Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
#include <stdlib.h>
int n;
int a[100005];
int k;
int main()
{
scanf("%d", &n);
for (int i = 0; i < n; i++) {
int tmp;
scanf("%d", &tmp);
if (a[tmp] == 0) {
k++;
a[tmp] = 1;
}
}
if (k & 1) {
printf("%d\n", k);
}
else {
printf("%d\n", k - 1);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154227/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154227/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@a = dso_local local_unnamed_addr global [100005 x i32] zeroinitializer, align 16
@k = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%tmp = alloca i32, align 4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end, %entry
%1 = load i32, ptr @k, align 4, !tbaa !5
%and = and i32 %1, 1
%sext = add nsw i32 %and, -1
%sub.sink = add nsw i32 %1, %sext
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
ret i32 0
for.body: ; preds = %entry, %if.end
%i.012 = phi i32 [ %inc5, %if.end ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp)
%2 = load i32, ptr %tmp, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%arrayidx = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %idxprom
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp2 = icmp eq i32 %3, 0
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %for.body
%4 = load i32, ptr @k, align 4, !tbaa !5
%inc = add nsw i32 %4, 1
store i32 %inc, ptr @k, align 4, !tbaa !5
store i32 1, ptr %arrayidx, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #3
%inc5 = add nuw nsw i32 %i.012, 1
%5 = load i32, ptr @n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc5, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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"}
|
/*1803115*/
#include <stdio.h>
int main()
{
char ch;
int x,c[26]= {0};
while(scanf("%c",&ch)!=EOF)
{
if(ch>='A' && ch<='Z')
{
x=ch-'A';
c[x]+=1;
}
else if(ch>='a' && ch<='z')
{
x=ch-'a';
c[x]+=1;
}
}
for(x=0,ch='a'; x<26; x++,ch++)
{
printf("%c : %d\n",ch,c[x]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154328/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154328/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%c = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %c) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %c, i8 0, i64 104, i1 false)
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not34 = icmp eq i32 %call33, -1
br i1 %cmp.not34, label %for.cond.preheader, label %while.body
for.cond.preheader.loopexit: ; preds = %if.end20
%.pre = load i32, ptr %c, align 16, !tbaa !5
%arrayidx25.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 1
%.pre37 = load i32, ptr %arrayidx25.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 2
%.pre38 = load i32, ptr %arrayidx25.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 3
%.pre39 = load i32, ptr %arrayidx25.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 4
%.pre40 = load i32, ptr %arrayidx25.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 5
%.pre41 = load i32, ptr %arrayidx25.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 6
%.pre42 = load i32, ptr %arrayidx25.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 7
%.pre43 = load i32, ptr %arrayidx25.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 8
%.pre44 = load i32, ptr %arrayidx25.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 9
%.pre45 = load i32, ptr %arrayidx25.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 10
%.pre46 = load i32, ptr %arrayidx25.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 11
%.pre47 = load i32, ptr %arrayidx25.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 12
%.pre48 = load i32, ptr %arrayidx25.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 13
%.pre49 = load i32, ptr %arrayidx25.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 14
%.pre50 = load i32, ptr %arrayidx25.14.phi.trans.insert, align 8, !tbaa !5
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry
%0 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
store i8 97, ptr %ch, align 1, !tbaa !9
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %14)
%15 = load i8, ptr %ch, align 1, !tbaa !9
%inc27 = add i8 %15, 1
store i8 %inc27, ptr %ch, align 1, !tbaa !9
%conv23.1 = sext i8 %inc27 to i32
%call26.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.1, i32 noundef %13)
%16 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.1 = add i8 %16, 1
store i8 %inc27.1, ptr %ch, align 1, !tbaa !9
%conv23.2 = sext i8 %inc27.1 to i32
%call26.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.2, i32 noundef %12)
%17 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.2 = add i8 %17, 1
store i8 %inc27.2, ptr %ch, align 1, !tbaa !9
%conv23.3 = sext i8 %inc27.2 to i32
%call26.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.3, i32 noundef %11)
%18 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.3 = add i8 %18, 1
store i8 %inc27.3, ptr %ch, align 1, !tbaa !9
%conv23.4 = sext i8 %inc27.3 to i32
%call26.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.4, i32 noundef %10)
%19 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.4 = add i8 %19, 1
store i8 %inc27.4, ptr %ch, align 1, !tbaa !9
%conv23.5 = sext i8 %inc27.4 to i32
%call26.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.5, i32 noundef %9)
%20 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.5 = add i8 %20, 1
store i8 %inc27.5, ptr %ch, align 1, !tbaa !9
%conv23.6 = sext i8 %inc27.5 to i32
%call26.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.6, i32 noundef %8)
%21 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.6 = add i8 %21, 1
store i8 %inc27.6, ptr %ch, align 1, !tbaa !9
%conv23.7 = sext i8 %inc27.6 to i32
%call26.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.7, i32 noundef %7)
%22 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.7 = add i8 %22, 1
store i8 %inc27.7, ptr %ch, align 1, !tbaa !9
%conv23.8 = sext i8 %inc27.7 to i32
%call26.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.8, i32 noundef %6)
%23 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.8 = add i8 %23, 1
store i8 %inc27.8, ptr %ch, align 1, !tbaa !9
%conv23.9 = sext i8 %inc27.8 to i32
%call26.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.9, i32 noundef %5)
%24 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.9 = add i8 %24, 1
store i8 %inc27.9, ptr %ch, align 1, !tbaa !9
%conv23.10 = sext i8 %inc27.9 to i32
%call26.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.10, i32 noundef %4)
%25 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.10 = add i8 %25, 1
store i8 %inc27.10, ptr %ch, align 1, !tbaa !9
%conv23.11 = sext i8 %inc27.10 to i32
%call26.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.11, i32 noundef %3)
%26 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.11 = add i8 %26, 1
store i8 %inc27.11, ptr %ch, align 1, !tbaa !9
%conv23.12 = sext i8 %inc27.11 to i32
%call26.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.12, i32 noundef %2)
%27 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.12 = add i8 %27, 1
store i8 %inc27.12, ptr %ch, align 1, !tbaa !9
%conv23.13 = sext i8 %inc27.12 to i32
%call26.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.13, i32 noundef %1)
%28 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.13 = add i8 %28, 1
store i8 %inc27.13, ptr %ch, align 1, !tbaa !9
%conv23.14 = sext i8 %inc27.13 to i32
%call26.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.14, i32 noundef %0)
%29 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.14 = add i8 %29, 1
store i8 %inc27.14, ptr %ch, align 1, !tbaa !9
%conv23.15 = sext i8 %inc27.14 to i32
%arrayidx25.15 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 15
%30 = load i32, ptr %arrayidx25.15, align 4, !tbaa !5
%call26.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.15, i32 noundef %30)
%31 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.15 = add i8 %31, 1
store i8 %inc27.15, ptr %ch, align 1, !tbaa !9
%conv23.16 = sext i8 %inc27.15 to i32
%arrayidx25.16 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 16
%32 = load i32, ptr %arrayidx25.16, align 16, !tbaa !5
%call26.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.16, i32 noundef %32)
%33 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.16 = add i8 %33, 1
store i8 %inc27.16, ptr %ch, align 1, !tbaa !9
%conv23.17 = sext i8 %inc27.16 to i32
%arrayidx25.17 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 17
%34 = load i32, ptr %arrayidx25.17, align 4, !tbaa !5
%call26.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.17, i32 noundef %34)
%35 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.17 = add i8 %35, 1
store i8 %inc27.17, ptr %ch, align 1, !tbaa !9
%conv23.18 = sext i8 %inc27.17 to i32
%arrayidx25.18 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 18
%36 = load i32, ptr %arrayidx25.18, align 8, !tbaa !5
%call26.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.18, i32 noundef %36)
%37 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.18 = add i8 %37, 1
store i8 %inc27.18, ptr %ch, align 1, !tbaa !9
%conv23.19 = sext i8 %inc27.18 to i32
%arrayidx25.19 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 19
%38 = load i32, ptr %arrayidx25.19, align 4, !tbaa !5
%call26.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.19, i32 noundef %38)
%39 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.19 = add i8 %39, 1
store i8 %inc27.19, ptr %ch, align 1, !tbaa !9
%conv23.20 = sext i8 %inc27.19 to i32
%arrayidx25.20 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 20
%40 = load i32, ptr %arrayidx25.20, align 16, !tbaa !5
%call26.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.20, i32 noundef %40)
%41 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.20 = add i8 %41, 1
store i8 %inc27.20, ptr %ch, align 1, !tbaa !9
%conv23.21 = sext i8 %inc27.20 to i32
%arrayidx25.21 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 21
%42 = load i32, ptr %arrayidx25.21, align 4, !tbaa !5
%call26.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.21, i32 noundef %42)
%43 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.21 = add i8 %43, 1
store i8 %inc27.21, ptr %ch, align 1, !tbaa !9
%conv23.22 = sext i8 %inc27.21 to i32
%arrayidx25.22 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 22
%44 = load i32, ptr %arrayidx25.22, align 8, !tbaa !5
%call26.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.22, i32 noundef %44)
%45 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.22 = add i8 %45, 1
store i8 %inc27.22, ptr %ch, align 1, !tbaa !9
%conv23.23 = sext i8 %inc27.22 to i32
%arrayidx25.23 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 23
%46 = load i32, ptr %arrayidx25.23, align 4, !tbaa !5
%call26.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.23, i32 noundef %46)
%47 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.23 = add i8 %47, 1
store i8 %inc27.23, ptr %ch, align 1, !tbaa !9
%conv23.24 = sext i8 %inc27.23 to i32
%arrayidx25.24 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 24
%48 = load i32, ptr %arrayidx25.24, align 16, !tbaa !5
%call26.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.24, i32 noundef %48)
%49 = load i8, ptr %ch, align 1, !tbaa !9
%inc27.24 = add i8 %49, 1
store i8 %inc27.24, ptr %ch, align 1, !tbaa !9
%conv23.25 = sext i8 %inc27.24 to i32
%arrayidx25.25 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 25
%50 = load i32, ptr %arrayidx25.25, align 4, !tbaa !5
%call26.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.25, i32 noundef %50)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
ret i32 0
while.body: ; preds = %entry, %if.end20
%51 = load i8, ptr %ch, align 1
%conv = sext i8 %51 to i64
%52 = add i8 %51, -65
%or.cond = icmp ult i8 %52, 26
br i1 %or.cond, label %if.end20.sink.split, label %if.else
if.else: ; preds = %while.body
%53 = add i8 %51, -97
%or.cond28 = icmp ult i8 %53, 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 [ 4294967231, %while.body ], [ 4294967199, %if.else ]
%sub = add nsw i64 %.sink, %conv
%idxprom = and i64 %sub, 4294967295
%arrayidx = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %idxprom
%54 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add19 = add nsw i32 %54, 1
store i32 %add19, 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 !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 a[26],i,j;
char ch;
for(i=0;i<26;i++) a[i]=0;
while(1){
if(scanf("%c",&ch)==EOF) break;
if(('A'<=ch)&&(ch<='Z')) ch+=('a'-'A');
if(('a'<=ch)&&(ch<='z')) a[ch-'a']++;
}
for(i=0;i<26;i++) printf("%c : %d\n",i+'a',a[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154371/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154371/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca [26 x i32], align 16
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %a, i8 0, i64 104, i1 false), !tbaa !5
%call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp144 = icmp eq i32 %call43, -1
br i1 %cmp144, label %for.cond24.preheader, label %if.end
for.cond24.preheader.loopexit: ; preds = %if.end23
%.pre = load i32, ptr %a, align 16, !tbaa !5
%arrayidx30.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 1
%.pre49 = load i32, ptr %arrayidx30.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 2
%.pre50 = load i32, ptr %arrayidx30.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx30.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 3
%.pre51 = load i32, ptr %arrayidx30.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 4
%.pre52 = load i32, ptr %arrayidx30.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx30.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 5
%.pre53 = load i32, ptr %arrayidx30.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 6
%.pre54 = load i32, ptr %arrayidx30.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx30.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 7
%.pre55 = load i32, ptr %arrayidx30.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 8
%.pre56 = load i32, ptr %arrayidx30.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx30.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 9
%.pre57 = load i32, ptr %arrayidx30.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 10
%.pre58 = load i32, ptr %arrayidx30.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx30.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 11
%.pre59 = load i32, ptr %arrayidx30.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 12
%.pre60 = load i32, ptr %arrayidx30.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx30.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 13
%.pre61 = load i32, ptr %arrayidx30.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 14
%.pre62 = load i32, ptr %arrayidx30.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx30.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 15
%.pre63 = load i32, ptr %arrayidx30.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 16
%.pre64 = load i32, ptr %arrayidx30.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx30.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 17
%.pre65 = load i32, ptr %arrayidx30.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 18
%.pre66 = load i32, ptr %arrayidx30.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx30.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 19
%.pre67 = load i32, ptr %arrayidx30.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 20
%.pre68 = load i32, ptr %arrayidx30.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx30.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 21
%.pre69 = load i32, ptr %arrayidx30.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 22
%.pre70 = load i32, ptr %arrayidx30.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx30.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 23
%.pre71 = load i32, ptr %arrayidx30.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx30.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 24
%.pre72 = load i32, ptr %arrayidx30.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx30.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 25
%.pre73 = load i32, ptr %arrayidx30.25.phi.trans.insert, align 4, !tbaa !5
br label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.cond24.preheader.loopexit, %entry
%0 = phi i32 [ %.pre73, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre72, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre71, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre70, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre69, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre68, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre67, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre66, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre65, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre64, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre63, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre62, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre61, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre60, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre59, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre58, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre57, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre56, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre55, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre54, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre53, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre52, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre51, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre50, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre49, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond24.preheader.loopexit ], [ 0, %entry ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call31.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call31.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call31.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call31.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call31.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call31.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call31.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call31.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call31.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call31.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call31.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call31.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call31.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call31.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call31.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call31.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call31.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call31.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call31.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call31.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call31.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call31.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call31.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call31.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call31.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 %a) #4
ret i32 0
if.end: ; preds = %entry, %if.end23
%26 = load i8, ptr %ch, align 1
%27 = add i8 %26, -65
%or.cond = icmp ult i8 %27, 26
br i1 %or.cond, label %if.then7, label %if.end10
if.then7: ; preds = %if.end
%add = add nuw nsw i8 %26, 32
store i8 %add, ptr %ch, align 1, !tbaa !9
br label %if.end10
if.end10: ; preds = %if.then7, %if.end
%28 = phi i8 [ %add, %if.then7 ], [ %26, %if.end ]
%29 = add i8 %28, -97
%or.cond35 = icmp ult i8 %29, 26
br i1 %or.cond35, label %if.then18, label %if.end23
if.then18: ; preds = %if.end10
%conv11 = zext i8 %28 to i64
%sub = add nuw nsw i64 %conv11, 4294967199
%idxprom20 = and i64 %sub, 4294967295
%arrayidx21 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %idxprom20
%30 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%inc22 = add nsw i32 %30, 1
store i32 %inc22, ptr %arrayidx21, align 4, !tbaa !5
br label %if.end23
if.end23: ; preds = %if.then18, %if.end10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp1 = icmp eq i32 %call, -1
br i1 %cmp1, label %for.cond24.preheader.loopexit, label %if.end
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 = !{!7, !7, i64 0}
|
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void){
char c;
int data[256]={0},i;
while(1){
c = getchar();
//printf("%d",c);
if(isupper(c)){
c = tolower(c);
}
data[c]++;
if(c == EOF){
break;
}
}
for(i = 'a' ; i<='z';i++){
printf("%c : %d\n",i,data[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154429/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154429/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%data = alloca [256 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %data) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %data, i8 0, i64 1024, i1 false)
br label %while.cond
while.cond: ; preds = %if.end, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
%call1 = tail call ptr @__ctype_b_loc() #6
%1 = load ptr, ptr %call1, align 8, !tbaa !5
%sext = shl i32 %call.i, 24
%conv2 = ashr exact i32 %sext, 24
%idxprom = sext i32 %conv2 to i64
%arrayidx = getelementptr inbounds i16, ptr %1, i64 %idxprom
%2 = load i16, ptr %arrayidx, align 2, !tbaa !9
%3 = and i16 %2, 256
%tobool.not = icmp eq i16 %3, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.cond
%call4 = tail call ptr @__ctype_tolower_loc() #6
%4 = load ptr, ptr %call4, align 8, !tbaa !5
%arrayidx7 = getelementptr inbounds i32, ptr %4, i64 %idxprom
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !11
br label %if.end
if.end: ; preds = %if.then, %while.cond
%c.0.in = phi i32 [ %5, %if.then ], [ %call.i, %while.cond ]
%c.0 = zext i32 %c.0.in to i64
%sext28 = shl i64 %c.0, 56
%idxprom9 = ashr exact i64 %sext28, 56
%arrayidx10 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 %idxprom9
%6 = load i32, ptr %arrayidx10, align 4, !tbaa !11
%inc = add nsw i32 %6, 1
store i32 %inc, ptr %arrayidx10, align 4, !tbaa !11
%sext27.mask = and i32 %c.0.in, 255
%cmp = icmp eq i32 %sext27.mask, 255
br i1 %cmp, label %for.body.preheader, label %while.cond
for.body.preheader: ; preds = %if.end
%arrayidx18 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 97
%7 = load i32, ptr %arrayidx18, align 4, !tbaa !11
%call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %7)
%arrayidx18.1 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 98
%8 = load i32, ptr %arrayidx18.1, align 8, !tbaa !11
%call19.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %8)
%arrayidx18.2 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 99
%9 = load i32, ptr %arrayidx18.2, align 4, !tbaa !11
%call19.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %9)
%arrayidx18.3 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 100
%10 = load i32, ptr %arrayidx18.3, align 16, !tbaa !11
%call19.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %10)
%arrayidx18.4 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 101
%11 = load i32, ptr %arrayidx18.4, align 4, !tbaa !11
%call19.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %11)
%arrayidx18.5 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 102
%12 = load i32, ptr %arrayidx18.5, align 8, !tbaa !11
%call19.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %12)
%arrayidx18.6 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 103
%13 = load i32, ptr %arrayidx18.6, align 4, !tbaa !11
%call19.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %13)
%arrayidx18.7 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 104
%14 = load i32, ptr %arrayidx18.7, align 16, !tbaa !11
%call19.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %14)
%arrayidx18.8 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 105
%15 = load i32, ptr %arrayidx18.8, align 4, !tbaa !11
%call19.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %15)
%arrayidx18.9 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 106
%16 = load i32, ptr %arrayidx18.9, align 8, !tbaa !11
%call19.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %16)
%arrayidx18.10 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 107
%17 = load i32, ptr %arrayidx18.10, align 4, !tbaa !11
%call19.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %17)
%arrayidx18.11 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 108
%18 = load i32, ptr %arrayidx18.11, align 16, !tbaa !11
%call19.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %18)
%arrayidx18.12 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 109
%19 = load i32, ptr %arrayidx18.12, align 4, !tbaa !11
%call19.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %19)
%arrayidx18.13 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 110
%20 = load i32, ptr %arrayidx18.13, align 8, !tbaa !11
%call19.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %20)
%arrayidx18.14 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 111
%21 = load i32, ptr %arrayidx18.14, align 4, !tbaa !11
%call19.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %21)
%arrayidx18.15 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 112
%22 = load i32, ptr %arrayidx18.15, align 16, !tbaa !11
%call19.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %22)
%arrayidx18.16 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 113
%23 = load i32, ptr %arrayidx18.16, align 4, !tbaa !11
%call19.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %23)
%arrayidx18.17 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 114
%24 = load i32, ptr %arrayidx18.17, align 8, !tbaa !11
%call19.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %24)
%arrayidx18.18 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 115
%25 = load i32, ptr %arrayidx18.18, align 4, !tbaa !11
%call19.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %25)
%arrayidx18.19 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 116
%26 = load i32, ptr %arrayidx18.19, align 16, !tbaa !11
%call19.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %26)
%arrayidx18.20 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 117
%27 = load i32, ptr %arrayidx18.20, align 4, !tbaa !11
%call19.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %27)
%arrayidx18.21 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 118
%28 = load i32, ptr %arrayidx18.21, align 8, !tbaa !11
%call19.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %28)
%arrayidx18.22 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 119
%29 = load i32, ptr %arrayidx18.22, align 4, !tbaa !11
%call19.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %29)
%arrayidx18.23 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 120
%30 = load i32, ptr %arrayidx18.23, align 16, !tbaa !11
%call19.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %30)
%arrayidx18.24 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 121
%31 = load i32, ptr %arrayidx18.24, align 4, !tbaa !11
%call19.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %31)
%arrayidx18.25 = getelementptr inbounds [256 x i32], ptr %data, i64 0, i64 122
%32 = load i32, ptr %arrayidx18.25, align 8, !tbaa !11
%call19.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %32)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %data) #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: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_tolower_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture 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 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
|
#include<stdio.h>
#include<string.h>
int main(){
int i = 0, num[26] = {0};
char c;
while(scanf("%c", &c) != EOF){
if((c >= 65) && (c <= 90)){
num[(c - 65)]++;
} else if((c >= 97) && (c <= 122)){
num[c - 97]++;
}
i++;
}
for(i = 0; i < 26; i++){
printf("%c : %d\n", i + 97, num[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%num = alloca [26 x i32], align 16
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %num) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %num, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not34 = icmp eq i32 %call33, -1
br i1 %cmp.not34, label %for.cond.preheader, 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 [26 x i32], ptr %num, i64 0, i64 1
%.pre38 = load i32, ptr %arrayidx25.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 2
%.pre39 = load i32, ptr %arrayidx25.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 3
%.pre40 = load i32, ptr %arrayidx25.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 4
%.pre41 = load i32, ptr %arrayidx25.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 5
%.pre42 = load i32, ptr %arrayidx25.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 6
%.pre43 = load i32, ptr %arrayidx25.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 7
%.pre44 = load i32, ptr %arrayidx25.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 8
%.pre45 = load i32, ptr %arrayidx25.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 9
%.pre46 = load i32, ptr %arrayidx25.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 10
%.pre47 = load i32, ptr %arrayidx25.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 11
%.pre48 = load i32, ptr %arrayidx25.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 12
%.pre49 = load i32, ptr %arrayidx25.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 13
%.pre50 = load i32, ptr %arrayidx25.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 14
%.pre51 = load i32, ptr %arrayidx25.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 15
%.pre52 = load i32, ptr %arrayidx25.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 16
%.pre53 = load i32, ptr %arrayidx25.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 17
%.pre54 = load i32, ptr %arrayidx25.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 18
%.pre55 = load i32, ptr %arrayidx25.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 19
%.pre56 = load i32, ptr %arrayidx25.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 20
%.pre57 = load i32, ptr %arrayidx25.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 21
%.pre58 = load i32, ptr %arrayidx25.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 22
%.pre59 = load i32, ptr %arrayidx25.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 23
%.pre60 = load i32, ptr %arrayidx25.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 24
%.pre61 = load i32, ptr %arrayidx25.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 25
%.pre62 = load i32, ptr %arrayidx25.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 [ %.pre62, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre61, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call26.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call26.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call26.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call26.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call26.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call26.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call26.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call26.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call26.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call26.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call26.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call26.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call26.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call26.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call26.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call26.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call26.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call26.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call26.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call26.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call26.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call26.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call26.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call26.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call26.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 %num) #4
ret i32 0
while.body: ; preds = %entry, %if.end20
%26 = load i8, ptr %c, align 1
%conv = sext i8 %26 to i64
%27 = add i8 %26, -65
%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, -97
%or.cond28 = icmp ult i8 %28, 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 [ 4294967231, %while.body ], [ 4294967199, %if.else ]
%sub = add nsw i64 %.sink, %conv
%idxprom = and i64 %sub, 4294967295
%arrayidx = getelementptr inbounds [26 x i32], ptr %num, 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 %c)
%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(void) {
char c;
int suu[26]= {0},i,j;
while(scanf("%c", &c) != EOF){
for (j=0; j<26; j++){
if(c == 'a'+j || c == 'A'+j){
suu[j]++;
}
}
}
for(i=0; i<26; i++){
printf("%c : %d\n", 'a'+i, suu[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154559/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154559/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%c = alloca i8, align 1
%suu = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %suu) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %suu, i8 0, i64 104, i1 false)
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not29 = icmp eq i32 %call28, -1
br i1 %cmp.not29, label %for.cond9.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 %c)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond9.preheader.loopexit, label %for.cond.preheader, !llvm.loop !5
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%0 = load i8, ptr %c, align 1, !tbaa !7
%conv = sext i8 %0 to i64
%1 = and i64 %conv, 4294967295
br label %for.body
for.cond9.preheader.loopexit: ; preds = %while.cond.loopexit
%.pre = load i32, ptr %suu, align 16, !tbaa !10
%arrayidx15.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 1
%.pre39 = load i32, ptr %arrayidx15.1.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 2
%.pre40 = load i32, ptr %arrayidx15.2.phi.trans.insert, align 8, !tbaa !10
%arrayidx15.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 3
%.pre41 = load i32, ptr %arrayidx15.3.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 4
%.pre42 = load i32, ptr %arrayidx15.4.phi.trans.insert, align 16, !tbaa !10
%arrayidx15.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 5
%.pre43 = load i32, ptr %arrayidx15.5.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 6
%.pre44 = load i32, ptr %arrayidx15.6.phi.trans.insert, align 8, !tbaa !10
%arrayidx15.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 7
%.pre45 = load i32, ptr %arrayidx15.7.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 8
%.pre46 = load i32, ptr %arrayidx15.8.phi.trans.insert, align 16, !tbaa !10
%arrayidx15.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 9
%.pre47 = load i32, ptr %arrayidx15.9.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 10
%.pre48 = load i32, ptr %arrayidx15.10.phi.trans.insert, align 8, !tbaa !10
%arrayidx15.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 11
%.pre49 = load i32, ptr %arrayidx15.11.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 12
%.pre50 = load i32, ptr %arrayidx15.12.phi.trans.insert, align 16, !tbaa !10
%arrayidx15.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 13
%.pre51 = load i32, ptr %arrayidx15.13.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 14
%.pre52 = load i32, ptr %arrayidx15.14.phi.trans.insert, align 8, !tbaa !10
%arrayidx15.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 15
%.pre53 = load i32, ptr %arrayidx15.15.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 16
%.pre54 = load i32, ptr %arrayidx15.16.phi.trans.insert, align 16, !tbaa !10
%arrayidx15.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 17
%.pre55 = load i32, ptr %arrayidx15.17.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 18
%.pre56 = load i32, ptr %arrayidx15.18.phi.trans.insert, align 8, !tbaa !10
%arrayidx15.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 19
%.pre57 = load i32, ptr %arrayidx15.19.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 20
%.pre58 = load i32, ptr %arrayidx15.20.phi.trans.insert, align 16, !tbaa !10
%arrayidx15.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 21
%.pre59 = load i32, ptr %arrayidx15.21.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 22
%.pre60 = load i32, ptr %arrayidx15.22.phi.trans.insert, align 8, !tbaa !10
%arrayidx15.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 23
%.pre61 = load i32, ptr %arrayidx15.23.phi.trans.insert, align 4, !tbaa !10
%arrayidx15.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 24
%.pre62 = load i32, ptr %arrayidx15.24.phi.trans.insert, align 16, !tbaa !10
%arrayidx15.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %suu, i64 0, i64 25
%.pre63 = load i32, ptr %arrayidx15.25.phi.trans.insert, align 4, !tbaa !10
br label %for.cond9.preheader
for.cond9.preheader: ; preds = %for.cond9.preheader.loopexit, %entry
%2 = phi i32 [ %.pre63, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre62, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre61, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre60, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre59, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre58, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre57, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre56, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre55, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre54, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre53, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre52, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre51, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre50, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre49, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre48, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre47, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre46, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre45, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre44, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre43, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre42, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre41, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre40, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%26 = phi i32 [ %.pre39, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%27 = phi i32 [ %.pre, %for.cond9.preheader.loopexit ], [ 0, %entry ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %27)
%call16.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %26)
%call16.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %25)
%call16.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %24)
%call16.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %23)
%call16.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %22)
%call16.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %21)
%call16.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %20)
%call16.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %19)
%call16.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %18)
%call16.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %17)
%call16.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %16)
%call16.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %15)
%call16.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %14)
%call16.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %13)
%call16.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %12)
%call16.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %11)
%call16.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %10)
%call16.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %9)
%call16.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %8)
%call16.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %7)
%call16.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %6)
%call16.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %5)
%call16.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %4)
%call16.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %3)
%call16.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 %suu) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #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 %suu, i64 0, i64 %indvars.iv
%30 = load i32, ptr %arrayidx, align 8, !tbaa !10
%inc = add nsw i32 %30, 1
store i32 %inc, 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 %suu, i64 0, i64 %indvars.iv.next
%33 = load i32, ptr %arrayidx.1, align 4, !tbaa !10
%inc.1 = add nsw i32 %33, 1
store i32 %inc.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>
int main(void){
char ch;
int num[26] = {0};
int i;
while ( scanf("%c", &ch) != EOF ){
//scanf("%c",&ch);
for(i=0;i<26;i++){
if(ch==i+65){
num[i]++;
break;
}else if(ch==i+97){
num[i]++;
break;
}
}
}
for(i=0;i<26;i++){
printf("%c : %d\n",i+97,num[i]);
}
return 0; /*0?????????*/
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154601/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154601/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@switch.table.main = private unnamed_addr constant [53 x i64] [i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 17, i64 18, i64 19, i64 20, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 17, i64 18, i64 19, i64 20], align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ch = alloca i8, align 1
%num = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %num) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %num, i8 0, i64 104, i1 false)
%call37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not38 = icmp eq i32 %call37, -1
br i1 %cmp.not38, label %for.cond14.preheader, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%0 = load i8, ptr %ch, align 1, !tbaa !5
%switch.tableidx = add i8 %0, -65
%1 = icmp ult i8 %switch.tableidx, 53
br i1 %1, label %switch.hole_check, label %for.inc.20
for.cond14.preheader.loopexit: ; preds = %for.end
%.pre = load i32, ptr %num, align 16, !tbaa !8
%arrayidx20.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 1
%.pre44 = load i32, ptr %arrayidx20.1.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 2
%.pre45 = load i32, ptr %arrayidx20.2.phi.trans.insert, align 8, !tbaa !8
%arrayidx20.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 3
%.pre46 = load i32, ptr %arrayidx20.3.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 4
%.pre47 = load i32, ptr %arrayidx20.4.phi.trans.insert, align 16, !tbaa !8
%arrayidx20.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 5
%.pre48 = load i32, ptr %arrayidx20.5.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 6
%.pre49 = load i32, ptr %arrayidx20.6.phi.trans.insert, align 8, !tbaa !8
%arrayidx20.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 7
%.pre50 = load i32, ptr %arrayidx20.7.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 8
%.pre51 = load i32, ptr %arrayidx20.8.phi.trans.insert, align 16, !tbaa !8
%arrayidx20.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 9
%.pre52 = load i32, ptr %arrayidx20.9.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 10
%.pre53 = load i32, ptr %arrayidx20.10.phi.trans.insert, align 8, !tbaa !8
%arrayidx20.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 11
%.pre54 = load i32, ptr %arrayidx20.11.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 12
%.pre55 = load i32, ptr %arrayidx20.12.phi.trans.insert, align 16, !tbaa !8
%arrayidx20.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 13
%.pre56 = load i32, ptr %arrayidx20.13.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 14
%.pre57 = load i32, ptr %arrayidx20.14.phi.trans.insert, align 8, !tbaa !8
%arrayidx20.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 15
%.pre58 = load i32, ptr %arrayidx20.15.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 16
%.pre59 = load i32, ptr %arrayidx20.16.phi.trans.insert, align 16, !tbaa !8
%arrayidx20.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 17
%.pre60 = load i32, ptr %arrayidx20.17.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 18
%.pre61 = load i32, ptr %arrayidx20.18.phi.trans.insert, align 8, !tbaa !8
%arrayidx20.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 19
%.pre62 = load i32, ptr %arrayidx20.19.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 20
%.pre63 = load i32, ptr %arrayidx20.20.phi.trans.insert, align 16, !tbaa !8
%arrayidx20.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 21
%.pre64 = load i32, ptr %arrayidx20.21.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 22
%.pre65 = load i32, ptr %arrayidx20.22.phi.trans.insert, align 8, !tbaa !8
%arrayidx20.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 23
%.pre66 = load i32, ptr %arrayidx20.23.phi.trans.insert, align 4, !tbaa !8
%arrayidx20.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 24
%.pre67 = load i32, ptr %arrayidx20.24.phi.trans.insert, align 16, !tbaa !8
%arrayidx20.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 25
%.pre68 = load i32, ptr %arrayidx20.25.phi.trans.insert, align 4, !tbaa !8
br label %for.cond14.preheader
for.cond14.preheader: ; preds = %for.cond14.preheader.loopexit, %entry
%2 = phi i32 [ %.pre68, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre67, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre66, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre65, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre64, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre63, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre62, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre61, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre60, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre59, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre58, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre57, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre56, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre55, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre54, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre53, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre52, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre51, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre50, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre49, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre48, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre47, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre46, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre45, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%26 = phi i32 [ %.pre44, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%27 = phi i32 [ %.pre, %for.cond14.preheader.loopexit ], [ 0, %entry ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %27)
%call21.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %26)
%call21.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %25)
%call21.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %24)
%call21.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %23)
%call21.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %22)
%call21.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %21)
%call21.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %20)
%call21.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %19)
%call21.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %18)
%call21.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %17)
%call21.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %16)
%call21.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %15)
%call21.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %14)
%call21.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %13)
%call21.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %12)
%call21.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %11)
%call21.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %10)
%call21.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %9)
%call21.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %8)
%call21.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %7)
%call21.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %6)
%call21.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %5)
%call21.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %4)
%call21.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %3)
%call21.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 %num) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
ret i32 0
if.then.fold.split107: ; preds = %for.inc.20
br label %for.end.sink.split
if.then.fold.split109: ; preds = %for.inc.20
br label %for.end.sink.split
if.then.fold.split111: ; preds = %for.inc.20
br label %for.end.sink.split
if.then.fold.split113: ; preds = %for.inc.20
br label %for.end.sink.split
if.then8.fold.split108: ; preds = %for.inc.20
br label %for.end.sink.split
if.then8.fold.split110: ; preds = %for.inc.20
br label %for.end.sink.split
if.then8.fold.split112: ; preds = %for.inc.20
br label %for.end.sink.split
if.then8.fold.split114: ; preds = %for.inc.20
br label %for.end.sink.split
for.inc.20: ; preds = %switch.hole_check, %for.cond.preheader
switch i8 %0, label %for.end [
i8 86, label %for.end.sink.split
i8 118, label %for.end.sink.split
i8 87, label %if.then.fold.split107
i8 119, label %if.then8.fold.split108
i8 88, label %if.then.fold.split109
i8 120, label %if.then8.fold.split110
i8 89, label %if.then.fold.split111
i8 121, label %if.then8.fold.split112
i8 90, label %if.then.fold.split113
i8 122, label %if.then8.fold.split114
]
switch.hole_check: ; preds = %for.cond.preheader
%switch.maskindex = zext i8 %switch.tableidx to i64
%switch.shifted = lshr i64 9007194961870847, %switch.maskindex
%28 = and i64 %switch.shifted, 1
%switch.lobit.not = icmp eq i64 %28, 0
br i1 %switch.lobit.not, label %for.inc.20, label %switch.lookup
switch.lookup: ; preds = %switch.hole_check
%29 = sext i8 %switch.tableidx to i64
%switch.gep = getelementptr inbounds [53 x i64], ptr @switch.table.main, i64 0, i64 %29
%switch.load = load i64, ptr %switch.gep, align 8
br label %for.end.sink.split
for.end.sink.split: ; preds = %switch.lookup, %if.then8.fold.split108, %if.then8.fold.split110, %if.then8.fold.split112, %if.then8.fold.split114, %for.inc.20, %if.then.fold.split107, %if.then.fold.split109, %if.then.fold.split111, %if.then.fold.split113, %for.inc.20
%i.036.lcssa.sink = phi i64 [ 21, %for.inc.20 ], [ 22, %if.then.fold.split107 ], [ 23, %if.then.fold.split109 ], [ 24, %if.then.fold.split111 ], [ 25, %if.then.fold.split113 ], [ 21, %for.inc.20 ], [ 22, %if.then8.fold.split108 ], [ 23, %if.then8.fold.split110 ], [ 24, %if.then8.fold.split112 ], [ 25, %if.then8.fold.split114 ], [ %switch.load, %switch.lookup ]
%arrayidx = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 %i.036.lcssa.sink
%30 = load i32, ptr %arrayidx, align 4, !tbaa !8
%inc11 = add nsw i32 %30, 1
store i32 %inc11, ptr %arrayidx, align 4, !tbaa !8
br label %for.end
for.end: ; preds = %for.end.sink.split, %for.inc.20
%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.cond14.preheader.loopexit, label %for.cond.preheader, !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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int a,b,c,n,m,i,j,k,l,d[1000][2],t[2];
scanf("%d",&m);
//printf("%d",t);
char s[2005];
for(i=0;i<m;i++)
{
k=1;
scanf("%d",&n);
for(j=0;j<n;j++)
{
scanf("%d %d",&d[j][0],&d[j][1]);
}
for(j=0;j<n-1;j++)
{
for(k=0;k<n-1-j;k++)
{
if(d[k][0]>d[k+1][0])
{
t[0]=d[k][0];
t[1]=d[k][1];
d[k][0]=d[k+1][0];
d[k][1]=d[k+1][1];
d[k+1][0]=t[0];
d[k+1][1]=t[1];
}
else if(d[k][0]==d[k+1][0]&&d[k][1]>d[k+1][1])
{
t[0]=d[k][0];
t[1]=d[k][1];
d[k][0]=d[k+1][0];
d[k][1]=d[k+1][1];
d[k+1][0]=t[0];
d[k+1][1]=t[1];
}
}
}
k=1;
int val=0,u=0,r=0;
for(j=0;j<d[0][0];j++) s[j]='R';
val=r=d[0][0];
for(j=0;j<d[0][1];j++) s[j+val]='U';
u=d[0][1];
val+=u;
for(j=1;j<n;j++)
{
if(d[j][0]<r||d[j][1]<u)
{
k=0;
break;
}
for(l=r;l<d[j][0];l++) s[val+l-r]='R';
val+=(d[j][0]-r);
r=d[j][0];
for(l=u;l<d[j][1];l++) s[val+l-u]='U';
val+=d[j][1]-u;
u=d[j][1];
}
// printf("%d",val);
if(k==0) printf("NO\n");
else
{
printf("YES\n");
for(j=0;j<val;j++) printf("%c",s[j]);
printf("\n");
}
// printf("11\n");
}
// your code goes here
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15466/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15466/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.6 = 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
%m = alloca i32, align 4
%d = alloca [1000 x [2 x i32]], align 16
%s = alloca [2005 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 8000, ptr nonnull %d) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
call void @llvm.lifetime.start.p0(i64 2005, ptr nonnull %s) #5
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp324 = icmp sgt i32 %0, 0
br i1 %cmp324, label %for.body.lr.ph, label %for.end215
for.body.lr.ph: ; preds = %entry
%arrayidx127 = getelementptr inbounds [2 x i32], ptr %d, i64 0, i64 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end212
%i.0325 = phi i32 [ 0, %for.body.lr.ph ], [ %inc214, %if.end212 ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp3298 = icmp sgt i32 %1, 0
br i1 %cmp3298, label %for.body4, label %for.cond113.preheader
for.cond10.preheader: ; preds = %for.body4
%sub = add i32 %2, -1
%cmp11302 = icmp sgt i32 %2, 1
br i1 %cmp11302, label %for.cond13.preheader, label %for.cond113.preheader
for.body4: ; preds = %for.body, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ]
%arrayidx = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv
%arrayidx8 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv, i64 1
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx8)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp3, label %for.body4, label %for.cond10.preheader, !llvm.loop !9
for.cond113.preheader: ; preds = %for.inc110, %for.body, %for.cond10.preheader
%cmp11302366 = phi i1 [ false, %for.cond10.preheader ], [ false, %for.body ], [ %cmp11302, %for.inc110 ]
%.lcssa365 = phi i32 [ %2, %for.cond10.preheader ], [ %1, %for.body ], [ %2, %for.inc110 ]
%4 = load i32, ptr %d, align 16, !tbaa !5
%cmp116304 = icmp sgt i32 %4, 0
br i1 %cmp116304, label %for.body117.preheader, label %for.cond125.preheader
for.body117.preheader: ; preds = %for.cond113.preheader
%5 = zext i32 %4 to i64
call void @llvm.memset.p0.i64(ptr nonnull align 16 %s, i8 82, i64 %5, i1 false), !tbaa !11
br label %for.cond125.preheader
for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc110
%indvars.iv331 = phi i32 [ %indvars.iv.next332, %for.inc110 ], [ %sub, %for.cond10.preheader ]
%j.1303 = phi i32 [ %inc111, %for.inc110 ], [ 0, %for.cond10.preheader ]
%6 = xor i32 %j.1303, -1
%sub15 = add i32 %2, %6
%cmp16300 = icmp sgt i32 %sub15, 0
br i1 %cmp16300, label %for.body17.preheader, label %for.inc110
for.body17.preheader: ; preds = %for.cond13.preheader
%wide.trip.count = zext i32 %indvars.iv331 to i64
%.pre = load i32, ptr %d, align 16, !tbaa !5
br label %for.body17
for.body17: ; preds = %for.body17.preheader, %for.inc107
%7 = phi i32 [ %.pre, %for.body17.preheader ], [ %13, %for.inc107 ]
%indvars.iv328 = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next329, %for.inc107 ]
%arrayidx19 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv328
%indvars.iv.next329 = add nuw nsw i64 %indvars.iv328, 1
%arrayidx22 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv.next329
%8 = load i32, ptr %arrayidx22, align 8, !tbaa !5
%cmp24 = icmp sgt i32 %7, %8
br i1 %cmp24, label %if.then, label %if.else
if.then: ; preds = %for.body17
%arrayidx31 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv328, i64 1
%9 = load i32, ptr %arrayidx31, align 4, !tbaa !5
store i32 %8, ptr %arrayidx19, align 8, !tbaa !5
%arrayidx43 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv.next329, i64 1
%10 = load i32, ptr %arrayidx43, align 4, !tbaa !5
store i32 %10, ptr %arrayidx31, align 4, !tbaa !5
store i32 %7, ptr %arrayidx22, align 8, !tbaa !5
store i32 %9, ptr %arrayidx43, align 4, !tbaa !5
br label %for.inc107
if.else: ; preds = %for.body17
%cmp64 = icmp eq i32 %7, %8
br i1 %cmp64, label %land.lhs.true, label %for.inc107
land.lhs.true: ; preds = %if.else
%arrayidx67 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv328, i64 1
%11 = load i32, ptr %arrayidx67, align 4, !tbaa !5
%arrayidx71 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv.next329, i64 1
%12 = load i32, ptr %arrayidx71, align 4, !tbaa !5
%cmp72 = icmp sgt i32 %11, %12
br i1 %cmp72, label %if.then73, label %for.inc107
if.then73: ; preds = %land.lhs.true
store i32 %7, ptr %arrayidx19, align 8, !tbaa !5
store i32 %12, ptr %arrayidx67, align 4, !tbaa !5
store i32 %7, ptr %arrayidx22, align 8, !tbaa !5
store i32 %11, ptr %arrayidx71, align 4, !tbaa !5
br label %for.inc107
for.inc107: ; preds = %if.then, %if.then73, %land.lhs.true, %if.else
%13 = phi i32 [ %7, %if.then ], [ %7, %if.then73 ], [ %7, %land.lhs.true ], [ %8, %if.else ]
%exitcond.not = icmp eq i64 %indvars.iv.next329, %wide.trip.count
br i1 %exitcond.not, label %for.inc110, label %for.body17, !llvm.loop !12
for.inc110: ; preds = %for.inc107, %for.cond13.preheader
%inc111 = add nuw nsw i32 %j.1303, 1
%indvars.iv.next332 = add i32 %indvars.iv331, -1
%exitcond333.not = icmp eq i32 %inc111, %sub
br i1 %exitcond333.not, label %for.cond113.preheader, label %for.cond13.preheader, !llvm.loop !13
for.cond125.preheader: ; preds = %for.body117.preheader, %for.cond113.preheader
%14 = load i32, ptr %arrayidx127, align 4, !tbaa !5
%cmp128307 = icmp sgt i32 %14, 0
br i1 %cmp128307, label %for.body129.preheader, label %for.end135
for.body129.preheader: ; preds = %for.cond125.preheader
%15 = sext i32 %4 to i64
%scevgep = getelementptr i8, ptr %s, i64 %15
%16 = zext i32 %14 to i64
call void @llvm.memset.p0.i64(ptr align 1 %scevgep, i8 85, i64 %16, i1 false), !tbaa !11
br label %for.end135
for.end135: ; preds = %for.body129.preheader, %for.cond125.preheader
%add138 = add nsw i32 %14, %4
br i1 %cmp11302366, label %for.body141.preheader, label %if.else200
for.body141.preheader: ; preds = %for.end135
%wide.trip.count354 = zext i32 %.lcssa365 to i64
br label %for.body141
for.body141: ; preds = %for.body141.preheader, %for.end185
%indvars.iv351 = phi i64 [ 1, %for.body141.preheader ], [ %indvars.iv.next352, %for.end185 ]
%r.0319 = phi i32 [ %4, %for.body141.preheader ], [ %17, %for.end185 ]
%u.0318 = phi i32 [ %14, %for.body141.preheader ], [ %18, %for.end185 ]
%val.0317 = phi i32 [ %add138, %for.body141.preheader ], [ %add190, %for.end185 ]
%arrayidx143 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv351
%17 = load i32, ptr %arrayidx143, align 8, !tbaa !5
%cmp145 = icmp slt i32 %17, %r.0319
br i1 %cmp145, label %if.then198, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body141
%arrayidx148 = getelementptr inbounds [1000 x [2 x i32]], ptr %d, i64 0, i64 %indvars.iv351, i64 1
%18 = load i32, ptr %arrayidx148, align 4, !tbaa !5
%cmp149 = icmp slt i32 %18, %u.0318
br i1 %cmp149, label %if.then198, label %for.cond152.preheader
for.cond152.preheader: ; preds = %lor.lhs.false
%cmp156310 = icmp slt i32 %r.0319, %17
br i1 %cmp156310, label %iter.check379, label %for.end164
iter.check379: ; preds = %for.cond152.preheader
%add158 = sub i32 %val.0317, %r.0319
%19 = sext i32 %r.0319 to i64
%wide.trip.count344 = sext i32 %17 to i64
%20 = sub nsw i64 %wide.trip.count344, %19
%min.iters.check377 = icmp ult i64 %20, 8
br i1 %min.iters.check377, label %for.body157.preheader, label %vector.scevcheck375
vector.scevcheck375: ; preds = %iter.check379
%21 = xor i64 %19, -1
%22 = add nsw i64 %21, %wide.trip.count344
%23 = trunc i64 %22 to i32
%24 = add i32 %val.0317, %23
%25 = icmp slt i32 %24, %val.0317
%26 = icmp ugt i64 %22, 4294967295
%27 = or i1 %25, %26
br i1 %27, label %for.body157.preheader, label %vector.main.loop.iter.check381
vector.main.loop.iter.check381: ; preds = %vector.scevcheck375
%min.iters.check380 = icmp ult i64 %20, 32
br i1 %min.iters.check380, label %vec.epilog.ph393, label %vector.ph382
vector.ph382: ; preds = %vector.main.loop.iter.check381
%n.vec384 = and i64 %20, -32
br label %vector.body386
vector.body386: ; preds = %vector.body386, %vector.ph382
%index387 = phi i64 [ 0, %vector.ph382 ], [ %index.next389, %vector.body386 ]
%28 = trunc i64 %index387 to i32
%29 = add i32 %val.0317, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %30
store <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>, ptr %31, align 1, !tbaa !11
%32 = getelementptr inbounds i8, ptr %31, i64 16
store <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>, ptr %32, align 1, !tbaa !11
%index.next389 = add nuw i64 %index387, 32
%33 = icmp eq i64 %index.next389, %n.vec384
br i1 %33, label %middle.block376, label %vector.body386, !llvm.loop !14
middle.block376: ; preds = %vector.body386
%cmp.n385 = icmp eq i64 %20, %n.vec384
br i1 %cmp.n385, label %for.end164, label %vec.epilog.iter.check392
vec.epilog.iter.check392: ; preds = %middle.block376
%ind.end400 = add nsw i64 %n.vec384, %19
%n.vec.remaining394 = and i64 %20, 24
%min.epilog.iters.check395 = icmp eq i64 %n.vec.remaining394, 0
br i1 %min.epilog.iters.check395, label %for.body157.preheader, label %vec.epilog.ph393
vec.epilog.ph393: ; preds = %vector.main.loop.iter.check381, %vec.epilog.iter.check392
%vec.epilog.resume.val396 = phi i64 [ %n.vec384, %vec.epilog.iter.check392 ], [ 0, %vector.main.loop.iter.check381 ]
%n.vec398 = and i64 %20, -8
%ind.end399 = add nsw i64 %n.vec398, %19
br label %vec.epilog.vector.body403
vec.epilog.vector.body403: ; preds = %vec.epilog.vector.body403, %vec.epilog.ph393
%index404 = phi i64 [ %vec.epilog.resume.val396, %vec.epilog.ph393 ], [ %index.next406, %vec.epilog.vector.body403 ]
%34 = trunc i64 %index404 to i32
%35 = add i32 %val.0317, %34
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %36
store <8 x i8> <i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82>, ptr %37, align 1, !tbaa !11
%index.next406 = add nuw i64 %index404, 8
%38 = icmp eq i64 %index.next406, %n.vec398
br i1 %38, label %vec.epilog.middle.block390, label %vec.epilog.vector.body403, !llvm.loop !17
vec.epilog.middle.block390: ; preds = %vec.epilog.vector.body403
%cmp.n402 = icmp eq i64 %20, %n.vec398
br i1 %cmp.n402, label %for.end164, label %for.body157.preheader
for.body157.preheader: ; preds = %vector.scevcheck375, %iter.check379, %vec.epilog.iter.check392, %vec.epilog.middle.block390
%indvars.iv341.ph = phi i64 [ %19, %iter.check379 ], [ %19, %vector.scevcheck375 ], [ %ind.end400, %vec.epilog.iter.check392 ], [ %ind.end399, %vec.epilog.middle.block390 ]
%39 = sub nsw i64 %wide.trip.count344, %indvars.iv341.ph
%40 = xor i64 %indvars.iv341.ph, -1
%41 = add nsw i64 %40, %wide.trip.count344
%xtraiter = and i64 %39, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body157.prol.loopexit, label %for.body157.prol
for.body157.prol: ; preds = %for.body157.preheader, %for.body157.prol
%indvars.iv341.prol = phi i64 [ %indvars.iv.next342.prol, %for.body157.prol ], [ %indvars.iv341.ph, %for.body157.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body157.prol ], [ 0, %for.body157.preheader ]
%42 = trunc i64 %indvars.iv341.prol to i32
%sub159.prol = add i32 %add158, %42
%idxprom160.prol = sext i32 %sub159.prol to i64
%arrayidx161.prol = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom160.prol
store i8 82, ptr %arrayidx161.prol, align 1, !tbaa !11
%indvars.iv.next342.prol = add nsw i64 %indvars.iv341.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body157.prol.loopexit, label %for.body157.prol, !llvm.loop !18
for.body157.prol.loopexit: ; preds = %for.body157.prol, %for.body157.preheader
%indvars.iv341.unr = phi i64 [ %indvars.iv341.ph, %for.body157.preheader ], [ %indvars.iv.next342.prol, %for.body157.prol ]
%43 = icmp ult i64 %41, 3
br i1 %43, label %for.end164, label %for.body157
for.body157: ; preds = %for.body157.prol.loopexit, %for.body157
%indvars.iv341 = phi i64 [ %indvars.iv.next342.3, %for.body157 ], [ %indvars.iv341.unr, %for.body157.prol.loopexit ]
%44 = trunc i64 %indvars.iv341 to i32
%sub159 = add i32 %add158, %44
%idxprom160 = sext i32 %sub159 to i64
%arrayidx161 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom160
store i8 82, ptr %arrayidx161, align 1, !tbaa !11
%45 = trunc i64 %indvars.iv341 to i32
%46 = add i32 %45, 1
%sub159.1 = add i32 %add158, %46
%idxprom160.1 = sext i32 %sub159.1 to i64
%arrayidx161.1 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom160.1
store i8 82, ptr %arrayidx161.1, align 1, !tbaa !11
%47 = trunc i64 %indvars.iv341 to i32
%48 = add i32 %47, 2
%sub159.2 = add i32 %add158, %48
%idxprom160.2 = sext i32 %sub159.2 to i64
%arrayidx161.2 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom160.2
store i8 82, ptr %arrayidx161.2, align 1, !tbaa !11
%49 = trunc i64 %indvars.iv341 to i32
%50 = add i32 %49, 3
%sub159.3 = add i32 %add158, %50
%idxprom160.3 = sext i32 %sub159.3 to i64
%arrayidx161.3 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom160.3
store i8 82, ptr %arrayidx161.3, align 1, !tbaa !11
%indvars.iv.next342.3 = add nsw i64 %indvars.iv341, 4
%exitcond345.not.3 = icmp eq i64 %indvars.iv.next342.3, %wide.trip.count344
br i1 %exitcond345.not.3, label %for.end164, label %for.body157, !llvm.loop !20
for.end164: ; preds = %for.body157.prol.loopexit, %for.body157, %middle.block376, %vec.epilog.middle.block390, %for.cond152.preheader
%cmp177312 = icmp slt i32 %u.0318, %18
%51 = add i32 %17, %val.0317
%52 = add i32 %r.0319, %u.0318
%add179 = sub i32 %51, %52
br i1 %cmp177312, label %iter.check, label %for.end185
iter.check: ; preds = %for.end164
%53 = sext i32 %u.0318 to i64
%wide.trip.count349 = sext i32 %18 to i64
%54 = sub nsw i64 %wide.trip.count349, %53
%min.iters.check = icmp ult i64 %54, 8
br i1 %min.iters.check, label %for.body178.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %iter.check
%55 = xor i64 %53, -1
%56 = add nsw i64 %55, %wide.trip.count349
%57 = add i32 %val.0317, %17
%58 = sub i32 %57, %r.0319
%59 = trunc i64 %56 to i32
%60 = add i32 %58, %59
%61 = icmp slt i32 %60, %58
%62 = icmp ugt i64 %56, 4294967295
%63 = or i1 %61, %62
br i1 %63, label %for.body178.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.scevcheck
%min.iters.check367 = icmp ult i64 %54, 32
br i1 %min.iters.check367, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %54, -32
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%64 = trunc i64 %index to i32
%65 = add i32 %u.0318, %64
%66 = add i32 %add179, %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %67
store <16 x i8> <i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85>, ptr %68, align 1, !tbaa !11
%69 = getelementptr inbounds i8, ptr %68, i64 16
store <16 x i8> <i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85>, ptr %69, align 1, !tbaa !11
%index.next = add nuw i64 %index, 32
%70 = icmp eq i64 %index.next, %n.vec
br i1 %70, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %54, %n.vec
br i1 %cmp.n, label %for.end185, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end370 = add nsw i64 %n.vec, %53
%n.vec.remaining = and i64 %54, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body178.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.vec369 = and i64 %54, -8
%ind.end = add nsw i64 %n.vec369, %53
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index372 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next374, %vec.epilog.vector.body ]
%71 = trunc i64 %index372 to i32
%72 = add i32 %u.0318, %71
%73 = add i32 %add179, %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %74
store <8 x i8> <i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85, i8 85>, ptr %75, align 1, !tbaa !11
%index.next374 = add nuw i64 %index372, 8
%76 = icmp eq i64 %index.next374, %n.vec369
br i1 %76, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !22
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n371 = icmp eq i64 %54, %n.vec369
br i1 %cmp.n371, label %for.end185, label %for.body178.preheader
for.body178.preheader: ; preds = %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv346.ph = phi i64 [ %53, %iter.check ], [ %53, %vector.scevcheck ], [ %ind.end370, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
%77 = sub nsw i64 %wide.trip.count349, %indvars.iv346.ph
%78 = xor i64 %indvars.iv346.ph, -1
%79 = add nsw i64 %78, %wide.trip.count349
%xtraiter407 = and i64 %77, 3
%lcmp.mod408.not = icmp eq i64 %xtraiter407, 0
br i1 %lcmp.mod408.not, label %for.body178.prol.loopexit, label %for.body178.prol
for.body178.prol: ; preds = %for.body178.preheader, %for.body178.prol
%indvars.iv346.prol = phi i64 [ %indvars.iv.next347.prol, %for.body178.prol ], [ %indvars.iv346.ph, %for.body178.preheader ]
%prol.iter409 = phi i64 [ %prol.iter409.next, %for.body178.prol ], [ 0, %for.body178.preheader ]
%80 = trunc i64 %indvars.iv346.prol to i32
%sub180.prol = add i32 %add179, %80
%idxprom181.prol = sext i32 %sub180.prol to i64
%arrayidx182.prol = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom181.prol
store i8 85, ptr %arrayidx182.prol, align 1, !tbaa !11
%indvars.iv.next347.prol = add nsw i64 %indvars.iv346.prol, 1
%prol.iter409.next = add i64 %prol.iter409, 1
%prol.iter409.cmp.not = icmp eq i64 %prol.iter409.next, %xtraiter407
br i1 %prol.iter409.cmp.not, label %for.body178.prol.loopexit, label %for.body178.prol, !llvm.loop !23
for.body178.prol.loopexit: ; preds = %for.body178.prol, %for.body178.preheader
%indvars.iv346.unr = phi i64 [ %indvars.iv346.ph, %for.body178.preheader ], [ %indvars.iv.next347.prol, %for.body178.prol ]
%81 = icmp ult i64 %79, 3
br i1 %81, label %for.end185, label %for.body178
for.body178: ; preds = %for.body178.prol.loopexit, %for.body178
%indvars.iv346 = phi i64 [ %indvars.iv.next347.3, %for.body178 ], [ %indvars.iv346.unr, %for.body178.prol.loopexit ]
%82 = trunc i64 %indvars.iv346 to i32
%sub180 = add i32 %add179, %82
%idxprom181 = sext i32 %sub180 to i64
%arrayidx182 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom181
store i8 85, ptr %arrayidx182, align 1, !tbaa !11
%83 = trunc i64 %indvars.iv346 to i32
%84 = add i32 %83, 1
%sub180.1 = add i32 %add179, %84
%idxprom181.1 = sext i32 %sub180.1 to i64
%arrayidx182.1 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom181.1
store i8 85, ptr %arrayidx182.1, align 1, !tbaa !11
%85 = trunc i64 %indvars.iv346 to i32
%86 = add i32 %85, 2
%sub180.2 = add i32 %add179, %86
%idxprom181.2 = sext i32 %sub180.2 to i64
%arrayidx182.2 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom181.2
store i8 85, ptr %arrayidx182.2, align 1, !tbaa !11
%87 = trunc i64 %indvars.iv346 to i32
%88 = add i32 %87, 3
%sub180.3 = add i32 %add179, %88
%idxprom181.3 = sext i32 %sub180.3 to i64
%arrayidx182.3 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %idxprom181.3
store i8 85, ptr %arrayidx182.3, align 1, !tbaa !11
%indvars.iv.next347.3 = add nsw i64 %indvars.iv346, 4
%exitcond350.not.3 = icmp eq i64 %indvars.iv.next347.3, %wide.trip.count349
br i1 %exitcond350.not.3, label %for.end185, label %for.body178, !llvm.loop !24
for.end185: ; preds = %for.body178.prol.loopexit, %for.body178, %middle.block, %vec.epilog.middle.block, %for.end164
%add190 = add i32 %add179, %18
%indvars.iv.next352 = add nuw nsw i64 %indvars.iv351, 1
%exitcond355.not = icmp eq i64 %indvars.iv.next352, %wide.trip.count354
br i1 %exitcond355.not, label %if.else200, label %for.body141, !llvm.loop !25
if.then198: ; preds = %lor.lhs.false, %for.body141
%puts294 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %if.end212
if.else200: ; preds = %for.end185, %for.end135
%val.0.lcssa = phi i32 [ %add138, %for.end135 ], [ %add190, %for.end185 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%cmp203322 = icmp sgt i32 %val.0.lcssa, 0
br i1 %cmp203322, label %for.body204.preheader, label %for.end210
for.body204.preheader: ; preds = %if.else200
%wide.trip.count359 = zext i32 %val.0.lcssa to i64
br label %for.body204
for.body204: ; preds = %for.body204.preheader, %for.body204
%indvars.iv356 = phi i64 [ 0, %for.body204.preheader ], [ %indvars.iv.next357, %for.body204 ]
%arrayidx206 = getelementptr inbounds [2005 x i8], ptr %s, i64 0, i64 %indvars.iv356
%89 = load i8, ptr %arrayidx206, align 1, !tbaa !11
%conv = sext i8 %89 to i32
%putchar293 = call i32 @putchar(i32 %conv)
%indvars.iv.next357 = add nuw nsw i64 %indvars.iv356, 1
%exitcond360.not = icmp eq i64 %indvars.iv.next357, %wide.trip.count359
br i1 %exitcond360.not, label %for.end210, label %for.body204, !llvm.loop !26
for.end210: ; preds = %for.body204, %if.else200
%putchar = call i32 @putchar(i32 10)
br label %if.end212
if.end212: ; preds = %for.end210, %if.then198
%inc214 = add nuw nsw i32 %i.0325, 1
%90 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc214, %90
br i1 %cmp, label %for.body, label %for.end215, !llvm.loop !27
for.end215: ; preds = %if.end212, %entry
call void @llvm.lifetime.end.p0(i64 2005, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree 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: 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10, !15, !16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10, !15}
!21 = distinct !{!21, !10, !15, !16}
!22 = distinct !{!22, !10, !15, !16}
!23 = distinct !{!23, !19}
!24 = distinct !{!24, !10, !15}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
|
#include <stdio.h>
#include <ctype.h>
int main(void){
// Your code here!
int count[26]={0};
char ch;
int i,num;
while(scanf("%c",&ch)!=EOF){
if(islower(ch)){
num=ch-'a';
}else if(isupper(ch)){
num=ch-'A';
}else{
continue;
}
count[num]++;
}
for(i=0;i<26;i++){
printf("%c : %d\n",'a'+i, count[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154702/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154702/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%count = alloca [26 x i32], align 16
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %count) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %count, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #5
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not28 = icmp eq i32 %call27, -1
br i1 %cmp.not28, 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 = %while.cond.backedge
%.pre = load i32, ptr %count, align 16, !tbaa !5
%arrayidx21.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 1
%.pre32 = load i32, ptr %arrayidx21.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 2
%.pre33 = load i32, ptr %arrayidx21.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx21.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 3
%.pre34 = load i32, ptr %arrayidx21.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 4
%.pre35 = load i32, ptr %arrayidx21.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx21.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 5
%.pre36 = load i32, ptr %arrayidx21.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 6
%.pre37 = load i32, ptr %arrayidx21.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx21.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 7
%.pre38 = load i32, ptr %arrayidx21.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 8
%.pre39 = load i32, ptr %arrayidx21.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx21.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 9
%.pre40 = load i32, ptr %arrayidx21.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 10
%.pre41 = load i32, ptr %arrayidx21.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx21.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 11
%.pre42 = load i32, ptr %arrayidx21.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 12
%.pre43 = load i32, ptr %arrayidx21.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx21.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 13
%.pre44 = load i32, ptr %arrayidx21.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 14
%.pre45 = load i32, ptr %arrayidx21.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx21.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 15
%.pre46 = load i32, ptr %arrayidx21.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 16
%.pre47 = load i32, ptr %arrayidx21.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx21.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 17
%.pre48 = load i32, ptr %arrayidx21.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 18
%.pre49 = load i32, ptr %arrayidx21.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx21.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 19
%.pre50 = load i32, ptr %arrayidx21.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 20
%.pre51 = load i32, ptr %arrayidx21.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx21.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 21
%.pre52 = load i32, ptr %arrayidx21.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 22
%.pre53 = load i32, ptr %arrayidx21.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx21.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 23
%.pre54 = load i32, ptr %arrayidx21.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx21.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 24
%.pre55 = load i32, ptr %arrayidx21.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx21.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 25
%.pre56 = load i32, ptr %arrayidx21.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 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre34, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre33, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre32, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call22.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call22.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call22.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call22.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call22.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call22.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call22.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call22.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call22.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call22.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call22.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call22.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call22.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call22.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call22.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call22.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call22.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call22.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call22.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call22.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call22.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call22.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call22.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call22.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call22.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 %count) #5
ret i32 0
while.body: ; preds = %while.body.lr.ph, %while.cond.backedge
%26 = load ptr, ptr %call1, align 8, !tbaa !9
%27 = load i8, ptr %ch, align 1, !tbaa !11
%conv = sext i8 %27 to i64
%idxprom = sext i8 %27 to i64
%arrayidx = getelementptr inbounds i16, ptr %26, i64 %idxprom
%28 = load i16, ptr %arrayidx, align 2, !tbaa !12
%conv2 = zext i16 %28 to i32
%and = and i32 %conv2, 512
%tobool.not = icmp eq i32 %and, 0
br i1 %tobool.not, label %if.else, label %if.end15
if.else: ; preds = %while.body
%and9 = and i32 %conv2, 256
%tobool10.not = icmp eq i32 %and9, 0
br i1 %tobool10.not, label %while.cond.backedge, label %if.end15
if.end15: ; preds = %if.else, %while.body
%.sink = phi i64 [ -97, %while.body ], [ -65, %if.else ]
%sub13 = add nsw i64 %.sink, %conv
%arrayidx17 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 %sub13
%29 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%inc = add nsw i32 %29, 1
store i32 %inc, ptr %arrayidx17, align 4, !tbaa !5
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end15, %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 !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: 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 = { 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>
int main(void)
{
char c;
int i,count[26]={0};
while(scanf("%c",&c)!=EOF)
{
if(c>='a'&&c<='z')
{
count[c-'a']++;
}
else if(c>='A'&&c<='Z')
{
count[c-'A']++;
}
}
for(i=0;i<26;i++)
{
printf("%c : %d\n",'a'+i,count[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154753/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154753/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%c = alloca i8, align 1
%count = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %count) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %count, i8 0, i64 104, i1 false)
%call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%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 %count, align 16, !tbaa !5
%arrayidx24.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 %count, 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 104, ptr nonnull %count) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4
ret i32 0
while.body: ; preds = %entry, %if.end20
%26 = load i8, ptr %c, 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 %count, 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 %c)
%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>
#define MAXINP 1200
int main(void){
char ch;
char alph[27]="abcdefghijklmnopqrstuvwxyz";
int alphcount[27]={0};
scanf("%[^\n]",ch);
while ( scanf("%c", &ch) != EOF ){
if('a' <= ch && ch <= 'z')
{
int num = ch - 'a';
alphcount[num]++;
}
if('A' <= ch && ch <= 'Z')
{
int num = ch +32 - 'a';
alphcount[num]++;
}
}
for ( int i = 0; i < 26; i++)
{
printf("%c : %d\n",alph[i],alphcount[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154797/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154797/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%[^\0A]\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.2 = 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
%alphcount = alloca [27 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
call void @llvm.lifetime.start.p0(i64 108, ptr nonnull %alphcount) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(108) %alphcount, i8 0, i64 108, i1 false)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, i32 noundef 0)
%call139 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ch)
%cmp.not40 = icmp eq i32 %call139, -1
br i1 %cmp.not40, label %for.cond.preheader, label %while.body
for.cond.preheader.loopexit: ; preds = %if.end24
%.pre = load i32, ptr %alphcount, align 16, !tbaa !5
%arrayidx31.1.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 1
%.pre43 = load i32, ptr %arrayidx31.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.2.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 2
%.pre44 = load i32, ptr %arrayidx31.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx31.3.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 3
%.pre45 = load i32, ptr %arrayidx31.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.4.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 4
%.pre46 = load i32, ptr %arrayidx31.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx31.5.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 5
%.pre47 = load i32, ptr %arrayidx31.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.6.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 6
%.pre48 = load i32, ptr %arrayidx31.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx31.7.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 7
%.pre49 = load i32, ptr %arrayidx31.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.8.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 8
%.pre50 = load i32, ptr %arrayidx31.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx31.9.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 9
%.pre51 = load i32, ptr %arrayidx31.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.10.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 10
%.pre52 = load i32, ptr %arrayidx31.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx31.11.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 11
%.pre53 = load i32, ptr %arrayidx31.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.12.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 12
%.pre54 = load i32, ptr %arrayidx31.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx31.13.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 13
%.pre55 = load i32, ptr %arrayidx31.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.14.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 14
%.pre56 = load i32, ptr %arrayidx31.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx31.15.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 15
%.pre57 = load i32, ptr %arrayidx31.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.16.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 16
%.pre58 = load i32, ptr %arrayidx31.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx31.17.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 17
%.pre59 = load i32, ptr %arrayidx31.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.18.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 18
%.pre60 = load i32, ptr %arrayidx31.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx31.19.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 19
%.pre61 = load i32, ptr %arrayidx31.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.20.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 20
%.pre62 = load i32, ptr %arrayidx31.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx31.21.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 21
%.pre63 = load i32, ptr %arrayidx31.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.22.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 22
%.pre64 = load i32, ptr %arrayidx31.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx31.23.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 23
%.pre65 = load i32, ptr %arrayidx31.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx31.24.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 24
%.pre66 = load i32, ptr %arrayidx31.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx31.25.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 25
%.pre67 = load i32, ptr %arrayidx31.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 [ %.pre67, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre66, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre65, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre64, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre63, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre62, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre61, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 97, i32 noundef %25)
%call32.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 98, i32 noundef %24)
%call32.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 99, i32 noundef %23)
%call32.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 100, i32 noundef %22)
%call32.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 101, i32 noundef %21)
%call32.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 102, i32 noundef %20)
%call32.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 103, i32 noundef %19)
%call32.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 104, i32 noundef %18)
%call32.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 105, i32 noundef %17)
%call32.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 106, i32 noundef %16)
%call32.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 107, i32 noundef %15)
%call32.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 108, i32 noundef %14)
%call32.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 109, i32 noundef %13)
%call32.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 110, i32 noundef %12)
%call32.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 111, i32 noundef %11)
%call32.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 112, i32 noundef %10)
%call32.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 113, i32 noundef %9)
%call32.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 114, i32 noundef %8)
%call32.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 115, i32 noundef %7)
%call32.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 116, i32 noundef %6)
%call32.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 117, i32 noundef %5)
%call32.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 118, i32 noundef %4)
%call32.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 119, i32 noundef %3)
%call32.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 120, i32 noundef %2)
%call32.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 121, i32 noundef %1)
%call32.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 122, i32 noundef %0)
call void @llvm.lifetime.end.p0(i64 108, ptr nonnull %alphcount) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
ret i32 0
while.body: ; preds = %entry, %if.end24
%26 = load i8, ptr %ch, align 1
%27 = add i8 %26, -97
%or.cond = icmp ult i8 %27, 26
br i1 %or.cond, label %if.end24.sink.split, label %if.end
if.end: ; preds = %while.body
%28 = add i8 %26, -65
%or.cond34 = icmp ult i8 %28, 26
br i1 %or.cond34, label %if.end24.sink.split, label %if.end24
if.end24.sink.split: ; preds = %if.end, %while.body
%.sink = phi i64 [ 4294967199, %while.body ], [ 4294967231, %if.end ]
%conv10 = zext i8 %26 to i64
%sub20 = add nuw nsw i64 %.sink, %conv10
%idxprom21 = and i64 %sub20, 4294967295
%arrayidx22 = getelementptr inbounds [27 x i32], ptr %alphcount, i64 0, i64 %idxprom21
%29 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%inc = add nsw i32 %29, 1
store i32 %inc, ptr %arrayidx22, align 4, !tbaa !5
br label %if.end24
if.end24: ; preds = %if.end24.sink.split, %if.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ch)
%cmp.not = icmp eq i32 %call1, -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: 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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>
#include<string.h>
#include<stdbool.h>
#define ll long long int
int gcd(int a, int b)
{
// Everything divides 0
if (a == 0)
return b;
if (b == 0)
return a;
// base case
if (a == b)
return a;
// a is greater
if (a > b)
return gcd(a-b, b);
return gcd(a, b-a);
}
void sort(int a[],ll n){
ll i,j,temp;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(a[i]<a[j]){
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
}
bool isprime(ll n){
ll c,i;
c=0;
for(i=1;i<=sqrt(n);i++){
if(n%i==0){
c++;
}
}
if(c==1){
return true;
}
else
{
return false;
}
}
int main(){
ll t,a,b,c,n;
scanf("%lld",&t);
while(t--){
scanf("%lld%lld%lld%lld",&a,&b,&c,&n);
int a1[4];
a1[0]=a;
a1[1]=b;
a1[2]=c;
sort(a1,3);
ll max=a1[2];
ll sec=a1[1];
ll min=a1[0];
ll diff1=max-min;
ll diff2=max-sec;
n=n-diff1-diff2;
if(n>=0&&n%3==0){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15484/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15484/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [17 x i8] c"%lld%lld%lld%lld\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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp41 = icmp eq i32 %a, 0
br i1 %cmp41, label %return, label %if.end.lr.ph.split
if.end.lr.ph.split: ; preds = %entry, %if.then8
%b.tr.ph43 = phi i32 [ %b.tr2638, %if.then8 ], [ %b, %entry ]
%a.tr.ph42 = phi i32 [ %sub, %if.then8 ], [ %a, %entry ]
%cmp135 = icmp eq i32 %b.tr.ph43, 0
%cmp436 = icmp eq i32 %a.tr.ph42, %b.tr.ph43
%or.cond37 = or i1 %cmp135, %cmp436
br i1 %or.cond37, label %return, label %if.end6
if.end6: ; preds = %if.end.lr.ph.split, %if.end9
%b.tr2638 = phi i32 [ %sub10, %if.end9 ], [ %b.tr.ph43, %if.end.lr.ph.split ]
%cmp7 = icmp sgt i32 %a.tr.ph42, %b.tr2638
br i1 %cmp7, label %if.then8, label %if.end9
if.then8: ; preds = %if.end6
%sub = sub nsw i32 %a.tr.ph42, %b.tr2638
%cmp = icmp eq i32 %sub, 0
br i1 %cmp, label %return, label %if.end.lr.ph.split
if.end9: ; preds = %if.end6
%sub10 = sub nsw i32 %b.tr2638, %a.tr.ph42
%cmp1 = icmp eq i32 %sub10, 0
%cmp4 = icmp eq i32 %a.tr.ph42, %sub10
%or.cond = or i1 %cmp1, %cmp4
br i1 %or.cond, label %return, label %if.end6
return: ; preds = %if.end.lr.ph.split, %if.then8, %if.end9, %entry
%retval.0 = phi i32 [ %b, %entry ], [ %a.tr.ph42, %if.end9 ], [ %a.tr.ph42, %if.end.lr.ph.split ], [ %b.tr2638, %if.then8 ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort(ptr nocapture noundef %a, i64 noundef %n) local_unnamed_addr #1 {
entry:
%cmp31 = icmp sgt i64 %n, 0
br i1 %cmp31, label %for.cond1.preheader.us.preheader, label %for.end13
for.cond1.preheader.us.preheader: ; preds = %entry
%xtraiter = and i64 %n, 1
%0 = icmp eq i64 %n, 1
%unroll_iter = and i64 %n, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc11_crit_edge.us
%i.032.us = phi i64 [ %inc12.us, %for.cond1.for.inc11_crit_edge.us ], [ 0, %for.cond1.preheader.us.preheader ]
%arrayidx.us = getelementptr inbounds i32, ptr %a, i64 %i.032.us
br i1 %0, label %for.cond1.for.inc11_crit_edge.us.unr-lcssa, label %for.body3.us
for.body3.us: ; preds = %for.cond1.preheader.us, %for.inc.us.1
%j.030.us = phi i64 [ %inc.us.1, %for.inc.us.1 ], [ 0, %for.cond1.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc.us.1 ], [ 0, %for.cond1.preheader.us ]
%1 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
%arrayidx4.us = getelementptr inbounds i32, ptr %a, i64 %j.030.us
%2 = load i32, ptr %arrayidx4.us, align 4, !tbaa !5
%cmp5.us = icmp slt i32 %1, %2
br i1 %cmp5.us, label %if.then.us, label %for.inc.us
if.then.us: ; preds = %for.body3.us
store i32 %2, ptr %arrayidx.us, align 4, !tbaa !5
store i32 %1, ptr %arrayidx4.us, align 4, !tbaa !5
br label %for.inc.us
for.inc.us: ; preds = %if.then.us, %for.body3.us
%inc.us = or i64 %j.030.us, 1
%3 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
%arrayidx4.us.1 = getelementptr inbounds i32, ptr %a, i64 %inc.us
%4 = load i32, ptr %arrayidx4.us.1, align 4, !tbaa !5
%cmp5.us.1 = icmp slt i32 %3, %4
br i1 %cmp5.us.1, label %if.then.us.1, label %for.inc.us.1
if.then.us.1: ; preds = %for.inc.us
store i32 %4, ptr %arrayidx.us, align 4, !tbaa !5
store i32 %3, ptr %arrayidx4.us.1, align 4, !tbaa !5
br label %for.inc.us.1
for.inc.us.1: ; preds = %if.then.us.1, %for.inc.us
%inc.us.1 = add nuw nsw i64 %j.030.us, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond1.for.inc11_crit_edge.us.unr-lcssa, label %for.body3.us, !llvm.loop !9
for.cond1.for.inc11_crit_edge.us.unr-lcssa: ; preds = %for.inc.us.1, %for.cond1.preheader.us
%j.030.us.unr = phi i64 [ 0, %for.cond1.preheader.us ], [ %inc.us.1, %for.inc.us.1 ]
br i1 %lcmp.mod.not, label %for.cond1.for.inc11_crit_edge.us, label %for.body3.us.epil
for.body3.us.epil: ; preds = %for.cond1.for.inc11_crit_edge.us.unr-lcssa
%5 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
%arrayidx4.us.epil = getelementptr inbounds i32, ptr %a, i64 %j.030.us.unr
%6 = load i32, ptr %arrayidx4.us.epil, align 4, !tbaa !5
%cmp5.us.epil = icmp slt i32 %5, %6
br i1 %cmp5.us.epil, label %if.then.us.epil, label %for.cond1.for.inc11_crit_edge.us
if.then.us.epil: ; preds = %for.body3.us.epil
store i32 %6, ptr %arrayidx.us, align 4, !tbaa !5
store i32 %5, ptr %arrayidx4.us.epil, align 4, !tbaa !5
br label %for.cond1.for.inc11_crit_edge.us
for.cond1.for.inc11_crit_edge.us: ; preds = %for.body3.us.epil, %if.then.us.epil, %for.cond1.for.inc11_crit_edge.us.unr-lcssa
%inc12.us = add nuw nsw i64 %i.032.us, 1
%exitcond33.not = icmp eq i64 %inc12.us, %n
br i1 %exitcond33.not, label %for.end13, label %for.cond1.preheader.us, !llvm.loop !11
for.end13: ; preds = %for.cond1.for.inc11_crit_edge.us, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind memory(write) uwtable
define dso_local zeroext i1 @isprime(i64 noundef %n) local_unnamed_addr #3 {
entry:
%conv1 = sitofp i64 %n to double
%call14 = tail call double @sqrt(double noundef %conv1) #9
%cmp15 = fcmp ult double %call14, 1.000000e+00
br i1 %cmp15, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.017 = phi i64 [ %inc5, %for.body ], [ 1, %entry ]
%c.016 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ]
%rem = srem i64 %n, %i.017
%cmp3 = icmp eq i64 %rem, 0
%inc = zext i1 %cmp3 to i64
%spec.select = add nuw nsw i64 %c.016, %inc
%inc5 = add nuw nsw i64 %i.017, 1
%conv = sitofp i64 %inc5 to double
%call = tail call double @sqrt(double noundef %conv1) #9
%cmp = fcmp ult double %call, %conv
br i1 %cmp, label %for.end.loopexit, label %for.body, !llvm.loop !12
for.end.loopexit: ; preds = %for.body
%0 = icmp eq i64 %spec.select, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%c.0.lcssa = phi i1 [ false, %entry ], [ %0, %for.end.loopexit ]
ret i1 %c.0.lcssa
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%t = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #9
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #9
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #9
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #9
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !13
%dec22 = add nsw i64 %0, -1
store i64 %dec22, ptr %t, align 8, !tbaa !13
%tobool.not23 = icmp eq i64 %0, 0
br i1 %tobool.not23, label %while.end, label %for.inc.us.i
for.inc.us.i: ; preds = %entry, %for.inc.us.i
%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 i64, ptr %a, align 8, !tbaa !13
%conv = trunc i64 %1 to i32
%2 = load i64, ptr %b, align 8, !tbaa !13
%conv2 = trunc i64 %2 to i32
%3 = load i64, ptr %c, align 8, !tbaa !13
%conv4 = trunc i64 %3 to i32
%spec.select = call i32 @llvm.smin.i32(i32 %conv, i32 %conv2)
%spec.select48 = call i32 @llvm.smax.i32(i32 %conv, i32 %conv2)
%a1.sroa.30.0 = call i32 @llvm.smin.i32(i32 %spec.select48, i32 %conv4)
%a1.sroa.0.2 = call i32 @llvm.smax.i32(i32 %spec.select48, i32 %conv4)
%a1.sroa.16.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %a1.sroa.0.2)
%a1.sroa.0.3 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %a1.sroa.0.2)
%a1.sroa.30.2 = call i32 @llvm.smax.i32(i32 %a1.sroa.30.0, i32 %a1.sroa.0.3)
%a1.sroa.0.4 = call i32 @llvm.smin.i32(i32 %a1.sroa.30.0, i32 %a1.sroa.0.3)
%a1.sroa.30.3 = call i32 @llvm.smax.i32(i32 %a1.sroa.30.2, i32 %a1.sroa.16.1)
%a1.sroa.16.4 = call i32 @llvm.smin.i32(i32 %a1.sroa.30.2, i32 %a1.sroa.16.1)
%conv7 = sext i32 %a1.sroa.30.3 to i64
%conv9 = sext i32 %a1.sroa.16.4 to i64
%conv11 = sext i32 %a1.sroa.0.4 to i64
%sub.neg = sub nsw i64 %conv11, %conv7
%sub12.neg = sub nsw i64 %conv9, %conv7
%4 = load i64, ptr %n, align 8, !tbaa !13
%sub13 = add i64 %sub.neg, %4
%sub14 = add i64 %sub13, %sub12.neg
store i64 %sub14, ptr %n, align 8, !tbaa !13
%cmp = icmp sgt i64 %sub14, -1
%rem = urem i64 %sub14, 3
%cmp16 = icmp eq i64 %rem, 0
%or.cond = and i1 %cmp, %cmp16
%str.sink = select i1 %or.cond, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%5 = load i64, ptr %t, align 8, !tbaa !13
%dec = add nsw i64 %5, -1
store i64 %dec, ptr %t, align 8, !tbaa !13
%tobool.not = icmp eq i64 %5, 0
br i1 %tobool.not, label %while.end, label %for.inc.us.i, !llvm.loop !15
while.end: ; preds = %for.inc.us.i, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main(){
int i, result[127];
char moji;
for(i=0;i<127;i++) result[i]=0;
while(1){
if( scanf("%c",&moji)==EOF) break;
result[moji]++;
}
for(i=0;i<26;i++) printf("%c : %d\n",i+97,result[i+65]+result[i+97]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154883/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154883/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%result = alloca [127 x i32], align 16
%moji = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 508, ptr nonnull %result) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %moji) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(508) %result, i8 0, i64 508, i1 false), !tbaa !5
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %moji)
%cmp128 = icmp eq i32 %call27, -1
br i1 %cmp128, label %for.cond5.preheader, label %if.end
for.cond5.preheader: ; preds = %if.end, %entry
%arrayidx10 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 65
%0 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 97
%1 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%add14 = add nsw i32 %1, %0
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %add14)
%arrayidx10.1 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 66
%2 = load i32, ptr %arrayidx10.1, align 8, !tbaa !5
%arrayidx13.1 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 98
%3 = load i32, ptr %arrayidx13.1, align 8, !tbaa !5
%add14.1 = add nsw i32 %3, %2
%call15.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %add14.1)
%arrayidx10.2 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 67
%4 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%arrayidx13.2 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 99
%5 = load i32, ptr %arrayidx13.2, align 4, !tbaa !5
%add14.2 = add nsw i32 %5, %4
%call15.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %add14.2)
%arrayidx10.3 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 68
%6 = load i32, ptr %arrayidx10.3, align 16, !tbaa !5
%arrayidx13.3 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 100
%7 = load i32, ptr %arrayidx13.3, align 16, !tbaa !5
%add14.3 = add nsw i32 %7, %6
%call15.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %add14.3)
%arrayidx10.4 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 69
%8 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5
%arrayidx13.4 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 101
%9 = load i32, ptr %arrayidx13.4, align 4, !tbaa !5
%add14.4 = add nsw i32 %9, %8
%call15.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %add14.4)
%arrayidx10.5 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 70
%10 = load i32, ptr %arrayidx10.5, align 8, !tbaa !5
%arrayidx13.5 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 102
%11 = load i32, ptr %arrayidx13.5, align 8, !tbaa !5
%add14.5 = add nsw i32 %11, %10
%call15.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %add14.5)
%arrayidx10.6 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 71
%12 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5
%arrayidx13.6 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 103
%13 = load i32, ptr %arrayidx13.6, align 4, !tbaa !5
%add14.6 = add nsw i32 %13, %12
%call15.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %add14.6)
%arrayidx10.7 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 72
%14 = load i32, ptr %arrayidx10.7, align 16, !tbaa !5
%arrayidx13.7 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 104
%15 = load i32, ptr %arrayidx13.7, align 16, !tbaa !5
%add14.7 = add nsw i32 %15, %14
%call15.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %add14.7)
%arrayidx10.8 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 73
%16 = load i32, ptr %arrayidx10.8, align 4, !tbaa !5
%arrayidx13.8 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 105
%17 = load i32, ptr %arrayidx13.8, align 4, !tbaa !5
%add14.8 = add nsw i32 %17, %16
%call15.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %add14.8)
%arrayidx10.9 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 74
%18 = load i32, ptr %arrayidx10.9, align 8, !tbaa !5
%arrayidx13.9 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 106
%19 = load i32, ptr %arrayidx13.9, align 8, !tbaa !5
%add14.9 = add nsw i32 %19, %18
%call15.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %add14.9)
%arrayidx10.10 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 75
%20 = load i32, ptr %arrayidx10.10, align 4, !tbaa !5
%arrayidx13.10 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 107
%21 = load i32, ptr %arrayidx13.10, align 4, !tbaa !5
%add14.10 = add nsw i32 %21, %20
%call15.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %add14.10)
%arrayidx10.11 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 76
%22 = load i32, ptr %arrayidx10.11, align 16, !tbaa !5
%arrayidx13.11 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 108
%23 = load i32, ptr %arrayidx13.11, align 16, !tbaa !5
%add14.11 = add nsw i32 %23, %22
%call15.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %add14.11)
%arrayidx10.12 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 77
%24 = load i32, ptr %arrayidx10.12, align 4, !tbaa !5
%arrayidx13.12 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 109
%25 = load i32, ptr %arrayidx13.12, align 4, !tbaa !5
%add14.12 = add nsw i32 %25, %24
%call15.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %add14.12)
%arrayidx10.13 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 78
%26 = load i32, ptr %arrayidx10.13, align 8, !tbaa !5
%arrayidx13.13 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 110
%27 = load i32, ptr %arrayidx13.13, align 8, !tbaa !5
%add14.13 = add nsw i32 %27, %26
%call15.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %add14.13)
%arrayidx10.14 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 79
%28 = load i32, ptr %arrayidx10.14, align 4, !tbaa !5
%arrayidx13.14 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 111
%29 = load i32, ptr %arrayidx13.14, align 4, !tbaa !5
%add14.14 = add nsw i32 %29, %28
%call15.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %add14.14)
%arrayidx10.15 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 80
%30 = load i32, ptr %arrayidx10.15, align 16, !tbaa !5
%arrayidx13.15 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 112
%31 = load i32, ptr %arrayidx13.15, align 16, !tbaa !5
%add14.15 = add nsw i32 %31, %30
%call15.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %add14.15)
%arrayidx10.16 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 81
%32 = load i32, ptr %arrayidx10.16, align 4, !tbaa !5
%arrayidx13.16 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 113
%33 = load i32, ptr %arrayidx13.16, align 4, !tbaa !5
%add14.16 = add nsw i32 %33, %32
%call15.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %add14.16)
%arrayidx10.17 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 82
%34 = load i32, ptr %arrayidx10.17, align 8, !tbaa !5
%arrayidx13.17 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 114
%35 = load i32, ptr %arrayidx13.17, align 8, !tbaa !5
%add14.17 = add nsw i32 %35, %34
%call15.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %add14.17)
%arrayidx10.18 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 83
%36 = load i32, ptr %arrayidx10.18, align 4, !tbaa !5
%arrayidx13.18 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 115
%37 = load i32, ptr %arrayidx13.18, align 4, !tbaa !5
%add14.18 = add nsw i32 %37, %36
%call15.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %add14.18)
%arrayidx10.19 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 84
%38 = load i32, ptr %arrayidx10.19, align 16, !tbaa !5
%arrayidx13.19 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 116
%39 = load i32, ptr %arrayidx13.19, align 16, !tbaa !5
%add14.19 = add nsw i32 %39, %38
%call15.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %add14.19)
%arrayidx10.20 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 85
%40 = load i32, ptr %arrayidx10.20, align 4, !tbaa !5
%arrayidx13.20 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 117
%41 = load i32, ptr %arrayidx13.20, align 4, !tbaa !5
%add14.20 = add nsw i32 %41, %40
%call15.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %add14.20)
%arrayidx10.21 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 86
%42 = load i32, ptr %arrayidx10.21, align 8, !tbaa !5
%arrayidx13.21 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 118
%43 = load i32, ptr %arrayidx13.21, align 8, !tbaa !5
%add14.21 = add nsw i32 %43, %42
%call15.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %add14.21)
%arrayidx10.22 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 87
%44 = load i32, ptr %arrayidx10.22, align 4, !tbaa !5
%arrayidx13.22 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 119
%45 = load i32, ptr %arrayidx13.22, align 4, !tbaa !5
%add14.22 = add nsw i32 %45, %44
%call15.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %add14.22)
%arrayidx10.23 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 88
%46 = load i32, ptr %arrayidx10.23, align 16, !tbaa !5
%arrayidx13.23 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 120
%47 = load i32, ptr %arrayidx13.23, align 16, !tbaa !5
%add14.23 = add nsw i32 %47, %46
%call15.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %add14.23)
%arrayidx10.24 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 89
%48 = load i32, ptr %arrayidx10.24, align 4, !tbaa !5
%arrayidx13.24 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 121
%49 = load i32, ptr %arrayidx13.24, align 4, !tbaa !5
%add14.24 = add nsw i32 %49, %48
%call15.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %add14.24)
%arrayidx10.25 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 90
%50 = load i32, ptr %arrayidx10.25, align 8, !tbaa !5
%arrayidx13.25 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 122
%51 = load i32, ptr %arrayidx13.25, align 8, !tbaa !5
%add14.25 = add nsw i32 %51, %50
%call15.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %add14.25)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %moji) #4
call void @llvm.lifetime.end.p0(i64 508, ptr nonnull %result) #4
ret i32 0
if.end: ; preds = %entry, %if.end
%52 = load i8, ptr %moji, align 1, !tbaa !9
%idxprom2 = sext i8 %52 to i64
%arrayidx3 = getelementptr inbounds [127 x i32], ptr %result, i64 0, i64 %idxprom2
%53 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%inc4 = add nsw i32 %53, 1
store i32 %inc4, ptr %arrayidx3, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %moji)
%cmp1 = icmp eq i32 %call, -1
br i1 %cmp1, label %for.cond5.preheader, label %if.end
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 = !{!7, !7, i64 0}
|
//ITP1-8-C: Counting Characters
//2019.05.19
#include <stdio.h>
int main(void){
int count[26] = {0};
int i;
char c;
while (scanf("%c", &c) != EOF) {
if (c >= 'A' && c <= 'Z') {
i = c - 'A';
count[i] = count[i] + 1;
}else if (c >= 'a' && c <= 'z') {
i = c - 'a';
count[i] = count[i] + 1;
}
}
for (i = 0; i < 26; i++) {
printf("%c : %d\n", 'a' + i, count[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154926/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154926/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%count = alloca [26 x i32], align 16
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %count) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %count, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not40 = icmp eq i32 %call39, -1
br i1 %cmp.not40, label %for.cond.preheader, label %while.body
for.cond.preheader.loopexit: ; preds = %if.end24
%.pre = load i32, ptr %count, align 16, !tbaa !5
%arrayidx29.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 1
%.pre44 = load i32, ptr %arrayidx29.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 2
%.pre45 = load i32, ptr %arrayidx29.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx29.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 3
%.pre46 = load i32, ptr %arrayidx29.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 4
%.pre47 = load i32, ptr %arrayidx29.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx29.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 5
%.pre48 = load i32, ptr %arrayidx29.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 6
%.pre49 = load i32, ptr %arrayidx29.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx29.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 7
%.pre50 = load i32, ptr %arrayidx29.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 8
%.pre51 = load i32, ptr %arrayidx29.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx29.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 9
%.pre52 = load i32, ptr %arrayidx29.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 10
%.pre53 = load i32, ptr %arrayidx29.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx29.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 11
%.pre54 = load i32, ptr %arrayidx29.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 12
%.pre55 = load i32, ptr %arrayidx29.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx29.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 13
%.pre56 = load i32, ptr %arrayidx29.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 14
%.pre57 = load i32, ptr %arrayidx29.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx29.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 15
%.pre58 = load i32, ptr %arrayidx29.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 16
%.pre59 = load i32, ptr %arrayidx29.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx29.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 17
%.pre60 = load i32, ptr %arrayidx29.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 18
%.pre61 = load i32, ptr %arrayidx29.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx29.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 19
%.pre62 = load i32, ptr %arrayidx29.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 20
%.pre63 = load i32, ptr %arrayidx29.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx29.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 21
%.pre64 = load i32, ptr %arrayidx29.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 22
%.pre65 = load i32, ptr %arrayidx29.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx29.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 23
%.pre66 = load i32, ptr %arrayidx29.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx29.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 24
%.pre67 = load i32, ptr %arrayidx29.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx29.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 25
%.pre68 = load i32, ptr %arrayidx29.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 [ %.pre68, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre67, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre66, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre65, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre64, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre63, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre62, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre61, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call30.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call30.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call30.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call30.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call30.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call30.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call30.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call30.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call30.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call30.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call30.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call30.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call30.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call30.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call30.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call30.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call30.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call30.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call30.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call30.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call30.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call30.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call30.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call30.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call30.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 %count) #4
ret i32 0
while.body: ; preds = %entry, %if.end24
%26 = load i8, ptr %c, align 1
%conv = sext i8 %26 to i64
%27 = add i8 %26, -65
%or.cond = icmp ult i8 %27, 26
br i1 %or.cond, label %if.end24.sink.split, label %if.else
if.else: ; preds = %while.body
%28 = add i8 %26, -97
%or.cond31 = icmp ult i8 %28, 26
br i1 %or.cond31, label %if.end24.sink.split, label %if.end24
if.end24.sink.split: ; preds = %if.else, %while.body
%.sink = phi i64 [ 4294967231, %while.body ], [ 4294967199, %if.else ]
%sub = add nsw i64 %.sink, %conv
%idxprom = and i64 %sub, 4294967295
%arrayidx = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 %idxprom
%29 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add21 = add nsw i32 %29, 1
store i32 %add21, ptr %arrayidx, align 4, !tbaa !5
br label %if.end24
if.end24: ; preds = %if.end24.sink.split, %if.else
%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 !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 n, a[101], i, sum=0, p;
scanf("%d" , &n);
for(i=1; i<=n; i++)
{
scanf("%d", &a[i]);
sum += a[i];
}
int max = -1;
for(i=1; i<=n; i++)
{
if(a[i] > max)
max = a[i];
}
p = sum - max;
if(p > max)
printf("Yes\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155011/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155011/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not31 = icmp slt i32 %0, 1
br i1 %cmp.not31, label %for.end14, label %for.body
for.cond4.preheader: ; preds = %for.body
%cmp5.not35 = icmp slt i32 %10, 1
br i1 %cmp5.not35, label %for.end14, label %for.body6.preheader
for.body6.preheader: ; preds = %for.cond4.preheader
%1 = add nuw i32 %10, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %10, 8
br i1 %min.iters.check, label %for.body6.preheader50, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %2, -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> [ <i32 -1, i32 -1, i32 -1, i32 -1>, %vector.ph ], [ %5, %vector.body ]
%vec.phi48 = phi <4 x i32> [ <i32 -1, i32 -1, i32 -1, i32 -1>, %vector.ph ], [ %6, %vector.body ]
%offset.idx = or i64 %index, 1
%3 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load49 = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
%6 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load49, <4 x i32> %vec.phi48)
%index.next = add nuw i64 %index, 8
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, 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> %5, <4 x i32> %6)
%8 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.end14, label %for.body6.preheader50
for.body6.preheader50: ; preds = %for.body6.preheader, %middle.block
%indvars.iv41.ph = phi i64 [ 1, %for.body6.preheader ], [ %ind.end, %middle.block ]
%max.037.ph = phi i32 [ -1, %for.body6.preheader ], [ %8, %middle.block ]
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%sum.032 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%9 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %9, %sum.032
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %11
br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.body6: ; preds = %for.body6.preheader50, %for.body6
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body6 ], [ %indvars.iv41.ph, %for.body6.preheader50 ]
%max.037 = phi i32 [ %spec.select, %for.body6 ], [ %max.037.ph, %for.body6.preheader50 ]
%arrayidx8 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv41
%12 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %12, i32 %max.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.body6, !llvm.loop !14
for.end14: ; preds = %for.body6, %middle.block, %entry, %for.cond4.preheader
%sum.0.lcssa47 = phi i32 [ %add, %for.cond4.preheader ], [ 0, %entry ], [ %add, %middle.block ], [ %add, %for.body6 ]
%max.0.lcssa = phi i32 [ -1, %for.cond4.preheader ], [ -1, %entry ], [ %8, %middle.block ], [ %spec.select, %for.body6 ]
%sub = sub nsw i32 %sum.0.lcssa47, %max.0.lcssa
%cmp15 = icmp sgt i32 %sub, %max.0.lcssa
%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 404, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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 <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.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 = { 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 <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//ABC117B
int main(void) {
int max=0, n, k, i, L, cou=0, tmp;
scanf("%d", &n);
for(i=0; i<n; i++){
scanf(" %d", &L);
cou+=L;
max=max<L ? L : max;
}
if(cou-max>max) printf("Yes");
else printf("No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155062/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155062/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"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 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 %L) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%max.014 = phi i32 [ %cond, %for.body ], [ 0, %entry ]
%cou.013 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%i.012 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %L)
%1 = load i32, ptr %L, align 4
%add = add nsw i32 %1, %cou.013
%cond = call i32 @llvm.smax.i32(i32 %max.014, i32 %1)
%inc = add nuw nsw i32 %i.012, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%cou.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%max.0.lcssa = phi i32 [ 0, %entry ], [ %cond, %for.body ]
%sub = sub nsw i32 %cou.0.lcssa, %max.0.lcssa
%cmp3 = icmp sgt i32 %sub, %max.0.lcssa
%.str.2..str.3 = select i1 %cmp3, ptr @.str.2, ptr @.str.3
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #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.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main (void) {
int i;
int n;
scanf("%d", &n);
int l[n], max = 0, sum = 0;
for (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\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155112/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155112/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%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
%cmp23 = icmp sgt i32 %3, 0
br i1 %cmp23, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.026 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%max.025 = 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
%spec.select = call i32 @llvm.smax.i32(i32 %4, i32 %max.025)
%add = add nsw i32 %4, %sum.026
%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, %entry
%max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ]
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa
%cmp9 = icmp slt i32 %max.0.lcssa, %sub
%str.3.str = select i1 %cmp9, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree 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: 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.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 nocallback nofree nosync nounwind willreturn }
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"}
|
#include<stdio.h>
int main() {
int max, i, n, l[10], sum;
if (scanf("%d", &n) == 0) return 1;
sum = 0;
max = 0;
for (i = 0; i < n; i++) {
if (scanf("%d", &l[i]) == 0) return 1;
}
for (i = 0; i < n; i++) {
sum += l[i];
if (max < l[i]) max = l[i];
}
printf(sum - max > max ? "Yes" : "No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155156/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155156/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%l = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %l) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp = icmp eq i32 %call, 0
br i1 %cmp, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp138 = icmp sgt i32 %0, 0
br i1 %cmp138, label %for.body, label %for.end20
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp1, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.cond6.preheader: ; preds = %for.cond
%cmp740 = icmp sgt i32 %1, 0
br i1 %cmp740, label %for.body8.preheader, label %for.end20
for.body8.preheader: ; preds = %for.cond6.preheader
%wide.trip.count = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body8.preheader58, label %vector.ph
vector.ph: ; preds = %for.body8.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 ], [ %5, %vector.body ]
%vec.phi53 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi54 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi55 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%3 = getelementptr inbounds [10 x i32], ptr %l, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load56 = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = add <4 x i32> %wide.load, %vec.phi
%6 = add <4 x i32> %wide.load56, %vec.phi53
%7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi54, <4 x i32> %wide.load)
%8 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi55, <4 x i32> %wide.load56)
%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 !11
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %7, <4 x i32> %8)
%10 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%bin.rdx = add <4 x i32> %6, %5
%11 = 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.end20, label %for.body8.preheader58
for.body8.preheader58: ; preds = %for.body8.preheader, %middle.block
%indvars.iv48.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ]
%sum.043.ph = phi i32 [ 0, %for.body8.preheader ], [ %11, %middle.block ]
%max.041.ph = phi i32 [ 0, %for.body8.preheader ], [ %10, %middle.block ]
br label %for.body8
for.body: ; preds = %for.cond.preheader, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [10 x i32], ptr %l, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%cmp3 = icmp eq i32 %call2, 0
br i1 %cmp3, label %cleanup, label %for.cond
for.body8: ; preds = %for.body8.preheader58, %for.body8
%indvars.iv48 = phi i64 [ %indvars.iv.next49, %for.body8 ], [ %indvars.iv48.ph, %for.body8.preheader58 ]
%sum.043 = phi i32 [ %add, %for.body8 ], [ %sum.043.ph, %for.body8.preheader58 ]
%max.041 = phi i32 [ %spec.select, %for.body8 ], [ %max.041.ph, %for.body8.preheader58 ]
%arrayidx10 = getelementptr inbounds [10 x i32], ptr %l, i64 0, i64 %indvars.iv48
%12 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add = add nsw i32 %12, %sum.043
%spec.select = call i32 @llvm.smax.i32(i32 %max.041, i32 %12)
%indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
%exitcond.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count
br i1 %exitcond.not, label %for.end20, label %for.body8, !llvm.loop !14
for.end20: ; preds = %for.body8, %middle.block, %for.cond.preheader, %for.cond6.preheader
%max.0.lcssa = phi i32 [ 0, %for.cond6.preheader ], [ 0, %for.cond.preheader ], [ %10, %middle.block ], [ %spec.select, %for.body8 ]
%sum.0.lcssa = phi i32 [ 0, %for.cond6.preheader ], [ 0, %for.cond.preheader ], [ %11, %middle.block ], [ %add, %for.body8 ]
%sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa
%cmp21 = icmp sgt i32 %sub, %max.0.lcssa
%cond = select i1 %cmp21, ptr @.str.1, ptr @.str.2
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
br label %cleanup
cleanup: ; preds = %for.body, %entry, %for.end20
%retval.0 = phi i32 [ 0, %for.end20 ], [ 1, %entry ], [ 1, %for.body ]
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
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: 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = 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()
{
long long q,a,b,c;
scanf("%lld",&q);
while(q--)
{
scanf("%lld%lld%lld",&a,&b,&c);
printf("%lld\n",(a+b+c)/2);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1552/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1552/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%lld%lld%lld\00", align 1
@.str.2 = 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:
%q = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i64, ptr %q, align 8, !tbaa !5
%dec4 = add nsw i64 %0, -1
store i64 %dec4, ptr %q, align 8, !tbaa !5
%tobool.not5 = icmp eq i64 %0, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %2, %1
%3 = load i64, ptr %c, align 8, !tbaa !5
%add2 = add nsw i64 %add, %3
%div = sdiv i64 %add2, 2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
%4 = load i64, ptr %q, align 8, !tbaa !5
%dec = add nsw i64 %4, -1
store i64 %dec, ptr %q, align 8, !tbaa !5
%tobool.not = icmp eq i64 %4, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int t;
scanf("%d", &t);
int n;
int i, j;
char s[200005];
int c[200005], cc;
int ans;
for (; t > 0; t--)
{
scanf("%d", &n);
scanf("%s", s);
cc = 1;
c[0] = 1;
for (i = 1; i < n; i++)
{
if (s[i] == s[i - 1])
c[cc - 1]++;
else
{
c[cc] = 1;
cc++;
}
}
j = 0;
c[cc] = 10;
ans = 0;
for (i = 0; i < cc; i++)
{
ans++;
while (c[j] == 1)
j++;
if (j == cc)
{
cc--;
c[cc] = 10;
j--;
}
else
c[j]--;
if (i == j)
j++;
}
printf("%d\n", ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15530/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15530/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
%s = alloca [200005 x i8], align 16
%c = alloca [200005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 200005, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %c) #3
%.pr = load i32, ptr %t, align 4, !tbaa !5
%cmp83 = icmp sgt i32 %.pr, 0
br i1 %cmp83, label %for.body.preheader, label %for.end53
for.body.preheader: ; preds = %entry
%arrayidx2091 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.end49
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
store i32 1, ptr %c, align 16, !tbaa !5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp474 = icmp sgt i32 %0, 1
br i1 %cmp474, label %for.body5.preheader, label %for.end.thread
for.end.thread: ; preds = %for.body
store i32 10, ptr %arrayidx2091, align 4, !tbaa !5
br label %for.body24.preheader
for.body5.preheader: ; preds = %for.body
%wide.trip.count = zext i32 %0 to i64
%.pre = load i8, ptr %s, align 16, !tbaa !9
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.inc
%1 = phi i8 [ %.pre, %for.body5.preheader ], [ %2, %for.inc ]
%indvars.iv = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next, %for.inc ]
%cc.076 = phi i32 [ 1, %for.body5.preheader ], [ %cc.1, %for.inc ]
%arrayidx6 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp10 = icmp eq i8 %2, %1
br i1 %cmp10, label %if.then, label %if.else
if.then: ; preds = %for.body5
%sub12 = add nsw i32 %cc.076, -1
%idxprom13 = sext i32 %sub12 to i64
%arrayidx14 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %idxprom13
%3 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%inc = add nsw i32 %3, 1
store i32 %inc, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %for.body5
%idxprom15 = sext i32 %cc.076 to i64
%arrayidx16 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %idxprom15
store i32 1, ptr %arrayidx16, align 4, !tbaa !5
%inc17 = add nsw i32 %cc.076, 1
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%cc.1 = phi i32 [ %cc.076, %if.then ], [ %inc17, %if.else ]
%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.body5, !llvm.loop !10
for.end: ; preds = %for.inc
%idxprom19 = sext i32 %cc.1 to i64
%arrayidx20 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %idxprom19
store i32 10, ptr %arrayidx20, align 4, !tbaa !5
%cmp2277 = icmp sgt i32 %cc.1, 0
br i1 %cmp2277, label %for.body24.preheader, label %for.end49
for.body24.preheader: ; preds = %for.end.thread, %for.end
%cc.280.ph = phi i32 [ %cc.1, %for.end ], [ 1, %for.end.thread ]
br label %for.body24
for.body24: ; preds = %for.body24.preheader, %if.end41
%ans.081 = phi i32 [ %inc25, %if.end41 ], [ 0, %for.body24.preheader ]
%cc.280 = phi i32 [ %cc.3, %if.end41 ], [ %cc.280.ph, %for.body24.preheader ]
%j.079 = phi i32 [ %spec.select, %if.end41 ], [ 0, %for.body24.preheader ]
%4 = sext i32 %j.079 to i64
br label %while.cond
while.cond: ; preds = %while.cond, %for.body24
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %while.cond ], [ %4, %for.body24 ]
%arrayidx27 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %indvars.iv86
%5 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28 = icmp eq i32 %5, 1
%indvars.iv.next87 = add i64 %indvars.iv86, 1
br i1 %cmp28, label %while.cond, label %while.end, !llvm.loop !12
while.end: ; preds = %while.cond
%inc25 = add nuw nsw i32 %ans.081, 1
%6 = trunc i64 %indvars.iv86 to i32
%cmp31 = icmp eq i32 %cc.280, %6
br i1 %cmp31, label %if.then33, label %if.else37
if.then33: ; preds = %while.end
%dec = add nsw i32 %cc.280, -1
%idxprom34 = sext i32 %dec to i64
%arrayidx35 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %idxprom34
store i32 10, ptr %arrayidx35, align 4, !tbaa !5
br label %if.end41
if.else37: ; preds = %while.end
%arrayidx27.le = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %indvars.iv86
%dec40 = add nsw i32 %5, -1
store i32 %dec40, ptr %arrayidx27.le, align 4, !tbaa !5
br label %if.end41
if.end41: ; preds = %if.else37, %if.then33
%j.2 = phi i32 [ %dec, %if.then33 ], [ %6, %if.else37 ]
%cc.3 = phi i32 [ %dec, %if.then33 ], [ %cc.280, %if.else37 ]
%cmp42 = icmp eq i32 %ans.081, %j.2
%inc45 = zext i1 %cmp42 to i32
%spec.select = add nsw i32 %j.2, %inc45
%cmp22 = icmp slt i32 %inc25, %cc.3
br i1 %cmp22, label %for.body24, label %for.end49, !llvm.loop !13
for.end49: ; preds = %if.end41, %for.end
%ans.0.lcssa = phi i32 [ 0, %for.end ], [ %inc25, %if.end41 ]
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
%7 = load i32, ptr %t, align 4, !tbaa !5
%dec52 = add nsw i32 %7, -1
store i32 %dec52, ptr %t, align 4, !tbaa !5
%cmp = icmp sgt i32 %7, 1
br i1 %cmp, label %for.body, label %for.end53, !llvm.loop !14
for.end53: ; preds = %for.end49, %entry
call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 200005, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
|
#include <stdio.h>
int main(void){
int n;
scanf("%d",&n);
int p[10];
int max=0;
int sum=0;
for(int i=0;i<n;i++){
scanf("%d",&p[i]);
sum+=p[i];
if(p[i]>max)max=p[i];
}
if(sum-2*max>0)printf("Yes\n");
else printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155343/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155343/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%p = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %p) #5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %if.else
for.cond.cleanup: ; preds = %for.body
%1 = shl nuw nsw i32 %spec.select, 1
%cmp9 = icmp sgt i32 %add, %1
br i1 %cmp9, label %if.end13, label %if.else
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.024 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%max.023 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %2, %sum.024
%spec.select = call i32 @llvm.smax.i32(i32 %2, i32 %max.023)
%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.cond.cleanup, !llvm.loop !9
if.else: ; preds = %entry, %for.cond.cleanup
br label %if.end13
if.end13: ; preds = %for.cond.cleanup, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.cond.cleanup ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %p) #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>
#include<math.h>
int main(void)
{
int x;
scanf("%d",&x);
if(x==1){
puts("1");
return 0;
}
int max=0;
for(double i=1;i<=x;i++){
for(double j=2;j<=x;j++){
// printf("%lf\n",pow(i,j));
if(pow(i,j)>max&&pow(i,j)<=x){
max=pow(i,j);
}
}
}
printf("%d\n",max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155387/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155387/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"1\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:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp240 = icmp slt i32 %0, 1
br i1 %cmp240, label %for.cond.cleanup, label %for.cond4.preheader
if.then: ; preds = %entry
%call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
for.cond4.preheader: ; preds = %for.cond.preheader, %for.cond.cleanup8
%1 = phi i32 [ %2, %for.cond.cleanup8 ], [ %0, %for.cond.preheader ]
%i.042 = phi double [ %inc23, %for.cond.cleanup8 ], [ 1.000000e+00, %for.cond.preheader ]
%max.041 = phi i32 [ %max.1.lcssa, %for.cond.cleanup8 ], [ 0, %for.cond.preheader ]
%cmp636 = icmp slt i32 %1, 2
br i1 %cmp636, label %for.cond4.preheader.for.cond.cleanup8_crit_edge, label %for.body9
for.cond4.preheader.for.cond.cleanup8_crit_edge: ; preds = %for.cond4.preheader
%.pre = sitofp i32 %1 to double
br label %for.cond.cleanup8
for.cond.cleanup: ; preds = %for.cond.cleanup8, %for.cond.preheader
%max.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %max.1.lcssa, %for.cond.cleanup8 ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa)
br label %cleanup
for.cond.cleanup8: ; preds = %for.inc, %for.cond4.preheader.for.cond.cleanup8_crit_edge
%conv.pre-phi = phi double [ %.pre, %for.cond4.preheader.for.cond.cleanup8_crit_edge ], [ %conv5, %for.inc ]
%2 = phi i32 [ %1, %for.cond4.preheader.for.cond.cleanup8_crit_edge ], [ %4, %for.inc ]
%max.1.lcssa = phi i32 [ %max.041, %for.cond4.preheader.for.cond.cleanup8_crit_edge ], [ %max.2, %for.inc ]
%inc23 = fadd double %i.042, 1.000000e+00
%cmp2 = fcmp ugt double %inc23, %conv.pre-phi
br i1 %cmp2, label %for.cond.cleanup, label %for.cond4.preheader, !llvm.loop !9
for.body9: ; preds = %for.cond4.preheader, %for.inc
%j.038 = phi double [ %inc, %for.inc ], [ 2.000000e+00, %for.cond4.preheader ]
%max.137 = phi i32 [ %max.2, %for.inc ], [ %max.041, %for.cond4.preheader ]
%call10 = call double @pow(double noundef %i.042, double noundef %j.038) #4
%conv11 = sitofp i32 %max.137 to double
%cmp12 = fcmp ogt double %call10, %conv11
br i1 %cmp12, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body9
%call14 = call double @pow(double noundef %i.042, double noundef %j.038) #4
%3 = load i32, ptr %x, align 4, !tbaa !5
%conv15 = sitofp i32 %3 to double
%cmp16 = fcmp ugt double %call14, %conv15
br i1 %cmp16, label %for.inc, label %if.then18
if.then18: ; preds = %land.lhs.true
%call19 = call double @pow(double noundef %i.042, double noundef %j.038) #4
%conv20 = fptosi double %call19 to i32
br label %for.inc
for.inc: ; preds = %for.body9, %land.lhs.true, %if.then18
%max.2 = phi i32 [ %conv20, %if.then18 ], [ %max.137, %land.lhs.true ], [ %max.137, %for.body9 ]
%inc = fadd double %j.038, 1.000000e+00
%4 = load i32, ptr %x, align 4, !tbaa !5
%conv5 = sitofp i32 %4 to double
%cmp6 = fcmp ugt double %inc, %conv5
br i1 %cmp6, label %for.cond.cleanup8, label %for.body9, !llvm.loop !11
cleanup: ; preds = %for.cond.cleanup, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(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 @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 nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main() {
int t;
scanf("%d", &t);
for(int i = 0; i < t; i++) {
int n;
scanf("%d", &n);
printf("2\n");
if (n == 2) {
printf("2 1\n");
continue;
}
if (n == 3) {
printf("3 1\n2 2\n");
continue;
}
printf("%d %d\n%d %d\n", n, n-2, n-1, n-1);
int i = 3;
while (n-i > 0) {
printf("%d %d\n", n-i+2, n-i);
i++;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15543/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15543/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [13 x i8] c"%d %d\0A%d %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"2\00", align 1
@str.6 = private unnamed_addr constant [8 x i8] c"3 1\0A2 2\00", align 1
@str.7 = private unnamed_addr constant [4 x i8] c"2 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
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
for.body: ; preds = %entry, %cleanup
%i.032 = phi i32 [ %inc18, %cleanup ], [ 0, %entry ]
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)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%1 = load i32, ptr %n, align 4, !tbaa !5
switch i32 %1, label %if.end8 [
i32 2, label %cleanup.sink.split
i32 3, label %if.then6
]
if.then6: ; preds = %for.body
br label %cleanup.sink.split
if.end8: ; preds = %for.body
%sub = add nsw i32 %1, -2
%sub9 = add nsw i32 %1, -1
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %1, i32 noundef %sub, i32 noundef %sub9, i32 noundef %sub9)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp1428 = icmp sgt i32 %2, 3
br i1 %cmp1428, label %while.body.preheader, label %cleanup
while.body.preheader: ; preds = %if.end8
%sub1327 = add nsw i32 %2, -3
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%sub1330 = phi i32 [ %sub13, %while.body ], [ %sub1327, %while.body.preheader ]
%i12.029 = phi i32 [ %inc, %while.body ], [ 3, %while.body.preheader ]
%add = add nuw nsw i32 %sub1330, 2
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %add, i32 noundef %sub1330)
%inc = add nuw nsw i32 %i12.029, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub13 = sub nsw i32 %3, %inc
%cmp14 = icmp sgt i32 %sub13, 0
br i1 %cmp14, label %while.body, label %cleanup, !llvm.loop !9
cleanup.sink.split: ; preds = %for.body, %if.then6
%str.6.sink = phi ptr [ @str.6, %if.then6 ], [ @str.7, %for.body ]
%puts25 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
br label %cleanup
cleanup: ; preds = %while.body, %cleanup.sink.split, %if.end8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
%inc18 = add nuw nsw i32 %i.032, 1
%4 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc18, %4
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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
int main(void){
int X;
int i, j, k;
int max = -1;
int buf;
scanf("%d", &X);
for(i = 1; i <= ((int) sqrt((double) X)); i++){
for(j = 2; j <= 10; j++){
buf = (int) pow((double) i, (double) j);
if(buf > max && buf <= X){
max = buf;
}
}
}
printf("%d\n", max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155473/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155473/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%X = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%0 = load i32, ptr %X, align 4, !tbaa !5
%conv29 = sitofp i32 %0 to double
%call130 = call double @sqrt(double noundef %conv29) #4
%conv231 = fptosi double %call130 to i32
%cmp.not32 = icmp slt i32 %conv231, 1
br i1 %cmp.not32, label %for.end18, label %for.cond4.preheader
for.cond4.preheader: ; preds = %entry, %for.cond4.preheader
%i.034 = phi i32 [ %inc17, %for.cond4.preheader ], [ 1, %entry ]
%max.033 = phi i32 [ %max.2.8, %for.cond4.preheader ], [ -1, %entry ]
%conv8 = sitofp i32 %i.034 to double
%square = fmul double %conv8, %conv8
%conv11 = fptosi double %square to i32
%cmp12 = icmp sge i32 %max.033, %conv11
%1 = load i32, ptr %X, align 4
%cmp14.not = icmp slt i32 %1, %conv11
%or.cond = select i1 %cmp12, i1 true, i1 %cmp14.not
%max.2 = select i1 %or.cond, i32 %max.033, i32 %conv11
%call10.1 = call double @pow(double noundef %conv8, double noundef 3.000000e+00) #4
%conv11.1 = fptosi double %call10.1 to i32
%cmp12.1 = icmp sge i32 %max.2, %conv11.1
%2 = load i32, ptr %X, align 4
%cmp14.not.1 = icmp slt i32 %2, %conv11.1
%or.cond.1 = select i1 %cmp12.1, i1 true, i1 %cmp14.not.1
%max.2.1 = select i1 %or.cond.1, i32 %max.2, i32 %conv11.1
%call10.2 = call double @pow(double noundef %conv8, double noundef 4.000000e+00) #4
%conv11.2 = fptosi double %call10.2 to i32
%cmp12.2 = icmp sge i32 %max.2.1, %conv11.2
%3 = load i32, ptr %X, align 4
%cmp14.not.2 = icmp slt i32 %3, %conv11.2
%or.cond.2 = select i1 %cmp12.2, i1 true, i1 %cmp14.not.2
%max.2.2 = select i1 %or.cond.2, i32 %max.2.1, i32 %conv11.2
%call10.3 = call double @pow(double noundef %conv8, double noundef 5.000000e+00) #4
%conv11.3 = fptosi double %call10.3 to i32
%cmp12.3 = icmp sge i32 %max.2.2, %conv11.3
%4 = load i32, ptr %X, align 4
%cmp14.not.3 = icmp slt i32 %4, %conv11.3
%or.cond.3 = select i1 %cmp12.3, i1 true, i1 %cmp14.not.3
%max.2.3 = select i1 %or.cond.3, i32 %max.2.2, i32 %conv11.3
%call10.4 = call double @pow(double noundef %conv8, double noundef 6.000000e+00) #4
%conv11.4 = fptosi double %call10.4 to i32
%cmp12.4 = icmp sge i32 %max.2.3, %conv11.4
%5 = load i32, ptr %X, align 4
%cmp14.not.4 = icmp slt i32 %5, %conv11.4
%or.cond.4 = select i1 %cmp12.4, i1 true, i1 %cmp14.not.4
%max.2.4 = select i1 %or.cond.4, i32 %max.2.3, i32 %conv11.4
%call10.5 = call double @pow(double noundef %conv8, double noundef 7.000000e+00) #4
%conv11.5 = fptosi double %call10.5 to i32
%cmp12.5 = icmp sge i32 %max.2.4, %conv11.5
%6 = load i32, ptr %X, align 4
%cmp14.not.5 = icmp slt i32 %6, %conv11.5
%or.cond.5 = select i1 %cmp12.5, i1 true, i1 %cmp14.not.5
%max.2.5 = select i1 %or.cond.5, i32 %max.2.4, i32 %conv11.5
%call10.6 = call double @pow(double noundef %conv8, double noundef 8.000000e+00) #4
%conv11.6 = fptosi double %call10.6 to i32
%cmp12.6 = icmp sge i32 %max.2.5, %conv11.6
%7 = load i32, ptr %X, align 4
%cmp14.not.6 = icmp slt i32 %7, %conv11.6
%or.cond.6 = select i1 %cmp12.6, i1 true, i1 %cmp14.not.6
%max.2.6 = select i1 %or.cond.6, i32 %max.2.5, i32 %conv11.6
%call10.7 = call double @pow(double noundef %conv8, double noundef 9.000000e+00) #4
%conv11.7 = fptosi double %call10.7 to i32
%cmp12.7 = icmp sge i32 %max.2.6, %conv11.7
%8 = load i32, ptr %X, align 4
%cmp14.not.7 = icmp slt i32 %8, %conv11.7
%or.cond.7 = select i1 %cmp12.7, i1 true, i1 %cmp14.not.7
%max.2.7 = select i1 %or.cond.7, i32 %max.2.6, i32 %conv11.7
%call10.8 = call double @pow(double noundef %conv8, double noundef 1.000000e+01) #4
%conv11.8 = fptosi double %call10.8 to i32
%cmp12.8 = icmp sge i32 %max.2.7, %conv11.8
%9 = load i32, ptr %X, align 4
%cmp14.not.8 = icmp slt i32 %9, %conv11.8
%or.cond.8 = or i1 %cmp12.8, %cmp14.not.8
%max.2.8 = select i1 %or.cond.8, i32 %max.2.7, i32 %conv11.8
%inc17 = add nuw nsw i32 %i.034, 1
%conv = sitofp i32 %9 to double
%call1 = call double @sqrt(double noundef %conv) #4
%conv2 = fptosi double %call1 to i32
%cmp.not.not = icmp slt i32 %i.034, %conv2
br i1 %cmp.not.not, label %for.cond4.preheader, label %for.end18, !llvm.loop !9
for.end18: ; preds = %for.cond4.preheader, %entry
%max.0.lcssa = phi i32 [ -1, %entry ], [ %max.2.8, %for.cond4.preheader ]
%call19 = 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 %X) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; 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"}
|
#include <stdio.h>
int main() {
int t,n,flag;
scanf("%d",&t);
for(int i=0;i<t;i++){
flag = 0;
scanf("%d",&n);
for(int j=0;j<=n/2;j++){
for(int k=0;k<=n/5;k++){
for(int l=0;l<=n/7;l++){
if(3*j + 5*k + 7*l == n){
flag = 1;
printf("%d %d %d\n",j,k,l);
break;
}
}
if(flag==1)
break;
}
if(flag==1)
break;
}
if(flag!=1)
printf("-1\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15556/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15556/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp69 = icmp sgt i32 %0, 0
br i1 %cmp69, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc39, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
for.body: ; preds = %entry, %for.inc39
%i.070 = phi i32 [ %inc40, %for.inc39 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.not.not65 = icmp slt i32 %1, -1
br i1 %cmp3.not.not65, label %if.then36.loopexit, label %for.cond6.preheader.preheader
for.cond6.preheader.preheader: ; preds = %for.body
%div7 = sdiv i32 %1, 5
%div12 = sdiv i32 %1, 7
%div = sdiv i32 %1, 2
%2 = mul i32 %1, -1227133513
br label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc31
%j.066 = phi i32 [ %inc32, %for.inc31 ], [ 0, %for.cond6.preheader.preheader ]
%3 = mul i32 %j.066, -613566757
%4 = add i32 %2, %3
%mul = mul nuw nsw i32 %j.066, 3
br label %for.cond11.preheader
for.cond11.preheader: ; preds = %for.cond6.preheader, %for.cond11.for.inc24_crit_edge
%k.063 = phi i32 [ %inc25, %for.cond11.for.inc24_crit_edge ], [ 0, %for.cond6.preheader ]
%5 = mul i32 %k.063, 1840700269
%6 = add i32 %4, %5
%umin = call i32 @llvm.umin.i32(i32 %div12, i32 %6)
%7 = add i32 %umin, 1
%mul16 = mul nuw nsw i32 %k.063, 5
%add = add nuw nsw i32 %mul16, %mul
%min.iters.check = icmp ult i32 %7, 17
br i1 %min.iters.check, label %for.body15.preheader, label %vector.ph
vector.ph: ; preds = %for.cond11.preheader
%n.mod.vf = and i32 %7, 15
%8 = icmp eq i32 %n.mod.vf, 0
%9 = select i1 %8, i32 16, i32 %n.mod.vf
%n.vec = sub i32 %7, %9
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%index.next = add nuw i32 %index, 16
%10 = icmp eq i32 %index.next, %n.vec
br i1 %10, label %for.body15.preheader, label %vector.body, !llvm.loop !9
for.body15.preheader: ; preds = %vector.body, %for.cond11.preheader
%l.061.ph = phi i32 [ 0, %for.cond11.preheader ], [ %n.vec, %vector.body ]
br label %for.body15
for.body15: ; preds = %for.body15.preheader, %for.inc
%l.061 = phi i32 [ %inc, %for.inc ], [ %l.061.ph, %for.body15.preheader ]
%mul17 = mul nuw nsw i32 %l.061, 7
%add18 = add nuw nsw i32 %add, %mul17
%cmp19 = icmp eq i32 %add18, %1
br i1 %cmp19, label %cleanup26, label %for.inc
for.inc: ; preds = %for.body15
%inc = add nuw nsw i32 %l.061, 1
%exitcond.not = icmp eq i32 %l.061, %div12
br i1 %exitcond.not, label %for.cond11.for.inc24_crit_edge, label %for.body15, !llvm.loop !13
for.cond11.for.inc24_crit_edge: ; preds = %for.inc
%inc25 = add nuw nsw i32 %k.063, 1
%exitcond75.not = icmp eq i32 %k.063, %div7
br i1 %exitcond75.not, label %for.inc31, label %for.cond11.preheader, !llvm.loop !14
cleanup26: ; preds = %for.body15
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %j.066, i32 noundef %k.063, i32 noundef %l.061)
br label %for.inc39
for.inc31: ; preds = %for.cond11.for.inc24_crit_edge
%inc32 = add nuw nsw i32 %j.066, 1
%cmp3.not.not.not = icmp slt i32 %j.066, %div
br i1 %cmp3.not.not.not, label %for.cond6.preheader, label %if.then36.loopexit, !llvm.loop !15
if.then36.loopexit: ; preds = %for.inc31, %for.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc39
for.inc39: ; preds = %cleanup26, %if.then36.loopexit
%inc40 = add nuw nsw i32 %i.070, 1
%11 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc40, %11
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !16
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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.umin.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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
void reset(int w[1024][1024],int l[]){
int i,j;
for(i = 0;i < 1024;i++){l[i] = 0;}
for(i = 0;i < 1024;i++){
for(j = 0;j < 1024;j++){w[i][j] = 0;}
}
}
int main(void) {
int n,m,w[1024][1024],l[1024],i,j,a,b,res;
while(scanf("%d",&n) , n != 0){
scanf("%d",&m);
res = 0;
reset(w,l);
for(i = 1;i <= m;i++){
scanf("%d%d",&a,&b);
w[a][b]++;
w[b][a]++;
}
for(i = 1;i <= n;i++){
if(w[1][i] == 0){continue;}
l[i] = 1;
for(j = 1;j <= n;j++){
if(w[i][j] != 0){l[j] = 1;}
}
}
for(i = 2;i <= n;i++){if(l[i]){res++;}}
printf("%d\n",res);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155602/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155602/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @reset(ptr nocapture noundef writeonly %w, ptr nocapture noundef writeonly %l) local_unnamed_addr #0 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(4096) %l, i8 0, i64 4096, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(4194304) %w, i8 0, i64 4194304, i1 false), !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%w = alloca [1024 x [1024 x i32]], align 16
%l = alloca [1024 x i32], align 16
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %w) #6
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %l) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
%call75 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not76 = icmp eq i32 %0, 0
br i1 %cmp.not76, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end50
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4096) %l, i8 0, i64 4096, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4194304) %w, i8 0, i64 4194304, i1 false), !tbaa !5
%1 = load i32, ptr %m, align 4, !tbaa !5
%cmp3.not65 = icmp slt i32 %1, 1
br i1 %cmp3.not65, label %for.cond13.preheader, label %for.body
for.cond13.preheader: ; preds = %for.body, %while.body
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp14.not69 = icmp slt i32 %2, 1
br i1 %cmp14.not69, label %for.end50, label %for.body15.preheader
for.body15.preheader: ; preds = %for.cond13.preheader
%3 = add i32 %2, 1
%wide.trip.count81 = zext i32 %3 to i64
%4 = add nsw i64 %wide.trip.count81, -1
%min.iters.check93 = icmp ult i64 %4, 8
%n.vec96 = and i64 %4, -8
%ind.end97 = or i64 %n.vec96, 1
%cmp.n99 = icmp eq i64 %4, %n.vec96
br label %for.body15
for.body: ; preds = %while.body, %for.body
%i.066 = phi i32 [ %inc12, %for.body ], [ 1, %while.body ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%5 = load i32, ptr %a, align 4, !tbaa !5
%idxprom = sext i32 %5 to i64
%6 = load i32, ptr %b, align 4, !tbaa !5
%idxprom5 = sext i32 %6 to i64
%arrayidx6 = getelementptr inbounds [1024 x [1024 x i32]], ptr %w, i64 0, i64 %idxprom, i64 %idxprom5
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%inc = add nsw i32 %7, 1
store i32 %inc, ptr %arrayidx6, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [1024 x [1024 x i32]], ptr %w, i64 0, i64 %idxprom5, i64 %idxprom
%8 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%inc11 = add nsw i32 %8, 1
store i32 %inc11, ptr %arrayidx10, align 4, !tbaa !5
%inc12 = add nuw nsw i32 %i.066, 1
%9 = load i32, ptr %m, align 4, !tbaa !5
%cmp3.not.not = icmp slt i32 %i.066, %9
br i1 %cmp3.not.not, label %for.body, label %for.cond13.preheader, !llvm.loop !9
for.cond40.preheader: ; preds = %for.inc37
%cmp41.not71 = icmp slt i32 %2, 2
br i1 %cmp41.not71, label %for.end50, label %for.body42.preheader
for.body42.preheader: ; preds = %for.cond40.preheader
%10 = add nuw i32 %2, 1
%wide.trip.count86 = zext i32 %10 to i64
%11 = add nsw i64 %wide.trip.count81, -2
%min.iters.check = icmp ult i64 %11, 8
br i1 %min.iters.check, label %for.body42.preheader120, label %vector.ph
vector.ph: ; preds = %for.body42.preheader
%n.vec = and i64 %11, -8
%ind.end = or i64 %n.vec, 2
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%vec.phi89 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%offset.idx = or i64 %index, 2
%12 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %12, align 8, !tbaa !5
%13 = getelementptr inbounds i32, ptr %12, i64 4
%wide.load90 = load <4 x i32>, ptr %13, align 8, !tbaa !5
%14 = icmp ne <4 x i32> %wide.load, zeroinitializer
%15 = icmp ne <4 x i32> %wide.load90, zeroinitializer
%16 = zext <4 x i1> %14 to <4 x i32>
%17 = zext <4 x i1> %15 to <4 x i32>
%18 = add <4 x i32> %vec.phi, %16
%19 = add <4 x i32> %vec.phi89, %17
%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
%bin.rdx = add <4 x i32> %19, %18
%21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %11, %n.vec
br i1 %cmp.n, label %for.end50, label %for.body42.preheader120
for.body42.preheader120: ; preds = %for.body42.preheader, %middle.block
%indvars.iv83.ph = phi i64 [ 2, %for.body42.preheader ], [ %ind.end, %middle.block ]
%res.073.ph = phi i32 [ 0, %for.body42.preheader ], [ %21, %middle.block ]
br label %for.body42
for.body15: ; preds = %for.body15.preheader, %for.inc37
%indvars.iv78 = phi i64 [ 1, %for.body15.preheader ], [ %indvars.iv.next79, %for.inc37 ]
%arrayidx18 = getelementptr inbounds [1024 x [1024 x i32]], ptr %w, i64 0, i64 1, i64 %indvars.iv78
%22 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%cmp19 = icmp eq i32 %22, 0
br i1 %cmp19, label %for.inc37, label %if.end
if.end: ; preds = %for.body15
%arrayidx21 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %indvars.iv78
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
br i1 %min.iters.check93, label %for.body24.preheader, label %vector.body100
vector.body100: ; preds = %if.end, %pred.store.continue118
%index101 = phi i64 [ %index.next119, %pred.store.continue118 ], [ 0, %if.end ]
%offset.idx102 = or i64 %index101, 1
%23 = or i64 %index101, 5
%24 = getelementptr inbounds [1024 x [1024 x i32]], ptr %w, i64 0, i64 %indvars.iv78, i64 %offset.idx102
%wide.load103 = load <4 x i32>, ptr %24, align 4, !tbaa !5
%25 = getelementptr inbounds i32, ptr %24, i64 4
%wide.load104 = load <4 x i32>, ptr %25, align 4, !tbaa !5
%26 = icmp ne <4 x i32> %wide.load103, zeroinitializer
%27 = icmp ne <4 x i32> %wide.load104, zeroinitializer
%28 = extractelement <4 x i1> %26, i64 0
br i1 %28, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body100
%29 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %offset.idx102
store i32 1, ptr %29, align 4, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body100
%30 = extractelement <4 x i1> %26, i64 1
br i1 %30, label %pred.store.if105, label %pred.store.continue106
pred.store.if105: ; preds = %pred.store.continue
%31 = or i64 %index101, 2
%32 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %31
store i32 1, ptr %32, align 8, !tbaa !5
br label %pred.store.continue106
pred.store.continue106: ; preds = %pred.store.if105, %pred.store.continue
%33 = extractelement <4 x i1> %26, i64 2
br i1 %33, label %pred.store.if107, label %pred.store.continue108
pred.store.if107: ; preds = %pred.store.continue106
%34 = or i64 %index101, 3
%35 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %34
store i32 1, ptr %35, align 4, !tbaa !5
br label %pred.store.continue108
pred.store.continue108: ; preds = %pred.store.if107, %pred.store.continue106
%36 = extractelement <4 x i1> %26, i64 3
br i1 %36, label %pred.store.if109, label %pred.store.continue110
pred.store.if109: ; preds = %pred.store.continue108
%37 = or i64 %index101, 4
%38 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %37
store i32 1, ptr %38, align 16, !tbaa !5
br label %pred.store.continue110
pred.store.continue110: ; preds = %pred.store.if109, %pred.store.continue108
%39 = extractelement <4 x i1> %27, i64 0
br i1 %39, label %pred.store.if111, label %pred.store.continue112
pred.store.if111: ; preds = %pred.store.continue110
%40 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %23
store i32 1, ptr %40, align 4, !tbaa !5
br label %pred.store.continue112
pred.store.continue112: ; preds = %pred.store.if111, %pred.store.continue110
%41 = extractelement <4 x i1> %27, i64 1
br i1 %41, label %pred.store.if113, label %pred.store.continue114
pred.store.if113: ; preds = %pred.store.continue112
%42 = or i64 %index101, 6
%43 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %42
store i32 1, ptr %43, align 8, !tbaa !5
br label %pred.store.continue114
pred.store.continue114: ; preds = %pred.store.if113, %pred.store.continue112
%44 = extractelement <4 x i1> %27, i64 2
br i1 %44, label %pred.store.if115, label %pred.store.continue116
pred.store.if115: ; preds = %pred.store.continue114
%45 = or i64 %index101, 7
%46 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %45
store i32 1, ptr %46, align 4, !tbaa !5
br label %pred.store.continue116
pred.store.continue116: ; preds = %pred.store.if115, %pred.store.continue114
%47 = extractelement <4 x i1> %27, i64 3
br i1 %47, label %pred.store.if117, label %pred.store.continue118
pred.store.if117: ; preds = %pred.store.continue116
%48 = add i64 %index101, 8
%49 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %48
store i32 1, ptr %49, align 16, !tbaa !5
br label %pred.store.continue118
pred.store.continue118: ; preds = %pred.store.if117, %pred.store.continue116
%index.next119 = add nuw i64 %index101, 8
%50 = icmp eq i64 %index.next119, %n.vec96
br i1 %50, label %middle.block91, label %vector.body100, !llvm.loop !14
middle.block91: ; preds = %pred.store.continue118
br i1 %cmp.n99, label %for.inc37, label %for.body24.preheader
for.body24.preheader: ; preds = %if.end, %middle.block91
%indvars.iv.ph = phi i64 [ 1, %if.end ], [ %ind.end97, %middle.block91 ]
br label %for.body24
for.body24: ; preds = %for.body24.preheader, %for.inc34
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc34 ], [ %indvars.iv.ph, %for.body24.preheader ]
%arrayidx28 = getelementptr inbounds [1024 x [1024 x i32]], ptr %w, i64 0, i64 %indvars.iv78, i64 %indvars.iv
%51 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%cmp29.not = icmp eq i32 %51, 0
br i1 %cmp29.not, label %for.inc34, label %if.then30
if.then30: ; preds = %for.body24
%arrayidx32 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %indvars.iv
store i32 1, ptr %arrayidx32, align 4, !tbaa !5
br label %for.inc34
for.inc34: ; preds = %for.body24, %if.then30
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count81
br i1 %exitcond.not, label %for.inc37, label %for.body24, !llvm.loop !15
for.inc37: ; preds = %for.inc34, %middle.block91, %for.body15
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
br i1 %exitcond82.not, label %for.cond40.preheader, label %for.body15, !llvm.loop !16
for.body42: ; preds = %for.body42.preheader120, %for.body42
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body42 ], [ %indvars.iv83.ph, %for.body42.preheader120 ]
%res.073 = phi i32 [ %spec.select, %for.body42 ], [ %res.073.ph, %for.body42.preheader120 ]
%arrayidx44 = getelementptr inbounds [1024 x i32], ptr %l, i64 0, i64 %indvars.iv83
%52 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%tobool.not = icmp ne i32 %52, 0
%inc46 = zext i1 %tobool.not to i32
%spec.select = add nuw nsw i32 %res.073, %inc46
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
br i1 %exitcond87.not, label %for.end50, label %for.body42, !llvm.loop !17
for.end50: ; preds = %for.body42, %middle.block, %for.cond13.preheader, %for.cond40.preheader
%res.0.lcssa = phi i32 [ 0, %for.cond40.preheader ], [ 0, %for.cond13.preheader ], [ %21, %middle.block ], [ %spec.select, %for.body42 ]
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %res.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%53 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp eq i32 %53, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !18
while.end: ; preds = %for.end50, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %l) #6
call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %w) #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 nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: 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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12, !13}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !13, !12}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
#include <memory.h>
int main(void){
int N,W,H,i,x,y,map[100][100],S,T,o,sum,sum1,max,j;
for(;sum=0,max=0,memset(map,0,sizeof(map)),scanf("%d",&N),N;){
int W,H;
scanf("%d %d",&W,&H);
for(i=0;i<N;i++){
scanf("%d %d",&x,&y);
map[y][x]=1;
}
scanf("%d %d",&S,&T);
for(i=1;i<=T;i++)
for(o=1;o<=S;o++)
sum+=map[i][o];
sum1=max=sum;
for(i=1;;max < sum ?(max=sum):(max=max)){
for(o=2;o+S-1<=W;o++){
for(j=0;j<T;j++){
sum-=map[i+j][o-1];
sum+=map[i+j][o+S-1];
}
if(max<sum)
max=sum;
}
i++;
if(i+T-1> H)
break;
for(o=1,j=0;j<S;j++){
sum1-=map[i-1][o+j];
sum1+=map[i+T-1][o+j];
}
sum=sum1;
}
printf("%d\n",max);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155653/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155653/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%map = alloca [100 x [100 x i32]], align 16
%S = alloca i32, align 4
%T = alloca i32, align 4
%W1 = alloca i32, align 4
%H2 = 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 %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %map) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %map, i8 0, i64 40000, i1 false)
%call156 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%tobool.not157 = icmp eq i32 %0, 0
br i1 %tobool.not157, label %for.end87, label %for.body
for.body: ; preds = %entry, %for.end85
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W1) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H2) #5
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %W1, ptr noundef nonnull %H2)
%1 = load i32, ptr %N, align 4, !tbaa !5
%cmp127 = icmp sgt i32 %1, 0
br i1 %cmp127, label %for.body5, label %for.end
for.body5: ; preds = %for.body, %for.body5
%i.0128 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%2 = load i32, ptr %y, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%3 = load i32, ptr %x, align 4, !tbaa !5
%idxprom7 = sext i32 %3 to i64
%arrayidx8 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %idxprom, i64 %idxprom7
store i32 1, ptr %arrayidx8, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.0128, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.body
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S, ptr noundef nonnull %T)
%5 = load i32, ptr %T, align 4, !tbaa !5
%cmp11.not132 = icmp slt i32 %5, 1
%.pre = load i32, ptr %S, align 4, !tbaa !5
%cmp14.not129 = icmp slt i32 %.pre, 1
%or.cond = select i1 %cmp11.not132, i1 true, i1 %cmp14.not129
br i1 %or.cond, label %for.cond26.preheader, label %for.cond13.preheader.preheader
for.cond13.preheader.preheader: ; preds = %for.end
%6 = add nuw i32 %.pre, 1
%7 = add nuw i32 %5, 1
%wide.trip.count164 = zext i32 %7 to i64
%wide.trip.count = zext i32 %6 to i64
%8 = add nsw i64 %wide.trip.count, -1
%min.iters.check206 = icmp ult i32 %.pre, 8
%n.vec209 = and i64 %8, -8
%ind.end210 = or i64 %n.vec209, 1
%cmp.n212 = icmp eq i64 %8, %n.vec209
br label %for.cond13.preheader
for.cond26.preheader: ; preds = %for.cond13.for.inc23_crit_edge, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %add.lcssa, %for.cond13.for.inc23_crit_edge ]
%9 = load i32, ptr %W1, align 4, !tbaa !5
%sub142 = add i32 %.pre, 1
%cmp29.not143 = icmp sgt i32 %sub142, %9
%10 = load i32, ptr %H2, align 4, !tbaa !5
%cmp32138 = icmp sgt i32 %5, 0
%cmp63152 = icmp sgt i32 %.pre, 0
%wide.trip.count170 = zext i32 %5 to i64
%wide.trip.count179 = zext i32 %.pre to i64
%11 = add i32 %.pre, 2
%12 = add i32 %9, 1
%smax = call i32 @llvm.smax.i32(i32 %11, i32 %12)
%13 = xor i32 %.pre, -1
%14 = add i32 %smax, %13
%min.iters.check192 = icmp ult i32 %14, 8
%n.vec195 = and i32 %14, -8
%ind.end = or i32 %n.vec195, 2
%cmp.n197 = icmp eq i32 %14, %n.vec195
%xtraiter = and i64 %wide.trip.count170, 1
%15 = icmp eq i32 %5, 1
%unroll_iter = and i64 %wide.trip.count170, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%min.iters.check = icmp ult i32 %.pre, 8
%n.vec = and i64 %wide.trip.count179, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count179
br label %for.cond26
for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.cond13.for.inc23_crit_edge
%indvars.iv161 = phi i64 [ 1, %for.cond13.preheader.preheader ], [ %indvars.iv.next162, %for.cond13.for.inc23_crit_edge ]
%sum.0134 = phi i32 [ 0, %for.cond13.preheader.preheader ], [ %add.lcssa, %for.cond13.for.inc23_crit_edge ]
br i1 %min.iters.check206, label %for.body15.preheader, label %vector.ph207
vector.ph207: ; preds = %for.cond13.preheader
%16 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %sum.0134, i64 0
br label %vector.body213
vector.body213: ; preds = %vector.body213, %vector.ph207
%index214 = phi i64 [ 0, %vector.ph207 ], [ %index.next219, %vector.body213 ]
%vec.phi215 = phi <4 x i32> [ %16, %vector.ph207 ], [ %19, %vector.body213 ]
%vec.phi216 = phi <4 x i32> [ zeroinitializer, %vector.ph207 ], [ %20, %vector.body213 ]
%offset.idx = or i64 %index214, 1
%17 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %indvars.iv161, i64 %offset.idx
%wide.load217 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr inbounds i32, ptr %17, i64 4
%wide.load218 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = add <4 x i32> %wide.load217, %vec.phi215
%20 = add <4 x i32> %wide.load218, %vec.phi216
%index.next219 = add nuw i64 %index214, 8
%21 = icmp eq i64 %index.next219, %n.vec209
br i1 %21, label %middle.block204, label %vector.body213, !llvm.loop !11
middle.block204: ; preds = %vector.body213
%bin.rdx220 = add <4 x i32> %20, %19
%22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx220)
br i1 %cmp.n212, label %for.cond13.for.inc23_crit_edge, label %for.body15.preheader
for.body15.preheader: ; preds = %for.cond13.preheader, %middle.block204
%indvars.iv.ph = phi i64 [ 1, %for.cond13.preheader ], [ %ind.end210, %middle.block204 ]
%sum.1131.ph = phi i32 [ %sum.0134, %for.cond13.preheader ], [ %22, %middle.block204 ]
br label %for.body15
for.body15: ; preds = %for.body15.preheader, %for.body15
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body15 ], [ %indvars.iv.ph, %for.body15.preheader ]
%sum.1131 = phi i32 [ %add, %for.body15 ], [ %sum.1131.ph, %for.body15.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %indvars.iv161, i64 %indvars.iv
%23 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%add = add nsw i32 %23, %sum.1131
%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.for.inc23_crit_edge, label %for.body15, !llvm.loop !14
for.cond13.for.inc23_crit_edge: ; preds = %for.body15, %middle.block204
%add.lcssa = phi i32 [ %22, %middle.block204 ], [ %add, %for.body15 ]
%indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
%exitcond165.not = icmp eq i64 %indvars.iv.next162, %wide.trip.count164
br i1 %exitcond165.not, label %for.cond26.preheader, label %for.cond13.preheader, !llvm.loop !15
for.cond26: ; preds = %for.cond26.preheader, %for.end82
%indvars.iv181 = phi i64 [ 1, %for.cond26.preheader ], [ %indvars.iv.next182, %for.end82 ]
%sum1.0 = phi i32 [ %sum.0.lcssa, %for.cond26.preheader ], [ %sum1.1.lcssa, %for.end82 ]
%max.0 = phi i32 [ %sum.0.lcssa, %for.cond26.preheader ], [ %sum1.1.max.1, %for.end82 ]
br i1 %cmp29.not143, label %for.end55, label %for.cond31.preheader.lr.ph
for.cond31.preheader.lr.ph: ; preds = %for.cond26
br i1 %cmp32138, label %for.cond31.preheader.us, label %for.cond31.preheader.preheader
for.cond31.preheader.preheader: ; preds = %for.cond31.preheader.lr.ph
br i1 %min.iters.check192, label %for.cond31.preheader.preheader222, label %vector.ph193
vector.ph193: ; preds = %for.cond31.preheader.preheader
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %max.0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %sum1.0, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body198
vector.body198: ; preds = %vector.body198, %vector.ph193
%index199 = phi i32 [ 0, %vector.ph193 ], [ %index.next202, %vector.body198 ]
%vec.phi200 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph193 ], [ %24, %vector.body198 ]
%vec.phi201 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph193 ], [ %25, %vector.body198 ]
%24 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi200, <4 x i32> %broadcast.splat)
%25 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi201, <4 x i32> %broadcast.splat)
%index.next202 = add nuw i32 %index199, 8
%26 = icmp eq i32 %index.next202, %n.vec195
br i1 %26, label %middle.block190, label %vector.body198, !llvm.loop !16
middle.block190: ; preds = %vector.body198
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %24, <4 x i32> %25)
%27 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
br i1 %cmp.n197, label %for.end55, label %for.cond31.preheader.preheader222
for.cond31.preheader.preheader222: ; preds = %for.cond31.preheader.preheader, %middle.block190
%max.1146.ph = phi i32 [ %max.0, %for.cond31.preheader.preheader ], [ %27, %middle.block190 ]
%o.1144.ph = phi i32 [ 2, %for.cond31.preheader.preheader ], [ %ind.end, %middle.block190 ]
br label %for.cond31.preheader
for.cond31.preheader.us: ; preds = %for.cond31.preheader.lr.ph, %for.cond31.for.end51_crit_edge.us
%indvars.iv172 = phi i64 [ %indvars.iv.next173, %for.cond31.for.end51_crit_edge.us ], [ 2, %for.cond31.preheader.lr.ph ]
%sub147.us = phi i32 [ %sub.us, %for.cond31.for.end51_crit_edge.us ], [ %sub142, %for.cond31.preheader.lr.ph ]
%max.1146.us = phi i32 [ %spec.select.us, %for.cond31.for.end51_crit_edge.us ], [ %max.0, %for.cond31.preheader.lr.ph ]
%sum.3145.us = phi i32 [ %add48.us.lcssa, %for.cond31.for.end51_crit_edge.us ], [ %sum1.0, %for.cond31.preheader.lr.ph ]
%28 = add nsw i64 %indvars.iv172, -1
%idxprom46.us = sext i32 %sub147.us to i64
br i1 %15, label %for.cond31.for.end51_crit_edge.us.unr-lcssa, label %for.body33.us
for.body33.us: ; preds = %for.cond31.preheader.us, %for.body33.us
%indvars.iv166 = phi i64 [ %indvars.iv.next167.1, %for.body33.us ], [ 0, %for.cond31.preheader.us ]
%sum.4139.us = phi i32 [ %add48.us.1, %for.body33.us ], [ %sum.3145.us, %for.cond31.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.body33.us ], [ 0, %for.cond31.preheader.us ]
%29 = add nuw nsw i64 %indvars.iv166, %indvars.iv181
%arrayidx39.us = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %29, i64 %28
%30 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5
%arrayidx47.us = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %29, i64 %idxprom46.us
%31 = load i32, ptr %arrayidx47.us, align 4, !tbaa !5
%indvars.iv.next167 = or i64 %indvars.iv166, 1
%32 = add nuw nsw i64 %indvars.iv.next167, %indvars.iv181
%arrayidx39.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %32, i64 %28
%33 = load i32, ptr %arrayidx39.us.1, align 4, !tbaa !5
%34 = add i32 %sum.4139.us, %31
%35 = add i32 %30, %33
%sub40.us.1 = sub i32 %34, %35
%arrayidx47.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %32, i64 %idxprom46.us
%36 = load i32, ptr %arrayidx47.us.1, align 4, !tbaa !5
%add48.us.1 = add nsw i32 %sub40.us.1, %36
%indvars.iv.next167.1 = add nuw nsw i64 %indvars.iv166, 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.cond31.for.end51_crit_edge.us.unr-lcssa, label %for.body33.us, !llvm.loop !17
for.cond31.for.end51_crit_edge.us.unr-lcssa: ; preds = %for.body33.us, %for.cond31.preheader.us
%add48.us.lcssa.ph = phi i32 [ undef, %for.cond31.preheader.us ], [ %add48.us.1, %for.body33.us ]
%indvars.iv166.unr = phi i64 [ 0, %for.cond31.preheader.us ], [ %indvars.iv.next167.1, %for.body33.us ]
%sum.4139.us.unr = phi i32 [ %sum.3145.us, %for.cond31.preheader.us ], [ %add48.us.1, %for.body33.us ]
br i1 %lcmp.mod.not, label %for.cond31.for.end51_crit_edge.us, label %for.body33.us.epil
for.body33.us.epil: ; preds = %for.cond31.for.end51_crit_edge.us.unr-lcssa
%37 = add nuw nsw i64 %indvars.iv166.unr, %indvars.iv181
%arrayidx39.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %37, i64 %28
%38 = load i32, ptr %arrayidx39.us.epil, align 4, !tbaa !5
%sub40.us.epil = sub i32 %sum.4139.us.unr, %38
%arrayidx47.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %37, i64 %idxprom46.us
%39 = load i32, ptr %arrayidx47.us.epil, align 4, !tbaa !5
%add48.us.epil = add nsw i32 %sub40.us.epil, %39
br label %for.cond31.for.end51_crit_edge.us
for.cond31.for.end51_crit_edge.us: ; preds = %for.cond31.for.end51_crit_edge.us.unr-lcssa, %for.body33.us.epil
%add48.us.lcssa = phi i32 [ %add48.us.lcssa.ph, %for.cond31.for.end51_crit_edge.us.unr-lcssa ], [ %add48.us.epil, %for.body33.us.epil ]
%spec.select.us = call i32 @llvm.smax.i32(i32 %max.1146.us, i32 %add48.us.lcssa)
%indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
%40 = trunc i64 %indvars.iv172 to i32
%sub.us = add i32 %.pre, %40
%cmp29.not.us = icmp sgt i32 %sub.us, %9
br i1 %cmp29.not.us, label %for.end55, label %for.cond31.preheader.us, !llvm.loop !18
for.cond31.preheader: ; preds = %for.cond31.preheader.preheader222, %for.cond31.preheader
%max.1146 = phi i32 [ %spec.select, %for.cond31.preheader ], [ %max.1146.ph, %for.cond31.preheader.preheader222 ]
%o.1144 = phi i32 [ %inc54, %for.cond31.preheader ], [ %o.1144.ph, %for.cond31.preheader.preheader222 ]
%spec.select = call i32 @llvm.smax.i32(i32 %max.1146, i32 %sum1.0)
%inc54 = add nuw nsw i32 %o.1144, 1
%sub = add i32 %o.1144, %.pre
%cmp29.not = icmp sgt i32 %sub, %9
br i1 %cmp29.not, label %for.end55, label %for.cond31.preheader, !llvm.loop !19
for.end55: ; preds = %for.cond31.preheader, %for.cond31.for.end51_crit_edge.us, %middle.block190, %for.cond26
%max.1.lcssa = phi i32 [ %max.0, %for.cond26 ], [ %27, %middle.block190 ], [ %spec.select.us, %for.cond31.for.end51_crit_edge.us ], [ %spec.select, %for.cond31.preheader ]
%indvars.iv.next182 = add nuw i64 %indvars.iv181, 1
%41 = trunc i64 %indvars.iv181 to i32
%sub58 = add i32 %5, %41
%cmp59 = icmp sgt i32 %sub58, %10
br i1 %cmp59, label %for.end85, label %for.cond62.preheader
for.cond62.preheader: ; preds = %for.end55
br i1 %cmp63152, label %for.body64.lr.ph, label %for.end82
for.body64.lr.ph: ; preds = %for.cond62.preheader
%idxprom74 = sext i32 %sub58 to i64
br i1 %min.iters.check, label %for.body64.preheader, label %vector.ph
vector.ph: ; preds = %for.body64.lr.ph
%42 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %sum1.0, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %42, %vector.ph ], [ %50, %vector.body ]
%vec.phi186 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %51, %vector.body ]
%43 = or i64 %index, 1
%44 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %indvars.iv181, i64 %43
%wide.load = load <4 x i32>, ptr %44, align 4, !tbaa !5
%45 = getelementptr inbounds i32, ptr %44, i64 4
%wide.load187 = load <4 x i32>, ptr %45, align 4, !tbaa !5
%46 = sub <4 x i32> %vec.phi, %wide.load
%47 = sub <4 x i32> %vec.phi186, %wide.load187
%48 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %idxprom74, i64 %43
%wide.load188 = load <4 x i32>, ptr %48, align 4, !tbaa !5
%49 = getelementptr inbounds i32, ptr %48, i64 4
%wide.load189 = load <4 x i32>, ptr %49, align 4, !tbaa !5
%50 = add <4 x i32> %46, %wide.load188
%51 = add <4 x i32> %47, %wide.load189
%index.next = add nuw i64 %index, 8
%52 = icmp eq i64 %index.next, %n.vec
br i1 %52, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %51, %50
%53 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.end82, label %for.body64.preheader
for.body64.preheader: ; preds = %for.body64.lr.ph, %middle.block
%indvars.iv176.ph = phi i64 [ 0, %for.body64.lr.ph ], [ %n.vec, %middle.block ]
%sum1.1153.ph = phi i32 [ %sum1.0, %for.body64.lr.ph ], [ %53, %middle.block ]
br label %for.body64
for.body64: ; preds = %for.body64.preheader, %for.body64
%indvars.iv176 = phi i64 [ %indvars.iv.next177, %for.body64 ], [ %indvars.iv176.ph, %for.body64.preheader ]
%sum1.1153 = phi i32 [ %add79, %for.body64 ], [ %sum1.1153.ph, %for.body64.preheader ]
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%arrayidx70 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %indvars.iv181, i64 %indvars.iv.next177
%54 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%sub71 = sub i32 %sum1.1153, %54
%arrayidx78 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %idxprom74, i64 %indvars.iv.next177
%55 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%add79 = add nsw i32 %sub71, %55
%exitcond180.not = icmp eq i64 %indvars.iv.next177, %wide.trip.count179
br i1 %exitcond180.not, label %for.end82, label %for.body64, !llvm.loop !21
for.end82: ; preds = %for.body64, %middle.block, %for.cond62.preheader
%sum1.1.lcssa = phi i32 [ %sum1.0, %for.cond62.preheader ], [ %53, %middle.block ], [ %add79, %for.body64 ]
%sum1.1.max.1 = call i32 @llvm.smax.i32(i32 %max.1.lcssa, i32 %sum1.1.lcssa)
br label %for.cond26
for.end85: ; preds = %for.end55
%call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.1.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H2) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W1) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %map, i8 0, i64 40000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%56 = load i32, ptr %N, align 4, !tbaa !5
%tobool.not = icmp eq i32 %56, 0
br i1 %tobool.not, label %for.end87, label %for.body, !llvm.loop !22
for.end87: ; preds = %for.end85, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #5
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %map) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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: 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
; 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.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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !12, !13}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !13, !12}
!20 = distinct !{!20, !10, !12, !13}
!21 = distinct !{!21, !10, !13, !12}
!22 = distinct !{!22, !10}
|
#include <stdio.h>
void swap (int *x, int *y) {
int temp; // 値を一時保存する変数
temp = *x;
*x = *y;
*y = temp;
}
/***
* pivotを決め、
* 全データをpivotを境目に振り分け、
* pivotの添え字を返す
***/
int partition (int array[], int left, int right) {
int i, j, pivot;
i = left;
j = right + 1;
pivot = left; // 先頭要素をpivotとする
do {
do { i++; } while (array[i] < array[pivot]);
do { j--; } while (array[pivot] < array[j]);
// pivotより小さいものを左へ、大きいものを右へ
if (i < j) { swap(&array[i], &array[j]); }
} while (i < j);
swap(&array[pivot], &array[j]); //pivotを更新
return j;
}
/* クイックソート */
void quick_sort (int array[], int left, int right) {
int pivot;
if (left < right) {
pivot = partition(array, left, right);
quick_sort(array, left, pivot-1); // pivotを境に再帰的にクイックソート
quick_sort(array, pivot+1, right);
}
}
int main() {
int N;
scanf("%d", &N);
int X[N], Y[N];
for (int i = 0; i < N; i++) {
scanf("%d", &X[i]);
Y[i] = X[i];
}
quick_sort(Y, 0, N - 1);
int m1 = Y[N/2-1], m2 = Y[N/2];
float m = (m1 + m2) / 2.0;
for (int i = 0; i < N; i++) {
if (X[i] < m) {
printf("%d\n", m2);
} else {
printf("%d\n", m1);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155697/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155697/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %array, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %right, 1
%idxprom2 = sext i32 %left to i64
%arrayidx3 = getelementptr inbounds i32, ptr %array, i64 %idxprom2
br label %do.body
do.body: ; preds = %if.then, %entry
%j.0 = phi i32 [ %add, %entry ], [ %6, %if.then ]
%i.0 = phi i32 [ %left, %entry ], [ %3, %if.then ]
%0 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%1 = sext i32 %i.0 to i64
br label %do.body1
do.body1: ; preds = %do.body1, %do.body
%indvars.iv = phi i64 [ %indvars.iv.next, %do.body1 ], [ %1, %do.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp slt i32 %2, %0
br i1 %cmp, label %do.body1, label %do.body4.preheader, !llvm.loop !9
do.body4.preheader: ; preds = %do.body1
%arrayidx.le = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%3 = trunc i64 %indvars.iv.next to i32
%4 = sext i32 %j.0 to i64
br label %do.body4
do.body4: ; preds = %do.body4.preheader, %do.body4
%indvars.iv49 = phi i64 [ %4, %do.body4.preheader ], [ %indvars.iv.next50, %do.body4 ]
%indvars.iv.next50 = add i64 %indvars.iv49, -1
%arrayidx9 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next50
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp slt i32 %0, %5
br i1 %cmp10, label %do.body4, label %do.end11, !llvm.loop !11
do.end11: ; preds = %do.body4
%arrayidx9.le = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next50
%6 = trunc i64 %indvars.iv.next50 to i32
%cmp12 = icmp slt i32 %3, %6
br i1 %cmp12, label %if.then, label %do.end19
if.then: ; preds = %do.end11
store i32 %5, ptr %arrayidx.le, align 4, !tbaa !5
store i32 %2, ptr %arrayidx9.le, align 4, !tbaa !5
br label %do.body, !llvm.loop !12
do.end19: ; preds = %do.end11
store i32 %5, ptr %arrayidx3, align 4, !tbaa !5
store i32 %0, ptr %arrayidx9.le, align 4, !tbaa !5
ret i32 %6
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quick_sort(ptr nocapture noundef %array, i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 {
entry:
%cmp13 = icmp slt i32 %left, %right
br i1 %cmp13, label %if.then.lr.ph, label %if.end
if.then.lr.ph: ; preds = %entry
%add.i = add nsw i32 %right, 1
br label %if.then
if.then: ; preds = %if.then.lr.ph, %partition.exit
%left.tr14 = phi i32 [ %left, %if.then.lr.ph ], [ %add, %partition.exit ]
%idxprom2.i = sext i32 %left.tr14 to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %array, i64 %idxprom2.i
br label %do.body.i
do.body.i: ; preds = %if.then.i, %if.then
%j.0.i = phi i32 [ %add.i, %if.then ], [ %6, %if.then.i ]
%i.0.i = phi i32 [ %left.tr14, %if.then ], [ %5, %if.then.i ]
%0 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%1 = sext i32 %i.0.i to i64
br label %do.body1.i
do.body1.i: ; preds = %do.body1.i, %do.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %do.body1.i ], [ %1, %do.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.i = icmp slt i32 %2, %0
br i1 %cmp.i, label %do.body1.i, label %do.body4.preheader.i, !llvm.loop !9
do.body4.preheader.i: ; preds = %do.body1.i
%arrayidx.i.le = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i
%3 = sext i32 %j.0.i to i64
br label %do.body4.i
do.body4.i: ; preds = %do.body4.i, %do.body4.preheader.i
%indvars.iv49.i = phi i64 [ %3, %do.body4.preheader.i ], [ %indvars.iv.next50.i, %do.body4.i ]
%indvars.iv.next50.i = add i64 %indvars.iv49.i, -1
%arrayidx9.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next50.i
%4 = load i32, ptr %arrayidx9.i, align 4, !tbaa !5
%cmp10.i = icmp slt i32 %0, %4
br i1 %cmp10.i, label %do.body4.i, label %do.end11.i, !llvm.loop !11
do.end11.i: ; preds = %do.body4.i
%arrayidx9.i.le = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next50.i
%5 = trunc i64 %indvars.iv.next.i to i32
%6 = trunc i64 %indvars.iv.next50.i to i32
%cmp12.i = icmp slt i32 %5, %6
br i1 %cmp12.i, label %if.then.i, label %partition.exit
if.then.i: ; preds = %do.end11.i
store i32 %4, ptr %arrayidx.i.le, align 4, !tbaa !5
store i32 %2, ptr %arrayidx9.i.le, align 4, !tbaa !5
br label %do.body.i, !llvm.loop !12
partition.exit: ; preds = %do.end11.i
store i32 %4, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx9.i.le, align 4, !tbaa !5
%sub = add nsw i32 %6, -1
tail call void @quick_sort(ptr noundef nonnull %array, i32 noundef %left.tr14, i32 noundef %sub)
%add = add nsw i32 %6, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
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
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp39 = icmp sgt i32 %3, 0
br i1 %cmp39, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%5 = phi i32 [ %3, %entry ], [ %9, %for.body ]
%sub = add nsw i32 %5, -1
call void @quick_sort(ptr noundef nonnull %vla1, i32 noundef 0, i32 noundef %sub)
%div = sdiv i32 %5, 2
%sub7 = add nsw i32 %div, -1
%idxprom8 = sext i32 %sub7 to i64
%arrayidx9 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom8
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%idxprom11 = sext i32 %div to i64
%arrayidx12 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom11
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%add = add nsw i32 %7, %6
%conv = sitofp i32 %add to double
%div13 = fmul double %conv, 5.000000e-01
%conv14 = fptrunc double %div13 to float
%cmp1741 = icmp sgt i32 %5, 0
br i1 %cmp1741, label %for.body20, label %for.cond.cleanup19
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)
%8 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds i32, ptr %vla1, 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 %N, 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.cond.cleanup, !llvm.loop !13
for.cond.cleanup19: ; preds = %for.body20, %for.cond.cleanup
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7
ret i32 0
for.body20: ; preds = %for.cond.cleanup, %for.body20
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.body20 ], [ 0, %for.cond.cleanup ]
%arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv45
%11 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%conv23 = sitofp i32 %11 to float
%cmp24 = fcmp olt float %conv23, %conv14
%. = select i1 %cmp24, i32 %7, i32 %6
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.)
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%12 = load i32, ptr %N, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp17 = icmp slt i64 %indvars.iv.next46, %13
br i1 %cmp17, label %for.body20, label %for.cond.cleanup19, !llvm.loop !14
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress nocallback nofree nosync nounwind willreturn }
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}
|
#include <stdio.h>
typedef int value_type; /* ソートするキーの型 */
/* x, y, z の中間値を返す */
value_type med3(value_type x, value_type y, value_type z) {
if (x < y) {
if (y < z) return y; else if (z < x) return x; else return z;
} else {
if (z < y) return y; else if (x < z) return x; else return z;
}
}
/* クイックソート
* a : ソートする配列
* left : ソートするデータの開始位置
* right : ソートするデータの終了位置
*/
void quicksort(value_type a[], int left, int right) {
if (left < right) {
int i = left, j = right;
value_type tmp, pivot = med3(a[i], a[i + (j - i) / 2], a[j]); /* (i+j)/2 ではオーバーフローしてしまう */
while (1) { /* a[] を pivot 以上と以下の集まりに分割する */
while (a[i] < pivot) i++; /* a[i] >= pivot となる位置を検索 */
while (pivot < a[j]) j--; /* a[j] <= pivot となる位置を検索 */
if (i >= j) break;
tmp = a[i]; a[i] = a[j]; a[j] = tmp; /* a[i], a[j] を交換 */
i++; j--;
}
quicksort(a, left, i - 1); /* 分割した左を再帰的にソート */
quicksort(a, j + 1, right); /* 分割した右を再帰的にソート */
}
}
int main(void){
int i,n;
int x[200000];
int y[200000];
scanf("%d",&n);
for( i=0; i<n; i++){
scanf("%d",&x[i]);
y[i] = x[i];
}
quicksort( x, 0, n-1);
for( i=0; i<n; i++){
if( y[i] < x[ n/2 ] ) printf("%d\n",x[ n/2 ]);
else printf("%d\n",x[ n/2 - 1 ]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155761/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155761/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @med3(i32 noundef %x, i32 noundef %y, i32 noundef %z) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %x, %y
br i1 %cmp, label %if.then, label %if.else6
if.then: ; preds = %entry
%cmp1 = icmp slt i32 %y, %z
br i1 %cmp1, label %return, label %if.else
if.else: ; preds = %if.then
%x.z = tail call i32 @llvm.smax.i32(i32 %z, i32 %x)
br label %return
if.else6: ; preds = %entry
%cmp7 = icmp slt i32 %z, %y
br i1 %cmp7, label %return, label %if.else9
if.else9: ; preds = %if.else6
%x.z26 = tail call i32 @llvm.smin.i32(i32 %x, i32 %z)
br label %return
return: ; preds = %if.else9, %if.else6, %if.else, %if.then
%retval.0 = phi i32 [ %y, %if.then ], [ %x.z, %if.else ], [ %y, %if.else6 ], [ %x.z26, %if.else9 ]
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quicksort(ptr nocapture noundef %a, i32 noundef %left, i32 noundef %right) local_unnamed_addr #1 {
entry:
%cmp65 = icmp slt i32 %left, %right
br i1 %cmp65, label %if.then.lr.ph, label %if.end31
if.then.lr.ph: ; preds = %entry
%idxprom3 = sext i32 %right to i64
%arrayidx4 = getelementptr inbounds i32, ptr %a, i64 %idxprom3
br label %if.then
if.then: ; preds = %if.then.lr.ph, %while.end28
%left.tr66 = phi i32 [ %left, %if.then.lr.ph ], [ %add30, %while.end28 ]
%idxprom = sext i32 %left.tr66 to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub = sub nsw i32 %right, %left.tr66
%div = sdiv i32 %sub, 2
%add = add nsw i32 %div, %left.tr66
%idxprom1 = sext i32 %add to i64
%arrayidx2 = getelementptr inbounds i32, ptr %a, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp.i = icmp slt i32 %0, %1
br i1 %cmp.i, label %if.then.i, label %if.else6.i
if.then.i: ; preds = %if.then
%cmp1.i = icmp slt i32 %1, %2
br i1 %cmp1.i, label %med3.exit, label %if.else.i
if.else.i: ; preds = %if.then.i
%x.z.i = tail call i32 @llvm.smax.i32(i32 %2, i32 %0)
br label %med3.exit
if.else6.i: ; preds = %if.then
%cmp7.i = icmp slt i32 %2, %1
br i1 %cmp7.i, label %med3.exit, label %if.else9.i
if.else9.i: ; preds = %if.else6.i
%x.z26.i = tail call i32 @llvm.smin.i32(i32 %0, i32 %2)
br label %med3.exit
med3.exit: ; preds = %if.then.i, %if.else.i, %if.else6.i, %if.else9.i
%retval.0.i = phi i32 [ %1, %if.then.i ], [ %x.z.i, %if.else.i ], [ %1, %if.else6.i ], [ %x.z26.i, %if.else9.i ]
br label %while.cond
while.cond: ; preds = %if.end, %med3.exit
%j.0 = phi i32 [ %right, %med3.exit ], [ %dec27, %if.end ]
%i.0 = phi i32 [ %left.tr66, %med3.exit ], [ %inc26, %if.end ]
%3 = sext i32 %i.0 to i64
br label %while.cond5
while.cond5: ; preds = %while.cond5, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond5 ], [ %3, %while.cond ]
%arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8 = icmp slt i32 %4, %retval.0.i
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp8, label %while.cond5, label %while.cond10.preheader, !llvm.loop !9
while.cond10.preheader: ; preds = %while.cond5
%arrayidx7.le = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%5 = trunc i64 %indvars.iv to i32
%6 = sext i32 %j.0 to i64
br label %while.cond10
while.cond10: ; preds = %while.cond10, %while.cond10.preheader
%indvars.iv69 = phi i64 [ %indvars.iv.next70, %while.cond10 ], [ %6, %while.cond10.preheader ]
%arrayidx12 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv69
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp slt i32 %retval.0.i, %7
%indvars.iv.next70 = add i64 %indvars.iv69, -1
br i1 %cmp13, label %while.cond10, label %while.end15, !llvm.loop !11
while.end15: ; preds = %while.cond10
%8 = trunc i64 %indvars.iv69 to i32
%cmp16.not = icmp slt i32 %5, %8
br i1 %cmp16.not, label %if.end, label %while.end28
if.end: ; preds = %while.end15
%arrayidx12.le = getelementptr inbounds i32, ptr %a, i64 %indvars.iv69
store i32 %7, ptr %arrayidx7.le, align 4, !tbaa !5
store i32 %4, ptr %arrayidx12.le, align 4, !tbaa !5
%inc26 = add nsw i32 %5, 1
%dec27 = add nsw i32 %8, -1
br label %while.cond
while.end28: ; preds = %while.end15
%sub29 = add nsw i32 %5, -1
tail call void @quicksort(ptr noundef nonnull %a, i32 noundef %left.tr66, i32 noundef %sub29)
%add30 = add nsw i32 %8, 1
%cmp = icmp slt i32 %add30, %right
br i1 %cmp, label %if.then, label %if.end31
if.end31: ; preds = %while.end28, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%x = alloca [200000 x i32], align 16
%y = alloca [200000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %y) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
call void @quicksort(ptr noundef nonnull %x, i32 noundef 0, i32 noundef %sub44)
br label %for.end25
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x i32], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds [200000 x i32], ptr %y, i64 0, i64 %indvars.iv
store i32 %1, ptr %arrayidx5, align 4, !tbaa !5
%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 !12
for.end: ; preds = %for.body
%sub = add nsw i32 %2, -1
call void @quicksort(ptr noundef nonnull %x, i32 noundef 0, i32 noundef %sub)
%cmp737 = icmp sgt i32 %2, 0
br i1 %cmp737, label %for.body8, label %for.end25
for.body8: ; preds = %for.end, %for.inc23
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.inc23 ], [ 0, %for.end ]
%4 = phi i32 [ %8, %for.inc23 ], [ %2, %for.end ]
%arrayidx10 = getelementptr inbounds [200000 x i32], ptr %y, i64 0, i64 %indvars.iv41
%5 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%div = sdiv i32 %4, 2
%idxprom11 = sext i32 %div to i64
%arrayidx12 = getelementptr inbounds [200000 x i32], ptr %x, i64 0, i64 %idxprom11
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp slt i32 %5, %6
br i1 %cmp13, label %for.inc23, label %if.else
if.else: ; preds = %for.body8
%sub19 = add nsw i32 %div, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [200000 x i32], ptr %x, i64 0, i64 %idxprom20
%7 = load i32, ptr %arrayidx21, align 4, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %for.body8, %if.else
%.sink = phi i32 [ %7, %if.else ], [ %6, %for.body8 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp7 = icmp slt i64 %indvars.iv.next42, %9
br i1 %cmp7, label %for.body8, label %for.end25, !llvm.loop !13
for.end25: ; preds = %for.inc23, %for.end.thread, %for.end
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %x) #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 #4
; 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 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 = { 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 nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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}
|
#include<stdio.h>
int main(){
int i,j,n,m,l,A[100][100],B[100][100],k;
long long int C[100][100],sum=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++){
sum=0;
for(k=0;k<m;k++){
sum += A[i][k] * B[k][j];
}
C[i][j] = sum;
}
}
for(i=0;i<n;i++){
for(j=0;j<l-1;j++){
printf("%lld ",C[i][j]);
}
printf("%lld\n",C[i][l-1]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155804/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155804/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%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
%cmp113 = icmp sgt i32 %0, 0
%.pre182 = 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 %.pre182, 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 ], [ %.pre182, %for.cond1.preheader.lr.ph ]
%indvars.iv148 = phi i64 [ %indvars.iv.next149, %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 [ %.pre182, %entry ], [ %11, %for.inc7 ]
%cmp11117 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp11117, 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 [100 x [100 x i32]], ptr %A, i64 0, i64 %indvars.iv148, 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.next149 = add nuw nsw i64 %indvars.iv148, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next149, %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.iv154 = phi i64 [ %indvars.iv.next155, %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
%.pre184 = 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 ], [ %.pre184, %for.cond27.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %39, %for.cond27.preheader.loopexit ]
%cmp28125 = icmp sgt i32 %15, 0
br i1 %cmp28125, label %for.cond30.preheader.lr.ph, label %for.end81
for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
%.lcssa189 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre182, %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
%cmp31123 = icmp sgt i32 %17, 0
br i1 %cmp31123, label %for.cond30.preheader.lr.ph.split.us, label %for.cond61.preheader.preheader
for.cond61.preheader.preheader.loopexit209.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.cond61.preheader.preheader, label %for.cond30.preheader.us.epil
for.cond30.preheader.us.epil: ; preds = %for.cond61.preheader.preheader.loopexit209.unr-lcssa, %for.cond30.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond30.preheader.us.epil ], [ %indvar.unr, %for.cond61.preheader.preheader.loopexit209.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond30.preheader.us.epil ], [ 0, %for.cond61.preheader.preheader.loopexit209.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.cond61.preheader.preheader, label %for.cond30.preheader.us.epil, !llvm.loop !15
for.cond61.preheader.preheader: ; preds = %for.cond61.preheader.preheader.loopexit209.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.cond61.preheader
for.cond30.preheader.lr.ph.split.us: ; preds = %for.cond30.preheader.lr.ph
%cmp34119 = icmp sgt i32 %.lcssa189, 0
br i1 %cmp34119, 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.cond61.preheader.preheader.loopexit209.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.gep227 = getelementptr i8, ptr %C, i64 1600
%invariant.gep229 = getelementptr i8, ptr %C, i64 2400
%invariant.gep231 = getelementptr i8, ptr %C, i64 3200
%invariant.gep233 = getelementptr i8, ptr %C, i64 4000
%invariant.gep235 = getelementptr i8, ptr %C, i64 4800
%invariant.gep237 = getelementptr i8, ptr %C, i64 5600
br label %for.cond30.preheader.us
for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph.split.us
%wide.trip.count174 = zext i32 %16 to i64
%wide.trip.count169 = zext i32 %17 to i64
%wide.trip.count164 = zext i32 %.lcssa189 to i64
%xtraiter215 = and i64 %wide.trip.count164, 1
%22 = icmp eq i32 %.lcssa189, 1
%unroll_iter219 = and i64 %wide.trip.count164, 4294967294
%lcmp.mod217.not = icmp eq i64 %xtraiter215, 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.iv171 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next172, %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.iv166 = phi i64 [ %indvars.iv.next167, %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.iv161 = phi i64 [ %indvars.iv.next162.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ]
%sum.0121.us.us.us = phi i64 [ %add.us.us.us.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ]
%niter220 = phi i64 [ %niter220.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.iv171, i64 %indvars.iv161
%23 = 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.iv161, i64 %indvars.iv166
%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 %sum.0121.us.us.us, %conv.us.us.us
%indvars.iv.next162 = or i64 %indvars.iv161, 1
%arrayidx39.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %indvars.iv171, i64 %indvars.iv.next162
%25 = 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.next162, i64 %indvars.iv166
%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.next162.1 = add nuw nsw i64 %indvars.iv161, 2
%niter220.next.1 = add i64 %niter220, 2
%niter220.ncmp.1 = icmp eq i64 %niter220.next.1, %unroll_iter219
br i1 %niter220.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.iv161.unr = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %indvars.iv.next162.1, %for.body35.us.us.us ]
%sum.0121.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.mod217.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 [100 x [100 x i32]], ptr %A, i64 0, i64 %indvars.iv171, i64 %indvars.iv161.unr
%27 = 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.iv161.unr, i64 %indvars.iv166
%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 %sum.0121.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 [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv171, i64 %indvars.iv166
store i64 %add.us.us.us.lcssa, ptr %arrayidx50.us.us.us, align 8, !tbaa !13
%indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
%exitcond170.not = icmp eq i64 %indvars.iv.next167, %wide.trip.count169
br i1 %exitcond170.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.next172 = add nuw nsw i64 %indvars.iv171, 1
%exitcond175.not = icmp eq i64 %indvars.iv.next172, %wide.trip.count174
br i1 %exitcond175.not, label %for.cond61.preheader.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, 800
%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, 800
%gep = getelementptr i8, ptr %invariant.gep, i64 %30
call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %20, i1 false), !tbaa !13
%31 = mul nuw i64 %indvar, 800
%gep228 = getelementptr i8, ptr %invariant.gep227, i64 %31
call void @llvm.memset.p0.i64(ptr align 16 %gep228, i8 0, i64 %20, i1 false), !tbaa !13
%32 = mul nuw i64 %indvar, 800
%gep230 = getelementptr i8, ptr %invariant.gep229, i64 %32
call void @llvm.memset.p0.i64(ptr align 16 %gep230, i8 0, i64 %20, i1 false), !tbaa !13
%33 = mul nuw i64 %indvar, 800
%gep232 = getelementptr i8, ptr %invariant.gep231, i64 %33
call void @llvm.memset.p0.i64(ptr align 16 %gep232, i8 0, i64 %20, i1 false), !tbaa !13
%34 = mul nuw i64 %indvar, 800
%gep234 = getelementptr i8, ptr %invariant.gep233, i64 %34
call void @llvm.memset.p0.i64(ptr align 16 %gep234, i8 0, i64 %20, i1 false), !tbaa !13
%35 = mul nuw i64 %indvar, 800
%gep236 = getelementptr i8, ptr %invariant.gep235, i64 %35
call void @llvm.memset.p0.i64(ptr align 16 %gep236, i8 0, i64 %20, i1 false), !tbaa !13
%36 = mul nuw i64 %indvar, 800
%gep238 = getelementptr i8, ptr %invariant.gep237, i64 %36
call void @llvm.memset.p0.i64(ptr align 16 %gep238, 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.cond61.preheader.preheader.loopexit209.unr-lcssa, label %for.cond30.preheader.us, !llvm.loop !19
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv151 = phi i64 [ %indvars.iv.next152, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %B, i64 0, i64 %indvars.iv154, i64 %indvars.iv151
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
%37 = load i32, ptr %l, align 4, !tbaa !5
%38 = sext i32 %37 to i64
%cmp14 = icmp slt i64 %indvars.iv.next152, %38
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !20
for.inc24.loopexit: ; preds = %for.body15
%.pre183 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%39 = phi i32 [ %.pre183, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%40 = phi i32 [ %37, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
%41 = sext i32 %39 to i64
%cmp11 = icmp slt i64 %indvars.iv.next155, %41
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !21
for.cond61.preheader: ; preds = %for.cond61.preheader.preheader, %for.end72
%indvars.iv179 = phi i64 [ %indvars.iv.next180, %for.end72 ], [ 0, %for.cond61.preheader.preheader ]
%42 = load i32, ptr %l, align 4, !tbaa !5
%cmp62136 = icmp sgt i32 %42, 1
br i1 %cmp62136, label %for.body64, label %for.cond61.preheader.for.end72_crit_edge
for.cond61.preheader.for.end72_crit_edge: ; preds = %for.cond61.preheader
%sub135 = add nsw i32 %42, -1
%.pre185 = sext i32 %sub135 to i64
br label %for.end72
for.body64: ; preds = %for.cond61.preheader, %for.body64
%indvars.iv176 = phi i64 [ %indvars.iv.next177, %for.body64 ], [ 0, %for.cond61.preheader ]
%arrayidx68 = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv179, i64 %indvars.iv176
%43 = load i64, ptr %arrayidx68, align 8, !tbaa !13
%call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %43)
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%44 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %44, -1
%45 = sext i32 %sub to i64
%cmp62 = icmp slt i64 %indvars.iv.next177, %45
br i1 %cmp62, label %for.body64, label %for.end72, !llvm.loop !22
for.end72: ; preds = %for.body64, %for.cond61.preheader.for.end72_crit_edge
%idxprom76.pre-phi = phi i64 [ %.pre185, %for.cond61.preheader.for.end72_crit_edge ], [ %45, %for.body64 ]
%arrayidx77 = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv179, i64 %idxprom76.pre-phi
%46 = load i64, ptr %arrayidx77, align 8, !tbaa !13
%call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %46)
%indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
%47 = load i32, ptr %n, align 4, !tbaa !5
%48 = sext i32 %47 to i64
%cmp58 = icmp slt i64 %indvars.iv.next180, %48
br i1 %cmp58, label %for.cond61.preheader, label %for.end81, !llvm.loop !23
for.end81: ; preds = %for.end72, %for.cond27.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 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(void) {
int m,n,l, i, c, k;
int a[100][100], b[100][100];
scanf("%d%d%d", &n, &m, &l);
for(i = 0; n > i; i++){
for(c = 0; m > c; c++){
scanf("%d", &a[i][c]);
}
}
for(i = 0; m > i; i++){
for(c = 0; l > c; c++){
scanf("%d", &b[i][c]);
}
}
for(i = 0; n > i; i++){
for(c = 0; l > c; c++){
long long int buf = 0;
for(k = 0; m > k; k++){
buf += a[i][k] * b[k][c];
}
printf("%lld", buf);
if(c != l-1) printf(" ");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155855/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155855/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%m = alloca i32, align 4
%n = 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
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 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 = 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
%cmp82 = icmp sgt i32 %0, 0
%.pre116 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp82, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre116, 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 ], [ %.pre116, %for.cond1.preheader.lr.ph ]
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp280 = icmp sgt i32 %3, 0
br i1 %cmp280, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre116, %entry ], [ %11, %for.inc7 ]
%cmp1186 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp1186, 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 [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv98, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = trunc i64 %indvars.iv.next to i32
%cmp2 = icmp sgt i32 %8, %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.next99 = add nuw i64 %indvars.iv98, 1
%12 = trunc i64 %indvars.iv.next99 to i32
%cmp = icmp sgt i32 %10, %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.iv104 = phi i64 [ %indvars.iv.next105, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp1484 = icmp sgt i32 %14, 0
br i1 %cmp1484, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre118 = 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 [ %.pre118, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ]
%cmp2893 = icmp sgt i32 %15, 0
br i1 %cmp2893, label %for.cond30.preheader.preheader, label %for.end57
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.iv101 = phi i64 [ %indvars.iv.next102, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv104, i64 %indvars.iv101
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next102 = add nuw i64 %indvars.iv101, 1
%16 = load i32, ptr %l, align 4, !tbaa !5
%17 = trunc i64 %indvars.iv.next102 to i32
%cmp14 = icmp sgt i32 %16, %17
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13
for.inc24.loopexit: ; preds = %for.body15
%.pre117 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%18 = phi i32 [ %.pre117, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next105 = add nuw i64 %indvars.iv104, 1
%20 = trunc i64 %indvars.iv.next105 to i32
%cmp11 = icmp sgt i32 %18, %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.end53
%indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.end53 ], [ 0, %for.cond30.preheader.preheader ]
%21 = load i32, ptr %l, align 4, !tbaa !5
%cmp3191 = icmp sgt i32 %21, 0
br i1 %cmp3191, label %for.cond33.preheader, label %for.end53
for.cond33.preheader: ; preds = %for.cond30.preheader, %if.end
%indvars.iv110 = phi i64 [ %indvars.iv.next111, %if.end ], [ 0, %for.cond30.preheader ]
%22 = load i32, ptr %m, align 4, !tbaa !5
%cmp3488 = icmp sgt i32 %22, 0
br i1 %cmp3488, label %for.body35.lr.ph, label %for.end46
for.body35.lr.ph: ; preds = %for.cond33.preheader
%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.end46.loopexit.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.iv107 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next108.1, %for.body35 ]
%buf.090 = phi i64 [ 0, %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 [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107
%24 = load i32, ptr %arrayidx39, align 8, !tbaa !5
%arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107, i64 %indvars.iv110
%25 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%mul = mul nsw i32 %25, %24
%conv = sext i32 %mul to i64
%add = add nsw i64 %buf.090, %conv
%indvars.iv.next108 = or i64 %indvars.iv107, 1
%arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv.next108
%26 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5
%arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next108, i64 %indvars.iv110
%27 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5
%mul.1 = mul nsw i32 %27, %26
%conv.1 = sext i32 %mul.1 to i64
%add.1 = add nsw i64 %add, %conv.1
%indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15
for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph
%add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ]
%indvars.iv107.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next108.1, %for.body35 ]
%buf.090.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil
for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa
%arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107.unr
%28 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5
%arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107.unr, i64 %indvars.iv110
%29 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5
%mul.epil = mul nsw i32 %29, %28
%conv.epil = sext i32 %mul.epil to i64
%add.epil = add nsw i64 %buf.090.unr, %conv.epil
br label %for.end46
for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader
%buf.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ]
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %buf.0.lcssa)
%30 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %30, -1
%31 = zext i32 %sub to i64
%cmp48.not = icmp eq i64 %indvars.iv110, %31
br i1 %cmp48.not, label %if.end, label %if.then
if.then: ; preds = %for.end46
%putchar79 = call i32 @putchar(i32 32)
%.pre119 = load i32, ptr %l, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.end46
%32 = phi i32 [ %.pre119, %if.then ], [ %30, %for.end46 ]
%indvars.iv.next111 = add nuw i64 %indvars.iv110, 1
%33 = trunc i64 %indvars.iv.next111 to i32
%cmp31 = icmp sgt i32 %32, %33
br i1 %cmp31, label %for.cond33.preheader, label %for.end53, !llvm.loop !16
for.end53: ; preds = %if.end, %for.cond30.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next114 = add nuw i64 %indvars.iv113, 1
%34 = load i32, ptr %n, align 4, !tbaa !5
%35 = trunc i64 %indvars.iv.next114 to i32
%cmp28 = icmp sgt i32 %34, %35
br i1 %cmp28, label %for.cond30.preheader, label %for.end57, !llvm.loop !17
for.end57: ; preds = %for.end53, %for.cond27.preheader
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 %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #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}
!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){
int n,m,l;
int i,j,k;
int a[110][110],b[110][110];
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(j=0;j<m;j++)
for(k=0;k<l;k++)
scanf("%d",&b[j][k]);
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++){
printf("%ld",c[i][j]);
if(j<l-1)
printf(" ");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155899/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155899/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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
%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 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %11, %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 ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre167, %entry ], [ %11, %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 ]
%arrayidx5 = getelementptr inbounds [110 x [110 x i32]], ptr %a, i64 0, i64 %indvars.iv139, 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.next140 = add nuw nsw i64 %indvars.iv139, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next140, %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 [ %28, %for.inc24 ], [ %5, %for.cond10.preheader ]
%14 = phi i32 [ %29, %for.inc24 ], [ %6, %for.cond10.preheader ]
%indvars.iv145 = phi i64 [ %indvars.iv.next146, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp14113 = icmp sgt i32 %14, 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
%15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre169, %for.cond27.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %28, %for.cond27.preheader.loopexit ]
%cmp28121 = icmp sgt i32 %15, 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 ]
%16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%17 = load i32, ptr %l, align 4, !tbaa !5
%cmp31119 = icmp sgt i32 %17, 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 %16 to i64
%wide.trip.count154 = zext i32 %17 to i64
%wide.trip.count = zext i32 %.lcssa174 to i64
%xtraiter = and i64 %wide.trip.count, 1
%18 = 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 [110 x [110 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 %18, 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 ]
%19 = 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 [110 x [110 x i32]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv148
%20 = load i32, ptr %arrayidx39.us.us.us, align 8, !tbaa !5
%arrayidx43.us.us.us = getelementptr inbounds [110 x [110 x i32]], ptr %b, i64 0, i64 %indvars.iv148, i64 %indvars.iv151
%21 = load i32, ptr %arrayidx43.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.next149 = or i64 %indvars.iv148, 1
%arrayidx39.us.us.us.1 = getelementptr inbounds [110 x [110 x i32]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv.next149
%22 = load i32, ptr %arrayidx39.us.us.us.1, align 4, !tbaa !5
%arrayidx43.us.us.us.1 = getelementptr inbounds [110 x [110 x i32]], ptr %b, i64 0, i64 %indvars.iv.next149, i64 %indvars.iv151
%23 = load i32, ptr %arrayidx43.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.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 [110 x [110 x i32]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv148.unr
%24 = load i32, ptr %arrayidx39.us.us.us.epil, align 4, !tbaa !5
%arrayidx43.us.us.us.epil = getelementptr inbounds [110 x [110 x i32]], ptr %b, i64 0, i64 %indvars.iv148.unr, i64 %indvars.iv151
%25 = load i32, ptr %arrayidx43.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.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 ]
%arrayidx19 = getelementptr inbounds [110 x [110 x i32]], ptr %b, i64 0, i64 %indvars.iv145, i64 %indvars.iv142
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
%26 = load i32, ptr %l, align 4, !tbaa !5
%27 = sext i32 %26 to i64
%cmp14 = icmp slt i64 %indvars.iv.next143, %27
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
%28 = phi i32 [ %.pre168, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%29 = phi i32 [ %26, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
%30 = sext i32 %28 to i64
%cmp11 = icmp slt i64 %indvars.iv.next146, %30
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 ]
%31 = load i32, ptr %l, align 4, !tbaa !5
%cmp62129 = icmp sgt i32 %31, 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 [110 x [110 x i64]], ptr %c, i64 0, i64 %indvars.iv164, i64 %indvars.iv161
%32 = load i64, ptr %arrayidx68, align 8, !tbaa !13
%call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %32)
%33 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %33, -1
%34 = sext i32 %sub to i64
%cmp70 = icmp slt i64 %indvars.iv161, %34
br i1 %cmp70, label %if.then, label %for.inc73
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
%35 = phi i32 [ %33, %for.body64 ], [ %.pre170, %if.then ]
%indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
%36 = sext i32 %35 to i64
%cmp62 = icmp slt i64 %indvars.iv.next162, %36
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
%37 = load i32, ptr %n, align 4, !tbaa !5
%38 = sext i32 %37 to i64
%cmp58 = icmp slt i64 %indvars.iv.next165, %38
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 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 = !{!14, !14, i64 0}
!14 = !{!"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,i,j,k;
long long int c[100][100]={0},a[100][100],b[100][100];
scanf("%d %d %d",&n,&m,&l);
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%lld",&a[i][j]);
}
}
for(j=0;j<m;j++){
for(k=0;k<l;k++){
scanf("%lld",&b[j][k]);
}
}
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_155941/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155941/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%c = alloca [100 x [100 x i64]], align 16
%a = alloca [100 x [100 x i64]], align 16
%b = 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 %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 80000, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %b) #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
%cmp108 = icmp sgt i32 %0, 0
%.pre164 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp108, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre164, 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 ], [ %.pre164, %for.cond1.preheader.lr.ph ]
%indvars.iv136 = phi i64 [ %indvars.iv.next137, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2106 = icmp sgt i32 %3, 0
br i1 %cmp2106, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre164, %entry ], [ %11, %for.inc7 ]
%cmp11112 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond181 = select i1 %cmp11112, i1 %7, i1 false
br i1 %or.cond181, 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 i64]], ptr %a, i64 0, i64 %indvars.iv136, 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.next137 = add nuw nsw i64 %indvars.iv136, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next137, %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 [ %28, %for.inc24 ], [ %5, %for.cond10.preheader ]
%14 = phi i32 [ %29, %for.inc24 ], [ %6, %for.cond10.preheader ]
%indvars.iv142 = phi i64 [ %indvars.iv.next143, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp14110 = icmp sgt i32 %14, 0
br i1 %cmp14110, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre166 = 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 ], [ %.pre166, %for.cond27.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %28, %for.cond27.preheader.loopexit ]
%cmp28118 = icmp sgt i32 %15, 0
br i1 %cmp28118, label %for.cond30.preheader.lr.ph, label %for.end76
for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
%.lcssa171 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre164, %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
%cmp31116 = icmp sgt i32 %17, 0
%cmp34114 = icmp sgt i32 %.lcssa171, 0
%or.cond = select i1 %cmp31116, i1 %cmp34114, i1 false
br i1 %or.cond, label %for.cond30.preheader.us.us.preheader, label %for.cond60.preheader.preheader
for.cond60.preheader.preheader: ; preds = %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond30.preheader.lr.ph
br label %for.cond60.preheader
for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph
%wide.trip.count156 = zext i32 %16 to i64
%wide.trip.count151 = zext i32 %17 to i64
%wide.trip.count = zext i32 %.lcssa171 to i64
%xtraiter = and i64 %wide.trip.count, 1
%18 = icmp eq i32 %.lcssa171, 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.iv153 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next154, %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.iv148 = phi i64 [ %indvars.iv.next149, %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.iv153, i64 %indvars.iv148
%arrayidx47.promoted.us.us.us = load i64, ptr %arrayidx47.us.us.us, align 8, !tbaa !13
br i1 %18, 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.iv145 = phi i64 [ %indvars.iv.next146.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ]
%19 = 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 i64]], ptr %a, i64 0, i64 %indvars.iv153, i64 %indvars.iv145
%20 = load i64, ptr %arrayidx39.us.us.us, align 16, !tbaa !13
%arrayidx43.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv145, i64 %indvars.iv148
%21 = load i64, ptr %arrayidx43.us.us.us, align 8, !tbaa !13
%mul.us.us.us = mul nsw i64 %21, %20
%add.us.us.us = add nsw i64 %19, %mul.us.us.us
%indvars.iv.next146 = or i64 %indvars.iv145, 1
%arrayidx39.us.us.us.1 = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %indvars.iv153, i64 %indvars.iv.next146
%22 = load i64, ptr %arrayidx39.us.us.us.1, align 8, !tbaa !13
%arrayidx43.us.us.us.1 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv.next146, i64 %indvars.iv148
%23 = load i64, ptr %arrayidx43.us.us.us.1, align 8, !tbaa !13
%mul.us.us.us.1 = mul nsw i64 %23, %22
%add.us.us.us.1 = add nsw i64 %add.us.us.us, %mul.us.us.us.1
%indvars.iv.next146.1 = add nuw nsw i64 %indvars.iv145, 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.iv145.unr = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %indvars.iv.next146.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 i64]], ptr %a, i64 0, i64 %indvars.iv153, i64 %indvars.iv145.unr
%24 = load i64, ptr %arrayidx39.us.us.us.epil, align 8, !tbaa !13
%arrayidx43.us.us.us.epil = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv145.unr, i64 %indvars.iv148
%25 = load i64, ptr %arrayidx43.us.us.us.epil, align 8, !tbaa !13
%mul.us.us.us.epil = mul nsw i64 %25, %24
%add.us.us.us.epil = add nsw i64 %.unr, %mul.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.next149 = add nuw nsw i64 %indvars.iv148, 1
%exitcond152.not = icmp eq i64 %indvars.iv.next149, %wide.trip.count151
br i1 %exitcond152.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.next154 = add nuw nsw i64 %indvars.iv153, 1
%exitcond157.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count156
br i1 %exitcond157.not, label %for.cond60.preheader.preheader, label %for.cond30.preheader.us.us, !llvm.loop !17
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv139 = phi i64 [ %indvars.iv.next140, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv142, i64 %indvars.iv139
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
%26 = load i32, ptr %l, align 4, !tbaa !5
%27 = sext i32 %26 to i64
%cmp14 = icmp slt i64 %indvars.iv.next140, %27
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !18
for.inc24.loopexit: ; preds = %for.body15
%.pre165 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%28 = phi i32 [ %.pre165, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%29 = phi i32 [ %26, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
%30 = sext i32 %28 to i64
%cmp11 = icmp slt i64 %indvars.iv.next143, %30
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !19
for.cond60.preheader: ; preds = %for.cond60.preheader.preheader, %for.end72
%indvars.iv161 = phi i64 [ %indvars.iv.next162, %for.end72 ], [ 0, %for.cond60.preheader.preheader ]
%31 = load i32, ptr %l, align 4, !tbaa !5
%cmp61126 = icmp sgt i32 %31, 0
br i1 %cmp61126, label %for.body62, label %for.end72
for.body62: ; preds = %for.cond60.preheader, %for.inc70
%indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.inc70 ], [ 0, %for.cond60.preheader ]
%arrayidx66 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv161, i64 %indvars.iv158
%32 = load i64, ptr %arrayidx66, align 8, !tbaa !13
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %32)
%33 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %33, -1
%34 = zext i32 %sub to i64
%cmp68.not = icmp eq i64 %indvars.iv158, %34
br i1 %cmp68.not, label %for.inc70, label %if.then
if.then: ; preds = %for.body62
%putchar105 = call i32 @putchar(i32 32)
%.pre167 = load i32, ptr %l, align 4, !tbaa !5
br label %for.inc70
for.inc70: ; preds = %for.body62, %if.then
%35 = phi i32 [ %33, %for.body62 ], [ %.pre167, %if.then ]
%indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
%36 = sext i32 %35 to i64
%cmp61 = icmp slt i64 %indvars.iv.next159, %36
br i1 %cmp61, label %for.body62, label %for.end72, !llvm.loop !20
for.end72: ; preds = %for.inc70, %for.cond60.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
%37 = load i32, ptr %n, align 4, !tbaa !5
%38 = sext i32 %37 to i64
%cmp58 = icmp slt i64 %indvars.iv.next162, %38
br i1 %cmp58, label %for.cond60.preheader, label %for.end76, !llvm.loop !21
for.end76: ; preds = %for.end72, %for.cond27.preheader
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 80000, ptr nonnull %c) #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 = !{!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>
#define N 100
int main(void){
int n, m, l, a[N][N], b[N][N];
long int c[N][N];
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(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(k = 0; k < m; k++){
c[i][j] += a[i][k] * b[k][j];
}
printf("%ld", c[i][j]);
if(j != l-1){
printf(" ");
}else{
printf("\n");
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155985/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155985/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%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
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 = 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
%cmp99 = icmp sgt i32 %0, 0
%.pre134 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp99, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre134, 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 ], [ %.pre134, %for.cond1.preheader.lr.ph ]
%indvars.iv116 = phi i64 [ %indvars.iv.next117, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp297 = icmp sgt i32 %3, 0
br i1 %cmp297, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre134, %entry ], [ %11, %for.inc7 ]
%cmp11103 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp11103, 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 [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv116, 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.next117 = add nuw nsw i64 %indvars.iv116, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next117, %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 [ %21, %for.inc24 ], [ %5, %for.cond10.preheader ]
%14 = phi i32 [ %22, %for.inc24 ], [ %6, %for.cond10.preheader ]
%indvars.iv122 = phi i64 [ %indvars.iv.next123, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp14101 = icmp sgt i32 %14, 0
br i1 %cmp14101, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre136 = 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 [ %.pre136, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ]
%cmp28110 = icmp sgt i32 %15, 0
br i1 %cmp28110, label %for.cond30.preheader.lr.ph, label %for.end69
for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
%16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%17 = load i32, ptr %l, align 4, !tbaa !5
%18 = icmp sgt i32 %17, 0
br i1 %18, label %for.cond30.preheader, label %for.end69
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv119 = phi i64 [ %indvars.iv.next120, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv122, i64 %indvars.iv119
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
%19 = load i32, ptr %l, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp14 = icmp slt i64 %indvars.iv.next120, %20
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13
for.inc24.loopexit: ; preds = %for.body15
%.pre135 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%21 = phi i32 [ %.pre135, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%22 = phi i32 [ %19, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
%23 = sext i32 %21 to i64
%cmp11 = icmp slt i64 %indvars.iv.next123, %23
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14
for.cond30.preheader: ; preds = %for.cond30.preheader.lr.ph, %for.inc67
%24 = phi i32 [ %39, %for.inc67 ], [ %16, %for.cond30.preheader.lr.ph ]
%25 = phi i32 [ %40, %for.inc67 ], [ %17, %for.cond30.preheader.lr.ph ]
%indvars.iv131 = phi i64 [ %indvars.iv.next132, %for.inc67 ], [ 0, %for.cond30.preheader.lr.ph ]
%cmp31108 = icmp sgt i32 %25, 0
br i1 %cmp31108, label %for.body32, label %for.inc67
for.body32: ; preds = %for.cond30.preheader, %for.end54
%indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.end54 ], [ 0, %for.cond30.preheader ]
%26 = load i32, ptr %m, align 4, !tbaa !5
%cmp38105 = icmp sgt i32 %26, 0
br i1 %cmp38105, label %for.body39.lr.ph, label %for.end54
for.body39.lr.ph: ; preds = %for.body32
%wide.trip.count = zext i32 %26 to i64
%xtraiter = and i64 %wide.trip.count, 1
%27 = icmp eq i32 %26, 1
br i1 %27, label %for.end54.loopexit.unr-lcssa, label %for.body39.lr.ph.new
for.body39.lr.ph.new: ; preds = %for.body39.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body39
for.body39: ; preds = %for.body39, %for.body39.lr.ph.new
%indvars.iv125 = phi i64 [ 0, %for.body39.lr.ph.new ], [ %indvars.iv.next126.1, %for.body39 ]
%add107 = phi i64 [ 0, %for.body39.lr.ph.new ], [ %add.1, %for.body39 ]
%niter = phi i64 [ 0, %for.body39.lr.ph.new ], [ %niter.next.1, %for.body39 ]
%arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv131, i64 %indvars.iv125
%28 = load i32, ptr %arrayidx43, align 8, !tbaa !5
%arrayidx47 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv125, i64 %indvars.iv128
%29 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%mul = mul nsw i32 %29, %28
%conv = sext i32 %mul to i64
%add = add nsw i64 %add107, %conv
%indvars.iv.next126 = or i64 %indvars.iv125, 1
%arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv131, i64 %indvars.iv.next126
%30 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5
%arrayidx47.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next126, i64 %indvars.iv128
%31 = load i32, ptr %arrayidx47.1, align 4, !tbaa !5
%mul.1 = mul nsw i32 %31, %30
%conv.1 = sext i32 %mul.1 to i64
%add.1 = add nsw i64 %add, %conv.1
%indvars.iv.next126.1 = add nuw nsw i64 %indvars.iv125, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end54.loopexit.unr-lcssa, label %for.body39, !llvm.loop !15
for.end54.loopexit.unr-lcssa: ; preds = %for.body39, %for.body39.lr.ph
%add.lcssa.ph = phi i64 [ undef, %for.body39.lr.ph ], [ %add.1, %for.body39 ]
%indvars.iv125.unr = phi i64 [ 0, %for.body39.lr.ph ], [ %indvars.iv.next126.1, %for.body39 ]
%add107.unr = phi i64 [ 0, %for.body39.lr.ph ], [ %add.1, %for.body39 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end54, label %for.body39.epil
for.body39.epil: ; preds = %for.end54.loopexit.unr-lcssa
%arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv131, i64 %indvars.iv125.unr
%32 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5
%arrayidx47.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv125.unr, i64 %indvars.iv128
%33 = load i32, ptr %arrayidx47.epil, align 4, !tbaa !5
%mul.epil = mul nsw i32 %33, %32
%conv.epil = sext i32 %mul.epil to i64
%add.epil = add nsw i64 %add107.unr, %conv.epil
br label %for.end54
for.end54: ; preds = %for.body39.epil, %for.end54.loopexit.unr-lcssa, %for.body32
%34 = phi i64 [ 0, %for.body32 ], [ %add.lcssa.ph, %for.end54.loopexit.unr-lcssa ], [ %add.epil, %for.body39.epil ]
%call59 = 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
%cmp60.not = icmp eq i64 %indvars.iv128, %36
%. = select i1 %cmp60.not, i32 10, i32 32
%putchar96 = call i32 @putchar(i32 %.)
%indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
%37 = load i32, ptr %l, align 4, !tbaa !5
%38 = sext i32 %37 to i64
%cmp31 = icmp slt i64 %indvars.iv.next129, %38
br i1 %cmp31, label %for.body32, label %for.inc67.loopexit, !llvm.loop !16
for.inc67.loopexit: ; preds = %for.end54
%.pre137 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc67
for.inc67: ; preds = %for.inc67.loopexit, %for.cond30.preheader
%39 = phi i32 [ %.pre137, %for.inc67.loopexit ], [ %24, %for.cond30.preheader ]
%40 = phi i32 [ %37, %for.inc67.loopexit ], [ %25, %for.cond30.preheader ]
%indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
%41 = sext i32 %39 to i64
%cmp28 = icmp slt i64 %indvars.iv.next132, %41
br i1 %cmp28, label %for.cond30.preheader, label %for.end69, !llvm.loop !17
for.end69: ; preds = %for.inc67, %for.cond30.preheader.lr.ph, %for.cond27.preheader
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: 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}
!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, !12}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
int row, col;
int productcol;
//??????????????°?????????????????°????¬?????????°
scanf("%d %d %d\n", &row, &col, &productcol);
//??????????????°??¨????????????????????????
int productrow=col;
int i, j;
int num[500][500];
int product[500][500];
//?????°????????????
for (i = 0; i < row;i++) {
char tmp[10000];
//??\???
fgets(tmp, sizeof(tmp), stdin);
num[i][0] = atoi(strtok(tmp," "));
//?????°????????????
for (j = 1; j < col; j++) {
num[i][j] = atoi(strtok(NULL, " "));
}
//?????°??????????????????
}
//?????°??????????????????
//??????????????????
for (i = 0; i < productrow; i++) {
char tmp[15000];
//??\???
fgets(tmp, sizeof(tmp), stdin);
product[i][0] = atoi(strtok(tmp, " "));
//??????????????????
for (j = 1; j < productcol; j++) {
product[i][j] = atoi(strtok(NULL, " "));
}
//?????°??????????????????
}
//????????????????????????
long sum[500][500] = { 0 };
int k;
//?????°???????????? 3???
for (i = 0; i < row; i++) {
//???????????????????????????????????°????§?????????????????????????
for (j = 0; j < productcol; j++) {
//??????????????????
for (k = 0; k < productrow; k++) {
//???????¶?????????????
sum[i][j] += num[i][k] * product[k][j];
}
//????????????????????????
//???????????????????????¨???????????????????¬????
if (j == productcol - 1) {
printf("%ld\n", sum[i][j]);
break;
}
printf("%ld ", sum[i][j]);
}
//????????????????????????
}
//?????°??????????????????
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156041/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156041/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [2 x i8] c" \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:
%row = alloca i32, align 4
%col = alloca i32, align 4
%productcol = alloca i32, align 4
%num = alloca [500 x [500 x i32]], align 16
%product = alloca [500 x [500 x i32]], align 16
%tmp = alloca [10000 x i8], align 16
%tmp21 = alloca [15000 x i8], align 16
%sum = alloca [500 x [500 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %row) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %col) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %productcol) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %row, ptr noundef nonnull %col, ptr noundef nonnull %productcol)
%0 = load i32, ptr %col, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %num) #5
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %product) #5
%1 = load i32, ptr %row, align 4, !tbaa !5
%cmp125 = icmp sgt i32 %1, 0
br i1 %cmp125, label %for.body, label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.end, %entry
%2 = phi i32 [ %1, %entry ], [ %7, %for.end ]
%cmp19129 = icmp sgt i32 %0, 0
br i1 %cmp19129, label %for.body20.preheader, label %for.end44
for.body20.preheader: ; preds = %for.cond18.preheader
%wide.trip.count = zext i32 %0 to i64
br label %for.body20
for.body: ; preds = %entry, %for.end
%indvars.iv145 = phi i64 [ %indvars.iv.next146, %for.end ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %tmp) #5
%3 = load ptr, ptr @stdin, align 8, !tbaa !9
%call1 = call ptr @fgets(ptr noundef nonnull %tmp, i32 noundef 10000, ptr noundef %3)
%call3 = call ptr @strtok(ptr noundef nonnull %tmp, ptr noundef nonnull @.str.1) #5
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %call3, ptr noundef null, i32 noundef 10) #5
%conv.i = trunc i64 %call.i to i32
%arrayidx = getelementptr inbounds [500 x [500 x i32]], ptr %num, i64 0, i64 %indvars.iv145
store i32 %conv.i, ptr %arrayidx, align 16, !tbaa !5
%4 = load i32, ptr %col, align 4, !tbaa !5
%cmp7123 = icmp sgt i32 %4, 1
br i1 %cmp7123, label %for.body8, label %for.end
for.body8: ; preds = %for.body, %for.body8
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ 1, %for.body ]
%call9 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.1) #5
%call.i116 = call i64 @strtol(ptr nocapture noundef nonnull %call9, ptr noundef null, i32 noundef 10) #5
%conv.i117 = trunc i64 %call.i116 to i32
%arrayidx14 = getelementptr inbounds [500 x [500 x i32]], ptr %num, i64 0, i64 %indvars.iv145, i64 %indvars.iv
store i32 %conv.i117, ptr %arrayidx14, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %col, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp7 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp7, label %for.body8, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body8, %for.body
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %tmp) #5
%indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
%7 = load i32, ptr %row, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next146, %8
br i1 %cmp, label %for.body, label %for.cond18.preheader, !llvm.loop !13
for.body20: ; preds = %for.body20.preheader, %for.end41
%indvars.iv151 = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next152, %for.end41 ]
call void @llvm.lifetime.start.p0(i64 15000, ptr nonnull %tmp21) #5
%9 = load ptr, ptr @stdin, align 8, !tbaa !9
%call23 = call ptr @fgets(ptr noundef nonnull %tmp21, i32 noundef 15000, ptr noundef %9)
%call25 = call ptr @strtok(ptr noundef nonnull %tmp21, ptr noundef nonnull @.str.1) #5
%call.i118 = call i64 @strtol(ptr nocapture noundef nonnull %call25, ptr noundef null, i32 noundef 10) #5
%conv.i119 = trunc i64 %call.i118 to i32
%arrayidx28 = getelementptr inbounds [500 x [500 x i32]], ptr %product, i64 0, i64 %indvars.iv151
store i32 %conv.i119, ptr %arrayidx28, align 16, !tbaa !5
%10 = load i32, ptr %productcol, align 4, !tbaa !5
%cmp31127 = icmp sgt i32 %10, 1
br i1 %cmp31127, label %for.body32, label %for.end41
for.body32: ; preds = %for.body20, %for.body32
%indvars.iv148 = phi i64 [ %indvars.iv.next149, %for.body32 ], [ 1, %for.body20 ]
%call33 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.1) #5
%call.i120 = call i64 @strtol(ptr nocapture noundef nonnull %call33, ptr noundef null, i32 noundef 10) #5
%conv.i121 = trunc i64 %call.i120 to i32
%arrayidx38 = getelementptr inbounds [500 x [500 x i32]], ptr %product, i64 0, i64 %indvars.iv151, i64 %indvars.iv148
store i32 %conv.i121, ptr %arrayidx38, align 4, !tbaa !5
%indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
%11 = load i32, ptr %productcol, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp31 = icmp slt i64 %indvars.iv.next149, %12
br i1 %cmp31, label %for.body32, label %for.end41, !llvm.loop !14
for.end41: ; preds = %for.body32, %for.body20
call void @llvm.lifetime.end.p0(i64 15000, ptr nonnull %tmp21) #5
%indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
%exitcond.not = icmp eq i64 %indvars.iv.next152, %wide.trip.count
br i1 %exitcond.not, label %for.end44.loopexit, label %for.body20, !llvm.loop !15
for.end44.loopexit: ; preds = %for.end41
%.pre = load i32, ptr %row, align 4, !tbaa !5
br label %for.end44
for.end44: ; preds = %for.end44.loopexit, %for.cond18.preheader
%13 = phi i32 [ %.pre, %for.end44.loopexit ], [ %2, %for.cond18.preheader ]
call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %sum) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000000) %sum, i8 0, i64 2000000, i1 false)
%cmp46135 = icmp sgt i32 %13, 0
br i1 %cmp46135, label %for.cond48.preheader.lr.ph, label %for.end86
for.cond48.preheader.lr.ph: ; preds = %for.end44
%14 = load i32, ptr %productcol, align 4, !tbaa !5
%15 = icmp sgt i32 %14, 0
br i1 %15, label %for.cond48.preheader.preheader, label %for.end86
for.cond48.preheader.preheader: ; preds = %for.cond48.preheader.lr.ph
%wide.trip.count160 = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count160, 1
%16 = icmp eq i32 %0, 1
%unroll_iter = and i64 %wide.trip.count160, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond48.preheader
for.cond48.preheaderthread-pre-split: ; preds = %for.inc84
%.pr = load i32, ptr %productcol, align 4, !tbaa !5
br label %for.cond48.preheader
for.cond48.preheader: ; preds = %for.cond48.preheaderthread-pre-split, %for.cond48.preheader.preheader
%17 = phi i32 [ %.pr, %for.cond48.preheaderthread-pre-split ], [ %14, %for.cond48.preheader.preheader ]
%indvars.iv165 = phi i64 [ %indvars.iv.next166, %for.cond48.preheaderthread-pre-split ], [ 0, %for.cond48.preheader.preheader ]
%cmp49133 = icmp sgt i32 %17, 0
br i1 %cmp49133, label %for.cond51.preheader.lr.ph, label %for.inc84
for.cond51.preheader.lr.ph: ; preds = %for.cond48.preheader
br i1 %cmp19129, label %for.cond51.preheader.us, label %for.cond51.preheader
for.cond51.preheader.us: ; preds = %for.cond51.preheader.lr.ph, %if.end.us
%indvars.iv162 = phi i64 [ %indvars.iv.next163, %if.end.us ], [ 0, %for.cond51.preheader.lr.ph ]
%18 = phi i32 [ %19, %if.end.us ], [ %17, %for.cond51.preheader.lr.ph ]
%arrayidx65.us = getelementptr inbounds [500 x [500 x i64]], ptr %sum, i64 0, i64 %indvars.iv165, i64 %indvars.iv162
%arrayidx65.promoted.us = load i64, ptr %arrayidx65.us, align 8, !tbaa !16
br i1 %16, label %for.cond51.for.end68_crit_edge.us.unr-lcssa, label %for.body53.us
if.end.us: ; preds = %for.cond51.for.end68_crit_edge.us
%call80.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %add.us.lcssa)
%indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
%19 = load i32, ptr %productcol, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp49.us = icmp slt i64 %indvars.iv.next163, %20
br i1 %cmp49.us, label %for.cond51.preheader.us, label %for.inc84, !llvm.loop !18
for.body53.us: ; preds = %for.cond51.preheader.us, %for.body53.us
%indvars.iv157 = phi i64 [ %indvars.iv.next158.1, %for.body53.us ], [ 0, %for.cond51.preheader.us ]
%21 = phi i64 [ %add.us.1, %for.body53.us ], [ %arrayidx65.promoted.us, %for.cond51.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.body53.us ], [ 0, %for.cond51.preheader.us ]
%arrayidx57.us = getelementptr inbounds [500 x [500 x i32]], ptr %num, i64 0, i64 %indvars.iv165, i64 %indvars.iv157
%22 = load i32, ptr %arrayidx57.us, align 8, !tbaa !5
%arrayidx61.us = getelementptr inbounds [500 x [500 x i32]], ptr %product, i64 0, i64 %indvars.iv157, i64 %indvars.iv162
%23 = load i32, ptr %arrayidx61.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 %21, %conv.us
%indvars.iv.next158 = or i64 %indvars.iv157, 1
%arrayidx57.us.1 = getelementptr inbounds [500 x [500 x i32]], ptr %num, i64 0, i64 %indvars.iv165, i64 %indvars.iv.next158
%24 = load i32, ptr %arrayidx57.us.1, align 4, !tbaa !5
%arrayidx61.us.1 = getelementptr inbounds [500 x [500 x i32]], ptr %product, i64 0, i64 %indvars.iv.next158, i64 %indvars.iv162
%25 = load i32, ptr %arrayidx61.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.next158.1 = add nuw nsw i64 %indvars.iv157, 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.cond51.for.end68_crit_edge.us.unr-lcssa, label %for.body53.us, !llvm.loop !19
for.cond51.for.end68_crit_edge.us.unr-lcssa: ; preds = %for.body53.us, %for.cond51.preheader.us
%add.us.lcssa.ph = phi i64 [ undef, %for.cond51.preheader.us ], [ %add.us.1, %for.body53.us ]
%indvars.iv157.unr = phi i64 [ 0, %for.cond51.preheader.us ], [ %indvars.iv.next158.1, %for.body53.us ]
%.unr = phi i64 [ %arrayidx65.promoted.us, %for.cond51.preheader.us ], [ %add.us.1, %for.body53.us ]
br i1 %lcmp.mod.not, label %for.cond51.for.end68_crit_edge.us, label %for.body53.us.epil
for.body53.us.epil: ; preds = %for.cond51.for.end68_crit_edge.us.unr-lcssa
%arrayidx57.us.epil = getelementptr inbounds [500 x [500 x i32]], ptr %num, i64 0, i64 %indvars.iv165, i64 %indvars.iv157.unr
%26 = load i32, ptr %arrayidx57.us.epil, align 4, !tbaa !5
%arrayidx61.us.epil = getelementptr inbounds [500 x [500 x i32]], ptr %product, i64 0, i64 %indvars.iv157.unr, i64 %indvars.iv162
%27 = load i32, ptr %arrayidx61.us.epil, align 4, !tbaa !5
%mul.us.epil = mul nsw i32 %27, %26
%conv.us.epil = sext i32 %mul.us.epil to i64
%add.us.epil = add nsw i64 %.unr, %conv.us.epil
br label %for.cond51.for.end68_crit_edge.us
for.cond51.for.end68_crit_edge.us: ; preds = %for.cond51.for.end68_crit_edge.us.unr-lcssa, %for.body53.us.epil
%add.us.lcssa = phi i64 [ %add.us.lcssa.ph, %for.cond51.for.end68_crit_edge.us.unr-lcssa ], [ %add.us.epil, %for.body53.us.epil ]
store i64 %add.us.lcssa, ptr %arrayidx65.us, align 8, !tbaa !16
%sub.us = add nsw i32 %18, -1
%28 = zext i32 %sub.us to i64
%cmp69.us = icmp eq i64 %indvars.iv162, %28
br i1 %cmp69.us, label %if.then, label %if.end.us
for.cond51.preheader: ; preds = %for.cond51.preheader.lr.ph, %if.end
%indvars.iv154 = phi i64 [ %indvars.iv.next155, %if.end ], [ 0, %for.cond51.preheader.lr.ph ]
%29 = phi i32 [ %33, %if.end ], [ %17, %for.cond51.preheader.lr.ph ]
%sub = add nsw i32 %29, -1
%30 = zext i32 %sub to i64
%cmp69 = icmp eq i64 %indvars.iv154, %30
br i1 %cmp69, label %if.then, label %if.end
if.then: ; preds = %for.cond51.preheader, %for.cond51.for.end68_crit_edge.us
%.us-phi.in = phi i64 [ %indvars.iv162, %for.cond51.for.end68_crit_edge.us ], [ %indvars.iv154, %for.cond51.preheader ]
%idxprom73 = and i64 %.us-phi.in, 4294967295
%arrayidx74 = getelementptr inbounds [500 x [500 x i64]], ptr %sum, i64 0, i64 %indvars.iv165, i64 %idxprom73
%31 = load i64, ptr %arrayidx74, align 8, !tbaa !16
%call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %31)
br label %for.inc84
if.end: ; preds = %for.cond51.preheader
%arrayidx79 = getelementptr inbounds [500 x [500 x i64]], ptr %sum, i64 0, i64 %indvars.iv165, i64 %indvars.iv154
%32 = load i64, ptr %arrayidx79, align 8, !tbaa !16
%call80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %32)
%indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
%33 = load i32, ptr %productcol, align 4, !tbaa !5
%34 = sext i32 %33 to i64
%cmp49 = icmp slt i64 %indvars.iv.next155, %34
br i1 %cmp49, label %for.cond51.preheader, label %for.inc84, !llvm.loop !18
for.inc84: ; preds = %if.end, %if.end.us, %for.cond48.preheader, %if.then
%indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1
%35 = load i32, ptr %row, align 4, !tbaa !5
%36 = sext i32 %35 to i64
%cmp46 = icmp slt i64 %indvars.iv.next166, %36
br i1 %cmp46, label %for.cond48.preheaderthread-pre-split, label %for.end86, !llvm.loop !20
for.end86: ; preds = %for.inc84, %for.cond48.preheader.lr.ph, %for.end44
call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %sum) #5
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %product) #5
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %num) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %productcol) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %col) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %row) #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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, 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 = { 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 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !21}
!21 = !{!"llvm.loop.unswitch.partial.disable"}
|
#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);
//??????A?????\??? n*m
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%d",&a[i][j]);
}
}
//??????B?????\??? m*l
for(j=0;j<m;j++){
for(k=0;k<l;k++){
scanf("%d",&b[j][k]);
}
}
//?????? C n*l
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_156085/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156085/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 a[10000], b[10000], n, m, l, i, j, k;
long long c;
scanf("%d %d %d", &n, &m, &l);
for (i = 0; i < n; i++)
for (j = 0; j < m; j++)
scanf("%d", a + i * m + j);
for (i = 0; i < m; i++)
for (j = 0; j < l; j++)
scanf("%d", b + i * l + j);
for (i = 0; i < n; i++)
for (j = 0; j < l; j++)
{
c = 0;
for (k = 0; k < m; k++)
c += a[i * m + k] * b[k * l + j];
printf("%ld", c);
if (j != l - 1)
printf(" ");
else
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156135/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156135/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10000 x i32], align 16
%b = alloca [10000 x i32], 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 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
%cmp85 = icmp sgt i32 %0, 0
%.pre114 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp85, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre114, 0
br i1 %1, label %for.cond1.preheader, label %for.cond32.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 ], [ %.pre114, %for.cond1.preheader.lr.ph ]
%i.086 = phi i32 [ %inc8, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp283 = icmp sgt i32 %3, 0
br i1 %cmp283, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %11, %for.inc7 ]
%5 = phi i32 [ %.pre114, %entry ], [ %12, %for.inc7 ]
%cmp1189 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp1189, i1 %7, i1 false
br i1 %or.cond, label %for.cond13.preheader, label %for.cond29.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%8 = phi i32 [ %9, %for.body3 ], [ %3, %for.cond1.preheader ]
%mul = mul nsw i32 %8, %i.086
%idx.ext = sext i32 %mul to i64
%add.ptr = getelementptr inbounds i32, ptr %a, i64 %idx.ext
%add.ptr5 = getelementptr inbounds i32, ptr %add.ptr, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr5)
%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 ]
%inc8 = add nuw nsw i32 %i.086, 1
%cmp = icmp slt i32 %inc8, %11
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc26
%13 = phi i32 [ %22, %for.inc26 ], [ %5, %for.cond10.preheader ]
%14 = phi i32 [ %23, %for.inc26 ], [ %6, %for.cond10.preheader ]
%i.190 = phi i32 [ %inc27, %for.inc26 ], [ 0, %for.cond10.preheader ]
%cmp1487 = icmp sgt i32 %14, 0
br i1 %cmp1487, label %for.body15, label %for.inc26
for.cond29.preheader.loopexit: ; preds = %for.inc26
%.pre116 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond29.preheader
for.cond29.preheader: ; preds = %for.cond29.preheader.loopexit, %for.cond10.preheader
%15 = phi i32 [ %.pre116, %for.cond29.preheader.loopexit ], [ %4, %for.cond10.preheader ]
%cmp3096 = icmp sgt i32 %15, 0
br i1 %cmp3096, label %for.cond32.preheader.lr.ph, label %for.end58
for.cond32.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond29.preheader
%16 = phi i32 [ %15, %for.cond29.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%17 = load i32, ptr %l, align 4, !tbaa !5
%18 = icmp sgt i32 %17, 0
br i1 %18, label %for.cond32.preheader, label %for.end58
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.body15 ], [ 0, %for.cond13.preheader ]
%19 = phi i32 [ %20, %for.body15 ], [ %14, %for.cond13.preheader ]
%mul17 = mul nsw i32 %19, %i.190
%idx.ext18 = sext i32 %mul17 to i64
%add.ptr19 = getelementptr inbounds i32, ptr %b, i64 %idx.ext18
%add.ptr21 = getelementptr inbounds i32, ptr %add.ptr19, i64 %indvars.iv102
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr21)
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%20 = load i32, ptr %l, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp14 = icmp slt i64 %indvars.iv.next103, %21
br i1 %cmp14, label %for.body15, label %for.inc26.loopexit, !llvm.loop !13
for.inc26.loopexit: ; preds = %for.body15
%.pre115 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc26
for.inc26: ; preds = %for.inc26.loopexit, %for.cond13.preheader
%22 = phi i32 [ %.pre115, %for.inc26.loopexit ], [ %13, %for.cond13.preheader ]
%23 = phi i32 [ %20, %for.inc26.loopexit ], [ %14, %for.cond13.preheader ]
%inc27 = add nuw nsw i32 %i.190, 1
%cmp11 = icmp slt i32 %inc27, %22
br i1 %cmp11, label %for.cond13.preheader, label %for.cond29.preheader.loopexit, !llvm.loop !14
for.cond32.preheader: ; preds = %for.cond32.preheader.lr.ph, %for.inc56
%24 = phi i32 [ %67, %for.inc56 ], [ %16, %for.cond32.preheader.lr.ph ]
%25 = phi i32 [ %68, %for.inc56 ], [ %17, %for.cond32.preheader.lr.ph ]
%i.297 = phi i32 [ %inc57, %for.inc56 ], [ 0, %for.cond32.preheader.lr.ph ]
%cmp3394 = icmp sgt i32 %25, 0
br i1 %cmp3394, label %for.cond35.preheader, label %for.inc56
for.cond35.preheader: ; preds = %for.cond32.preheader, %for.end47
%indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.end47 ], [ 0, %for.cond32.preheader ]
%26 = phi i32 [ %65, %for.end47 ], [ %25, %for.cond32.preheader ]
%27 = load i32, ptr %m, align 4, !tbaa !5
%cmp3691 = icmp sgt i32 %27, 0
br i1 %cmp3691, label %for.body37.lr.ph, label %for.end47
for.body37.lr.ph: ; preds = %for.cond35.preheader
%mul38 = mul nsw i32 %27, %i.297
%28 = sext i32 %mul38 to i64
%29 = sext i32 %26 to i64
%wide.trip.count = zext i32 %27 to i64
%min.iters.check = icmp ugt i32 %27, 3
%ident.check.not = icmp eq i32 %26, 1
%or.cond133 = and i1 %min.iters.check, %ident.check.not
br i1 %or.cond133, label %vector.ph, label %for.body37.preheader
vector.ph: ; preds = %for.body37.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %41, %vector.body ]
%vec.phi129 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %42, %vector.body ]
%30 = add nsw i64 %index, %28
%31 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %30
%wide.load = load <2 x i32>, ptr %31, align 4, !tbaa !5
%32 = getelementptr inbounds i32, ptr %31, i64 2
%wide.load130 = load <2 x i32>, ptr %32, align 4, !tbaa !5
%33 = mul nsw i64 %index, %29
%34 = add nsw i64 %33, %indvars.iv111
%35 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %34
%wide.load131 = load <2 x i32>, ptr %35, align 4, !tbaa !5
%36 = getelementptr inbounds i32, ptr %35, i64 2
%wide.load132 = load <2 x i32>, ptr %36, align 4, !tbaa !5
%37 = mul nsw <2 x i32> %wide.load131, %wide.load
%38 = mul nsw <2 x i32> %wide.load132, %wide.load130
%39 = sext <2 x i32> %37 to <2 x i64>
%40 = sext <2 x i32> %38 to <2 x i64>
%41 = add <2 x i64> %vec.phi, %39
%42 = add <2 x i64> %vec.phi129, %40
%index.next = add nuw i64 %index, 4
%43 = icmp eq i64 %index.next, %n.vec
br i1 %43, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %42, %41
%44 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end47, label %for.body37.preheader
for.body37.preheader: ; preds = %for.body37.lr.ph, %middle.block
%indvars.iv105.ph = phi i64 [ 0, %for.body37.lr.ph ], [ %n.vec, %middle.block ]
%c.093.ph = phi i64 [ 0, %for.body37.lr.ph ], [ %44, %middle.block ]
%xtraiter = and i64 %wide.trip.count, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body37.prol.loopexit, label %for.body37.prol
for.body37.prol: ; preds = %for.body37.preheader
%45 = add nsw i64 %indvars.iv105.ph, %28
%arrayidx.prol = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %45
%46 = load i32, ptr %arrayidx.prol, align 4, !tbaa !5
%47 = mul nsw i64 %indvars.iv105.ph, %29
%48 = add nsw i64 %47, %indvars.iv111
%arrayidx42.prol = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %48
%49 = load i32, ptr %arrayidx42.prol, align 4, !tbaa !5
%mul43.prol = mul nsw i32 %49, %46
%conv.prol = sext i32 %mul43.prol to i64
%add44.prol = add nsw i64 %c.093.ph, %conv.prol
%indvars.iv.next106.prol = or i64 %indvars.iv105.ph, 1
br label %for.body37.prol.loopexit
for.body37.prol.loopexit: ; preds = %for.body37.prol, %for.body37.preheader
%add44.lcssa.unr = phi i64 [ undef, %for.body37.preheader ], [ %add44.prol, %for.body37.prol ]
%indvars.iv105.unr = phi i64 [ %indvars.iv105.ph, %for.body37.preheader ], [ %indvars.iv.next106.prol, %for.body37.prol ]
%c.093.unr = phi i64 [ %c.093.ph, %for.body37.preheader ], [ %add44.prol, %for.body37.prol ]
%50 = sub nsw i64 0, %wide.trip.count
%51 = xor i64 %indvars.iv105.ph, %50
%52 = icmp eq i64 %51, -1
br i1 %52, label %for.end47, label %for.body37
for.body37: ; preds = %for.body37.prol.loopexit, %for.body37
%indvars.iv105 = phi i64 [ %indvars.iv.next106.1, %for.body37 ], [ %indvars.iv105.unr, %for.body37.prol.loopexit ]
%c.093 = phi i64 [ %add44.1, %for.body37 ], [ %c.093.unr, %for.body37.prol.loopexit ]
%53 = add nsw i64 %indvars.iv105, %28
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %53
%54 = load i32, ptr %arrayidx, align 4, !tbaa !5
%55 = mul nsw i64 %indvars.iv105, %29
%56 = add nsw i64 %55, %indvars.iv111
%arrayidx42 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %56
%57 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%mul43 = mul nsw i32 %57, %54
%conv = sext i32 %mul43 to i64
%add44 = add nsw i64 %c.093, %conv
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%58 = add nsw i64 %indvars.iv.next106, %28
%arrayidx.1 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %58
%59 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%60 = mul nsw i64 %indvars.iv.next106, %29
%61 = add nsw i64 %60, %indvars.iv111
%arrayidx42.1 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %61
%62 = load i32, ptr %arrayidx42.1, align 4, !tbaa !5
%mul43.1 = mul nsw i32 %62, %59
%conv.1 = sext i32 %mul43.1 to i64
%add44.1 = add nsw i64 %add44, %conv.1
%indvars.iv.next106.1 = add nuw nsw i64 %indvars.iv105, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next106.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.end47, label %for.body37, !llvm.loop !18
for.end47: ; preds = %for.body37.prol.loopexit, %for.body37, %middle.block, %for.cond35.preheader
%c.0.lcssa = phi i64 [ 0, %for.cond35.preheader ], [ %44, %middle.block ], [ %add44.lcssa.unr, %for.body37.prol.loopexit ], [ %add44.1, %for.body37 ]
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %c.0.lcssa)
%63 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %63, -1
%64 = zext i32 %sub to i64
%cmp49.not = icmp eq i64 %indvars.iv111, %64
%. = select i1 %cmp49.not, i32 10, i32 32
%putchar82 = call i32 @putchar(i32 %.)
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%65 = load i32, ptr %l, align 4, !tbaa !5
%66 = sext i32 %65 to i64
%cmp33 = icmp slt i64 %indvars.iv.next112, %66
br i1 %cmp33, label %for.cond35.preheader, label %for.inc56.loopexit, !llvm.loop !19
for.inc56.loopexit: ; preds = %for.end47
%.pre117 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc56
for.inc56: ; preds = %for.inc56.loopexit, %for.cond32.preheader
%67 = phi i32 [ %.pre117, %for.inc56.loopexit ], [ %24, %for.cond32.preheader ]
%68 = phi i32 [ %65, %for.inc56.loopexit ], [ %25, %for.cond32.preheader ]
%inc57 = add nuw nsw i32 %i.297, 1
%cmp30 = icmp slt i32 %inc57, %67
br i1 %cmp30, label %for.cond32.preheader, label %for.end58, !llvm.loop !20
for.end58: ; preds = %for.inc56, %for.cond32.preheader.lr.ph, %for.cond29.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 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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"}
!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, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !16}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !12}
|
#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_156179/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156179/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 argc, char * argv[])
{
int n,m,l,A,B,C;
long long a[101][101]={0};
long long b[101][101]={0};
long long c[101][101]={0};
scanf("%d %d %d",&n,&m,&l);
//行列aの入力
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
scanf("%d", &A);
a[i][j] = A;
}
}
//行列bの入力
for(int j=0;j<m;j++){
for(int k=0;k<l;k++){
scanf("%d", &B);
b[j][k] = B;
}
}
//行列aと行列bの計算
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] += a[i][k]*b[k][j];
}
}
}
//結果を出力
for(int i=0;i<n;i++){
for(int j=0;j<l;j++){
printf("%lld", c[i][j]);
c[i][j] = C;
if(j!=l-1){
printf(" ");
}
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156221/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156221/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%m = alloca i32, align 4
%l = alloca i32, align 4
%A = alloca i32, align 4
%B = alloca i32, align 4
%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 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 %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81608) %a, i8 0, i64 81608, i1 false)
call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %b) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81608) %b, i8 0, i64 81608, i1 false)
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 i32, ptr %n, align 4, !tbaa !5
%cmp138 = icmp sgt i32 %0, 0
%.pre206 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp138, label %for.cond1.preheader.lr.ph, label %for.cond12.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre206, 0
br i1 %1, label %for.cond1.preheader, label %for.cond41.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 ], [ %.pre206, %for.cond1.preheader.lr.ph ]
%indvars.iv169 = phi i64 [ %indvars.iv.next170, %for.cond.cleanup3 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2136 = icmp sgt i32 %3, 0
br i1 %cmp2136, 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 [ %.pre206, %entry ], [ %9, %for.cond.cleanup3 ]
%cmp13142 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp13142, i1 %7, i1 false
br i1 %or.cond, label %for.cond17.preheader, label %for.cond35.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 [ %12, %for.cond.cleanup3.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1
%10 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next170, %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 ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A)
%11 = load i32, ptr %A, align 4, !tbaa !5
%conv = sext i32 %11 to i64
%arrayidx7 = getelementptr inbounds [101 x [101 x i64]], ptr %a, i64 0, i64 %indvars.iv169, i64 %indvars.iv
store i64 %conv, ptr %arrayidx7, align 8, !tbaa !12
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr %m, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp2, label %for.body4, label %for.cond.cleanup3.loopexit, !llvm.loop !14
for.cond17.preheader: ; preds = %for.cond12.preheader, %for.cond.cleanup20
%14 = phi i32 [ %38, %for.cond.cleanup20 ], [ %5, %for.cond12.preheader ]
%15 = phi i32 [ %39, %for.cond.cleanup20 ], [ %6, %for.cond12.preheader ]
%indvars.iv175 = phi i64 [ %indvars.iv.next176, %for.cond.cleanup20 ], [ 0, %for.cond12.preheader ]
%cmp18140 = icmp sgt i32 %15, 0
br i1 %cmp18140, label %for.body21, label %for.cond.cleanup20
for.cond35.preheader.loopexit: ; preds = %for.cond.cleanup20
%.pre208 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond35.preheader
for.cond35.preheader: ; preds = %for.cond35.preheader.loopexit, %for.cond12.preheader
%16 = phi i32 [ %4, %for.cond12.preheader ], [ %.pre208, %for.cond35.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond12.preheader ], [ %38, %for.cond35.preheader.loopexit ]
%cmp36149 = icmp sgt i32 %16, 0
br i1 %cmp36149, label %for.cond41.preheader.lr.ph, label %for.cond.cleanup81
for.cond41.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond35.preheader
%.lcssa213 = phi i32 [ %.lcssa, %for.cond35.preheader ], [ %.pre206, %for.cond1.preheader.lr.ph ]
%17 = phi i32 [ %16, %for.cond35.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%18 = load i32, ptr %l, align 4, !tbaa !5
%cmp42147 = icmp sgt i32 %18, 0
br i1 %cmp42147, label %for.cond41.preheader.lr.ph.split.us, label %for.cond84.preheader.preheader
for.cond84.preheader.preheader.loopexit230.unr-lcssa: ; preds = %for.cond41.preheader.us, %for.cond41.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond41.preheader.us.preheader ], [ %indvar.next.7, %for.cond41.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond84.preheader.preheader, label %for.cond41.preheader.us.epil
for.cond41.preheader.us.epil: ; preds = %for.cond84.preheader.preheader.loopexit230.unr-lcssa, %for.cond41.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond41.preheader.us.epil ], [ %indvar.unr, %for.cond84.preheader.preheader.loopexit230.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond41.preheader.us.epil ], [ 0, %for.cond84.preheader.preheader.loopexit230.unr-lcssa ]
%19 = mul nuw nsw i64 %indvar.epil, 808
%scevgep.epil = getelementptr i8, ptr %c, i64 %19
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %21, i1 false), !tbaa !12
%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.cond84.preheader.preheader, label %for.cond41.preheader.us.epil, !llvm.loop !15
for.cond84.preheader.preheader: ; preds = %for.cond84.preheader.preheader.loopexit230.unr-lcssa, %for.cond41.preheader.us.epil, %for.cond41.for.cond.cleanup44_crit_edge.split.us.us.us, %for.cond41.preheader.lr.ph
br label %for.cond84.preheader
for.cond41.preheader.lr.ph.split.us: ; preds = %for.cond41.preheader.lr.ph
%cmp52144 = icmp sgt i32 %.lcssa213, 0
br i1 %cmp52144, label %for.cond41.preheader.us.us.preheader, label %for.cond41.preheader.us.preheader
for.cond41.preheader.us.preheader: ; preds = %for.cond41.preheader.lr.ph.split.us
%20 = zext i32 %18 to i64
%21 = shl nuw nsw i64 %20, 3
%wide.trip.count = zext i32 %17 to i64
%xtraiter = and i64 %wide.trip.count, 7
%22 = icmp ult i32 %17, 8
br i1 %22, label %for.cond84.preheader.preheader.loopexit230.unr-lcssa, label %for.cond41.preheader.us.preheader.new
for.cond41.preheader.us.preheader.new: ; preds = %for.cond41.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
%invariant.gep = getelementptr i8, ptr %c, i64 808
%invariant.gep247 = getelementptr i8, ptr %c, i64 1616
%invariant.gep249 = getelementptr i8, ptr %c, i64 2424
%invariant.gep251 = getelementptr i8, ptr %c, i64 3232
%invariant.gep253 = getelementptr i8, ptr %c, i64 4040
%invariant.gep255 = getelementptr i8, ptr %c, i64 4848
%invariant.gep257 = getelementptr i8, ptr %c, i64 5656
br label %for.cond41.preheader.us
for.cond41.preheader.us.us.preheader: ; preds = %for.cond41.preheader.lr.ph.split.us
%wide.trip.count198 = zext i32 %17 to i64
%wide.trip.count193 = zext i32 %18 to i64
%wide.trip.count185 = zext i32 %.lcssa213 to i64
%xtraiter236 = and i64 %wide.trip.count185, 1
%23 = icmp eq i32 %.lcssa213, 1
%unroll_iter240 = and i64 %wide.trip.count185, 4294967294
%lcmp.mod238.not = icmp eq i64 %xtraiter236, 0
br label %for.cond41.preheader.us.us
for.cond41.preheader.us.us: ; preds = %for.cond41.preheader.us.us.preheader, %for.cond41.for.cond.cleanup44_crit_edge.split.us.us.us
%indvars.iv195 = phi i64 [ 0, %for.cond41.preheader.us.us.preheader ], [ %indvars.iv.next196, %for.cond41.for.cond.cleanup44_crit_edge.split.us.us.us ]
br label %for.body45.us.us.us
for.body45.us.us.us: ; preds = %for.cond51.for.cond.cleanup54_crit_edge.us.us.us, %for.cond41.preheader.us.us
%indvars.iv190 = phi i64 [ %indvars.iv.next191, %for.cond51.for.cond.cleanup54_crit_edge.us.us.us ], [ 0, %for.cond41.preheader.us.us ]
%arrayidx49.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv195, i64 %indvars.iv190
br i1 %23, label %for.cond51.for.cond.cleanup54_crit_edge.us.us.us.unr-lcssa, label %for.body55.us.us.us
for.body55.us.us.us: ; preds = %for.body45.us.us.us, %for.body55.us.us.us
%indvars.iv182 = phi i64 [ %indvars.iv.next183.1, %for.body55.us.us.us ], [ 0, %for.body45.us.us.us ]
%add146.us.us.us = phi i64 [ %add.us.us.us.1, %for.body55.us.us.us ], [ 0, %for.body45.us.us.us ]
%niter241 = phi i64 [ %niter241.next.1, %for.body55.us.us.us ], [ 0, %for.body45.us.us.us ]
%arrayidx59.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %a, i64 0, i64 %indvars.iv195, i64 %indvars.iv182
%24 = load i64, ptr %arrayidx59.us.us.us, align 8, !tbaa !12
%arrayidx63.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %b, i64 0, i64 %indvars.iv182, i64 %indvars.iv190
%25 = load i64, ptr %arrayidx63.us.us.us, align 8, !tbaa !12
%mul.us.us.us = mul nsw i64 %25, %24
%add.us.us.us = add nsw i64 %add146.us.us.us, %mul.us.us.us
%indvars.iv.next183 = or i64 %indvars.iv182, 1
%arrayidx59.us.us.us.1 = getelementptr inbounds [101 x [101 x i64]], ptr %a, i64 0, i64 %indvars.iv195, i64 %indvars.iv.next183
%26 = load i64, ptr %arrayidx59.us.us.us.1, align 8, !tbaa !12
%arrayidx63.us.us.us.1 = getelementptr inbounds [101 x [101 x i64]], ptr %b, i64 0, i64 %indvars.iv.next183, i64 %indvars.iv190
%27 = load i64, ptr %arrayidx63.us.us.us.1, align 8, !tbaa !12
%mul.us.us.us.1 = mul nsw i64 %27, %26
%add.us.us.us.1 = add nsw i64 %add.us.us.us, %mul.us.us.us.1
%indvars.iv.next183.1 = add nuw nsw i64 %indvars.iv182, 2
%niter241.next.1 = add i64 %niter241, 2
%niter241.ncmp.1 = icmp eq i64 %niter241.next.1, %unroll_iter240
br i1 %niter241.ncmp.1, label %for.cond51.for.cond.cleanup54_crit_edge.us.us.us.unr-lcssa, label %for.body55.us.us.us, !llvm.loop !17
for.cond51.for.cond.cleanup54_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body55.us.us.us, %for.body45.us.us.us
%add.us.us.us.lcssa.ph = phi i64 [ undef, %for.body45.us.us.us ], [ %add.us.us.us.1, %for.body55.us.us.us ]
%indvars.iv182.unr = phi i64 [ 0, %for.body45.us.us.us ], [ %indvars.iv.next183.1, %for.body55.us.us.us ]
%add146.us.us.us.unr = phi i64 [ 0, %for.body45.us.us.us ], [ %add.us.us.us.1, %for.body55.us.us.us ]
br i1 %lcmp.mod238.not, label %for.cond51.for.cond.cleanup54_crit_edge.us.us.us, label %for.body55.us.us.us.epil
for.body55.us.us.us.epil: ; preds = %for.cond51.for.cond.cleanup54_crit_edge.us.us.us.unr-lcssa
%arrayidx59.us.us.us.epil = getelementptr inbounds [101 x [101 x i64]], ptr %a, i64 0, i64 %indvars.iv195, i64 %indvars.iv182.unr
%28 = load i64, ptr %arrayidx59.us.us.us.epil, align 8, !tbaa !12
%arrayidx63.us.us.us.epil = getelementptr inbounds [101 x [101 x i64]], ptr %b, i64 0, i64 %indvars.iv182.unr, i64 %indvars.iv190
%29 = load i64, ptr %arrayidx63.us.us.us.epil, align 8, !tbaa !12
%mul.us.us.us.epil = mul nsw i64 %29, %28
%add.us.us.us.epil = add nsw i64 %add146.us.us.us.unr, %mul.us.us.us.epil
br label %for.cond51.for.cond.cleanup54_crit_edge.us.us.us
for.cond51.for.cond.cleanup54_crit_edge.us.us.us: ; preds = %for.cond51.for.cond.cleanup54_crit_edge.us.us.us.unr-lcssa, %for.body55.us.us.us.epil
%add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond51.for.cond.cleanup54_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body55.us.us.us.epil ]
store i64 %add.us.us.us.lcssa, ptr %arrayidx49.us.us.us, align 8, !tbaa !12
%indvars.iv.next191 = add nuw nsw i64 %indvars.iv190, 1
%exitcond194.not = icmp eq i64 %indvars.iv.next191, %wide.trip.count193
br i1 %exitcond194.not, label %for.cond41.for.cond.cleanup44_crit_edge.split.us.us.us, label %for.body45.us.us.us, !llvm.loop !18
for.cond41.for.cond.cleanup44_crit_edge.split.us.us.us: ; preds = %for.cond51.for.cond.cleanup54_crit_edge.us.us.us
%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.cond84.preheader.preheader, label %for.cond41.preheader.us.us, !llvm.loop !19
for.cond41.preheader.us: ; preds = %for.cond41.preheader.us, %for.cond41.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond41.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond41.preheader.us ]
%niter = phi i64 [ 0, %for.cond41.preheader.us.preheader.new ], [ %niter.next.7, %for.cond41.preheader.us ]
%30 = mul nuw nsw i64 %indvar, 808
%scevgep = getelementptr i8, ptr %c, i64 %30
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %21, i1 false), !tbaa !12
%31 = mul nuw i64 %indvar, 808
%gep = getelementptr i8, ptr %invariant.gep, i64 %31
call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %21, i1 false), !tbaa !12
%32 = mul nuw i64 %indvar, 808
%gep248 = getelementptr i8, ptr %invariant.gep247, i64 %32
call void @llvm.memset.p0.i64(ptr align 16 %gep248, i8 0, i64 %21, i1 false), !tbaa !12
%33 = mul nuw i64 %indvar, 808
%gep250 = getelementptr i8, ptr %invariant.gep249, i64 %33
call void @llvm.memset.p0.i64(ptr align 8 %gep250, i8 0, i64 %21, i1 false), !tbaa !12
%34 = mul nuw i64 %indvar, 808
%gep252 = getelementptr i8, ptr %invariant.gep251, i64 %34
call void @llvm.memset.p0.i64(ptr align 16 %gep252, i8 0, i64 %21, i1 false), !tbaa !12
%35 = mul nuw i64 %indvar, 808
%gep254 = getelementptr i8, ptr %invariant.gep253, i64 %35
call void @llvm.memset.p0.i64(ptr align 8 %gep254, i8 0, i64 %21, i1 false), !tbaa !12
%36 = mul nuw i64 %indvar, 808
%gep256 = getelementptr i8, ptr %invariant.gep255, i64 %36
call void @llvm.memset.p0.i64(ptr align 16 %gep256, i8 0, i64 %21, i1 false), !tbaa !12
%37 = mul nuw i64 %indvar, 808
%gep258 = getelementptr i8, ptr %invariant.gep257, i64 %37
call void @llvm.memset.p0.i64(ptr align 8 %gep258, i8 0, i64 %21, i1 false), !tbaa !12
%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.cond84.preheader.preheader.loopexit230.unr-lcssa, label %for.cond41.preheader.us, !llvm.loop !19
for.cond.cleanup20.loopexit: ; preds = %for.body21
%.pre207 = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond.cleanup20
for.cond.cleanup20: ; preds = %for.cond.cleanup20.loopexit, %for.cond17.preheader
%38 = phi i32 [ %.pre207, %for.cond.cleanup20.loopexit ], [ %14, %for.cond17.preheader ]
%39 = phi i32 [ %42, %for.cond.cleanup20.loopexit ], [ %15, %for.cond17.preheader ]
%indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
%40 = sext i32 %38 to i64
%cmp13 = icmp slt i64 %indvars.iv.next176, %40
br i1 %cmp13, label %for.cond17.preheader, label %for.cond35.preheader.loopexit, !llvm.loop !20
for.body21: ; preds = %for.cond17.preheader, %for.body21
%indvars.iv172 = phi i64 [ %indvars.iv.next173, %for.body21 ], [ 0, %for.cond17.preheader ]
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %B)
%41 = load i32, ptr %B, align 4, !tbaa !5
%conv23 = sext i32 %41 to i64
%arrayidx27 = getelementptr inbounds [101 x [101 x i64]], ptr %b, i64 0, i64 %indvars.iv175, i64 %indvars.iv172
store i64 %conv23, ptr %arrayidx27, align 8, !tbaa !12
%indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
%42 = load i32, ptr %l, align 4, !tbaa !5
%43 = sext i32 %42 to i64
%cmp18 = icmp slt i64 %indvars.iv.next173, %43
br i1 %cmp18, label %for.body21, label %for.cond.cleanup20.loopexit, !llvm.loop !21
for.cond84.preheader: ; preds = %for.cond84.preheader.preheader, %for.cond.cleanup87
%indvars.iv203 = phi i64 [ %indvars.iv.next204, %for.cond.cleanup87 ], [ 0, %for.cond84.preheader.preheader ]
%44 = load i32, ptr %l, align 4, !tbaa !5
%cmp85159 = icmp sgt i32 %44, 0
br i1 %cmp85159, label %for.body88, label %for.cond.cleanup87
for.cond.cleanup81: ; preds = %for.cond.cleanup87, %for.cond35.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 4, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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.cleanup87: ; preds = %for.inc102, %for.cond84.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next204 = add nuw nsw i64 %indvars.iv203, 1
%45 = load i32, ptr %n, align 4, !tbaa !5
%46 = sext i32 %45 to i64
%cmp79 = icmp slt i64 %indvars.iv.next204, %46
br i1 %cmp79, label %for.cond84.preheader, label %for.cond.cleanup81, !llvm.loop !22
for.body88: ; preds = %for.cond84.preheader, %for.inc102
%indvars.iv200 = phi i64 [ %indvars.iv.next201, %for.inc102 ], [ 0, %for.cond84.preheader ]
%arrayidx92 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv203, i64 %indvars.iv200
%47 = load i64, ptr %arrayidx92, align 8, !tbaa !12
%call93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %47)
store i64 0, ptr %arrayidx92, align 8, !tbaa !12
%48 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %48, -1
%49 = zext i32 %sub to i64
%cmp99.not = icmp eq i64 %indvars.iv200, %49
br i1 %cmp99.not, label %for.inc102, label %if.then
if.then: ; preds = %for.body88
%putchar135 = call i32 @putchar(i32 32)
%.pre209 = load i32, ptr %l, align 4, !tbaa !5
br label %for.inc102
for.inc102: ; preds = %for.body88, %if.then
%50 = phi i32 [ %48, %for.body88 ], [ %.pre209, %if.then ]
%indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
%51 = sext i32 %50 to i64
%cmp85 = icmp slt i64 %indvars.iv.next201, %51
br i1 %cmp85, label %for.body88, label %for.cond.cleanup87, !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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!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}
|
// ITP1_7_D: Matrix Multiplication
// 2017.7.27
#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]);
putchar('\n');
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156265/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156265/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@.str.3 = private unnamed_addr constant [6 x i8] c" %lld\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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) #4
call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 81608, 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
%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
%47 = load ptr, ptr @stdout, align 8, !tbaa !23
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %47)
%indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
%48 = load i32, ptr %n, align 4, !tbaa !5
%49 = sext i32 %48 to i64
%cmp58 = icmp slt i64 %indvars.iv.next176, %49
br i1 %cmp58, label %for.body60, label %for.end80, !llvm.loop !25
for.end80: ; preds = %for.end76, %for.cond27.preheader
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 81608, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 40804, 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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 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 = !{!24, !24, i64 0}
!24 = !{!"any pointer", !7, i64 0}
!25 = distinct !{!25, !10}
|
#include <stdio.h>
int main()
{
int n, m, l ;
int i, j, k, x ;
int mat_a[105][105] = {} ;
int mat_b[105][105] = {} ;
long int mat_c[105][105] = {} ;
scanf("%d %d %d",&n,&m,&l) ;
/*行列Aに代入*/
for ( i = 0 ; i < n ; i++ ){
for( j = 0 ; j < m ; j++ ){
scanf("%d",&x) ;
mat_a[i][j] = x ;
}
}
/*行列Bに代入*/
for ( j = 0 ; j < m ; j++ ){
for( k = 0 ; k < l ; k++ ){
scanf("%d",&x) ;
mat_b[j][k] = x ;
}
}
/*行列Cを計算*/
for( i = 0 ; i < n ; i++ ){
for( k = 0 ; k < l ; k++ ){
for( j = 0 ; j < m ; j++ ){
mat_c[i][k] += mat_a[i][j] * mat_b[j][k] ;
}
}
}
for( i = 0 ; i < n; i++ ){
for( k = 0 ; k < l; k++ ){
if( k < l-1 ){
printf("%ld ", mat_c[i][k]) ;
}else{
printf("%ld", mat_c[i][k]) ;
}
}
printf("\n") ;
}
return 0 ;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156308/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156308/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \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
%x = alloca i32, align 4
%mat_a = alloca [105 x [105 x i32]], align 16
%mat_b = alloca [105 x [105 x i32]], align 16
%mat_c = alloca [105 x [105 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 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 44100, ptr nonnull %mat_a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44100) %mat_a, i8 0, i64 44100, i1 false)
call void @llvm.lifetime.start.p0(i64 44100, ptr nonnull %mat_b) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44100) %mat_b, i8 0, i64 44100, i1 false)
call void @llvm.lifetime.start.p0(i64 88200, ptr nonnull %mat_c) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(88200) %mat_c, i8 0, i64 88200, 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
%cmp116 = icmp sgt i32 %0, 0
%.pre172 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp116, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre172, 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 ], [ %.pre172, %for.cond1.preheader.lr.ph ]
%indvars.iv144 = phi i64 [ %indvars.iv.next145, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2114 = icmp sgt i32 %3, 0
br i1 %cmp2114, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %11, %for.inc7 ]
%5 = phi i32 [ %.pre172, %entry ], [ %12, %for.inc7 ]
%cmp11120 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond188 = select i1 %cmp11120, i1 %7, i1 false
br i1 %or.cond188, 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 [105 x [105 x i32]], ptr %mat_a, i64 0, i64 %indvars.iv144, 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.next145 = add nuw nsw i64 %indvars.iv144, 1
%13 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next145, %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.iv150 = phi i64 [ %indvars.iv.next151, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp14118 = icmp sgt i32 %15, 0
br i1 %cmp14118, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre174 = 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 ], [ %.pre174, %for.cond27.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %30, %for.cond27.preheader.loopexit ]
%cmp28126 = icmp sgt i32 %16, 0
br i1 %cmp28126, label %for.cond30.preheader.lr.ph, label %for.end83
for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
%.lcssa178 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre172, %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
%cmp31124 = icmp sgt i32 %18, 0
%cmp34122 = icmp sgt i32 %.lcssa178, 0
%or.cond = select i1 %cmp31124, i1 %cmp34122, 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.count164 = zext i32 %17 to i64
%wide.trip.count159 = zext i32 %18 to i64
%wide.trip.count = zext i32 %.lcssa178 to i64
%xtraiter = and i64 %wide.trip.count, 1
%19 = icmp eq i32 %.lcssa178, 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.iv161 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next162, %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.iv156 = phi i64 [ %indvars.iv.next157, %for.cond33.for.inc51_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ]
%arrayidx47.us.us.us = getelementptr inbounds [105 x [105 x i64]], ptr %mat_c, i64 0, i64 %indvars.iv161, i64 %indvars.iv156
%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.iv153 = phi i64 [ %indvars.iv.next154.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 [105 x [105 x i32]], ptr %mat_a, i64 0, i64 %indvars.iv161, i64 %indvars.iv153
%21 = load i32, ptr %arrayidx39.us.us.us, align 4, !tbaa !5
%arrayidx43.us.us.us = getelementptr inbounds [105 x [105 x i32]], ptr %mat_b, i64 0, i64 %indvars.iv153, i64 %indvars.iv156
%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.next154 = or i64 %indvars.iv153, 1
%arrayidx39.us.us.us.1 = getelementptr inbounds [105 x [105 x i32]], ptr %mat_a, i64 0, i64 %indvars.iv161, i64 %indvars.iv.next154
%23 = load i32, ptr %arrayidx39.us.us.us.1, align 4, !tbaa !5
%arrayidx43.us.us.us.1 = getelementptr inbounds [105 x [105 x i32]], ptr %mat_b, i64 0, i64 %indvars.iv.next154, i64 %indvars.iv156
%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.next154.1 = add nuw nsw i64 %indvars.iv153, 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.iv153.unr = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %indvars.iv.next154.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 [105 x [105 x i32]], ptr %mat_a, i64 0, i64 %indvars.iv161, i64 %indvars.iv153.unr
%25 = load i32, ptr %arrayidx39.us.us.us.epil, align 4, !tbaa !5
%arrayidx43.us.us.us.epil = getelementptr inbounds [105 x [105 x i32]], ptr %mat_b, i64 0, i64 %indvars.iv153.unr, i64 %indvars.iv156
%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.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.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.next162 = add nuw nsw i64 %indvars.iv161, 1
%exitcond165.not = icmp eq i64 %indvars.iv.next162, %wide.trip.count164
br i1 %exitcond165.not, label %for.cond61.preheader.preheader, label %for.cond30.preheader.us.us, !llvm.loop !17
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv147 = phi i64 [ %indvars.iv.next148, %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 [105 x [105 x i32]], ptr %mat_b, i64 0, i64 %indvars.iv150, i64 %indvars.iv147
store i32 %27, ptr %arrayidx20, align 4, !tbaa !5
%indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
%28 = load i32, ptr %l, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp14 = icmp slt i64 %indvars.iv.next148, %29
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !18
for.inc24.loopexit: ; preds = %for.body15
%.pre173 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%30 = phi i32 [ %.pre173, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%31 = phi i32 [ %28, %for.inc24.loopexit ], [ %15, %for.cond13.preheader ]
%indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
%32 = sext i32 %30 to i64
%cmp11 = icmp slt i64 %indvars.iv.next151, %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.end79
%indvars.iv169 = phi i64 [ %indvars.iv.next170, %for.end79 ], [ 0, %for.cond61.preheader.preheader ]
%33 = load i32, ptr %l, align 4, !tbaa !5
%cmp62134 = icmp sgt i32 %33, 0
br i1 %cmp62134, label %for.body64, label %for.end79
for.body64: ; preds = %for.cond61.preheader, %for.body64
%indvars.iv166 = phi i64 [ %indvars.iv.next167, %for.body64 ], [ 0, %for.cond61.preheader ]
%34 = phi i32 [ %37, %for.body64 ], [ %33, %for.cond61.preheader ]
%sub = add nsw i32 %34, -1
%35 = sext i32 %sub to i64
%cmp65 = icmp slt i64 %indvars.iv166, %35
%arrayidx70 = getelementptr inbounds [105 x [105 x i64]], ptr %mat_c, i64 0, i64 %indvars.iv169, i64 %indvars.iv166
%36 = load i64, ptr %arrayidx70, align 8, !tbaa !13
%.str.2..str.3 = select i1 %cmp65, ptr @.str.2, ptr @.str.3
%call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3, i64 noundef %36)
%indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
%37 = load i32, ptr %l, align 4, !tbaa !5
%38 = sext i32 %37 to i64
%cmp62 = icmp slt i64 %indvars.iv.next167, %38
br i1 %cmp62, label %for.body64, label %for.end79, !llvm.loop !20
for.end79: ; preds = %for.body64, %for.cond61.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1
%39 = load i32, ptr %n, align 4, !tbaa !5
%40 = sext i32 %39 to i64
%cmp58 = icmp slt i64 %indvars.iv.next170, %40
br i1 %cmp58, label %for.cond61.preheader, label %for.end83, !llvm.loop !21
for.end83: ; preds = %for.end79, %for.cond27.preheader
call void @llvm.lifetime.end.p0(i64 88200, ptr nonnull %mat_c) #5
call void @llvm.lifetime.end.p0(i64 44100, ptr nonnull %mat_b) #5
call void @llvm.lifetime.end.p0(i64 44100, ptr nonnull %mat_a) #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
ret i32 0
}
; 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", !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(void)
{
long long int A[100][100], B[100][100], C[100][100] = {0};
int n, m, l;
int i, k, j;
scanf("%d %d %d", &n, &m, &l);
for (i = 0; i < n; i++)
{
for (j = 0; j < m; j++)
{
scanf("%lld", &A[i][j]);
}
}
for (i = 0; i < m; i++)
{
for (j = 0; j < l; j++)
{
scanf("%lld", &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("%lld", C[i][j]);
if (j < l - 1)
{
printf(" ");
}
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156351/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156351/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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) #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 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
%cmp92 = icmp sgt i32 %0, 0
%.pre125 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp92, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre125, 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 ], [ %.pre125, %for.cond1.preheader.lr.ph ]
%indvars.iv107 = phi i64 [ %indvars.iv.next108, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp290 = icmp sgt i32 %3, 0
br i1 %cmp290, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre125, %entry ], [ %11, %for.inc7 ]
%cmp1196 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp1196, 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 [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv107, 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.next108 = add nuw nsw i64 %indvars.iv107, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next108, %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.iv113 = phi i64 [ %indvars.iv.next114, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp1494 = icmp sgt i32 %14, 0
br i1 %cmp1494, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre127 = 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 [ %.pre127, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ]
%cmp28102 = icmp sgt i32 %15, 0
br i1 %cmp28102, label %for.cond30.preheader.preheader, label %for.end64
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.iv110 = phi i64 [ %indvars.iv.next111, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv113, i64 %indvars.iv110
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
%16 = load i32, ptr %l, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp14 = icmp slt i64 %indvars.iv.next111, %17
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13
for.inc24.loopexit: ; preds = %for.body15
%.pre126 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%18 = phi i32 [ %.pre126, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
%20 = sext i32 %18 to i64
%cmp11 = icmp slt i64 %indvars.iv.next114, %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.end60
%indvars.iv122 = phi i64 [ %indvars.iv.next123, %for.end60 ], [ 0, %for.cond30.preheader.preheader ]
%21 = load i32, ptr %l, align 4, !tbaa !5
%cmp31100 = icmp sgt i32 %21, 0
br i1 %cmp31100, label %for.cond33.preheader, label %for.end60
for.cond33.preheader: ; preds = %for.cond30.preheader, %for.inc58
%indvars.iv119 = phi i64 [ %indvars.iv.next120, %for.inc58 ], [ 0, %for.cond30.preheader ]
%22 = load i32, ptr %m, align 4, !tbaa !5
%cmp3498 = icmp sgt i32 %22, 0
%arrayidx47 = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv122, i64 %indvars.iv119
%arrayidx47.promoted = load i64, ptr %arrayidx47, align 8, !tbaa !15
br i1 %cmp3498, label %for.body35.lr.ph, label %for.end50
for.body35.lr.ph: ; preds = %for.cond33.preheader
%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.iv116 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next117.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 [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv122, i64 %indvars.iv116
%25 = load i64, ptr %arrayidx39, align 16, !tbaa !15
%arrayidx43 = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv116, i64 %indvars.iv119
%26 = load i64, ptr %arrayidx43, align 8, !tbaa !15
%mul = mul nsw i64 %26, %25
%add = add nsw i64 %24, %mul
%indvars.iv.next117 = or i64 %indvars.iv116, 1
%arrayidx39.1 = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv122, i64 %indvars.iv.next117
%27 = load i64, ptr %arrayidx39.1, align 8, !tbaa !15
%arrayidx43.1 = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv.next117, i64 %indvars.iv119
%28 = load i64, ptr %arrayidx43.1, align 8, !tbaa !15
%mul.1 = mul nsw i64 %28, %27
%add.1 = add nsw i64 %add, %mul.1
%indvars.iv.next117.1 = add nuw nsw i64 %indvars.iv116, 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.iv116.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next117.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 [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv122, i64 %indvars.iv116.unr
%29 = load i64, ptr %arrayidx39.epil, align 8, !tbaa !15
%arrayidx43.epil = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv116.unr, i64 %indvars.iv119
%30 = load i64, ptr %arrayidx43.epil, align 8, !tbaa !15
%mul.epil = mul nsw i64 %30, %29
%add.epil = add nsw i64 %.unr, %mul.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.preheader, %for.cond33.for.end50_crit_edge
%31 = phi i64 [ %add.lcssa, %for.cond33.for.end50_crit_edge ], [ %arrayidx47.promoted, %for.cond33.preheader ]
%call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %31)
%32 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %32, -1
%33 = sext i32 %sub to i64
%cmp56 = icmp slt i64 %indvars.iv119, %33
br i1 %cmp56, label %if.then, label %for.inc58
if.then: ; preds = %for.end50
%putchar89 = call i32 @putchar(i32 32)
%.pre129 = load i32, ptr %l, align 4, !tbaa !5
br label %for.inc58
for.inc58: ; preds = %for.end50, %if.then
%34 = phi i32 [ %32, %for.end50 ], [ %.pre129, %if.then ]
%indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
%35 = sext i32 %34 to i64
%cmp31 = icmp slt i64 %indvars.iv.next120, %35
br i1 %cmp31, label %for.cond33.preheader, label %for.end60, !llvm.loop !18
for.end60: ; preds = %for.inc58, %for.cond30.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
%36 = load i32, ptr %n, align 4, !tbaa !5
%37 = sext i32 %36 to i64
%cmp28 = icmp slt i64 %indvars.iv.next123, %37
br i1 %cmp28, label %for.cond30.preheader, label %for.end64, !llvm.loop !19
for.end64: ; preds = %for.end60, %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 80000, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 80000, 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 = 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>
int main(void) {
int n, m, l;
int i, j, k;
int a[100][100], b[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++) {
long long sum = 0;
for (k = 0; k < m; k++) sum += a[i][k] * b[k][j];
printf("%s%lld", j ? " " : "", sum);
}
puts("");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156395/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156395/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%s%lld\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c" \00", align 1
@.str.4 = private unnamed_addr constant [1 x i8] zeroinitializer, 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
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 = 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
%cmp78 = icmp sgt i32 %0, 0
%.pre112 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp78, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre112, 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 ], [ %.pre112, %for.cond1.preheader.lr.ph ]
%indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp276 = icmp sgt i32 %3, 0
br i1 %cmp276, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre112, %entry ], [ %11, %for.inc7 ]
%cmp1182 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp1182, 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 [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv94, 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.next95 = add nuw nsw i64 %indvars.iv94, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next95, %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.iv100 = phi i64 [ %indvars.iv.next101, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp1480 = icmp sgt i32 %14, 0
br i1 %cmp1480, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre114 = 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 [ %.pre114, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ]
%cmp2889 = icmp sgt i32 %15, 0
br i1 %cmp2889, label %for.cond30.preheader.preheader, label %for.end54
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.iv97 = phi i64 [ %indvars.iv.next98, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv100, i64 %indvars.iv97
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
%16 = load i32, ptr %l, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp14 = icmp slt i64 %indvars.iv.next98, %17
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13
for.inc24.loopexit: ; preds = %for.body15
%.pre113 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%18 = phi i32 [ %.pre113, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
%20 = sext i32 %18 to i64
%cmp11 = icmp slt i64 %indvars.iv.next101, %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.end50
%indvars.iv109 = phi i64 [ %indvars.iv.next110, %for.end50 ], [ 0, %for.cond30.preheader.preheader ]
%21 = load i32, ptr %l, align 4, !tbaa !5
%cmp3187 = icmp sgt i32 %21, 0
br i1 %cmp3187, label %for.cond33.preheader, label %for.end50
for.cond33.preheader: ; preds = %for.cond30.preheader, %for.end46
%indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.end46 ], [ 0, %for.cond30.preheader ]
%22 = load i32, ptr %m, align 4, !tbaa !5
%cmp3484 = icmp sgt i32 %22, 0
br i1 %cmp3484, label %for.body35.lr.ph, label %for.end46
for.body35.lr.ph: ; preds = %for.cond33.preheader
%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.end46.loopexit.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.iv103 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next104.1, %for.body35 ]
%sum.086 = phi i64 [ 0, %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 [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv109, i64 %indvars.iv103
%24 = load i32, ptr %arrayidx39, align 8, !tbaa !5
%arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv103, i64 %indvars.iv106
%25 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%mul = mul nsw i32 %25, %24
%conv = sext i32 %mul to i64
%add = add nsw i64 %sum.086, %conv
%indvars.iv.next104 = or i64 %indvars.iv103, 1
%arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv109, i64 %indvars.iv.next104
%26 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5
%arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next104, i64 %indvars.iv106
%27 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5
%mul.1 = mul nsw i32 %27, %26
%conv.1 = sext i32 %mul.1 to i64
%add.1 = add nsw i64 %add, %conv.1
%indvars.iv.next104.1 = add nuw nsw i64 %indvars.iv103, 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.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15
for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph
%add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ]
%indvars.iv103.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next104.1, %for.body35 ]
%sum.086.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil
for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa
%arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv109, i64 %indvars.iv103.unr
%28 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5
%arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv103.unr, i64 %indvars.iv106
%29 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5
%mul.epil = mul nsw i32 %29, %28
%conv.epil = sext i32 %mul.epil to i64
%add.epil = add nsw i64 %sum.086.unr, %conv.epil
br label %for.end46
for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader
%sum.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ]
%tobool.not = icmp eq i64 %indvars.iv106, 0
%cond = select i1 %tobool.not, ptr @.str.4, ptr @.str.3
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond, i64 noundef %sum.0.lcssa)
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%30 = load i32, ptr %l, align 4, !tbaa !5
%31 = sext i32 %30 to i64
%cmp31 = icmp slt i64 %indvars.iv.next107, %31
br i1 %cmp31, label %for.cond33.preheader, label %for.end50, !llvm.loop !16
for.end50: ; preds = %for.end46, %for.cond30.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
%32 = load i32, ptr %n, align 4, !tbaa !5
%33 = sext i32 %32 to i64
%cmp28 = icmp slt i64 %indvars.iv.next110, %33
br i1 %cmp28, label %for.cond30.preheader, label %for.end54, !llvm.loop !17
for.end54: ; preds = %for.end50, %for.cond27.preheader
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: 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}
!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>
#include<stdlib.h>
int main(void)
{
int i,j,k;
int n,m,l;
int **mat1,**mat2;
long long **mat3;
scanf("%d%d%d",&n,&m,&l);
mat1=(int**)malloc(sizeof(int*)*n);
for(i=0;i<n;i++)
{
mat1[i]=(int*)malloc(sizeof(int)*m);
for(j=0;j<m;j++) scanf("%d",&mat1[i][j]);
}
mat2=(int**)malloc(sizeof(int*)*m);
for(j=0;j<m;j++)
{
mat2[j]=(int*)malloc(sizeof(int)*l);
for(k=0;k<l;k++) scanf("%d",&mat2[j][k]);
}
mat3=(long long**)malloc(sizeof(long long*)*n);
for(i=0;i<n;i++)
{
mat3[i]=malloc(sizeof(long long)*l);
for(k=0;k<l;k++)
{
mat3[i][k]=0;
for(j=0;j<m;j++) mat3[i][k]+=mat1[i][j]*mat2[j][k];
}
}
for(i=0;i<n;i++)
{
for(k=0;k<l;k++)
{
if(k>0) printf(" ");
printf("%ld",mat3[i][k]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156438/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156438/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.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
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
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 3
%call1 = call noalias ptr @malloc(i64 noundef %mul) #7
%cmp158 = icmp sgt i32 %0, 0
%.pre241 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp158, label %for.body.lr.ph, label %for.end17
for.body.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre241, 0
br i1 %1, label %for.body, label %for.body.lr.ph.split.us
for.body.lr.ph.split.us: ; preds = %for.body.lr.ph
%conv3.us = sext i32 %.pre241 to i64
%mul4.us = shl nsw i64 %conv3.us, 2
%wide.trip.count = zext i32 %0 to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us, %for.body.lr.ph.split.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body.us ], [ 0, %for.body.lr.ph.split.us ]
%call5.us = call noalias ptr @malloc(i64 noundef %mul4.us) #7
%arrayidx.us = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv
store ptr %call5.us, ptr %arrayidx.us, align 8, !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.end17, label %for.body.us, !llvm.loop !11
for.body: ; preds = %for.body.lr.ph, %for.inc15
%2 = phi i32 [ %6, %for.inc15 ], [ %0, %for.body.lr.ph ]
%3 = phi i32 [ %7, %for.inc15 ], [ %.pre241, %for.body.lr.ph ]
%indvars.iv191 = phi i64 [ %indvars.iv.next192, %for.inc15 ], [ 0, %for.body.lr.ph ]
%conv3 = sext i32 %3 to i64
%mul4 = shl nsw i64 %conv3, 2
%call5 = call noalias ptr @malloc(i64 noundef %mul4) #7
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv191
store ptr %call5, ptr %arrayidx, align 8, !tbaa !9
%cmp7156 = icmp sgt i32 %3, 0
br i1 %cmp7156, label %for.body9, label %for.inc15
for.body9: ; preds = %for.body, %for.body9
%indvars.iv188 = phi i64 [ %indvars.iv.next189, %for.body9 ], [ 0, %for.body ]
%arrayidx13 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv188
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx13)
%indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
%4 = load i32, ptr %m, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp7 = icmp slt i64 %indvars.iv.next189, %5
br i1 %cmp7, label %for.body9, label %for.inc15.loopexit, !llvm.loop !13
for.inc15.loopexit: ; preds = %for.body9
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc15
for.inc15: ; preds = %for.inc15.loopexit, %for.body
%6 = phi i32 [ %.pre, %for.inc15.loopexit ], [ %2, %for.body ]
%7 = phi i32 [ %4, %for.inc15.loopexit ], [ %3, %for.body ]
%indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
%8 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next192, %8
br i1 %cmp, label %for.body, label %for.end17, !llvm.loop !14
for.end17: ; preds = %for.body.us, %for.inc15, %entry
%9 = phi i32 [ %0, %entry ], [ %6, %for.inc15 ], [ %0, %for.body.us ]
%10 = phi i32 [ %.pre241, %entry ], [ %7, %for.inc15 ], [ %.pre241, %for.body.us ]
%conv18 = sext i32 %10 to i64
%mul19 = shl nsw i64 %conv18, 3
%call20 = call noalias ptr @malloc(i64 noundef %mul19) #7
%cmp22162 = icmp sgt i32 %10, 0
br i1 %cmp22162, label %for.body24.lr.ph, label %for.end44
for.body24.lr.ph: ; preds = %for.end17
%11 = load i32, ptr %l, align 4, !tbaa !5
%12 = icmp sgt i32 %11, 0
br i1 %12, label %for.body24, label %for.body24.lr.ph.split.us
for.body24.lr.ph.split.us: ; preds = %for.body24.lr.ph
%conv25.us = sext i32 %11 to i64
%mul26.us = shl nsw i64 %conv25.us, 2
%wide.trip.count198 = zext i32 %10 to i64
br label %for.body24.us
for.body24.us: ; preds = %for.body24.us, %for.body24.lr.ph.split.us
%indvars.iv194 = phi i64 [ %indvars.iv.next195, %for.body24.us ], [ 0, %for.body24.lr.ph.split.us ]
%call27.us = call noalias ptr @malloc(i64 noundef %mul26.us) #7
%arrayidx29.us = getelementptr inbounds ptr, ptr %call20, i64 %indvars.iv194
store ptr %call27.us, ptr %arrayidx29.us, align 8, !tbaa !9
%indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
%exitcond199.not = icmp eq i64 %indvars.iv.next195, %wide.trip.count198
br i1 %exitcond199.not, label %for.end44, label %for.body24.us, !llvm.loop !16
for.body24: ; preds = %for.body24.lr.ph, %for.inc42
%13 = phi i32 [ %17, %for.inc42 ], [ %10, %for.body24.lr.ph ]
%14 = phi i32 [ %18, %for.inc42 ], [ %11, %for.body24.lr.ph ]
%indvars.iv203 = phi i64 [ %indvars.iv.next204, %for.inc42 ], [ 0, %for.body24.lr.ph ]
%conv25 = sext i32 %14 to i64
%mul26 = shl nsw i64 %conv25, 2
%call27 = call noalias ptr @malloc(i64 noundef %mul26) #7
%arrayidx29 = getelementptr inbounds ptr, ptr %call20, i64 %indvars.iv203
store ptr %call27, ptr %arrayidx29, align 8, !tbaa !9
%cmp31160 = icmp sgt i32 %14, 0
br i1 %cmp31160, label %for.body33, label %for.inc42
for.body33: ; preds = %for.body24, %for.body33
%indvars.iv200 = phi i64 [ %indvars.iv.next201, %for.body33 ], [ 0, %for.body24 ]
%arrayidx37 = getelementptr inbounds i32, ptr %call27, i64 %indvars.iv200
%call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx37)
%indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
%15 = load i32, ptr %l, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp31 = icmp slt i64 %indvars.iv.next201, %16
br i1 %cmp31, label %for.body33, label %for.inc42.loopexit, !llvm.loop !17
for.inc42.loopexit: ; preds = %for.body33
%.pre242 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc42
for.inc42: ; preds = %for.inc42.loopexit, %for.body24
%17 = phi i32 [ %.pre242, %for.inc42.loopexit ], [ %13, %for.body24 ]
%18 = phi i32 [ %15, %for.inc42.loopexit ], [ %14, %for.body24 ]
%indvars.iv.next204 = add nuw nsw i64 %indvars.iv203, 1
%19 = sext i32 %17 to i64
%cmp22 = icmp slt i64 %indvars.iv.next204, %19
br i1 %cmp22, label %for.body24, label %for.end44.loopexit, !llvm.loop !18
for.end44.loopexit: ; preds = %for.inc42
%.pre243 = load i32, ptr %n, align 4, !tbaa !5
br label %for.end44
for.end44: ; preds = %for.body24.us, %for.end44.loopexit, %for.end17
%20 = phi i32 [ %9, %for.end17 ], [ %.pre243, %for.end44.loopexit ], [ %9, %for.body24.us ]
%.lcssa = phi i32 [ %10, %for.end17 ], [ %17, %for.end44.loopexit ], [ %10, %for.body24.us ]
%conv45 = sext i32 %20 to i64
%mul46 = shl nsw i64 %conv45, 3
%call47 = call noalias ptr @malloc(i64 noundef %mul46) #7
%cmp49168 = icmp sgt i32 %20, 0
br i1 %cmp49168, label %for.body51.lr.ph, label %for.end114
for.body51.lr.ph: ; preds = %for.end44
%21 = load i32, ptr %l, align 4, !tbaa !5
%conv52 = sext i32 %21 to i64
%mul53 = shl nsw i64 %conv52, 3
%cmp58166 = icmp sgt i32 %21, 0
br i1 %cmp58166, label %for.body51.lr.ph.split.us, label %for.body51.preheader
for.body51.preheader: ; preds = %for.body51.lr.ph
%wide.trip.count209 = zext i32 %20 to i64
br label %for.body51
for.body51.lr.ph.split.us: ; preds = %for.body51.lr.ph
%cmp66164 = icmp sgt i32 %.lcssa, 0
br i1 %cmp66164, label %for.body51.us.us.preheader, label %for.body51.us.preheader
for.body51.us.preheader: ; preds = %for.body51.lr.ph.split.us
%22 = zext i32 %21 to i64
%23 = shl nuw nsw i64 %22, 3
%wide.trip.count217 = zext i32 %20 to i64
br label %for.body51.us
for.body51.us.us.preheader: ; preds = %for.body51.lr.ph.split.us
%wide.trip.count232 = zext i32 %20 to i64
%wide.trip.count227 = zext i32 %21 to i64
%wide.trip.count222 = zext i32 %.lcssa to i64
%xtraiter = and i64 %wide.trip.count222, 1
%24 = icmp eq i32 %.lcssa, 1
%unroll_iter = and i64 %wide.trip.count222, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.body51.us.us
for.body51.us.us: ; preds = %for.body51.us.us.preheader, %for.cond57.for.inc89_crit_edge.split.us.us.us
%indvars.iv229 = phi i64 [ 0, %for.body51.us.us.preheader ], [ %indvars.iv.next230, %for.cond57.for.inc89_crit_edge.split.us.us.us ]
%call54.us.us = call noalias ptr @malloc(i64 noundef %mul53) #7
%arrayidx56.us.us = getelementptr inbounds ptr, ptr %call47, i64 %indvars.iv229
store ptr %call54.us.us, ptr %arrayidx56.us.us, align 8, !tbaa !9
%arrayidx70.us.us = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv229
%25 = load ptr, ptr %arrayidx70.us.us, align 8, !tbaa !9
br label %for.body60.us.us.us
for.body60.us.us.us: ; preds = %for.cond65.for.inc86_crit_edge.us.us.us, %for.body51.us.us
%indvars.iv224 = phi i64 [ %indvars.iv.next225, %for.cond65.for.inc86_crit_edge.us.us.us ], [ 0, %for.body51.us.us ]
%arrayidx64.us.us.us = getelementptr inbounds i64, ptr %call54.us.us, i64 %indvars.iv224
br i1 %24, label %for.cond65.for.inc86_crit_edge.us.us.us.unr-lcssa, label %for.body68.us.us.us
for.body68.us.us.us: ; preds = %for.body60.us.us.us, %for.body68.us.us.us
%indvars.iv219 = phi i64 [ %indvars.iv.next220.1, %for.body68.us.us.us ], [ 0, %for.body60.us.us.us ]
%26 = phi i64 [ %add.us.us.us.1, %for.body68.us.us.us ], [ 0, %for.body60.us.us.us ]
%niter = phi i64 [ %niter.next.1, %for.body68.us.us.us ], [ 0, %for.body60.us.us.us ]
%arrayidx72.us.us.us = getelementptr inbounds i32, ptr %25, i64 %indvars.iv219
%27 = load i32, ptr %arrayidx72.us.us.us, align 4, !tbaa !5
%arrayidx74.us.us.us = getelementptr inbounds ptr, ptr %call20, i64 %indvars.iv219
%28 = load ptr, ptr %arrayidx74.us.us.us, align 8, !tbaa !9
%arrayidx76.us.us.us = getelementptr inbounds i32, ptr %28, i64 %indvars.iv224
%29 = load i32, ptr %arrayidx76.us.us.us, align 4, !tbaa !5
%mul77.us.us.us = mul nsw i32 %29, %27
%conv78.us.us.us = sext i32 %mul77.us.us.us to i64
%add.us.us.us = add nsw i64 %26, %conv78.us.us.us
%indvars.iv.next220 = or i64 %indvars.iv219, 1
%arrayidx72.us.us.us.1 = getelementptr inbounds i32, ptr %25, i64 %indvars.iv.next220
%30 = load i32, ptr %arrayidx72.us.us.us.1, align 4, !tbaa !5
%arrayidx74.us.us.us.1 = getelementptr inbounds ptr, ptr %call20, i64 %indvars.iv.next220
%31 = load ptr, ptr %arrayidx74.us.us.us.1, align 8, !tbaa !9
%arrayidx76.us.us.us.1 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv224
%32 = load i32, ptr %arrayidx76.us.us.us.1, align 4, !tbaa !5
%mul77.us.us.us.1 = mul nsw i32 %32, %30
%conv78.us.us.us.1 = sext i32 %mul77.us.us.us.1 to i64
%add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv78.us.us.us.1
%indvars.iv.next220.1 = add nuw nsw i64 %indvars.iv219, 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.cond65.for.inc86_crit_edge.us.us.us.unr-lcssa, label %for.body68.us.us.us, !llvm.loop !19
for.cond65.for.inc86_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body68.us.us.us, %for.body60.us.us.us
%add.us.us.us.lcssa.ph = phi i64 [ undef, %for.body60.us.us.us ], [ %add.us.us.us.1, %for.body68.us.us.us ]
%indvars.iv219.unr = phi i64 [ 0, %for.body60.us.us.us ], [ %indvars.iv.next220.1, %for.body68.us.us.us ]
%.unr = phi i64 [ 0, %for.body60.us.us.us ], [ %add.us.us.us.1, %for.body68.us.us.us ]
br i1 %lcmp.mod.not, label %for.cond65.for.inc86_crit_edge.us.us.us, label %for.body68.us.us.us.epil
for.body68.us.us.us.epil: ; preds = %for.cond65.for.inc86_crit_edge.us.us.us.unr-lcssa
%arrayidx72.us.us.us.epil = getelementptr inbounds i32, ptr %25, i64 %indvars.iv219.unr
%33 = load i32, ptr %arrayidx72.us.us.us.epil, align 4, !tbaa !5
%arrayidx74.us.us.us.epil = getelementptr inbounds ptr, ptr %call20, i64 %indvars.iv219.unr
%34 = load ptr, ptr %arrayidx74.us.us.us.epil, align 8, !tbaa !9
%arrayidx76.us.us.us.epil = getelementptr inbounds i32, ptr %34, i64 %indvars.iv224
%35 = load i32, ptr %arrayidx76.us.us.us.epil, align 4, !tbaa !5
%mul77.us.us.us.epil = mul nsw i32 %35, %33
%conv78.us.us.us.epil = sext i32 %mul77.us.us.us.epil to i64
%add.us.us.us.epil = add nsw i64 %.unr, %conv78.us.us.us.epil
br label %for.cond65.for.inc86_crit_edge.us.us.us
for.cond65.for.inc86_crit_edge.us.us.us: ; preds = %for.cond65.for.inc86_crit_edge.us.us.us.unr-lcssa, %for.body68.us.us.us.epil
%add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond65.for.inc86_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body68.us.us.us.epil ]
store i64 %add.us.us.us.lcssa, ptr %arrayidx64.us.us.us, align 8, !tbaa !20
%indvars.iv.next225 = add nuw nsw i64 %indvars.iv224, 1
%exitcond228.not = icmp eq i64 %indvars.iv.next225, %wide.trip.count227
br i1 %exitcond228.not, label %for.cond57.for.inc89_crit_edge.split.us.us.us, label %for.body60.us.us.us, !llvm.loop !22
for.cond57.for.inc89_crit_edge.split.us.us.us: ; preds = %for.cond65.for.inc86_crit_edge.us.us.us
%indvars.iv.next230 = add nuw nsw i64 %indvars.iv229, 1
%exitcond233.not = icmp eq i64 %indvars.iv.next230, %wide.trip.count232
br i1 %exitcond233.not, label %for.cond92.preheader, label %for.body51.us.us, !llvm.loop !23
for.body51.us: ; preds = %for.body51.us.preheader, %for.body51.us
%indvars.iv214 = phi i64 [ 0, %for.body51.us.preheader ], [ %indvars.iv.next215, %for.body51.us ]
%call54.us = call noalias ptr @malloc(i64 noundef %mul53) #7
%arrayidx56.us = getelementptr inbounds ptr, ptr %call47, i64 %indvars.iv214
store ptr %call54.us, ptr %arrayidx56.us, align 8, !tbaa !9
call void @llvm.memset.p0.i64(ptr align 8 %call54.us, i8 0, i64 %23, i1 false), !tbaa !20
%indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
%exitcond218.not = icmp eq i64 %indvars.iv.next215, %wide.trip.count217
br i1 %exitcond218.not, label %for.cond92.preheader, label %for.body51.us, !llvm.loop !23
for.cond92.preheader: ; preds = %for.body51, %for.body51.us, %for.cond57.for.inc89_crit_edge.split.us.us.us
br i1 %cmp49168, label %for.cond96.preheader, label %for.end114
for.body51: ; preds = %for.body51.preheader, %for.body51
%indvars.iv206 = phi i64 [ 0, %for.body51.preheader ], [ %indvars.iv.next207, %for.body51 ]
%call54 = call noalias ptr @malloc(i64 noundef %mul53) #7
%arrayidx56 = getelementptr inbounds ptr, ptr %call47, i64 %indvars.iv206
store ptr %call54, ptr %arrayidx56, align 8, !tbaa !9
%indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1
%exitcond210.not = icmp eq i64 %indvars.iv.next207, %wide.trip.count209
br i1 %exitcond210.not, label %for.cond92.preheader, label %for.body51, !llvm.loop !23
for.cond96.preheader: ; preds = %for.cond92.preheader, %for.end110
%indvars.iv238 = phi i64 [ %indvars.iv.next239, %for.end110 ], [ 0, %for.cond92.preheader ]
%36 = load i32, ptr %l, align 4, !tbaa !5
%cmp97178 = icmp sgt i32 %36, 0
br i1 %cmp97178, label %if.end.peel, label %for.end110
if.end.peel: ; preds = %for.cond96.preheader
%arrayidx104 = getelementptr inbounds ptr, ptr %call47, i64 %indvars.iv238
%37 = load ptr, ptr %arrayidx104, align 8, !tbaa !9
%38 = load i64, ptr %37, align 8, !tbaa !20
%call107.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %38)
%39 = load i32, ptr %l, align 4, !tbaa !5
%cmp97.peel = icmp sgt i32 %39, 1
br i1 %cmp97.peel, label %if.end, label %for.end110
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv234 = phi i64 [ %indvars.iv.next235, %if.end ], [ 1, %if.end.peel ]
%putchar155 = call i32 @putchar(i32 32)
%arrayidx106 = getelementptr inbounds i64, ptr %37, i64 %indvars.iv234
%40 = load i64, ptr %arrayidx106, align 8, !tbaa !20
%call107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %40)
%indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
%41 = load i32, ptr %l, align 4, !tbaa !5
%42 = sext i32 %41 to i64
%cmp97 = icmp slt i64 %indvars.iv.next235, %42
br i1 %cmp97, label %if.end, label %for.end110, !llvm.loop !24
for.end110: ; preds = %if.end, %if.end.peel, %for.cond96.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next239 = add nuw nsw i64 %indvars.iv238, 1
%43 = load i32, ptr %n, align 4, !tbaa !5
%44 = sext i32 %43 to i64
%cmp93 = icmp slt i64 %indvars.iv.next239, %44
br i1 %cmp93, label %for.cond96.preheader, label %for.end114, !llvm.loop !26
for.end114: ; preds = %for.end110, %for.end44, %for.cond92.preheader
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
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !15}
!19 = distinct !{!19, !12}
!20 = !{!21, !21, i64 0}
!21 = !{!"long long", !7, i64 0}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12, !25}
!25 = !{!"llvm.loop.peeled.count", i32 1}
!26 = distinct !{!26, !12}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,a,b;long long int sum=0;
scanf("%d %d %d",&n,&a,&b);
long long int c[n];
for(int i=0;i<n;i++)
scanf("%lld",&c[i]);
for(int i=0;i<n-1;i++)
{
if((c[i+1]-c[i])*a>b)
{
sum+=b;
}
else
sum+=(c[i+1]-c[i])*a;
}
printf("%lld",sum);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156489/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156489/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp39 = icmp sgt i32 %3, 0
br i1 %cmp39, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp441 = icmp sgt i32 %7, 1
br i1 %cmp441, label %for.body6.lr.ph, label %for.cond.cleanup5
for.body6.lr.ph: ; preds = %for.cond3.preheader
%sub = add nsw i32 %7, -1
%4 = load i32, ptr %a, align 4, !tbaa !5
%conv = sext i32 %4 to i64
%5 = load i32, ptr %b, align 4, !tbaa !5
%conv12 = sext i32 %5 to i64
%wide.trip.count = zext i32 %sub to i64
%.pre = load i64, ptr %vla, align 16, !tbaa !9
%xtraiter = and i64 %wide.trip.count, 1
%6 = icmp eq i32 %sub, 1
br i1 %6, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6.lr.ph.new
for.body6.lr.ph.new: ; preds = %for.body6.lr.ph
%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 i64, 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
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !11
for.cond.cleanup5.loopexit.unr-lcssa.loopexit: ; preds = %for.body6
%9 = add nuw nsw i64 %indvars.iv47, 3
br label %for.cond.cleanup5.loopexit.unr-lcssa
for.cond.cleanup5.loopexit.unr-lcssa: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa.loopexit, %for.body6.lr.ph
%sum.1.lcssa.ph = phi i64 [ undef, %for.body6.lr.ph ], [ %sum.1.1, %for.cond.cleanup5.loopexit.unr-lcssa.loopexit ]
%.unr = phi i64 [ %.pre, %for.body6.lr.ph ], [ %13, %for.cond.cleanup5.loopexit.unr-lcssa.loopexit ]
%indvars.iv47.unr = phi i64 [ 1, %for.body6.lr.ph ], [ %9, %for.cond.cleanup5.loopexit.unr-lcssa.loopexit ]
%sum.042.unr = phi i64 [ 0, %for.body6.lr.ph ], [ %sum.1.1, %for.cond.cleanup5.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup5, label %for.body6.epil
for.body6.epil: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa
%arrayidx8.epil = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv47.unr
%10 = load i64, ptr %arrayidx8.epil, align 8, !tbaa !9
%sub11.epil = sub nsw i64 %10, %.unr
%mul.epil = mul nsw i64 %sub11.epil, %conv
%conv12.mul.epil = call i64 @llvm.smin.i64(i64 %mul.epil, i64 %conv12)
%sum.1.epil = add nsw i64 %conv12.mul.epil, %sum.042.unr
br label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %for.body6.epil, %for.cond.cleanup5.loopexit.unr-lcssa, %entry, %for.cond3.preheader
%sum.0.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.cond.cleanup5.loopexit.unr-lcssa ], [ %sum.1.epil, %for.body6.epil ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body6: ; preds = %for.body6, %for.body6.lr.ph.new
%11 = phi i64 [ %.pre, %for.body6.lr.ph.new ], [ %13, %for.body6 ]
%indvars.iv47 = phi i64 [ 0, %for.body6.lr.ph.new ], [ %indvars.iv.next48.1, %for.body6 ]
%sum.042 = phi i64 [ 0, %for.body6.lr.ph.new ], [ %sum.1.1, %for.body6 ]
%niter = phi i64 [ 0, %for.body6.lr.ph.new ], [ %niter.next.1, %for.body6 ]
%indvars.iv.next48 = or i64 %indvars.iv47, 1
%arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next48
%12 = load i64, ptr %arrayidx8, align 8, !tbaa !9
%sub11 = sub nsw i64 %12, %11
%mul = mul nsw i64 %sub11, %conv
%conv12.mul = call i64 @llvm.smin.i64(i64 %mul, i64 %conv12)
%sum.1 = add nsw i64 %conv12.mul, %sum.042
%indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 2
%arrayidx8.1 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next48.1
%13 = load i64, ptr %arrayidx8.1, align 16, !tbaa !9
%sub11.1 = sub nsw i64 %13, %12
%mul.1 = mul nsw i64 %sub11.1, %conv
%conv12.mul.1 = call i64 @llvm.smin.i64(i64 %mul.1, i64 %conv12)
%sum.1.1 = add nsw i64 %conv12.mul.1, %sum.1
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup5.loopexit.unr-lcssa.loopexit, label %for.body6, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 i64 @llvm.smin.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
|
// AOJ NTL_2_F Multiplication of Big Integers II
// 2019.3.8 bal4u
#include <stdio.h>
#include <stdlib.h>
#define N 1000000000
int a[30000], b[30000], ab[60000];
int a_minus, b_minus;
char buf[500000];
char *mpStr2Num(int *num, char *str)
{
char *ss, *end;
int *nn;
int k, x;
// while (*str == ' ' || *str == '\t') str++;
while (*str == '0') str++;
ss = str;
x = 0;
while (*ss >= '0' && *ss <= '9') ss++, x++;
end = ss;
if (ss == str) { *num = 0; return end; }
x = 0, k = 1, nn = num;
do {
x += (*--ss - '0') * k;
k *= 10;
if (k == N || ss == str) *++nn = x, x = 0, k = 1;
} while (ss != str);
*num = nn - num;
return end;
}
void mpNum2Str(char *str, int *num)
{
int i, j, x;
char *ss;
if (*num == 0 || (*num == 1 && *(num + 1) == 0)) {
*str++ = '0', *str = '\0';
return;
}
ss = str - 1;
for (i = *num; i > 0; i--) {
x = *++num;
for (j = 1; j < N; j *= 10) {
*++ss = x % 10 + '0';
x /= 10;
}
}
while (*ss == '0') ss--;
*(ss + 1) = '\0';
while (str < ss) {
x = *str;
*str++ = *ss;
*ss-- = x;
}
}
void mpAdd(int *ret, int *a, int *b)
{
int i, lr, la, lb, x;
int *rr;
la = *a, lb = *b;
lr = (la >= lb) ? la : lb;
rr = ret, x = 0;
for (i = 1; i <= lr; i++) {
if (i <= la) x += *++a;
if (i <= lb) x += *++b;
if (x < N) *++rr = x, x = 0;
else *++rr = x - N, x = 1;
}
*++rr = x;
*ret = lr + x;
}
void mpSub(int *ret, int *a, int *b)
{
int i, la, lb, x;
int *rr;
la = *a, lb = *b;
rr = ret, x = 0;
for (i = 1; i <= la; i++) {
x += *++a;
if (i <= lb) x -= *++b;
if (x >= 0) *++rr = x, x = 0;
else *++rr = x + N, x = -1;
}
while (--i > 0) if (*rr-- != 0) break;
*ret = i;
}
int mpCmp(int *a, int *b)
{
int *aa;
if (*a != *b) return *a - *b;
aa = a, a += *aa, b += *aa;
while (a != aa) {
if (*a != *b) return *a - *b;
a--, b--;
}
return 0;
}
int mpAddSub(int *ret, int *a, int a_minus, int *b, int b_minus)
{
int k, minus = 0;
if (a_minus && b_minus) minus = 1, a_minus = 0, b_minus = 0;
if (!a_minus && !b_minus) mpAdd(ret, a, b);
else {
k = mpCmp(a, b);
if (k == 0) *ret = 0, minus = 0;
else if (k > 0) mpSub(ret, a, b), minus = a_minus;
else mpSub(ret, b, a), minus = b_minus;
}
return minus;
}
void mpMul(int *ret, int *a, int *b)
{
int i, j, la, lb;
int *aa;
int ca;
unsigned long long x;
la = *a, lb = *b;
if (la == 0 || lb == 0) { *ret = 0; return; }
for (i = la + lb; i > 0; i--) *(ret + i) = 0;
for (j = 1; j <= lb; j++) {
ca = 0;
b++;
aa = a;
for (i = 1; i <= la; i++) {
x = *++aa;
x = x * *b + *(ret + i + j - 1) + ca;
*(ret + i + j - 1) = (int)(x % N);
ca = (int)(x / N);
}
*(ret + i + j - 1) = ca;
}
*ret = (ca != 0) ? la + lb : la + lb - 1;
}
int mpDiv(int *q, int *r, int *za, int *zb)
{
int i;
int m, n;
int *aa, *bb, *qq, *rr, *t;
int ca;
long long x;
int k, Q;
static int atmp[1000], btmp[1000];
int *a = atmp, *b = btmp;
*q = 0, *r = 0;
if (*zb == 0) return -2;
if (*za == 0) return 0;
if (*za < *zb) {
for (aa = za, rr = r, i = *za; i >= 0; i--) *rr++ = *aa++;
return 0;
}
if (*zb == 1) {
*q = *za;
zb++;
for (ca = 0, aa = za + *za, qq = q + *q, i = *za; i > 0; i--) {
x = (long long)N * ca + *aa--;
*qq-- = (int)(x / *zb), ca = (int)(x % *zb);
}
if (*(q + *q) == 0) (*q)--;
if (ca > 0) {
*r++ = 1;
*r = ca;
}
else *r = 0;
return 0;
}
for (aa = a, i = *za; i >= 0; i--) *aa++ = *za++;
for (bb = b, i = *zb; i >= 0; i--) *bb++ = *zb++;
if ((k = (N / 2 - 1) / *(b + *b) + 1) > 1) {
for (ca = 0, aa = a, qq = q, i = 0; i < *a; i++) {
x = (long long)k * *++aa + ca; /* a = a * k */
*++qq = x % N, ca = (int)(x / N);
}
*++qq = ca;
*q = i + (ca > 0);
for (qq = q, aa = a, i = *q; i >= 0; i--) *aa++ = *qq++;
for (ca = 0, bb = b, qq = q, i = 0; i < *b; i++) {
x = (long long)k * *++bb + ca; /* b = b * k */
*++qq = x % N, ca = (int)(x / N);
}
*++qq = ca;
*q = i + (ca > 0);
for (qq = q, bb = b, i = *q; i >= 0; i--) *bb++ = *qq++;
}
*q = *a - *b + 1;
for (qq = q, i = *q; i > 0; i--) *++qq = 0;
n = *b;
while ((m = *a) >= n) {
if (*(a + *a) >= *(b + *b)) {
for (aa = a + *a, bb = b + *b; bb != b; aa--, bb--)
if (*aa != *bb) break;
if (bb == b) {
*a -= *b;
*(q + m - n + 1) = 1;
continue;
}
else if (*aa > *bb) {
for (t = bb, ca = 0, aa = a + m - n, bb = b; bb < t; ) {
*++aa -= *++bb + ca;
ca = 0;
if (*aa < 0) *aa += N, ca = 1;
}
while (*aa == 0) aa--;
*a = aa - a;
*(q + m - n + 1) = 1;
continue;
}
Q = N - 1;
}
else Q = ((long long)N * *(a + *a) + *(a + *a - 1)) / *(b + *b);
if (m == n) break;
for (; ; ) {
if (Q == 1) {
*(b + *b + 1) = 0;
for (ca = 0, aa = a + (*a - *b - 1), bb = b, i = *b; i >= 0; i--) {
*++aa -= *++bb + ca;
ca = 0;
if (*aa < 0) *aa += N, ca = 1;
}
while (*aa == 0) aa--;
*a = aa - a;
break;
}
for (ca = 0, rr = r, bb = b, i = 0; i < *b; i++) {
x = (long long)Q * *++bb + ca;
*++rr = x % N, ca = (int)(x / N);
}
*++rr = ca;
*r = i + 1;
for (aa = a + *a, rr = r + *r; rr != r; aa--, rr--)
if (*aa != *rr) break;
if (rr == r) {
*a -= *r;
break;
}
else if (*aa > *rr) {
for (t = rr, ca = 0, aa = a + (*a - *r), rr = r; rr < t; ) {
*++aa -= *++rr + ca;
ca = 0;
if (*aa < 0) *aa += N, ca = 1;
}
while (*aa == 0) aa--;
*a = aa - a;
break;
}
else Q--;
}
*(q + m - n) = Q;
}
if (*(q + *q) == 0) (*q)--;
if (k > 1) {
for (ca = 0, aa = a + *a, rr = r + *a, i = *a; i > 0; i--) {
x = (long long)N * ca + *aa--;
*rr-- = (int)(x / k), ca = (int)(x % k);
}
*r = *a - (*(r + *a) == 0);
if (*r < 0) *r = 0;
}
else for (aa = a, rr = r, i = *a; i >= 0; i--) *rr++ = *aa++;
return 0;
}
int main()
{
int minus;
char *p, *q;
fgets(p = buf, 5000000, stdin);
if (*p == '-') a_minus = 1, p++;
p = mpStr2Num(a, p);
while (*p == ' ') p++;
q = p;
if (*p == '-') b_minus = 1, p++;
p = mpStr2Num(b, p);
minus = a_minus ^ b_minus;
mpMul(ab, a, b);
if (*ab == 0) minus = 0;
if (minus) putchar('-');
mpNum2Str(buf, ab);
puts(buf);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156531/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156531/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mpDiv.atmp = internal global [1000 x i32] zeroinitializer, align 16
@mpDiv.btmp = internal global [1000 x i32] zeroinitializer, align 16
@buf = dso_local global [500000 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@a_minus = dso_local local_unnamed_addr global i32 0, align 4
@a = dso_local global [30000 x i32] zeroinitializer, align 16
@b_minus = dso_local local_unnamed_addr global i32 0, align 4
@b = dso_local global [30000 x i32] zeroinitializer, align 16
@ab = dso_local global [60000 x i32] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local ptr @mpStr2Num(ptr noundef %num, ptr noundef readonly %str) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%str.addr.0 = phi ptr [ %str, %entry ], [ %incdec.ptr, %while.cond ]
%0 = load i8, ptr %str.addr.0, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 48
%incdec.ptr = getelementptr inbounds i8, ptr %str.addr.0, i64 1
br i1 %cmp, label %while.cond, label %while.cond2, !llvm.loop !8
while.cond2: ; preds = %while.cond, %while.cond2
%indvar = phi i64 [ %indvar.next, %while.cond2 ], [ 0, %while.cond ]
%ss.0 = phi ptr [ %incdec.ptr10, %while.cond2 ], [ %str.addr.0, %while.cond ]
%1 = load i8, ptr %ss.0, align 1, !tbaa !5
%2 = add i8 %1, -48
%or.cond = icmp ult i8 %2, 10
%incdec.ptr10 = getelementptr inbounds i8, ptr %ss.0, i64 1
%indvar.next = add i64 %indvar, 1
br i1 %or.cond, label %while.cond2, label %while.end11, !llvm.loop !10
while.end11: ; preds = %while.cond2
%cmp12 = icmp eq ptr %ss.0, %str.addr.0
br i1 %cmp12, label %cleanup, label %do.body.preheader
do.body.preheader: ; preds = %while.end11
%xtraiter = and i64 %indvar, 1
%3 = icmp eq i64 %indvar, 1
br i1 %3, label %do.end.unr-lcssa, label %do.body.preheader.new
do.body.preheader.new: ; preds = %do.body.preheader
%unroll_iter = and i64 %indvar, -2
br label %do.body
do.body: ; preds = %do.cond.1, %do.body.preheader.new
%ss.1 = phi ptr [ %ss.0, %do.body.preheader.new ], [ %incdec.ptr14.1, %do.cond.1 ]
%nn.0 = phi ptr [ %num, %do.body.preheader.new ], [ %nn.1.1, %do.cond.1 ]
%k.0 = phi i32 [ 1, %do.body.preheader.new ], [ %k.1.1, %do.cond.1 ]
%x.1 = phi i32 [ 0, %do.body.preheader.new ], [ %x.2.1, %do.cond.1 ]
%niter = phi i64 [ 0, %do.body.preheader.new ], [ %niter.next.1, %do.cond.1 ]
%incdec.ptr14 = getelementptr inbounds i8, ptr %ss.1, i64 -1
%4 = load i8, ptr %incdec.ptr14, align 1, !tbaa !5
%conv15 = sext i8 %4 to i32
%sub = add nsw i32 %conv15, -48
%mul = mul nsw i32 %sub, %k.0
%add = add nsw i32 %mul, %x.1
%cmp17 = icmp eq i32 %k.0, 100000000
%mul16 = mul nsw i32 %k.0, 10
%cmp19 = icmp eq ptr %incdec.ptr14, %str.addr.0
%or.cond52 = or i1 %cmp19, %cmp17
br i1 %or.cond52, label %if.then21, label %do.cond
if.then21: ; preds = %do.body
%incdec.ptr22 = getelementptr inbounds i32, ptr %nn.0, i64 1
store i32 %add, ptr %incdec.ptr22, align 4, !tbaa !11
br label %do.cond
do.cond: ; preds = %do.body, %if.then21
%nn.1 = phi ptr [ %incdec.ptr22, %if.then21 ], [ %nn.0, %do.body ]
%k.1 = phi i32 [ 1, %if.then21 ], [ %mul16, %do.body ]
%x.2 = phi i32 [ 0, %if.then21 ], [ %add, %do.body ]
%incdec.ptr14.1 = getelementptr inbounds i8, ptr %ss.1, i64 -2
%5 = load i8, ptr %incdec.ptr14.1, align 1, !tbaa !5
%conv15.1 = sext i8 %5 to i32
%sub.1 = add nsw i32 %conv15.1, -48
%mul.1 = mul nsw i32 %sub.1, %k.1
%add.1 = add nsw i32 %mul.1, %x.2
%cmp17.1 = icmp eq i32 %k.1, 100000000
%mul16.1 = mul nsw i32 %k.1, 10
%cmp19.1 = icmp eq ptr %incdec.ptr14.1, %str.addr.0
%or.cond52.1 = or i1 %cmp19.1, %cmp17.1
br i1 %or.cond52.1, label %if.then21.1, label %do.cond.1
if.then21.1: ; preds = %do.cond
%incdec.ptr22.1 = getelementptr inbounds i32, ptr %nn.1, i64 1
store i32 %add.1, ptr %incdec.ptr22.1, align 4, !tbaa !11
br label %do.cond.1
do.cond.1: ; preds = %if.then21.1, %do.cond
%nn.1.1 = phi ptr [ %incdec.ptr22.1, %if.then21.1 ], [ %nn.1, %do.cond ]
%k.1.1 = phi i32 [ 1, %if.then21.1 ], [ %mul16.1, %do.cond ]
%x.2.1 = phi i32 [ 0, %if.then21.1 ], [ %add.1, %do.cond ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %do.end.unr-lcssa, label %do.body, !llvm.loop !13
do.end.unr-lcssa: ; preds = %do.cond.1, %do.body.preheader
%nn.1.lcssa.ph = phi ptr [ undef, %do.body.preheader ], [ %nn.1.1, %do.cond.1 ]
%ss.1.unr = phi ptr [ %ss.0, %do.body.preheader ], [ %incdec.ptr14.1, %do.cond.1 ]
%nn.0.unr = phi ptr [ %num, %do.body.preheader ], [ %nn.1.1, %do.cond.1 ]
%k.0.unr = phi i32 [ 1, %do.body.preheader ], [ %k.1.1, %do.cond.1 ]
%x.1.unr = phi i32 [ 0, %do.body.preheader ], [ %x.2.1, %do.cond.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %do.end, label %do.body.epil
do.body.epil: ; preds = %do.end.unr-lcssa
%incdec.ptr14.epil = getelementptr inbounds i8, ptr %ss.1.unr, i64 -1
%cmp17.epil = icmp eq i32 %k.0.unr, 100000000
%cmp19.epil = icmp eq ptr %incdec.ptr14.epil, %str.addr.0
%or.cond52.epil = or i1 %cmp19.epil, %cmp17.epil
br i1 %or.cond52.epil, label %if.then21.epil, label %do.end
if.then21.epil: ; preds = %do.body.epil
%6 = load i8, ptr %incdec.ptr14.epil, align 1, !tbaa !5
%conv15.epil = sext i8 %6 to i32
%sub.epil = add nsw i32 %conv15.epil, -48
%mul.epil = mul nsw i32 %sub.epil, %k.0.unr
%add.epil = add nsw i32 %mul.epil, %x.1.unr
%incdec.ptr22.epil = getelementptr inbounds i32, ptr %nn.0.unr, i64 1
store i32 %add.epil, ptr %incdec.ptr22.epil, align 4, !tbaa !11
br label %do.end
do.end: ; preds = %do.body.epil, %if.then21.epil, %do.end.unr-lcssa
%nn.1.lcssa = phi ptr [ %nn.1.lcssa.ph, %do.end.unr-lcssa ], [ %incdec.ptr22.epil, %if.then21.epil ], [ %nn.0.unr, %do.body.epil ]
%sub.ptr.lhs.cast = ptrtoint ptr %nn.1.lcssa to i64
%sub.ptr.rhs.cast = ptrtoint ptr %num to i64
%sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast
%sub.ptr.div = lshr exact i64 %sub.ptr.sub, 2
%conv26 = trunc i64 %sub.ptr.div to i32
br label %cleanup
cleanup: ; preds = %while.end11, %do.end
%storemerge = phi i32 [ %conv26, %do.end ], [ 0, %while.end11 ]
store i32 %storemerge, ptr %num, align 4, !tbaa !11
ret ptr %ss.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mpNum2Str(ptr noundef %str, ptr nocapture noundef readonly %num) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %num, align 4, !tbaa !11
switch i32 %0, label %if.end [
i32 0, label %if.then
i32 1, label %land.lhs.true
]
land.lhs.true: ; preds = %entry
%add.ptr = getelementptr inbounds i32, ptr %num, i64 1
%1 = load i32, ptr %add.ptr, align 4, !tbaa !11
%cmp2 = icmp eq i32 %1, 0
br i1 %cmp2, label %if.then, label %if.end.thread
if.end.thread: ; preds = %land.lhs.true
%add.ptr358 = getelementptr inbounds i8, ptr %str, i64 -1
br label %for.body.preheader
if.then: ; preds = %entry, %land.lhs.true
%incdec.ptr = getelementptr inbounds i8, ptr %str, i64 1
store i8 48, ptr %str, align 1, !tbaa !5
store i8 0, ptr %incdec.ptr, align 1, !tbaa !5
br label %cleanup
if.end: ; preds = %entry
%add.ptr3 = getelementptr inbounds i8, ptr %str, i64 -1
%cmp451 = icmp sgt i32 %0, 0
br i1 %cmp451, label %for.body.preheader, label %while.cond.preheader
for.body.preheader: ; preds = %if.end.thread, %if.end
%ss.054.ph = phi ptr [ %add.ptr3, %if.end ], [ %add.ptr358, %if.end.thread ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%ss.054 = phi ptr [ %incdec.ptr9.8, %for.body ], [ %ss.054.ph, %for.body.preheader ]
%i.053 = phi i32 [ %dec, %for.body ], [ %0, %for.body.preheader ]
%num.addr.052 = phi ptr [ %incdec.ptr5, %for.body ], [ %num, %for.body.preheader ]
%incdec.ptr5 = getelementptr inbounds i32, ptr %num.addr.052, i64 1
%2 = load i32, ptr %incdec.ptr5, align 4, !tbaa !11
%rem = srem i32 %2, 10
%3 = trunc i32 %rem to i8
%conv = add nsw i8 %3, 48
%incdec.ptr9 = getelementptr inbounds i8, ptr %ss.054, i64 1
store i8 %conv, ptr %incdec.ptr9, align 1, !tbaa !5
%div = sdiv i32 %2, 10
%rem.1 = srem i32 %div, 10
%4 = trunc i32 %rem.1 to i8
%conv.1 = add nsw i8 %4, 48
%incdec.ptr9.1 = getelementptr inbounds i8, ptr %ss.054, i64 2
store i8 %conv.1, ptr %incdec.ptr9.1, align 1, !tbaa !5
%div.1 = sdiv i32 %2, 100
%rem.2 = srem i32 %div.1, 10
%5 = trunc i32 %rem.2 to i8
%conv.2 = add nsw i8 %5, 48
%incdec.ptr9.2 = getelementptr inbounds i8, ptr %ss.054, i64 3
store i8 %conv.2, ptr %incdec.ptr9.2, align 1, !tbaa !5
%div.2 = sdiv i32 %2, 1000
%rem.3 = srem i32 %div.2, 10
%6 = trunc i32 %rem.3 to i8
%conv.3 = add nsw i8 %6, 48
%incdec.ptr9.3 = getelementptr inbounds i8, ptr %ss.054, i64 4
store i8 %conv.3, ptr %incdec.ptr9.3, align 1, !tbaa !5
%div.3 = sdiv i32 %2, 10000
%rem.4 = srem i32 %div.3, 10
%7 = trunc i32 %rem.4 to i8
%conv.4 = add nsw i8 %7, 48
%incdec.ptr9.4 = getelementptr inbounds i8, ptr %ss.054, i64 5
store i8 %conv.4, ptr %incdec.ptr9.4, align 1, !tbaa !5
%div.4 = sdiv i32 %2, 100000
%rem.5.lhs.trunc = trunc i32 %div.4 to i16
%rem.561 = srem i16 %rem.5.lhs.trunc, 10
%8 = trunc i16 %rem.561 to i8
%conv.5 = add nsw i8 %8, 48
%incdec.ptr9.5 = getelementptr inbounds i8, ptr %ss.054, i64 6
store i8 %conv.5, ptr %incdec.ptr9.5, align 1, !tbaa !5
%div.5 = sdiv i32 %2, 1000000
%rem.6.lhs.trunc = trunc i32 %div.5 to i16
%rem.662 = srem i16 %rem.6.lhs.trunc, 10
%9 = trunc i16 %rem.662 to i8
%conv.6 = add nsw i8 %9, 48
%incdec.ptr9.6 = getelementptr inbounds i8, ptr %ss.054, i64 7
store i8 %conv.6, ptr %incdec.ptr9.6, align 1, !tbaa !5
%div.6 = sdiv i32 %2, 10000000
%rem.7.lhs.trunc = trunc i32 %div.6 to i16
%rem.763 = srem i16 %rem.7.lhs.trunc, 10
%10 = trunc i16 %rem.763 to i8
%conv.7 = add nsw i8 %10, 48
%incdec.ptr9.7 = getelementptr inbounds i8, ptr %ss.054, i64 8
store i8 %conv.7, ptr %incdec.ptr9.7, align 1, !tbaa !5
%div.7 = sdiv i32 %2, 100000000
%rem.8.lhs.trunc = trunc i32 %div.7 to i8
%rem.864 = srem i8 %rem.8.lhs.trunc, 10
%conv.8 = add nsw i8 %rem.864, 48
%incdec.ptr9.8 = getelementptr inbounds i8, ptr %ss.054, i64 9
store i8 %conv.8, ptr %incdec.ptr9.8, align 1, !tbaa !5
%dec = add nsw i32 %i.053, -1
%cmp4 = icmp ugt i32 %i.053, 1
br i1 %cmp4, label %for.body, label %while.cond.preheader, !llvm.loop !14
while.cond.preheader: ; preds = %for.body, %if.end
%ss.2.ph = phi ptr [ %add.ptr3, %if.end ], [ %incdec.ptr9.8, %for.body ]
br label %while.cond
while.cond: ; preds = %while.cond.preheader, %while.cond
%ss.2 = phi ptr [ %incdec.ptr15, %while.cond ], [ %ss.2.ph, %while.cond.preheader ]
%11 = load i8, ptr %ss.2, align 1, !tbaa !5
%cmp13 = icmp eq i8 %11, 48
%incdec.ptr15 = getelementptr inbounds i8, ptr %ss.2, i64 -1
br i1 %cmp13, label %while.cond, label %while.end, !llvm.loop !15
while.end: ; preds = %while.cond
%add.ptr16 = getelementptr inbounds i8, ptr %ss.2, i64 1
store i8 0, ptr %add.ptr16, align 1, !tbaa !5
%cmp1855 = icmp ugt ptr %ss.2, %str
br i1 %cmp1855, label %while.body20, label %cleanup
while.body20: ; preds = %while.end, %while.body20
%ss.357 = phi ptr [ %incdec.ptr24, %while.body20 ], [ %ss.2, %while.end ]
%str.addr.056 = phi ptr [ %incdec.ptr22, %while.body20 ], [ %str, %while.end ]
%12 = load i8, ptr %str.addr.056, align 1, !tbaa !5
%13 = load i8, ptr %ss.357, align 1, !tbaa !5
%incdec.ptr22 = getelementptr inbounds i8, ptr %str.addr.056, i64 1
store i8 %13, ptr %str.addr.056, align 1, !tbaa !5
%incdec.ptr24 = getelementptr inbounds i8, ptr %ss.357, i64 -1
store i8 %12, ptr %ss.357, align 1, !tbaa !5
%cmp18 = icmp ult ptr %incdec.ptr22, %incdec.ptr24
br i1 %cmp18, label %while.body20, label %cleanup, !llvm.loop !16
cleanup: ; preds = %while.body20, %while.end, %if.then
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mpAdd(ptr nocapture noundef writeonly %ret, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !11
%1 = load i32, ptr %b, align 4, !tbaa !11
%cond = tail call i32 @llvm.smax.i32(i32 %0, i32 %1)
%cmp1.not34 = icmp slt i32 %cond, 1
br i1 %cmp1.not34, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%rr.039 = phi ptr [ %rr.1, %for.inc ], [ %ret, %entry ]
%x.038 = phi i32 [ %x.3, %for.inc ], [ 0, %entry ]
%a.addr.037 = phi ptr [ %a.addr.1, %for.inc ], [ %a, %entry ]
%b.addr.036 = phi ptr [ %b.addr.1, %for.inc ], [ %b, %entry ]
%i.035 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%cmp2.not = icmp sgt i32 %i.035, %0
br i1 %cmp2.not, label %if.end, label %if.then
if.then: ; preds = %for.body
%incdec.ptr = getelementptr inbounds i32, ptr %a.addr.037, i64 1
%2 = load i32, ptr %incdec.ptr, align 4, !tbaa !11
%add = add nsw i32 %2, %x.038
br label %if.end
if.end: ; preds = %if.then, %for.body
%a.addr.1 = phi ptr [ %incdec.ptr, %if.then ], [ %a.addr.037, %for.body ]
%x.1 = phi i32 [ %add, %if.then ], [ %x.038, %for.body ]
%cmp3.not = icmp sgt i32 %i.035, %1
br i1 %cmp3.not, label %if.end7, label %if.then4
if.then4: ; preds = %if.end
%incdec.ptr5 = getelementptr inbounds i32, ptr %b.addr.036, i64 1
%3 = load i32, ptr %incdec.ptr5, align 4, !tbaa !11
%add6 = add nsw i32 %3, %x.1
br label %if.end7
if.end7: ; preds = %if.then4, %if.end
%b.addr.1 = phi ptr [ %incdec.ptr5, %if.then4 ], [ %b.addr.036, %if.end ]
%x.2 = phi i32 [ %add6, %if.then4 ], [ %x.1, %if.end ]
%cmp8 = icmp slt i32 %x.2, 1000000000
br i1 %cmp8, label %if.then9, label %if.else
if.then9: ; preds = %if.end7
%incdec.ptr10 = getelementptr inbounds i32, ptr %rr.039, i64 1
store i32 %x.2, ptr %incdec.ptr10, align 4, !tbaa !11
br label %for.inc
if.else: ; preds = %if.end7
%sub = add nsw i32 %x.2, -1000000000
%incdec.ptr11 = getelementptr inbounds i32, ptr %rr.039, i64 1
store i32 %sub, ptr %incdec.ptr11, align 4, !tbaa !11
br label %for.inc
for.inc: ; preds = %if.then9, %if.else
%x.3 = phi i32 [ 0, %if.then9 ], [ 1, %if.else ]
%rr.1 = phi ptr [ %incdec.ptr10, %if.then9 ], [ %incdec.ptr11, %if.else ]
%inc = add nuw i32 %i.035, 1
%exitcond.not = icmp eq i32 %i.035, %cond
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !17
for.end: ; preds = %for.inc, %entry
%x.0.lcssa = phi i32 [ 0, %entry ], [ %x.3, %for.inc ]
%rr.0.lcssa = phi ptr [ %ret, %entry ], [ %rr.1, %for.inc ]
%incdec.ptr13 = getelementptr inbounds i32, ptr %rr.0.lcssa, i64 1
store i32 %x.0.lcssa, ptr %incdec.ptr13, align 4, !tbaa !11
%add14 = add nsw i32 %x.0.lcssa, %cond
store i32 %add14, ptr %ret, align 4, !tbaa !11
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mpSub(ptr nocapture noundef %ret, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !11
%1 = load i32, ptr %b, align 4, !tbaa !11
%cmp.not27 = icmp slt i32 %0, 1
br i1 %cmp.not27, label %while.cond.preheader, label %for.body.preheader
for.body.preheader: ; preds = %entry
%2 = add nuw i32 %0, 1
br label %for.body
while.cond.preheader: ; preds = %for.inc, %entry
%i.0.lcssa = phi i32 [ 1, %entry ], [ %2, %for.inc ]
%rr.0.lcssa = phi ptr [ %ret, %entry ], [ %rr.1, %for.inc ]
%smin = tail call i32 @llvm.smin.i32(i32 %i.0.lcssa, i32 1)
%3 = add i32 %smin, -1
br label %while.cond
for.body: ; preds = %for.body.preheader, %for.inc
%rr.032 = phi ptr [ %rr.1, %for.inc ], [ %ret, %for.body.preheader ]
%x.031 = phi i32 [ %x.2, %for.inc ], [ 0, %for.body.preheader ]
%a.addr.030 = phi ptr [ %incdec.ptr, %for.inc ], [ %a, %for.body.preheader ]
%b.addr.029 = phi ptr [ %b.addr.1, %for.inc ], [ %b, %for.body.preheader ]
%i.028 = phi i32 [ %inc, %for.inc ], [ 1, %for.body.preheader ]
%incdec.ptr = getelementptr inbounds i32, ptr %a.addr.030, i64 1
%4 = load i32, ptr %incdec.ptr, align 4, !tbaa !11
%add = add nsw i32 %4, %x.031
%cmp1.not = icmp sgt i32 %i.028, %1
br i1 %cmp1.not, label %if.end, label %if.then
if.then: ; preds = %for.body
%incdec.ptr2 = getelementptr inbounds i32, ptr %b.addr.029, i64 1
%5 = load i32, ptr %incdec.ptr2, align 4, !tbaa !11
%sub = sub nsw i32 %add, %5
br label %if.end
if.end: ; preds = %if.then, %for.body
%b.addr.1 = phi ptr [ %incdec.ptr2, %if.then ], [ %b.addr.029, %for.body ]
%x.1 = phi i32 [ %sub, %if.then ], [ %add, %for.body ]
%cmp3 = icmp sgt i32 %x.1, -1
br i1 %cmp3, label %if.then4, label %if.else
if.then4: ; preds = %if.end
%incdec.ptr5 = getelementptr inbounds i32, ptr %rr.032, i64 1
store i32 %x.1, ptr %incdec.ptr5, align 4, !tbaa !11
br label %for.inc
if.else: ; preds = %if.end
%add6 = add nsw i32 %x.1, 1000000000
%incdec.ptr7 = getelementptr inbounds i32, ptr %rr.032, i64 1
store i32 %add6, ptr %incdec.ptr7, align 4, !tbaa !11
br label %for.inc
for.inc: ; preds = %if.then4, %if.else
%x.2 = phi i32 [ 0, %if.then4 ], [ -1, %if.else ]
%rr.1 = phi ptr [ %incdec.ptr5, %if.then4 ], [ %incdec.ptr7, %if.else ]
%inc = add nuw i32 %i.028, 1
%exitcond.not = icmp eq i32 %i.028, %0
br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !18
while.cond: ; preds = %while.cond.preheader, %while.body
%i.1 = phi i32 [ %dec, %while.body ], [ %i.0.lcssa, %while.cond.preheader ]
%rr.2 = phi ptr [ %incdec.ptr10, %while.body ], [ %rr.0.lcssa, %while.cond.preheader ]
%cmp9 = icmp sgt i32 %i.1, 1
br i1 %cmp9, label %while.body, label %while.end
while.body: ; preds = %while.cond
%dec = add nsw i32 %i.1, -1
%incdec.ptr10 = getelementptr inbounds i32, ptr %rr.2, i64 -1
%6 = load i32, ptr %rr.2, align 4, !tbaa !11
%cmp11.not = icmp eq i32 %6, 0
br i1 %cmp11.not, label %while.cond, label %while.end, !llvm.loop !19
while.end: ; preds = %while.body, %while.cond
%dec.lcssa = phi i32 [ %dec, %while.body ], [ %3, %while.cond ]
store i32 %dec.lcssa, ptr %ret, align 4, !tbaa !11
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @mpCmp(ptr noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !11
%1 = load i32, ptr %b, align 4, !tbaa !11
%cmp.not = icmp eq i32 %0, %1
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%sub = sub nsw i32 %0, %1
br label %cleanup
if.end: ; preds = %entry
%cmp3.not27 = icmp eq i32 %0, 0
br i1 %cmp3.not27, label %cleanup, label %while.body.preheader
while.body.preheader: ; preds = %if.end
%idx.ext = sext i32 %0 to i64
%add.ptr2 = getelementptr inbounds i32, ptr %b, i64 %idx.ext
%add.ptr = getelementptr inbounds i32, ptr %a, i64 %idx.ext
br label %while.body
while.body: ; preds = %while.body.preheader, %if.end7
%b.addr.029 = phi ptr [ %incdec.ptr8, %if.end7 ], [ %add.ptr2, %while.body.preheader ]
%a.addr.028 = phi ptr [ %incdec.ptr, %if.end7 ], [ %add.ptr, %while.body.preheader ]
%2 = load i32, ptr %a.addr.028, align 4, !tbaa !11
%3 = load i32, ptr %b.addr.029, align 4, !tbaa !11
%cmp4.not = icmp eq i32 %2, %3
br i1 %cmp4.not, label %if.end7, label %if.then5
if.then5: ; preds = %while.body
%sub6 = sub nsw i32 %2, %3
br label %cleanup
if.end7: ; preds = %while.body
%incdec.ptr = getelementptr inbounds i32, ptr %a.addr.028, i64 -1
%incdec.ptr8 = getelementptr inbounds i32, ptr %b.addr.029, i64 -1
%cmp3.not = icmp eq ptr %incdec.ptr, %a
br i1 %cmp3.not, label %cleanup, label %while.body, !llvm.loop !20
cleanup: ; preds = %if.end7, %if.end, %if.then5, %if.then
%retval.0 = phi i32 [ %sub, %if.then ], [ %sub6, %if.then5 ], [ 0, %if.end ], [ 0, %if.end7 ]
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @mpAddSub(ptr nocapture noundef %ret, ptr noundef readonly %a, i32 noundef %a_minus, ptr nocapture noundef readonly %b, i32 noundef %b_minus) local_unnamed_addr #1 {
entry:
%tobool = icmp ne i32 %a_minus, 0
%tobool1 = icmp ne i32 %b_minus, 0
%or.cond = and i1 %tobool, %tobool1
%b_minus.addr.0 = select i1 %or.cond, i32 0, i32 %b_minus
%a_minus.addr.0 = select i1 %or.cond, i32 0, i32 %a_minus
%minus.0 = zext i1 %or.cond to i32
%0 = or i32 %a_minus.addr.0, %b_minus.addr.0
%or.cond14.not = icmp eq i32 %0, 0
%1 = load i32, ptr %a, align 4, !tbaa !11
%2 = load i32, ptr %b, align 4, !tbaa !11
br i1 %or.cond14.not, label %if.then5, label %if.else
if.then5: ; preds = %entry
%cond.i = tail call i32 @llvm.smax.i32(i32 %1, i32 %2)
%cmp1.not34.i = icmp slt i32 %cond.i, 1
br i1 %cmp1.not34.i, label %mpAdd.exit, label %for.body.i
for.body.i: ; preds = %if.then5, %for.inc.i
%rr.039.i = phi ptr [ %rr.1.i, %for.inc.i ], [ %ret, %if.then5 ]
%x.038.i = phi i32 [ %x.3.i, %for.inc.i ], [ 0, %if.then5 ]
%a.addr.037.i = phi ptr [ %a.addr.1.i, %for.inc.i ], [ %a, %if.then5 ]
%b.addr.036.i = phi ptr [ %b.addr.1.i, %for.inc.i ], [ %b, %if.then5 ]
%i.035.i = phi i32 [ %inc.i, %for.inc.i ], [ 1, %if.then5 ]
%cmp2.not.i = icmp sgt i32 %i.035.i, %1
br i1 %cmp2.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%incdec.ptr.i = getelementptr inbounds i32, ptr %a.addr.037.i, i64 1
%3 = load i32, ptr %incdec.ptr.i, align 4, !tbaa !11
%add.i = add nsw i32 %3, %x.038.i
br label %if.end.i
if.end.i: ; preds = %if.then.i, %for.body.i
%a.addr.1.i = phi ptr [ %incdec.ptr.i, %if.then.i ], [ %a.addr.037.i, %for.body.i ]
%x.1.i = phi i32 [ %add.i, %if.then.i ], [ %x.038.i, %for.body.i ]
%cmp3.not.i = icmp sgt i32 %i.035.i, %2
br i1 %cmp3.not.i, label %if.end7.i, label %if.then4.i
if.then4.i: ; preds = %if.end.i
%incdec.ptr5.i = getelementptr inbounds i32, ptr %b.addr.036.i, i64 1
%4 = load i32, ptr %incdec.ptr5.i, align 4, !tbaa !11
%add6.i = add nsw i32 %4, %x.1.i
br label %if.end7.i
if.end7.i: ; preds = %if.then4.i, %if.end.i
%b.addr.1.i = phi ptr [ %incdec.ptr5.i, %if.then4.i ], [ %b.addr.036.i, %if.end.i ]
%x.2.i = phi i32 [ %add6.i, %if.then4.i ], [ %x.1.i, %if.end.i ]
%cmp8.i = icmp slt i32 %x.2.i, 1000000000
br i1 %cmp8.i, label %if.then9.i, label %if.else.i
if.then9.i: ; preds = %if.end7.i
%incdec.ptr10.i = getelementptr inbounds i32, ptr %rr.039.i, i64 1
store i32 %x.2.i, ptr %incdec.ptr10.i, align 4, !tbaa !11
br label %for.inc.i
if.else.i: ; preds = %if.end7.i
%sub.i = add nsw i32 %x.2.i, -1000000000
%incdec.ptr11.i = getelementptr inbounds i32, ptr %rr.039.i, i64 1
store i32 %sub.i, ptr %incdec.ptr11.i, align 4, !tbaa !11
br label %for.inc.i
for.inc.i: ; preds = %if.else.i, %if.then9.i
%x.3.i = phi i32 [ 0, %if.then9.i ], [ 1, %if.else.i ]
%rr.1.i = phi ptr [ %incdec.ptr10.i, %if.then9.i ], [ %incdec.ptr11.i, %if.else.i ]
%inc.i = add nuw i32 %i.035.i, 1
%exitcond.not.i = icmp eq i32 %i.035.i, %cond.i
br i1 %exitcond.not.i, label %mpAdd.exit, label %for.body.i, !llvm.loop !17
mpAdd.exit: ; preds = %for.inc.i, %if.then5
%x.0.lcssa.i = phi i32 [ 0, %if.then5 ], [ %x.3.i, %for.inc.i ]
%rr.0.lcssa.i = phi ptr [ %ret, %if.then5 ], [ %rr.1.i, %for.inc.i ]
%incdec.ptr13.i = getelementptr inbounds i32, ptr %rr.0.lcssa.i, i64 1
store i32 %x.0.lcssa.i, ptr %incdec.ptr13.i, align 4, !tbaa !11
%add14.i = add nsw i32 %x.0.lcssa.i, %cond.i
br label %if.end13
if.else: ; preds = %entry
%cmp.not.i = icmp eq i32 %1, %2
br i1 %cmp.not.i, label %if.end.i31, label %if.then.i29
if.then.i29: ; preds = %if.else
%sub.i30 = sub nsw i32 %1, %2
br label %mpCmp.exit
if.end.i31: ; preds = %if.else
%cmp3.not27.i = icmp eq i32 %1, 0
br i1 %cmp3.not27.i, label %if.end13, label %while.body.preheader.i
while.body.preheader.i: ; preds = %if.end.i31
%idx.ext.i = sext i32 %1 to i64
%add.ptr2.i = getelementptr inbounds i32, ptr %b, i64 %idx.ext.i
%add.ptr.i = getelementptr inbounds i32, ptr %a, i64 %idx.ext.i
br label %while.body.i
while.body.i: ; preds = %if.end7.i32, %while.body.preheader.i
%b.addr.029.i = phi ptr [ %incdec.ptr8.i, %if.end7.i32 ], [ %add.ptr2.i, %while.body.preheader.i ]
%a.addr.028.i = phi ptr [ %incdec.ptr.i33, %if.end7.i32 ], [ %add.ptr.i, %while.body.preheader.i ]
%5 = load i32, ptr %a.addr.028.i, align 4, !tbaa !11
%6 = load i32, ptr %b.addr.029.i, align 4, !tbaa !11
%cmp4.not.i = icmp eq i32 %5, %6
br i1 %cmp4.not.i, label %if.end7.i32, label %if.then5.i
if.then5.i: ; preds = %while.body.i
%sub6.i = sub nsw i32 %5, %6
br label %mpCmp.exit
if.end7.i32: ; preds = %while.body.i
%incdec.ptr.i33 = getelementptr inbounds i32, ptr %a.addr.028.i, i64 -1
%incdec.ptr8.i = getelementptr inbounds i32, ptr %b.addr.029.i, i64 -1
%cmp3.not.i34 = icmp eq ptr %incdec.ptr.i33, %a
br i1 %cmp3.not.i34, label %if.end13, label %while.body.i, !llvm.loop !20
mpCmp.exit: ; preds = %if.then.i29, %if.then5.i
%retval.0.i = phi i32 [ %sub.i30, %if.then.i29 ], [ %sub6.i, %if.then5.i ]
%cmp = icmp eq i32 %retval.0.i, 0
br i1 %cmp, label %if.end13, label %if.else7
if.else7: ; preds = %mpCmp.exit
%cmp8 = icmp sgt i32 %retval.0.i, 0
br i1 %cmp8, label %if.then9, label %if.else10
if.then9: ; preds = %if.else7
%cmp.not27.i = icmp slt i32 %1, 1
br i1 %cmp.not27.i, label %while.cond.preheader.i, label %for.body.i35
while.cond.preheader.i.loopexit: ; preds = %for.inc.i46
%7 = add nuw i32 %1, 1
br label %while.cond.preheader.i
while.cond.preheader.i: ; preds = %while.cond.preheader.i.loopexit, %if.then9
%i.0.lcssa.i = phi i32 [ 1, %if.then9 ], [ %7, %while.cond.preheader.i.loopexit ]
%rr.0.lcssa.i51 = phi ptr [ %ret, %if.then9 ], [ %rr.1.i48, %while.cond.preheader.i.loopexit ]
%smin.i = tail call i32 @llvm.smin.i32(i32 %i.0.lcssa.i, i32 1)
%8 = add i32 %smin.i, -1
br label %while.cond.i
for.body.i35: ; preds = %if.then9, %for.inc.i46
%rr.032.i = phi ptr [ %rr.1.i48, %for.inc.i46 ], [ %ret, %if.then9 ]
%x.031.i = phi i32 [ %x.2.i47, %for.inc.i46 ], [ 0, %if.then9 ]
%a.addr.030.i = phi ptr [ %incdec.ptr.i37, %for.inc.i46 ], [ %a, %if.then9 ]
%b.addr.029.i36 = phi ptr [ %b.addr.1.i42, %for.inc.i46 ], [ %b, %if.then9 ]
%i.028.i = phi i32 [ %inc.i49, %for.inc.i46 ], [ 1, %if.then9 ]
%incdec.ptr.i37 = getelementptr inbounds i32, ptr %a.addr.030.i, i64 1
%9 = load i32, ptr %incdec.ptr.i37, align 4, !tbaa !11
%add.i38 = add nsw i32 %9, %x.031.i
%cmp1.not.i = icmp sgt i32 %i.028.i, %2
br i1 %cmp1.not.i, label %if.end.i41, label %if.then.i39
if.then.i39: ; preds = %for.body.i35
%incdec.ptr2.i = getelementptr inbounds i32, ptr %b.addr.029.i36, i64 1
%10 = load i32, ptr %incdec.ptr2.i, align 4, !tbaa !11
%sub.i40 = sub nsw i32 %add.i38, %10
br label %if.end.i41
if.end.i41: ; preds = %if.then.i39, %for.body.i35
%b.addr.1.i42 = phi ptr [ %incdec.ptr2.i, %if.then.i39 ], [ %b.addr.029.i36, %for.body.i35 ]
%x.1.i43 = phi i32 [ %sub.i40, %if.then.i39 ], [ %add.i38, %for.body.i35 ]
%cmp3.i = icmp sgt i32 %x.1.i43, -1
br i1 %cmp3.i, label %if.then4.i54, label %if.else.i44
if.then4.i54: ; preds = %if.end.i41
%incdec.ptr5.i55 = getelementptr inbounds i32, ptr %rr.032.i, i64 1
store i32 %x.1.i43, ptr %incdec.ptr5.i55, align 4, !tbaa !11
br label %for.inc.i46
if.else.i44: ; preds = %if.end.i41
%add6.i45 = add nsw i32 %x.1.i43, 1000000000
%incdec.ptr7.i = getelementptr inbounds i32, ptr %rr.032.i, i64 1
store i32 %add6.i45, ptr %incdec.ptr7.i, align 4, !tbaa !11
br label %for.inc.i46
for.inc.i46: ; preds = %if.else.i44, %if.then4.i54
%x.2.i47 = phi i32 [ 0, %if.then4.i54 ], [ -1, %if.else.i44 ]
%rr.1.i48 = phi ptr [ %incdec.ptr5.i55, %if.then4.i54 ], [ %incdec.ptr7.i, %if.else.i44 ]
%inc.i49 = add nuw i32 %i.028.i, 1
%exitcond.not.i50 = icmp eq i32 %i.028.i, %1
br i1 %exitcond.not.i50, label %while.cond.preheader.i.loopexit, label %for.body.i35, !llvm.loop !18
while.cond.i: ; preds = %while.body.i52, %while.cond.preheader.i
%i.1.i = phi i32 [ %dec.i, %while.body.i52 ], [ %i.0.lcssa.i, %while.cond.preheader.i ]
%rr.2.i = phi ptr [ %incdec.ptr10.i53, %while.body.i52 ], [ %rr.0.lcssa.i51, %while.cond.preheader.i ]
%cmp9.i = icmp sgt i32 %i.1.i, 1
br i1 %cmp9.i, label %while.body.i52, label %if.end13
while.body.i52: ; preds = %while.cond.i
%dec.i = add nsw i32 %i.1.i, -1
%incdec.ptr10.i53 = getelementptr inbounds i32, ptr %rr.2.i, i64 -1
%11 = load i32, ptr %rr.2.i, align 4, !tbaa !11
%cmp11.not.i = icmp eq i32 %11, 0
br i1 %cmp11.not.i, label %while.cond.i, label %if.end13, !llvm.loop !19
if.else10: ; preds = %if.else7
%cmp.not27.i56 = icmp slt i32 %2, 1
br i1 %cmp.not27.i56, label %while.cond.preheader.i82, label %for.body.i58
while.cond.preheader.i82.loopexit: ; preds = %for.inc.i77
%12 = add nuw i32 %2, 1
br label %while.cond.preheader.i82
while.cond.preheader.i82: ; preds = %while.cond.preheader.i82.loopexit, %if.else10
%i.0.lcssa.i83 = phi i32 [ 1, %if.else10 ], [ %12, %while.cond.preheader.i82.loopexit ]
%rr.0.lcssa.i84 = phi ptr [ %ret, %if.else10 ], [ %rr.1.i79, %while.cond.preheader.i82.loopexit ]
%smin.i85 = tail call i32 @llvm.smin.i32(i32 %i.0.lcssa.i83, i32 1)
%13 = add i32 %smin.i85, -1
br label %while.cond.i86
for.body.i58: ; preds = %if.else10, %for.inc.i77
%rr.032.i59 = phi ptr [ %rr.1.i79, %for.inc.i77 ], [ %ret, %if.else10 ]
%x.031.i60 = phi i32 [ %x.2.i78, %for.inc.i77 ], [ 0, %if.else10 ]
%a.addr.030.i61 = phi ptr [ %incdec.ptr.i64, %for.inc.i77 ], [ %b, %if.else10 ]
%b.addr.029.i62 = phi ptr [ %b.addr.1.i71, %for.inc.i77 ], [ %a, %if.else10 ]
%i.028.i63 = phi i32 [ %inc.i80, %for.inc.i77 ], [ 1, %if.else10 ]
%incdec.ptr.i64 = getelementptr inbounds i32, ptr %a.addr.030.i61, i64 1
%14 = load i32, ptr %incdec.ptr.i64, align 4, !tbaa !11
%add.i65 = add nsw i32 %14, %x.031.i60
%cmp1.not.i66 = icmp sgt i32 %i.028.i63, %1
br i1 %cmp1.not.i66, label %if.end.i70, label %if.then.i67
if.then.i67: ; preds = %for.body.i58
%incdec.ptr2.i68 = getelementptr inbounds i32, ptr %b.addr.029.i62, i64 1
%15 = load i32, ptr %incdec.ptr2.i68, align 4, !tbaa !11
%sub.i69 = sub nsw i32 %add.i65, %15
br label %if.end.i70
if.end.i70: ; preds = %if.then.i67, %for.body.i58
%b.addr.1.i71 = phi ptr [ %incdec.ptr2.i68, %if.then.i67 ], [ %b.addr.029.i62, %for.body.i58 ]
%x.1.i72 = phi i32 [ %sub.i69, %if.then.i67 ], [ %add.i65, %for.body.i58 ]
%cmp3.i73 = icmp sgt i32 %x.1.i72, -1
br i1 %cmp3.i73, label %if.then4.i95, label %if.else.i74
if.then4.i95: ; preds = %if.end.i70
%incdec.ptr5.i96 = getelementptr inbounds i32, ptr %rr.032.i59, i64 1
store i32 %x.1.i72, ptr %incdec.ptr5.i96, align 4, !tbaa !11
br label %for.inc.i77
if.else.i74: ; preds = %if.end.i70
%add6.i75 = add nsw i32 %x.1.i72, 1000000000
%incdec.ptr7.i76 = getelementptr inbounds i32, ptr %rr.032.i59, i64 1
store i32 %add6.i75, ptr %incdec.ptr7.i76, align 4, !tbaa !11
br label %for.inc.i77
for.inc.i77: ; preds = %if.else.i74, %if.then4.i95
%x.2.i78 = phi i32 [ 0, %if.then4.i95 ], [ -1, %if.else.i74 ]
%rr.1.i79 = phi ptr [ %incdec.ptr5.i96, %if.then4.i95 ], [ %incdec.ptr7.i76, %if.else.i74 ]
%inc.i80 = add nuw i32 %i.028.i63, 1
%exitcond.not.i81 = icmp eq i32 %i.028.i63, %2
br i1 %exitcond.not.i81, label %while.cond.preheader.i82.loopexit, label %for.body.i58, !llvm.loop !18
while.cond.i86: ; preds = %while.body.i91, %while.cond.preheader.i82
%i.1.i87 = phi i32 [ %dec.i92, %while.body.i91 ], [ %i.0.lcssa.i83, %while.cond.preheader.i82 ]
%rr.2.i88 = phi ptr [ %incdec.ptr10.i93, %while.body.i91 ], [ %rr.0.lcssa.i84, %while.cond.preheader.i82 ]
%cmp9.i89 = icmp sgt i32 %i.1.i87, 1
br i1 %cmp9.i89, label %while.body.i91, label %if.end13
while.body.i91: ; preds = %while.cond.i86
%dec.i92 = add nsw i32 %i.1.i87, -1
%incdec.ptr10.i93 = getelementptr inbounds i32, ptr %rr.2.i88, i64 -1
%16 = load i32, ptr %rr.2.i88, align 4, !tbaa !11
%cmp11.not.i94 = icmp eq i32 %16, 0
br i1 %cmp11.not.i94, label %while.cond.i86, label %if.end13, !llvm.loop !19
if.end13: ; preds = %if.end7.i32, %while.body.i91, %while.cond.i86, %while.body.i52, %while.cond.i, %mpCmp.exit, %if.end.i31, %mpAdd.exit
%.sink = phi i32 [ %add14.i, %mpAdd.exit ], [ 0, %if.end.i31 ], [ 0, %mpCmp.exit ], [ %dec.i, %while.body.i52 ], [ %8, %while.cond.i ], [ %dec.i92, %while.body.i91 ], [ %13, %while.cond.i86 ], [ 0, %if.end7.i32 ]
%minus.1 = phi i32 [ %minus.0, %mpAdd.exit ], [ 0, %if.end.i31 ], [ 0, %mpCmp.exit ], [ %a_minus.addr.0, %while.cond.i ], [ %a_minus.addr.0, %while.body.i52 ], [ %b_minus.addr.0, %while.cond.i86 ], [ %b_minus.addr.0, %while.body.i91 ], [ 0, %if.end7.i32 ]
store i32 %.sink, ptr %ret, align 4, !tbaa !11
ret i32 %minus.1
}
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @mpMul(ptr nocapture noundef %ret, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !11
%1 = load i32, ptr %b, align 4, !tbaa !11
%cmp = icmp eq i32 %0, 0
%cmp1 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %cleanup, label %if.end
if.end: ; preds = %entry
%add = add i32 %1, %0
%cmp279 = icmp sgt i32 %add, 0
br i1 %cmp279, label %for.body.preheader, label %for.cond3.preheader
for.body.preheader: ; preds = %if.end
%2 = zext i32 %add to i64
%3 = add nsw i32 %add, -1
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 2
%6 = sub nsw i64 %2, %4
%7 = shl nsw i64 %6, 2
%scevgep = getelementptr i8, ptr %ret, i64 %7
%8 = add nuw nsw i64 %5, 4
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i8 0, i64 %8, i1 false), !tbaa !11
br label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.body.preheader, %if.end
%invariant.gep88 = getelementptr i32, ptr %ret, i64 -1
%cmp4.not89 = icmp slt i32 %1, 1
br i1 %cmp4.not89, label %for.end36, label %for.body5.lr.ph
for.body5.lr.ph: ; preds = %for.cond3.preheader
%cmp7.not81 = icmp slt i32 %0, 1
br i1 %cmp7.not81, label %for.body5.lr.ph.split.us, label %for.body5.preheader
for.body5.preheader: ; preds = %for.body5.lr.ph
%9 = add nuw i32 %0, 1
%10 = add nuw i32 %1, 1
%wide.trip.count100 = zext i32 %10 to i64
%wide.trip.count = zext i32 %9 to i64
%add.ptr30 = getelementptr inbounds i32, ptr %ret, i64 %wide.trip.count
%invariant.gep = getelementptr i32, ptr %add.ptr30, i64 -1
br label %for.body5
for.body5.lr.ph.split.us: ; preds = %for.body5.lr.ph
%scevgep102 = getelementptr i8, ptr %ret, i64 4
%11 = zext i32 %1 to i64
%12 = shl nuw nsw i64 %11, 2
tail call void @llvm.memset.p0.i64(ptr align 4 %scevgep102, i8 0, i64 %12, i1 false), !tbaa !11
br label %for.end36
for.body5: ; preds = %for.body5.preheader, %for.cond6.for.end28_crit_edge
%indvars.iv97 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next98, %for.cond6.for.end28_crit_edge ]
%b.addr.091 = phi ptr [ %b, %for.body5.preheader ], [ %incdec.ptr, %for.cond6.for.end28_crit_edge ]
%incdec.ptr = getelementptr inbounds i32, ptr %b.addr.091, i64 1
%gep = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv97
br label %for.body8
for.body8: ; preds = %for.body5, %for.body8
%indvars.iv = phi i64 [ 1, %for.body5 ], [ %indvars.iv.next, %for.body8 ]
%ca.184 = phi i64 [ 0, %for.body5 ], [ %div, %for.body8 ]
%aa.083 = phi ptr [ %a, %for.body5 ], [ %incdec.ptr9, %for.body8 ]
%incdec.ptr9 = getelementptr inbounds i32, ptr %aa.083, i64 1
%13 = load i32, ptr %incdec.ptr9, align 4, !tbaa !11
%conv = sext i32 %13 to i64
%14 = load i32, ptr %incdec.ptr, align 4, !tbaa !11
%conv10 = sext i32 %14 to i64
%mul = mul nsw i64 %conv10, %conv
%gep87 = getelementptr i32, ptr %gep, i64 %indvars.iv
%15 = load i32, ptr %gep87, align 4, !tbaa !11
%conv16 = sext i32 %15 to i64
%sext = shl i64 %ca.184, 32
%conv18 = ashr exact i64 %sext, 32
%add17 = add nsw i64 %conv18, %conv16
%add19 = add nsw i64 %add17, %mul
%rem = urem i64 %add19, 1000000000
%conv20 = trunc i64 %rem to i32
store i32 %conv20, ptr %gep87, align 4, !tbaa !11
%div = udiv i64 %add19, 1000000000
%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.cond6.for.end28_crit_edge, label %for.body8, !llvm.loop !21
for.cond6.for.end28_crit_edge: ; preds = %for.body8
%conv26 = trunc i64 %div to i32
%gep106 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv97
store i32 %conv26, ptr %gep106, align 4, !tbaa !11
%indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
%exitcond101.not = icmp eq i64 %indvars.iv.next98, %wide.trip.count100
br i1 %exitcond101.not, label %for.end36.loopexit94, label %for.body5, !llvm.loop !22
for.end36.loopexit94: ; preds = %for.cond6.for.end28_crit_edge
%16 = icmp eq i32 %conv26, 0
%17 = sext i1 %16 to i32
br label %for.end36
for.end36: ; preds = %for.end36.loopexit94, %for.body5.lr.ph.split.us, %for.cond3.preheader
%ca.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ -1, %for.body5.lr.ph.split.us ], [ %17, %for.end36.loopexit94 ]
%cond = add nsw i32 %add, %ca.0.lcssa
br label %cleanup
cleanup: ; preds = %entry, %for.end36
%storemerge = phi i32 [ %cond, %for.end36 ], [ 0, %entry ]
store i32 %storemerge, ptr %ret, align 4, !tbaa !11
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @mpDiv(ptr nocapture noundef %q, ptr noundef %r, ptr nocapture noundef readonly %za, ptr nocapture noundef readonly %zb) local_unnamed_addr #1 {
entry:
%za976 = ptrtoint ptr %za to i64
%r950 = ptrtoint ptr %r to i64
%q899 = ptrtoint ptr %q to i64
%zb873 = ptrtoint ptr %zb to i64
%za863 = ptrtoint ptr %za to i64
store i32 0, ptr %q, align 4, !tbaa !11
store i32 0, ptr %r, align 4, !tbaa !11
%0 = load i32, ptr %zb, align 4, !tbaa !11
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%1 = load i32, ptr %za, align 4, !tbaa !11
%cmp1 = icmp eq i32 %1, 0
br i1 %cmp1, label %cleanup, label %if.end3
if.end3: ; preds = %if.end
%cmp4 = icmp slt i32 %1, %0
br i1 %cmp4, label %for.cond.preheader, label %if.end8
for.cond.preheader: ; preds = %if.end3
%cmp6784 = icmp sgt i32 %1, -1
br i1 %cmp6784, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %for.cond.preheader
%2 = add i32 %1, 1
%3 = zext i32 %2 to i64
%min.iters.check980 = icmp ult i32 %2, 8
%4 = sub i64 %r950, %za976
%diff.check977 = icmp ult i64 %4, 32
%or.cond = or i1 %min.iters.check980, %diff.check977
br i1 %or.cond, label %for.body.preheader1006, label %vector.ph981
vector.ph981: ; preds = %for.body.preheader
%n.vec983 = and i64 %3, 4294967288
%5 = shl nuw nsw i64 %n.vec983, 2
%ind.end984 = getelementptr i8, ptr %r, i64 %5
%6 = shl nuw nsw i64 %n.vec983, 2
%ind.end986 = getelementptr i8, ptr %za, i64 %6
%.cast988 = trunc i64 %n.vec983 to i32
%ind.end989 = sub i32 %1, %.cast988
br label %vector.body992
vector.body992: ; preds = %vector.body992, %vector.ph981
%index993 = phi i64 [ 0, %vector.ph981 ], [ %index.next1000, %vector.body992 ]
%7 = shl i64 %index993, 2
%next.gep994 = getelementptr i8, ptr %r, i64 %7
%8 = shl i64 %index993, 2
%next.gep996 = getelementptr i8, ptr %za, i64 %8
%wide.load998 = load <4 x i32>, ptr %next.gep996, align 4, !tbaa !11
%9 = getelementptr i32, ptr %next.gep996, i64 4
%wide.load999 = load <4 x i32>, ptr %9, align 4, !tbaa !11
store <4 x i32> %wide.load998, ptr %next.gep994, align 4, !tbaa !11
%10 = getelementptr i32, ptr %next.gep994, i64 4
store <4 x i32> %wide.load999, ptr %10, align 4, !tbaa !11
%index.next1000 = add nuw i64 %index993, 8
%11 = icmp eq i64 %index.next1000, %n.vec983
br i1 %11, label %middle.block978, label %vector.body992, !llvm.loop !23
middle.block978: ; preds = %vector.body992
%cmp.n991 = icmp eq i64 %n.vec983, %3
br i1 %cmp.n991, label %cleanup, label %for.body.preheader1006
for.body.preheader1006: ; preds = %for.body.preheader, %middle.block978
%rr.0787.ph = phi ptr [ %r, %for.body.preheader ], [ %ind.end984, %middle.block978 ]
%aa.0786.ph = phi ptr [ %za, %for.body.preheader ], [ %ind.end986, %middle.block978 ]
%i.0785.ph = phi i32 [ %1, %for.body.preheader ], [ %ind.end989, %middle.block978 ]
%12 = add i32 %i.0785.ph, 1
%xtraiter1045 = and i32 %12, 7
%lcmp.mod1046.not = icmp eq i32 %xtraiter1045, 0
br i1 %lcmp.mod1046.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader1006, %for.body.prol
%rr.0787.prol = phi ptr [ %incdec.ptr7.prol, %for.body.prol ], [ %rr.0787.ph, %for.body.preheader1006 ]
%aa.0786.prol = phi ptr [ %incdec.ptr.prol, %for.body.prol ], [ %aa.0786.ph, %for.body.preheader1006 ]
%i.0785.prol = phi i32 [ %dec.prol, %for.body.prol ], [ %i.0785.ph, %for.body.preheader1006 ]
%prol.iter1047 = phi i32 [ %prol.iter1047.next, %for.body.prol ], [ 0, %for.body.preheader1006 ]
%incdec.ptr.prol = getelementptr inbounds i32, ptr %aa.0786.prol, i64 1
%13 = load i32, ptr %aa.0786.prol, align 4, !tbaa !11
%incdec.ptr7.prol = getelementptr inbounds i32, ptr %rr.0787.prol, i64 1
store i32 %13, ptr %rr.0787.prol, align 4, !tbaa !11
%dec.prol = add nsw i32 %i.0785.prol, -1
%prol.iter1047.next = add i32 %prol.iter1047, 1
%prol.iter1047.cmp.not = icmp eq i32 %prol.iter1047.next, %xtraiter1045
br i1 %prol.iter1047.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !26
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader1006
%rr.0787.unr = phi ptr [ %rr.0787.ph, %for.body.preheader1006 ], [ %incdec.ptr7.prol, %for.body.prol ]
%aa.0786.unr = phi ptr [ %aa.0786.ph, %for.body.preheader1006 ], [ %incdec.ptr.prol, %for.body.prol ]
%i.0785.unr = phi i32 [ %i.0785.ph, %for.body.preheader1006 ], [ %dec.prol, %for.body.prol ]
%14 = icmp ult i32 %i.0785.ph, 7
br i1 %14, label %cleanup, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.body
%rr.0787 = phi ptr [ %incdec.ptr7.7, %for.body ], [ %rr.0787.unr, %for.body.prol.loopexit ]
%aa.0786 = phi ptr [ %incdec.ptr.7, %for.body ], [ %aa.0786.unr, %for.body.prol.loopexit ]
%i.0785 = phi i32 [ %dec.7, %for.body ], [ %i.0785.unr, %for.body.prol.loopexit ]
%incdec.ptr = getelementptr inbounds i32, ptr %aa.0786, i64 1
%15 = load i32, ptr %aa.0786, align 4, !tbaa !11
%incdec.ptr7 = getelementptr inbounds i32, ptr %rr.0787, i64 1
store i32 %15, ptr %rr.0787, align 4, !tbaa !11
%incdec.ptr.1 = getelementptr inbounds i32, ptr %aa.0786, i64 2
%16 = load i32, ptr %incdec.ptr, align 4, !tbaa !11
%incdec.ptr7.1 = getelementptr inbounds i32, ptr %rr.0787, i64 2
store i32 %16, ptr %incdec.ptr7, align 4, !tbaa !11
%incdec.ptr.2 = getelementptr inbounds i32, ptr %aa.0786, i64 3
%17 = load i32, ptr %incdec.ptr.1, align 4, !tbaa !11
%incdec.ptr7.2 = getelementptr inbounds i32, ptr %rr.0787, i64 3
store i32 %17, ptr %incdec.ptr7.1, align 4, !tbaa !11
%incdec.ptr.3 = getelementptr inbounds i32, ptr %aa.0786, i64 4
%18 = load i32, ptr %incdec.ptr.2, align 4, !tbaa !11
%incdec.ptr7.3 = getelementptr inbounds i32, ptr %rr.0787, i64 4
store i32 %18, ptr %incdec.ptr7.2, align 4, !tbaa !11
%incdec.ptr.4 = getelementptr inbounds i32, ptr %aa.0786, i64 5
%19 = load i32, ptr %incdec.ptr.3, align 4, !tbaa !11
%incdec.ptr7.4 = getelementptr inbounds i32, ptr %rr.0787, i64 5
store i32 %19, ptr %incdec.ptr7.3, align 4, !tbaa !11
%incdec.ptr.5 = getelementptr inbounds i32, ptr %aa.0786, i64 6
%20 = load i32, ptr %incdec.ptr.4, align 4, !tbaa !11
%incdec.ptr7.5 = getelementptr inbounds i32, ptr %rr.0787, i64 6
store i32 %20, ptr %incdec.ptr7.4, align 4, !tbaa !11
%incdec.ptr.6 = getelementptr inbounds i32, ptr %aa.0786, i64 7
%21 = load i32, ptr %incdec.ptr.5, align 4, !tbaa !11
%incdec.ptr7.6 = getelementptr inbounds i32, ptr %rr.0787, i64 7
store i32 %21, ptr %incdec.ptr7.5, align 4, !tbaa !11
%incdec.ptr.7 = getelementptr inbounds i32, ptr %aa.0786, i64 8
%22 = load i32, ptr %incdec.ptr.6, align 4, !tbaa !11
%incdec.ptr7.7 = getelementptr inbounds i32, ptr %rr.0787, i64 8
store i32 %22, ptr %incdec.ptr7.6, align 4, !tbaa !11
%dec.7 = add nsw i32 %i.0785, -8
%cmp6.not.7 = icmp eq i32 %i.0785, 7
br i1 %cmp6.not.7, label %cleanup, label %for.body, !llvm.loop !28
if.end8: ; preds = %if.end3
%cmp9 = icmp eq i32 %0, 1
br i1 %cmp9, label %if.then10, label %for.cond40.preheader
for.cond40.preheader: ; preds = %if.end8
%cmp41686 = icmp sgt i32 %1, -1
br i1 %cmp41686, label %for.body43.preheader, label %for.end48
for.body43.preheader: ; preds = %for.cond40.preheader
%23 = add i32 %1, 1
%24 = zext i32 %23 to i64
%min.iters.check = icmp ult i32 %23, 8
%25 = sub i64 ptrtoint (ptr @mpDiv.atmp to i64), %za863
%diff.check = icmp ult i64 %25, 32
%or.cond1001 = or i1 %min.iters.check, %diff.check
br i1 %or.cond1001, label %for.body43.preheader1029, label %vector.ph
vector.ph: ; preds = %for.body43.preheader
%n.vec = and i64 %24, 4294967288
%26 = shl nuw nsw i64 %n.vec, 2
%ind.end = getelementptr i8, ptr %za, i64 %26
%27 = shl nuw nsw i64 %n.vec, 2
%ind.end864 = getelementptr i8, ptr @mpDiv.atmp, i64 %27
%.cast = trunc i64 %n.vec to i32
%ind.end866 = sub i32 %1, %.cast
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%28 = shl i64 %index, 2
%next.gep = getelementptr i8, ptr %za, i64 %28
%29 = shl i64 %index, 2
%next.gep869 = getelementptr i8, ptr @mpDiv.atmp, i64 %29
%wide.load = load <4 x i32>, ptr %next.gep, align 4, !tbaa !11
%30 = getelementptr i32, ptr %next.gep, i64 4
%wide.load871 = load <4 x i32>, ptr %30, align 4, !tbaa !11
store <4 x i32> %wide.load, ptr %next.gep869, align 16, !tbaa !11
%31 = getelementptr i32, ptr %next.gep869, i64 4
store <4 x i32> %wide.load871, ptr %31, align 16, !tbaa !11
%index.next = add nuw i64 %index, 8
%32 = icmp eq i64 %index.next, %n.vec
br i1 %32, label %middle.block, label %vector.body, !llvm.loop !29
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %24
br i1 %cmp.n, label %for.end48.loopexit, label %for.body43.preheader1029
for.body43.preheader1029: ; preds = %for.body43.preheader, %middle.block
%za.addr.0689.ph = phi ptr [ %za, %for.body43.preheader ], [ %ind.end, %middle.block ]
%aa.2688.ph = phi ptr [ @mpDiv.atmp, %for.body43.preheader ], [ %ind.end864, %middle.block ]
%i.2687.ph = phi i32 [ %1, %for.body43.preheader ], [ %ind.end866, %middle.block ]
%33 = add i32 %i.2687.ph, 1
%xtraiter = and i32 %33, 7
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body43.prol.loopexit, label %for.body43.prol
for.body43.prol: ; preds = %for.body43.preheader1029, %for.body43.prol
%za.addr.0689.prol = phi ptr [ %incdec.ptr44.prol, %for.body43.prol ], [ %za.addr.0689.ph, %for.body43.preheader1029 ]
%aa.2688.prol = phi ptr [ %incdec.ptr45.prol, %for.body43.prol ], [ %aa.2688.ph, %for.body43.preheader1029 ]
%i.2687.prol = phi i32 [ %dec47.prol, %for.body43.prol ], [ %i.2687.ph, %for.body43.preheader1029 ]
%prol.iter = phi i32 [ %prol.iter.next, %for.body43.prol ], [ 0, %for.body43.preheader1029 ]
%incdec.ptr44.prol = getelementptr inbounds i32, ptr %za.addr.0689.prol, i64 1
%34 = load i32, ptr %za.addr.0689.prol, align 4, !tbaa !11
%incdec.ptr45.prol = getelementptr inbounds i32, ptr %aa.2688.prol, i64 1
store i32 %34, ptr %aa.2688.prol, align 4, !tbaa !11
%dec47.prol = add nsw i32 %i.2687.prol, -1
%prol.iter.next = add i32 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body43.prol.loopexit, label %for.body43.prol, !llvm.loop !30
for.body43.prol.loopexit: ; preds = %for.body43.prol, %for.body43.preheader1029
%za.addr.0689.unr = phi ptr [ %za.addr.0689.ph, %for.body43.preheader1029 ], [ %incdec.ptr44.prol, %for.body43.prol ]
%aa.2688.unr = phi ptr [ %aa.2688.ph, %for.body43.preheader1029 ], [ %incdec.ptr45.prol, %for.body43.prol ]
%i.2687.unr = phi i32 [ %i.2687.ph, %for.body43.preheader1029 ], [ %dec47.prol, %for.body43.prol ]
%35 = icmp ult i32 %i.2687.ph, 7
br i1 %35, label %for.end48.loopexit, label %for.body43
if.then10: ; preds = %if.end8
store i32 %1, ptr %q, align 4, !tbaa !11
%incdec.ptr11 = getelementptr inbounds i32, ptr %zb, i64 1
%36 = load i32, ptr %za, align 4, !tbaa !11
%idx.ext12 = sext i32 %1 to i64
%cmp15778 = icmp sgt i32 %36, 0
br i1 %cmp15778, label %for.body16.preheader, label %for.end26
for.body16.preheader: ; preds = %if.then10
%add.ptr13 = getelementptr inbounds i32, ptr %q, i64 %idx.ext12
%idx.ext = zext i32 %36 to i64
%add.ptr = getelementptr inbounds i32, ptr %za, i64 %idx.ext
%.pre816 = load i32, ptr %incdec.ptr11, align 4, !tbaa !11
br label %for.body16
for.body16: ; preds = %for.body16.preheader, %for.body16
%37 = phi i32 [ %39, %for.body16 ], [ %.pre816, %for.body16.preheader ]
%ca.0782 = phi i64 [ %rem, %for.body16 ], [ 0, %for.body16.preheader ]
%qq.0781 = phi ptr [ %incdec.ptr21, %for.body16 ], [ %add.ptr13, %for.body16.preheader ]
%aa.1780 = phi ptr [ %incdec.ptr17, %for.body16 ], [ %add.ptr, %for.body16.preheader ]
%i.1779 = phi i32 [ %dec25, %for.body16 ], [ %36, %for.body16.preheader ]
%mul = mul nsw i64 %ca.0782, 1000000000
%incdec.ptr17 = getelementptr inbounds i32, ptr %aa.1780, i64 -1
%38 = load i32, ptr %aa.1780, align 4, !tbaa !11
%conv18 = sext i32 %38 to i64
%add = add nsw i64 %mul, %conv18
%conv19 = sext i32 %37 to i64
%div = sdiv i64 %add, %conv19
%conv20 = trunc i64 %div to i32
%incdec.ptr21 = getelementptr inbounds i32, ptr %qq.0781, i64 -1
store i32 %conv20, ptr %qq.0781, align 4, !tbaa !11
%39 = load i32, ptr %incdec.ptr11, align 4, !tbaa !11
%conv22 = sext i32 %39 to i64
%rem = srem i64 %add, %conv22
%dec25 = add nsw i32 %i.1779, -1
%cmp15 = icmp ugt i32 %i.1779, 1
br i1 %cmp15, label %for.body16, label %for.end26.loopexit, !llvm.loop !31
for.end26.loopexit: ; preds = %for.body16
%conv23 = trunc i64 %rem to i32
%.pre817 = load i32, ptr %q, align 4, !tbaa !11
%.pre818 = sext i32 %.pre817 to i64
br label %for.end26
for.end26: ; preds = %for.end26.loopexit, %if.then10
%idx.ext27.pre-phi = phi i64 [ %.pre818, %for.end26.loopexit ], [ %idx.ext12, %if.then10 ]
%40 = phi i32 [ %.pre817, %for.end26.loopexit ], [ %1, %if.then10 ]
%ca.0.lcssa = phi i32 [ %conv23, %for.end26.loopexit ], [ 0, %if.then10 ]
%add.ptr28 = getelementptr inbounds i32, ptr %q, i64 %idx.ext27.pre-phi
%41 = load i32, ptr %add.ptr28, align 4, !tbaa !11
%cmp29 = icmp eq i32 %41, 0
br i1 %cmp29, label %if.then31, label %if.end33
if.then31: ; preds = %for.end26
%dec32 = add nsw i32 %40, -1
store i32 %dec32, ptr %q, align 4, !tbaa !11
br label %if.end33
if.end33: ; preds = %if.then31, %for.end26
%cmp34 = icmp sgt i32 %ca.0.lcssa, 0
br i1 %cmp34, label %if.then36, label %if.else
if.then36: ; preds = %if.end33
%incdec.ptr37 = getelementptr inbounds i32, ptr %r, i64 1
store i32 1, ptr %r, align 4, !tbaa !11
store i32 %ca.0.lcssa, ptr %incdec.ptr37, align 4, !tbaa !11
br label %cleanup
if.else: ; preds = %if.end33
store i32 0, ptr %r, align 4, !tbaa !11
br label %cleanup
for.body43: ; preds = %for.body43.prol.loopexit, %for.body43
%za.addr.0689 = phi ptr [ %incdec.ptr44.7, %for.body43 ], [ %za.addr.0689.unr, %for.body43.prol.loopexit ]
%aa.2688 = phi ptr [ %incdec.ptr45.7, %for.body43 ], [ %aa.2688.unr, %for.body43.prol.loopexit ]
%i.2687 = phi i32 [ %dec47.7, %for.body43 ], [ %i.2687.unr, %for.body43.prol.loopexit ]
%incdec.ptr44 = getelementptr inbounds i32, ptr %za.addr.0689, i64 1
%42 = load i32, ptr %za.addr.0689, align 4, !tbaa !11
%incdec.ptr45 = getelementptr inbounds i32, ptr %aa.2688, i64 1
store i32 %42, ptr %aa.2688, align 4, !tbaa !11
%incdec.ptr44.1 = getelementptr inbounds i32, ptr %za.addr.0689, i64 2
%43 = load i32, ptr %incdec.ptr44, align 4, !tbaa !11
%incdec.ptr45.1 = getelementptr inbounds i32, ptr %aa.2688, i64 2
store i32 %43, ptr %incdec.ptr45, align 4, !tbaa !11
%incdec.ptr44.2 = getelementptr inbounds i32, ptr %za.addr.0689, i64 3
%44 = load i32, ptr %incdec.ptr44.1, align 4, !tbaa !11
%incdec.ptr45.2 = getelementptr inbounds i32, ptr %aa.2688, i64 3
store i32 %44, ptr %incdec.ptr45.1, align 4, !tbaa !11
%incdec.ptr44.3 = getelementptr inbounds i32, ptr %za.addr.0689, i64 4
%45 = load i32, ptr %incdec.ptr44.2, align 4, !tbaa !11
%incdec.ptr45.3 = getelementptr inbounds i32, ptr %aa.2688, i64 4
store i32 %45, ptr %incdec.ptr45.2, align 4, !tbaa !11
%incdec.ptr44.4 = getelementptr inbounds i32, ptr %za.addr.0689, i64 5
%46 = load i32, ptr %incdec.ptr44.3, align 4, !tbaa !11
%incdec.ptr45.4 = getelementptr inbounds i32, ptr %aa.2688, i64 5
store i32 %46, ptr %incdec.ptr45.3, align 4, !tbaa !11
%incdec.ptr44.5 = getelementptr inbounds i32, ptr %za.addr.0689, i64 6
%47 = load i32, ptr %incdec.ptr44.4, align 4, !tbaa !11
%incdec.ptr45.5 = getelementptr inbounds i32, ptr %aa.2688, i64 6
store i32 %47, ptr %incdec.ptr45.4, align 4, !tbaa !11
%incdec.ptr44.6 = getelementptr inbounds i32, ptr %za.addr.0689, i64 7
%48 = load i32, ptr %incdec.ptr44.5, align 4, !tbaa !11
%incdec.ptr45.6 = getelementptr inbounds i32, ptr %aa.2688, i64 7
store i32 %48, ptr %incdec.ptr45.5, align 4, !tbaa !11
%incdec.ptr44.7 = getelementptr inbounds i32, ptr %za.addr.0689, i64 8
%49 = load i32, ptr %incdec.ptr44.6, align 4, !tbaa !11
%incdec.ptr45.7 = getelementptr inbounds i32, ptr %aa.2688, i64 8
store i32 %49, ptr %incdec.ptr45.6, align 4, !tbaa !11
%dec47.7 = add nsw i32 %i.2687, -8
%cmp41.not.7 = icmp eq i32 %i.2687, 7
br i1 %cmp41.not.7, label %for.end48.loopexit, label %for.body43, !llvm.loop !32
for.end48.loopexit: ; preds = %for.body43.prol.loopexit, %for.body43, %middle.block
%.pre = load i32, ptr %zb, align 4, !tbaa !11
br label %for.end48
for.end48: ; preds = %for.end48.loopexit, %for.cond40.preheader
%50 = phi i32 [ %.pre, %for.end48.loopexit ], [ %0, %for.cond40.preheader ]
%cmp50690 = icmp sgt i32 %50, -1
br i1 %cmp50690, label %for.body52.preheader, label %for.end57
for.body52.preheader: ; preds = %for.end48
%51 = add i32 %50, 1
%52 = zext i32 %51 to i64
%min.iters.check877 = icmp ult i32 %51, 8
%53 = sub i64 ptrtoint (ptr @mpDiv.btmp to i64), %zb873
%diff.check874 = icmp ult i64 %53, 32
%or.cond1002 = or i1 %min.iters.check877, %diff.check874
br i1 %or.cond1002, label %for.body52.preheader1028, label %vector.ph878
vector.ph878: ; preds = %for.body52.preheader
%n.vec880 = and i64 %52, 4294967288
%54 = shl nuw nsw i64 %n.vec880, 2
%ind.end881 = getelementptr i8, ptr @mpDiv.btmp, i64 %54
%55 = shl nuw nsw i64 %n.vec880, 2
%ind.end883 = getelementptr i8, ptr %zb, i64 %55
%.cast885 = trunc i64 %n.vec880 to i32
%ind.end886 = sub i32 %50, %.cast885
br label %vector.body889
vector.body889: ; preds = %vector.body889, %vector.ph878
%index890 = phi i64 [ 0, %vector.ph878 ], [ %index.next897, %vector.body889 ]
%56 = shl i64 %index890, 2
%next.gep891 = getelementptr i8, ptr @mpDiv.btmp, i64 %56
%57 = shl i64 %index890, 2
%next.gep893 = getelementptr i8, ptr %zb, i64 %57
%wide.load895 = load <4 x i32>, ptr %next.gep893, align 4, !tbaa !11
%58 = getelementptr i32, ptr %next.gep893, i64 4
%wide.load896 = load <4 x i32>, ptr %58, align 4, !tbaa !11
store <4 x i32> %wide.load895, ptr %next.gep891, align 16, !tbaa !11
%59 = getelementptr i32, ptr %next.gep891, i64 4
store <4 x i32> %wide.load896, ptr %59, align 16, !tbaa !11
%index.next897 = add nuw i64 %index890, 8
%60 = icmp eq i64 %index.next897, %n.vec880
br i1 %60, label %middle.block875, label %vector.body889, !llvm.loop !33
middle.block875: ; preds = %vector.body889
%cmp.n888 = icmp eq i64 %n.vec880, %52
br i1 %cmp.n888, label %for.end57, label %for.body52.preheader1028
for.body52.preheader1028: ; preds = %for.body52.preheader, %middle.block875
%bb.0693.ph = phi ptr [ @mpDiv.btmp, %for.body52.preheader ], [ %ind.end881, %middle.block875 ]
%zb.addr.0692.ph = phi ptr [ %zb, %for.body52.preheader ], [ %ind.end883, %middle.block875 ]
%i.3691.ph = phi i32 [ %50, %for.body52.preheader ], [ %ind.end886, %middle.block875 ]
%61 = add i32 %i.3691.ph, 1
%xtraiter1030 = and i32 %61, 7
%lcmp.mod1031.not = icmp eq i32 %xtraiter1030, 0
br i1 %lcmp.mod1031.not, label %for.body52.prol.loopexit, label %for.body52.prol
for.body52.prol: ; preds = %for.body52.preheader1028, %for.body52.prol
%bb.0693.prol = phi ptr [ %incdec.ptr54.prol, %for.body52.prol ], [ %bb.0693.ph, %for.body52.preheader1028 ]
%zb.addr.0692.prol = phi ptr [ %incdec.ptr53.prol, %for.body52.prol ], [ %zb.addr.0692.ph, %for.body52.preheader1028 ]
%i.3691.prol = phi i32 [ %dec56.prol, %for.body52.prol ], [ %i.3691.ph, %for.body52.preheader1028 ]
%prol.iter1032 = phi i32 [ %prol.iter1032.next, %for.body52.prol ], [ 0, %for.body52.preheader1028 ]
%incdec.ptr53.prol = getelementptr inbounds i32, ptr %zb.addr.0692.prol, i64 1
%62 = load i32, ptr %zb.addr.0692.prol, align 4, !tbaa !11
%incdec.ptr54.prol = getelementptr inbounds i32, ptr %bb.0693.prol, i64 1
store i32 %62, ptr %bb.0693.prol, align 4, !tbaa !11
%dec56.prol = add nsw i32 %i.3691.prol, -1
%prol.iter1032.next = add i32 %prol.iter1032, 1
%prol.iter1032.cmp.not = icmp eq i32 %prol.iter1032.next, %xtraiter1030
br i1 %prol.iter1032.cmp.not, label %for.body52.prol.loopexit, label %for.body52.prol, !llvm.loop !34
for.body52.prol.loopexit: ; preds = %for.body52.prol, %for.body52.preheader1028
%bb.0693.unr = phi ptr [ %bb.0693.ph, %for.body52.preheader1028 ], [ %incdec.ptr54.prol, %for.body52.prol ]
%zb.addr.0692.unr = phi ptr [ %zb.addr.0692.ph, %for.body52.preheader1028 ], [ %incdec.ptr53.prol, %for.body52.prol ]
%i.3691.unr = phi i32 [ %i.3691.ph, %for.body52.preheader1028 ], [ %dec56.prol, %for.body52.prol ]
%63 = icmp ult i32 %i.3691.ph, 7
br i1 %63, label %for.end57, label %for.body52
for.body52: ; preds = %for.body52.prol.loopexit, %for.body52
%bb.0693 = phi ptr [ %incdec.ptr54.7, %for.body52 ], [ %bb.0693.unr, %for.body52.prol.loopexit ]
%zb.addr.0692 = phi ptr [ %incdec.ptr53.7, %for.body52 ], [ %zb.addr.0692.unr, %for.body52.prol.loopexit ]
%i.3691 = phi i32 [ %dec56.7, %for.body52 ], [ %i.3691.unr, %for.body52.prol.loopexit ]
%incdec.ptr53 = getelementptr inbounds i32, ptr %zb.addr.0692, i64 1
%64 = load i32, ptr %zb.addr.0692, align 4, !tbaa !11
%incdec.ptr54 = getelementptr inbounds i32, ptr %bb.0693, i64 1
store i32 %64, ptr %bb.0693, align 4, !tbaa !11
%incdec.ptr53.1 = getelementptr inbounds i32, ptr %zb.addr.0692, i64 2
%65 = load i32, ptr %incdec.ptr53, align 4, !tbaa !11
%incdec.ptr54.1 = getelementptr inbounds i32, ptr %bb.0693, i64 2
store i32 %65, ptr %incdec.ptr54, align 4, !tbaa !11
%incdec.ptr53.2 = getelementptr inbounds i32, ptr %zb.addr.0692, i64 3
%66 = load i32, ptr %incdec.ptr53.1, align 4, !tbaa !11
%incdec.ptr54.2 = getelementptr inbounds i32, ptr %bb.0693, i64 3
store i32 %66, ptr %incdec.ptr54.1, align 4, !tbaa !11
%incdec.ptr53.3 = getelementptr inbounds i32, ptr %zb.addr.0692, i64 4
%67 = load i32, ptr %incdec.ptr53.2, align 4, !tbaa !11
%incdec.ptr54.3 = getelementptr inbounds i32, ptr %bb.0693, i64 4
store i32 %67, ptr %incdec.ptr54.2, align 4, !tbaa !11
%incdec.ptr53.4 = getelementptr inbounds i32, ptr %zb.addr.0692, i64 5
%68 = load i32, ptr %incdec.ptr53.3, align 4, !tbaa !11
%incdec.ptr54.4 = getelementptr inbounds i32, ptr %bb.0693, i64 5
store i32 %68, ptr %incdec.ptr54.3, align 4, !tbaa !11
%incdec.ptr53.5 = getelementptr inbounds i32, ptr %zb.addr.0692, i64 6
%69 = load i32, ptr %incdec.ptr53.4, align 4, !tbaa !11
%incdec.ptr54.5 = getelementptr inbounds i32, ptr %bb.0693, i64 6
store i32 %69, ptr %incdec.ptr54.4, align 4, !tbaa !11
%incdec.ptr53.6 = getelementptr inbounds i32, ptr %zb.addr.0692, i64 7
%70 = load i32, ptr %incdec.ptr53.5, align 4, !tbaa !11
%incdec.ptr54.6 = getelementptr inbounds i32, ptr %bb.0693, i64 7
store i32 %70, ptr %incdec.ptr54.5, align 4, !tbaa !11
%incdec.ptr53.7 = getelementptr inbounds i32, ptr %zb.addr.0692, i64 8
%71 = load i32, ptr %incdec.ptr53.6, align 4, !tbaa !11
%incdec.ptr54.7 = getelementptr inbounds i32, ptr %bb.0693, i64 8
store i32 %71, ptr %incdec.ptr54.6, align 4, !tbaa !11
%dec56.7 = add nsw i32 %i.3691, -8
%cmp50.not.7 = icmp eq i32 %i.3691, 7
br i1 %cmp50.not.7, label %for.end57, label %for.body52, !llvm.loop !35
for.end57: ; preds = %for.body52.prol.loopexit, %for.body52, %middle.block875, %for.end48
%72 = load i32, ptr @mpDiv.btmp, align 16, !tbaa !11
%idx.ext58 = sext i32 %72 to i64
%add.ptr59 = getelementptr inbounds i32, ptr @mpDiv.btmp, i64 %idx.ext58
%73 = load i32, ptr %add.ptr59, align 4, !tbaa !11
%div60 = sdiv i32 499999999, %73
%add61 = add nsw i32 %div60, 1
%cmp62 = icmp sgt i32 %div60, 0
br i1 %cmp62, label %for.cond65.preheader, label %if.end126
for.cond65.preheader: ; preds = %for.end57
%74 = load i32, ptr @mpDiv.atmp, align 16, !tbaa !11
%cmp66694 = icmp sgt i32 %74, 0
br i1 %cmp66694, label %for.body68.lr.ph, label %for.end81
for.body68.lr.ph: ; preds = %for.cond65.preheader
%conv69 = zext i32 %add61 to i64
br label %for.body68
for.body68: ; preds = %for.body68.lr.ph, %for.body68
%ca.1698 = phi i64 [ 0, %for.body68.lr.ph ], [ %div78, %for.body68 ]
%qq.1697 = phi ptr [ %q, %for.body68.lr.ph ], [ %incdec.ptr77, %for.body68 ]
%aa.3696 = phi ptr [ @mpDiv.atmp, %for.body68.lr.ph ], [ %incdec.ptr70, %for.body68 ]
%i.4695 = phi i32 [ 0, %for.body68.lr.ph ], [ %inc, %for.body68 ]
%incdec.ptr70 = getelementptr inbounds i32, ptr %aa.3696, i64 1
%75 = load i32, ptr %incdec.ptr70, align 4, !tbaa !11
%conv71 = sext i32 %75 to i64
%mul72 = mul nsw i64 %conv71, %conv69
%sext788 = shl i64 %ca.1698, 32
%conv73 = ashr exact i64 %sext788, 32
%add74 = add nsw i64 %mul72, %conv73
%rem75 = srem i64 %add74, 1000000000
%conv76 = trunc i64 %rem75 to i32
%incdec.ptr77 = getelementptr inbounds i32, ptr %qq.1697, i64 1
store i32 %conv76, ptr %incdec.ptr77, align 4, !tbaa !11
%div78 = sdiv i64 %add74, 1000000000
%inc = add nuw nsw i32 %i.4695, 1
%exitcond.not = icmp eq i32 %inc, %74
br i1 %exitcond.not, label %for.end81.loopexit, label %for.body68, !llvm.loop !36
for.end81.loopexit: ; preds = %for.body68
%conv79 = trunc i64 %div78 to i32
br label %for.end81
for.end81: ; preds = %for.end81.loopexit, %for.cond65.preheader
%i.4.lcssa = phi i32 [ 0, %for.cond65.preheader ], [ %74, %for.end81.loopexit ]
%qq.1.lcssa = phi ptr [ %q, %for.cond65.preheader ], [ %incdec.ptr77, %for.end81.loopexit ]
%ca.1.lcssa = phi i32 [ 0, %for.cond65.preheader ], [ %conv79, %for.end81.loopexit ]
%incdec.ptr82 = getelementptr inbounds i32, ptr %qq.1.lcssa, i64 1
store i32 %ca.1.lcssa, ptr %incdec.ptr82, align 4, !tbaa !11
%cmp83 = icmp sgt i32 %ca.1.lcssa, 0
%conv84 = zext i1 %cmp83 to i32
%add85 = add nuw nsw i32 %i.4.lcssa, %conv84
store i32 %add85, ptr %q, align 4, !tbaa !11
%cmp87701 = icmp sgt i32 %add85, -1
br i1 %cmp87701, label %for.body89.preheader, label %for.cond95.preheader
for.body89.preheader: ; preds = %for.end81
%76 = add i32 %i.4.lcssa, %conv84
%77 = add i32 %76, 1
%78 = zext i32 %77 to i64
%min.iters.check903 = icmp ult i32 %77, 8
%79 = sub i64 ptrtoint (ptr @mpDiv.atmp to i64), %q899
%diff.check900 = icmp ult i64 %79, 32
%or.cond1003 = or i1 %min.iters.check903, %diff.check900
br i1 %or.cond1003, label %for.body89.preheader1027, label %vector.ph904
vector.ph904: ; preds = %for.body89.preheader
%n.vec906 = and i64 %78, 4294967288
%80 = shl nuw nsw i64 %n.vec906, 2
%ind.end907 = getelementptr i8, ptr %q, i64 %80
%81 = shl nuw nsw i64 %n.vec906, 2
%ind.end909 = getelementptr i8, ptr @mpDiv.atmp, i64 %81
%.cast911 = trunc i64 %n.vec906 to i32
%ind.end912 = sub i32 %add85, %.cast911
br label %vector.body915
vector.body915: ; preds = %vector.body915, %vector.ph904
%index916 = phi i64 [ 0, %vector.ph904 ], [ %index.next923, %vector.body915 ]
%82 = shl i64 %index916, 2
%next.gep917 = getelementptr i8, ptr %q, i64 %82
%83 = shl i64 %index916, 2
%next.gep919 = getelementptr i8, ptr @mpDiv.atmp, i64 %83
%wide.load921 = load <4 x i32>, ptr %next.gep917, align 4, !tbaa !11
%84 = getelementptr i32, ptr %next.gep917, i64 4
%wide.load922 = load <4 x i32>, ptr %84, align 4, !tbaa !11
store <4 x i32> %wide.load921, ptr %next.gep919, align 16, !tbaa !11
%85 = getelementptr i32, ptr %next.gep919, i64 4
store <4 x i32> %wide.load922, ptr %85, align 16, !tbaa !11
%index.next923 = add nuw i64 %index916, 8
%86 = icmp eq i64 %index.next923, %n.vec906
br i1 %86, label %middle.block901, label %vector.body915, !llvm.loop !37
middle.block901: ; preds = %vector.body915
%cmp.n914 = icmp eq i64 %n.vec906, %78
br i1 %cmp.n914, label %for.cond95.preheader, label %for.body89.preheader1027
for.body89.preheader1027: ; preds = %for.body89.preheader, %middle.block901
%qq.2704.ph = phi ptr [ %q, %for.body89.preheader ], [ %ind.end907, %middle.block901 ]
%aa.4703.ph = phi ptr [ @mpDiv.atmp, %for.body89.preheader ], [ %ind.end909, %middle.block901 ]
%i.5702.ph = phi i32 [ %add85, %for.body89.preheader ], [ %ind.end912, %middle.block901 ]
%87 = add i32 %i.5702.ph, 1
%xtraiter1033 = and i32 %87, 7
%lcmp.mod1034.not = icmp eq i32 %xtraiter1033, 0
br i1 %lcmp.mod1034.not, label %for.body89.prol.loopexit, label %for.body89.prol
for.body89.prol: ; preds = %for.body89.preheader1027, %for.body89.prol
%qq.2704.prol = phi ptr [ %incdec.ptr90.prol, %for.body89.prol ], [ %qq.2704.ph, %for.body89.preheader1027 ]
%aa.4703.prol = phi ptr [ %incdec.ptr91.prol, %for.body89.prol ], [ %aa.4703.ph, %for.body89.preheader1027 ]
%i.5702.prol = phi i32 [ %dec93.prol, %for.body89.prol ], [ %i.5702.ph, %for.body89.preheader1027 ]
%prol.iter1035 = phi i32 [ %prol.iter1035.next, %for.body89.prol ], [ 0, %for.body89.preheader1027 ]
%incdec.ptr90.prol = getelementptr inbounds i32, ptr %qq.2704.prol, i64 1
%88 = load i32, ptr %qq.2704.prol, align 4, !tbaa !11
%incdec.ptr91.prol = getelementptr inbounds i32, ptr %aa.4703.prol, i64 1
store i32 %88, ptr %aa.4703.prol, align 4, !tbaa !11
%dec93.prol = add nsw i32 %i.5702.prol, -1
%prol.iter1035.next = add i32 %prol.iter1035, 1
%prol.iter1035.cmp.not = icmp eq i32 %prol.iter1035.next, %xtraiter1033
br i1 %prol.iter1035.cmp.not, label %for.body89.prol.loopexit, label %for.body89.prol, !llvm.loop !38
for.body89.prol.loopexit: ; preds = %for.body89.prol, %for.body89.preheader1027
%qq.2704.unr = phi ptr [ %qq.2704.ph, %for.body89.preheader1027 ], [ %incdec.ptr90.prol, %for.body89.prol ]
%aa.4703.unr = phi ptr [ %aa.4703.ph, %for.body89.preheader1027 ], [ %incdec.ptr91.prol, %for.body89.prol ]
%i.5702.unr = phi i32 [ %i.5702.ph, %for.body89.preheader1027 ], [ %dec93.prol, %for.body89.prol ]
%89 = icmp ult i32 %i.5702.ph, 7
br i1 %89, label %for.cond95.preheader, label %for.body89
for.cond95.preheader: ; preds = %for.body89.prol.loopexit, %for.body89, %middle.block901, %for.end81
%90 = load i32, ptr @mpDiv.btmp, align 16, !tbaa !11
%cmp96705 = icmp sgt i32 %90, 0
br i1 %cmp96705, label %for.body98.lr.ph, label %for.end112
for.body98.lr.ph: ; preds = %for.cond95.preheader
%conv99 = zext i32 %add61 to i64
br label %for.body98
for.body89: ; preds = %for.body89.prol.loopexit, %for.body89
%qq.2704 = phi ptr [ %incdec.ptr90.7, %for.body89 ], [ %qq.2704.unr, %for.body89.prol.loopexit ]
%aa.4703 = phi ptr [ %incdec.ptr91.7, %for.body89 ], [ %aa.4703.unr, %for.body89.prol.loopexit ]
%i.5702 = phi i32 [ %dec93.7, %for.body89 ], [ %i.5702.unr, %for.body89.prol.loopexit ]
%incdec.ptr90 = getelementptr inbounds i32, ptr %qq.2704, i64 1
%91 = load i32, ptr %qq.2704, align 4, !tbaa !11
%incdec.ptr91 = getelementptr inbounds i32, ptr %aa.4703, i64 1
store i32 %91, ptr %aa.4703, align 4, !tbaa !11
%incdec.ptr90.1 = getelementptr inbounds i32, ptr %qq.2704, i64 2
%92 = load i32, ptr %incdec.ptr90, align 4, !tbaa !11
%incdec.ptr91.1 = getelementptr inbounds i32, ptr %aa.4703, i64 2
store i32 %92, ptr %incdec.ptr91, align 4, !tbaa !11
%incdec.ptr90.2 = getelementptr inbounds i32, ptr %qq.2704, i64 3
%93 = load i32, ptr %incdec.ptr90.1, align 4, !tbaa !11
%incdec.ptr91.2 = getelementptr inbounds i32, ptr %aa.4703, i64 3
store i32 %93, ptr %incdec.ptr91.1, align 4, !tbaa !11
%incdec.ptr90.3 = getelementptr inbounds i32, ptr %qq.2704, i64 4
%94 = load i32, ptr %incdec.ptr90.2, align 4, !tbaa !11
%incdec.ptr91.3 = getelementptr inbounds i32, ptr %aa.4703, i64 4
store i32 %94, ptr %incdec.ptr91.2, align 4, !tbaa !11
%incdec.ptr90.4 = getelementptr inbounds i32, ptr %qq.2704, i64 5
%95 = load i32, ptr %incdec.ptr90.3, align 4, !tbaa !11
%incdec.ptr91.4 = getelementptr inbounds i32, ptr %aa.4703, i64 5
store i32 %95, ptr %incdec.ptr91.3, align 4, !tbaa !11
%incdec.ptr90.5 = getelementptr inbounds i32, ptr %qq.2704, i64 6
%96 = load i32, ptr %incdec.ptr90.4, align 4, !tbaa !11
%incdec.ptr91.5 = getelementptr inbounds i32, ptr %aa.4703, i64 6
store i32 %96, ptr %incdec.ptr91.4, align 4, !tbaa !11
%incdec.ptr90.6 = getelementptr inbounds i32, ptr %qq.2704, i64 7
%97 = load i32, ptr %incdec.ptr90.5, align 4, !tbaa !11
%incdec.ptr91.6 = getelementptr inbounds i32, ptr %aa.4703, i64 7
store i32 %97, ptr %incdec.ptr91.5, align 4, !tbaa !11
%incdec.ptr90.7 = getelementptr inbounds i32, ptr %qq.2704, i64 8
%98 = load i32, ptr %incdec.ptr90.6, align 4, !tbaa !11
%incdec.ptr91.7 = getelementptr inbounds i32, ptr %aa.4703, i64 8
store i32 %98, ptr %incdec.ptr91.6, align 4, !tbaa !11
%dec93.7 = add nsw i32 %i.5702, -8
%cmp87.not.7 = icmp eq i32 %i.5702, 7
br i1 %cmp87.not.7, label %for.cond95.preheader, label %for.body89, !llvm.loop !39
for.body98: ; preds = %for.body98.lr.ph, %for.body98
%ca.2709 = phi i64 [ 0, %for.body98.lr.ph ], [ %div108, %for.body98 ]
%qq.3708 = phi ptr [ %q, %for.body98.lr.ph ], [ %incdec.ptr107, %for.body98 ]
%bb.1707 = phi ptr [ @mpDiv.btmp, %for.body98.lr.ph ], [ %incdec.ptr100, %for.body98 ]
%i.6706 = phi i32 [ 0, %for.body98.lr.ph ], [ %inc111, %for.body98 ]
%incdec.ptr100 = getelementptr inbounds i32, ptr %bb.1707, i64 1
%99 = load i32, ptr %incdec.ptr100, align 4, !tbaa !11
%conv101 = sext i32 %99 to i64
%mul102 = mul nsw i64 %conv101, %conv99
%sext789 = shl i64 %ca.2709, 32
%conv103 = ashr exact i64 %sext789, 32
%add104 = add nsw i64 %mul102, %conv103
%rem105 = srem i64 %add104, 1000000000
%conv106 = trunc i64 %rem105 to i32
%incdec.ptr107 = getelementptr inbounds i32, ptr %qq.3708, i64 1
store i32 %conv106, ptr %incdec.ptr107, align 4, !tbaa !11
%div108 = sdiv i64 %add104, 1000000000
%inc111 = add nuw nsw i32 %i.6706, 1
%exitcond810.not = icmp eq i32 %inc111, %90
br i1 %exitcond810.not, label %for.end112.loopexit, label %for.body98, !llvm.loop !40
for.end112.loopexit: ; preds = %for.body98
%conv109 = trunc i64 %div108 to i32
br label %for.end112
for.end112: ; preds = %for.end112.loopexit, %for.cond95.preheader
%i.6.lcssa = phi i32 [ 0, %for.cond95.preheader ], [ %90, %for.end112.loopexit ]
%qq.3.lcssa = phi ptr [ %q, %for.cond95.preheader ], [ %incdec.ptr107, %for.end112.loopexit ]
%ca.2.lcssa = phi i32 [ 0, %for.cond95.preheader ], [ %conv109, %for.end112.loopexit ]
%incdec.ptr113 = getelementptr inbounds i32, ptr %qq.3.lcssa, i64 1
store i32 %ca.2.lcssa, ptr %incdec.ptr113, align 4, !tbaa !11
%cmp114 = icmp sgt i32 %ca.2.lcssa, 0
%conv115 = zext i1 %cmp114 to i32
%add116 = add nuw nsw i32 %i.6.lcssa, %conv115
store i32 %add116, ptr %q, align 4, !tbaa !11
%cmp118713 = icmp sgt i32 %add116, -1
br i1 %cmp118713, label %for.body120.preheader, label %if.end126
for.body120.preheader: ; preds = %for.end112
%100 = add i32 %i.6.lcssa, %conv115
%101 = add i32 %100, 1
%102 = zext i32 %101 to i64
%min.iters.check928 = icmp ult i32 %101, 8
%103 = sub i64 ptrtoint (ptr @mpDiv.btmp to i64), %q899
%diff.check925 = icmp ult i64 %103, 32
%or.cond1004 = or i1 %min.iters.check928, %diff.check925
br i1 %or.cond1004, label %for.body120.preheader1026, label %vector.ph929
vector.ph929: ; preds = %for.body120.preheader
%n.vec931 = and i64 %102, 4294967288
%104 = shl nuw nsw i64 %n.vec931, 2
%ind.end932 = getelementptr i8, ptr %q, i64 %104
%105 = shl nuw nsw i64 %n.vec931, 2
%ind.end934 = getelementptr i8, ptr @mpDiv.btmp, i64 %105
%.cast936 = trunc i64 %n.vec931 to i32
%ind.end937 = sub i32 %add116, %.cast936
br label %vector.body940
vector.body940: ; preds = %vector.body940, %vector.ph929
%index941 = phi i64 [ 0, %vector.ph929 ], [ %index.next948, %vector.body940 ]
%106 = shl i64 %index941, 2
%next.gep942 = getelementptr i8, ptr %q, i64 %106
%107 = shl i64 %index941, 2
%next.gep944 = getelementptr i8, ptr @mpDiv.btmp, i64 %107
%wide.load946 = load <4 x i32>, ptr %next.gep942, align 4, !tbaa !11
%108 = getelementptr i32, ptr %next.gep942, i64 4
%wide.load947 = load <4 x i32>, ptr %108, align 4, !tbaa !11
store <4 x i32> %wide.load946, ptr %next.gep944, align 16, !tbaa !11
%109 = getelementptr i32, ptr %next.gep944, i64 4
store <4 x i32> %wide.load947, ptr %109, align 16, !tbaa !11
%index.next948 = add nuw i64 %index941, 8
%110 = icmp eq i64 %index.next948, %n.vec931
br i1 %110, label %middle.block926, label %vector.body940, !llvm.loop !41
middle.block926: ; preds = %vector.body940
%cmp.n939 = icmp eq i64 %n.vec931, %102
br i1 %cmp.n939, label %if.end126, label %for.body120.preheader1026
for.body120.preheader1026: ; preds = %for.body120.preheader, %middle.block926
%qq.4716.ph = phi ptr [ %q, %for.body120.preheader ], [ %ind.end932, %middle.block926 ]
%bb.2715.ph = phi ptr [ @mpDiv.btmp, %for.body120.preheader ], [ %ind.end934, %middle.block926 ]
%i.7714.ph = phi i32 [ %add116, %for.body120.preheader ], [ %ind.end937, %middle.block926 ]
%111 = add i32 %i.7714.ph, 1
%xtraiter1036 = and i32 %111, 7
%lcmp.mod1037.not = icmp eq i32 %xtraiter1036, 0
br i1 %lcmp.mod1037.not, label %for.body120.prol.loopexit, label %for.body120.prol
for.body120.prol: ; preds = %for.body120.preheader1026, %for.body120.prol
%qq.4716.prol = phi ptr [ %incdec.ptr121.prol, %for.body120.prol ], [ %qq.4716.ph, %for.body120.preheader1026 ]
%bb.2715.prol = phi ptr [ %incdec.ptr122.prol, %for.body120.prol ], [ %bb.2715.ph, %for.body120.preheader1026 ]
%i.7714.prol = phi i32 [ %dec124.prol, %for.body120.prol ], [ %i.7714.ph, %for.body120.preheader1026 ]
%prol.iter1038 = phi i32 [ %prol.iter1038.next, %for.body120.prol ], [ 0, %for.body120.preheader1026 ]
%incdec.ptr121.prol = getelementptr inbounds i32, ptr %qq.4716.prol, i64 1
%112 = load i32, ptr %qq.4716.prol, align 4, !tbaa !11
%incdec.ptr122.prol = getelementptr inbounds i32, ptr %bb.2715.prol, i64 1
store i32 %112, ptr %bb.2715.prol, align 4, !tbaa !11
%dec124.prol = add nsw i32 %i.7714.prol, -1
%prol.iter1038.next = add i32 %prol.iter1038, 1
%prol.iter1038.cmp.not = icmp eq i32 %prol.iter1038.next, %xtraiter1036
br i1 %prol.iter1038.cmp.not, label %for.body120.prol.loopexit, label %for.body120.prol, !llvm.loop !42
for.body120.prol.loopexit: ; preds = %for.body120.prol, %for.body120.preheader1026
%qq.4716.unr = phi ptr [ %qq.4716.ph, %for.body120.preheader1026 ], [ %incdec.ptr121.prol, %for.body120.prol ]
%bb.2715.unr = phi ptr [ %bb.2715.ph, %for.body120.preheader1026 ], [ %incdec.ptr122.prol, %for.body120.prol ]
%i.7714.unr = phi i32 [ %i.7714.ph, %for.body120.preheader1026 ], [ %dec124.prol, %for.body120.prol ]
%113 = icmp ult i32 %i.7714.ph, 7
br i1 %113, label %if.end126, label %for.body120
for.body120: ; preds = %for.body120.prol.loopexit, %for.body120
%qq.4716 = phi ptr [ %incdec.ptr121.7, %for.body120 ], [ %qq.4716.unr, %for.body120.prol.loopexit ]
%bb.2715 = phi ptr [ %incdec.ptr122.7, %for.body120 ], [ %bb.2715.unr, %for.body120.prol.loopexit ]
%i.7714 = phi i32 [ %dec124.7, %for.body120 ], [ %i.7714.unr, %for.body120.prol.loopexit ]
%incdec.ptr121 = getelementptr inbounds i32, ptr %qq.4716, i64 1
%114 = load i32, ptr %qq.4716, align 4, !tbaa !11
%incdec.ptr122 = getelementptr inbounds i32, ptr %bb.2715, i64 1
store i32 %114, ptr %bb.2715, align 4, !tbaa !11
%incdec.ptr121.1 = getelementptr inbounds i32, ptr %qq.4716, i64 2
%115 = load i32, ptr %incdec.ptr121, align 4, !tbaa !11
%incdec.ptr122.1 = getelementptr inbounds i32, ptr %bb.2715, i64 2
store i32 %115, ptr %incdec.ptr122, align 4, !tbaa !11
%incdec.ptr121.2 = getelementptr inbounds i32, ptr %qq.4716, i64 3
%116 = load i32, ptr %incdec.ptr121.1, align 4, !tbaa !11
%incdec.ptr122.2 = getelementptr inbounds i32, ptr %bb.2715, i64 3
store i32 %116, ptr %incdec.ptr122.1, align 4, !tbaa !11
%incdec.ptr121.3 = getelementptr inbounds i32, ptr %qq.4716, i64 4
%117 = load i32, ptr %incdec.ptr121.2, align 4, !tbaa !11
%incdec.ptr122.3 = getelementptr inbounds i32, ptr %bb.2715, i64 4
store i32 %117, ptr %incdec.ptr122.2, align 4, !tbaa !11
%incdec.ptr121.4 = getelementptr inbounds i32, ptr %qq.4716, i64 5
%118 = load i32, ptr %incdec.ptr121.3, align 4, !tbaa !11
%incdec.ptr122.4 = getelementptr inbounds i32, ptr %bb.2715, i64 5
store i32 %118, ptr %incdec.ptr122.3, align 4, !tbaa !11
%incdec.ptr121.5 = getelementptr inbounds i32, ptr %qq.4716, i64 6
%119 = load i32, ptr %incdec.ptr121.4, align 4, !tbaa !11
%incdec.ptr122.5 = getelementptr inbounds i32, ptr %bb.2715, i64 6
store i32 %119, ptr %incdec.ptr122.4, align 4, !tbaa !11
%incdec.ptr121.6 = getelementptr inbounds i32, ptr %qq.4716, i64 7
%120 = load i32, ptr %incdec.ptr121.5, align 4, !tbaa !11
%incdec.ptr122.6 = getelementptr inbounds i32, ptr %bb.2715, i64 7
store i32 %120, ptr %incdec.ptr122.5, align 4, !tbaa !11
%incdec.ptr121.7 = getelementptr inbounds i32, ptr %qq.4716, i64 8
%121 = load i32, ptr %incdec.ptr121.6, align 4, !tbaa !11
%incdec.ptr122.7 = getelementptr inbounds i32, ptr %bb.2715, i64 8
store i32 %121, ptr %incdec.ptr122.6, align 4, !tbaa !11
%dec124.7 = add nsw i32 %i.7714, -8
%cmp118.not.7 = icmp eq i32 %i.7714, 7
br i1 %cmp118.not.7, label %if.end126, label %for.body120, !llvm.loop !43
if.end126: ; preds = %for.body120.prol.loopexit, %for.body120, %middle.block926, %for.end112, %for.end57
%122 = load i32, ptr @mpDiv.atmp, align 16, !tbaa !11
%123 = load i32, ptr @mpDiv.btmp, align 16, !tbaa !11
%sub = sub nsw i32 %122, %123
%add127 = add i32 %sub, 1
store i32 %add127, ptr %q, align 4, !tbaa !11
%cmp129717 = icmp sgt i32 %sub, -1
br i1 %cmp129717, label %for.body131.preheader, label %for.end135
for.body131.preheader: ; preds = %if.end126
%scevgep = getelementptr i8, ptr %q, i64 4
%124 = add i32 %122, 1
%smin = tail call i32 @llvm.smin.i32(i32 %add127, i32 1)
%125 = add i32 %123, %smin
%126 = sub i32 %124, %125
%127 = zext i32 %126 to i64
%128 = shl nuw nsw i64 %127, 2
%129 = add nuw nsw i64 %128, 4
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i8 0, i64 %129, i1 false), !tbaa !11
br label %for.end135
for.end135: ; preds = %for.body131.preheader, %if.end126
%130 = load i32, ptr @mpDiv.btmp, align 16, !tbaa !11
%131 = load i32, ptr @mpDiv.atmp, align 16, !tbaa !11
%cmp136.not759 = icmp slt i32 %131, %130
br i1 %cmp136.not759, label %while.end348, label %while.body.lr.ph
while.body.lr.ph: ; preds = %for.end135
%idx.ext176 = sext i32 %130 to i64
%idx.neg177 = sub nsw i64 0, %idx.ext176
%invariant.gep = getelementptr i32, ptr %q, i64 %idx.neg177
%invariant.gep761 = getelementptr i32, ptr %invariant.gep, i64 1
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.cond.backedge
%132 = phi i32 [ %131, %while.body.lr.ph ], [ %138, %while.cond.backedge ]
%idx.ext138 = sext i32 %132 to i64
%add.ptr139 = getelementptr inbounds i32, ptr @mpDiv.atmp, i64 %idx.ext138
%133 = load i32, ptr %add.ptr139, align 4, !tbaa !11
%134 = load i32, ptr @mpDiv.btmp, align 16, !tbaa !11
%idx.ext140 = sext i32 %134 to i64
%add.ptr141 = getelementptr inbounds i32, ptr @mpDiv.btmp, i64 %idx.ext140
%135 = load i32, ptr %add.ptr141, align 4, !tbaa !11
%cmp142.not = icmp slt i32 %133, %135
br i1 %cmp142.not, label %if.end222, label %for.cond149.preheader
for.cond149.preheader: ; preds = %while.body
%cmp150.not720 = icmp eq i32 %134, 0
br i1 %cmp150.not720, label %if.then163, label %for.body152
for.body152: ; preds = %for.cond149.preheader, %for.inc157
%bb.3722 = phi ptr [ %incdec.ptr159, %for.inc157 ], [ %add.ptr141, %for.cond149.preheader ]
%aa.5721 = phi ptr [ %incdec.ptr158, %for.inc157 ], [ %add.ptr139, %for.cond149.preheader ]
%136 = load i32, ptr %aa.5721, align 4, !tbaa !11
%137 = load i32, ptr %bb.3722, align 4, !tbaa !11
%cmp153.not = icmp eq i32 %136, %137
br i1 %cmp153.not, label %for.inc157, label %if.else170
for.inc157: ; preds = %for.body152
%incdec.ptr158 = getelementptr inbounds i32, ptr %aa.5721, i64 -1
%incdec.ptr159 = getelementptr inbounds i32, ptr %bb.3722, i64 -1
%cmp150.not = icmp eq ptr %incdec.ptr159, @mpDiv.btmp
br i1 %cmp150.not, label %if.then163, label %for.body152, !llvm.loop !44
if.then163: ; preds = %for.inc157, %for.cond149.preheader
%sub164 = sub nsw i32 %132, %134
br label %while.cond.backedge
while.cond.backedge: ; preds = %while.end259, %if.then304, %while.end332, %if.then163, %while.end
%sub164.sink = phi i32 [ %sub164, %if.then163 ], [ %conv198, %while.end ], [ %conv337, %while.end332 ], [ %sub305, %if.then304 ], [ %conv264, %while.end259 ]
%invariant.gep761.sink = phi ptr [ %invariant.gep761, %if.then163 ], [ %invariant.gep761, %while.end ], [ %invariant.gep, %while.end332 ], [ %invariant.gep, %if.then304 ], [ %invariant.gep, %while.end259 ]
%.sink = phi i32 [ 1, %if.then163 ], [ 1, %while.end ], [ %163, %while.end332 ], [ %162, %if.then304 ], [ 1, %while.end259 ]
store i32 %sub164.sink, ptr @mpDiv.atmp, align 16, !tbaa !11
%gep766 = getelementptr i32, ptr %invariant.gep761.sink, i64 %idx.ext138
store i32 %.sink, ptr %gep766, align 4, !tbaa !11
%138 = load i32, ptr @mpDiv.atmp, align 16, !tbaa !11
%cmp136.not = icmp slt i32 %138, %130
br i1 %cmp136.not, label %while.end348.loopexit, label %while.body, !llvm.loop !45
if.else170: ; preds = %for.body152
%cmp171 = icmp sgt i32 %136, %137
br i1 %cmp171, label %if.then173, label %if.end222.thread
if.then173: ; preds = %if.else170
%add.ptr178 = getelementptr inbounds i32, ptr %add.ptr139, i64 %idx.neg177
%cmp180723 = icmp ugt ptr %bb.3722, @mpDiv.btmp
br i1 %cmp180723, label %for.body182, label %while.cond193.preheader
for.body182: ; preds = %if.then173, %for.body182
%ca.3726.neg = phi i32 [ %sub186.lobit.neg, %for.body182 ], [ 0, %if.then173 ]
%bb.4725 = phi ptr [ %incdec.ptr183, %for.body182 ], [ @mpDiv.btmp, %if.then173 ]
%aa.6724 = phi ptr [ %incdec.ptr185, %for.body182 ], [ %add.ptr178, %if.then173 ]
%incdec.ptr183 = getelementptr inbounds i32, ptr %bb.4725, i64 1
%139 = load i32, ptr %incdec.ptr183, align 4, !tbaa !11
%incdec.ptr185 = getelementptr inbounds i32, ptr %aa.6724, i64 1
%140 = load i32, ptr %incdec.ptr185, align 4, !tbaa !11
%add184.neg = sub i32 %ca.3726.neg, %139
%sub186 = add i32 %add184.neg, %140
%cmp187 = icmp slt i32 %sub186, 0
%add190 = add nsw i32 %sub186, 1000000000
%spec.select = select i1 %cmp187, i32 %add190, i32 %sub186
%sub186.lobit.neg = ashr i32 %sub186, 31
store i32 %spec.select, ptr %incdec.ptr185, align 4, !tbaa !11
%cmp180 = icmp ult ptr %incdec.ptr183, %bb.3722
br i1 %cmp180, label %for.body182, label %while.cond193.preheader, !llvm.loop !46
while.cond193.preheader: ; preds = %for.body182, %if.then173
%aa.7.ph = phi ptr [ %add.ptr178, %if.then173 ], [ %incdec.ptr185, %for.body182 ]
br label %while.cond193
while.cond193: ; preds = %while.cond193.preheader, %while.cond193
%aa.7 = phi ptr [ %incdec.ptr197, %while.cond193 ], [ %aa.7.ph, %while.cond193.preheader ]
%141 = load i32, ptr %aa.7, align 4, !tbaa !11
%cmp194 = icmp eq i32 %141, 0
%incdec.ptr197 = getelementptr inbounds i32, ptr %aa.7, i64 -1
br i1 %cmp194, label %while.cond193, label %while.end, !llvm.loop !47
while.end: ; preds = %while.cond193
%sub.ptr.lhs.cast = ptrtoint ptr %aa.7 to i64
%sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, ptrtoint (ptr @mpDiv.atmp to i64)
%sub.ptr.div = lshr exact i64 %sub.ptr.sub, 2
%conv198 = trunc i64 %sub.ptr.div to i32
br label %while.cond.backedge
if.end222: ; preds = %while.body
%cmp223 = icmp eq i32 %132, %130
br i1 %cmp223, label %while.end348.loopexit, label %for.cond227.preheader
if.end222.thread: ; preds = %if.else170
%cmp223821 = icmp eq i32 %132, %130
br i1 %cmp223821, label %while.end348.loopexit, label %for.cond266.preheader.preheader
for.cond227.preheader: ; preds = %if.end222
%conv210 = sext i32 %133 to i64
%mul211 = mul nsw i64 %conv210, 1000000000
%add.ptr214 = getelementptr inbounds i32, ptr %add.ptr139, i64 -1
%142 = load i32, ptr %add.ptr214, align 4, !tbaa !11
%conv215 = sext i32 %142 to i64
%add216 = add nsw i64 %mul211, %conv215
%conv219 = sext i32 %135 to i64
%div220 = sdiv i64 %add216, %conv219
%143 = and i64 %div220, 4294967295
%cmp228745 = icmp eq i64 %143, 1
br i1 %cmp228745, label %if.then230, label %for.cond266.preheader.preheader
for.cond266.preheader.preheader: ; preds = %if.end222.thread, %for.cond227.preheader
%Q.0822825 = phi i64 [ %div220, %for.cond227.preheader ], [ 999999999, %if.end222.thread ]
%sext844 = shl i64 %Q.0822825, 32
%144 = ashr exact i64 %sext844, 32
br label %for.cond266.preheader
for.cond266.preheader: ; preds = %for.cond266.preheader.preheader, %if.else338
%indvars.iv = phi i64 [ %144, %for.cond266.preheader.preheader ], [ %indvars.iv.next, %if.else338 ]
%145 = load i32, ptr @mpDiv.btmp, align 16, !tbaa !11
%cmp267728 = icmp sgt i32 %145, 0
br i1 %cmp267728, label %for.body269, label %for.body293.preheader
if.then230.loopexit: ; preds = %if.else338
%.pre813 = load i32, ptr @mpDiv.btmp, align 16, !tbaa !11
%.pre819 = sext i32 %.pre813 to i64
br label %if.then230
if.then230: ; preds = %if.then230.loopexit, %for.cond227.preheader
%idx.ext231.pre-phi = phi i64 [ %.pre819, %if.then230.loopexit ], [ %idx.ext140, %for.cond227.preheader ]
%146 = phi i32 [ %159, %if.then230.loopexit ], [ %132, %for.cond227.preheader ]
%gep = getelementptr i32, ptr getelementptr inbounds ([1000 x i32], ptr @mpDiv.btmp, i64 0, i64 1), i64 %idx.ext231.pre-phi
store i32 0, ptr %gep, align 4, !tbaa !11
%147 = load i32, ptr @mpDiv.btmp, align 16, !tbaa !11
%148 = xor i32 %147, -1
%sub235 = add i32 %146, %148
%idx.ext236 = sext i32 %sub235 to i64
%add.ptr237 = getelementptr inbounds i32, ptr @mpDiv.atmp, i64 %idx.ext236
%cmp239753 = icmp sgt i32 %147, -1
br i1 %cmp239753, label %for.body241.preheader, label %while.cond254.preheader
for.body241.preheader: ; preds = %if.then230
%149 = add i32 %147, 1
%xtraiter1039 = and i32 %149, 1
%150 = icmp eq i32 %147, 0
br i1 %150, label %while.cond254.preheader.loopexit.unr-lcssa, label %for.body241.preheader.new
for.body241.preheader.new: ; preds = %for.body241.preheader
%unroll_iter = and i32 %149, -2
br label %for.body241
for.body241: ; preds = %for.body241, %for.body241.preheader.new
%ca.5757.neg = phi i32 [ 0, %for.body241.preheader.new ], [ %sub245.lobit.neg.1, %for.body241 ]
%bb.5756 = phi ptr [ @mpDiv.btmp, %for.body241.preheader.new ], [ %incdec.ptr242.1, %for.body241 ]
%aa.8755 = phi ptr [ %add.ptr237, %for.body241.preheader.new ], [ %incdec.ptr244.1, %for.body241 ]
%niter = phi i32 [ 0, %for.body241.preheader.new ], [ %niter.next.1, %for.body241 ]
%incdec.ptr242 = getelementptr inbounds i32, ptr %bb.5756, i64 1
%151 = load i32, ptr %incdec.ptr242, align 4, !tbaa !11
%incdec.ptr244 = getelementptr inbounds i32, ptr %aa.8755, i64 1
%152 = load i32, ptr %incdec.ptr244, align 4, !tbaa !11
%add243.neg = sub i32 %ca.5757.neg, %151
%sub245 = add i32 %add243.neg, %152
%cmp246 = icmp slt i32 %sub245, 0
%add249 = add nsw i32 %sub245, 1000000000
%spec.select670 = select i1 %cmp246, i32 %add249, i32 %sub245
%sub245.lobit.neg = ashr i32 %sub245, 31
store i32 %spec.select670, ptr %incdec.ptr244, align 4, !tbaa !11
%incdec.ptr242.1 = getelementptr inbounds i32, ptr %bb.5756, i64 2
%153 = load i32, ptr %incdec.ptr242.1, align 4, !tbaa !11
%incdec.ptr244.1 = getelementptr inbounds i32, ptr %aa.8755, i64 2
%154 = load i32, ptr %incdec.ptr244.1, align 4, !tbaa !11
%add243.neg.1 = sub i32 %sub245.lobit.neg, %153
%sub245.1 = add i32 %add243.neg.1, %154
%cmp246.1 = icmp slt i32 %sub245.1, 0
%add249.1 = add nsw i32 %sub245.1, 1000000000
%spec.select670.1 = select i1 %cmp246.1, i32 %add249.1, i32 %sub245.1
%sub245.lobit.neg.1 = ashr i32 %sub245.1, 31
store i32 %spec.select670.1, ptr %incdec.ptr244.1, align 4, !tbaa !11
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %while.cond254.preheader.loopexit.unr-lcssa, label %for.body241, !llvm.loop !48
while.cond254.preheader.loopexit.unr-lcssa: ; preds = %for.body241, %for.body241.preheader
%incdec.ptr244.lcssa.ph = phi ptr [ undef, %for.body241.preheader ], [ %incdec.ptr244.1, %for.body241 ]
%ca.5757.neg.unr = phi i32 [ 0, %for.body241.preheader ], [ %sub245.lobit.neg.1, %for.body241 ]
%bb.5756.unr = phi ptr [ @mpDiv.btmp, %for.body241.preheader ], [ %incdec.ptr242.1, %for.body241 ]
%aa.8755.unr = phi ptr [ %add.ptr237, %for.body241.preheader ], [ %incdec.ptr244.1, %for.body241 ]
%lcmp.mod1040.not = icmp eq i32 %xtraiter1039, 0
br i1 %lcmp.mod1040.not, label %while.cond254.preheader, label %for.body241.epil
for.body241.epil: ; preds = %while.cond254.preheader.loopexit.unr-lcssa
%incdec.ptr242.epil = getelementptr inbounds i32, ptr %bb.5756.unr, i64 1
%155 = load i32, ptr %incdec.ptr242.epil, align 4, !tbaa !11
%incdec.ptr244.epil = getelementptr inbounds i32, ptr %aa.8755.unr, i64 1
%156 = load i32, ptr %incdec.ptr244.epil, align 4, !tbaa !11
%add243.neg.epil = sub i32 %ca.5757.neg.unr, %155
%sub245.epil = add i32 %add243.neg.epil, %156
%cmp246.epil = icmp slt i32 %sub245.epil, 0
%add249.epil = add nsw i32 %sub245.epil, 1000000000
%spec.select670.epil = select i1 %cmp246.epil, i32 %add249.epil, i32 %sub245.epil
store i32 %spec.select670.epil, ptr %incdec.ptr244.epil, align 4, !tbaa !11
br label %while.cond254.preheader
while.cond254.preheader: ; preds = %for.body241.epil, %while.cond254.preheader.loopexit.unr-lcssa, %if.then230
%aa.9.ph = phi ptr [ %add.ptr237, %if.then230 ], [ %incdec.ptr244.lcssa.ph, %while.cond254.preheader.loopexit.unr-lcssa ], [ %incdec.ptr244.epil, %for.body241.epil ]
br label %while.cond254
while.cond254: ; preds = %while.cond254.preheader, %while.cond254
%aa.9 = phi ptr [ %incdec.ptr258, %while.cond254 ], [ %aa.9.ph, %while.cond254.preheader ]
%157 = load i32, ptr %aa.9, align 4, !tbaa !11
%cmp255 = icmp eq i32 %157, 0
%incdec.ptr258 = getelementptr inbounds i32, ptr %aa.9, i64 -1
br i1 %cmp255, label %while.cond254, label %while.end259, !llvm.loop !49
while.end259: ; preds = %while.cond254
%sub.ptr.lhs.cast260 = ptrtoint ptr %aa.9 to i64
%sub.ptr.sub262 = sub i64 %sub.ptr.lhs.cast260, ptrtoint (ptr @mpDiv.atmp to i64)
%sub.ptr.div263 = lshr exact i64 %sub.ptr.sub262, 2
%conv264 = trunc i64 %sub.ptr.div263 to i32
br label %while.cond.backedge
for.body269: ; preds = %for.cond266.preheader, %for.body269
%ca.7732 = phi i64 [ %div279, %for.body269 ], [ 0, %for.cond266.preheader ]
%rr.1731 = phi ptr [ %incdec.ptr278, %for.body269 ], [ %r, %for.cond266.preheader ]
%bb.6730 = phi ptr [ %incdec.ptr271, %for.body269 ], [ @mpDiv.btmp, %for.cond266.preheader ]
%i.10729 = phi i32 [ %inc282, %for.body269 ], [ 0, %for.cond266.preheader ]
%incdec.ptr271 = getelementptr inbounds i32, ptr %bb.6730, i64 1
%158 = load i32, ptr %incdec.ptr271, align 4, !tbaa !11
%conv272 = sext i32 %158 to i64
%mul273 = mul nsw i64 %indvars.iv, %conv272
%sext790 = shl i64 %ca.7732, 32
%conv274 = ashr exact i64 %sext790, 32
%add275 = add nsw i64 %mul273, %conv274
%rem276 = srem i64 %add275, 1000000000
%conv277 = trunc i64 %rem276 to i32
%incdec.ptr278 = getelementptr inbounds i32, ptr %rr.1731, i64 1
store i32 %conv277, ptr %incdec.ptr278, align 4, !tbaa !11
%div279 = sdiv i64 %add275, 1000000000
%inc282 = add nuw nsw i32 %i.10729, 1
%exitcond811.not = icmp eq i32 %inc282, %145
br i1 %exitcond811.not, label %for.end283.loopexit, label %for.body269, !llvm.loop !50
for.end283.loopexit: ; preds = %for.body269
%conv280 = trunc i64 %div279 to i32
br label %for.body293.preheader
for.body293.preheader: ; preds = %for.cond266.preheader, %for.end283.loopexit
%i.10.lcssa = phi i32 [ 0, %for.cond266.preheader ], [ %145, %for.end283.loopexit ]
%rr.1.lcssa = phi ptr [ %r, %for.cond266.preheader ], [ %incdec.ptr278, %for.end283.loopexit ]
%ca.7.lcssa = phi i32 [ 0, %for.cond266.preheader ], [ %conv280, %for.end283.loopexit ]
%incdec.ptr284 = getelementptr inbounds i32, ptr %rr.1.lcssa, i64 1
store i32 %ca.7.lcssa, ptr %incdec.ptr284, align 4, !tbaa !11
%add285 = add nuw nsw i32 %i.10.lcssa, 1
store i32 %add285, ptr %r, align 4, !tbaa !11
%159 = load i32, ptr @mpDiv.atmp, align 16, !tbaa !11
%idx.ext288 = zext i32 %add285 to i64
%add.ptr289 = getelementptr inbounds i32, ptr %r, i64 %idx.ext288
%idx.ext286 = sext i32 %159 to i64
%add.ptr287 = getelementptr inbounds i32, ptr @mpDiv.atmp, i64 %idx.ext286
br label %for.body293
for.body293: ; preds = %for.body293.preheader, %for.inc298
%rr.2738 = phi ptr [ %incdec.ptr300, %for.inc298 ], [ %add.ptr289, %for.body293.preheader ]
%aa.10737 = phi ptr [ %incdec.ptr299, %for.inc298 ], [ %add.ptr287, %for.body293.preheader ]
%160 = load i32, ptr %aa.10737, align 4, !tbaa !11
%161 = load i32, ptr %rr.2738, align 4, !tbaa !11
%cmp294.not = icmp eq i32 %160, %161
br i1 %cmp294.not, label %for.inc298, label %if.else306
for.inc298: ; preds = %for.body293
%incdec.ptr299 = getelementptr inbounds i32, ptr %aa.10737, i64 -1
%incdec.ptr300 = getelementptr inbounds i32, ptr %rr.2738, i64 -1
%cmp291.not = icmp eq ptr %incdec.ptr300, %r
br i1 %cmp291.not, label %if.then304, label %for.body293, !llvm.loop !51
if.then304: ; preds = %for.inc298
%162 = trunc i64 %indvars.iv to i32
%sub305 = sub nsw i32 %159, %add285
br label %while.cond.backedge
if.else306: ; preds = %for.body293
%cmp307 = icmp sgt i32 %160, %161
br i1 %cmp307, label %if.then309, label %if.else338
if.then309: ; preds = %if.else306
%163 = trunc i64 %indvars.iv to i32
%sub310 = sub nsw i32 %159, %add285
%idx.ext311 = sext i32 %sub310 to i64
%add.ptr312 = getelementptr inbounds i32, ptr @mpDiv.atmp, i64 %idx.ext311
%cmp314748 = icmp ugt ptr %rr.2738, %r
br i1 %cmp314748, label %for.body316, label %while.cond327.preheader
for.body316: ; preds = %if.then309, %for.body316
%ca.8751.neg = phi i32 [ %sub320.lobit.neg, %for.body316 ], [ 0, %if.then309 ]
%rr.3750 = phi ptr [ %incdec.ptr317, %for.body316 ], [ %r, %if.then309 ]
%aa.11749 = phi ptr [ %incdec.ptr319, %for.body316 ], [ %add.ptr312, %if.then309 ]
%incdec.ptr317 = getelementptr inbounds i32, ptr %rr.3750, i64 1
%164 = load i32, ptr %incdec.ptr317, align 4, !tbaa !11
%incdec.ptr319 = getelementptr inbounds i32, ptr %aa.11749, i64 1
%165 = load i32, ptr %incdec.ptr319, align 4, !tbaa !11
%add318.neg = sub i32 %ca.8751.neg, %164
%sub320 = add i32 %add318.neg, %165
%cmp321 = icmp slt i32 %sub320, 0
%add324 = add nsw i32 %sub320, 1000000000
%spec.select672 = select i1 %cmp321, i32 %add324, i32 %sub320
%sub320.lobit.neg = ashr i32 %sub320, 31
store i32 %spec.select672, ptr %incdec.ptr319, align 4, !tbaa !11
%cmp314 = icmp ult ptr %incdec.ptr317, %rr.2738
br i1 %cmp314, label %for.body316, label %while.cond327.preheader, !llvm.loop !52
while.cond327.preheader: ; preds = %for.body316, %if.then309
%aa.12.ph = phi ptr [ %add.ptr312, %if.then309 ], [ %incdec.ptr319, %for.body316 ]
br label %while.cond327
while.cond327: ; preds = %while.cond327.preheader, %while.cond327
%aa.12 = phi ptr [ %incdec.ptr331, %while.cond327 ], [ %aa.12.ph, %while.cond327.preheader ]
%166 = load i32, ptr %aa.12, align 4, !tbaa !11
%cmp328 = icmp eq i32 %166, 0
%incdec.ptr331 = getelementptr inbounds i32, ptr %aa.12, i64 -1
br i1 %cmp328, label %while.cond327, label %while.end332, !llvm.loop !53
while.end332: ; preds = %while.cond327
%sub.ptr.lhs.cast333 = ptrtoint ptr %aa.12 to i64
%sub.ptr.sub335 = sub i64 %sub.ptr.lhs.cast333, ptrtoint (ptr @mpDiv.atmp to i64)
%sub.ptr.div336 = lshr exact i64 %sub.ptr.sub335, 2
%conv337 = trunc i64 %sub.ptr.div336 to i32
br label %while.cond.backedge
if.else338: ; preds = %if.else306
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%167 = and i64 %indvars.iv.next, 4294967295
%cmp228 = icmp eq i64 %167, 1
br i1 %cmp228, label %if.then230.loopexit, label %for.cond266.preheader
while.end348.loopexit: ; preds = %if.end222.thread, %if.end222, %while.cond.backedge
%.pre814 = load i32, ptr %q, align 4, !tbaa !11
br label %while.end348
while.end348: ; preds = %while.end348.loopexit, %for.end135
%168 = phi i32 [ %.pre814, %while.end348.loopexit ], [ %add127, %for.end135 ]
%idx.ext349 = sext i32 %168 to i64
%add.ptr350 = getelementptr inbounds i32, ptr %q, i64 %idx.ext349
%169 = load i32, ptr %add.ptr350, align 4, !tbaa !11
%cmp351 = icmp eq i32 %169, 0
br i1 %cmp351, label %if.then353, label %if.end355
if.then353: ; preds = %while.end348
%dec354 = add nsw i32 %168, -1
store i32 %dec354, ptr %q, align 4, !tbaa !11
br label %if.end355
if.end355: ; preds = %if.then353, %while.end348
%170 = load i32, ptr @mpDiv.atmp, align 16, !tbaa !11
br i1 %cmp62, label %if.then358, label %if.else391
if.then358: ; preds = %if.end355
%cmp364773 = icmp sgt i32 %170, 0
br i1 %cmp364773, label %for.body366.lr.ph, label %for.end381
for.body366.lr.ph: ; preds = %if.then358
%idx.ext359 = zext i32 %170 to i64
%add.ptr362 = getelementptr inbounds i32, ptr %r, i64 %idx.ext359
%add.ptr360 = getelementptr inbounds i32, ptr @mpDiv.atmp, i64 %idx.ext359
%conv372 = zext i32 %add61 to i64
br label %for.body366
for.body366: ; preds = %for.body366.lr.ph, %for.body366
%ca.10777 = phi i64 [ 0, %for.body366.lr.ph ], [ %rem377, %for.body366 ]
%rr.4776 = phi ptr [ %add.ptr362, %for.body366.lr.ph ], [ %incdec.ptr375, %for.body366 ]
%aa.13775 = phi ptr [ %add.ptr360, %for.body366.lr.ph ], [ %incdec.ptr369, %for.body366 ]
%i.11774 = phi i32 [ %170, %for.body366.lr.ph ], [ %dec380, %for.body366 ]
%sext = shl i64 %ca.10777, 32
%conv367 = ashr exact i64 %sext, 32
%mul368 = mul nsw i64 %conv367, 1000000000
%incdec.ptr369 = getelementptr inbounds i32, ptr %aa.13775, i64 -1
%171 = load i32, ptr %aa.13775, align 4, !tbaa !11
%conv370 = sext i32 %171 to i64
%add371 = add nsw i64 %mul368, %conv370
%div373 = sdiv i64 %add371, %conv372
%conv374 = trunc i64 %div373 to i32
%incdec.ptr375 = getelementptr inbounds i32, ptr %rr.4776, i64 -1
store i32 %conv374, ptr %rr.4776, align 4, !tbaa !11
%rem377 = srem i64 %add371, %conv372
%dec380 = add nsw i32 %i.11774, -1
%cmp364 = icmp ugt i32 %i.11774, 1
br i1 %cmp364, label %for.body366, label %for.end381.loopexit, !llvm.loop !54
for.end381.loopexit: ; preds = %for.body366
%.pre815 = load i32, ptr @mpDiv.atmp, align 16, !tbaa !11
br label %for.end381
for.end381: ; preds = %for.end381.loopexit, %if.then358
%172 = phi i32 [ %.pre815, %for.end381.loopexit ], [ %170, %if.then358 ]
%idx.ext382 = sext i32 %172 to i64
%add.ptr383 = getelementptr inbounds i32, ptr %r, i64 %idx.ext382
%173 = load i32, ptr %add.ptr383, align 4, !tbaa !11
%cmp384 = icmp eq i32 %173, 0
%conv385.neg = sext i1 %cmp384 to i32
%sub386 = add i32 %172, %conv385.neg
%spec.store.select = tail call i32 @llvm.smax.i32(i32 %sub386, i32 0)
store i32 %spec.store.select, ptr %r, align 4
br label %cleanup
if.else391: ; preds = %if.end355
%cmp393769 = icmp sgt i32 %170, -1
br i1 %cmp393769, label %for.body395.preheader, label %cleanup
for.body395.preheader: ; preds = %if.else391
%174 = add i32 %170, 1
%175 = zext i32 %174 to i64
%min.iters.check954 = icmp ult i32 %174, 8
%176 = sub i64 %r950, ptrtoint (ptr @mpDiv.atmp to i64)
%diff.check951 = icmp ult i64 %176, 32
%or.cond1005 = or i1 %min.iters.check954, %diff.check951
br i1 %or.cond1005, label %for.body395.preheader1007, label %vector.ph955
vector.ph955: ; preds = %for.body395.preheader
%n.vec957 = and i64 %175, 4294967288
%177 = shl nuw nsw i64 %n.vec957, 2
%ind.end958 = getelementptr i8, ptr %r, i64 %177
%178 = shl nuw nsw i64 %n.vec957, 2
%ind.end960 = getelementptr i8, ptr @mpDiv.atmp, i64 %178
%.cast962 = trunc i64 %n.vec957 to i32
%ind.end963 = sub i32 %170, %.cast962
br label %vector.body966
vector.body966: ; preds = %vector.body966, %vector.ph955
%index967 = phi i64 [ 0, %vector.ph955 ], [ %index.next974, %vector.body966 ]
%179 = shl i64 %index967, 2
%next.gep968 = getelementptr i8, ptr %r, i64 %179
%180 = shl i64 %index967, 2
%next.gep970 = getelementptr i8, ptr @mpDiv.atmp, i64 %180
%wide.load972 = load <4 x i32>, ptr %next.gep970, align 16, !tbaa !11
%181 = getelementptr i32, ptr %next.gep970, i64 4
%wide.load973 = load <4 x i32>, ptr %181, align 16, !tbaa !11
store <4 x i32> %wide.load972, ptr %next.gep968, align 4, !tbaa !11
%182 = getelementptr i32, ptr %next.gep968, i64 4
store <4 x i32> %wide.load973, ptr %182, align 4, !tbaa !11
%index.next974 = add nuw i64 %index967, 8
%183 = icmp eq i64 %index.next974, %n.vec957
br i1 %183, label %middle.block952, label %vector.body966, !llvm.loop !55
middle.block952: ; preds = %vector.body966
%cmp.n965 = icmp eq i64 %n.vec957, %175
br i1 %cmp.n965, label %cleanup, label %for.body395.preheader1007
for.body395.preheader1007: ; preds = %for.body395.preheader, %middle.block952
%rr.5772.ph = phi ptr [ %r, %for.body395.preheader ], [ %ind.end958, %middle.block952 ]
%aa.14771.ph = phi ptr [ @mpDiv.atmp, %for.body395.preheader ], [ %ind.end960, %middle.block952 ]
%i.12770.ph = phi i32 [ %170, %for.body395.preheader ], [ %ind.end963, %middle.block952 ]
%184 = add i32 %i.12770.ph, 1
%xtraiter1042 = and i32 %184, 7
%lcmp.mod1043.not = icmp eq i32 %xtraiter1042, 0
br i1 %lcmp.mod1043.not, label %for.body395.prol.loopexit, label %for.body395.prol
for.body395.prol: ; preds = %for.body395.preheader1007, %for.body395.prol
%rr.5772.prol = phi ptr [ %incdec.ptr397.prol, %for.body395.prol ], [ %rr.5772.ph, %for.body395.preheader1007 ]
%aa.14771.prol = phi ptr [ %incdec.ptr396.prol, %for.body395.prol ], [ %aa.14771.ph, %for.body395.preheader1007 ]
%i.12770.prol = phi i32 [ %dec399.prol, %for.body395.prol ], [ %i.12770.ph, %for.body395.preheader1007 ]
%prol.iter1044 = phi i32 [ %prol.iter1044.next, %for.body395.prol ], [ 0, %for.body395.preheader1007 ]
%incdec.ptr396.prol = getelementptr inbounds i32, ptr %aa.14771.prol, i64 1
%185 = load i32, ptr %aa.14771.prol, align 4, !tbaa !11
%incdec.ptr397.prol = getelementptr inbounds i32, ptr %rr.5772.prol, i64 1
store i32 %185, ptr %rr.5772.prol, align 4, !tbaa !11
%dec399.prol = add nsw i32 %i.12770.prol, -1
%prol.iter1044.next = add i32 %prol.iter1044, 1
%prol.iter1044.cmp.not = icmp eq i32 %prol.iter1044.next, %xtraiter1042
br i1 %prol.iter1044.cmp.not, label %for.body395.prol.loopexit, label %for.body395.prol, !llvm.loop !56
for.body395.prol.loopexit: ; preds = %for.body395.prol, %for.body395.preheader1007
%rr.5772.unr = phi ptr [ %rr.5772.ph, %for.body395.preheader1007 ], [ %incdec.ptr397.prol, %for.body395.prol ]
%aa.14771.unr = phi ptr [ %aa.14771.ph, %for.body395.preheader1007 ], [ %incdec.ptr396.prol, %for.body395.prol ]
%i.12770.unr = phi i32 [ %i.12770.ph, %for.body395.preheader1007 ], [ %dec399.prol, %for.body395.prol ]
%186 = icmp ult i32 %i.12770.ph, 7
br i1 %186, label %cleanup, label %for.body395
for.body395: ; preds = %for.body395.prol.loopexit, %for.body395
%rr.5772 = phi ptr [ %incdec.ptr397.7, %for.body395 ], [ %rr.5772.unr, %for.body395.prol.loopexit ]
%aa.14771 = phi ptr [ %incdec.ptr396.7, %for.body395 ], [ %aa.14771.unr, %for.body395.prol.loopexit ]
%i.12770 = phi i32 [ %dec399.7, %for.body395 ], [ %i.12770.unr, %for.body395.prol.loopexit ]
%incdec.ptr396 = getelementptr inbounds i32, ptr %aa.14771, i64 1
%187 = load i32, ptr %aa.14771, align 4, !tbaa !11
%incdec.ptr397 = getelementptr inbounds i32, ptr %rr.5772, i64 1
store i32 %187, ptr %rr.5772, align 4, !tbaa !11
%incdec.ptr396.1 = getelementptr inbounds i32, ptr %aa.14771, i64 2
%188 = load i32, ptr %incdec.ptr396, align 4, !tbaa !11
%incdec.ptr397.1 = getelementptr inbounds i32, ptr %rr.5772, i64 2
store i32 %188, ptr %incdec.ptr397, align 4, !tbaa !11
%incdec.ptr396.2 = getelementptr inbounds i32, ptr %aa.14771, i64 3
%189 = load i32, ptr %incdec.ptr396.1, align 4, !tbaa !11
%incdec.ptr397.2 = getelementptr inbounds i32, ptr %rr.5772, i64 3
store i32 %189, ptr %incdec.ptr397.1, align 4, !tbaa !11
%incdec.ptr396.3 = getelementptr inbounds i32, ptr %aa.14771, i64 4
%190 = load i32, ptr %incdec.ptr396.2, align 4, !tbaa !11
%incdec.ptr397.3 = getelementptr inbounds i32, ptr %rr.5772, i64 4
store i32 %190, ptr %incdec.ptr397.2, align 4, !tbaa !11
%incdec.ptr396.4 = getelementptr inbounds i32, ptr %aa.14771, i64 5
%191 = load i32, ptr %incdec.ptr396.3, align 4, !tbaa !11
%incdec.ptr397.4 = getelementptr inbounds i32, ptr %rr.5772, i64 5
store i32 %191, ptr %incdec.ptr397.3, align 4, !tbaa !11
%incdec.ptr396.5 = getelementptr inbounds i32, ptr %aa.14771, i64 6
%192 = load i32, ptr %incdec.ptr396.4, align 4, !tbaa !11
%incdec.ptr397.5 = getelementptr inbounds i32, ptr %rr.5772, i64 6
store i32 %192, ptr %incdec.ptr397.4, align 4, !tbaa !11
%incdec.ptr396.6 = getelementptr inbounds i32, ptr %aa.14771, i64 7
%193 = load i32, ptr %incdec.ptr396.5, align 4, !tbaa !11
%incdec.ptr397.6 = getelementptr inbounds i32, ptr %rr.5772, i64 7
store i32 %193, ptr %incdec.ptr397.5, align 4, !tbaa !11
%incdec.ptr396.7 = getelementptr inbounds i32, ptr %aa.14771, i64 8
%194 = load i32, ptr %incdec.ptr396.6, align 4, !tbaa !11
%incdec.ptr397.7 = getelementptr inbounds i32, ptr %rr.5772, i64 8
store i32 %194, ptr %incdec.ptr397.6, align 4, !tbaa !11
%dec399.7 = add nsw i32 %i.12770, -8
%cmp393.not.7 = icmp eq i32 %i.12770, 7
br i1 %cmp393.not.7, label %cleanup, label %for.body395, !llvm.loop !57
cleanup: ; preds = %for.body395.prol.loopexit, %for.body395, %for.body.prol.loopexit, %for.body, %middle.block952, %middle.block978, %if.else391, %for.cond.preheader, %for.end381, %if.then36, %if.else, %if.end, %entry
%retval.0 = phi i32 [ -2, %entry ], [ 0, %if.end ], [ 0, %if.else ], [ 0, %if.then36 ], [ 0, %for.end381 ], [ 0, %for.cond.preheader ], [ 0, %if.else391 ], [ 0, %middle.block978 ], [ 0, %middle.block952 ], [ 0, %for.body ], [ 0, %for.body.prol.loopexit ], [ 0, %for.body395 ], [ 0, %for.body395.prol.loopexit ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !58
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 5000000, ptr noundef %0)
%1 = load i8, ptr @buf, align 16, !tbaa !5
switch i8 %1, label %while.cond2.i.preheader [
i8 45, label %if.then
i8 48, label %while.cond.ithread-pre-split
]
while.cond.ithread-pre-split: ; preds = %entry, %while.cond.ithread-pre-split
%str.addr.0.i121 = phi ptr [ %incdec.ptr.i, %while.cond.ithread-pre-split ], [ @buf, %entry ]
%incdec.ptr.i = getelementptr inbounds i8, ptr %str.addr.0.i121, i64 1
%.pr = load i8, ptr %incdec.ptr.i, align 1, !tbaa !5
%cmp.i = icmp eq i8 %.pr, 48
br i1 %cmp.i, label %while.cond.ithread-pre-split, label %while.cond2.i.preheader, !llvm.loop !8
while.cond2.i.preheader: ; preds = %while.cond.ithread-pre-split, %entry
%str.addr.0.i.lcssa = phi ptr [ @buf, %entry ], [ %incdec.ptr.i, %while.cond.ithread-pre-split ]
br label %while.cond2.i
while.cond2.i: ; preds = %while.cond2.i.preheader, %while.cond2.i
%indvar131 = phi i64 [ 0, %while.cond2.i.preheader ], [ %indvar.next132, %while.cond2.i ]
%ss.0.i = phi ptr [ %str.addr.0.i.lcssa, %while.cond2.i.preheader ], [ %incdec.ptr10.i, %while.cond2.i ]
%2 = load i8, ptr %ss.0.i, align 1, !tbaa !5
%3 = add i8 %2, -48
%or.cond.i = icmp ult i8 %3, 10
%incdec.ptr10.i = getelementptr inbounds i8, ptr %ss.0.i, i64 1
%indvar.next132 = add i64 %indvar131, 1
br i1 %or.cond.i, label %while.cond2.i, label %while.end11.i, !llvm.loop !10
while.end11.i: ; preds = %while.cond2.i
%cmp12.i = icmp eq ptr %ss.0.i, %str.addr.0.i.lcssa
br i1 %cmp12.i, label %if.end, label %do.body.i.preheader
do.body.i.preheader: ; preds = %while.end11.i
%xtraiter133 = and i64 %indvar131, 1
%4 = icmp eq i64 %indvar131, 1
br i1 %4, label %do.end.i.unr-lcssa, label %do.body.i.preheader.new
do.body.i.preheader.new: ; preds = %do.body.i.preheader
%unroll_iter136 = and i64 %indvar131, -2
br label %do.body.i
do.body.i: ; preds = %do.cond.i.1, %do.body.i.preheader.new
%ss.1.i = phi ptr [ %ss.0.i, %do.body.i.preheader.new ], [ %incdec.ptr14.i.1, %do.cond.i.1 ]
%nn.0.i = phi ptr [ @a, %do.body.i.preheader.new ], [ %nn.1.i.1, %do.cond.i.1 ]
%k.0.i = phi i32 [ 1, %do.body.i.preheader.new ], [ %k.1.i.1, %do.cond.i.1 ]
%x.1.i = phi i32 [ 0, %do.body.i.preheader.new ], [ %x.2.i.1, %do.cond.i.1 ]
%niter137 = phi i64 [ 0, %do.body.i.preheader.new ], [ %niter137.next.1, %do.cond.i.1 ]
%incdec.ptr14.i = getelementptr inbounds i8, ptr %ss.1.i, i64 -1
%5 = load i8, ptr %incdec.ptr14.i, align 1, !tbaa !5
%conv15.i = sext i8 %5 to i32
%sub.i = add nsw i32 %conv15.i, -48
%mul.i = mul nsw i32 %sub.i, %k.0.i
%add.i = add nsw i32 %mul.i, %x.1.i
%cmp17.i = icmp eq i32 %k.0.i, 100000000
%mul16.i = mul nsw i32 %k.0.i, 10
%cmp19.i = icmp eq ptr %incdec.ptr14.i, %str.addr.0.i.lcssa
%or.cond52.i = or i1 %cmp19.i, %cmp17.i
br i1 %or.cond52.i, label %if.then21.i, label %do.cond.i
if.then21.i: ; preds = %do.body.i
%incdec.ptr22.i = getelementptr inbounds i32, ptr %nn.0.i, i64 1
store i32 %add.i, ptr %incdec.ptr22.i, align 4, !tbaa !11
br label %do.cond.i
do.cond.i: ; preds = %if.then21.i, %do.body.i
%nn.1.i = phi ptr [ %incdec.ptr22.i, %if.then21.i ], [ %nn.0.i, %do.body.i ]
%k.1.i = phi i32 [ 1, %if.then21.i ], [ %mul16.i, %do.body.i ]
%x.2.i = phi i32 [ 0, %if.then21.i ], [ %add.i, %do.body.i ]
%incdec.ptr14.i.1 = getelementptr inbounds i8, ptr %ss.1.i, i64 -2
%6 = load i8, ptr %incdec.ptr14.i.1, align 1, !tbaa !5
%conv15.i.1 = sext i8 %6 to i32
%sub.i.1 = add nsw i32 %conv15.i.1, -48
%mul.i.1 = mul nsw i32 %sub.i.1, %k.1.i
%add.i.1 = add nsw i32 %mul.i.1, %x.2.i
%cmp17.i.1 = icmp eq i32 %k.1.i, 100000000
%mul16.i.1 = mul nsw i32 %k.1.i, 10
%cmp19.i.1 = icmp eq ptr %incdec.ptr14.i.1, %str.addr.0.i.lcssa
%or.cond52.i.1 = or i1 %cmp19.i.1, %cmp17.i.1
br i1 %or.cond52.i.1, label %if.then21.i.1, label %do.cond.i.1
if.then21.i.1: ; preds = %do.cond.i
%incdec.ptr22.i.1 = getelementptr inbounds i32, ptr %nn.1.i, i64 1
store i32 %add.i.1, ptr %incdec.ptr22.i.1, align 4, !tbaa !11
br label %do.cond.i.1
do.cond.i.1: ; preds = %if.then21.i.1, %do.cond.i
%nn.1.i.1 = phi ptr [ %incdec.ptr22.i.1, %if.then21.i.1 ], [ %nn.1.i, %do.cond.i ]
%k.1.i.1 = phi i32 [ 1, %if.then21.i.1 ], [ %mul16.i.1, %do.cond.i ]
%x.2.i.1 = phi i32 [ 0, %if.then21.i.1 ], [ %add.i.1, %do.cond.i ]
%niter137.next.1 = add i64 %niter137, 2
%niter137.ncmp.1 = icmp eq i64 %niter137.next.1, %unroll_iter136
br i1 %niter137.ncmp.1, label %do.end.i.unr-lcssa, label %do.body.i, !llvm.loop !13
do.end.i.unr-lcssa: ; preds = %do.cond.i.1, %do.body.i.preheader
%nn.1.i.lcssa.ph = phi ptr [ undef, %do.body.i.preheader ], [ %nn.1.i.1, %do.cond.i.1 ]
%ss.1.i.unr = phi ptr [ %ss.0.i, %do.body.i.preheader ], [ %incdec.ptr14.i.1, %do.cond.i.1 ]
%nn.0.i.unr = phi ptr [ @a, %do.body.i.preheader ], [ %nn.1.i.1, %do.cond.i.1 ]
%k.0.i.unr = phi i32 [ 1, %do.body.i.preheader ], [ %k.1.i.1, %do.cond.i.1 ]
%x.1.i.unr = phi i32 [ 0, %do.body.i.preheader ], [ %x.2.i.1, %do.cond.i.1 ]
%lcmp.mod134.not = icmp eq i64 %xtraiter133, 0
br i1 %lcmp.mod134.not, label %do.end.i, label %do.body.i.epil
do.body.i.epil: ; preds = %do.end.i.unr-lcssa
%incdec.ptr14.i.epil = getelementptr inbounds i8, ptr %ss.1.i.unr, i64 -1
%cmp17.i.epil = icmp eq i32 %k.0.i.unr, 100000000
%cmp19.i.epil = icmp eq ptr %incdec.ptr14.i.epil, %str.addr.0.i.lcssa
%or.cond52.i.epil = or i1 %cmp19.i.epil, %cmp17.i.epil
br i1 %or.cond52.i.epil, label %if.then21.i.epil, label %do.end.i
if.then21.i.epil: ; preds = %do.body.i.epil
%7 = load i8, ptr %incdec.ptr14.i.epil, align 1, !tbaa !5
%conv15.i.epil = sext i8 %7 to i32
%sub.i.epil = add nsw i32 %conv15.i.epil, -48
%mul.i.epil = mul nsw i32 %sub.i.epil, %k.0.i.unr
%add.i.epil = add nsw i32 %mul.i.epil, %x.1.i.unr
%incdec.ptr22.i.epil = getelementptr inbounds i32, ptr %nn.0.i.unr, i64 1
store i32 %add.i.epil, ptr %incdec.ptr22.i.epil, align 4, !tbaa !11
br label %do.end.i
do.end.i: ; preds = %do.body.i.epil, %if.then21.i.epil, %do.end.i.unr-lcssa
%nn.1.i.lcssa = phi ptr [ %nn.1.i.lcssa.ph, %do.end.i.unr-lcssa ], [ %incdec.ptr22.i.epil, %if.then21.i.epil ], [ %nn.0.i.unr, %do.body.i.epil ]
%sub.ptr.lhs.cast.i = ptrtoint ptr %nn.1.i.lcssa to i64
%sub.ptr.sub.i = sub i64 %sub.ptr.lhs.cast.i, ptrtoint (ptr @a to i64)
%sub.ptr.div.i = lshr exact i64 %sub.ptr.sub.i, 2
%conv26.i = trunc i64 %sub.ptr.div.i to i32
br label %if.end
if.then: ; preds = %entry
store i32 1, ptr @a_minus, align 4, !tbaa !11
br label %while.cond.i32
while.cond.i32: ; preds = %while.cond.i32, %if.then
%str.addr.0.i33 = phi ptr [ getelementptr inbounds ([500000 x i8], ptr @buf, i64 0, i64 1), %if.then ], [ %incdec.ptr.i35, %while.cond.i32 ]
%8 = load i8, ptr %str.addr.0.i33, align 1, !tbaa !5
%cmp.i34 = icmp eq i8 %8, 48
%incdec.ptr.i35 = getelementptr inbounds i8, ptr %str.addr.0.i33, i64 1
br i1 %cmp.i34, label %while.cond.i32, label %while.cond2.i37, !llvm.loop !8
while.cond2.i37: ; preds = %while.cond.i32, %while.cond2.i37
%indvar = phi i64 [ %indvar.next, %while.cond2.i37 ], [ 0, %while.cond.i32 ]
%ss.0.i38 = phi ptr [ %incdec.ptr10.i40, %while.cond2.i37 ], [ %str.addr.0.i33, %while.cond.i32 ]
%9 = load i8, ptr %ss.0.i38, align 1, !tbaa !5
%10 = add i8 %9, -48
%or.cond.i39 = icmp ult i8 %10, 10
%incdec.ptr10.i40 = getelementptr inbounds i8, ptr %ss.0.i38, i64 1
%indvar.next = add i64 %indvar, 1
br i1 %or.cond.i39, label %while.cond2.i37, label %while.end11.i41, !llvm.loop !10
while.end11.i41: ; preds = %while.cond2.i37
%cmp12.i42 = icmp eq ptr %ss.0.i38, %str.addr.0.i33
br i1 %cmp12.i42, label %if.end, label %do.body.i43.preheader
do.body.i43.preheader: ; preds = %while.end11.i41
%xtraiter = and i64 %indvar, 1
%11 = icmp eq i64 %indvar, 1
br i1 %11, label %do.end.i61.unr-lcssa, label %do.body.i43.preheader.new
do.body.i43.preheader.new: ; preds = %do.body.i43.preheader
%unroll_iter = and i64 %indvar, -2
br label %do.body.i43
do.body.i43: ; preds = %do.cond.i57.1, %do.body.i43.preheader.new
%ss.1.i44 = phi ptr [ %ss.0.i38, %do.body.i43.preheader.new ], [ %incdec.ptr14.i48.1, %do.cond.i57.1 ]
%nn.0.i45 = phi ptr [ @a, %do.body.i43.preheader.new ], [ %nn.1.i58.1, %do.cond.i57.1 ]
%k.0.i46 = phi i32 [ 1, %do.body.i43.preheader.new ], [ %k.1.i59.1, %do.cond.i57.1 ]
%x.1.i47 = phi i32 [ 0, %do.body.i43.preheader.new ], [ %x.2.i60.1, %do.cond.i57.1 ]
%niter = phi i64 [ 0, %do.body.i43.preheader.new ], [ %niter.next.1, %do.cond.i57.1 ]
%incdec.ptr14.i48 = getelementptr inbounds i8, ptr %ss.1.i44, i64 -1
%12 = load i8, ptr %incdec.ptr14.i48, align 1, !tbaa !5
%conv15.i49 = sext i8 %12 to i32
%sub.i50 = add nsw i32 %conv15.i49, -48
%mul.i51 = mul nsw i32 %sub.i50, %k.0.i46
%add.i52 = add nsw i32 %mul.i51, %x.1.i47
%cmp17.i53 = icmp eq i32 %k.0.i46, 100000000
%mul16.i54 = mul nsw i32 %k.0.i46, 10
%cmp19.i55 = icmp eq ptr %incdec.ptr14.i48, %str.addr.0.i33
%or.cond52.i56 = or i1 %cmp19.i55, %cmp17.i53
br i1 %or.cond52.i56, label %if.then21.i67, label %do.cond.i57
if.then21.i67: ; preds = %do.body.i43
%incdec.ptr22.i68 = getelementptr inbounds i32, ptr %nn.0.i45, i64 1
store i32 %add.i52, ptr %incdec.ptr22.i68, align 4, !tbaa !11
br label %do.cond.i57
do.cond.i57: ; preds = %if.then21.i67, %do.body.i43
%nn.1.i58 = phi ptr [ %incdec.ptr22.i68, %if.then21.i67 ], [ %nn.0.i45, %do.body.i43 ]
%k.1.i59 = phi i32 [ 1, %if.then21.i67 ], [ %mul16.i54, %do.body.i43 ]
%x.2.i60 = phi i32 [ 0, %if.then21.i67 ], [ %add.i52, %do.body.i43 ]
%incdec.ptr14.i48.1 = getelementptr inbounds i8, ptr %ss.1.i44, i64 -2
%13 = load i8, ptr %incdec.ptr14.i48.1, align 1, !tbaa !5
%conv15.i49.1 = sext i8 %13 to i32
%sub.i50.1 = add nsw i32 %conv15.i49.1, -48
%mul.i51.1 = mul nsw i32 %sub.i50.1, %k.1.i59
%add.i52.1 = add nsw i32 %mul.i51.1, %x.2.i60
%cmp17.i53.1 = icmp eq i32 %k.1.i59, 100000000
%mul16.i54.1 = mul nsw i32 %k.1.i59, 10
%cmp19.i55.1 = icmp eq ptr %incdec.ptr14.i48.1, %str.addr.0.i33
%or.cond52.i56.1 = or i1 %cmp19.i55.1, %cmp17.i53.1
br i1 %or.cond52.i56.1, label %if.then21.i67.1, label %do.cond.i57.1
if.then21.i67.1: ; preds = %do.cond.i57
%incdec.ptr22.i68.1 = getelementptr inbounds i32, ptr %nn.1.i58, i64 1
store i32 %add.i52.1, ptr %incdec.ptr22.i68.1, align 4, !tbaa !11
br label %do.cond.i57.1
do.cond.i57.1: ; preds = %if.then21.i67.1, %do.cond.i57
%nn.1.i58.1 = phi ptr [ %incdec.ptr22.i68.1, %if.then21.i67.1 ], [ %nn.1.i58, %do.cond.i57 ]
%k.1.i59.1 = phi i32 [ 1, %if.then21.i67.1 ], [ %mul16.i54.1, %do.cond.i57 ]
%x.2.i60.1 = phi i32 [ 0, %if.then21.i67.1 ], [ %add.i52.1, %do.cond.i57 ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %do.end.i61.unr-lcssa, label %do.body.i43, !llvm.loop !13
do.end.i61.unr-lcssa: ; preds = %do.cond.i57.1, %do.body.i43.preheader
%nn.1.i58.lcssa.ph = phi ptr [ undef, %do.body.i43.preheader ], [ %nn.1.i58.1, %do.cond.i57.1 ]
%ss.1.i44.unr = phi ptr [ %ss.0.i38, %do.body.i43.preheader ], [ %incdec.ptr14.i48.1, %do.cond.i57.1 ]
%nn.0.i45.unr = phi ptr [ @a, %do.body.i43.preheader ], [ %nn.1.i58.1, %do.cond.i57.1 ]
%k.0.i46.unr = phi i32 [ 1, %do.body.i43.preheader ], [ %k.1.i59.1, %do.cond.i57.1 ]
%x.1.i47.unr = phi i32 [ 0, %do.body.i43.preheader ], [ %x.2.i60.1, %do.cond.i57.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %do.end.i61, label %do.body.i43.epil
do.body.i43.epil: ; preds = %do.end.i61.unr-lcssa
%incdec.ptr14.i48.epil = getelementptr inbounds i8, ptr %ss.1.i44.unr, i64 -1
%cmp17.i53.epil = icmp eq i32 %k.0.i46.unr, 100000000
%cmp19.i55.epil = icmp eq ptr %incdec.ptr14.i48.epil, %str.addr.0.i33
%or.cond52.i56.epil = or i1 %cmp19.i55.epil, %cmp17.i53.epil
br i1 %or.cond52.i56.epil, label %if.then21.i67.epil, label %do.end.i61
if.then21.i67.epil: ; preds = %do.body.i43.epil
%14 = load i8, ptr %incdec.ptr14.i48.epil, align 1, !tbaa !5
%conv15.i49.epil = sext i8 %14 to i32
%sub.i50.epil = add nsw i32 %conv15.i49.epil, -48
%mul.i51.epil = mul nsw i32 %sub.i50.epil, %k.0.i46.unr
%add.i52.epil = add nsw i32 %mul.i51.epil, %x.1.i47.unr
%incdec.ptr22.i68.epil = getelementptr inbounds i32, ptr %nn.0.i45.unr, i64 1
store i32 %add.i52.epil, ptr %incdec.ptr22.i68.epil, align 4, !tbaa !11
br label %do.end.i61
do.end.i61: ; preds = %do.body.i43.epil, %if.then21.i67.epil, %do.end.i61.unr-lcssa
%nn.1.i58.lcssa = phi ptr [ %nn.1.i58.lcssa.ph, %do.end.i61.unr-lcssa ], [ %incdec.ptr22.i68.epil, %if.then21.i67.epil ], [ %nn.0.i45.unr, %do.body.i43.epil ]
%sub.ptr.lhs.cast.i62 = ptrtoint ptr %nn.1.i58.lcssa to i64
%sub.ptr.sub.i63 = sub i64 %sub.ptr.lhs.cast.i62, ptrtoint (ptr @a to i64)
%sub.ptr.div.i64 = lshr exact i64 %sub.ptr.sub.i63, 2
%conv26.i65 = trunc i64 %sub.ptr.div.i64 to i32
br label %if.end
if.end: ; preds = %do.end.i61, %while.end11.i41, %do.end.i, %while.end11.i
%15 = phi i32 [ %conv26.i, %do.end.i ], [ 0, %while.end11.i ], [ %conv26.i65, %do.end.i61 ], [ 0, %while.end11.i41 ]
%phi.call = phi ptr [ %ss.0.i, %do.end.i ], [ %str.addr.0.i.lcssa, %while.end11.i ], [ %ss.0.i38, %do.end.i61 ], [ %str.addr.0.i33, %while.end11.i41 ]
store i32 %15, ptr @a, align 16, !tbaa !11
br label %while.cond
while.cond: ; preds = %while.body, %if.end
%p.1 = phi ptr [ %phi.call, %if.end ], [ %incdec.ptr6, %while.body ]
%16 = load i8, ptr %p.1, align 1, !tbaa !5
switch i8 %16, label %while.cond.i70.preheader [
i8 32, label %while.body
i8 45, label %if.then10
]
while.body: ; preds = %while.cond
%incdec.ptr6 = getelementptr inbounds i8, ptr %p.1, i64 1
br label %while.cond, !llvm.loop !60
if.then10: ; preds = %while.cond
store i32 1, ptr @b_minus, align 4, !tbaa !11
%incdec.ptr11 = getelementptr inbounds i8, ptr %p.1, i64 1
br label %while.cond.i70.preheader
while.cond.i70.preheader: ; preds = %while.cond, %if.then10
%str.addr.0.i71.ph = phi ptr [ %incdec.ptr11, %if.then10 ], [ %p.1, %while.cond ]
br label %while.cond.i70
while.cond.i70: ; preds = %while.cond.i70.preheader, %while.cond.i70
%str.addr.0.i71 = phi ptr [ %incdec.ptr.i73, %while.cond.i70 ], [ %str.addr.0.i71.ph, %while.cond.i70.preheader ]
%17 = load i8, ptr %str.addr.0.i71, align 1, !tbaa !5
%cmp.i72 = icmp eq i8 %17, 48
%incdec.ptr.i73 = getelementptr inbounds i8, ptr %str.addr.0.i71, i64 1
br i1 %cmp.i72, label %while.cond.i70, label %while.cond2.i75, !llvm.loop !8
while.cond2.i75: ; preds = %while.cond.i70, %while.cond2.i75
%indvar138 = phi i64 [ %indvar.next139, %while.cond2.i75 ], [ 0, %while.cond.i70 ]
%ss.0.i76 = phi ptr [ %incdec.ptr10.i78, %while.cond2.i75 ], [ %str.addr.0.i71, %while.cond.i70 ]
%18 = load i8, ptr %ss.0.i76, align 1, !tbaa !5
%19 = add i8 %18, -48
%or.cond.i77 = icmp ult i8 %19, 10
%incdec.ptr10.i78 = getelementptr inbounds i8, ptr %ss.0.i76, i64 1
%indvar.next139 = add i64 %indvar138, 1
br i1 %or.cond.i77, label %while.cond2.i75, label %while.end11.i79, !llvm.loop !10
while.end11.i79: ; preds = %while.cond2.i75
%cmp12.i80 = icmp eq ptr %ss.0.i76, %str.addr.0.i71
br i1 %cmp12.i80, label %mpStr2Num.exit107.thread, label %do.body.i81.preheader
do.body.i81.preheader: ; preds = %while.end11.i79
%xtraiter140 = and i64 %indvar138, 1
%20 = icmp eq i64 %indvar138, 1
br i1 %20, label %mpStr2Num.exit107.unr-lcssa, label %do.body.i81.preheader.new
do.body.i81.preheader.new: ; preds = %do.body.i81.preheader
%unroll_iter143 = and i64 %indvar138, -2
br label %do.body.i81
mpStr2Num.exit107.thread: ; preds = %while.end11.i79
store i32 0, ptr @b, align 16, !tbaa !11
br label %mpMul.exit.thread
do.body.i81: ; preds = %do.cond.i95.1, %do.body.i81.preheader.new
%ss.1.i82 = phi ptr [ %ss.0.i76, %do.body.i81.preheader.new ], [ %incdec.ptr14.i86.1, %do.cond.i95.1 ]
%nn.0.i83 = phi ptr [ @b, %do.body.i81.preheader.new ], [ %nn.1.i96.1, %do.cond.i95.1 ]
%k.0.i84 = phi i32 [ 1, %do.body.i81.preheader.new ], [ %k.1.i97.1, %do.cond.i95.1 ]
%x.1.i85 = phi i32 [ 0, %do.body.i81.preheader.new ], [ %x.2.i98.1, %do.cond.i95.1 ]
%niter144 = phi i64 [ 0, %do.body.i81.preheader.new ], [ %niter144.next.1, %do.cond.i95.1 ]
%incdec.ptr14.i86 = getelementptr inbounds i8, ptr %ss.1.i82, i64 -1
%21 = load i8, ptr %incdec.ptr14.i86, align 1, !tbaa !5
%conv15.i87 = sext i8 %21 to i32
%sub.i88 = add nsw i32 %conv15.i87, -48
%mul.i89 = mul nsw i32 %sub.i88, %k.0.i84
%add.i90 = add nsw i32 %mul.i89, %x.1.i85
%cmp17.i91 = icmp eq i32 %k.0.i84, 100000000
%mul16.i92 = mul nsw i32 %k.0.i84, 10
%cmp19.i93 = icmp eq ptr %incdec.ptr14.i86, %str.addr.0.i71
%or.cond52.i94 = or i1 %cmp19.i93, %cmp17.i91
br i1 %or.cond52.i94, label %if.then21.i105, label %do.cond.i95
if.then21.i105: ; preds = %do.body.i81
%incdec.ptr22.i106 = getelementptr inbounds i32, ptr %nn.0.i83, i64 1
store i32 %add.i90, ptr %incdec.ptr22.i106, align 4, !tbaa !11
br label %do.cond.i95
do.cond.i95: ; preds = %if.then21.i105, %do.body.i81
%nn.1.i96 = phi ptr [ %incdec.ptr22.i106, %if.then21.i105 ], [ %nn.0.i83, %do.body.i81 ]
%k.1.i97 = phi i32 [ 1, %if.then21.i105 ], [ %mul16.i92, %do.body.i81 ]
%x.2.i98 = phi i32 [ 0, %if.then21.i105 ], [ %add.i90, %do.body.i81 ]
%incdec.ptr14.i86.1 = getelementptr inbounds i8, ptr %ss.1.i82, i64 -2
%22 = load i8, ptr %incdec.ptr14.i86.1, align 1, !tbaa !5
%conv15.i87.1 = sext i8 %22 to i32
%sub.i88.1 = add nsw i32 %conv15.i87.1, -48
%mul.i89.1 = mul nsw i32 %sub.i88.1, %k.1.i97
%add.i90.1 = add nsw i32 %mul.i89.1, %x.2.i98
%cmp17.i91.1 = icmp eq i32 %k.1.i97, 100000000
%mul16.i92.1 = mul nsw i32 %k.1.i97, 10
%cmp19.i93.1 = icmp eq ptr %incdec.ptr14.i86.1, %str.addr.0.i71
%or.cond52.i94.1 = or i1 %cmp19.i93.1, %cmp17.i91.1
br i1 %or.cond52.i94.1, label %if.then21.i105.1, label %do.cond.i95.1
if.then21.i105.1: ; preds = %do.cond.i95
%incdec.ptr22.i106.1 = getelementptr inbounds i32, ptr %nn.1.i96, i64 1
store i32 %add.i90.1, ptr %incdec.ptr22.i106.1, align 4, !tbaa !11
br label %do.cond.i95.1
do.cond.i95.1: ; preds = %if.then21.i105.1, %do.cond.i95
%nn.1.i96.1 = phi ptr [ %incdec.ptr22.i106.1, %if.then21.i105.1 ], [ %nn.1.i96, %do.cond.i95 ]
%k.1.i97.1 = phi i32 [ 1, %if.then21.i105.1 ], [ %mul16.i92.1, %do.cond.i95 ]
%x.2.i98.1 = phi i32 [ 0, %if.then21.i105.1 ], [ %add.i90.1, %do.cond.i95 ]
%niter144.next.1 = add i64 %niter144, 2
%niter144.ncmp.1 = icmp eq i64 %niter144.next.1, %unroll_iter143
br i1 %niter144.ncmp.1, label %mpStr2Num.exit107.unr-lcssa, label %do.body.i81, !llvm.loop !13
mpStr2Num.exit107.unr-lcssa: ; preds = %do.cond.i95.1, %do.body.i81.preheader
%nn.1.i96.lcssa.ph = phi ptr [ undef, %do.body.i81.preheader ], [ %nn.1.i96.1, %do.cond.i95.1 ]
%ss.1.i82.unr = phi ptr [ %ss.0.i76, %do.body.i81.preheader ], [ %incdec.ptr14.i86.1, %do.cond.i95.1 ]
%nn.0.i83.unr = phi ptr [ @b, %do.body.i81.preheader ], [ %nn.1.i96.1, %do.cond.i95.1 ]
%k.0.i84.unr = phi i32 [ 1, %do.body.i81.preheader ], [ %k.1.i97.1, %do.cond.i95.1 ]
%x.1.i85.unr = phi i32 [ 0, %do.body.i81.preheader ], [ %x.2.i98.1, %do.cond.i95.1 ]
%lcmp.mod141.not = icmp eq i64 %xtraiter140, 0
br i1 %lcmp.mod141.not, label %mpStr2Num.exit107, label %do.body.i81.epil
do.body.i81.epil: ; preds = %mpStr2Num.exit107.unr-lcssa
%incdec.ptr14.i86.epil = getelementptr inbounds i8, ptr %ss.1.i82.unr, i64 -1
%cmp17.i91.epil = icmp eq i32 %k.0.i84.unr, 100000000
%cmp19.i93.epil = icmp eq ptr %incdec.ptr14.i86.epil, %str.addr.0.i71
%or.cond52.i94.epil = or i1 %cmp19.i93.epil, %cmp17.i91.epil
br i1 %or.cond52.i94.epil, label %if.then21.i105.epil, label %mpStr2Num.exit107
if.then21.i105.epil: ; preds = %do.body.i81.epil
%23 = load i8, ptr %incdec.ptr14.i86.epil, align 1, !tbaa !5
%conv15.i87.epil = sext i8 %23 to i32
%sub.i88.epil = add nsw i32 %conv15.i87.epil, -48
%mul.i89.epil = mul nsw i32 %sub.i88.epil, %k.0.i84.unr
%add.i90.epil = add nsw i32 %mul.i89.epil, %x.1.i85.unr
%incdec.ptr22.i106.epil = getelementptr inbounds i32, ptr %nn.0.i83.unr, i64 1
store i32 %add.i90.epil, ptr %incdec.ptr22.i106.epil, align 4, !tbaa !11
br label %mpStr2Num.exit107
mpStr2Num.exit107: ; preds = %do.body.i81.epil, %if.then21.i105.epil, %mpStr2Num.exit107.unr-lcssa
%nn.1.i96.lcssa = phi ptr [ %nn.1.i96.lcssa.ph, %mpStr2Num.exit107.unr-lcssa ], [ %incdec.ptr22.i106.epil, %if.then21.i105.epil ], [ %nn.0.i83.unr, %do.body.i81.epil ]
%sub.ptr.lhs.cast.i100 = ptrtoint ptr %nn.1.i96.lcssa to i64
%sub.ptr.sub.i101 = sub i64 %sub.ptr.lhs.cast.i100, ptrtoint (ptr @b to i64)
%sub.ptr.div.i102 = lshr exact i64 %sub.ptr.sub.i101, 2
%conv26.i103 = trunc i64 %sub.ptr.div.i102 to i32
store i32 %conv26.i103, ptr @b, align 16, !tbaa !11
%24 = load i32, ptr @a_minus, align 4, !tbaa !11
%25 = load i32, ptr @b_minus, align 4, !tbaa !11
%cmp.i108 = icmp eq i32 %15, 0
%cmp1.i = icmp eq i32 %conv26.i103, 0
%or.cond.i109 = select i1 %cmp.i108, i1 true, i1 %cmp1.i
br i1 %or.cond.i109, label %mpMul.exit.thread, label %if.end.i
mpMul.exit.thread: ; preds = %mpStr2Num.exit107.thread, %mpStr2Num.exit107
store i32 0, ptr @ab, align 16, !tbaa !11
br label %if.end20
if.end.i: ; preds = %mpStr2Num.exit107
%add.i110 = add i32 %15, %conv26.i103
%cmp279.i = icmp sgt i32 %add.i110, 0
br i1 %cmp279.i, label %for.body.preheader.i, label %for.cond3.preheader.i
for.body.preheader.i: ; preds = %if.end.i
%26 = zext i32 %add.i110 to i64
%27 = add nsw i32 %add.i110, -1
%28 = zext i32 %27 to i64
%29 = shl nuw nsw i64 %28, 2
%30 = sub nsw i64 %26, %28
%31 = shl nsw i64 %30, 2
%scevgep.i = getelementptr i8, ptr @ab, i64 %31
%32 = add nuw nsw i64 %29, 4
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.i, i8 0, i64 %32, i1 false), !tbaa !11
br label %for.cond3.preheader.i
for.cond3.preheader.i: ; preds = %for.body.preheader.i, %if.end.i
%cmp4.not89.i = icmp slt i32 %conv26.i103, 1
br i1 %cmp4.not89.i, label %mpMul.exit, label %for.body5.lr.ph.i
for.body5.lr.ph.i: ; preds = %for.cond3.preheader.i
%cmp7.not81.i = icmp slt i32 %15, 1
br i1 %cmp7.not81.i, label %for.body5.lr.ph.split.us.i, label %for.body5.preheader.i
for.body5.preheader.i: ; preds = %for.body5.lr.ph.i
%33 = add nuw i32 %15, 1
%34 = add nuw nsw i64 %sub.ptr.div.i102, 1
%wide.trip.count100.i = and i64 %34, 4294967295
%wide.trip.count.i = zext i32 %33 to i64
%add.ptr30.i = getelementptr inbounds i32, ptr @ab, i64 %wide.trip.count.i
%invariant.gep.i = getelementptr i32, ptr %add.ptr30.i, i64 -1
br label %for.body5.i
for.body5.lr.ph.split.us.i: ; preds = %for.body5.lr.ph.i
%35 = and i64 %sub.ptr.sub.i101, 17179869180
tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([60000 x i32], ptr @ab, i64 0, i64 1), i8 0, i64 %35, i1 false), !tbaa !11
br label %mpMul.exit
for.body5.i: ; preds = %for.cond6.for.end28_crit_edge.i, %for.body5.preheader.i
%indvars.iv97.i = phi i64 [ 1, %for.body5.preheader.i ], [ %indvars.iv.next98.i, %for.cond6.for.end28_crit_edge.i ]
%b.addr.091.i = phi ptr [ @b, %for.body5.preheader.i ], [ %incdec.ptr.i111, %for.cond6.for.end28_crit_edge.i ]
%incdec.ptr.i111 = getelementptr inbounds i32, ptr %b.addr.091.i, i64 1
%gep.i = getelementptr i32, ptr getelementptr ([60000 x i32], ptr @ab, i64 -1, i64 59999), i64 %indvars.iv97.i
%36 = load i32, ptr %incdec.ptr.i111, align 4, !tbaa !11
%conv10.i = sext i32 %36 to i64
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i, %for.body5.i
%indvars.iv.i = phi i64 [ 1, %for.body5.i ], [ %indvars.iv.next.i, %for.body8.i ]
%ca.184.i = phi i64 [ 0, %for.body5.i ], [ %div.i, %for.body8.i ]
%aa.083.i = phi ptr [ @a, %for.body5.i ], [ %incdec.ptr9.i, %for.body8.i ]
%incdec.ptr9.i = getelementptr inbounds i32, ptr %aa.083.i, i64 1
%37 = load i32, ptr %incdec.ptr9.i, align 4, !tbaa !11
%conv.i = sext i32 %37 to i64
%mul.i112 = mul nsw i64 %conv10.i, %conv.i
%gep87.i = getelementptr i32, ptr %gep.i, i64 %indvars.iv.i
%38 = load i32, ptr %gep87.i, align 4, !tbaa !11
%conv16.i = sext i32 %38 to i64
%sext.i = shl i64 %ca.184.i, 32
%conv18.i = ashr exact i64 %sext.i, 32
%add17.i = add nsw i64 %conv18.i, %conv16.i
%add19.i = add nsw i64 %add17.i, %mul.i112
%rem.i = urem i64 %add19.i, 1000000000
%conv20.i = trunc i64 %rem.i to i32
store i32 %conv20.i, ptr %gep87.i, align 4, !tbaa !11
%div.i = udiv i64 %add19.i, 1000000000
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond6.for.end28_crit_edge.i, label %for.body8.i, !llvm.loop !21
for.cond6.for.end28_crit_edge.i: ; preds = %for.body8.i
%conv26.i113 = trunc i64 %div.i to i32
%gep106.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv97.i
store i32 %conv26.i113, ptr %gep106.i, align 4, !tbaa !11
%indvars.iv.next98.i = add nuw nsw i64 %indvars.iv97.i, 1
%exitcond101.not.i = icmp eq i64 %indvars.iv.next98.i, %wide.trip.count100.i
br i1 %exitcond101.not.i, label %for.end36.loopexit94.i, label %for.body5.i, !llvm.loop !22
for.end36.loopexit94.i: ; preds = %for.cond6.for.end28_crit_edge.i
%39 = icmp eq i32 %conv26.i113, 0
%40 = sext i1 %39 to i32
br label %mpMul.exit
mpMul.exit: ; preds = %for.cond3.preheader.i, %for.body5.lr.ph.split.us.i, %for.end36.loopexit94.i
%ca.0.lcssa.i = phi i32 [ 0, %for.cond3.preheader.i ], [ -1, %for.body5.lr.ph.split.us.i ], [ %40, %for.end36.loopexit94.i ]
%cond.i = add nsw i32 %ca.0.lcssa.i, %add.i110
%cond.i.fr = freeze i32 %cond.i
store i32 %cond.i.fr, ptr @ab, align 16, !tbaa !11
%cmp14 = icmp eq i32 %cond.i.fr, 0
%tobool.not = icmp eq i32 %24, %25
%or.cond = select i1 %cmp14, i1 true, i1 %tobool.not
br i1 %or.cond, label %if.end20, label %if.then18
if.then18: ; preds = %mpMul.exit
%41 = load ptr, ptr @stdout, align 8, !tbaa !58
%call.i = tail call i32 @putc(i32 noundef 45, ptr noundef %41)
br label %if.end20
if.end20: ; preds = %mpMul.exit.thread, %mpMul.exit, %if.then18
tail call void @mpNum2Str(ptr noundef nonnull @buf, ptr noundef nonnull @ab)
%call21 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @buf)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
!15 = distinct !{!15, !9}
!16 = distinct !{!16, !9}
!17 = distinct !{!17, !9}
!18 = distinct !{!18, !9}
!19 = distinct !{!19, !9}
!20 = distinct !{!20, !9}
!21 = distinct !{!21, !9}
!22 = distinct !{!22, !9}
!23 = distinct !{!23, !9, !24, !25}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.unroll.disable"}
!28 = distinct !{!28, !9, !24}
!29 = distinct !{!29, !9, !24, !25}
!30 = distinct !{!30, !27}
!31 = distinct !{!31, !9}
!32 = distinct !{!32, !9, !24}
!33 = distinct !{!33, !9, !24, !25}
!34 = distinct !{!34, !27}
!35 = distinct !{!35, !9, !24}
!36 = distinct !{!36, !9}
!37 = distinct !{!37, !9, !24, !25}
!38 = distinct !{!38, !27}
!39 = distinct !{!39, !9, !24}
!40 = distinct !{!40, !9}
!41 = distinct !{!41, !9, !24, !25}
!42 = distinct !{!42, !27}
!43 = distinct !{!43, !9, !24}
!44 = distinct !{!44, !9}
!45 = distinct !{!45, !9}
!46 = distinct !{!46, !9}
!47 = distinct !{!47, !9}
!48 = distinct !{!48, !9}
!49 = distinct !{!49, !9}
!50 = distinct !{!50, !9}
!51 = distinct !{!51, !9}
!52 = distinct !{!52, !9}
!53 = distinct !{!53, !9}
!54 = distinct !{!54, !9}
!55 = distinct !{!55, !9, !24, !25}
!56 = distinct !{!56, !27}
!57 = distinct !{!57, !9, !24}
!58 = !{!59, !59, i64 0}
!59 = !{!"any pointer", !6, i64 0}
!60 = distinct !{!60, !9}
|
#include<stdio.h>
int main(void) {
int d, n;
scanf("%d%d", &d, &n);
int ans = n + (n==100);
for(int i=0; i<d; i++) {
ans *= 100;
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156575/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156575/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%d = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 100
%conv = zext i1 %cmp to i32
%add = add nsw i32 %0, %conv
%1 = load i32, ptr %d, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %1, 0
br i1 %cmp16, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %1, -8
%2 = insertelement <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, i32 %add, i64 0
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> [ %2, %vector.ph ], [ %3, %vector.body ]
%vec.phi9 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %4, %vector.body ]
%3 = mul <4 x i32> %vec.phi, <i32 100, i32 100, i32 100, i32 100>
%4 = mul <4 x i32> %vec.phi9, <i32 100, i32 100, i32 100, i32 100>
%index.next = add nuw i32 %index, 8
%5 = icmp eq i32 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %4, %3
%6 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %1, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.08.ph = phi i32 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ans.07.ph = phi i32 [ %add, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%ans.0.lcssa = phi i32 [ %add, %entry ], [ %6, %middle.block ], [ %mul, %for.body ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
ret i32 0
for.body: ; preds = %for.body.preheader10, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ %i.08.ph, %for.body.preheader10 ]
%ans.07 = phi i32 [ %mul, %for.body ], [ %ans.07.ph, %for.body.preheader10 ]
%mul = mul nsw i32 %ans.07, 100
%inc = add nuw nsw i32 %i.08, 1
%exitcond.not = icmp eq i32 %inc, %1
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include <stdio.h>
int main(void)
{
int D, n;
scanf("%d%d", &D, &n);
int dup = 0, gap;
int pow100[4] = {1, 100, 10000, 1000000};
n *= pow100[D];
while((gap = n/pow100[D+1]-dup) > 0){
dup += gap;
n += dup*pow100[D];
}
printf("%d", n);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156618/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156618/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@__const.main.pow100 = private unnamed_addr constant [4 x i32] [i32 1, i32 100, i32 10000, i32 1000000], align 16
@.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:
%D = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D, ptr noundef nonnull %n)
%0 = load i32, ptr %D, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [4 x i32], ptr @__const.main.pow100, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%mul = mul nsw i32 %2, %1
%add = add nsw i32 %0, 1
%idxprom1 = sext i32 %add to i64
%arrayidx2 = getelementptr inbounds [4 x i32], ptr @__const.main.pow100, i64 0, i64 %idxprom1
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%div12 = sdiv i32 %mul, %3
%cmp13 = icmp sgt i32 %div12, 0
br i1 %cmp13, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%div15 = phi i32 [ %div, %while.body ], [ %div12, %entry ]
%storemerge14 = phi i32 [ %add7, %while.body ], [ %mul, %entry ]
%mul6 = mul nsw i32 %div15, %1
%add7 = add nsw i32 %mul6, %storemerge14
%div = sdiv i32 %add7, %3
%cmp = icmp sgt i32 %div, %div15
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%storemerge.lcssa11 = phi i32 [ %mul, %entry ], [ %add7, %while.body ]
store i32 %storemerge.lcssa11, ptr %n, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %storemerge.lcssa11)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <stdbool.h>
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define PI 3.14159265358979323846;
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
/*
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r)
*/
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r)
#define TYPE long long
#define ll long long
#define MEMSET(a) memset(a,0,sizeof(a))
#define MEMSET_U(a) memset(a,-1,sizeof(a))
#define bool _Bool
const int mod = (int)1e09 + 7;
//#define DEBUG1
//#define DEBUG2
//#define DEBUGF
#define DUMMY
int in(void) { int i; scanf("%d", &i); return i; }
long long llin(void) { long long i; scanf("%lld", &i); return i; }
double din(void) { double i; scanf("%lf", &i); return i; }
void chin(char s[]) { scanf("%s", s); }
void print(int a) { printf("%d\n", a); }
void llprint(long long a) { printf("%lld\n", a); }
void dprint(double a) { printf("%.10f\n", a); }
void print2(int a, int b) { printf("%d %d\n", a, b); }
int Max(int a, int b) { if (a > b) { return a; }return b; }
int Min(int a, int b) { if (a < b) { return a; }return b; }
long long llmax(long long a, long long b) { return a > b ? a : b; }
long long llmin(long long a, long long b) { return a < b ? a : b; }
double dmax(double a, double b) { return a > b ? a : b; }
double dmin(double a, double b) { return a < b ? a : b; }
//long long llmax(long long a, long long b) { return a > b ? a : b; }
//long long llmin(long long a, long long b) { return a < b ? a : b; }
//double dmax(double a, double b) { return a > b ? a : b; }
int cmp(const void *a, const void *b) { return *(TYPE *)a - *(TYPE *)b; }
int cmp_r(const void *a, const void *b) { return *(TYPE *)b - *(TYPE *)a; }
int char_cmp(const void *a, const void *b) { return strcmp((char *)a, (char *)b); }
int char_cmp_r(const void *a, const void *b) { return strcmp((char *)b, (char *)a); }
void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; }
int main() {
double D, N;
scanf("%lf%lf", &D, &N);
int ans;
if (N != 100) {
ans = (int)(pow(100, D)*N);
}
else if (D == 0) {
ans = 101;
}
else if (D == 1) {
ans = 10100;
}
else if (D == 2) {
ans = 1010000;
}
printf("%d\n", ans);
#ifdef DEBUGF
getch();
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156661/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156661/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.3 = 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.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@.str.8 = private unnamed_addr constant [7 x i8] c"%lf%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #11
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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 i64 @llin() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @din() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a)
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 void @llprint(i64 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b)
ret void
}
; 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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @Min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmin(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp olt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; 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 #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !9
%1 = load i64, ptr %a, align 8, !tbaa !9
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #8 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%D = alloca double, align 8
%N = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %D) #11
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %D, ptr noundef nonnull %N)
%0 = load double, ptr %N, align 8, !tbaa !11
%cmp = fcmp une double %0, 1.000000e+02
%1 = load double, ptr %D, align 8, !tbaa !11
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call double @pow(double noundef 1.000000e+02, double noundef %1) #11
%2 = load double, ptr %N, align 8, !tbaa !11
%mul = fmul double %call1, %2
%conv = fptosi double %mul to i32
br label %if.end15
if.else: ; preds = %entry
%cmp2 = fcmp oeq double %1, 0.000000e+00
br i1 %cmp2, label %if.end15, label %if.else5
if.else5: ; preds = %if.else
%cmp6 = fcmp oeq double %1, 1.000000e+00
br i1 %cmp6, label %if.end15, label %if.else9
if.else9: ; preds = %if.else5
br label %if.end15
if.end15: ; preds = %if.else9, %if.else5, %if.else, %if.then
%ans.0 = phi i32 [ %conv, %if.then ], [ 101, %if.else ], [ 10100, %if.else5 ], [ 1010000, %if.else9 ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %D) #11
ret i32 0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #10
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { 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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
|
#include <stdio.h>
#include <math.h>
int main(void) {
int d, n;
scanf("%d", &d);
scanf("%d", &n);
int base = 0;
switch (d) {
case 0: base = 1; break;
case 1: base = 100; break;
case 2: base = 10000; break;
}
int result = (n!=100) ? base*n : base*(n+1);
printf("%d\n", result);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156704/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156704/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@switch.table.main = private unnamed_addr constant [3 x i32] [i32 1, i32 100, i32 10000], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %d, align 4, !tbaa !5
%1 = icmp ult i32 %0, 3
br i1 %1, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %entry
%2 = sext i32 %0 to i64
%switch.gep = getelementptr inbounds [3 x i32], ptr @switch.table.main, i64 0, i64 %2
%switch.load = load i32, ptr %switch.gep, align 4
br label %sw.epilog
sw.epilog: ; preds = %switch.lookup, %entry
%base.0 = phi i32 [ 0, %entry ], [ %switch.load, %switch.lookup ]
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp eq i32 %3, 100
%. = select i1 %cmp.not, i32 101, i32 %3
%cond = mul nsw i32 %., %base.0
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define X 100
int main(){
int D, N;
scanf("%d %d", &D, &N);
int i, ans, num=1, temp;
for(i=0;i<D;i++){
num*=X;
}
ans=num*N;
temp=ans;
for(i=0;i<=D&&temp%100==0;i++){
temp/=X;
}
if(i!=D){
for(i=0;;i++){
ans+=num;
temp=ans;
for(i=0;i<=D&&temp%100==0;i++){
temp/=X;
}
if(i==D){
break;
}
}
}
printf("%d", ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156748/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156748/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%D = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D, ptr noundef nonnull %N)
%0 = load i32, ptr %D, align 4, !tbaa !5
%.fr = freeze i32 %0
%cmp46 = icmp sgt i32 %.fr, 0
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %.fr, 8
br i1 %min.iters.check, label %for.body.preheader69, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %.fr, -8
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.phi67 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %2, %vector.body ]
%1 = mul <4 x i32> %vec.phi, <i32 100, i32 100, i32 100, i32 100>
%2 = mul <4 x i32> %vec.phi67, <i32 100, i32 100, i32 100, i32 100>
%index.next = add nuw i32 %index, 8
%3 = icmp eq i32 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %2, %1
%4 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %.fr, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader69
for.body.preheader69: ; preds = %for.body.preheader, %middle.block
%num.048.ph = phi i32 [ 1, %for.body.preheader ], [ %4, %middle.block ]
%i.047.ph = phi i32 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader69, %for.body
%num.048 = phi i32 [ %mul, %for.body ], [ %num.048.ph, %for.body.preheader69 ]
%i.047 = phi i32 [ %inc, %for.body ], [ %i.047.ph, %for.body.preheader69 ]
%mul = mul nsw i32 %num.048, 100
%inc = add nuw nsw i32 %i.047, 1
%exitcond.not = icmp eq i32 %inc, %.fr
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%num.0.lcssa = phi i32 [ 1, %entry ], [ %4, %middle.block ], [ %mul, %for.body ]
%5 = load i32, ptr %N, align 4, !tbaa !5
%mul1 = mul nsw i32 %5, %num.0.lcssa
%cmp3.not50 = icmp sgt i32 %.fr, -1
%rem51 = srem i32 %mul1, 100
%cmp452 = icmp eq i32 %rem51, 0
%or.cond53 = select i1 %cmp3.not50, i1 %cmp452, i1 false
br i1 %or.cond53, label %for.body5, label %for.end8
for.body5: ; preds = %for.end, %for.body5
%temp.055 = phi i32 [ %div, %for.body5 ], [ %mul1, %for.end ]
%i.154 = phi i32 [ %inc7, %for.body5 ], [ 0, %for.end ]
%div = sdiv i32 %temp.055, 100
%inc7 = add nuw nsw i32 %i.154, 1
%cmp3.not = icmp slt i32 %i.154, %.fr
%rem = srem i32 %div, 100
%cmp4 = icmp eq i32 %rem, 0
%or.cond = select i1 %cmp3.not, i1 %cmp4, i1 false
br i1 %or.cond, label %for.body5, label %for.end8, !llvm.loop !14
for.end8: ; preds = %for.body5, %for.end
%i.1.lcssa = phi i32 [ 0, %for.end ], [ %inc7, %for.body5 ]
%cmp9.not = icmp eq i32 %i.1.lcssa, %.fr
br i1 %cmp9.not, label %if.end27, label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.end8
br i1 %cmp3.not50, label %for.cond10, label %for.cond10.us
for.cond10.us: ; preds = %for.cond10.preheader, %for.cond10.us
br label %for.cond10.us
for.cond10: ; preds = %for.cond10.preheader, %for.end21
%ans.0 = phi i32 [ %add, %for.end21 ], [ %mul1, %for.cond10.preheader ]
%add = add nsw i32 %ans.0, %num.0.lcssa
%rem1458 = srem i32 %add, 100
%cmp1559 = icmp eq i32 %rem1458, 0
br i1 %cmp1559, label %for.body17, label %for.end21
for.body17: ; preds = %for.cond10, %for.body17
%temp.162 = phi i32 [ %div18, %for.body17 ], [ %add, %for.cond10 ]
%i.261 = phi i32 [ %inc20, %for.body17 ], [ 0, %for.cond10 ]
%div18 = sdiv i32 %temp.162, 100
%inc20 = add nuw nsw i32 %i.261, 1
%cmp12.not = icmp slt i32 %i.261, %.fr
%rem14 = srem i32 %div18, 100
%cmp15 = icmp eq i32 %rem14, 0
%or.cond45 = select i1 %cmp12.not, i1 %cmp15, i1 false
br i1 %or.cond45, label %for.body17, label %for.end21, !llvm.loop !15
for.end21: ; preds = %for.body17, %for.cond10
%i.2.lcssa = phi i32 [ 0, %for.cond10 ], [ %inc20, %for.body17 ]
%cmp22 = icmp eq i32 %i.2.lcssa, %.fr
br i1 %cmp22, label %if.end27, label %for.cond10
if.end27: ; preds = %for.end21, %for.end8
%ans.1 = phi i32 [ %mul1, %for.end8 ], [ %add, %for.end21 ]
%call28 = 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 %N) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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.mul.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main(void){
int D,N;
int ans;
scanf("%d %d", &D, &N);
ans = N;
if(N==100) ans++;
for(int i=0; i<D; i++){
ans *= 100;
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156799/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156799/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%D = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 100
%spec.select = select i1 %cmp, i32 101, i32 %0
%1 = load i32, ptr %D, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %1, 0
br i1 %cmp17, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body.preheader11, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %1, -8
%2 = insertelement <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, i32 %spec.select, i64 0
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> [ %2, %vector.ph ], [ %3, %vector.body ]
%vec.phi10 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %4, %vector.body ]
%3 = mul <4 x i32> %vec.phi, <i32 100, i32 100, i32 100, i32 100>
%4 = mul <4 x i32> %vec.phi10, <i32 100, i32 100, i32 100, i32 100>
%index.next = add nuw i32 %index, 8
%5 = icmp eq i32 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %4, %3
%6 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %1, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader11
for.body.preheader11: ; preds = %for.body.preheader, %middle.block
%i.09.ph = phi i32 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ans.18.ph = phi i32 [ %spec.select, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%ans.1.lcssa = phi i32 [ %spec.select, %entry ], [ %6, %middle.block ], [ %mul, %for.body ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4
ret i32 0
for.body: ; preds = %for.body.preheader11, %for.body
%i.09 = phi i32 [ %inc2, %for.body ], [ %i.09.ph, %for.body.preheader11 ]
%ans.18 = phi i32 [ %mul, %for.body ], [ %ans.18.ph, %for.body.preheader11 ]
%mul = mul nsw i32 %ans.18, 100
%inc2 = add nuw nsw i32 %i.09, 1
%exitcond.not = icmp eq i32 %inc2, %1
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include <stdio.h>
#define MOD 100000
#define NMAX 7
#define SMAX 3000
int main(void){
int n, m, s;
while(scanf("%d %d %d", &n, &m, &s), n){
int i, j, dp[NMAX*NMAX+1][SMAX+1] = {0};
dp[0][0] = 1;
for(i = 1; i <= n * n; i++){
for(j = 0; j <= s; j++){
if(j - i >= 0) dp[i][j] += dp[i-1][j-i];
if(j - i >= 0) dp[i][j] += dp[i][j-i];
if(j - m - 1 >= 0) dp[i][j] += (MOD - dp[i-1][j-m-1]);
dp[i][j] %= MOD;
}
}
printf("%d\n", dp[n*n][s]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156841/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156841/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%s = alloca i32, align 4
%dp = alloca [50 x [3001 x i32]], 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 %s) #5
%call87 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not88 = icmp eq i32 %0, 0
br i1 %tobool.not88, label %while.end, label %for.cond2.preheader.lr.ph
for.cond2.preheader.lr.ph: ; preds = %entry, %for.end53
%1 = phi i32 [ %17, %for.end53 ], [ %0, %entry ]
call void @llvm.lifetime.start.p0(i64 600200, ptr nonnull %dp) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(600200) %dp, i8 0, i64 600200, i1 false)
store i32 1, ptr %dp, align 16, !tbaa !5
%mul = mul i32 %1, %1
%2 = load i32, ptr %s, align 4, !tbaa !5
%cmp3.not83 = icmp slt i32 %2, 0
%3 = load i32, ptr %m, align 4
%4 = xor i32 %3, -1
br i1 %cmp3.not83, label %for.end53, label %for.cond2.preheader.preheader
for.cond2.preheader.preheader: ; preds = %for.cond2.preheader.lr.ph
%5 = add nuw i32 %2, 1
%umax = call i32 @llvm.umax.i32(i32 %mul, i32 1)
%6 = add i32 %umax, 1
%wide.trip.count98 = zext i32 %6 to i64
%wide.trip.count = zext i32 %5 to i64
br label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.cond2.for.inc51_crit_edge
%indvars.iv93 = phi i64 [ 1, %for.cond2.preheader.preheader ], [ %indvars.iv.next94, %for.cond2.for.inc51_crit_edge ]
%7 = add nsw i64 %indvars.iv93, -1
br label %for.body4
for.body4: ; preds = %for.cond2.preheader, %if.end46
%indvars.iv = phi i64 [ 0, %for.cond2.preheader ], [ %indvars.iv.next, %if.end46 ]
%8 = sub nsw i64 %indvars.iv, %indvars.iv93
%cmp5 = icmp sgt i64 %8, -1
br i1 %cmp5, label %if.then, label %if.end28
if.then: ; preds = %for.body4
%idxprom9 = and i64 %8, 4294967295
%arrayidx10 = getelementptr inbounds [50 x [3001 x i32]], ptr %dp, i64 0, i64 %7, i64 %idxprom9
%9 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds [50 x [3001 x i32]], ptr %dp, i64 0, i64 %indvars.iv93, i64 %indvars.iv
%10 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%add = add nsw i32 %10, %9
store i32 %add, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx22 = getelementptr inbounds [50 x [3001 x i32]], ptr %dp, i64 0, i64 %indvars.iv93, i64 %idxprom9
%11 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%add27 = add nsw i32 %11, %add
store i32 %add27, ptr %arrayidx14, align 4, !tbaa !5
br label %if.end28
if.end28: ; preds = %for.body4, %if.then
%12 = trunc i64 %indvars.iv to i32
%sub30 = add i32 %12, %4
%cmp31 = icmp sgt i32 %sub30, -1
br i1 %cmp31, label %if.then32, label %if.end28.if.end46_crit_edge
if.end28.if.end46_crit_edge: ; preds = %if.end28
%arrayidx50.phi.trans.insert = getelementptr inbounds [50 x [3001 x i32]], ptr %dp, i64 0, i64 %indvars.iv93, i64 %indvars.iv
%.pre = load i32, ptr %arrayidx50.phi.trans.insert, align 4, !tbaa !5
br label %if.end46
if.then32: ; preds = %if.end28
%idxprom38 = zext i32 %sub30 to i64
%arrayidx39 = getelementptr inbounds [50 x [3001 x i32]], ptr %dp, i64 0, i64 %7, i64 %idxprom38
%13 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%arrayidx44 = getelementptr inbounds [50 x [3001 x i32]], ptr %dp, i64 0, i64 %indvars.iv93, i64 %indvars.iv
%14 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%reass.sub89 = sub i32 %14, %13
%add45 = add i32 %reass.sub89, 100000
br label %if.end46
if.end46: ; preds = %if.end28.if.end46_crit_edge, %if.then32
%15 = phi i32 [ %.pre, %if.end28.if.end46_crit_edge ], [ %add45, %if.then32 ]
%arrayidx50 = getelementptr inbounds [50 x [3001 x i32]], ptr %dp, i64 0, i64 %indvars.iv93, i64 %indvars.iv
%rem = srem i32 %15, 100000
store i32 %rem, ptr %arrayidx50, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.for.inc51_crit_edge, label %for.body4, !llvm.loop !9
for.cond2.for.inc51_crit_edge: ; preds = %if.end46
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%exitcond99.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count98
br i1 %exitcond99.not, label %for.end53, label %for.cond2.preheader, !llvm.loop !11
for.end53: ; preds = %for.cond2.for.inc51_crit_edge, %for.cond2.preheader.lr.ph
%idxprom55 = zext i32 %mul to i64
%idxprom57 = sext i32 %2 to i64
%arrayidx58 = getelementptr inbounds [50 x [3001 x i32]], ptr %dp, i64 0, i64 %idxprom55, i64 %idxprom57
%16 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16)
call void @llvm.lifetime.end.p0(i64 600200, ptr nonnull %dp) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %s)
%17 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %17, 0
br i1 %tobool.not, label %while.end, label %for.cond2.preheader.lr.ph, !llvm.loop !12
while.end: ; preds = %for.end53, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: 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.umax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main()
{
char input[4];
int cup[3] = {1};
int p1, p2, c, i;
while (scanf("%s", input) != EOF){
p1 = input[0] - 'A';
p2 = input[2] - 'A';
c = cup[p1];
cup[p1] = cup[p2];
cup[p2] = c;
}
i = 0;
while (1){
if (cup[i] == 1){
printf("%c\n", 'A' + i);
break;
}
i++;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156885/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156885/source.c"
target datalayout = "e-m:e-p270: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.cup = private unnamed_addr constant [3 x i32] [i32 1, i32 0, i32 0], align 4
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%input = alloca [4 x i8], align 1
%cup = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input) #4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %cup) #4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %cup, ptr noundef nonnull align 4 dereferenceable(12) @__const.main.cup, i64 12, i1 false)
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%cmp.not24 = icmp eq i32 %call23, -1
br i1 %cmp.not24, label %while.cond11.preheader, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [4 x i8], ptr %input, i64 0, i64 2
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%0 = load i8, ptr %input, align 1, !tbaa !5
%conv = sext i8 %0 to i64
%sub = add nsw i64 %conv, -65
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%conv2 = sext i8 %1 to i64
%sub3 = add nsw i64 %conv2, -65
%arrayidx4 = getelementptr inbounds [3 x i32], ptr %cup, i64 0, i64 %sub
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !8
%arrayidx6 = getelementptr inbounds [3 x i32], ptr %cup, i64 0, i64 %sub3
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !8
store i32 %3, ptr %arrayidx4, align 4, !tbaa !8
store i32 %2, ptr %arrayidx6, align 4, !tbaa !8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.cond11.preheader, label %while.body, !llvm.loop !10
while.cond11.preheader: ; preds = %while.body, %entry
br label %while.cond11
while.cond11: ; preds = %while.cond11.preheader, %while.cond11
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond11 ], [ 0, %while.cond11.preheader ]
%arrayidx14 = getelementptr inbounds [3 x i32], ptr %cup, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx14, align 4, !tbaa !8
%cmp15 = icmp eq i32 %4, 1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp15, label %if.then, label %while.cond11
if.then: ; preds = %while.cond11
%5 = trunc i64 %indvars.iv to i32
%add = add nuw nsw i32 %5, 65
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %cup) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: 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: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
/*
Problem 0047 : Cup Game
*/
#include <stdio.h>
int main(void){
int cup[3] = {1 , 0 , 0};
char x , y;
int x2 , y2 , buf , i;
while(scanf("%c,%c%*c" , &x , &y)!=EOF){
x2 = x - 'A';
y2 = y - 'A';
buf = cup[x2];
cup[x2] = cup[y2];
cup[y2] = buf;
}
for(i=0;;i++){
if(cup[i]==1){
printf("%c\n" , i + 'A');
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156942/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156942/source.c"
target datalayout = "e-m:e-p270: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.cup = private unnamed_addr constant [3 x i32] [i32 1, i32 0, i32 0], align 4
@.str = private unnamed_addr constant [9 x i8] c"%c,%c%*c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%cup = alloca [3 x i32], align 4
%x = alloca i8, align 1
%y = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %cup) #4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %cup, ptr noundef nonnull align 4 dereferenceable(12) @__const.main.cup, i64 12, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %y) #4
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%cmp.not19 = icmp eq i32 %call18, -1
br i1 %cmp.not19, label %for.cond.preheader, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i8, ptr %x, align 1, !tbaa !5
%conv = sext i8 %0 to i64
%sub = add nsw i64 %conv, -65
%1 = load i8, ptr %y, align 1, !tbaa !5
%conv1 = sext i8 %1 to i64
%sub2 = add nsw i64 %conv1, -65
%arrayidx = getelementptr inbounds [3 x i32], ptr %cup, i64 0, i64 %sub
%2 = load i32, ptr %arrayidx, align 4, !tbaa !8
%arrayidx4 = getelementptr inbounds [3 x i32], ptr %cup, i64 0, i64 %sub2
%3 = load i32, ptr %arrayidx4, align 4, !tbaa !8
store i32 %3, ptr %arrayidx, align 4, !tbaa !8
store i32 %2, ptr %arrayidx4, align 4, !tbaa !8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !10
for.cond.preheader: ; preds = %while.body, %entry
br label %for.cond
for.cond: ; preds = %for.cond.preheader, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ]
%arrayidx10 = getelementptr inbounds [3 x i32], ptr %cup, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx10, align 4, !tbaa !8
%cmp11 = icmp eq i32 %4, 1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp11, label %if.then, label %for.cond
if.then: ; preds = %for.cond
%5 = trunc i64 %indvars.iv to i32
%add = add nuw nsw i32 %5, 65
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %cup) #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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, 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: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main ()
{
long long int a,b,c,n,i;
scanf("%I64d",&n);
for (i=1;i<=n;i++)
{
scanf("%I64d%I64d%I64d",&a,&b,&c);
printf("%I64d\n",(a+b+c)/2);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1570/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1
@.str.1 = private unnamed_addr constant [16 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:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not5 = icmp slt i64 %0, 1
br i1 %cmp.not5, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.06 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %2, %1
%3 = load i64, ptr %c, align 8, !tbaa !5
%add2 = add nsw i64 %add, %3
%div = sdiv i64 %add2, 2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
%inc = add nuw nsw i64 %i.06, 1
%4 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.06, %4
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 8, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int i, j, temp;
int arr[3] = { 1,0,0 };
char ch1, ch2;
while (scanf("%c,%c", &ch1, &ch2) != EOF)
{
switch (ch1)
{
case 'A':i = 0; break;
case 'B':i = 1; break;
case 'C':i = 2; break;
default:break;
}
switch (ch2)
{
case 'A':j = 0; break;
case 'B':j = 1; break;
case 'C':j = 2; break;
default:break;
}
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
i = j = ch1 = ch2 = 0;
}
if (arr[0])
{
printf("A\n");
}
else if (arr[1])
{
printf("B\n");
}
else
{
printf("C\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157071/source.c"
target datalayout = "e-m:e-p270: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.arr = private unnamed_addr constant [3 x i32] [i32 1, i32 0, i32 0], align 4
@.str = private unnamed_addr constant [6 x i8] c"%c,%c\00", align 1
@str = private unnamed_addr constant [2 x i8] c"C\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"B\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%arr = alloca [3 x i32], align 4
%ch1 = alloca i8, align 1
%ch2 = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %arr) #5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arr, ptr noundef nonnull align 4 dereferenceable(12) @__const.main.arr, i64 12, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch1) #5
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch2) #5
%call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch1, ptr noundef nonnull %ch2)
%cmp.not35 = icmp eq i32 %call34, -1
br i1 %cmp.not35, label %if.end23, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i8, ptr %ch1, align 1, !tbaa !5
%switch.selectcmp = icmp eq i8 %0, 66
%switch.select = zext i1 %switch.selectcmp to i64
%switch.selectcmp28 = icmp eq i8 %0, 67
%switch.select29 = select i1 %switch.selectcmp28, i64 2, i64 %switch.select
%1 = load i8, ptr %ch2, align 1, !tbaa !5
%switch.selectcmp30 = icmp eq i8 %1, 66
%switch.select31 = zext i1 %switch.selectcmp30 to i64
%switch.selectcmp32 = icmp eq i8 %1, 67
%switch.select33 = select i1 %switch.selectcmp32, i64 2, i64 %switch.select31
%arrayidx = getelementptr inbounds [3 x i32], ptr %arr, i64 0, i64 %switch.select29
%2 = load i32, ptr %arrayidx, align 4, !tbaa !8
%arrayidx10 = getelementptr inbounds [3 x i32], ptr %arr, i64 0, i64 %switch.select33
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !8
store i32 %3, ptr %arrayidx, align 4, !tbaa !8
store i32 %2, ptr %arrayidx10, align 4, !tbaa !8
store i8 0, ptr %ch2, align 1, !tbaa !5
store i8 0, ptr %ch1, align 1, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch1, ptr noundef nonnull %ch2)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10
while.end: ; preds = %while.body
%.pre = load i32, ptr %arr, align 4, !tbaa !8
%4 = icmp eq i32 %.pre, 0
br i1 %4, label %if.else, label %if.end23
if.else: ; preds = %while.end
%arrayidx17 = getelementptr inbounds [3 x i32], ptr %arr, i64 0, i64 1
%5 = load i32, ptr %arrayidx17, align 4, !tbaa !8
%tobool18.not = icmp eq i32 %5, 0
%str.str.4 = select i1 %tobool18.not, ptr @str, ptr @str.4
br label %if.end23
if.end23: ; preds = %if.else, %while.end, %entry
%str.4.sink = phi ptr [ @str.5, %entry ], [ @str.5, %while.end ], [ %str.str.4, %if.else ]
%puts26 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch2) #5
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch1) #5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %arr) #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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
char s[1];
scanf("%s",s);
if(*s=='A')
puts("T");
else if(*s=='T')
puts("A");
else if(*s=='C')
puts("G");
else if(*s=='G')
puts("C");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157114/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157114/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c"T\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"G\00", align 1
@.str.4 = private unnamed_addr constant [2 x i8] c"C\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1 x i8], align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
switch i8 %0, label %if.end26 [
i8 65, label %if.end26.sink.split
i8 84, label %if.then8
i8 67, label %if.then15
i8 71, label %if.then22
]
if.then8: ; preds = %entry
br label %if.end26.sink.split
if.then15: ; preds = %entry
br label %if.end26.sink.split
if.then22: ; preds = %entry
br label %if.end26.sink.split
if.end26.sink.split: ; preds = %entry, %if.then15, %if.then22, %if.then8
%.str.2.sink = phi ptr [ @.str.2, %if.then8 ], [ @.str.4, %if.then22 ], [ @.str.3, %if.then15 ], [ @.str.1, %entry ]
%call9 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
br label %if.end26
if.end26: ; preds = %if.end26.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
char s;
scanf("%c", &s);
switch (s) {
case 'A':
printf("T");
break;
case 'C':
printf("G");
break;
case 'G':
printf("C");
break;
case 'T':
printf("A");
break;
default:
break;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157158/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157158/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%conv = sext i8 %0 to i32
switch i32 %conv, label %sw.epilog [
i32 65, label %sw.epilog.sink.split
i32 67, label %sw.bb2
i32 71, label %sw.bb4
i32 84, label %sw.bb6
]
sw.bb2: ; preds = %entry
br label %sw.epilog.sink.split
sw.bb4: ; preds = %entry
br label %sw.epilog.sink.split
sw.bb6: ; preds = %entry
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %entry, %sw.bb2, %sw.bb4, %sw.bb6
%.sink = phi i32 [ 65, %sw.bb6 ], [ 67, %sw.bb4 ], [ 71, %sw.bb2 ], [ 84, %entry ]
%putchar = call i32 @putchar(i32 %.sink)
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
char b;
do {
scanf("%c", &b);
} while (b != 'A' && b != 'C' && b != 'G' && b != 'T');
if (b == 'A') {
printf("%c\n", 'T');
} else if (b == 'C') {
printf("%c\n", 'G');
} else if (b == 'G') {
printf("%c\n", 'C');
} else if (b == 'T') {
printf("%c\n", 'A');
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157200/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157200/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #3
br label %do.body
do.body: ; preds = %do.body, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %b, align 1
switch i8 %0, label %do.body [
i8 65, label %if.end35.loopexit
i8 67, label %if.end35.loopexit38
i8 71, label %if.end35
i8 84, label %if.then31
]
if.then31: ; preds = %do.body
br label %if.end35
if.end35.loopexit: ; preds = %do.body
br label %if.end35
if.end35.loopexit38: ; preds = %do.body
br label %if.end35
if.end35: ; preds = %do.body, %if.end35.loopexit38, %if.end35.loopexit, %if.then31
%.sink = phi i32 [ 65, %if.then31 ], [ 84, %if.end35.loopexit ], [ 71, %if.end35.loopexit38 ], [ 67, %do.body ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #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)
{
char str[2];
scanf("%s", str);
if(str[0]=='A') printf("T");
if(str[0]=='C')printf("G");
if(str[0]=='G')printf("C");
if(str[0]=='T')printf("A");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157259/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157259/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%str = alloca [2 x i8], align 1
call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%0 = load i8, ptr %str, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 65
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 84)
%.pr = load i8, ptr %str, align 1, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i8 [ %.pr, %if.then ], [ %0, %entry ]
%cmp5 = icmp eq i8 %1, 67
br i1 %cmp5, label %if.then7, label %if.end9
if.then7: ; preds = %if.end
%putchar24 = call i32 @putchar(i32 71)
%.pre = load i8, ptr %str, align 1, !tbaa !5
br label %if.end9
if.end9: ; preds = %if.then7, %if.end
%2 = phi i8 [ %.pre, %if.then7 ], [ %1, %if.end ]
%cmp12 = icmp eq i8 %2, 71
br i1 %cmp12, label %if.then14, label %if.end16
if.then14: ; preds = %if.end9
%putchar25 = call i32 @putchar(i32 67)
%.pr27 = load i8, ptr %str, align 1, !tbaa !5
br label %if.end16
if.end16: ; preds = %if.then14, %if.end9
%3 = phi i8 [ %.pr27, %if.then14 ], [ %2, %if.end9 ]
%cmp19 = icmp eq i8 %3, 84
br i1 %cmp19, label %if.then21, label %if.end23
if.then21: ; preds = %if.end16
%putchar26 = call i32 @putchar(i32 65)
br label %if.end23
if.end23: ; preds = %if.then21, %if.end16
call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
char s;
scanf("%c", &s);
if(s == 'A')printf("T\n");
else if(s == 'T')printf("A\n");
else if(s == 'C')printf("G\n");
else if(s == 'G')printf("C\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157309/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157309/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [2 x i8] c"C\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"G\00", align 1
@str.6 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@str.7 = private unnamed_addr constant [2 x i8] c"T\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
switch i8 %0, label %if.end22 [
i8 65, label %if.end22.sink.split
i8 84, label %if.then6
i8 67, label %if.then12
i8 71, label %if.then18
]
if.then6: ; preds = %entry
br label %if.end22.sink.split
if.then12: ; preds = %entry
br label %if.end22.sink.split
if.then18: ; preds = %entry
br label %if.end22.sink.split
if.end22.sink.split: ; preds = %entry, %if.then12, %if.then18, %if.then6
%str.6.sink = phi ptr [ @str.6, %if.then6 ], [ @str, %if.then18 ], [ @str.5, %if.then12 ], [ @str.7, %entry ]
%puts24 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
br label %if.end22
if.end22: ; preds = %if.end22.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main (void)
{
char b;
scanf("%s",&b);
if (b=='A') printf("T\n");
else if (b=='T') printf("A\n");
else if (b=='C') printf("G\n");
else if (b=='G') printf("C\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157352/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157352/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"C\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"G\00", align 1
@str.6 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@str.7 = private unnamed_addr constant [2 x i8] c"T\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %b, align 1, !tbaa !5
switch i8 %0, label %if.end22 [
i8 65, label %if.end22.sink.split
i8 84, label %if.then6
i8 67, label %if.then12
i8 71, label %if.then18
]
if.then6: ; preds = %entry
br label %if.end22.sink.split
if.then12: ; preds = %entry
br label %if.end22.sink.split
if.then18: ; preds = %entry
br label %if.end22.sink.split
if.end22.sink.split: ; preds = %entry, %if.then12, %if.then18, %if.then6
%str.6.sink = phi ptr [ @str.6, %if.then6 ], [ @str, %if.then18 ], [ @str.5, %if.then12 ], [ @str.7, %entry ]
%puts24 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
br label %if.end22
if.end22: ; preds = %if.end22.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main() {
char a[1];
scanf("%s", a);
if (strcmp(a, "A") == 0 ) {
printf("T");
} else if (strcmp(a, "C") == 0) {
printf("G");
} else if (strcmp(a, "G") == 0) {
printf("C");
} else {
printf("A");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157396/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157396/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"C\00", align 1
@.str.4 = private unnamed_addr constant [2 x i8] c"G\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [1 x i8], align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call2 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(2) @.str.1) #6
%cmp = icmp eq i32 %call2, 0
br i1 %cmp, label %if.end18, label %if.else
if.else: ; preds = %entry
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(2) @.str.3) #6
%cmp6 = icmp eq i32 %call5, 0
br i1 %cmp6, label %if.end18, label %if.else9
if.else9: ; preds = %if.else
%call11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(2) @.str.4) #6
%cmp12 = icmp eq i32 %call11, 0
%. = select i1 %cmp12, i32 67, i32 65
br label %if.end18
if.end18: ; preds = %if.else9, %if.else, %entry
%.sink = phi i32 [ 84, %entry ], [ 71, %if.else ], [ %., %if.else9 ]
%putchar20 = call i32 @putchar(i32 %.sink)
call void @llvm.lifetime.end.p0(i64 1, 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(void){
char b;
scanf("%c",&b);
if(b == 'A')printf("T\n");
if(b == 'C')printf("G\n");
if(b == 'T')printf("A\n");
if(b == 'G')printf("C\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157446/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157446/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [2 x i8] c"T\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"G\00", align 1
@str.6 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@str.7 = private unnamed_addr constant [2 x i8] c"C\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %b, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 65
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pr = load i8, ptr %b, align 1, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i8 [ %.pr, %if.then ], [ %0, %entry ]
%cmp4 = icmp eq i8 %1, 67
br i1 %cmp4, label %if.then6, label %if.end8
if.then6: ; preds = %if.end
%puts21 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
%.pre = load i8, ptr %b, align 1, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then6, %if.end
%2 = phi i8 [ %.pre, %if.then6 ], [ %1, %if.end ]
%cmp10 = icmp eq i8 %2, 84
br i1 %cmp10, label %if.then12, label %if.end14
if.then12: ; preds = %if.end8
%puts22 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
%.pr24 = load i8, ptr %b, align 1, !tbaa !5
br label %if.end14
if.end14: ; preds = %if.then12, %if.end8
%3 = phi i8 [ %.pr24, %if.then12 ], [ %2, %if.end8 ]
%cmp16 = icmp eq i8 %3, 71
br i1 %cmp16, label %if.then18, label %if.end20
if.then18: ; preds = %if.end14
%puts23 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
br label %if.end20
if.end20: ; preds = %if.then18, %if.end14
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x1,y1;
int x2,y2;
scanf("%d %d",&x1,&y1);
scanf("%d %d",&x2,&y2);
int x=abs(x2-x1);
int y=abs(y2-y1);
if(x>y)
printf("%d",x);
else
printf("%d",y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15749/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15749/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca i32, align 4
%y1 = alloca i32, align 4
%x2 = alloca i32, align 4
%y2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x2, ptr noundef nonnull %y2)
%0 = load i32, ptr %x2, align 4, !tbaa !5
%1 = load i32, ptr %x1, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%3 = load i32, ptr %y2, align 4, !tbaa !5
%4 = load i32, ptr %y1, align 4, !tbaa !5
%sub2 = sub nsw i32 %3, %4
%5 = call i32 @llvm.abs.i32(i32 %sub2, i1 true)
%. = call i32 @llvm.umax.i32(i32 %2, i32 %5)
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
unsigned long long int sum=0;
int a,f,b,dif,i,temp;
scanf("%d %d",&a,&b);
dif=b-a;
for(i=0;i<=dif;i++)
{
f=a;
while(f!=0)
{
temp=f%10;
if(0==temp)
sum=sum+6;
if(1==temp)
sum=sum+2;
if(2==temp)
sum=sum+5;
if(3==temp)
sum=sum+5;
if(4==temp)
sum=sum+4;
if(5==temp)
sum=sum+5;
if(6==temp)
sum=sum+6;
if(7==temp)
sum=sum+3;
if(8==temp)
sum=sum+7;
if(9==temp)
sum=sum+6;
f=f/10;
}
a++;
}
printf("%llu",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15754/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15754/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%llu\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 %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not67 = icmp slt i32 %0, %1
br i1 %cmp.not67, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%2 = add i32 %0, 1
%3 = sub i32 %2, %1
br label %for.body
for.body: ; preds = %for.body.preheader, %while.end
%sum.070 = phi i64 [ %sum.1.lcssa, %while.end ], [ 0, %for.body.preheader ]
%i.069 = phi i32 [ %inc39, %while.end ], [ 0, %for.body.preheader ]
%inc6668 = phi i32 [ %inc, %while.end ], [ %1, %for.body.preheader ]
%cmp1.not63 = icmp eq i32 %inc6668, 0
br i1 %cmp1.not63, label %while.end, label %while.body
while.body: ; preds = %for.body, %while.body
%sum.165 = phi i64 [ %sum.11, %while.body ], [ %sum.070, %for.body ]
%f.064 = phi i32 [ %div, %while.body ], [ %inc6668, %for.body ]
%rem = srem i32 %f.064, 10
%cmp2 = icmp eq i32 %rem, 0
%add = add i64 %sum.165, 6
%spec.select = select i1 %cmp2, i64 %add, i64 %sum.165
%cmp3 = icmp eq i32 %rem, 1
%add5 = add i64 %spec.select, 2
%sum.3 = select i1 %cmp3, i64 %add5, i64 %spec.select
%cmp7 = icmp eq i32 %rem, 2
%add9 = add i64 %sum.3, 5
%sum.4 = select i1 %cmp7, i64 %add9, i64 %sum.3
%cmp11 = icmp eq i32 %rem, 3
%add13 = add i64 %sum.4, 5
%sum.5 = select i1 %cmp11, i64 %add13, i64 %sum.4
%cmp15 = icmp eq i32 %rem, 4
%add17 = add i64 %sum.5, 4
%sum.6 = select i1 %cmp15, i64 %add17, i64 %sum.5
%cmp19 = icmp eq i32 %rem, 5
%add21 = add i64 %sum.6, 5
%sum.7 = select i1 %cmp19, i64 %add21, i64 %sum.6
%cmp23 = icmp eq i32 %rem, 6
%add25 = add i64 %sum.7, 6
%sum.8 = select i1 %cmp23, i64 %add25, i64 %sum.7
%cmp27 = icmp eq i32 %rem, 7
%add29 = add i64 %sum.8, 3
%sum.9 = select i1 %cmp27, i64 %add29, i64 %sum.8
%cmp31 = icmp eq i32 %rem, 8
%add33 = add i64 %sum.9, 7
%sum.10 = select i1 %cmp31, i64 %add33, i64 %sum.9
%cmp35 = icmp eq i32 %rem, 9
%add37 = add i64 %sum.10, 6
%sum.11 = select i1 %cmp35, i64 %add37, i64 %sum.10
%div = sdiv i32 %f.064, 10
%f.064.off = add i32 %f.064, 9
%cmp1.not = icmp ult i32 %f.064.off, 19
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %for.body
%sum.1.lcssa = phi i64 [ %sum.070, %for.body ], [ %sum.11, %while.body ]
%inc = add nsw i32 %inc6668, 1
%inc39 = add nuw i32 %i.069, 1
%exitcond.not = icmp eq i32 %inc39, %3
br i1 %exitcond.not, label %for.cond.for.end_crit_edge, label %for.body, !llvm.loop !11
for.cond.for.end_crit_edge: ; preds = %while.end
store i32 %2, ptr %a, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %entry
%sum.0.lcssa = phi i64 [ %sum.1.lcssa, %for.cond.for.end_crit_edge ], [ 0, %entry ]
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int N, K, A[200200];
int main(){
scanf("%d%d", &N, &K);
for(int i=0; i<N; i++){
scanf("%d", A+i);
}
int l=0, r=1<<30;
while(r-l > 1){
int mid = (l+r)/2;
int cnt = 0;
for(int i=0; i<N; i++){
cnt += (A[i]+mid-1)/mid-1;
}
if(cnt > K)l = mid;
else r = mid;
}
printf("%d\n", r);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157583/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157583/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@N = dso_local global i32 0, align 4
@K = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@A = dso_local global [200200 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @K)
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp29 = icmp sgt i32 %0, 0
br i1 %cmp29, label %for.body, label %while.cond.preheader.thread
while.cond.preheader.thread: ; preds = %entry
%1 = load i32, ptr @K, align 4, !tbaa !5
%.fr57 = freeze i32 %1
br label %while.cond.preheader.split
while.cond.preheader: ; preds = %for.body
%cmp531 = icmp sgt i32 %7, 0
%2 = load i32, ptr @K, align 4, !tbaa !5
%.fr = freeze i32 %2
br i1 %cmp531, label %while.body.us.preheader, label %while.cond.preheader.split
while.body.us.preheader: ; preds = %while.cond.preheader
%wide.trip.count = zext i32 %7 to i64
%xtraiter = and i64 %wide.trip.count, 1
%3 = icmp eq i32 %7, 1
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %while.body.us
while.body.us: ; preds = %while.body.us.preheader, %for.cond4.for.cond.cleanup6_crit_edge.us
%r.036.us = phi i32 [ %r.0.div.us, %for.cond4.for.cond.cleanup6_crit_edge.us ], [ 1073741824, %while.body.us.preheader ]
%l.035.us = phi i32 [ %div.l.0.us, %for.cond4.for.cond.cleanup6_crit_edge.us ], [ 0, %while.body.us.preheader ]
%add.us = add nsw i32 %r.036.us, %l.035.us
%div.us = sdiv i32 %add.us, 2
%add8.us = add nsw i32 %div.us, -1
br i1 %3, label %for.cond4.for.cond.cleanup6_crit_edge.us.unr-lcssa, label %for.body7.us
for.body7.us: ; preds = %while.body.us, %for.body7.us
%indvars.iv52 = phi i64 [ %indvars.iv.next53.1, %for.body7.us ], [ 0, %while.body.us ]
%cnt.032.us = phi i32 [ %add12.us.1, %for.body7.us ], [ 0, %while.body.us ]
%niter = phi i64 [ %niter.next.1, %for.body7.us ], [ 0, %while.body.us ]
%arrayidx.us = getelementptr inbounds [200200 x i32], ptr @A, i64 0, i64 %indvars.iv52
%4 = load i32, ptr %arrayidx.us, align 8, !tbaa !5
%sub9.us = add i32 %add8.us, %4
%div10.us = sdiv i32 %sub9.us, %div.us
%sub11.us = add i32 %cnt.032.us, -1
%add12.us = add i32 %sub11.us, %div10.us
%indvars.iv.next53 = or i64 %indvars.iv52, 1
%arrayidx.us.1 = getelementptr inbounds [200200 x i32], ptr @A, i64 0, i64 %indvars.iv.next53
%5 = load i32, ptr %arrayidx.us.1, align 4, !tbaa !5
%sub9.us.1 = add i32 %add8.us, %5
%div10.us.1 = sdiv i32 %sub9.us.1, %div.us
%sub11.us.1 = add i32 %add12.us, -1
%add12.us.1 = add i32 %sub11.us.1, %div10.us.1
%indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 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.cond4.for.cond.cleanup6_crit_edge.us.unr-lcssa, label %for.body7.us, !llvm.loop !9
for.cond4.for.cond.cleanup6_crit_edge.us.unr-lcssa: ; preds = %for.body7.us, %while.body.us
%add12.us.lcssa.ph = phi i32 [ undef, %while.body.us ], [ %add12.us.1, %for.body7.us ]
%indvars.iv52.unr = phi i64 [ 0, %while.body.us ], [ %indvars.iv.next53.1, %for.body7.us ]
%cnt.032.us.unr = phi i32 [ 0, %while.body.us ], [ %add12.us.1, %for.body7.us ]
br i1 %lcmp.mod.not, label %for.cond4.for.cond.cleanup6_crit_edge.us, label %for.body7.us.epil
for.body7.us.epil: ; preds = %for.cond4.for.cond.cleanup6_crit_edge.us.unr-lcssa
%arrayidx.us.epil = getelementptr inbounds [200200 x i32], ptr @A, i64 0, i64 %indvars.iv52.unr
%6 = load i32, ptr %arrayidx.us.epil, align 4, !tbaa !5
%sub9.us.epil = add i32 %add8.us, %6
%div10.us.epil = sdiv i32 %sub9.us.epil, %div.us
%sub11.us.epil = add i32 %cnt.032.us.unr, -1
%add12.us.epil = add i32 %sub11.us.epil, %div10.us.epil
br label %for.cond4.for.cond.cleanup6_crit_edge.us
for.cond4.for.cond.cleanup6_crit_edge.us: ; preds = %for.cond4.for.cond.cleanup6_crit_edge.us.unr-lcssa, %for.body7.us.epil
%add12.us.lcssa = phi i32 [ %add12.us.lcssa.ph, %for.cond4.for.cond.cleanup6_crit_edge.us.unr-lcssa ], [ %add12.us.epil, %for.body7.us.epil ]
%cmp16.us = icmp sgt i32 %add12.us.lcssa, %.fr
%div.l.0.us = select i1 %cmp16.us, i32 %div.us, i32 %l.035.us
%r.0.div.us = select i1 %cmp16.us, i32 %r.036.us, i32 %div.us
%sub.us = sub nsw i32 %r.0.div.us, %div.l.0.us
%cmp2.us = icmp sgt i32 %sub.us, 1
br i1 %cmp2.us, label %while.body.us, label %while.end, !llvm.loop !11
while.cond.preheader.split: ; preds = %while.cond.preheader.thread, %while.cond.preheader
%.fr58 = phi i32 [ %.fr57, %while.cond.preheader.thread ], [ %.fr, %while.cond.preheader ]
%cmp16 = icmp slt i32 %.fr58, 0
%spec.select = select i1 %cmp16, i32 1073741824, i32 1
br label %while.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr @A, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr @N, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !12
while.end: ; preds = %for.cond4.for.cond.cleanup6_crit_edge.us, %while.cond.preheader.split
%.us-phi = phi i32 [ %spec.select, %while.cond.preheader.split ], [ %r.0.div.us, %for.cond4.for.cond.cleanup6_crit_edge.us ]
%call17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#define GYOU_MAX 256
void sort_string(char Text[], int size, int sign) {
char a;
for (int i = 0; i < size - 1; i++) {
for (int j = 0; j < size - 1 - i; j++) {
if (sign > 0) {
if (Text[j] > Text[j + 1]) {
a = Text[j];
Text[j] = Text[j + 1];
Text[j + 1] = a;
}
}
else {
if (Text[j] < Text[j + 1]) {
a = Text[j];
Text[j] = Text[j + 1];
Text[j + 1] = a;
}
}
}
}
}
int main(void){
char s[101], t[101];
scanf("%s%s", s, t);
sort_string(s, strlen(s),1);
sort_string(t, strlen(t), 0);
if (strcmp(s, t) < 0) {
printf("Yes\n");
}
else {
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157640/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157640/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_string(ptr nocapture noundef %Text, i32 noundef %size, i32 noundef %sign) local_unnamed_addr #0 {
entry:
%sub = add i32 %size, -1
%cmp79 = icmp sgt i32 %size, 1
br i1 %cmp79, label %for.cond1.preheader.lr.ph, label %for.cond.cleanup
for.cond1.preheader.lr.ph: ; preds = %entry
%cmp7 = icmp sgt i32 %sign, 0
br i1 %cmp7, label %for.cond1.preheader.us.preheader, label %for.cond1.preheader.preheader
for.cond1.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph
%invariant.gep = getelementptr i8, ptr %Text, i64 1
br label %for.cond1.preheader
for.cond1.preheader.us.preheader: ; preds = %for.cond1.preheader.lr.ph
%invariant.gep104 = getelementptr i8, ptr %Text, i64 1
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond.cleanup5.us
%indvars.iv89 = phi i32 [ %indvars.iv.next90, %for.cond.cleanup5.us ], [ %sub, %for.cond1.preheader.us.preheader ]
%i.080.us = phi i32 [ %inc47.us, %for.cond.cleanup5.us ], [ 0, %for.cond1.preheader.us.preheader ]
%0 = zext i32 %indvars.iv89 to i64
%cmp477.us = icmp sgt i32 %sub, %i.080.us
br i1 %cmp477.us, label %for.body6.us.us.preheader, label %for.cond.cleanup5.us
for.body6.us.us.preheader: ; preds = %for.cond1.preheader.us
%.pre94 = load i8, ptr %Text, align 1, !tbaa !5
%xtraiter98 = and i64 %0, 1
%1 = icmp eq i32 %indvars.iv89, 1
br i1 %1, label %for.cond.cleanup5.us.loopexit.unr-lcssa, label %for.body6.us.us.preheader.new
for.body6.us.us.preheader.new: ; preds = %for.body6.us.us.preheader
%unroll_iter101 = and i64 %0, 4294967294
br label %for.body6.us.us
for.cond.cleanup5.us.loopexit.unr-lcssa: ; preds = %for.inc.us.us.1, %for.body6.us.us.preheader
%.unr99 = phi i8 [ %.pre94, %for.body6.us.us.preheader ], [ %7, %for.inc.us.us.1 ]
%indvars.iv86.unr = phi i64 [ 0, %for.body6.us.us.preheader ], [ %indvars.iv.next87.1, %for.inc.us.us.1 ]
%lcmp.mod100.not = icmp eq i64 %xtraiter98, 0
br i1 %lcmp.mod100.not, label %for.cond.cleanup5.us, label %for.body6.us.us.epil
for.body6.us.us.epil: ; preds = %for.cond.cleanup5.us.loopexit.unr-lcssa
%gep105 = getelementptr i8, ptr %invariant.gep104, i64 %indvars.iv86.unr
%2 = load i8, ptr %gep105, align 1, !tbaa !5
%cmp11.us.us.epil = icmp sgt i8 %.unr99, %2
br i1 %cmp11.us.us.epil, label %if.then13.us.us.epil, label %for.cond.cleanup5.us
if.then13.us.us.epil: ; preds = %for.body6.us.us.epil
%arrayidx.us.us.epil = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv86.unr
store i8 %2, ptr %arrayidx.us.us.epil, align 1, !tbaa !5
store i8 %.unr99, ptr %gep105, align 1, !tbaa !5
br label %for.cond.cleanup5.us
for.cond.cleanup5.us: ; preds = %for.cond.cleanup5.us.loopexit.unr-lcssa, %if.then13.us.us.epil, %for.body6.us.us.epil, %for.cond1.preheader.us
%inc47.us = add nuw nsw i32 %i.080.us, 1
%indvars.iv.next90 = add i32 %indvars.iv89, -1
%exitcond93.not = icmp eq i32 %inc47.us, %sub
br i1 %exitcond93.not, label %for.cond.cleanup, label %for.cond1.preheader.us, !llvm.loop !8
for.body6.us.us: ; preds = %for.inc.us.us.1, %for.body6.us.us.preheader.new
%3 = phi i8 [ %.pre94, %for.body6.us.us.preheader.new ], [ %7, %for.inc.us.us.1 ]
%indvars.iv86 = phi i64 [ 0, %for.body6.us.us.preheader.new ], [ %indvars.iv.next87.1, %for.inc.us.us.1 ]
%niter102 = phi i64 [ 0, %for.body6.us.us.preheader.new ], [ %niter102.next.1, %for.inc.us.us.1 ]
%indvars.iv.next87 = or i64 %indvars.iv86, 1
%arrayidx9.us.us = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv.next87
%4 = load i8, ptr %arrayidx9.us.us, align 1, !tbaa !5
%cmp11.us.us = icmp sgt i8 %3, %4
br i1 %cmp11.us.us, label %if.then13.us.us, label %for.inc.us.us
if.then13.us.us: ; preds = %for.body6.us.us
%arrayidx.us.us = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv86
store i8 %4, ptr %arrayidx.us.us, align 1, !tbaa !5
store i8 %3, ptr %arrayidx9.us.us, align 1, !tbaa !5
br label %for.inc.us.us
for.inc.us.us: ; preds = %if.then13.us.us, %for.body6.us.us
%5 = phi i8 [ %3, %if.then13.us.us ], [ %4, %for.body6.us.us ]
%indvars.iv.next87.1 = add nuw nsw i64 %indvars.iv86, 2
%arrayidx9.us.us.1 = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv.next87.1
%6 = load i8, ptr %arrayidx9.us.us.1, align 1, !tbaa !5
%cmp11.us.us.1 = icmp sgt i8 %5, %6
br i1 %cmp11.us.us.1, label %if.then13.us.us.1, label %for.inc.us.us.1
if.then13.us.us.1: ; preds = %for.inc.us.us
%arrayidx.us.us.1 = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv.next87
store i8 %6, ptr %arrayidx.us.us.1, align 1, !tbaa !5
store i8 %5, ptr %arrayidx9.us.us.1, align 1, !tbaa !5
br label %for.inc.us.us.1
for.inc.us.us.1: ; preds = %if.then13.us.us.1, %for.inc.us.us
%7 = phi i8 [ %5, %if.then13.us.us.1 ], [ %6, %for.inc.us.us ]
%niter102.next.1 = add i64 %niter102, 2
%niter102.ncmp.1 = icmp eq i64 %niter102.next.1, %unroll_iter101
br i1 %niter102.ncmp.1, label %for.cond.cleanup5.us.loopexit.unr-lcssa, label %for.body6.us.us, !llvm.loop !10
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond.cleanup5
%indvars.iv83 = phi i32 [ %indvars.iv.next84, %for.cond.cleanup5 ], [ %sub, %for.cond1.preheader.preheader ]
%i.080 = phi i32 [ %inc47, %for.cond.cleanup5 ], [ 0, %for.cond1.preheader.preheader ]
%8 = zext i32 %indvars.iv83 to i64
%cmp477 = icmp sgt i32 %sub, %i.080
br i1 %cmp477, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond1.preheader
%.pre = load i8, ptr %Text, align 1, !tbaa !5
%xtraiter = and i64 %8, 1
%9 = icmp eq i32 %indvars.iv83, 1
br i1 %9, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %8, 4294967294
br label %for.body6
for.cond.cleanup: ; preds = %for.cond.cleanup5, %for.cond.cleanup5.us, %entry
ret void
for.cond.cleanup5.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body6.preheader
%.unr = phi i8 [ %.pre, %for.body6.preheader ], [ %15, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup5, label %for.body6.epil
for.body6.epil: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.unr
%10 = load i8, ptr %gep, align 1, !tbaa !5
%cmp31.epil = icmp slt i8 %.unr, %10
br i1 %cmp31.epil, label %if.then33.epil, label %for.cond.cleanup5
if.then33.epil: ; preds = %for.body6.epil
%arrayidx25.epil = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv.unr
store i8 %10, ptr %arrayidx25.epil, align 1, !tbaa !5
store i8 %.unr, ptr %gep, align 1, !tbaa !5
br label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa, %if.then33.epil, %for.body6.epil, %for.cond1.preheader
%inc47 = add nuw nsw i32 %i.080, 1
%indvars.iv.next84 = add i32 %indvars.iv83, -1
%exitcond85.not = icmp eq i32 %inc47, %sub
br i1 %exitcond85.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !8
for.body6: ; preds = %for.inc.1, %for.body6.preheader.new
%11 = phi i8 [ %.pre, %for.body6.preheader.new ], [ %15, %for.inc.1 ]
%indvars.iv = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx29 = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv.next
%12 = load i8, ptr %arrayidx29, align 1, !tbaa !5
%cmp31 = icmp slt i8 %11, %12
br i1 %cmp31, label %if.then33, label %for.inc
if.then33: ; preds = %for.body6
%arrayidx25 = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv
store i8 %12, ptr %arrayidx25, align 1, !tbaa !5
store i8 %11, ptr %arrayidx29, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then33, %for.body6
%13 = phi i8 [ %11, %if.then33 ], [ %12, %for.body6 ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx29.1 = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv.next.1
%14 = load i8, ptr %arrayidx29.1, align 1, !tbaa !5
%cmp31.1 = icmp slt i8 %13, %14
br i1 %cmp31.1, label %if.then33.1, label %for.inc.1
if.then33.1: ; preds = %for.inc
%arrayidx25.1 = getelementptr inbounds i8, ptr %Text, i64 %indvars.iv.next
store i8 %14, ptr %arrayidx25.1, align 1, !tbaa !5
store i8 %13, ptr %arrayidx29.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then33.1, %for.inc
%15 = phi i8 [ %13, %if.then33.1 ], [ %14, %for.inc ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6, !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 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:
%s = alloca [101 x i8], align 16
%t = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7
%conv = trunc i64 %call4 to i32
%sub.i = add i32 %conv, -1
%cmp79.i = icmp sgt i32 %conv, 1
br i1 %cmp79.i, label %for.cond1.preheader.us.i.preheader, label %sort_string.exit
for.cond1.preheader.us.i.preheader: ; preds = %entry
%invariant.gep = getelementptr i8, ptr %s, i64 1
br label %for.cond1.preheader.us.i
for.cond1.preheader.us.i: ; preds = %for.cond1.preheader.us.i.preheader, %for.cond.cleanup5.us.i
%indvars.iv89.i = phi i32 [ %indvars.iv.next90.i, %for.cond.cleanup5.us.i ], [ %sub.i, %for.cond1.preheader.us.i.preheader ]
%i.080.us.i = phi i32 [ %inc47.us.i, %for.cond.cleanup5.us.i ], [ 0, %for.cond1.preheader.us.i.preheader ]
%0 = zext i32 %indvars.iv89.i to i64
%cmp477.us.i = icmp sgt i32 %sub.i, %i.080.us.i
br i1 %cmp477.us.i, label %for.body6.us.us.preheader.i, label %for.cond.cleanup5.us.i
for.body6.us.us.preheader.i: ; preds = %for.cond1.preheader.us.i
%.pre94.i = load i8, ptr %s, align 16, !tbaa !5
%xtraiter = and i64 %0, 1
%1 = icmp eq i32 %indvars.iv89.i, 1
br i1 %1, label %for.cond.cleanup5.us.i.loopexit.unr-lcssa, label %for.body6.us.us.preheader.i.new
for.body6.us.us.preheader.i.new: ; preds = %for.body6.us.us.preheader.i
%unroll_iter = and i64 %0, 4294967294
br label %for.body6.us.us.i
for.cond.cleanup5.us.i.loopexit.unr-lcssa: ; preds = %for.inc.us.us.i.1, %for.body6.us.us.preheader.i
%.unr = phi i8 [ %.pre94.i, %for.body6.us.us.preheader.i ], [ %7, %for.inc.us.us.i.1 ]
%indvars.iv86.i.unr = phi i64 [ 0, %for.body6.us.us.preheader.i ], [ %indvars.iv.next87.i.1, %for.inc.us.us.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup5.us.i, label %for.body6.us.us.i.epil
for.body6.us.us.i.epil: ; preds = %for.cond.cleanup5.us.i.loopexit.unr-lcssa
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv86.i.unr
%2 = load i8, ptr %gep, align 1, !tbaa !5
%cmp11.us.us.i.epil = icmp sgt i8 %.unr, %2
br i1 %cmp11.us.us.i.epil, label %if.then13.us.us.i.epil, label %for.cond.cleanup5.us.i
if.then13.us.us.i.epil: ; preds = %for.body6.us.us.i.epil
%arrayidx.us.us.i.epil = getelementptr inbounds i8, ptr %s, i64 %indvars.iv86.i.unr
store i8 %2, ptr %arrayidx.us.us.i.epil, align 1, !tbaa !5
store i8 %.unr, ptr %gep, align 1, !tbaa !5
br label %for.cond.cleanup5.us.i
for.cond.cleanup5.us.i: ; preds = %for.cond.cleanup5.us.i.loopexit.unr-lcssa, %if.then13.us.us.i.epil, %for.body6.us.us.i.epil, %for.cond1.preheader.us.i
%inc47.us.i = add nuw nsw i32 %i.080.us.i, 1
%indvars.iv.next90.i = add i32 %indvars.iv89.i, -1
%exitcond93.not.i = icmp eq i32 %inc47.us.i, %sub.i
br i1 %exitcond93.not.i, label %sort_string.exit, label %for.cond1.preheader.us.i, !llvm.loop !8
for.body6.us.us.i: ; preds = %for.inc.us.us.i.1, %for.body6.us.us.preheader.i.new
%3 = phi i8 [ %.pre94.i, %for.body6.us.us.preheader.i.new ], [ %7, %for.inc.us.us.i.1 ]
%indvars.iv86.i = phi i64 [ 0, %for.body6.us.us.preheader.i.new ], [ %indvars.iv.next87.i.1, %for.inc.us.us.i.1 ]
%niter = phi i64 [ 0, %for.body6.us.us.preheader.i.new ], [ %niter.next.1, %for.inc.us.us.i.1 ]
%indvars.iv.next87.i = or i64 %indvars.iv86.i, 1
%arrayidx9.us.us.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next87.i
%4 = load i8, ptr %arrayidx9.us.us.i, align 1, !tbaa !5
%cmp11.us.us.i = icmp sgt i8 %3, %4
br i1 %cmp11.us.us.i, label %if.then13.us.us.i, label %for.inc.us.us.i
if.then13.us.us.i: ; preds = %for.body6.us.us.i
%arrayidx.us.us.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv86.i
store i8 %4, ptr %arrayidx.us.us.i, align 2, !tbaa !5
store i8 %3, ptr %arrayidx9.us.us.i, align 1, !tbaa !5
br label %for.inc.us.us.i
for.inc.us.us.i: ; preds = %if.then13.us.us.i, %for.body6.us.us.i
%5 = phi i8 [ %3, %if.then13.us.us.i ], [ %4, %for.body6.us.us.i ]
%indvars.iv.next87.i.1 = add nuw nsw i64 %indvars.iv86.i, 2
%arrayidx9.us.us.i.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next87.i.1
%6 = load i8, ptr %arrayidx9.us.us.i.1, align 2, !tbaa !5
%cmp11.us.us.i.1 = icmp sgt i8 %5, %6
br i1 %cmp11.us.us.i.1, label %if.then13.us.us.i.1, label %for.inc.us.us.i.1
if.then13.us.us.i.1: ; preds = %for.inc.us.us.i
%arrayidx.us.us.i.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next87.i
store i8 %6, ptr %arrayidx.us.us.i.1, align 1, !tbaa !5
store i8 %5, ptr %arrayidx9.us.us.i.1, align 2, !tbaa !5
br label %for.inc.us.us.i.1
for.inc.us.us.i.1: ; preds = %if.then13.us.us.i.1, %for.inc.us.us.i
%7 = phi i8 [ %5, %if.then13.us.us.i.1 ], [ %6, %for.inc.us.us.i ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup5.us.i.loopexit.unr-lcssa, label %for.body6.us.us.i, !llvm.loop !10
sort_string.exit: ; preds = %for.cond.cleanup5.us.i, %entry
%call7 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #7
%conv8 = trunc i64 %call7 to i32
%sub.i16 = add i32 %conv8, -1
%cmp79.i17 = icmp sgt i32 %conv8, 1
br i1 %cmp79.i17, label %for.cond1.preheader.i.preheader, label %sort_string.exit19
for.cond1.preheader.i.preheader: ; preds = %sort_string.exit
%invariant.gep26 = getelementptr i8, ptr %t, i64 1
br label %for.cond1.preheader.i
for.cond1.preheader.i: ; preds = %for.cond1.preheader.i.preheader, %for.cond.cleanup5.i
%indvars.iv83.i = phi i32 [ %indvars.iv.next84.i, %for.cond.cleanup5.i ], [ %sub.i16, %for.cond1.preheader.i.preheader ]
%i.080.i = phi i32 [ %inc47.i, %for.cond.cleanup5.i ], [ 0, %for.cond1.preheader.i.preheader ]
%8 = zext i32 %indvars.iv83.i to i64
%cmp477.i = icmp sgt i32 %sub.i16, %i.080.i
br i1 %cmp477.i, label %for.body6.preheader.i, label %for.cond.cleanup5.i
for.body6.preheader.i: ; preds = %for.cond1.preheader.i
%.pre.i = load i8, ptr %t, align 16, !tbaa !5
%xtraiter20 = and i64 %8, 1
%9 = icmp eq i32 %indvars.iv83.i, 1
br i1 %9, label %for.cond.cleanup5.i.loopexit.unr-lcssa, label %for.body6.preheader.i.new
for.body6.preheader.i.new: ; preds = %for.body6.preheader.i
%unroll_iter23 = and i64 %8, 4294967294
br label %for.body6.i
for.cond.cleanup5.i.loopexit.unr-lcssa: ; preds = %for.inc.i.1, %for.body6.preheader.i
%.unr21 = phi i8 [ %.pre.i, %for.body6.preheader.i ], [ %15, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body6.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%lcmp.mod22.not = icmp eq i64 %xtraiter20, 0
br i1 %lcmp.mod22.not, label %for.cond.cleanup5.i, label %for.body6.i.epil
for.body6.i.epil: ; preds = %for.cond.cleanup5.i.loopexit.unr-lcssa
%gep27 = getelementptr i8, ptr %invariant.gep26, i64 %indvars.iv.i.unr
%10 = load i8, ptr %gep27, align 1, !tbaa !5
%cmp31.i.epil = icmp slt i8 %.unr21, %10
br i1 %cmp31.i.epil, label %if.then33.i.epil, label %for.cond.cleanup5.i
if.then33.i.epil: ; preds = %for.body6.i.epil
%arrayidx25.i.epil = getelementptr inbounds i8, ptr %t, i64 %indvars.iv.i.unr
store i8 %10, ptr %arrayidx25.i.epil, align 1, !tbaa !5
store i8 %.unr21, ptr %gep27, align 1, !tbaa !5
br label %for.cond.cleanup5.i
for.cond.cleanup5.i: ; preds = %for.cond.cleanup5.i.loopexit.unr-lcssa, %if.then33.i.epil, %for.body6.i.epil, %for.cond1.preheader.i
%inc47.i = add nuw nsw i32 %i.080.i, 1
%indvars.iv.next84.i = add i32 %indvars.iv83.i, -1
%exitcond85.not.i = icmp eq i32 %inc47.i, %sub.i16
br i1 %exitcond85.not.i, label %sort_string.exit19, label %for.cond1.preheader.i, !llvm.loop !8
for.body6.i: ; preds = %for.inc.i.1, %for.body6.preheader.i.new
%11 = phi i8 [ %.pre.i, %for.body6.preheader.i.new ], [ %15, %for.inc.i.1 ]
%indvars.iv.i = phi i64 [ 0, %for.body6.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%niter24 = phi i64 [ 0, %for.body6.preheader.i.new ], [ %niter24.next.1, %for.inc.i.1 ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx29.i = getelementptr inbounds i8, ptr %t, i64 %indvars.iv.next.i
%12 = load i8, ptr %arrayidx29.i, align 1, !tbaa !5
%cmp31.i = icmp slt i8 %11, %12
br i1 %cmp31.i, label %if.then33.i, label %for.inc.i
if.then33.i: ; preds = %for.body6.i
%arrayidx25.i = getelementptr inbounds i8, ptr %t, i64 %indvars.iv.i
store i8 %12, ptr %arrayidx25.i, align 2, !tbaa !5
store i8 %11, ptr %arrayidx29.i, align 1, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then33.i, %for.body6.i
%13 = phi i8 [ %11, %if.then33.i ], [ %12, %for.body6.i ]
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx29.i.1 = getelementptr inbounds i8, ptr %t, i64 %indvars.iv.next.i.1
%14 = load i8, ptr %arrayidx29.i.1, align 2, !tbaa !5
%cmp31.i.1 = icmp slt i8 %13, %14
br i1 %cmp31.i.1, label %if.then33.i.1, label %for.inc.i.1
if.then33.i.1: ; preds = %for.inc.i
%arrayidx25.i.1 = getelementptr inbounds i8, ptr %t, i64 %indvars.iv.next.i
store i8 %14, ptr %arrayidx25.i.1, align 1, !tbaa !5
store i8 %13, ptr %arrayidx29.i.1, align 2, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then33.i.1, %for.inc.i
%15 = phi i8 [ %13, %if.then33.i.1 ], [ %14, %for.inc.i ]
%niter24.next.1 = add i64 %niter24, 2
%niter24.ncmp.1 = icmp eq i64 %niter24.next.1, %unroll_iter23
br i1 %niter24.ncmp.1, label %for.cond.cleanup5.i.loopexit.unr-lcssa, label %for.body6.i, !llvm.loop !10
sort_string.exit19: ; preds = %for.cond.cleanup5.i, %sort_string.exit
%call11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %t) #7
%cmp = icmp slt i32 %call11, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #6
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include<stdio.h>
int main(void)
{
char str1[101],str2[101],temp;
int i=0,j=0,frag=1,len;
scanf("%s %s",str1,str2);
while(frag == 1)
{
i=0; frag=0;
while(str1[i+1] != '\0')
{
if(str1[i] > str1[i+1])
{
temp = str1[i];
str1[i] = str1[i+1];
str1[i+1] = temp;
frag = 1;
}
i++;
}
}
frag = 1;
while(frag == 1)
{
j=0; frag = 0;
while(str2[j+1] != '\0')
{
if(str2[j] < str2[j+1])
{
temp = str2[j];
str2[j] = str2[j+1];
str2[j+1] = temp;
frag = 1;
}
j++;
}
}
if(i < j)
{
len = i;
frag = 0;
}
else
{
len = j;
frag = 1;
}
i=0;
while(len >= i)
{
if(str1[i] < str2[i])
{
printf("Yes\n");
return 0;
}
else if(str1[i] > str2[i])
{
printf("No\n");
return 0;
}
i++;
}
if(frag == 0)
{
printf("Yes\n");
return 0;
}
else
{
printf("No\n");
return 0;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157699/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157699/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str1 = alloca [101 x i8], align 16
%str2 = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str1) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str2) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str1, ptr noundef nonnull %str2)
%arrayidx137 = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 1
%0 = load i8, ptr %arrayidx137, align 1, !tbaa !5
%1 = icmp eq i8 %0, 0
br i1 %1, label %while.cond26.preheader, label %while.body5.outer
while.cond.loopexit: ; preds = %if.end
br i1 %cmp, label %while.cond2.preheaderthread-pre-split, label %while.cond26.preheader.loopexit.split.loop.exit210, !llvm.loop !8
while.cond2.preheaderthread-pre-split: ; preds = %if.end.thread, %while.cond.loopexit
%.pr = load i8, ptr %arrayidx137, align 1, !tbaa !5
%cmp3.not138 = icmp eq i8 %.pr, 0
br i1 %cmp3.not138, label %while.cond26.preheader, label %while.body5.outer.backedge
while.body5.outer: ; preds = %entry, %while.body5.outer.backedge
%indvars.iv155.ph = phi i64 [ %indvars.iv155.ph.be, %while.body5.outer.backedge ], [ 0, %entry ]
%indvars.iv.ph = phi i64 [ %indvars.iv.ph.be, %while.body5.outer.backedge ], [ 1, %entry ]
%.ph191 = phi i8 [ %.ph191.be, %while.body5.outer.backedge ], [ %0, %entry ]
%arrayidx142.ph = phi ptr [ %arrayidx142.ph.be, %while.body5.outer.backedge ], [ %arrayidx137, %entry ]
%cmp = phi i1 [ %cmp.be, %while.body5.outer.backedge ], [ false, %entry ]
%arrayidx7230 = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 %indvars.iv155.ph
%2 = load i8, ptr %arrayidx7230, align 1, !tbaa !5
%cmp13231 = icmp sgt i8 %2, %.ph191
br i1 %cmp13231, label %if.end.thread, label %if.end
while.cond26.preheader.loopexit.split.loop.exit210: ; preds = %while.cond.loopexit
%3 = trunc i64 %indvars.iv233 to i32
br label %while.cond26.preheader
while.cond26.preheader: ; preds = %while.cond2.preheaderthread-pre-split, %while.cond26.preheader.loopexit.split.loop.exit210, %entry
%.us-phi = phi i32 [ 0, %entry ], [ %3, %while.cond26.preheader.loopexit.split.loop.exit210 ], [ 0, %while.cond2.preheaderthread-pre-split ]
%arrayidx33144 = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 1
%4 = load i8, ptr %arrayidx33144, align 1, !tbaa !5
%5 = icmp eq i8 %4, 0
br i1 %5, label %while.end61, label %while.body37.outer
while.body5: ; preds = %if.end
%indvars.iv.next156 = add nuw nsw i64 %indvars.iv155232, 1
%arrayidx7 = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 %indvars.iv.next156
%6 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%cmp13 = icmp sgt i8 %6, %7
br i1 %cmp13, label %if.end.thread.loopexit, label %if.end, !llvm.loop !11
if.end: ; preds = %while.body5.outer, %while.body5
%indvars.iv233 = phi i64 [ %indvars.iv.next, %while.body5 ], [ %indvars.iv.ph, %while.body5.outer ]
%indvars.iv155232 = phi i64 [ %indvars.iv.next156, %while.body5 ], [ %indvars.iv155.ph, %while.body5.outer ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv233, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp3.not = icmp eq i8 %7, 0
br i1 %cmp3.not, label %while.cond.loopexit, label %while.body5, !llvm.loop !11
if.end.thread.loopexit: ; preds = %while.body5
%arrayidx.le = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 %indvars.iv.next
br label %if.end.thread
if.end.thread: ; preds = %if.end.thread.loopexit, %while.body5.outer
%indvars.iv155.lcssa = phi i64 [ %indvars.iv155.ph, %while.body5.outer ], [ %indvars.iv.next156, %if.end.thread.loopexit ]
%indvars.iv.lcssa = phi i64 [ %indvars.iv.ph, %while.body5.outer ], [ %indvars.iv.next, %if.end.thread.loopexit ]
%.lcssa225 = phi i8 [ %.ph191, %while.body5.outer ], [ %7, %if.end.thread.loopexit ]
%arrayidx142.lcssa = phi ptr [ %arrayidx142.ph, %while.body5.outer ], [ %arrayidx.le, %if.end.thread.loopexit ]
%.lcssa222 = phi i8 [ %2, %while.body5.outer ], [ %6, %if.end.thread.loopexit ]
%arrayidx7.le = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 %indvars.iv155.lcssa
store i8 %.lcssa225, ptr %arrayidx7.le, align 1, !tbaa !5
store i8 %.lcssa222, ptr %arrayidx142.lcssa, align 1, !tbaa !5
%indvars.iv.next174 = add nuw nsw i64 %indvars.iv.lcssa, 1
%arrayidx175 = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 %indvars.iv.next174
%8 = load i8, ptr %arrayidx175, align 1, !tbaa !5
%cmp3.not176 = icmp eq i8 %8, 0
%indvars.iv.next156177 = add nuw nsw i64 %indvars.iv155.lcssa, 1
br i1 %cmp3.not176, label %while.cond2.preheaderthread-pre-split, label %while.body5.outer.backedge
while.body5.outer.backedge: ; preds = %if.end.thread, %while.cond2.preheaderthread-pre-split
%indvars.iv155.ph.be = phi i64 [ %indvars.iv.next156177, %if.end.thread ], [ 0, %while.cond2.preheaderthread-pre-split ]
%indvars.iv.ph.be = phi i64 [ %indvars.iv.next174, %if.end.thread ], [ 1, %while.cond2.preheaderthread-pre-split ]
%.ph191.be = phi i8 [ %8, %if.end.thread ], [ %.pr, %while.cond2.preheaderthread-pre-split ]
%arrayidx142.ph.be = phi ptr [ %arrayidx175, %if.end.thread ], [ %arrayidx137, %while.cond2.preheaderthread-pre-split ]
%cmp.be = phi i1 [ true, %if.end.thread ], [ false, %while.cond2.preheaderthread-pre-split ]
br label %while.body5.outer, !llvm.loop !11
while.cond26.loopexit: ; preds = %if.end58
br i1 %cmp27, label %while.cond30.preheaderthread-pre-split, label %while.end61.loopexit.split.loop.exit213, !llvm.loop !12
while.cond30.preheaderthread-pre-split: ; preds = %if.end58.thread, %while.cond26.loopexit
%.pr172 = load i8, ptr %arrayidx33144, align 1, !tbaa !5
%cmp35.not145 = icmp eq i8 %.pr172, 0
br i1 %cmp35.not145, label %while.end61, label %while.body37.outer.backedge
while.body37.outer: ; preds = %while.cond26.preheader, %while.body37.outer.backedge
%indvars.iv159.ph = phi i64 [ %indvars.iv159.ph.be, %while.body37.outer.backedge ], [ 0, %while.cond26.preheader ]
%indvars.iv157.ph = phi i64 [ %indvars.iv157.ph.be, %while.body37.outer.backedge ], [ 1, %while.cond26.preheader ]
%.ph = phi i8 [ %.ph.be, %while.body37.outer.backedge ], [ %4, %while.cond26.preheader ]
%arrayidx33149.ph = phi ptr [ %arrayidx33149.ph.be, %while.body37.outer.backedge ], [ %arrayidx33144, %while.cond26.preheader ]
%cmp27 = phi i1 [ %cmp27.be, %while.body37.outer.backedge ], [ false, %while.cond26.preheader ]
%arrayidx39238 = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 %indvars.iv159.ph
%9 = load i8, ptr %arrayidx39238, align 1, !tbaa !5
%cmp45239 = icmp slt i8 %9, %.ph
br i1 %cmp45239, label %if.end58.thread, label %if.end58
while.body37: ; preds = %if.end58
%indvars.iv.next160 = add nuw nsw i64 %indvars.iv159240, 1
%arrayidx39 = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 %indvars.iv.next160
%10 = load i8, ptr %arrayidx39, align 1, !tbaa !5
%cmp45 = icmp slt i8 %10, %11
br i1 %cmp45, label %if.end58.thread.loopexit, label %if.end58, !llvm.loop !13
if.end58: ; preds = %while.body37.outer, %while.body37
%indvars.iv157241 = phi i64 [ %indvars.iv.next158, %while.body37 ], [ %indvars.iv157.ph, %while.body37.outer ]
%indvars.iv159240 = phi i64 [ %indvars.iv.next160, %while.body37 ], [ %indvars.iv159.ph, %while.body37.outer ]
%indvars.iv.next158 = add nuw nsw i64 %indvars.iv157241, 1
%arrayidx33 = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 %indvars.iv.next158
%11 = load i8, ptr %arrayidx33, align 1, !tbaa !5
%cmp35.not = icmp eq i8 %11, 0
br i1 %cmp35.not, label %while.cond26.loopexit, label %while.body37, !llvm.loop !13
if.end58.thread.loopexit: ; preds = %while.body37
%arrayidx33.le = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 %indvars.iv.next158
br label %if.end58.thread
if.end58.thread: ; preds = %if.end58.thread.loopexit, %while.body37.outer
%indvars.iv159.lcssa = phi i64 [ %indvars.iv159.ph, %while.body37.outer ], [ %indvars.iv.next160, %if.end58.thread.loopexit ]
%indvars.iv157.lcssa = phi i64 [ %indvars.iv157.ph, %while.body37.outer ], [ %indvars.iv.next158, %if.end58.thread.loopexit ]
%.lcssa217 = phi i8 [ %.ph, %while.body37.outer ], [ %11, %if.end58.thread.loopexit ]
%arrayidx33149.lcssa = phi ptr [ %arrayidx33149.ph, %while.body37.outer ], [ %arrayidx33.le, %if.end58.thread.loopexit ]
%.lcssa = phi i8 [ %9, %while.body37.outer ], [ %10, %if.end58.thread.loopexit ]
%arrayidx39.le = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 %indvars.iv159.lcssa
store i8 %.lcssa217, ptr %arrayidx39.le, align 1, !tbaa !5
store i8 %.lcssa, ptr %arrayidx33149.lcssa, align 1, !tbaa !5
%indvars.iv.next158183 = add nuw nsw i64 %indvars.iv157.lcssa, 1
%arrayidx33184 = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 %indvars.iv.next158183
%12 = load i8, ptr %arrayidx33184, align 1, !tbaa !5
%cmp35.not185 = icmp eq i8 %12, 0
%indvars.iv.next160186 = add nuw nsw i64 %indvars.iv159.lcssa, 1
br i1 %cmp35.not185, label %while.cond30.preheaderthread-pre-split, label %while.body37.outer.backedge
while.body37.outer.backedge: ; preds = %if.end58.thread, %while.cond30.preheaderthread-pre-split
%indvars.iv159.ph.be = phi i64 [ %indvars.iv.next160186, %if.end58.thread ], [ 0, %while.cond30.preheaderthread-pre-split ]
%indvars.iv157.ph.be = phi i64 [ %indvars.iv.next158183, %if.end58.thread ], [ 1, %while.cond30.preheaderthread-pre-split ]
%.ph.be = phi i8 [ %12, %if.end58.thread ], [ %.pr172, %while.cond30.preheaderthread-pre-split ]
%arrayidx33149.ph.be = phi ptr [ %arrayidx33184, %if.end58.thread ], [ %arrayidx33144, %while.cond30.preheaderthread-pre-split ]
%cmp27.be = phi i1 [ true, %if.end58.thread ], [ false, %while.cond30.preheaderthread-pre-split ]
br label %while.body37.outer, !llvm.loop !13
while.end61.loopexit.split.loop.exit213: ; preds = %while.cond26.loopexit
%13 = trunc i64 %indvars.iv157241 to i32
br label %while.end61
while.end61: ; preds = %while.cond30.preheaderthread-pre-split, %while.end61.loopexit.split.loop.exit213, %while.cond26.preheader
%.us-phi153 = phi i32 [ 0, %while.cond26.preheader ], [ %13, %while.end61.loopexit.split.loop.exit213 ], [ 0, %while.cond30.preheaderthread-pre-split ]
%cmp62 = icmp ult i32 %.us-phi, %.us-phi153
%i.0.j.0 = call i32 @llvm.umin.i32(i32 %.us-phi, i32 %.us-phi153)
%14 = add nuw i32 %i.0.j.0, 1
%wide.trip.count = zext i32 %14 to i64
br label %while.body69
while.cond66: ; preds = %if.else80
%indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
%exitcond.not = icmp eq i64 %indvars.iv.next162, %wide.trip.count
br i1 %exitcond.not, label %while.end94, label %while.body69, !llvm.loop !14
while.body69: ; preds = %while.end61, %while.cond66
%indvars.iv161 = phi i64 [ 0, %while.end61 ], [ %indvars.iv.next162, %while.cond66 ]
%arrayidx71 = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 %indvars.iv161
%15 = load i8, ptr %arrayidx71, align 1, !tbaa !5
%arrayidx74 = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 %indvars.iv161
%16 = load i8, ptr %arrayidx74, align 1, !tbaa !5
%cmp76 = icmp slt i8 %15, %16
br i1 %cmp76, label %cleanup, label %if.else80
if.else80: ; preds = %while.body69
%cmp87 = icmp sgt i8 %15, %16
br i1 %cmp87, label %cleanup, label %while.cond66
while.end94: ; preds = %while.cond66
%str.3.str = select i1 %cmp62, ptr @str.5, ptr @str.4
br label %cleanup
cleanup: ; preds = %if.else80, %while.body69, %while.end94
%str.sink = phi ptr [ %str.3.str, %while.end94 ], [ @str.5, %while.body69 ], [ @str.4, %if.else80 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %str2) #5
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %str1) #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.umin.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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.unswitch.partial.disable"}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9, !10}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
|
#include <stdio.h>
int B[10000000];
int len;
void print(int x) {
if(x > 0) B[len++]=x;
}
void yaru(int a, int islast) {
int i;
if (a%2==1) {
for(i=1;i<a;i+=2) {
print(2);
}
if(!islast) print(2); /* 最後以外で奇数が来るのは最初のみ */
} else {
if((a/2)%2==0) {
if(islast) {
print(1);
print(a-2);
} else {
print(a);
}
} else {
print(a/2-1);
if(islast) {
print(1);
print(a/2-1);
} else {
print(a/2+1);
}
}
}
}
int main(void) {
int N,M;
int A[200];
int i;
int kisuucount=0;
int k1=0,k2=0;
int tmp;
if(scanf("%d%d",&N,&M)!=2)return 1;
for(i=0;i<M;i++) {
if(scanf("%d",&A[i])!=1)return 1;
}
for(i=0;i<M;i++) {
if(A[i]%2!=0) {
if(kisuucount==0)k1=i; else k2=i;
kisuucount++;
}
}
if(kisuucount>2) {
puts("Impossible");
return 0;
}
if(kisuucount==1) {
tmp=A[k1];
A[k1]=A[0];
A[0]=tmp;
} else if(kisuucount==2) {
tmp=A[k1];
A[k1]=A[0];
A[0]=tmp;
tmp=A[k2];
A[k2]=A[M-1];
A[M-1]=tmp;
}
printf("%d", A[0]);
for(i=1;i<M;i++) printf(" %d",A[i]);
putchar('\n');
len=0;
if(A[0]%2==1) {
yaru(A[0], M==1);
if(M==1) print(1);
} else {
print(1);
yaru(A[0], M==1);
}
for(i=1;i<M;i++) {
yaru(A[i],i+1>=M);
}
printf("%d\n", len);
printf("%d", B[0]);
for(i=1;i<len;i++) printf(" %d", B[i]);
putchar('\n');
return 0;
}
/*
sample 1
ABB
CDC
C: A=B
sample 2
ABCCBA
DEEFGF
E: B=C
F: C=A
----------
123214554
AABBCCDEE
1234321565
AABBCCDDEE
122343
AABBCC
Aの列: (N-奇数の数)/2個のペアについて同じだと言える
Bの列: 同様
全部同じだと言うのに必要なペアの数は(N-1)個
奇数が0個でも、高々N/2個のペアについてしか同じと言えない
Nが偶数の場合
Aに奇数が0個 -> できる?
Aに奇数が1個 -> ありえない
Aに奇数が2個 -> できる?
Aに奇数が3個 -> ありえない
Aに奇数が4個以上 -> Impossible
Nが奇数の場合
Aに奇数が0個 -> ありえない
Aに奇数が1個 -> できる?
Aに奇数が2個 -> ありえない
Aに奇数が3個以上 -> Imposssible
123443215677658998
AABBxCCDDEEFGGFxHH
1122334455
xAABBCCDDx
1221345543
AAxBBCCxxx
1233214554
xAABCCBxDD
12345543216776
xABBACDEEDCxFF
123443215677658998
xABCDDCBAEEFGGFxHH
1221
xxAA
123456654321
xxABCDEEDCBA
1=3 2=4 5=3 6=4 5=6
Nが偶数の場合
A/2が奇数の場合
最初1個 -> 前のやつからの接続を受け入れる
次(A/2-1)個 -> 回文としてマーク
次1個 -> 次と接続する
次(A/2-1)個 -> 回文としてマーク
A/2が偶数の場合
最初1個-> 前のやつからの接続を受け入れる
次1個 -> 次と接続する
次(A-2)個 -> 回文としてマーク
123214566547887
AABBCCDDEFFExGG
1234321
AABBCCx
123454321
AABBCCDDx
Nが奇数の場合
Aが奇数のやつを最初に配置
*/
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157756/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157756/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@B = dso_local local_unnamed_addr global [10000000 x i32] zeroinitializer, align 16
@len = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @print(i32 noundef %x) local_unnamed_addr #0 {
entry:
%cmp = icmp sgt i32 %x, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load i32, ptr @len, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @len, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @yaru(i32 noundef %a, i32 noundef %islast) local_unnamed_addr #1 {
entry:
%0 = and i32 %a, -2147483647
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %for.cond.preheader, label %if.else
for.cond.preheader: ; preds = %entry
%len.promoted = load i32, ptr @len, align 4, !tbaa !5
%cmp178 = icmp ugt i32 %a, 1
br i1 %cmp178, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%1 = sext i32 %len.promoted to i64
%smax = tail call i32 @llvm.smax.i32(i32 %a, i32 3)
%2 = add nsw i32 %smax, -2
%3 = lshr i32 %2, 1
%narrow = add nuw i32 %3, 1
%4 = zext i32 %narrow to i64
%min.iters.check = icmp ult i32 %2, 14
br i1 %min.iters.check, label %for.body.preheader84, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 4294967288
%ind.end = add nsw i64 %n.vec, %1
%.cast = trunc i64 %n.vec to i32
%5 = shl i32 %.cast, 1
%ind.end82 = or i32 %5, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = add i64 %index, %1
%6 = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %offset.idx
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %7, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %4
br i1 %cmp.n, label %for.cond.for.end_crit_edge, label %for.body.preheader84
for.body.preheader84: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %1, %for.body.preheader ], [ %ind.end, %middle.block ]
%i.080.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end82, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader84, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader84 ]
%i.080 = phi i32 [ %add, %for.body ], [ %i.080.ph, %for.body.preheader84 ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.i = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %indvars.iv
store i32 2, ptr %arrayidx.i, align 4, !tbaa !5
%add = add nuw nsw i32 %i.080, 2
%cmp1 = icmp slt i32 %add, %a
br i1 %cmp1, label %for.body, label %for.cond.for.end_crit_edge, !llvm.loop !13
for.cond.for.end_crit_edge: ; preds = %for.body, %middle.block
%indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next, %for.body ]
%9 = trunc i64 %indvars.iv.next.lcssa to i32
store i32 %9, ptr @len, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %for.cond.preheader
%10 = phi i32 [ %9, %for.cond.for.end_crit_edge ], [ %len.promoted, %for.cond.preheader ]
%tobool.not = icmp eq i32 %islast, 0
br i1 %tobool.not, label %if.then2, label %if.end22
if.then2: ; preds = %for.end
%inc.i33 = add nsw i32 %10, 1
br label %if.end22.sink.split
if.else: ; preds = %entry
%div = sdiv i32 %a, 2
%11 = and i32 %div, 1
%cmp4 = icmp eq i32 %11, 0
br i1 %cmp4, label %if.then5, label %if.else10
if.then5: ; preds = %if.else
%tobool6.not = icmp eq i32 %islast, 0
br i1 %tobool6.not, label %if.else8, label %if.then7
if.then7: ; preds = %if.then5
%12 = load i32, ptr @len, align 4, !tbaa !5
%inc.i36 = add nsw i32 %12, 1
store i32 %inc.i36, ptr @len, align 4, !tbaa !5
%idxprom.i37 = sext i32 %12 to i64
%arrayidx.i38 = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %idxprom.i37
store i32 1, ptr %arrayidx.i38, align 4, !tbaa !5
%cmp.i = icmp sgt i32 %a, 2
br i1 %cmp.i, label %if.then.i, label %if.end22
if.then.i: ; preds = %if.then7
%sub = add nsw i32 %a, -2
%inc.i39 = add nsw i32 %12, 2
br label %if.end22.sink.split
if.else8: ; preds = %if.then5
%cmp.i42 = icmp sgt i32 %a, 0
br i1 %cmp.i42, label %if.then.i43, label %if.end22
if.then.i43: ; preds = %if.else8
%13 = load i32, ptr @len, align 4, !tbaa !5
%inc.i44 = add nsw i32 %13, 1
br label %if.end22.sink.split
if.else10: ; preds = %if.else
%sub12 = add nsw i32 %div, -1
%cmp.i48 = icmp sgt i32 %a, 3
br i1 %cmp.i48, label %print.exit53, label %print.exit53.thread
print.exit53: ; preds = %if.else10
%14 = load i32, ptr @len, align 4, !tbaa !5
%inc.i50 = add nsw i32 %14, 1
%idxprom.i51 = sext i32 %14 to i64
%arrayidx.i52 = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %idxprom.i51
store i32 %sub12, ptr %arrayidx.i52, align 4, !tbaa !5
%tobool13.not = icmp eq i32 %islast, 0
br i1 %tobool13.not, label %if.then.i65, label %if.then.i59
print.exit53.thread: ; preds = %if.else10
%tobool13.not70 = icmp eq i32 %islast, 0
br i1 %tobool13.not70, label %if.else17, label %if.then14.thread
if.then14.thread: ; preds = %print.exit53.thread
%15 = load i32, ptr @len, align 4, !tbaa !5
%inc.i5571 = add nsw i32 %15, 1
br label %if.end22.sink.split
if.then.i59: ; preds = %print.exit53
%inc.i55 = add nsw i32 %14, 2
%idxprom.i56 = sext i32 %inc.i50 to i64
%arrayidx.i57 = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %idxprom.i56
store i32 1, ptr %arrayidx.i57, align 4, !tbaa !5
%inc.i60 = add nsw i32 %14, 3
br label %if.end22.sink.split
if.else17: ; preds = %print.exit53.thread
%cmp.i64 = icmp sgt i32 %a, -2
br i1 %cmp.i64, label %if.else17.if.then.i65_crit_edge, label %if.end22
if.else17.if.then.i65_crit_edge: ; preds = %if.else17
%.pre = load i32, ptr @len, align 4, !tbaa !5
br label %if.then.i65
if.then.i65: ; preds = %if.else17.if.then.i65_crit_edge, %print.exit53
%16 = phi i32 [ %.pre, %if.else17.if.then.i65_crit_edge ], [ %inc.i50, %print.exit53 ]
%add1976 = add nsw i32 %div, 1
%inc.i66 = add nsw i32 %16, 1
br label %if.end22.sink.split
if.end22.sink.split: ; preds = %if.then2, %if.then.i, %if.then.i43, %if.then14.thread, %if.then.i59, %if.then.i65
%inc.i66.sink = phi i32 [ %inc.i66, %if.then.i65 ], [ %inc.i60, %if.then.i59 ], [ %inc.i5571, %if.then14.thread ], [ %inc.i44, %if.then.i43 ], [ %inc.i39, %if.then.i ], [ %inc.i33, %if.then2 ]
%.sink = phi i32 [ %16, %if.then.i65 ], [ %inc.i55, %if.then.i59 ], [ %15, %if.then14.thread ], [ %13, %if.then.i43 ], [ %inc.i36, %if.then.i ], [ %10, %if.then2 ]
%add1976.sink = phi i32 [ %add1976, %if.then.i65 ], [ %sub12, %if.then.i59 ], [ 1, %if.then14.thread ], [ %a, %if.then.i43 ], [ %sub, %if.then.i ], [ 2, %if.then2 ]
store i32 %inc.i66.sink, ptr @len, align 4, !tbaa !5
%idxprom.i67 = sext i32 %.sink to i64
%arrayidx.i68 = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %idxprom.i67
store i32 %add1976.sink, ptr %arrayidx.i68, align 4, !tbaa !5
br label %if.end22
if.end22: ; preds = %if.end22.sink.split, %if.else17, %if.else8, %if.then7, %for.end
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%A = alloca [200 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 800, ptr nonnull %A) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%cmp.not = icmp eq i32 %call, 2
br i1 %cmp.not, label %for.cond.preheader, label %cleanup
for.cond.preheader: ; preds = %entry
%0 = load i32, ptr %M, align 4, !tbaa !5
%cmp1143 = icmp sgt i32 %0, 0
br i1 %cmp1143, label %for.body, label %if.end52
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %M, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp1, label %for.body, label %for.cond6.preheader, !llvm.loop !14
for.cond6.preheader: ; preds = %for.cond
%cmp7145 = icmp sgt i32 %1, 0
br i1 %cmp7145, label %for.body8.preheader, label %if.end52
for.body8.preheader: ; preds = %for.cond6.preheader
%wide.trip.count = zext i32 %1 to i64
%xtraiter = and i64 %wide.trip.count, 1
%3 = icmp eq i32 %1, 1
br i1 %3, label %for.end20.unr-lcssa, label %for.body8.preheader.new
for.body8.preheader.new: ; preds = %for.body8.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body8
for.body: ; preds = %for.cond.preheader, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%cmp3.not = icmp eq i32 %call2, 1
br i1 %cmp3.not, label %for.cond, label %cleanup
for.body8: ; preds = %for.body8, %for.body8.preheader.new
%indvars.iv161 = phi i64 [ 0, %for.body8.preheader.new ], [ %indvars.iv.next162.1, %for.body8 ]
%k2.0149 = phi i32 [ 0, %for.body8.preheader.new ], [ %k2.2.1, %for.body8 ]
%k1.0148 = phi i32 [ 0, %for.body8.preheader.new ], [ %k1.2.1, %for.body8 ]
%kisuucount.0147 = phi i32 [ 0, %for.body8.preheader.new ], [ %kisuucount.1.1, %for.body8 ]
%niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.body8 ]
%arrayidx10 = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %indvars.iv161
%4 = load i32, ptr %arrayidx10, align 8, !tbaa !5
%5 = and i32 %4, 1
%cmp11.not = icmp eq i32 %5, 0
%cmp13 = icmp eq i32 %kisuucount.0147, 0
%6 = trunc i64 %indvars.iv161 to i32
%i.1.k1.0 = select i1 %cmp13, i32 %6, i32 %k1.0148
%kisuucount.1 = add i32 %5, %kisuucount.0147
%k1.2 = select i1 %cmp11.not, i32 %k1.0148, i32 %i.1.k1.0
%7 = select i1 %cmp11.not, i1 true, i1 %cmp13
%k2.2 = select i1 %7, i32 %k2.0149, i32 %6
%indvars.iv.next162 = or i64 %indvars.iv161, 1
%arrayidx10.1 = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %indvars.iv.next162
%8 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%9 = and i32 %8, 1
%cmp11.not.1 = icmp eq i32 %9, 0
%cmp13.1 = icmp eq i32 %kisuucount.1, 0
%10 = trunc i64 %indvars.iv.next162 to i32
%i.1.k1.0.1 = select i1 %cmp13.1, i32 %10, i32 %k1.2
%kisuucount.1.1 = add i32 %9, %kisuucount.1
%k1.2.1 = select i1 %cmp11.not.1, i32 %k1.2, i32 %i.1.k1.0.1
%11 = select i1 %cmp11.not.1, i1 true, i1 %cmp13.1
%k2.2.1 = select i1 %11, i32 %k2.2, i32 %10
%indvars.iv.next162.1 = add nuw nsw i64 %indvars.iv161, 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.end20.unr-lcssa, label %for.body8, !llvm.loop !15
for.end20.unr-lcssa: ; preds = %for.body8, %for.body8.preheader
%kisuucount.1.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %kisuucount.1.1, %for.body8 ]
%k1.2.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %k1.2.1, %for.body8 ]
%k2.2.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %k2.2.1, %for.body8 ]
%indvars.iv161.unr = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next162.1, %for.body8 ]
%k2.0149.unr = phi i32 [ 0, %for.body8.preheader ], [ %k2.2.1, %for.body8 ]
%k1.0148.unr = phi i32 [ 0, %for.body8.preheader ], [ %k1.2.1, %for.body8 ]
%kisuucount.0147.unr = phi i32 [ 0, %for.body8.preheader ], [ %kisuucount.1.1, %for.body8 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end20, label %for.body8.epil
for.body8.epil: ; preds = %for.end20.unr-lcssa
%arrayidx10.epil = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %indvars.iv161.unr
%12 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5
%13 = and i32 %12, 1
%cmp11.not.epil = icmp eq i32 %13, 0
%cmp13.epil = icmp eq i32 %kisuucount.0147.unr, 0
%14 = trunc i64 %indvars.iv161.unr to i32
%i.1.k1.0.epil = select i1 %cmp13.epil, i32 %14, i32 %k1.0148.unr
%kisuucount.1.epil = add i32 %13, %kisuucount.0147.unr
%k1.2.epil = select i1 %cmp11.not.epil, i32 %k1.0148.unr, i32 %i.1.k1.0.epil
%15 = select i1 %cmp11.not.epil, i1 true, i1 %cmp13.epil
%k2.2.epil = select i1 %15, i32 %k2.0149.unr, i32 %14
br label %for.end20
for.end20: ; preds = %for.end20.unr-lcssa, %for.body8.epil
%kisuucount.1.lcssa = phi i32 [ %kisuucount.1.lcssa.ph, %for.end20.unr-lcssa ], [ %kisuucount.1.epil, %for.body8.epil ]
%k1.2.lcssa = phi i32 [ %k1.2.lcssa.ph, %for.end20.unr-lcssa ], [ %k1.2.epil, %for.body8.epil ]
%k2.2.lcssa = phi i32 [ %k2.2.lcssa.ph, %for.end20.unr-lcssa ], [ %k2.2.epil, %for.body8.epil ]
%16 = sext i32 %k1.2.lcssa to i64
%17 = sext i32 %k2.2.lcssa to i64
%cmp21 = icmp sgt i32 %kisuucount.1.lcssa, 2
br i1 %cmp21, label %if.then22, label %if.end24
if.then22: ; preds = %for.end20
%call23 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
if.end24: ; preds = %for.end20
switch i32 %kisuucount.1.lcssa, label %if.end52 [
i32 1, label %if.then26
i32 2, label %if.then35
]
if.then26: ; preds = %if.end24
%arrayidx28 = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %16
%18 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%19 = load i32, ptr %A, align 16, !tbaa !5
store i32 %19, ptr %arrayidx28, align 4, !tbaa !5
store i32 %18, ptr %A, align 16, !tbaa !5
br label %if.end52
if.then35: ; preds = %if.end24
%arrayidx37 = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %16
%20 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%21 = load i32, ptr %A, align 16, !tbaa !5
store i32 %21, ptr %arrayidx37, align 4, !tbaa !5
store i32 %20, ptr %A, align 16, !tbaa !5
%arrayidx43 = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %17
%22 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%idxprom44 = sext i32 %sub to i64
%arrayidx45 = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %idxprom44
%23 = load i32, ptr %arrayidx45, align 4, !tbaa !5
store i32 %23, ptr %arrayidx43, align 4, !tbaa !5
store i32 %22, ptr %arrayidx45, align 4, !tbaa !5
br label %if.end52
if.end52: ; preds = %for.cond6.preheader, %for.cond.preheader, %if.end24, %if.then35, %if.then26
%24 = load i32, ptr %A, align 16, !tbaa !5
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %24)
%25 = load i32, ptr %M, align 4, !tbaa !5
%cmp56153 = icmp sgt i32 %25, 1
br i1 %cmp56153, label %for.body57, label %for.end63
for.body57: ; preds = %if.end52, %for.body57
%indvars.iv164 = phi i64 [ %indvars.iv.next165, %for.body57 ], [ 1, %if.end52 ]
%arrayidx59 = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %indvars.iv164
%26 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %26)
%indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
%27 = load i32, ptr %M, align 4, !tbaa !5
%28 = sext i32 %27 to i64
%cmp56 = icmp slt i64 %indvars.iv.next165, %28
br i1 %cmp56, label %for.body57, label %for.end63, !llvm.loop !16
for.end63: ; preds = %for.body57, %if.end52
%29 = load ptr, ptr @stdout, align 8, !tbaa !17
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %29)
store i32 0, ptr @len, align 4, !tbaa !5
%30 = load i32, ptr %A, align 16, !tbaa !5
%31 = and i32 %30, -2147483647
%cmp67 = icmp eq i32 %31, 1
br i1 %cmp67, label %if.then68, label %if.else75
if.then68: ; preds = %for.end63
%32 = load i32, ptr %M, align 4, !tbaa !5
%cmp70 = icmp eq i32 %32, 1
%conv = zext i1 %cmp70 to i32
call void @yaru(i32 noundef %30, i32 noundef %conv)
%33 = load i32, ptr %M, align 4, !tbaa !5
%cmp71 = icmp eq i32 %33, 1
br i1 %cmp71, label %if.end79.thread, label %if.end79
if.end79.thread: ; preds = %if.then68
%34 = load i32, ptr @len, align 4, !tbaa !5
%inc.i = add nsw i32 %34, 1
store i32 %inc.i, ptr @len, align 4, !tbaa !5
%idxprom.i = sext i32 %34 to i64
%arrayidx.i = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %idxprom.i
store i32 1, ptr %arrayidx.i, align 4, !tbaa !5
br label %for.end90
if.else75: ; preds = %for.end63
store i32 1, ptr @len, align 4, !tbaa !5
store i32 1, ptr @B, align 16, !tbaa !5
%35 = load i32, ptr %M, align 4, !tbaa !5
%cmp77 = icmp eq i32 %35, 1
%conv78 = zext i1 %cmp77 to i32
call void @yaru(i32 noundef %30, i32 noundef %conv78)
%.pre = load i32, ptr %M, align 4, !tbaa !5
br label %if.end79
if.end79: ; preds = %if.then68, %if.else75
%36 = phi i32 [ %33, %if.then68 ], [ %.pre, %if.else75 ]
%cmp81155 = icmp sgt i32 %36, 1
br i1 %cmp81155, label %for.body83, label %for.end90
for.body83: ; preds = %if.end79, %for.body83
%indvars.iv167 = phi i64 [ %indvars.iv.next168, %for.body83 ], [ 1, %if.end79 ]
%37 = phi i32 [ %40, %for.body83 ], [ %36, %if.end79 ]
%arrayidx85 = getelementptr inbounds [200 x i32], ptr %A, i64 0, i64 %indvars.iv167
%38 = load i32, ptr %arrayidx85, align 4, !tbaa !5
%indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
%39 = sext i32 %37 to i64
%cmp86 = icmp sge i64 %indvars.iv.next168, %39
%conv87 = zext i1 %cmp86 to i32
call void @yaru(i32 noundef %38, i32 noundef %conv87)
%40 = load i32, ptr %M, align 4, !tbaa !5
%41 = sext i32 %40 to i64
%cmp81 = icmp slt i64 %indvars.iv.next168, %41
br i1 %cmp81, label %for.body83, label %for.end90, !llvm.loop !19
for.end90: ; preds = %for.body83, %if.end79.thread, %if.end79
%42 = load i32, ptr @len, align 4, !tbaa !5
%call91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %42)
%43 = load i32, ptr @B, align 16, !tbaa !5
%call92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %43)
%44 = load i32, ptr @len, align 4, !tbaa !5
%cmp94157 = icmp sgt i32 %44, 1
br i1 %cmp94157, label %for.body96, label %for.end102
for.body96: ; preds = %for.end90, %for.body96
%indvars.iv170 = phi i64 [ %indvars.iv.next171, %for.body96 ], [ 1, %for.end90 ]
%arrayidx98 = getelementptr inbounds [10000000 x i32], ptr @B, i64 0, i64 %indvars.iv170
%45 = load i32, ptr %arrayidx98, align 4, !tbaa !5
%call99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %45)
%indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
%46 = load i32, ptr @len, align 4, !tbaa !5
%47 = sext i32 %46 to i64
%cmp94 = icmp slt i64 %indvars.iv.next171, %47
br i1 %cmp94, label %for.body96, label %for.end102, !llvm.loop !20
for.end102: ; preds = %for.body96, %for.end90
%48 = load ptr, ptr @stdout, align 8, !tbaa !17
%call.i141 = call i32 @putc(i32 noundef 10, ptr noundef %48)
br label %cleanup
cleanup: ; preds = %for.body, %entry, %for.end102, %if.then22
%retval.0 = phi i32 [ 0, %if.then22 ], [ 0, %for.end102 ], [ 1, %entry ], [ 1, %for.body ]
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %A) #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 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(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: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; 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(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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
#include <string.h>
int main() {
char L[100100];
fgets(L, sizeof(L), stdin);
long long result = 1;
long long t = 1;
for(int i = strlen(L) - 2; i >= 0; i--) {
if (L[i] == '1') {
result = result * 2 + t;
result %= 1000000007;
}
t *= 3;
t %= 1000000007;
}
printf("%lld\n", result);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157806/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157806/source.c"
target datalayout = "e-m:e-p270: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 [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca [100100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100100, ptr nonnull %L) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %L, i32 noundef 100100, ptr noundef %0)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %L) #5
%1 = trunc i64 %call2 to i32
%conv = add i32 %1, -2
%cmp16 = icmp sgt i32 %conv, -1
br i1 %cmp16, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%2 = zext i32 %conv to i64
br label %for.body
for.cond.cleanup: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %result.0.lcssa)
call void @llvm.lifetime.end.p0(i64 100100, ptr nonnull %L) #4
ret i32 0
for.body: ; preds = %for.body.preheader, %if.end
%indvars.iv = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next, %if.end ]
%t.018 = phi i64 [ 1, %for.body.preheader ], [ %rem8, %if.end ]
%result.017 = phi i64 [ 1, %for.body.preheader ], [ %result.1, %if.end ]
%arrayidx = getelementptr inbounds [100100 x i8], ptr %L, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp5 = icmp eq i8 %3, 49
br i1 %cmp5, label %if.then, label %if.end
if.then: ; preds = %for.body
%mul = shl nsw i64 %result.017, 1
%add = add nsw i64 %mul, %t.018
%rem = srem i64 %add, 1000000007
br label %if.end
if.end: ; preds = %if.then, %for.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.017, %for.body ]
%mul7 = mul nsw i64 %t.018, 3
%rem8 = srem i64 %mul7, 1000000007
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%cmp = icmp sgt i64 %indvars.iv, 0
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
long long x, y, n, i, j, a, b;
while( scanf("%I64d %I64d",&x, &y)!=EOF)
{
scanf("%I64d %I64d",&a,&b);
i=(x>a)?(x-a):(a-x);
j=(y>b)?(y-b):(b-y);
printf("%I64d\n",(i>j)?i:j);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15785/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15785/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%I64d %I64d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
%y = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%cmp.not26 = icmp eq i32 %call25, -1
br i1 %cmp.not26, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %x, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%cond = call i64 @llvm.abs.i64(i64 %sub, i1 true)
%2 = load i64, ptr %y, align 8, !tbaa !5
%3 = load i64, ptr %b, align 8, !tbaa !5
%sub6 = sub nsw i64 %2, %3
%cond10 = call i64 @llvm.abs.i64(i64 %sub6, i1 true)
%cond15 = call i64 @llvm.smax.i64(i64 %cond, i64 %cond10)
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cond15)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(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 nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main() {
long long int i,j,k,a,b,c,d,m,n;
scanf("%I64d %I64d\n",&a,&b);
scanf("%I64d %I64d",&c,&d);
m=c-a;
n=d-b;
if(m<0) {
m=-m;
}
if(n<0) {
n=-n;
}
if(m>=n) {
printf("%I64d",m);
}
else {
printf("%I64d",n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15790/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15790/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%I64d %I64d\0A\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"%I64d %I64d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
%d = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i64, ptr %c, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%2 = load i64, ptr %d, align 8, !tbaa !5
%3 = load i64, ptr %b, align 8, !tbaa !5
%sub2 = sub nsw i64 %2, %3
%spec.select = call i64 @llvm.abs.i64(i64 %sub, i1 true)
%n.0 = call i64 @llvm.abs.i64(i64 %sub2, i1 true)
%n.0.spec.select = call i64 @llvm.umax.i64(i64 %spec.select, i64 %n.0)
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %n.0.spec.select)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>
#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i,begin,end) for(int i=begin; i>end; i--)
#define lld long long int
int main(){
int c[3][3];
rep(i, 0, 3){
rep(j, 0, 3){
scanf("%d", &c[i][j]);
}
}
int f=1;
rep(i, 0, 2){
int buf = c[i][0] - c[i+1][0];
rep(j, 1, 3){
if(c[i][j] - c[i+1][j] != buf){
f = 0;
}
}
}
printf(f ? "Yes" : "No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157950/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157950/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%c = alloca [3 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%arrayidx6.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1)
%arrayidx6.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2)
%arrayidx6.164 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 0
%call.165 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.164)
%arrayidx6.1.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 1
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1.1)
%arrayidx6.2.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 2
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2.1)
%arrayidx6.266 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 0
%call.267 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.266)
%arrayidx6.1.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 1
%call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1.2)
%arrayidx6.2.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 2
%call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2.2)
%0 = load i32, ptr %c, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx6.164, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx6.1.1, align 16, !tbaa !5
%sub35 = sub nsw i32 %2, %3
%cmp36.not = icmp ne i32 %sub35, %sub
%4 = load i32, ptr %arrayidx6.2, align 8, !tbaa !5
%5 = load i32, ptr %arrayidx6.2.1, align 4, !tbaa !5
%sub35.1 = sub nsw i32 %4, %5
%cmp36.not.1 = icmp ne i32 %sub35.1, %sub
%6 = load i32, ptr %arrayidx6.266, align 8, !tbaa !5
%sub.1 = sub nsw i32 %1, %6
%7 = load i32, ptr %arrayidx6.1.2, align 4, !tbaa !5
%sub35.172 = sub nsw i32 %3, %7
%cmp36.not.173 = icmp ne i32 %sub35.172, %sub.1
%8 = load i32, ptr %arrayidx6.2.2, align 16, !tbaa !5
%sub35.1.1 = sub nsw i32 %5, %8
%cmp36.not.1.1 = icmp ne i32 %sub35.1.1, %sub.1
%.not = select i1 %cmp36.not.1.1, i1 true, i1 %cmp36.not.173
%9 = select i1 %.not, i1 true, i1 %cmp36.not.1
%narrow = select i1 %9, i1 true, i1 %cmp36.not
%cond = select i1 %narrow, ptr @.str.2, ptr @.str.1
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %c) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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()
{
int i,j,a[4][4],b[4][4],c[5][5],fh=0;
for(i=1;i<4;i++)
for(j=1;j<4;j++)
scanf("%d",&c[i][j]);
for(i=1;i<4;i++)
{
a[i][1]=c[i][1]-c[i][2];
a[i][2]=c[i][1]-c[i][3];
a[i][3]=c[i][2]-c[i][3];
b[i][1]=c[1][i]-c[2][i];
b[i][2]=c[1][i]-c[3][i];
b[i][3]=c[2][i]-c[3][i];
}
for(i=1;i<4;i++)
{
if(a[1][i]!=a[2][i]||a[1][i]!=a[3][i]||b[1][i]!=b[2][i]||b[1][i]!=b[3][i])
fh=1;
}
if(fh)
printf("No\n");
else
printf("Yes\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158014/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158014/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%c = alloca [5 x [5 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %c) #4
%arrayidx5 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 1, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%arrayidx5.1 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 1, i64 2
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 1, i64 3
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.1157 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 2, i64 1
%call.1158 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1157)
%arrayidx5.1.1 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 2, i64 2
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.1)
%arrayidx5.2.1 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 2, i64 3
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.1)
%arrayidx5.2159 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 3, i64 1
%call.2160 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2159)
%arrayidx5.1.2 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 3, i64 2
%call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.2)
%arrayidx5.2.2 = getelementptr inbounds [5 x [5 x i32]], ptr %c, i64 0, i64 3, i64 3
%call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.2)
%0 = load i32, ptr %arrayidx5, align 8, !tbaa !5
%1 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %arrayidx5.2, align 16, !tbaa !5
%sub27 = sub nsw i32 %0, %2
%sub37 = sub nsw i32 %1, %2
%3 = load i32, ptr %arrayidx5.1157, align 4, !tbaa !5
%sub47 = sub nsw i32 %0, %3
%4 = load i32, ptr %arrayidx5.2159, align 16, !tbaa !5
%sub57 = sub nsw i32 %0, %4
%sub67 = sub nsw i32 %3, %4
%5 = load i32, ptr %arrayidx5.1.1, align 16, !tbaa !5
%sub.1 = sub nsw i32 %3, %5
%6 = load i32, ptr %arrayidx5.2.1, align 4, !tbaa !5
%sub27.1 = sub nsw i32 %3, %6
%sub37.1 = sub nsw i32 %5, %6
%sub47.1 = sub nsw i32 %1, %5
%7 = load i32, ptr %arrayidx5.1.2, align 4, !tbaa !5
%sub57.1 = sub nsw i32 %1, %7
%sub67.1 = sub nsw i32 %5, %7
%8 = load i32, ptr %arrayidx5.2.2, align 8, !tbaa !5
%sub27.2 = sub nsw i32 %4, %8
%sub37.2 = sub nsw i32 %7, %8
%sub47.2 = sub nsw i32 %2, %6
%sub57.2 = sub nsw i32 %2, %8
%sub67.2 = sub nsw i32 %6, %8
%cmp83.not = icmp eq i32 %sub, %sub.1
%sub.2 = sub nsw i32 %4, %7
%cmp90.not = icmp eq i32 %sub, %sub.2
%cmp98.not = icmp eq i32 %sub47, %sub47.1
%cmp106.not = icmp eq i32 %sub47, %sub47.2
%cmp83.not.1 = icmp eq i32 %sub27, %sub27.1
%cmp90.not.1 = icmp eq i32 %sub27, %sub27.2
%cmp98.not.1 = icmp eq i32 %sub57, %sub57.1
%cmp106.not.1 = icmp eq i32 %sub57, %sub57.2
%cmp83.not.2 = icmp eq i32 %sub37, %sub37.1
%cmp90.not.2 = icmp eq i32 %sub37, %sub37.2
%or.cond174 = select i1 %cmp83.not.2, i1 %cmp90.not.2, i1 false
%cmp98.not.2 = icmp eq i32 %sub67, %sub67.1
%or.cond175 = select i1 %or.cond174, i1 %cmp98.not.2, i1 false
%cmp106.not.2 = icmp eq i32 %sub67, %sub67.2
%or.cond176 = select i1 %or.cond175, i1 %cmp106.not.2, i1 false
%9 = select i1 %or.cond176, i1 %cmp83.not.1, i1 false
%10 = select i1 %9, i1 %cmp90.not.1, i1 false
%11 = select i1 %10, i1 %cmp98.not.1, i1 false
%12 = select i1 %11, i1 %cmp106.not.1, i1 false
%13 = select i1 %12, i1 %cmp83.not, i1 false
%14 = select i1 %13, i1 %cmp90.not, i1 false
%15 = select i1 %14, i1 %cmp98.not, i1 false
%or.cond177 = select i1 %15, i1 %cmp106.not, i1 false
%str.sink = select i1 %or.cond177, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %c) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 c[9];
int i;
int flag=0;
for(i=0;i<3;i++){
scanf("%d%d%d",&c[3*i],&c[3*i+1],&c[3*i+2]);
}
if(c[0]-c[1]==c[3]-c[4] && c[0]-c[1]==c[6]-c[7] && c[1]-c[2]==c[4]-c[5] && c[1]-c[2]==c[7]-c[8] && c[0]-c[3]==c[1]-c[4] && c[0]-c[3]==c[2]-c[5] && c[3]-c[6]==c[4]-c[7] && c[3]-c[6]==c[5]-c[8]){
flag=1;
}
if(flag==1){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158058/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158058/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = 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:
%c = alloca [9 x i32], align 16
call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %c) #4
%arrayidx3 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 1
%arrayidx7 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx7)
%arrayidx.1 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 3
%arrayidx3.1 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 4
%arrayidx7.1 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 5
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx3.1, ptr noundef nonnull %arrayidx7.1)
%arrayidx.2 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 6
%arrayidx3.2 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 7
%arrayidx7.2 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 8
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx3.2, ptr noundef nonnull %arrayidx7.2)
%0 = load i32, ptr %c, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx3.1, align 16, !tbaa !5
%sub12 = sub nsw i32 %2, %3
%cmp13 = icmp eq i32 %sub, %sub12
br i1 %cmp13, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%5 = load i32, ptr %arrayidx3.2, align 4, !tbaa !5
%sub19 = sub nsw i32 %4, %5
%cmp20 = icmp eq i32 %sub, %sub19
br i1 %cmp20, label %land.lhs.true21, label %if.else
land.lhs.true21: ; preds = %land.lhs.true
%6 = load i32, ptr %arrayidx7, align 8, !tbaa !5
%sub24 = sub nsw i32 %1, %6
%7 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5
%sub27 = sub nsw i32 %3, %7
%cmp28 = icmp eq i32 %sub24, %sub27
br i1 %cmp28, label %land.lhs.true29, label %if.else
land.lhs.true29: ; preds = %land.lhs.true21
%8 = load i32, ptr %arrayidx7.2, align 16, !tbaa !5
%sub35 = sub nsw i32 %5, %8
%cmp36 = icmp eq i32 %sub24, %sub35
br i1 %cmp36, label %land.lhs.true37, label %if.else
land.lhs.true37: ; preds = %land.lhs.true29
%sub40 = sub nsw i32 %0, %2
%sub43 = sub nsw i32 %1, %3
%cmp44 = icmp eq i32 %sub40, %sub43
%sub51 = sub nsw i32 %6, %7
%cmp52 = icmp eq i32 %sub40, %sub51
%or.cond = select i1 %cmp44, i1 %cmp52, i1 false
br i1 %or.cond, label %land.lhs.true53, label %if.else
land.lhs.true53: ; preds = %land.lhs.true37
%sub56 = sub nsw i32 %2, %4
%sub59 = sub nsw i32 %3, %5
%cmp60 = icmp eq i32 %sub56, %sub59
%sub67 = sub nsw i32 %7, %8
%cmp68 = icmp eq i32 %sub56, %sub67
%or.cond79 = select i1 %cmp60, i1 %cmp68, i1 false
br i1 %or.cond79, label %if.end73, label %if.else
if.else: ; preds = %entry, %land.lhs.true, %land.lhs.true21, %land.lhs.true29, %land.lhs.true37, %land.lhs.true53
br label %if.end73
if.end73: ; preds = %land.lhs.true53, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true53 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %c) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#define MOD 1000000007
#define rep(i,l,r) for(ll i=l;i<r;i++)
typedef long long ll;
ll max(ll x, ll y) { return (x > y) ? x : y; }
int main() {
ll n;
char s[30001];
scanf("%lld", &n);
scanf("%s", s);
rep(i, 0, n) s[i] -= 48;
ll cnt[30001] = {};
bool flag[10] = {};
for (ll i = n - 2; i >= 0; i--) {
if (!flag[s[i + 1]]) {
flag[s[i + 1]] = true;
cnt[i] = cnt[i + 1] + 1;
}
else cnt[i] = cnt[i + 1];
}
ll arr[100] = {};
rep(i, 0, n - 1) {
rep(j, i + 1, n) {
arr[s[i] * 10 + s[j]] = max(arr[s[i] * 10 + s[j]], cnt[j]);
}
}
ll ans = 0;
rep(i, 0, 100) {
ans += arr[i];
}
printf("%lld", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158100/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158100/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%s\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(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 nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i64, align 8
%s = alloca [30001 x i8], align 16
%cnt = alloca [30001 x i64], align 16
%flag = alloca [10 x i8], align 1
%arr = alloca [100 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 30001, ptr nonnull %s) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp93 = icmp sgt i64 %0, 0
br i1 %cmp93, label %iter.check, label %for.cond.cleanup.thread
iter.check: ; preds = %entry
%min.iters.check = icmp ult i64 %0, 8
br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check108 = icmp ult i64 %0, 32
br i1 %min.iters.check108, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %0, -32
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%1 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %index
%wide.load = load <16 x i8>, ptr %1, align 16, !tbaa !9
%2 = getelementptr inbounds i8, ptr %1, i64 16
%wide.load109 = load <16 x i8>, ptr %2, align 16, !tbaa !9
%3 = add <16 x i8> %wide.load, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48>
%4 = add <16 x i8> %wide.load109, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48>
store <16 x i8> %3, ptr %1, align 16, !tbaa !9
store <16 x i8> %4, ptr %2, align 16, !tbaa !9
%index.next = add nuw i64 %index, 32
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%n.vec.remaining = and i64 %0, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec111 = and i64 %0, -8
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index113 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next115, %vec.epilog.vector.body ]
%6 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %index113
%wide.load114 = load <8 x i8>, ptr %6, align 8, !tbaa !9
%7 = add <8 x i8> %wide.load114, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48>
store <8 x i8> %7, ptr %6, align 8, !tbaa !9
%index.next115 = add nuw i64 %index113, 8
%8 = icmp eq i64 %index.next115, %n.vec111
br i1 %8, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n112 = icmp eq i64 %0, %n.vec111
br i1 %cmp.n112, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%i.094.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec111, %vec.epilog.middle.block ]
br label %for.body
for.cond.cleanup.thread: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 240008, ptr nonnull %cnt) #6
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %flag) #6
br label %for.cond.cleanup8.thread
for.cond.cleanup: ; preds = %for.body, %vec.epilog.middle.block, %middle.block
call void @llvm.lifetime.start.p0(i64 240008, ptr nonnull %cnt) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240008) %cnt, i8 0, i64 240008, i1 false)
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %flag) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %flag, i8 0, i64 10, i1 false)
%cmp695 = icmp sgt i64 %0, 1
br i1 %cmp695, label %for.body9.preheader, label %for.cond.cleanup8.thread
for.body9.preheader: ; preds = %for.cond.cleanup
%sub4 = add nsw i64 %0, -2
br label %for.body9
for.body: ; preds = %for.body.preheader, %for.body
%i.094 = phi i64 [ %inc, %for.body ], [ %i.094.ph, %for.body.preheader ]
%arrayidx = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %i.094
%9 = load i8, ptr %arrayidx, align 1, !tbaa !9
%sub = add i8 %9, -48
store i8 %sub, ptr %arrayidx, align 1, !tbaa !9
%inc = add nuw nsw i64 %i.094, 1
%exitcond.not = icmp eq i64 %inc, %0
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15
for.cond.cleanup8.thread: ; preds = %for.cond.cleanup.thread, %for.cond.cleanup
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %arr) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %arr, i8 0, i64 800, i1 false)
br label %vector.body119
for.cond.cleanup8: ; preds = %for.inc23
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %arr) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %arr, i8 0, i64 800, i1 false)
br i1 %cmp695, label %for.body31.preheader, label %vector.body119
for.body31.preheader: ; preds = %for.cond.cleanup8
%10 = add i64 %0, -2
br label %for.body31
for.body9: ; preds = %for.body9.preheader, %for.inc23
%i3.096 = phi i64 [ %dec, %for.inc23 ], [ %sub4, %for.body9.preheader ]
%add = add nuw nsw i64 %i3.096, 1
%arrayidx10 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %add
%11 = load i8, ptr %arrayidx10, align 1, !tbaa !9
%idxprom = sext i8 %11 to i64
%arrayidx11 = getelementptr inbounds [10 x i8], ptr %flag, i64 0, i64 %idxprom
%12 = load i8, ptr %arrayidx11, align 1, !tbaa !16, !range !18, !noundef !19
%tobool.not = icmp eq i8 %12, 0
br i1 %tobool.not, label %if.then, label %if.else
if.then: ; preds = %for.body9
store i8 1, ptr %arrayidx11, align 1, !tbaa !16
%arrayidx17 = getelementptr inbounds [30001 x i64], ptr %cnt, i64 0, i64 %add
%13 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%add18 = add nsw i64 %13, 1
br label %for.inc23
if.else: ; preds = %for.body9
%arrayidx21 = getelementptr inbounds [30001 x i64], ptr %cnt, i64 0, i64 %add
%14 = load i64, ptr %arrayidx21, align 8, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %if.then, %if.else
%.sink = phi i64 [ %add18, %if.then ], [ %14, %if.else ]
%15 = getelementptr inbounds [30001 x i64], ptr %cnt, i64 0, i64 %i3.096
store i64 %.sink, ptr %15, align 8
%dec = add nsw i64 %i3.096, -1
%cmp6 = icmp sgt i64 %i3.096, 0
br i1 %cmp6, label %for.body9, label %for.cond.cleanup8, !llvm.loop !20
for.cond26.loopexit: ; preds = %for.body37, %for.body31
%exitcond103.not = icmp eq i64 %i25.0100, %10
br i1 %exitcond103.not, label %vector.body119, label %for.body31, !llvm.loop !21
vector.body119: ; preds = %for.cond.cleanup8.thread, %for.cond.cleanup8, %for.cond26.loopexit
%wide.load121 = load <2 x i64>, ptr %arr, align 16, !tbaa !5
%16 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 2
%wide.load121.1 = load <2 x i64>, ptr %16, align 16, !tbaa !5
%17 = add <2 x i64> %wide.load121.1, %wide.load121
%18 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 4
%wide.load121.2 = load <2 x i64>, ptr %18, align 16, !tbaa !5
%19 = add <2 x i64> %wide.load121.2, %17
%20 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 6
%wide.load121.3 = load <2 x i64>, ptr %20, align 16, !tbaa !5
%21 = add <2 x i64> %wide.load121.3, %19
%22 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 8
%wide.load121.4 = load <2 x i64>, ptr %22, align 16, !tbaa !5
%23 = add <2 x i64> %wide.load121.4, %21
%24 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 10
%wide.load121.5 = load <2 x i64>, ptr %24, align 16, !tbaa !5
%25 = add <2 x i64> %wide.load121.5, %23
%26 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 12
%wide.load121.6 = load <2 x i64>, ptr %26, align 16, !tbaa !5
%27 = add <2 x i64> %wide.load121.6, %25
%28 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 14
%wide.load121.7 = load <2 x i64>, ptr %28, align 16, !tbaa !5
%29 = add <2 x i64> %wide.load121.7, %27
%30 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 16
%wide.load121.8 = load <2 x i64>, ptr %30, align 16, !tbaa !5
%31 = add <2 x i64> %wide.load121.8, %29
%32 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 18
%wide.load121.9 = load <2 x i64>, ptr %32, align 16, !tbaa !5
%33 = add <2 x i64> %wide.load121.9, %31
%34 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 20
%wide.load121.10 = load <2 x i64>, ptr %34, align 16, !tbaa !5
%35 = add <2 x i64> %wide.load121.10, %33
%36 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 22
%wide.load121.11 = load <2 x i64>, ptr %36, align 16, !tbaa !5
%37 = add <2 x i64> %wide.load121.11, %35
%38 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 24
%wide.load121.12 = load <2 x i64>, ptr %38, align 16, !tbaa !5
%39 = add <2 x i64> %wide.load121.12, %37
%40 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 26
%wide.load121.13 = load <2 x i64>, ptr %40, align 16, !tbaa !5
%41 = add <2 x i64> %wide.load121.13, %39
%42 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 28
%wide.load121.14 = load <2 x i64>, ptr %42, align 16, !tbaa !5
%43 = add <2 x i64> %wide.load121.14, %41
%44 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 30
%wide.load121.15 = load <2 x i64>, ptr %44, align 16, !tbaa !5
%45 = add <2 x i64> %wide.load121.15, %43
%46 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 32
%wide.load121.16 = load <2 x i64>, ptr %46, align 16, !tbaa !5
%47 = add <2 x i64> %wide.load121.16, %45
%48 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 34
%wide.load121.17 = load <2 x i64>, ptr %48, align 16, !tbaa !5
%49 = add <2 x i64> %wide.load121.17, %47
%50 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 36
%wide.load121.18 = load <2 x i64>, ptr %50, align 16, !tbaa !5
%51 = add <2 x i64> %wide.load121.18, %49
%52 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 38
%wide.load121.19 = load <2 x i64>, ptr %52, align 16, !tbaa !5
%53 = add <2 x i64> %wide.load121.19, %51
%54 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 40
%wide.load121.20 = load <2 x i64>, ptr %54, align 16, !tbaa !5
%55 = add <2 x i64> %wide.load121.20, %53
%56 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 42
%wide.load121.21 = load <2 x i64>, ptr %56, align 16, !tbaa !5
%57 = add <2 x i64> %wide.load121.21, %55
%58 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 44
%wide.load121.22 = load <2 x i64>, ptr %58, align 16, !tbaa !5
%59 = add <2 x i64> %wide.load121.22, %57
%60 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 46
%wide.load121.23 = load <2 x i64>, ptr %60, align 16, !tbaa !5
%61 = add <2 x i64> %wide.load121.23, %59
%62 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 48
%wide.load121.24 = load <2 x i64>, ptr %62, align 16, !tbaa !5
%63 = add <2 x i64> %wide.load121.24, %61
%64 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 50
%wide.load121.25 = load <2 x i64>, ptr %64, align 16, !tbaa !5
%65 = add <2 x i64> %wide.load121.25, %63
%66 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 52
%wide.load121.26 = load <2 x i64>, ptr %66, align 16, !tbaa !5
%67 = add <2 x i64> %wide.load121.26, %65
%68 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 54
%wide.load121.27 = load <2 x i64>, ptr %68, align 16, !tbaa !5
%69 = add <2 x i64> %wide.load121.27, %67
%70 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 56
%wide.load121.28 = load <2 x i64>, ptr %70, align 16, !tbaa !5
%71 = add <2 x i64> %wide.load121.28, %69
%72 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 58
%wide.load121.29 = load <2 x i64>, ptr %72, align 16, !tbaa !5
%73 = add <2 x i64> %wide.load121.29, %71
%74 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 60
%wide.load121.30 = load <2 x i64>, ptr %74, align 16, !tbaa !5
%75 = add <2 x i64> %wide.load121.30, %73
%76 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 62
%wide.load121.31 = load <2 x i64>, ptr %76, align 16, !tbaa !5
%77 = add <2 x i64> %wide.load121.31, %75
%78 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 64
%wide.load121.32 = load <2 x i64>, ptr %78, align 16, !tbaa !5
%79 = add <2 x i64> %wide.load121.32, %77
%80 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 66
%wide.load121.33 = load <2 x i64>, ptr %80, align 16, !tbaa !5
%81 = add <2 x i64> %wide.load121.33, %79
%82 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 68
%wide.load121.34 = load <2 x i64>, ptr %82, align 16, !tbaa !5
%83 = add <2 x i64> %wide.load121.34, %81
%84 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 70
%wide.load121.35 = load <2 x i64>, ptr %84, align 16, !tbaa !5
%85 = add <2 x i64> %wide.load121.35, %83
%86 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 72
%wide.load121.36 = load <2 x i64>, ptr %86, align 16, !tbaa !5
%87 = add <2 x i64> %wide.load121.36, %85
%88 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 74
%wide.load121.37 = load <2 x i64>, ptr %88, align 16, !tbaa !5
%89 = add <2 x i64> %wide.load121.37, %87
%90 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 76
%wide.load121.38 = load <2 x i64>, ptr %90, align 16, !tbaa !5
%91 = add <2 x i64> %wide.load121.38, %89
%92 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 78
%wide.load121.39 = load <2 x i64>, ptr %92, align 16, !tbaa !5
%93 = add <2 x i64> %wide.load121.39, %91
%94 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 80
%wide.load121.40 = load <2 x i64>, ptr %94, align 16, !tbaa !5
%95 = add <2 x i64> %wide.load121.40, %93
%96 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 82
%wide.load121.41 = load <2 x i64>, ptr %96, align 16, !tbaa !5
%97 = add <2 x i64> %wide.load121.41, %95
%98 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 84
%wide.load121.42 = load <2 x i64>, ptr %98, align 16, !tbaa !5
%99 = add <2 x i64> %wide.load121.42, %97
%100 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 86
%wide.load121.43 = load <2 x i64>, ptr %100, align 16, !tbaa !5
%101 = add <2 x i64> %wide.load121.43, %99
%102 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 88
%wide.load121.44 = load <2 x i64>, ptr %102, align 16, !tbaa !5
%103 = add <2 x i64> %wide.load121.44, %101
%104 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 90
%wide.load121.45 = load <2 x i64>, ptr %104, align 16, !tbaa !5
%105 = add <2 x i64> %wide.load121.45, %103
%106 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 92
%wide.load121.46 = load <2 x i64>, ptr %106, align 16, !tbaa !5
%107 = add <2 x i64> %wide.load121.46, %105
%108 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 94
%wide.load121.47 = load <2 x i64>, ptr %108, align 16, !tbaa !5
%109 = add <2 x i64> %wide.load121.47, %107
%110 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 96
%wide.load121.48 = load <2 x i64>, ptr %110, align 16, !tbaa !5
%111 = add <2 x i64> %wide.load121.48, %109
%112 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 98
%wide.load121.49 = load <2 x i64>, ptr %112, align 16, !tbaa !5
%113 = add <2 x i64> %wide.load121.49, %111
%114 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %113)
%call72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %114)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %arr) #6
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %flag) #6
call void @llvm.lifetime.end.p0(i64 240008, ptr nonnull %cnt) #6
call void @llvm.lifetime.end.p0(i64 30001, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
ret i32 0
for.body31: ; preds = %for.body31.preheader, %for.cond26.loopexit
%i25.0100 = phi i64 [ %add32, %for.cond26.loopexit ], [ 0, %for.body31.preheader ]
%add32 = add nuw nsw i64 %i25.0100, 1
%cmp3497 = icmp slt i64 %add32, %0
br i1 %cmp3497, label %for.body37.lr.ph, label %for.cond26.loopexit
for.body37.lr.ph: ; preds = %for.body31
%arrayidx38 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %i25.0100
%115 = load i8, ptr %arrayidx38, align 1, !tbaa !9
%conv39 = sext i8 %115 to i64
%mul = mul nsw i64 %conv39, 10
br label %for.body37
for.body37: ; preds = %for.body37.lr.ph, %for.body37
%j.098 = phi i64 [ %add32, %for.body37.lr.ph ], [ %inc56, %for.body37 ]
%arrayidx40 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %j.098
%116 = load i8, ptr %arrayidx40, align 1, !tbaa !9
%conv41 = sext i8 %116 to i64
%add42 = add nsw i64 %mul, %conv41
%arrayidx44 = getelementptr inbounds [100 x i64], ptr %arr, i64 0, i64 %add42
%117 = load i64, ptr %arrayidx44, align 8, !tbaa !5
%arrayidx45 = getelementptr inbounds [30001 x i64], ptr %cnt, i64 0, i64 %j.098
%118 = load i64, ptr %arrayidx45, align 8, !tbaa !5
%cond.i = call i64 @llvm.smax.i64(i64 %117, i64 %118)
store i64 %cond.i, ptr %arrayidx44, align 8, !tbaa !5
%inc56 = add nuw nsw i64 %j.098, 1
%cmp34 = icmp slt i64 %inc56, %0
br i1 %cmp34, label %for.body37, label %for.cond26.loopexit, !llvm.loop !22
}
; 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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.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) #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 i64 @llvm.smax.i64(i64, i64) #5
; 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 nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !11, !13, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
|
#include<stdio.h>
int main(){
int n;scanf("%d",&n);
char s[50000];scanf("%s",s);
int cnt=0,ans=0;
for(int i=0;i<=9;i++){
for(int j=0;j<=9;j++){
for(int k=0;k<=9;k++){
cnt=0;
for(int l=0;l<n;l++){
switch(cnt){
case 0:
if(s[l]-'0'==i)cnt++;
break;
case 1:
if(s[l]-'0'==j)cnt++;
break;
case 2:
if(s[l]-'0'==k)cnt++;
break;
}
if(cnt==3)break;
}
if(cnt==3)ans++;
}
}
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158144/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158144/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [50000 x i8], align 16
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)
call void @llvm.lifetime.start.p0(i64 50000, ptr nonnull %s) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp1185 = icmp sgt i32 %0, 0
br i1 %cmp1185, label %for.cond2.preheader.us.preheader, label %for.cond.cleanup
for.cond2.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%wide.trip.count = zext i32 %0 to i64
br label %for.cond2.preheader.us
for.cond2.preheader.us: ; preds = %for.cond2.preheader.us.preheader, %for.cond.cleanup4.split.us.us
%i.096.us = phi i32 [ %inc55.us, %for.cond.cleanup4.split.us.us ], [ 0, %for.cond2.preheader.us.preheader ]
%ans.095.us = phi i32 [ %spec.select81.us.us.us.9, %for.cond.cleanup4.split.us.us ], [ 0, %for.cond2.preheader.us.preheader ]
br label %for.cond6.preheader.us.us
for.cond6.preheader.us.us: ; preds = %cleanup.us.us.us.9, %for.cond2.preheader.us
%j.093.us.us = phi i32 [ 0, %for.cond2.preheader.us ], [ %inc51.us.us, %cleanup.us.us.us.9 ]
%ans.192.us.us = phi i32 [ %ans.095.us, %for.cond2.preheader.us ], [ %spec.select81.us.us.us.9, %cleanup.us.us.us.9 ]
br label %for.body13.us.us.us
for.body13.us.us.us: ; preds = %for.inc.us.us.us, %for.cond6.preheader.us.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc.us.us.us ], [ 0, %for.cond6.preheader.us.us ]
%cmp1188.us.us.us = phi i1 [ %cmp11.us.us.us, %for.inc.us.us.us ], [ true, %for.cond6.preheader.us.us ]
%cnt.086.us.us.us = phi i32 [ %cnt.1.ph.us.us.us, %for.inc.us.us.us ], [ 0, %for.cond6.preheader.us.us ]
switch i32 %cnt.086.us.us.us, label %for.inc.us.us.us [
i32 0, label %sw.bb.us.us.us
i32 1, label %sw.bb16.us.us.us
i32 2, label %sw.bb26.us.us.us
]
sw.bb26.us.us.us: ; preds = %for.body13.us.us.us
%arrayidx28.us.us.us = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx28.us.us.us, align 1, !tbaa !9
%cmp31.us.us.us = icmp eq i8 %2, 48
br i1 %cmp31.us.us.us, label %cleanup.us.us.us, label %for.inc.us.us.us
cleanup.us.us.us: ; preds = %for.inc.us.us.us, %sw.bb26.us.us.us
%cmp11.lcssa.us.us.us = phi i1 [ %cmp1188.us.us.us, %sw.bb26.us.us.us ], [ %cmp11.us.us.us, %for.inc.us.us.us ]
%inc44.us.us.us = zext i1 %cmp11.lcssa.us.us.us to i32
%spec.select81.us.us.us = add nsw i32 %ans.192.us.us, %inc44.us.us.us
br label %for.body13.us.us.us.1
for.body13.us.us.us.1: ; preds = %for.inc.us.us.us.1, %cleanup.us.us.us
%indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %for.inc.us.us.us.1 ], [ 0, %cleanup.us.us.us ]
%cmp1188.us.us.us.1 = phi i1 [ %cmp11.us.us.us.1, %for.inc.us.us.us.1 ], [ true, %cleanup.us.us.us ]
%cnt.086.us.us.us.1 = phi i32 [ %cnt.1.ph.us.us.us.1, %for.inc.us.us.us.1 ], [ 0, %cleanup.us.us.us ]
switch i32 %cnt.086.us.us.us.1, label %for.inc.us.us.us.1 [
i32 0, label %sw.bb.us.us.us.1
i32 1, label %sw.bb16.us.us.us.1
i32 2, label %sw.bb26.us.us.us.1
]
sw.bb26.us.us.us.1: ; preds = %for.body13.us.us.us.1
%arrayidx28.us.us.us.1 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.1
%3 = load i8, ptr %arrayidx28.us.us.us.1, align 1, !tbaa !9
%cmp31.us.us.us.1 = icmp eq i8 %3, 49
br i1 %cmp31.us.us.us.1, label %cleanup.us.us.us.1, label %for.inc.us.us.us.1
sw.bb16.us.us.us.1: ; preds = %for.body13.us.us.us.1
%arrayidx18.us.us.us.1 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.1
%4 = load i8, ptr %arrayidx18.us.us.us.1, align 1, !tbaa !9
%conv19.us.us.us.1 = sext i8 %4 to i32
%sub20.us.us.us.1 = add nsw i32 %conv19.us.us.us.1, -48
%cmp21.us.us.us.1 = icmp eq i32 %sub20.us.us.us.1, %j.093.us.us
%spec.select79.us.us.us.1 = select i1 %cmp21.us.us.us.1, i32 2, i32 1
br label %for.inc.us.us.us.1
sw.bb.us.us.us.1: ; preds = %for.body13.us.us.us.1
%arrayidx.us.us.us.1 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.1
%5 = load i8, ptr %arrayidx.us.us.us.1, align 1, !tbaa !9
%conv.us.us.us.1 = sext i8 %5 to i32
%sub.us.us.us.1 = add nsw i32 %conv.us.us.us.1, -48
%cmp14.us.us.us.1 = icmp eq i32 %sub.us.us.us.1, %i.096.us
%spec.select.us.us.us.1 = zext i1 %cmp14.us.us.us.1 to i32
br label %for.inc.us.us.us.1
for.inc.us.us.us.1: ; preds = %sw.bb.us.us.us.1, %sw.bb16.us.us.us.1, %sw.bb26.us.us.us.1, %for.body13.us.us.us.1
%cnt.1.ph.us.us.us.1 = phi i32 [ 2, %sw.bb26.us.us.us.1 ], [ %spec.select79.us.us.us.1, %sw.bb16.us.us.us.1 ], [ %spec.select.us.us.us.1, %sw.bb.us.us.us.1 ], [ %cnt.086.us.us.us.1, %for.body13.us.us.us.1 ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
%cmp11.us.us.us.1 = icmp ult i64 %indvars.iv.next.1, %1
%exitcond.1.not = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
br i1 %exitcond.1.not, label %cleanup.us.us.us.1, label %for.body13.us.us.us.1, !llvm.loop !10
cleanup.us.us.us.1: ; preds = %for.inc.us.us.us.1, %sw.bb26.us.us.us.1
%cmp11.lcssa.us.us.us.1 = phi i1 [ %cmp1188.us.us.us.1, %sw.bb26.us.us.us.1 ], [ %cmp11.us.us.us.1, %for.inc.us.us.us.1 ]
%inc44.us.us.us.1 = zext i1 %cmp11.lcssa.us.us.us.1 to i32
%spec.select81.us.us.us.1 = add nsw i32 %spec.select81.us.us.us, %inc44.us.us.us.1
br label %for.body13.us.us.us.2
for.body13.us.us.us.2: ; preds = %for.inc.us.us.us.2, %cleanup.us.us.us.1
%indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %for.inc.us.us.us.2 ], [ 0, %cleanup.us.us.us.1 ]
%cmp1188.us.us.us.2 = phi i1 [ %cmp11.us.us.us.2, %for.inc.us.us.us.2 ], [ true, %cleanup.us.us.us.1 ]
%cnt.086.us.us.us.2 = phi i32 [ %cnt.1.ph.us.us.us.2, %for.inc.us.us.us.2 ], [ 0, %cleanup.us.us.us.1 ]
switch i32 %cnt.086.us.us.us.2, label %for.inc.us.us.us.2 [
i32 0, label %sw.bb.us.us.us.2
i32 1, label %sw.bb16.us.us.us.2
i32 2, label %sw.bb26.us.us.us.2
]
sw.bb26.us.us.us.2: ; preds = %for.body13.us.us.us.2
%arrayidx28.us.us.us.2 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.2
%6 = load i8, ptr %arrayidx28.us.us.us.2, align 1, !tbaa !9
%cmp31.us.us.us.2 = icmp eq i8 %6, 50
br i1 %cmp31.us.us.us.2, label %cleanup.us.us.us.2, label %for.inc.us.us.us.2
sw.bb16.us.us.us.2: ; preds = %for.body13.us.us.us.2
%arrayidx18.us.us.us.2 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.2
%7 = load i8, ptr %arrayidx18.us.us.us.2, align 1, !tbaa !9
%conv19.us.us.us.2 = sext i8 %7 to i32
%sub20.us.us.us.2 = add nsw i32 %conv19.us.us.us.2, -48
%cmp21.us.us.us.2 = icmp eq i32 %sub20.us.us.us.2, %j.093.us.us
%spec.select79.us.us.us.2 = select i1 %cmp21.us.us.us.2, i32 2, i32 1
br label %for.inc.us.us.us.2
sw.bb.us.us.us.2: ; preds = %for.body13.us.us.us.2
%arrayidx.us.us.us.2 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.2
%8 = load i8, ptr %arrayidx.us.us.us.2, align 1, !tbaa !9
%conv.us.us.us.2 = sext i8 %8 to i32
%sub.us.us.us.2 = add nsw i32 %conv.us.us.us.2, -48
%cmp14.us.us.us.2 = icmp eq i32 %sub.us.us.us.2, %i.096.us
%spec.select.us.us.us.2 = zext i1 %cmp14.us.us.us.2 to i32
br label %for.inc.us.us.us.2
for.inc.us.us.us.2: ; preds = %sw.bb.us.us.us.2, %sw.bb16.us.us.us.2, %sw.bb26.us.us.us.2, %for.body13.us.us.us.2
%cnt.1.ph.us.us.us.2 = phi i32 [ 2, %sw.bb26.us.us.us.2 ], [ %spec.select79.us.us.us.2, %sw.bb16.us.us.us.2 ], [ %spec.select.us.us.us.2, %sw.bb.us.us.us.2 ], [ %cnt.086.us.us.us.2, %for.body13.us.us.us.2 ]
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
%cmp11.us.us.us.2 = icmp ult i64 %indvars.iv.next.2, %1
%exitcond.2.not = icmp eq i64 %indvars.iv.next.2, %wide.trip.count
br i1 %exitcond.2.not, label %cleanup.us.us.us.2, label %for.body13.us.us.us.2, !llvm.loop !10
cleanup.us.us.us.2: ; preds = %for.inc.us.us.us.2, %sw.bb26.us.us.us.2
%cmp11.lcssa.us.us.us.2 = phi i1 [ %cmp1188.us.us.us.2, %sw.bb26.us.us.us.2 ], [ %cmp11.us.us.us.2, %for.inc.us.us.us.2 ]
%inc44.us.us.us.2 = zext i1 %cmp11.lcssa.us.us.us.2 to i32
%spec.select81.us.us.us.2 = add nsw i32 %spec.select81.us.us.us.1, %inc44.us.us.us.2
br label %for.body13.us.us.us.3
for.body13.us.us.us.3: ; preds = %for.inc.us.us.us.3, %cleanup.us.us.us.2
%indvars.iv.3 = phi i64 [ %indvars.iv.next.3, %for.inc.us.us.us.3 ], [ 0, %cleanup.us.us.us.2 ]
%cmp1188.us.us.us.3 = phi i1 [ %cmp11.us.us.us.3, %for.inc.us.us.us.3 ], [ true, %cleanup.us.us.us.2 ]
%cnt.086.us.us.us.3 = phi i32 [ %cnt.1.ph.us.us.us.3, %for.inc.us.us.us.3 ], [ 0, %cleanup.us.us.us.2 ]
switch i32 %cnt.086.us.us.us.3, label %for.inc.us.us.us.3 [
i32 0, label %sw.bb.us.us.us.3
i32 1, label %sw.bb16.us.us.us.3
i32 2, label %sw.bb26.us.us.us.3
]
sw.bb26.us.us.us.3: ; preds = %for.body13.us.us.us.3
%arrayidx28.us.us.us.3 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.3
%9 = load i8, ptr %arrayidx28.us.us.us.3, align 1, !tbaa !9
%cmp31.us.us.us.3 = icmp eq i8 %9, 51
br i1 %cmp31.us.us.us.3, label %cleanup.us.us.us.3, label %for.inc.us.us.us.3
sw.bb16.us.us.us.3: ; preds = %for.body13.us.us.us.3
%arrayidx18.us.us.us.3 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.3
%10 = load i8, ptr %arrayidx18.us.us.us.3, align 1, !tbaa !9
%conv19.us.us.us.3 = sext i8 %10 to i32
%sub20.us.us.us.3 = add nsw i32 %conv19.us.us.us.3, -48
%cmp21.us.us.us.3 = icmp eq i32 %sub20.us.us.us.3, %j.093.us.us
%spec.select79.us.us.us.3 = select i1 %cmp21.us.us.us.3, i32 2, i32 1
br label %for.inc.us.us.us.3
sw.bb.us.us.us.3: ; preds = %for.body13.us.us.us.3
%arrayidx.us.us.us.3 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.3
%11 = load i8, ptr %arrayidx.us.us.us.3, align 1, !tbaa !9
%conv.us.us.us.3 = sext i8 %11 to i32
%sub.us.us.us.3 = add nsw i32 %conv.us.us.us.3, -48
%cmp14.us.us.us.3 = icmp eq i32 %sub.us.us.us.3, %i.096.us
%spec.select.us.us.us.3 = zext i1 %cmp14.us.us.us.3 to i32
br label %for.inc.us.us.us.3
for.inc.us.us.us.3: ; preds = %sw.bb.us.us.us.3, %sw.bb16.us.us.us.3, %sw.bb26.us.us.us.3, %for.body13.us.us.us.3
%cnt.1.ph.us.us.us.3 = phi i32 [ 2, %sw.bb26.us.us.us.3 ], [ %spec.select79.us.us.us.3, %sw.bb16.us.us.us.3 ], [ %spec.select.us.us.us.3, %sw.bb.us.us.us.3 ], [ %cnt.086.us.us.us.3, %for.body13.us.us.us.3 ]
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
%cmp11.us.us.us.3 = icmp ult i64 %indvars.iv.next.3, %1
%exitcond.3.not = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.3.not, label %cleanup.us.us.us.3, label %for.body13.us.us.us.3, !llvm.loop !10
cleanup.us.us.us.3: ; preds = %for.inc.us.us.us.3, %sw.bb26.us.us.us.3
%cmp11.lcssa.us.us.us.3 = phi i1 [ %cmp1188.us.us.us.3, %sw.bb26.us.us.us.3 ], [ %cmp11.us.us.us.3, %for.inc.us.us.us.3 ]
%inc44.us.us.us.3 = zext i1 %cmp11.lcssa.us.us.us.3 to i32
%spec.select81.us.us.us.3 = add nsw i32 %spec.select81.us.us.us.2, %inc44.us.us.us.3
br label %for.body13.us.us.us.4
for.body13.us.us.us.4: ; preds = %for.inc.us.us.us.4, %cleanup.us.us.us.3
%indvars.iv.4 = phi i64 [ %indvars.iv.next.4, %for.inc.us.us.us.4 ], [ 0, %cleanup.us.us.us.3 ]
%cmp1188.us.us.us.4 = phi i1 [ %cmp11.us.us.us.4, %for.inc.us.us.us.4 ], [ true, %cleanup.us.us.us.3 ]
%cnt.086.us.us.us.4 = phi i32 [ %cnt.1.ph.us.us.us.4, %for.inc.us.us.us.4 ], [ 0, %cleanup.us.us.us.3 ]
switch i32 %cnt.086.us.us.us.4, label %for.inc.us.us.us.4 [
i32 0, label %sw.bb.us.us.us.4
i32 1, label %sw.bb16.us.us.us.4
i32 2, label %sw.bb26.us.us.us.4
]
sw.bb26.us.us.us.4: ; preds = %for.body13.us.us.us.4
%arrayidx28.us.us.us.4 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.4
%12 = load i8, ptr %arrayidx28.us.us.us.4, align 1, !tbaa !9
%cmp31.us.us.us.4 = icmp eq i8 %12, 52
br i1 %cmp31.us.us.us.4, label %cleanup.us.us.us.4, label %for.inc.us.us.us.4
sw.bb16.us.us.us.4: ; preds = %for.body13.us.us.us.4
%arrayidx18.us.us.us.4 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.4
%13 = load i8, ptr %arrayidx18.us.us.us.4, align 1, !tbaa !9
%conv19.us.us.us.4 = sext i8 %13 to i32
%sub20.us.us.us.4 = add nsw i32 %conv19.us.us.us.4, -48
%cmp21.us.us.us.4 = icmp eq i32 %sub20.us.us.us.4, %j.093.us.us
%spec.select79.us.us.us.4 = select i1 %cmp21.us.us.us.4, i32 2, i32 1
br label %for.inc.us.us.us.4
sw.bb.us.us.us.4: ; preds = %for.body13.us.us.us.4
%arrayidx.us.us.us.4 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.4
%14 = load i8, ptr %arrayidx.us.us.us.4, align 1, !tbaa !9
%conv.us.us.us.4 = sext i8 %14 to i32
%sub.us.us.us.4 = add nsw i32 %conv.us.us.us.4, -48
%cmp14.us.us.us.4 = icmp eq i32 %sub.us.us.us.4, %i.096.us
%spec.select.us.us.us.4 = zext i1 %cmp14.us.us.us.4 to i32
br label %for.inc.us.us.us.4
for.inc.us.us.us.4: ; preds = %sw.bb.us.us.us.4, %sw.bb16.us.us.us.4, %sw.bb26.us.us.us.4, %for.body13.us.us.us.4
%cnt.1.ph.us.us.us.4 = phi i32 [ 2, %sw.bb26.us.us.us.4 ], [ %spec.select79.us.us.us.4, %sw.bb16.us.us.us.4 ], [ %spec.select.us.us.us.4, %sw.bb.us.us.us.4 ], [ %cnt.086.us.us.us.4, %for.body13.us.us.us.4 ]
%indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
%cmp11.us.us.us.4 = icmp ult i64 %indvars.iv.next.4, %1
%exitcond.4.not = icmp eq i64 %indvars.iv.next.4, %wide.trip.count
br i1 %exitcond.4.not, label %cleanup.us.us.us.4, label %for.body13.us.us.us.4, !llvm.loop !10
cleanup.us.us.us.4: ; preds = %for.inc.us.us.us.4, %sw.bb26.us.us.us.4
%cmp11.lcssa.us.us.us.4 = phi i1 [ %cmp1188.us.us.us.4, %sw.bb26.us.us.us.4 ], [ %cmp11.us.us.us.4, %for.inc.us.us.us.4 ]
%inc44.us.us.us.4 = zext i1 %cmp11.lcssa.us.us.us.4 to i32
%spec.select81.us.us.us.4 = add nsw i32 %spec.select81.us.us.us.3, %inc44.us.us.us.4
br label %for.body13.us.us.us.5
for.body13.us.us.us.5: ; preds = %for.inc.us.us.us.5, %cleanup.us.us.us.4
%indvars.iv.5 = phi i64 [ %indvars.iv.next.5, %for.inc.us.us.us.5 ], [ 0, %cleanup.us.us.us.4 ]
%cmp1188.us.us.us.5 = phi i1 [ %cmp11.us.us.us.5, %for.inc.us.us.us.5 ], [ true, %cleanup.us.us.us.4 ]
%cnt.086.us.us.us.5 = phi i32 [ %cnt.1.ph.us.us.us.5, %for.inc.us.us.us.5 ], [ 0, %cleanup.us.us.us.4 ]
switch i32 %cnt.086.us.us.us.5, label %for.inc.us.us.us.5 [
i32 0, label %sw.bb.us.us.us.5
i32 1, label %sw.bb16.us.us.us.5
i32 2, label %sw.bb26.us.us.us.5
]
sw.bb26.us.us.us.5: ; preds = %for.body13.us.us.us.5
%arrayidx28.us.us.us.5 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.5
%15 = load i8, ptr %arrayidx28.us.us.us.5, align 1, !tbaa !9
%cmp31.us.us.us.5 = icmp eq i8 %15, 53
br i1 %cmp31.us.us.us.5, label %cleanup.us.us.us.5, label %for.inc.us.us.us.5
sw.bb16.us.us.us.5: ; preds = %for.body13.us.us.us.5
%arrayidx18.us.us.us.5 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.5
%16 = load i8, ptr %arrayidx18.us.us.us.5, align 1, !tbaa !9
%conv19.us.us.us.5 = sext i8 %16 to i32
%sub20.us.us.us.5 = add nsw i32 %conv19.us.us.us.5, -48
%cmp21.us.us.us.5 = icmp eq i32 %sub20.us.us.us.5, %j.093.us.us
%spec.select79.us.us.us.5 = select i1 %cmp21.us.us.us.5, i32 2, i32 1
br label %for.inc.us.us.us.5
sw.bb.us.us.us.5: ; preds = %for.body13.us.us.us.5
%arrayidx.us.us.us.5 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.5
%17 = load i8, ptr %arrayidx.us.us.us.5, align 1, !tbaa !9
%conv.us.us.us.5 = sext i8 %17 to i32
%sub.us.us.us.5 = add nsw i32 %conv.us.us.us.5, -48
%cmp14.us.us.us.5 = icmp eq i32 %sub.us.us.us.5, %i.096.us
%spec.select.us.us.us.5 = zext i1 %cmp14.us.us.us.5 to i32
br label %for.inc.us.us.us.5
for.inc.us.us.us.5: ; preds = %sw.bb.us.us.us.5, %sw.bb16.us.us.us.5, %sw.bb26.us.us.us.5, %for.body13.us.us.us.5
%cnt.1.ph.us.us.us.5 = phi i32 [ 2, %sw.bb26.us.us.us.5 ], [ %spec.select79.us.us.us.5, %sw.bb16.us.us.us.5 ], [ %spec.select.us.us.us.5, %sw.bb.us.us.us.5 ], [ %cnt.086.us.us.us.5, %for.body13.us.us.us.5 ]
%indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
%cmp11.us.us.us.5 = icmp ult i64 %indvars.iv.next.5, %1
%exitcond.5.not = icmp eq i64 %indvars.iv.next.5, %wide.trip.count
br i1 %exitcond.5.not, label %cleanup.us.us.us.5, label %for.body13.us.us.us.5, !llvm.loop !10
cleanup.us.us.us.5: ; preds = %for.inc.us.us.us.5, %sw.bb26.us.us.us.5
%cmp11.lcssa.us.us.us.5 = phi i1 [ %cmp1188.us.us.us.5, %sw.bb26.us.us.us.5 ], [ %cmp11.us.us.us.5, %for.inc.us.us.us.5 ]
%inc44.us.us.us.5 = zext i1 %cmp11.lcssa.us.us.us.5 to i32
%spec.select81.us.us.us.5 = add nsw i32 %spec.select81.us.us.us.4, %inc44.us.us.us.5
br label %for.body13.us.us.us.6
for.body13.us.us.us.6: ; preds = %for.inc.us.us.us.6, %cleanup.us.us.us.5
%indvars.iv.6 = phi i64 [ %indvars.iv.next.6, %for.inc.us.us.us.6 ], [ 0, %cleanup.us.us.us.5 ]
%cmp1188.us.us.us.6 = phi i1 [ %cmp11.us.us.us.6, %for.inc.us.us.us.6 ], [ true, %cleanup.us.us.us.5 ]
%cnt.086.us.us.us.6 = phi i32 [ %cnt.1.ph.us.us.us.6, %for.inc.us.us.us.6 ], [ 0, %cleanup.us.us.us.5 ]
switch i32 %cnt.086.us.us.us.6, label %for.inc.us.us.us.6 [
i32 0, label %sw.bb.us.us.us.6
i32 1, label %sw.bb16.us.us.us.6
i32 2, label %sw.bb26.us.us.us.6
]
sw.bb26.us.us.us.6: ; preds = %for.body13.us.us.us.6
%arrayidx28.us.us.us.6 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.6
%18 = load i8, ptr %arrayidx28.us.us.us.6, align 1, !tbaa !9
%cmp31.us.us.us.6 = icmp eq i8 %18, 54
br i1 %cmp31.us.us.us.6, label %cleanup.us.us.us.6, label %for.inc.us.us.us.6
sw.bb16.us.us.us.6: ; preds = %for.body13.us.us.us.6
%arrayidx18.us.us.us.6 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.6
%19 = load i8, ptr %arrayidx18.us.us.us.6, align 1, !tbaa !9
%conv19.us.us.us.6 = sext i8 %19 to i32
%sub20.us.us.us.6 = add nsw i32 %conv19.us.us.us.6, -48
%cmp21.us.us.us.6 = icmp eq i32 %sub20.us.us.us.6, %j.093.us.us
%spec.select79.us.us.us.6 = select i1 %cmp21.us.us.us.6, i32 2, i32 1
br label %for.inc.us.us.us.6
sw.bb.us.us.us.6: ; preds = %for.body13.us.us.us.6
%arrayidx.us.us.us.6 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.6
%20 = load i8, ptr %arrayidx.us.us.us.6, align 1, !tbaa !9
%conv.us.us.us.6 = sext i8 %20 to i32
%sub.us.us.us.6 = add nsw i32 %conv.us.us.us.6, -48
%cmp14.us.us.us.6 = icmp eq i32 %sub.us.us.us.6, %i.096.us
%spec.select.us.us.us.6 = zext i1 %cmp14.us.us.us.6 to i32
br label %for.inc.us.us.us.6
for.inc.us.us.us.6: ; preds = %sw.bb.us.us.us.6, %sw.bb16.us.us.us.6, %sw.bb26.us.us.us.6, %for.body13.us.us.us.6
%cnt.1.ph.us.us.us.6 = phi i32 [ 2, %sw.bb26.us.us.us.6 ], [ %spec.select79.us.us.us.6, %sw.bb16.us.us.us.6 ], [ %spec.select.us.us.us.6, %sw.bb.us.us.us.6 ], [ %cnt.086.us.us.us.6, %for.body13.us.us.us.6 ]
%indvars.iv.next.6 = add nuw nsw i64 %indvars.iv.6, 1
%cmp11.us.us.us.6 = icmp ult i64 %indvars.iv.next.6, %1
%exitcond.6.not = icmp eq i64 %indvars.iv.next.6, %wide.trip.count
br i1 %exitcond.6.not, label %cleanup.us.us.us.6, label %for.body13.us.us.us.6, !llvm.loop !10
cleanup.us.us.us.6: ; preds = %for.inc.us.us.us.6, %sw.bb26.us.us.us.6
%cmp11.lcssa.us.us.us.6 = phi i1 [ %cmp1188.us.us.us.6, %sw.bb26.us.us.us.6 ], [ %cmp11.us.us.us.6, %for.inc.us.us.us.6 ]
%inc44.us.us.us.6 = zext i1 %cmp11.lcssa.us.us.us.6 to i32
%spec.select81.us.us.us.6 = add nsw i32 %spec.select81.us.us.us.5, %inc44.us.us.us.6
br label %for.body13.us.us.us.7
for.body13.us.us.us.7: ; preds = %for.inc.us.us.us.7, %cleanup.us.us.us.6
%indvars.iv.7 = phi i64 [ %indvars.iv.next.7, %for.inc.us.us.us.7 ], [ 0, %cleanup.us.us.us.6 ]
%cmp1188.us.us.us.7 = phi i1 [ %cmp11.us.us.us.7, %for.inc.us.us.us.7 ], [ true, %cleanup.us.us.us.6 ]
%cnt.086.us.us.us.7 = phi i32 [ %cnt.1.ph.us.us.us.7, %for.inc.us.us.us.7 ], [ 0, %cleanup.us.us.us.6 ]
switch i32 %cnt.086.us.us.us.7, label %for.inc.us.us.us.7 [
i32 0, label %sw.bb.us.us.us.7
i32 1, label %sw.bb16.us.us.us.7
i32 2, label %sw.bb26.us.us.us.7
]
sw.bb26.us.us.us.7: ; preds = %for.body13.us.us.us.7
%arrayidx28.us.us.us.7 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.7
%21 = load i8, ptr %arrayidx28.us.us.us.7, align 1, !tbaa !9
%cmp31.us.us.us.7 = icmp eq i8 %21, 55
br i1 %cmp31.us.us.us.7, label %cleanup.us.us.us.7, label %for.inc.us.us.us.7
sw.bb16.us.us.us.7: ; preds = %for.body13.us.us.us.7
%arrayidx18.us.us.us.7 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.7
%22 = load i8, ptr %arrayidx18.us.us.us.7, align 1, !tbaa !9
%conv19.us.us.us.7 = sext i8 %22 to i32
%sub20.us.us.us.7 = add nsw i32 %conv19.us.us.us.7, -48
%cmp21.us.us.us.7 = icmp eq i32 %sub20.us.us.us.7, %j.093.us.us
%spec.select79.us.us.us.7 = select i1 %cmp21.us.us.us.7, i32 2, i32 1
br label %for.inc.us.us.us.7
sw.bb.us.us.us.7: ; preds = %for.body13.us.us.us.7
%arrayidx.us.us.us.7 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.7
%23 = load i8, ptr %arrayidx.us.us.us.7, align 1, !tbaa !9
%conv.us.us.us.7 = sext i8 %23 to i32
%sub.us.us.us.7 = add nsw i32 %conv.us.us.us.7, -48
%cmp14.us.us.us.7 = icmp eq i32 %sub.us.us.us.7, %i.096.us
%spec.select.us.us.us.7 = zext i1 %cmp14.us.us.us.7 to i32
br label %for.inc.us.us.us.7
for.inc.us.us.us.7: ; preds = %sw.bb.us.us.us.7, %sw.bb16.us.us.us.7, %sw.bb26.us.us.us.7, %for.body13.us.us.us.7
%cnt.1.ph.us.us.us.7 = phi i32 [ 2, %sw.bb26.us.us.us.7 ], [ %spec.select79.us.us.us.7, %sw.bb16.us.us.us.7 ], [ %spec.select.us.us.us.7, %sw.bb.us.us.us.7 ], [ %cnt.086.us.us.us.7, %for.body13.us.us.us.7 ]
%indvars.iv.next.7 = add nuw nsw i64 %indvars.iv.7, 1
%cmp11.us.us.us.7 = icmp ult i64 %indvars.iv.next.7, %1
%exitcond.7.not = icmp eq i64 %indvars.iv.next.7, %wide.trip.count
br i1 %exitcond.7.not, label %cleanup.us.us.us.7, label %for.body13.us.us.us.7, !llvm.loop !10
cleanup.us.us.us.7: ; preds = %for.inc.us.us.us.7, %sw.bb26.us.us.us.7
%cmp11.lcssa.us.us.us.7 = phi i1 [ %cmp1188.us.us.us.7, %sw.bb26.us.us.us.7 ], [ %cmp11.us.us.us.7, %for.inc.us.us.us.7 ]
%inc44.us.us.us.7 = zext i1 %cmp11.lcssa.us.us.us.7 to i32
%spec.select81.us.us.us.7 = add nsw i32 %spec.select81.us.us.us.6, %inc44.us.us.us.7
br label %for.body13.us.us.us.8
for.body13.us.us.us.8: ; preds = %for.inc.us.us.us.8, %cleanup.us.us.us.7
%indvars.iv.8 = phi i64 [ %indvars.iv.next.8, %for.inc.us.us.us.8 ], [ 0, %cleanup.us.us.us.7 ]
%cmp1188.us.us.us.8 = phi i1 [ %cmp11.us.us.us.8, %for.inc.us.us.us.8 ], [ true, %cleanup.us.us.us.7 ]
%cnt.086.us.us.us.8 = phi i32 [ %cnt.1.ph.us.us.us.8, %for.inc.us.us.us.8 ], [ 0, %cleanup.us.us.us.7 ]
switch i32 %cnt.086.us.us.us.8, label %for.inc.us.us.us.8 [
i32 0, label %sw.bb.us.us.us.8
i32 1, label %sw.bb16.us.us.us.8
i32 2, label %sw.bb26.us.us.us.8
]
sw.bb26.us.us.us.8: ; preds = %for.body13.us.us.us.8
%arrayidx28.us.us.us.8 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.8
%24 = load i8, ptr %arrayidx28.us.us.us.8, align 1, !tbaa !9
%cmp31.us.us.us.8 = icmp eq i8 %24, 56
br i1 %cmp31.us.us.us.8, label %cleanup.us.us.us.8, label %for.inc.us.us.us.8
sw.bb16.us.us.us.8: ; preds = %for.body13.us.us.us.8
%arrayidx18.us.us.us.8 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.8
%25 = load i8, ptr %arrayidx18.us.us.us.8, align 1, !tbaa !9
%conv19.us.us.us.8 = sext i8 %25 to i32
%sub20.us.us.us.8 = add nsw i32 %conv19.us.us.us.8, -48
%cmp21.us.us.us.8 = icmp eq i32 %sub20.us.us.us.8, %j.093.us.us
%spec.select79.us.us.us.8 = select i1 %cmp21.us.us.us.8, i32 2, i32 1
br label %for.inc.us.us.us.8
sw.bb.us.us.us.8: ; preds = %for.body13.us.us.us.8
%arrayidx.us.us.us.8 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.8
%26 = load i8, ptr %arrayidx.us.us.us.8, align 1, !tbaa !9
%conv.us.us.us.8 = sext i8 %26 to i32
%sub.us.us.us.8 = add nsw i32 %conv.us.us.us.8, -48
%cmp14.us.us.us.8 = icmp eq i32 %sub.us.us.us.8, %i.096.us
%spec.select.us.us.us.8 = zext i1 %cmp14.us.us.us.8 to i32
br label %for.inc.us.us.us.8
for.inc.us.us.us.8: ; preds = %sw.bb.us.us.us.8, %sw.bb16.us.us.us.8, %sw.bb26.us.us.us.8, %for.body13.us.us.us.8
%cnt.1.ph.us.us.us.8 = phi i32 [ 2, %sw.bb26.us.us.us.8 ], [ %spec.select79.us.us.us.8, %sw.bb16.us.us.us.8 ], [ %spec.select.us.us.us.8, %sw.bb.us.us.us.8 ], [ %cnt.086.us.us.us.8, %for.body13.us.us.us.8 ]
%indvars.iv.next.8 = add nuw nsw i64 %indvars.iv.8, 1
%cmp11.us.us.us.8 = icmp ult i64 %indvars.iv.next.8, %1
%exitcond.8.not = icmp eq i64 %indvars.iv.next.8, %wide.trip.count
br i1 %exitcond.8.not, label %cleanup.us.us.us.8, label %for.body13.us.us.us.8, !llvm.loop !10
cleanup.us.us.us.8: ; preds = %for.inc.us.us.us.8, %sw.bb26.us.us.us.8
%cmp11.lcssa.us.us.us.8 = phi i1 [ %cmp1188.us.us.us.8, %sw.bb26.us.us.us.8 ], [ %cmp11.us.us.us.8, %for.inc.us.us.us.8 ]
%inc44.us.us.us.8 = zext i1 %cmp11.lcssa.us.us.us.8 to i32
%spec.select81.us.us.us.8 = add nsw i32 %spec.select81.us.us.us.7, %inc44.us.us.us.8
br label %for.body13.us.us.us.9
for.body13.us.us.us.9: ; preds = %for.inc.us.us.us.9, %cleanup.us.us.us.8
%indvars.iv.9 = phi i64 [ %indvars.iv.next.9, %for.inc.us.us.us.9 ], [ 0, %cleanup.us.us.us.8 ]
%cmp1188.us.us.us.9 = phi i1 [ %cmp11.us.us.us.9, %for.inc.us.us.us.9 ], [ true, %cleanup.us.us.us.8 ]
%cnt.086.us.us.us.9 = phi i32 [ %cnt.1.ph.us.us.us.9, %for.inc.us.us.us.9 ], [ 0, %cleanup.us.us.us.8 ]
switch i32 %cnt.086.us.us.us.9, label %for.inc.us.us.us.9 [
i32 0, label %sw.bb.us.us.us.9
i32 1, label %sw.bb16.us.us.us.9
i32 2, label %sw.bb26.us.us.us.9
]
sw.bb26.us.us.us.9: ; preds = %for.body13.us.us.us.9
%arrayidx28.us.us.us.9 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.9
%27 = load i8, ptr %arrayidx28.us.us.us.9, align 1, !tbaa !9
%cmp31.us.us.us.9 = icmp eq i8 %27, 57
br i1 %cmp31.us.us.us.9, label %cleanup.us.us.us.9, label %for.inc.us.us.us.9
sw.bb16.us.us.us.9: ; preds = %for.body13.us.us.us.9
%arrayidx18.us.us.us.9 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.9
%28 = load i8, ptr %arrayidx18.us.us.us.9, align 1, !tbaa !9
%conv19.us.us.us.9 = sext i8 %28 to i32
%sub20.us.us.us.9 = add nsw i32 %conv19.us.us.us.9, -48
%cmp21.us.us.us.9 = icmp eq i32 %sub20.us.us.us.9, %j.093.us.us
%spec.select79.us.us.us.9 = select i1 %cmp21.us.us.us.9, i32 2, i32 1
br label %for.inc.us.us.us.9
sw.bb.us.us.us.9: ; preds = %for.body13.us.us.us.9
%arrayidx.us.us.us.9 = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv.9
%29 = load i8, ptr %arrayidx.us.us.us.9, align 1, !tbaa !9
%conv.us.us.us.9 = sext i8 %29 to i32
%sub.us.us.us.9 = add nsw i32 %conv.us.us.us.9, -48
%cmp14.us.us.us.9 = icmp eq i32 %sub.us.us.us.9, %i.096.us
%spec.select.us.us.us.9 = zext i1 %cmp14.us.us.us.9 to i32
br label %for.inc.us.us.us.9
for.inc.us.us.us.9: ; preds = %sw.bb.us.us.us.9, %sw.bb16.us.us.us.9, %sw.bb26.us.us.us.9, %for.body13.us.us.us.9
%cnt.1.ph.us.us.us.9 = phi i32 [ 2, %sw.bb26.us.us.us.9 ], [ %spec.select79.us.us.us.9, %sw.bb16.us.us.us.9 ], [ %spec.select.us.us.us.9, %sw.bb.us.us.us.9 ], [ %cnt.086.us.us.us.9, %for.body13.us.us.us.9 ]
%indvars.iv.next.9 = add nuw nsw i64 %indvars.iv.9, 1
%cmp11.us.us.us.9 = icmp ult i64 %indvars.iv.next.9, %1
%exitcond.9.not = icmp eq i64 %indvars.iv.next.9, %wide.trip.count
br i1 %exitcond.9.not, label %cleanup.us.us.us.9, label %for.body13.us.us.us.9, !llvm.loop !10
cleanup.us.us.us.9: ; preds = %for.inc.us.us.us.9, %sw.bb26.us.us.us.9
%cmp11.lcssa.us.us.us.9 = phi i1 [ %cmp1188.us.us.us.9, %sw.bb26.us.us.us.9 ], [ %cmp11.us.us.us.9, %for.inc.us.us.us.9 ]
%inc44.us.us.us.9 = zext i1 %cmp11.lcssa.us.us.us.9 to i32
%spec.select81.us.us.us.9 = add nsw i32 %spec.select81.us.us.us.8, %inc44.us.us.us.9
%inc51.us.us = add nuw nsw i32 %j.093.us.us, 1
%exitcond99.not = icmp eq i32 %inc51.us.us, 10
br i1 %exitcond99.not, label %for.cond.cleanup4.split.us.us, label %for.cond6.preheader.us.us, !llvm.loop !12
sw.bb16.us.us.us: ; preds = %for.body13.us.us.us
%arrayidx18.us.us.us = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv
%30 = load i8, ptr %arrayidx18.us.us.us, align 1, !tbaa !9
%conv19.us.us.us = sext i8 %30 to i32
%sub20.us.us.us = add nsw i32 %conv19.us.us.us, -48
%cmp21.us.us.us = icmp eq i32 %sub20.us.us.us, %j.093.us.us
%spec.select79.us.us.us = select i1 %cmp21.us.us.us, i32 2, i32 1
br label %for.inc.us.us.us
sw.bb.us.us.us: ; preds = %for.body13.us.us.us
%arrayidx.us.us.us = getelementptr inbounds [50000 x i8], ptr %s, i64 0, i64 %indvars.iv
%31 = load i8, ptr %arrayidx.us.us.us, align 1, !tbaa !9
%conv.us.us.us = sext i8 %31 to i32
%sub.us.us.us = add nsw i32 %conv.us.us.us, -48
%cmp14.us.us.us = icmp eq i32 %sub.us.us.us, %i.096.us
%spec.select.us.us.us = zext i1 %cmp14.us.us.us to i32
br label %for.inc.us.us.us
for.inc.us.us.us: ; preds = %sw.bb.us.us.us, %sw.bb16.us.us.us, %sw.bb26.us.us.us, %for.body13.us.us.us
%cnt.1.ph.us.us.us = phi i32 [ 2, %sw.bb26.us.us.us ], [ %spec.select79.us.us.us, %sw.bb16.us.us.us ], [ %spec.select.us.us.us, %sw.bb.us.us.us ], [ %cnt.086.us.us.us, %for.body13.us.us.us ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp11.us.us.us = icmp ult i64 %indvars.iv.next, %1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup.us.us.us, label %for.body13.us.us.us, !llvm.loop !10
for.cond.cleanup4.split.us.us: ; preds = %cleanup.us.us.us.9
%inc55.us = add nuw nsw i32 %i.096.us, 1
%exitcond100.not = icmp eq i32 %inc55.us, 10
br i1 %exitcond100.not, label %for.cond.cleanup, label %for.cond2.preheader.us, !llvm.loop !13
for.cond.cleanup: ; preds = %for.cond.cleanup4.split.us.us, %entry
%.us-phi = phi i32 [ 0, %entry ], [ %spec.select81.us.us.us.9, %for.cond.cleanup4.split.us.us ]
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi)
call void @llvm.lifetime.end.p0(i64 50000, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include<stdio.h>
int main()
{
long int n, i=1;
long int num = 0;
scanf("%ld", & n);
for (long int k = n; k > 0; k--,i++)
{
num += i;
}printf("%ld", num-n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158195/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158195/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp5 = icmp sgt i64 %0, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%1 = shl nuw i64 %0, 1
%2 = add nsw i64 %0, -1
%3 = zext i64 %2 to i65
%4 = add nsw i64 %0, -2
%5 = zext i64 %4 to i65
%6 = mul i65 %3, %5
%7 = lshr i65 %6, 1
%8 = trunc i65 %7 to i64
%9 = add i64 %1, %8
%10 = add i64 %9, -1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %entry
%num.0.lcssa = phi i64 [ 0, %entry ], [ %10, %for.body.preheader ]
%sub = sub nsw i64 %num.0.lcssa, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sub)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
long long n;
scanf("%d",&n);
printf("%ld",n * (n - 1) / 2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158238/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158238/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%sub = add nsw i64 %0, -1
%mul = mul nsw i64 %sub, %0
%div = sdiv i64 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
long long int n;
scanf("%lld", &n);
long long int a=0;
for(int i=1;i<n;i++){
a = a + i;
}
printf("%lld", a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158281/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158281/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp7 = icmp sgt i64 %0, 1
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%1 = shl nuw i64 %0, 1
%2 = add nsw i64 %0, -2
%3 = zext i64 %2 to i65
%4 = add nsw i64 %0, -3
%5 = zext i64 %4 to i65
%6 = mul i65 %3, %5
%7 = lshr i65 %6, 1
%8 = trunc i65 %7 to i64
%9 = add i64 %1, %8
%10 = add i64 %9, -3
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %entry
%a.0.lcssa = phi i64 [ 0, %entry ], [ %10, %for.body.preheader ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %a.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
long i;
long n;
scanf("%ld", &n);
long long ans;
for(i=0; i<n; i++){
ans+=i;
}
printf("%lld\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158331/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158331/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp5 = icmp sgt i64 %0, 0
call void @llvm.assume(i1 %cmp5)
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef undef)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
int get_int(void) {
int num;
scanf("%d", &num);
return num;
}
#define POWER2_MAX 32
int main(void) {
int num = get_int();
int sign = (num>=0) ? 1 : -1;
int anum = abs(num);
static int map[POWER2_MAX];
int bit;
for(bit = 0; bit < POWER2_MAX; bit++) {
if(!(anum & (1<<bit))) continue;
int bit_sign = (bit%2) ? -1 : 1;
map[bit] = bit_sign * sign;
}
// carry
int msb = 0;
for(bit = 0; bit < POWER2_MAX; bit++) {
if(map[bit]==-1) {
map[bit] = 1;
map[bit+1] += 1;
} else if (map[bit]==2) {
map[bit] = 0;
map[bit+1] -= 1;
} else if (map[bit] == -2) {
map[bit] = 0;
map[bit+1] += 1;
}
if(map[bit]==1) msb = bit;
}
for(bit = msb; bit >= 0; bit--) {
putchar('0' + map[bit]);
}
putchar('\n');
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158382/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158382/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@main.map = internal unnamed_addr global [32 x i32] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @get_int() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i) #4
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num.i)
%0 = load i32, ptr %num.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i) #4
%cmp = icmp sgt i32 %0, -1
%cond.neg = select i1 %cmp, i32 -1, i32 1
%cond = select i1 %cmp, i32 1, i32 -1
%1 = call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %for.body
for.body: ; preds = %for.inc.1, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.1, %for.inc.1 ]
%2 = trunc i64 %indvars.iv to i32
%shl = shl nuw i32 1, %2
%and = and i32 %shl, %1
%tobool.not = icmp eq i32 %and, 0
br i1 %tobool.not, label %for.inc, label %if.end
if.end: ; preds = %for.body
%arrayidx = getelementptr inbounds [32 x i32], ptr @main.map, i64 0, i64 %indvars.iv
store i32 %cond, ptr %arrayidx, align 8, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.end
%indvars.iv.next = or i64 %indvars.iv, 1
%3 = trunc i64 %indvars.iv.next to i32
%shl.1 = shl nuw i32 1, %3
%and.1 = and i32 %shl.1, %1
%tobool.not.1 = icmp eq i32 %and.1, 0
br i1 %tobool.not.1, label %for.inc.1, label %if.end.1
if.end.1: ; preds = %for.inc
%arrayidx.1 = getelementptr inbounds [32 x i32], ptr @main.map, i64 0, i64 %indvars.iv.next
store i32 %cond.neg, ptr %arrayidx.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end.1, %for.inc
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 32
br i1 %exitcond.not.1, label %for.body6, label %for.body, !llvm.loop !9
for.cond47.preheader: ; preds = %if.end38.thread
%cmp4883 = icmp sgt i32 %14, -1
br i1 %cmp4883, label %for.body49.preheader, label %for.end55
for.body49.preheader: ; preds = %for.cond47.preheader
%4 = zext i32 %14 to i64
br label %for.body49
for.body6: ; preds = %for.inc.1, %if.end38.thread
%indvars.iv86 = phi i64 [ %indvars.iv.next87.pre-phi98, %if.end38.thread ], [ 0, %for.inc.1 ]
%msb.082 = phi i32 [ %14, %if.end38.thread ], [ 0, %for.inc.1 ]
%arrayidx8 = getelementptr inbounds [32 x i32], ptr @main.map, i64 0, i64 %indvars.iv86
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
switch i32 %5, label %if.end38 [
i32 -1, label %if.end38.thread99
i32 2, label %if.then19
i32 -2, label %if.then29
]
if.end38.thread99: ; preds = %for.body6
store i32 1, ptr %arrayidx8, align 4, !tbaa !5
%6 = add nuw nsw i64 %indvars.iv86, 1
%arrayidx14 = getelementptr inbounds [32 x i32], ptr @main.map, i64 0, i64 %6
%7 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%add15 = add nsw i32 %7, 1
store i32 %add15, ptr %arrayidx14, align 4, !tbaa !5
br label %12
if.then19: ; preds = %for.body6
store i32 0, ptr %arrayidx8, align 4, !tbaa !5
%8 = add nuw nsw i64 %indvars.iv86, 1
%arrayidx24 = getelementptr inbounds [32 x i32], ptr @main.map, i64 0, i64 %8
%9 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%sub = add nsw i32 %9, -1
store i32 %sub, ptr %arrayidx24, align 4, !tbaa !5
br label %if.end38.thread
if.then29: ; preds = %for.body6
store i32 0, ptr %arrayidx8, align 4, !tbaa !5
%10 = add nuw nsw i64 %indvars.iv86, 1
%arrayidx34 = getelementptr inbounds [32 x i32], ptr @main.map, i64 0, i64 %10
%11 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%add35 = add nsw i32 %11, 1
store i32 %add35, ptr %arrayidx34, align 4, !tbaa !5
br label %if.end38.thread
if.end38: ; preds = %for.body6
%.pre = add nuw nsw i64 %indvars.iv86, 1
%cmp41 = icmp eq i32 %5, 1
br i1 %cmp41, label %12, label %if.end38.thread
12: ; preds = %if.end38.thread99, %if.end38
%indvars.iv.next87.pre-phi102 = phi i64 [ %6, %if.end38.thread99 ], [ %.pre, %if.end38 ]
%13 = trunc i64 %indvars.iv86 to i32
br label %if.end38.thread
if.end38.thread: ; preds = %if.then29, %if.then19, %if.end38, %12
%indvars.iv.next87.pre-phi98 = phi i64 [ %indvars.iv.next87.pre-phi102, %12 ], [ %.pre, %if.end38 ], [ %10, %if.then29 ], [ %8, %if.then19 ]
%14 = phi i32 [ %13, %12 ], [ %msb.082, %if.end38 ], [ %msb.082, %if.then29 ], [ %msb.082, %if.then19 ]
%exitcond92.not = icmp eq i64 %indvars.iv.next87.pre-phi98, 32
br i1 %exitcond92.not, label %for.cond47.preheader, label %for.body6, !llvm.loop !11
for.body49: ; preds = %for.body49.preheader, %for.body49
%indvars.iv93 = phi i64 [ %4, %for.body49.preheader ], [ %indvars.iv.next94, %for.body49 ]
%arrayidx51 = getelementptr inbounds [32 x i32], ptr @main.map, i64 0, i64 %indvars.iv93
%15 = load i32, ptr %arrayidx51, align 4, !tbaa !5
%add52 = add nsw i32 %15, 48
%16 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i78 = call i32 @putc(i32 noundef %add52, ptr noundef %16)
%indvars.iv.next94 = add nsw i64 %indvars.iv93, -1
%cmp48.not = icmp eq i64 %indvars.iv93, 0
br i1 %cmp48.not, label %for.end55, label %for.body49, !llvm.loop !14
for.end55: ; preds = %for.body49, %for.cond47.preheader
%17 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i79 = call i32 @putc(i32 noundef 10, ptr noundef %17)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int n,count=0,keta[100];
scanf("%d",&n);
if(n==0){
puts("0");
return 0;
}
while(n!=0){
if(abs(n)%2==0){
keta[count]=0;
}
if(abs(n)%2==1){
if(count%2==0)n--;
else n++;
keta[count]=1;
}
n=n/2;
count++;
}
count--;
while(count>=0){
printf("%d",keta[count]);
count--;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158432/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158432/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%keta = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %keta) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %if.then, label %while.body
if.then: ; preds = %entry
%call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
while.cond18.preheader: ; preds = %while.body
store i32 %div, ptr %n, align 4, !tbaa !5
br label %while.body20
while.body: ; preds = %entry, %while.body
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %while.body ], [ 1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%1 = phi i32 [ %div, %while.body ], [ %0, %entry ]
%rem = and i32 %1, 1
%cmp3.not = icmp eq i32 %rem, 0
%rem946 = and i64 %indvars.iv, 1
%cmp10 = icmp eq i64 %rem946, 0
%storemerge.v = select i1 %cmp10, i32 -1, i32 1
%storemerge = select i1 %cmp3.not, i32 0, i32 %storemerge.v
%storemerge36 = add nsw i32 %1, %storemerge
%2 = getelementptr inbounds [100 x i32], ptr %keta, i64 0, i64 %indvars.iv
store i32 %rem, ptr %2, align 4
%div = sdiv i32 %storemerge36, 2
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%storemerge36.off = add i32 %storemerge36, 1
%cmp2.not = icmp ult i32 %storemerge36.off, 3
%indvars.iv.next42 = add nuw i64 %indvars.iv41, 1
br i1 %cmp2.not, label %while.cond18.preheader, label %while.body, !llvm.loop !9
while.body20: ; preds = %while.cond18.preheader, %while.body20
%indvars.iv43 = phi i64 [ %indvars.iv41, %while.cond18.preheader ], [ %indvars.iv.next44, %while.body20 ]
%indvars.iv.next44 = add i64 %indvars.iv43, -1
%idxprom21 = and i64 %indvars.iv.next44, 4294967295
%arrayidx22 = getelementptr inbounds [100 x i32], ptr %keta, i64 0, i64 %idxprom21
%3 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3)
%4 = trunc i64 %indvars.iv43 to i32
%cmp19 = icmp sgt i32 %4, 1
br i1 %cmp19, label %while.body20, label %cleanup, !llvm.loop !11
cleanup: ; preds = %while.body20, %if.then
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %keta) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
#define ll long long int
typedef struct{
ll t;
ll d;
}data;
int compare(const void *a, const void *b){return (((data*)b)->d - ((data*)a)->d);}
int main(void){
int n,k,i;
scanf("%d %d",&n,&k);
data neta[n];
ll ans=0,sum=0;
for(i=0;i<n;i++)scanf("%lld %lld",&neta[i].t,&neta[i].d);
int used[100001]={0},sushiTypes=0,stack[100000],top=0;
qsort(neta, n, sizeof(data), compare);
for(i=0;i<k;i++){
sum += neta[i].d;
if(used[neta[i].t]){//かぶってるネタはスタックにおいしさをメモ
stack[top]=neta[i].d;
top++;
}else{
used[neta[i].t] = 1;
sushiTypes++;
}
}
ans = sum+(ll)sushiTypes*sushiTypes;
for(i=k;i<n && top>0;i++){//美味しさソートのk個目以降 and スタックが存在
if(used[neta[i].t])continue;//すでに使っているネタは見ない
used[neta[i].t] = 1;
top--;//スタックは下にdが大きいもの上(top)にdが小さいもので入っている
sum += neta[i].d -stack[top];
sushiTypes++;
ans = sum+(ll)sushiTypes*sushiTypes>ans?sum+(ll)sushiTypes*sushiTypes:ans;
}
printf("%lld",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158476/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158476/source.c"
target datalayout = "e-m:e-p270: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 { i64, i64 }
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%d = getelementptr inbounds %struct.data, ptr %b, i64 0, i32 1
%0 = load i64, ptr %d, align 8, !tbaa !5
%d1 = getelementptr inbounds %struct.data, ptr %a, i64 0, i32 1
%1 = load i64, ptr %d1, 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 i32, align 4
%k = alloca i32, align 4
%used = alloca [100001 x i32], align 16
%stack = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !10
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca %struct.data, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !10
%cmp104 = icmp sgt i32 %3, 0
br i1 %cmp104, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv
%d = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %d)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !10
%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 !12
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %5, %for.body ]
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %used) #8
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %used, i8 0, i64 400004, i1 false)
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %stack) #8
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 16, ptr noundef nonnull @compare) #8
%6 = load i32, ptr %k, align 4, !tbaa !10
%cmp5106 = icmp sgt i32 %6, 0
br i1 %cmp5106, label %for.body7.preheader, label %for.end29
for.body7.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %6 to i64
br label %for.body7
for.body7: ; preds = %for.body7.preheader, %for.inc27
%indvars.iv124 = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next125, %for.inc27 ]
%top.0110 = phi i32 [ 0, %for.body7.preheader ], [ %top.1, %for.inc27 ]
%sushiTypes.0109 = phi i32 [ 0, %for.body7.preheader ], [ %sushiTypes.1, %for.inc27 ]
%sum.0108 = phi i64 [ 0, %for.body7.preheader ], [ %add, %for.inc27 ]
%arrayidx9 = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv124
%d10 = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv124, i32 1
%7 = load i64, ptr %d10, align 8, !tbaa !5
%add = add nsw i64 %7, %sum.0108
%8 = load i64, ptr %arrayidx9, align 16, !tbaa !14
%arrayidx14 = getelementptr inbounds [100001 x i32], ptr %used, i64 0, i64 %8
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !10
%tobool.not = icmp eq i32 %9, 0
br i1 %tobool.not, label %if.else, label %if.then
if.then: ; preds = %for.body7
%conv18 = trunc i64 %7 to i32
%idxprom19 = sext i32 %top.0110 to i64
%arrayidx20 = getelementptr inbounds [100000 x i32], ptr %stack, i64 0, i64 %idxprom19
store i32 %conv18, ptr %arrayidx20, align 4, !tbaa !10
%inc21 = add nsw i32 %top.0110, 1
br label %for.inc27
if.else: ; preds = %for.body7
store i32 1, ptr %arrayidx14, align 4, !tbaa !10
%inc26 = add nsw i32 %sushiTypes.0109, 1
br label %for.inc27
for.inc27: ; preds = %if.then, %if.else
%sushiTypes.1 = phi i32 [ %sushiTypes.0109, %if.then ], [ %inc26, %if.else ]
%top.1 = phi i32 [ %inc21, %if.then ], [ %top.0110, %if.else ]
%indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
%exitcond.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count
br i1 %exitcond.not, label %for.end29, label %for.body7, !llvm.loop !15
for.end29: ; preds = %for.inc27, %for.end
%sum.0.lcssa = phi i64 [ 0, %for.end ], [ %add, %for.inc27 ]
%sushiTypes.0.lcssa = phi i32 [ 0, %for.end ], [ %sushiTypes.1, %for.inc27 ]
%top.0.lcssa = phi i32 [ 0, %for.end ], [ %top.1, %for.inc27 ]
%conv30 = sext i32 %sushiTypes.0.lcssa to i64
%mul = mul nsw i64 %conv30, %conv30
%add32 = add nsw i64 %mul, %sum.0.lcssa
%10 = load i32, ptr %n, align 4, !tbaa !10
%cmp34115 = icmp slt i32 %6, %10
%cmp36116 = icmp sgt i32 %top.0.lcssa, 0
%11 = select i1 %cmp34115, i1 %cmp36116, i1 false
br i1 %11, label %for.body38.preheader, label %for.end70
for.body38.preheader: ; preds = %for.end29
%12 = sext i32 %6 to i64
%13 = sext i32 %10 to i64
br label %for.body38
for.body38: ; preds = %for.body38.preheader, %for.inc68
%indvars.iv127 = phi i64 [ %12, %for.body38.preheader ], [ %indvars.iv.next128, %for.inc68 ]
%top.2121 = phi i32 [ %top.0.lcssa, %for.body38.preheader ], [ %top.3, %for.inc68 ]
%sushiTypes.2120 = phi i32 [ %sushiTypes.0.lcssa, %for.body38.preheader ], [ %sushiTypes.3, %for.inc68 ]
%sum.1119 = phi i64 [ %sum.0.lcssa, %for.body38.preheader ], [ %sum.2, %for.inc68 ]
%ans.0118 = phi i64 [ %add32, %for.body38.preheader ], [ %ans.1, %for.inc68 ]
%arrayidx40 = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv127
%14 = load i64, ptr %arrayidx40, align 16, !tbaa !14
%arrayidx42 = getelementptr inbounds [100001 x i32], ptr %used, i64 0, i64 %14
%15 = load i32, ptr %arrayidx42, align 4, !tbaa !10
%tobool43.not = icmp eq i32 %15, 0
br i1 %tobool43.not, label %if.end45, label %for.inc68
if.end45: ; preds = %for.body38
store i32 1, ptr %arrayidx42, align 4, !tbaa !10
%dec = add nsw i32 %top.2121, -1
%d52 = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv127, i32 1
%16 = load i64, ptr %d52, align 8, !tbaa !5
%idxprom53 = zext i32 %dec to i64
%arrayidx54 = getelementptr inbounds [100000 x i32], ptr %stack, i64 0, i64 %idxprom53
%17 = load i32, ptr %arrayidx54, align 4, !tbaa !10
%conv55 = sext i32 %17 to i64
%sub = sub nsw i64 %16, %conv55
%add56 = add nsw i64 %sub, %sum.1119
%inc57 = add nsw i32 %sushiTypes.2120, 1
%conv58 = sext i32 %inc57 to i64
%mul60 = mul nsw i64 %conv58, %conv58
%add61 = add nsw i64 %add56, %mul60
%add61.ans.0 = call i64 @llvm.smax.i64(i64 %add61, i64 %ans.0118)
br label %for.inc68
for.inc68: ; preds = %for.body38, %if.end45
%ans.1 = phi i64 [ %ans.0118, %for.body38 ], [ %add61.ans.0, %if.end45 ]
%sum.2 = phi i64 [ %sum.1119, %for.body38 ], [ %add56, %if.end45 ]
%sushiTypes.3 = phi i32 [ %sushiTypes.2120, %for.body38 ], [ %inc57, %if.end45 ]
%top.3 = phi i32 [ %top.2121, %for.body38 ], [ %dec, %if.end45 ]
%indvars.iv.next128 = add nsw i64 %indvars.iv127, 1
%cmp34 = icmp slt i64 %indvars.iv.next128, %13
%cmp36 = icmp sgt i32 %top.3, 0
%18 = select i1 %cmp34, i1 %cmp36, i1 false
br i1 %18, label %for.body38, label %for.end70, !llvm.loop !16
for.end70: ; preds = %for.inc68, %for.end29
%ans.0.lcssa = phi i64 [ %add32, %for.end29 ], [ %ans.1, %for.inc68 ]
%call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %stack) #8
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %used) #8
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"", !7, i64 0, !7, i64 8}
!7 = !{!"long long", !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, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!6, !7, i64 0}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
|
#include <stdio.h>
int main(){
long long int a, b, c; scanf("%lld%lld%lld", &a, &b, &c);
if(c - a - b > 0 && 4 * a * b < (c - a - b)*(c - a - b))
printf("Yes\n");
else
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158526/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158526/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %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 i64, ptr %c, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%3 = add i64 %1, %2
%sub1 = sub i64 %0, %3
%cmp = icmp sgt i64 %sub1, 0
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%mul = shl nsw i64 %1, 2
%mul2 = mul nsw i64 %mul, %2
%mul7 = mul nsw i64 %sub1, %sub1
%cmp8 = icmp slt i64 %mul2, %mul7
br i1 %cmp8, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
// variable in description
int t;
int n;
// variable to support
int x;
int q;
// variable to judge
int i;
int j;
int k;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d",&n);
q = 3;
while( n % q )
{
q *= 2;
q++;
}
x = n / q;
printf("%d\n",x);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15857/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15857/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.end
for.body: ; preds = %entry, %while.end
%i.013 = phi i32 [ %inc3, %while.end ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%rem8 = srem i32 %1, 3
%tobool.not9 = icmp eq i32 %rem8, 0
br i1 %tobool.not9, label %while.end, label %while.body
while.body: ; preds = %for.body, %while.body
%q.010 = phi i32 [ %inc, %while.body ], [ 3, %for.body ]
%mul = shl nsw i32 %q.010, 1
%inc = or i32 %mul, 1
%rem = srem i32 %1, %inc
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %for.body
%q.0.lcssa = phi i32 [ 3, %for.body ], [ %inc, %while.body ]
%div = sdiv i32 %1, %q.0.lcssa
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%inc3 = add nuw nsw i32 %i.013, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc3, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
long a, b, c;
scanf("%ld", &a);
scanf("%ld", &b);
scanf("%ld", &c);
if(a+b < c && 4*a*b < (c-a-b)*(c-a-b)){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158612/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158612/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%2 = load i64, ptr %c, align 8, !tbaa !5
%cmp = icmp slt i64 %add, %2
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%mul = shl nsw i64 %0, 2
%mul3 = mul nsw i64 %mul, %1
%sub4 = sub i64 %2, %add
%mul7 = mul nsw i64 %sub4, %sub4
%cmp8 = icmp slt i64 %mul3, %mul7
br i1 %cmp8, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_SIZE_MAX 1005 // 最大サイズ
// 内部変数
static FILE *szpFpI; // 入力
static int siW, siH; // 幅・高さ
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX]; // マス
static int siWCnt; // ホワイトチョコレート数
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpA;
static int siTNo;
#endif
// 1行出力
int
fOutLine(
char *pcpLine // <I> 1行
)
{
char lc1Buf[1024];
#ifdef D_TEST
lc1Buf[0] = '\0';
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, pcpLine)) {
siRes = -1;
}
#else
printf("%s", pcpLine);
#endif
return 0;
}
// ホワイトチョコレート数 - 取得
int
fGetWCnt(
int piCol // <I> 列
, int *pipRLen // <I> 行長さ
, int piRCnt // <I> 行長さ数
, int *pipWCnt // <O> ホワイトチョコレート数
)
{
int i, j;
int liRow = 0;
for (i = 0; i < piRCnt; i++) {
pipWCnt[i] = 0;
for (j = 0; j < pipRLen[i]; j++) {
if (sc2Mass[liRow][piCol] == '1') {
pipWCnt[i]++;
if (pipWCnt[i] > siWCnt) {
return -1;
}
}
liRow++;
}
}
return 0;
}
// 横分割
int
fDivW(
int *pipRLen // <I> 行長さ
, int piRCnt // <I> 行長さ数
)
{
int i, j, liRet;
// 1列目
int li1WCnt[D_SIZE_MAX];
liRet = fGetWCnt(0, pipRLen, piRCnt, li1WCnt);
if (liRet != 0) {
return INT_MAX;
}
// 2列目以降
int liDCnt = piRCnt - 1;
for (i = 1; i < siW; i++) {
int li1WCnt2[D_SIZE_MAX];
liRet = fGetWCnt(i, pipRLen, piRCnt, li1WCnt2);
if (liRet != 0) {
return INT_MAX;
}
// 結合
for (j = 0; j < piRCnt; j++) {
li1WCnt[j] += li1WCnt2[j];
if (li1WCnt[j] > siWCnt) {
break;
}
}
if (j == piRCnt) {
continue;
}
// 結合不可
for (j = 0; j < piRCnt; j++) {
li1WCnt[j] = li1WCnt2[j];
}
liDCnt++;
}
return liDCnt;
}
// 縦分割
int
fDivH(
int piRow // <I> 行
, int *pipRLen // <I> 行長さ
, int piRCnt // <I> 行長さ数
)
{
// 終了
if (piRow >= siH) {
// 横分割
return fDivW(pipRLen, piRCnt);
}
// 分割する
pipRLen[piRCnt] = 1;
int liCnt = fDivH(piRow + 1, pipRLen, piRCnt + 1);
// 分割しない
pipRLen[piRCnt - 1]++;
int liCnt2 = fDivH(piRow + 1, pipRLen, piRCnt);
if (liCnt > liCnt2) {
liCnt = liCnt2;
}
return liCnt;
}
// 実行メイン
int
fMain(
)
{
int i;
char lc1Buf[1024];
// 幅・高さ・ホワイトチョコレート数 - 取得
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d%d%d", &siH, &siW, &siWCnt);
// マス - 取得
for (i = 0; i < siH; i++) {
fgets(sc2Mass[i], sizeof(sc2Mass[0]), szpFpI);
}
// 分割
int li1RLen[D_SIZE_MAX];
li1RLen[0] = 1;
int liCnt = fDivH(1, li1RLen, 1);
return liCnt;
}
// 1回実行
int
fOne(
)
{
int liRet;
char lc1Buf[1024];
// 入力 - セット
#ifdef D_TEST
sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
szpFpI = fopen(lc1Buf, "r");
sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
szpFpA = fopen(lc1Buf, "r");
siRes = 0;
#else
szpFpI = stdin;
#endif
// 実行メイン
liRet = fMain();
// 出力
sprintf(lc1Buf, "%d\n", liRet);
fOutLine(lc1Buf);
// 残データ有無
#ifdef D_TEST
lc1Buf[0] = '\0';
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, "")) {
siRes = -1;
}
#endif
// テストファイルクローズ
#ifdef D_TEST
fclose(szpFpI);
fclose(szpFpA);
#endif
// テスト結果
#ifdef D_TEST
if (siRes == 0) {
printf("OK %d\n", siTNo);
}
else {
printf("NG %d\n", siTNo);
}
#endif
return 0;
}
// プログラム開始
int
main()
{
#ifdef D_TEST
int i;
for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
siTNo = i;
fOne();
}
#else
fOne();
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158656/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158656/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@sc2Mass = internal global [1005 x [1005 x i8]] zeroinitializer, align 16
@siWCnt = internal global i32 0, align 4
@siW = internal global i32 0, align 4
@siH = internal global i32 0, align 4
@szpFpI = internal unnamed_addr global ptr null, align 8
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOutLine(ptr noundef %pcpLine) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %pcpLine)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @fGetWCnt(i32 noundef %piCol, ptr nocapture noundef readonly %pipRLen, i32 noundef %piRCnt, ptr nocapture noundef writeonly %pipWCnt) local_unnamed_addr #3 {
entry:
%cmp41 = icmp sgt i32 %piRCnt, 0
br i1 %cmp41, label %for.body.lr.ph, label %cleanup
for.body.lr.ph: ; preds = %entry
%idxprom8 = sext i32 %piCol to i64
%wide.trip.count = zext i32 %piRCnt to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc22
%indvars.iv46 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next47, %for.inc22 ]
%liRow.043 = phi i32 [ 0, %for.body.lr.ph ], [ %liRow.1.lcssa, %for.inc22 ]
%arrayidx = getelementptr inbounds i32, ptr %pipWCnt, i64 %indvars.iv46
store i32 0, ptr %arrayidx, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds i32, ptr %pipRLen, i64 %indvars.iv46
%0 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp438 = icmp sgt i32 %0, 0
br i1 %cmp438, label %for.body5.preheader, label %for.inc22
for.body5.preheader: ; preds = %for.body
%1 = sext i32 %liRow.043 to i64
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %if.end19
%2 = phi i32 [ %0, %for.body5.preheader ], [ %6, %if.end19 ]
%3 = phi i32 [ 0, %for.body5.preheader ], [ %7, %if.end19 ]
%indvars.iv = phi i64 [ %1, %for.body5.preheader ], [ %indvars.iv.next, %if.end19 ]
%j.039 = phi i32 [ 0, %for.body5.preheader ], [ %inc21, %if.end19 ]
%arrayidx9 = getelementptr inbounds [1005 x [1005 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv, i64 %idxprom8
%4 = load i8, ptr %arrayidx9, align 1, !tbaa !9
%cmp10 = icmp eq i8 %4, 49
br i1 %cmp10, label %if.then, label %if.end19
if.then: ; preds = %for.body5
%inc = add nsw i32 %3, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%5 = load i32, ptr @siWCnt, align 4, !tbaa !5
%cmp16.not = icmp slt i32 %3, %5
br i1 %cmp16.not, label %if.then.if.end19_crit_edge, label %cleanup
if.then.if.end19_crit_edge: ; preds = %if.then
%.pre = load i32, ptr %arrayidx3, align 4, !tbaa !5
br label %if.end19
if.end19: ; preds = %if.then.if.end19_crit_edge, %for.body5
%6 = phi i32 [ %.pre, %if.then.if.end19_crit_edge ], [ %2, %for.body5 ]
%7 = phi i32 [ %inc, %if.then.if.end19_crit_edge ], [ %3, %for.body5 ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%inc21 = add nuw nsw i32 %j.039, 1
%cmp4 = icmp slt i32 %inc21, %6
br i1 %cmp4, label %for.body5, label %for.inc22.loopexit, !llvm.loop !10
for.inc22.loopexit: ; preds = %if.end19
%8 = trunc i64 %indvars.iv.next to i32
br label %for.inc22
for.inc22: ; preds = %for.inc22.loopexit, %for.body
%liRow.1.lcssa = phi i32 [ %liRow.043, %for.body ], [ %8, %for.inc22.loopexit ]
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%exitcond.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !12
cleanup: ; preds = %for.inc22, %if.then, %entry
%retval.0 = phi i32 [ 0, %entry ], [ -1, %if.then ], [ 0, %for.inc22 ]
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @fDivW(ptr nocapture noundef readonly %pipRLen, i32 noundef %piRCnt) local_unnamed_addr #4 {
entry:
%li1WCnt = alloca [1005 x i32], align 16
%li1WCnt2 = alloca [1005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4020, ptr nonnull %li1WCnt) #8
%cmp41.i = icmp sgt i32 %piRCnt, 0
br i1 %cmp41.i, label %for.body.lr.ph.i, label %if.end.thread
for.body.lr.ph.i: ; preds = %entry
%wide.trip.count.i = zext i32 %piRCnt to i64
%0 = load i32, ptr @siWCnt, align 4
br label %for.body.i
for.body.i: ; preds = %for.inc22.i, %for.body.lr.ph.i
%indvars.iv46.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next47.i, %for.inc22.i ]
%liRow.043.i = phi i32 [ 0, %for.body.lr.ph.i ], [ %liRow.1.lcssa.i, %for.inc22.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %li1WCnt, i64 %indvars.iv46.i
store i32 0, ptr %arrayidx.i, align 4, !tbaa !5
%arrayidx3.i = getelementptr inbounds i32, ptr %pipRLen, i64 %indvars.iv46.i
%1 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp438.i = icmp sgt i32 %1, 0
br i1 %cmp438.i, label %for.body5.preheader.i, label %for.inc22.i
for.body5.preheader.i: ; preds = %for.body.i
%2 = sext i32 %liRow.043.i to i64
%3 = add i32 %liRow.043.i, %1
br label %for.body5.i
for.body5.i: ; preds = %if.end19.i, %for.body5.preheader.i
%4 = phi i32 [ 0, %for.body5.preheader.i ], [ %6, %if.end19.i ]
%indvars.iv.i = phi i64 [ %2, %for.body5.preheader.i ], [ %indvars.iv.next.i, %if.end19.i ]
%j.039.i = phi i32 [ 0, %for.body5.preheader.i ], [ %inc21.i, %if.end19.i ]
%arrayidx9.i = getelementptr inbounds [1005 x [1005 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv.i, i64 0
%5 = load i8, ptr %arrayidx9.i, align 1, !tbaa !9
%cmp10.i = icmp eq i8 %5, 49
br i1 %cmp10.i, label %if.then.i, label %if.end19.i
if.then.i: ; preds = %for.body5.i
%inc.i = add nsw i32 %4, 1
store i32 %inc.i, ptr %arrayidx.i, align 4, !tbaa !5
%cmp16.not.i = icmp slt i32 %4, %0
br i1 %cmp16.not.i, label %if.end19.i, label %cleanup35
if.end19.i: ; preds = %if.then.i, %for.body5.i
%6 = phi i32 [ %4, %for.body5.i ], [ %inc.i, %if.then.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%inc21.i = add nuw nsw i32 %j.039.i, 1
%exitcond.not = icmp eq i32 %inc21.i, %1
br i1 %exitcond.not, label %for.inc22.i, label %for.body5.i, !llvm.loop !10
for.inc22.i: ; preds = %if.end19.i, %for.body.i
%liRow.1.lcssa.i = phi i32 [ %liRow.043.i, %for.body.i ], [ %3, %if.end19.i ]
%indvars.iv.next47.i = add nuw nsw i64 %indvars.iv46.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next47.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %if.end, label %for.body.i, !llvm.loop !12
if.end: ; preds = %for.inc22.i
%sub = add nsw i32 %piRCnt, -1
%7 = load i32, ptr @siW, align 4, !tbaa !5
%cmp1103 = icmp sgt i32 %7, 1
br i1 %cmp1103, label %for.body.lr.ph, label %cleanup35
if.end.thread: ; preds = %entry
%sub191 = add nsw i32 %piRCnt, -1
%8 = load i32, ptr @siW, align 4, !tbaa !5
%cmp1103192 = icmp sgt i32 %8, 1
br i1 %cmp1103192, label %for.body.lr.ph.split.split, label %cleanup35
for.body.lr.ph: ; preds = %if.end
%wide.trip.count.i61 = zext i32 %piRCnt to i64
%9 = load i32, ptr @siWCnt, align 4
br i1 %cmp41.i, label %for.body.us.preheader, label %for.body.lr.ph.split.split
for.body.us.preheader: ; preds = %for.body.lr.ph
%10 = shl nuw nsw i64 %wide.trip.count.i61, 2
%wide.trip.count189 = zext i32 %7 to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %for.inc31.us
%indvars.iv186 = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next187, %for.inc31.us ]
%liDCnt.0105.us = phi i32 [ %sub, %for.body.us.preheader ], [ %liDCnt.1.ph.us, %for.inc31.us ]
call void @llvm.lifetime.start.p0(i64 4020, ptr nonnull %li1WCnt2) #8
br label %for.body.i62.us
for.body.i62.us: ; preds = %for.inc22.i68.us, %for.body.us
%indvars.iv46.i63.us = phi i64 [ 0, %for.body.us ], [ %indvars.iv.next47.i70.us, %for.inc22.i68.us ]
%liRow.043.i64.us = phi i32 [ 0, %for.body.us ], [ %liRow.1.lcssa.i69.us, %for.inc22.i68.us ]
%arrayidx.i65.us = getelementptr inbounds i32, ptr %li1WCnt2, i64 %indvars.iv46.i63.us
store i32 0, ptr %arrayidx.i65.us, align 4, !tbaa !5
%arrayidx3.i66.us = getelementptr inbounds i32, ptr %pipRLen, i64 %indvars.iv46.i63.us
%11 = load i32, ptr %arrayidx3.i66.us, align 4, !tbaa !5
%cmp438.i67.us = icmp sgt i32 %11, 0
br i1 %cmp438.i67.us, label %for.body5.preheader.i72.us, label %for.inc22.i68.us
for.body5.preheader.i72.us: ; preds = %for.body.i62.us
%12 = sext i32 %liRow.043.i64.us to i64
%13 = add i32 %liRow.043.i64.us, %11
br label %for.body5.i73.us
for.body5.i73.us: ; preds = %if.end19.i78.us, %for.body5.preheader.i72.us
%14 = phi i32 [ 0, %for.body5.preheader.i72.us ], [ %16, %if.end19.i78.us ]
%indvars.iv.i74.us = phi i64 [ %12, %for.body5.preheader.i72.us ], [ %indvars.iv.next.i79.us, %if.end19.i78.us ]
%j.039.i75.us = phi i32 [ 0, %for.body5.preheader.i72.us ], [ %inc21.i80.us, %if.end19.i78.us ]
%arrayidx9.i76.us = getelementptr inbounds [1005 x [1005 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv.i74.us, i64 %indvars.iv186
%15 = load i8, ptr %arrayidx9.i76.us, align 1, !tbaa !9
%cmp10.i77.us = icmp eq i8 %15, 49
br i1 %cmp10.i77.us, label %if.then.i83.us, label %if.end19.i78.us
if.then.i83.us: ; preds = %for.body5.i73.us
%inc.i84.us = add nsw i32 %14, 1
store i32 %inc.i84.us, ptr %arrayidx.i65.us, align 4, !tbaa !5
%cmp16.not.i85.us = icmp slt i32 %14, %9
br i1 %cmp16.not.i85.us, label %if.end19.i78.us, label %cleanup
if.end19.i78.us: ; preds = %if.then.i83.us, %for.body5.i73.us
%16 = phi i32 [ %14, %for.body5.i73.us ], [ %inc.i84.us, %if.then.i83.us ]
%indvars.iv.next.i79.us = add nsw i64 %indvars.iv.i74.us, 1
%inc21.i80.us = add nuw nsw i32 %j.039.i75.us, 1
%exitcond180.not = icmp eq i32 %inc21.i80.us, %11
br i1 %exitcond180.not, label %for.inc22.i68.us, label %for.body5.i73.us, !llvm.loop !10
for.inc22.i68.us: ; preds = %if.end19.i78.us, %for.body.i62.us
%liRow.1.lcssa.i69.us = phi i32 [ %liRow.043.i64.us, %for.body.i62.us ], [ %13, %if.end19.i78.us ]
%indvars.iv.next47.i70.us = add nuw nsw i64 %indvars.iv46.i63.us, 1
%exitcond.not.i71.us = icmp eq i64 %indvars.iv.next47.i70.us, %wide.trip.count.i61
br i1 %exitcond.not.i71.us, label %for.body9.us, label %for.body.i62.us, !llvm.loop !12
for.body9.us: ; preds = %for.inc22.i68.us, %for.inc.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc.us ], [ 0, %for.inc22.i68.us ]
%arrayidx.us = getelementptr inbounds [1005 x i32], ptr %li1WCnt2, i64 0, i64 %indvars.iv
%17 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
%arrayidx11.us = getelementptr inbounds [1005 x i32], ptr %li1WCnt, i64 0, i64 %indvars.iv
%18 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5
%add.us = add nsw i32 %18, %17
store i32 %add.us, ptr %arrayidx11.us, align 4, !tbaa !5
%cmp14.us = icmp sgt i32 %add.us, %9
br i1 %cmp14.us, label %for.end.us, label %for.inc.us
for.inc.us: ; preds = %for.body9.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond182.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i61
br i1 %exitcond182.not, label %for.inc31.us, label %for.body9.us, !llvm.loop !13
for.end.us: ; preds = %for.body9.us
%19 = trunc i64 %indvars.iv to i32
%cmp17.us = icmp eq i32 %19, %piRCnt
br i1 %cmp17.us, label %for.inc31.us, label %for.end29.us
for.end29.us: ; preds = %for.end.us
call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %li1WCnt, ptr nonnull align 16 %li1WCnt2, i64 %10, i1 false), !tbaa !5
%inc30.us = add nsw i32 %liDCnt.0105.us, 1
br label %for.inc31.us
for.inc31.us: ; preds = %for.inc.us, %for.end29.us, %for.end.us
%liDCnt.1.ph.us = phi i32 [ %liDCnt.0105.us, %for.end.us ], [ %inc30.us, %for.end29.us ], [ %liDCnt.0105.us, %for.inc.us ]
call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %li1WCnt2) #8
%indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
%exitcond190.not = icmp eq i64 %indvars.iv.next187, %wide.trip.count189
br i1 %exitcond190.not, label %cleanup35, label %for.body.us, !llvm.loop !14
for.body.lr.ph.split.split: ; preds = %if.end.thread, %for.body.lr.ph
%sub193196 = phi i32 [ %sub, %for.body.lr.ph ], [ %sub191, %if.end.thread ]
%20 = phi i32 [ %7, %for.body.lr.ph ], [ %8, %if.end.thread ]
%cmp17 = icmp eq i32 %piRCnt, 0
br i1 %cmp17, label %cleanup35, label %cleanup35.loopexit175
cleanup: ; preds = %if.then.i83.us
call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %li1WCnt2) #8
br label %cleanup35
cleanup35.loopexit175: ; preds = %for.body.lr.ph.split.split
%21 = add nsw i32 %20, %piRCnt
%22 = add i32 %21, -2
br label %cleanup35
cleanup35: ; preds = %if.then.i, %for.inc31.us, %for.body.lr.ph.split.split, %if.end.thread, %cleanup35.loopexit175, %if.end, %cleanup
%retval.3 = phi i32 [ 2147483647, %cleanup ], [ %sub, %if.end ], [ %22, %cleanup35.loopexit175 ], [ %sub191, %if.end.thread ], [ %sub193196, %for.body.lr.ph.split.split ], [ %liDCnt.1.ph.us, %for.inc31.us ], [ 2147483647, %if.then.i ]
call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %li1WCnt) #8
ret i32 %retval.3
}
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @fDivH(i32 noundef %piRow, ptr noundef %pipRLen, i32 noundef %piRCnt) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr @siH, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %piRow
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%call = tail call i32 @fDivW(ptr noundef %pipRLen, i32 noundef %piRCnt)
br label %common.ret22
common.ret22: ; preds = %if.end, %if.then
%common.ret22.op = phi i32 [ %call, %if.then ], [ %spec.select, %if.end ]
ret i32 %common.ret22.op
if.end: ; preds = %entry
%idxprom = sext i32 %piRCnt to i64
%arrayidx = getelementptr inbounds i32, ptr %pipRLen, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %piRow, 1
%add1 = add nsw i32 %piRCnt, 1
%call2 = tail call i32 @fDivH(i32 noundef %add, ptr noundef %pipRLen, i32 noundef %add1)
%sub = add nsw i32 %piRCnt, -1
%idxprom3 = sext i32 %sub to i64
%arrayidx4 = getelementptr inbounds i32, ptr %pipRLen, i64 %idxprom3
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%inc = add nsw i32 %1, 1
store i32 %inc, ptr %arrayidx4, align 4, !tbaa !5
%call6 = tail call i32 @fDivH(i32 noundef %add, ptr noundef %pipRLen, i32 noundef %piRCnt)
%spec.select = tail call i32 @llvm.smin.i32(i32 %call2, i32 %call6)
br label %common.ret22
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fMain() local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
%li1RLen = alloca [1005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #8
%0 = load ptr, ptr @szpFpI, align 8, !tbaa !15
%call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull @siH, ptr noundef nonnull @siW, ptr noundef nonnull @siWCnt) #8
%1 = load i32, ptr @siH, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %1, 0
br i1 %cmp10, 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 [1005 x [1005 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv
%2 = load ptr, ptr @szpFpI, align 8, !tbaa !15
%call4 = call ptr @fgets(ptr noundef nonnull %arrayidx, i32 noundef 1005, ptr noundef %2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @siH, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !17
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.start.p0(i64 4020, ptr nonnull %li1RLen) #8
store i32 1, ptr %li1RLen, align 16, !tbaa !5
%call7 = call i32 @fDivH(i32 noundef 1, ptr noundef nonnull %li1RLen, i32 noundef 1)
call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %li1RLen) #8
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #8
ret i32 %call7
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOne() local_unnamed_addr #0 {
entry:
%lc1Buf.i = alloca [1024 x i8], align 16
%li1RLen.i = alloca [1005 x i32], align 16
%lc1Buf = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #8
%0 = load ptr, ptr @stdin, align 8, !tbaa !15
store ptr %0, ptr @szpFpI, align 8, !tbaa !15
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf.i) #8
%call.i = call ptr @fgets(ptr noundef nonnull %lc1Buf.i, i32 noundef 1024, ptr noundef %0)
%call2.i = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf.i, ptr noundef nonnull @.str.1, ptr noundef nonnull @siH, ptr noundef nonnull @siW, ptr noundef nonnull @siWCnt) #8
%1 = load i32, ptr @siH, align 4, !tbaa !5
%cmp10.i = icmp sgt i32 %1, 0
br i1 %cmp10.i, label %for.body.i, label %fMain.exit
for.body.i: ; preds = %entry, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %entry ]
%arrayidx.i = getelementptr inbounds [1005 x [1005 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv.i
%2 = load ptr, ptr @szpFpI, align 8, !tbaa !15
%call4.i = call ptr @fgets(ptr noundef nonnull %arrayidx.i, i32 noundef 1005, ptr noundef %2)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%3 = load i32, ptr @siH, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp.i = icmp slt i64 %indvars.iv.next.i, %4
br i1 %cmp.i, label %for.body.i, label %fMain.exit, !llvm.loop !17
fMain.exit: ; preds = %for.body.i, %entry
call void @llvm.lifetime.start.p0(i64 4020, ptr nonnull %li1RLen.i) #8
store i32 1, ptr %li1RLen.i, align 16, !tbaa !5
%call7.i = call i32 @fDivH(i32 noundef 1, ptr noundef nonnull %li1RLen.i, i32 noundef 1)
call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %li1RLen.i) #8
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf.i) #8
%call1 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %call7.i) #8
%call.i4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 @fOne()
ret i32 0
}
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !11}
|
#include <stdio.h>
int main(void){
double A, B;
char* result;
scanf("%lf%lf", &A,&B);
if(A>B){
result ="GREATER";
}else if(A<B){
result ="LESS";
}else if(A==B){
result ="EQUAL";
}
printf("%s",result);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158742/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158742/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf%lf\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"GREATER\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"LESS\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"EQUAL\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca double, align 8
%B = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load double, ptr %A, align 8, !tbaa !5
%1 = load double, ptr %B, align 8, !tbaa !5
%cmp = fcmp ogt double %0, %1
br i1 %cmp, label %if.end7, label %if.else
if.else: ; preds = %entry
%cmp1 = fcmp olt double %0, %1
br i1 %cmp1, label %if.end7, label %if.else3
if.else3: ; preds = %if.else
br label %if.end7
if.end7: ; preds = %if.else3, %if.else, %entry
%result.0 = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.else ], [ @.str.3, %if.else3 ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %result.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int t;
scanf("%d",&t);
while(t--){
long int n,i=4;
scanf("%ld",&n);
while(n%(i-1)!=0)i*=2;
printf("%ld\n",n/(i-1));
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15880/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15880/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec9 = add nsw i32 %0, -1
store i32 %dec9, ptr %t, align 4, !tbaa !5
%tobool.not10 = icmp eq i32 %0, 0
br i1 %tobool.not10, label %while.end6, label %while.body
while.body: ; preds = %entry, %while.end
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !9
br label %while.cond2
while.cond2: ; preds = %while.cond2, %while.body
%i.0 = phi i64 [ 4, %while.body ], [ %mul, %while.cond2 ]
%sub = add nsw i64 %i.0, -1
%rem = srem i64 %1, %sub
%div = sdiv i64 %1, %sub
%cmp.not = icmp eq i64 %rem, 0
%mul = shl nsw i64 %i.0, 1
br i1 %cmp.not, label %while.end, label %while.cond2, !llvm.loop !11
while.end: ; preds = %while.cond2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end6, label %while.body, !llvm.loop !13
while.end6: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define SIZE_STRING 101 // 10の1乗が2桁なので、10の100乗は101桁
#define SIZE_NUM 2
#define FIRST_IS_LARGE 1
#define FIRST_IS_SMALL 2
#define FLG_EQUAL 0
int main(void)
{
/* 変数宣言 */
char cNUM[SIZE_NUM][SIZE_STRING + 1]; // 数字格納配列。NULLストッパ入りのサイズ
int iLoop; // ループカウンタ
int iFlg = FLG_EQUAL; // 数の大小フラグ
int iFirst = 0; // 1つ目の数字の1桁を格納する変数
int iSecond = 0; // 2つ目の数字の1桁を格納する変数
/* 変数初期化 */
memset(cNUM, 0x00, sizeof(cNUM));
/* 読み込み */
for(iLoop = 0; iLoop < SIZE_NUM; iLoop++)
{
scanf("%s", cNUM[iLoop]);
}
/************************************************************************/
/* ●数の大小比較 */
/* 101桁ループさせて、上の桁から順に、1桁ずつ比較。 */
/* 1桁ずつ比較で大小があれば大小フラグを立てる。 */
/* ただし、ループの途中で片方がNULLになったら、もう片方のほうが大きい。 */
/************************************************************************/
for(iLoop = 0; iLoop < SIZE_STRING; iLoop++)
{
/* 文字→数値変換 */
iFirst = cNUM[0][iLoop] - '0';
iSecond = cNUM[1][iLoop] - '0';
/* 片方がNULLなら、もう片方が大きいと判定し、break */
/* 両方がNULLなら、break */
if(cNUM[0][iLoop] != 0x00 && cNUM[1][iLoop] == 0x00)
{
iFlg = FIRST_IS_LARGE;
break;
}
if(cNUM[0][iLoop] == 0x00 && cNUM[1][iLoop] != 0x00)
{
iFlg = FIRST_IS_SMALL;
break;
}
if(cNUM[0][iLoop] == 0x00 && cNUM[1][iLoop] == 0x00)
{
break;
}
/* 数の大小フラグが初期値以外の場合、1桁ずつの比較はもうしない */
if(iFlg != FLG_EQUAL)
{
continue;
}
/* 大小がある場合数の大小フラグを立てる */
if(iFirst > iSecond)
{
iFlg = FIRST_IS_LARGE;
}
if(iFirst < iSecond)
{
iFlg = FIRST_IS_SMALL;
}
}
/* 結果出力 */
switch(iFlg){
case FIRST_IS_LARGE:
printf("GREATER\n");
break;
case FIRST_IS_SMALL:
printf("LESS\n");
break;
default:
printf("EQUAL\n");
break;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158858/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158858/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"LESS\00", align 1
@str.4 = private unnamed_addr constant [8 x i8] c"GREATER\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"EQUAL\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%cNUM = alloca [2 x [102 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 204, ptr nonnull %cNUM) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(204) %cNUM, i8 0, i64 204, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cNUM)
%arrayidx.1 = getelementptr inbounds [2 x [102 x i8]], ptr %cNUM, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
br label %for.body4
for.body4: ; preds = %entry, %if.end54
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %if.end54 ]
%iFlg.0101 = phi i32 [ 0, %entry ], [ %iFlg.2, %if.end54 ]
%arrayidx7 = getelementptr inbounds [102 x i8], ptr %cNUM, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%arrayidx10 = getelementptr inbounds [2 x [102 x i8]], ptr %cNUM, i64 0, i64 1, i64 %indvars.iv
%1 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%cmp17.not = icmp ne i8 %0, 0
%cmp23 = icmp eq i8 %1, 0
%or.cond = select i1 %cmp17.not, i1 %cmp23, i1 false
br i1 %or.cond, label %sw.epilog, label %if.end
if.end: ; preds = %for.body4
%cmp29 = icmp eq i8 %0, 0
br i1 %cmp29, label %land.lhs.true31, label %if.end54
land.lhs.true31: ; preds = %if.end
br i1 %cmp23, label %for.end69, label %sw.epilog
if.end54: ; preds = %if.end
%cmp55.not = icmp eq i32 %iFlg.0101, 0
%cmp59 = icmp sgt i8 %0, %1
%spec.select = zext i1 %cmp59 to i32
%cmp63 = icmp slt i8 %0, %1
%spec.select91 = select i1 %cmp63, i32 2, i32 %spec.select
%iFlg.2 = select i1 %cmp55.not, i32 %spec.select91, i32 %iFlg.0101
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 101
br i1 %exitcond.not, label %for.end69, label %for.body4, !llvm.loop !8
for.end69: ; preds = %if.end54, %land.lhs.true31
%iFlg.097 = phi i32 [ %iFlg.0101, %land.lhs.true31 ], [ %iFlg.2, %if.end54 ]
%switch.selectcmp = icmp eq i32 %iFlg.097, 2
%switch.select = select i1 %switch.selectcmp, ptr @str, ptr @str.5
%switch.selectcmp112 = icmp eq i32 %iFlg.097, 1
%switch.select113 = select i1 %switch.selectcmp112, ptr @str.4, ptr %switch.select
br label %sw.epilog
sw.epilog: ; preds = %for.body4, %land.lhs.true31, %for.end69
%str.5.sink = phi ptr [ %switch.select113, %for.end69 ], [ @str, %land.lhs.true31 ], [ @str.4, %for.body4 ]
%puts90 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
call void @llvm.lifetime.end.p0(i64 204, ptr nonnull %cNUM) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
double radians(int a)
{
return a * M_PI / 180;
}
int main()
{
int len, d, a = 90;
double x = 0, y = 0;
for (;;) {
scanf("%d,%d", &len, &d);
if (len == 0 && d == 0) break;
x += len * cos(radians(a));
y += len * sin(radians(a));
a -= d;
}
printf("%d\n%d\n", (int)x, (int)y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158908/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158908/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d\0A%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @radians(i32 noundef %a) local_unnamed_addr #0 {
entry:
%conv = sitofp i32 %a to double
%mul = fmul double %conv, 0x400921FB54442D18
%div = fdiv double %mul, 1.800000e+02
ret double %div
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%len = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %len) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #6
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len, ptr noundef nonnull %d)
%0 = load i32, ptr %len, align 4, !tbaa !5
%cmp18 = icmp eq i32 %0, 0
%1 = load i32, ptr %d, align 4
%cmp119 = icmp eq i32 %1, 0
%or.cond20 = select i1 %cmp18, i1 %cmp119, i1 false
br i1 %or.cond20, label %for.end, label %if.end
if.end: ; preds = %entry, %if.end
%2 = phi i32 [ %12, %if.end ], [ %0, %entry ]
%a.021 = phi i32 [ %sub, %if.end ], [ 90, %entry ]
%3 = phi <2 x double> [ %10, %if.end ], [ zeroinitializer, %entry ]
%conv.i = sitofp i32 %a.021 to double
%mul.i = fmul double %conv.i, 0x400921FB54442D18
%div.i = fdiv double %mul.i, 1.800000e+02
%call3 = call double @cos(double noundef %div.i) #6
%4 = load i32, ptr %len, align 4, !tbaa !5
%5 = insertelement <2 x i32> poison, i32 %2, i64 0
%6 = insertelement <2 x i32> %5, i32 %4, i64 1
%7 = sitofp <2 x i32> %6 to <2 x double>
%call6 = call double @sin(double noundef %div.i) #6
%8 = insertelement <2 x double> poison, double %call3, i64 0
%9 = insertelement <2 x double> %8, double %call6, i64 1
%10 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %9, <2 x double> %3)
%11 = load i32, ptr %d, align 4, !tbaa !5
%sub = sub nsw i32 %a.021, %11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len, ptr noundef nonnull %d)
%12 = load i32, ptr %len, align 4, !tbaa !5
%cmp = icmp eq i32 %12, 0
%13 = load i32, ptr %d, align 4
%cmp1 = icmp eq i32 %13, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %for.end.loopexit, label %if.end
for.end.loopexit: ; preds = %if.end
%14 = fptosi <2 x double> %10 to <2 x i32>
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%15 = phi <2 x i32> [ zeroinitializer, %entry ], [ %14, %for.end.loopexit ]
%16 = extractelement <2 x i32> %15, i64 0
%17 = extractelement <2 x i32> %15, i64 1
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16, i32 noundef %17)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %len) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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"}
|
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main(void){
double x=0,y=0,r=90.0;
int t1,t2;
for(;scanf("%d,%d",&t1,&t2),t1+t2;r-=t2){
x+=t1*cos((r/180.0)*PI);
y+=t1*sin((r/180.0)*PI);
}
printf("%d\n%d\n",(int)x,(int)y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158959/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158959/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d\0A%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t1 = alloca i32, align 4
%t2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t1) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t2) #5
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t1, ptr noundef nonnull %t2)
%0 = load i32, ptr %t1, align 4, !tbaa !5
%1 = load i32, ptr %t2, align 4, !tbaa !5
%add17 = sub i32 0, %1
%tobool.not18 = icmp eq i32 %0, %add17
br i1 %tobool.not18, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%2 = phi i32 [ %12, %for.body ], [ %0, %entry ]
%r.021 = phi double [ %sub, %for.body ], [ 9.000000e+01, %entry ]
%3 = phi <2 x double> [ %10, %for.body ], [ zeroinitializer, %entry ]
%div = fdiv double %r.021, 1.800000e+02
%mul = fmul double %div, 0x400921FB53C8D4F1
%call1 = call double @cos(double noundef %mul) #5
%4 = load i32, ptr %t1, align 4, !tbaa !5
%5 = insertelement <2 x i32> poison, i32 %2, i64 0
%6 = insertelement <2 x i32> %5, i32 %4, i64 1
%7 = sitofp <2 x i32> %6 to <2 x double>
%call6 = call double @sin(double noundef %mul) #5
%8 = insertelement <2 x double> poison, double %call1, i64 0
%9 = insertelement <2 x double> %8, double %call6, i64 1
%10 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %9, <2 x double> %3)
%11 = load i32, ptr %t2, align 4, !tbaa !5
%conv8 = sitofp i32 %11 to double
%sub = fsub double %r.021, %conv8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t1, ptr noundef nonnull %t2)
%12 = load i32, ptr %t1, align 4, !tbaa !5
%13 = load i32, ptr %t2, align 4, !tbaa !5
%add = sub i32 0, %13
%tobool.not = icmp eq i32 %12, %add
br i1 %tobool.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%14 = fptosi <2 x double> %10 to <2 x i32>
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%15 = phi <2 x i32> [ zeroinitializer, %entry ], [ %14, %for.end.loopexit ]
%16 = extractelement <2 x i32> %15, i64 0
%17 = extractelement <2 x i32> %15, i64 1
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16, i32 noundef %17)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t2) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t1) #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 @cos(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #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 = { 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>
#include<ctype.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
#include<stddef.h>
#include<stdint.h>
#define min(x, y) ((x<y) ? x : y)
#define max(x, y) ((x<y) ? y : x)
#define floop(x, y) for(long long int i = x; i < y; i++)
#define floop2(x, y) for(long long int j = x; j < y; j++)
#define floop3(x, y) for(long long int k = x; k < y; k++)
void solve(){
long long int n, max, k = 1;
scanf(" %lld", &n);
long long int a[n];
floop(0, n){
scanf(" %lld", &a[i]);
}
long long int sum = 0;
long long int bpnt[n];
bpnt[0] = -1;
floop(0, (n-1)){
if((a[i]*a[i+1]) < 0){
bpnt[k] = i;
k++;
}
}
floop(k, n){
bpnt[i] = -2;
}
floop(1, n){
if(bpnt[i] == (-2)){
max = a[(bpnt[i-1] + 1)];
floop2((bpnt[i-1] + 1), (n)){
if(a[j] > max){
max = a[j];
}
}
sum += max;
break;
}
else{
max = a[(bpnt[i-1] + 1)];
floop2((bpnt[i-1] + 1), (bpnt[i] + 1)){
if(a[j] > max){
max = a[j];
}
}
sum += max;
}
}
if(bpnt[n-1] != (-2)){
max = a[(bpnt[n-1] + 1)];
floop2((bpnt[n-1] + 1), (n)){
if(a[j] > max){
max = a[j];
}
}
sum += max;
}
printf("%lld\n", sum);
}
int main(){
/*
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
*/
int t;
scanf(" %d", &t);
while(t--){
solve();
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15903/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15903/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\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 void @solve() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp150 = icmp sgt i64 %2, 0
br i1 %cmp150, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
%vla2183 = alloca i64, i64 %2, align 16
store i64 -1, ptr %vla2183, align 16, !tbaa !5
br label %for.cond18.preheader
for.cond.cleanup: ; preds = %for.body
%vla2 = alloca i64, i64 %5, align 16
store i64 -1, ptr %vla2, align 16, !tbaa !5
%cmp6152 = icmp sgt i64 %5, 1
br i1 %cmp6152, label %for.body8.preheader, label %for.cond18.preheader
for.body8.preheader: ; preds = %for.cond.cleanup
%.pre = load i64, ptr %vla, align 16, !tbaa !5
%3 = add i64 %5, -1
%xtraiter = and i64 %3, 1
%4 = icmp eq i64 %5, 2
br i1 %4, label %for.cond18.preheader.loopexit.unr-lcssa, label %for.body8.preheader.new
for.body8.preheader.new: ; preds = %for.body8.preheader
%unroll_iter = and i64 %3, -2
br label %for.body8
for.body: ; preds = %entry, %for.body
%i.0151 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.0151
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.0151, 1
%5 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond18.preheader.loopexit.unr-lcssa: ; preds = %for.inc14.1, %for.body8.preheader
%k.1.lcssa.ph = phi i64 [ undef, %for.body8.preheader ], [ %k.1.1, %for.inc14.1 ]
%.unr = phi i64 [ %.pre, %for.body8.preheader ], [ %14, %for.inc14.1 ]
%i4.0154.unr = phi i64 [ 0, %for.body8.preheader ], [ %add.1, %for.inc14.1 ]
%k.0153.unr = phi i64 [ 1, %for.body8.preheader ], [ %k.1.1, %for.inc14.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond18.preheader, label %for.body8.epil
for.body8.epil: ; preds = %for.cond18.preheader.loopexit.unr-lcssa
%6 = getelementptr i64, ptr %vla, i64 %i4.0154.unr
%arrayidx10.epil = getelementptr i64, ptr %6, i64 1
%7 = load i64, ptr %arrayidx10.epil, align 8, !tbaa !5
%mul.epil = mul nsw i64 %7, %.unr
%cmp11.epil = icmp slt i64 %mul.epil, 0
br i1 %cmp11.epil, label %if.then.epil, label %for.cond18.preheader
if.then.epil: ; preds = %for.body8.epil
%arrayidx12.epil = getelementptr inbounds i64, ptr %vla2, i64 %k.0153.unr
store i64 %i4.0154.unr, ptr %arrayidx12.epil, align 8, !tbaa !5
%inc13.epil = add nsw i64 %k.0153.unr, 1
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.cond18.preheader.loopexit.unr-lcssa, %if.then.epil, %for.body8.epil, %for.cond.cleanup.thread, %for.cond.cleanup
%cmp6152187 = phi i1 [ false, %for.cond.cleanup ], [ false, %for.cond.cleanup.thread ], [ %cmp6152, %for.body8.epil ], [ %cmp6152, %if.then.epil ], [ %cmp6152, %for.cond18.preheader.loopexit.unr-lcssa ]
%vla2186 = phi ptr [ %vla2, %for.cond.cleanup ], [ %vla2183, %for.cond.cleanup.thread ], [ %vla2, %for.body8.epil ], [ %vla2, %if.then.epil ], [ %vla2, %for.cond18.preheader.loopexit.unr-lcssa ]
%.lcssa185 = phi i64 [ %5, %for.cond.cleanup ], [ %2, %for.cond.cleanup.thread ], [ %5, %for.body8.epil ], [ %5, %if.then.epil ], [ %5, %for.cond18.preheader.loopexit.unr-lcssa ]
%k.0.lcssa = phi i64 [ 1, %for.cond.cleanup ], [ 1, %for.cond.cleanup.thread ], [ %k.1.lcssa.ph, %for.cond18.preheader.loopexit.unr-lcssa ], [ %inc13.epil, %if.then.epil ], [ %k.0153.unr, %for.body8.epil ]
%cmp19156 = icmp slt i64 %k.0.lcssa, %.lcssa185
br i1 %cmp19156, label %for.body21.preheader, label %for.cond27.preheader
for.body21.preheader: ; preds = %for.cond18.preheader
%8 = sub i64 %.lcssa185, %k.0.lcssa
%min.iters.check = icmp ult i64 %8, 4
br i1 %min.iters.check, label %for.body21.preheader263, label %vector.ph
vector.ph: ; preds = %for.body21.preheader
%n.vec = and i64 %8, -4
%ind.end = add i64 %k.0.lcssa, %n.vec
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 %k.0.lcssa, %index
%9 = getelementptr inbounds i64, ptr %vla2186, i64 %offset.idx
store <2 x i64> <i64 -2, i64 -2>, ptr %9, align 8, !tbaa !5
%10 = getelementptr inbounds i64, ptr %9, i64 2
store <2 x i64> <i64 -2, i64 -2>, ptr %10, align 8, !tbaa !5
%index.next = add nuw i64 %index, 4
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %8, %n.vec
br i1 %cmp.n, label %for.cond27.preheader, label %for.body21.preheader263
for.body21.preheader263: ; preds = %for.body21.preheader, %middle.block
%i17.0157.ph = phi i64 [ %k.0.lcssa, %for.body21.preheader ], [ %ind.end, %middle.block ]
br label %for.body21
for.body8: ; preds = %for.inc14.1, %for.body8.preheader.new
%12 = phi i64 [ %.pre, %for.body8.preheader.new ], [ %14, %for.inc14.1 ]
%i4.0154 = phi i64 [ 0, %for.body8.preheader.new ], [ %add.1, %for.inc14.1 ]
%k.0153 = phi i64 [ 1, %for.body8.preheader.new ], [ %k.1.1, %for.inc14.1 ]
%niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.inc14.1 ]
%add = or i64 %i4.0154, 1
%arrayidx10 = getelementptr inbounds i64, ptr %vla, i64 %add
%13 = load i64, ptr %arrayidx10, align 8, !tbaa !5
%mul = mul nsw i64 %13, %12
%cmp11 = icmp slt i64 %mul, 0
br i1 %cmp11, label %if.then, label %for.inc14
if.then: ; preds = %for.body8
%arrayidx12 = getelementptr inbounds i64, ptr %vla2, i64 %k.0153
store i64 %i4.0154, ptr %arrayidx12, align 8, !tbaa !5
%inc13 = add nsw i64 %k.0153, 1
br label %for.inc14
for.inc14: ; preds = %for.body8, %if.then
%k.1 = phi i64 [ %inc13, %if.then ], [ %k.0153, %for.body8 ]
%add.1 = add nuw nsw i64 %i4.0154, 2
%arrayidx10.1 = getelementptr inbounds i64, ptr %vla, i64 %add.1
%14 = load i64, ptr %arrayidx10.1, align 16, !tbaa !5
%mul.1 = mul nsw i64 %14, %13
%cmp11.1 = icmp slt i64 %mul.1, 0
br i1 %cmp11.1, label %if.then.1, label %for.inc14.1
if.then.1: ; preds = %for.inc14
%arrayidx12.1 = getelementptr inbounds i64, ptr %vla2, i64 %k.1
store i64 %add, ptr %arrayidx12.1, align 8, !tbaa !5
%inc13.1 = add nsw i64 %k.1, 1
br label %for.inc14.1
for.inc14.1: ; preds = %if.then.1, %for.inc14
%k.1.1 = phi i64 [ %inc13.1, %if.then.1 ], [ %k.1, %for.inc14 ]
%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.cond18.preheader.loopexit.unr-lcssa, label %for.body8, !llvm.loop !14
for.cond27.preheader: ; preds = %for.body21, %middle.block, %for.cond18.preheader
br i1 %cmp6152187, label %for.body30, label %cleanup
for.body21: ; preds = %for.body21.preheader263, %for.body21
%i17.0157 = phi i64 [ %inc24, %for.body21 ], [ %i17.0157.ph, %for.body21.preheader263 ]
%arrayidx22 = getelementptr inbounds i64, ptr %vla2186, i64 %i17.0157
store i64 -2, ptr %arrayidx22, align 8, !tbaa !5
%inc24 = add nsw i64 %i17.0157, 1
%exitcond177.not = icmp eq i64 %inc24, %.lcssa185
br i1 %exitcond177.not, label %for.cond27.preheader, label %for.body21, !llvm.loop !15
for.body30: ; preds = %for.cond27.preheader, %for.cond.cleanup66
%i26.0164 = phi i64 [ %inc79, %for.cond.cleanup66 ], [ 1, %for.cond27.preheader ]
%sum.0163 = phi i64 [ %add76, %for.cond.cleanup66 ], [ 0, %for.cond27.preheader ]
%arrayidx31 = getelementptr inbounds i64, ptr %vla2186, i64 %i26.0164
%15 = load i64, ptr %arrayidx31, align 8, !tbaa !5
%cmp32 = icmp eq i64 %15, -2
%arrayidx35 = getelementptr i64, ptr %arrayidx31, i64 -1
%16 = load i64, ptr %arrayidx35, align 8, !tbaa !5
%add36 = add nsw i64 %16, 1
%arrayidx37 = getelementptr inbounds i64, ptr %vla, i64 %add36
%17 = load i64, ptr %arrayidx37, align 8, !tbaa !5
br i1 %cmp32, label %if.then33, label %if.else
if.then33: ; preds = %for.body30
%cmp42166 = icmp slt i64 %add36, %.lcssa185
br i1 %cmp42166, label %for.body44.preheader, label %for.cond.cleanup43
for.body44.preheader: ; preds = %if.then33
%18 = xor i64 %16, -1
%19 = add i64 %.lcssa185, %18
%min.iters.check209 = icmp ult i64 %19, 4
br i1 %min.iters.check209, label %for.body44.preheader251, label %vector.ph210
vector.ph210: ; preds = %for.body44.preheader
%n.vec212 = and i64 %19, -4
%ind.end213 = add i64 %add36, %n.vec212
%minmax.ident.splatinsert220 = insertelement <2 x i64> poison, i64 %17, i64 0
%minmax.ident.splat221 = shufflevector <2 x i64> %minmax.ident.splatinsert220, <2 x i64> poison, <2 x i32> zeroinitializer
%20 = getelementptr i64, ptr %vla, i64 %add36
br label %vector.body216
vector.body216: ; preds = %vector.body216, %vector.ph210
%index217 = phi i64 [ 0, %vector.ph210 ], [ %index.next225, %vector.body216 ]
%vec.phi218 = phi <2 x i64> [ %minmax.ident.splat221, %vector.ph210 ], [ %23, %vector.body216 ]
%vec.phi219 = phi <2 x i64> [ %minmax.ident.splat221, %vector.ph210 ], [ %24, %vector.body216 ]
%21 = getelementptr i64, ptr %20, i64 %index217
%wide.load223 = load <2 x i64>, ptr %21, align 8, !tbaa !5
%22 = getelementptr inbounds i64, ptr %21, i64 2
%wide.load224 = load <2 x i64>, ptr %22, align 8, !tbaa !5
%23 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load223, <2 x i64> %vec.phi218)
%24 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load224, <2 x i64> %vec.phi219)
%index.next225 = add nuw i64 %index217, 4
%25 = icmp eq i64 %index.next225, %n.vec212
br i1 %25, label %middle.block207, label %vector.body216, !llvm.loop !16
middle.block207: ; preds = %vector.body216
%rdx.minmax226 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %23, <2 x i64> %24)
%26 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax226)
%cmp.n215 = icmp eq i64 %19, %n.vec212
br i1 %cmp.n215, label %for.cond.cleanup43, label %for.body44.preheader251
for.body44.preheader251: ; preds = %for.body44.preheader, %middle.block207
%j.0168.ph = phi i64 [ %add36, %for.body44.preheader ], [ %ind.end213, %middle.block207 ]
%max.0167.ph = phi i64 [ %17, %for.body44.preheader ], [ %26, %middle.block207 ]
br label %for.body44
for.cond.cleanup43: ; preds = %for.body44, %middle.block207, %if.then33
%max.0.lcssa = phi i64 [ %17, %if.then33 ], [ %26, %middle.block207 ], [ %spec.select, %for.body44 ]
%add53 = add nsw i64 %max.0.lcssa, %sum.0163
br label %cleanup
for.body44: ; preds = %for.body44.preheader251, %for.body44
%j.0168 = phi i64 [ %inc51, %for.body44 ], [ %j.0168.ph, %for.body44.preheader251 ]
%max.0167 = phi i64 [ %spec.select, %for.body44 ], [ %max.0167.ph, %for.body44.preheader251 ]
%arrayidx45 = getelementptr inbounds i64, ptr %vla, i64 %j.0168
%27 = load i64, ptr %arrayidx45, align 8, !tbaa !5
%spec.select = call i64 @llvm.smax.i64(i64 %27, i64 %max.0167)
%inc51 = add nsw i64 %j.0168, 1
%exitcond180.not = icmp eq i64 %inc51, %.lcssa185
br i1 %exitcond180.not, label %for.cond.cleanup43, label %for.body44, !llvm.loop !17
if.else: ; preds = %for.body30
%cmp65.not158.not = icmp slt i64 %16, %15
br i1 %cmp65.not158.not, label %for.body67.preheader, label %for.cond.cleanup66
for.body67.preheader: ; preds = %if.else
%28 = sub i64 %15, %16
%min.iters.check194 = icmp ult i64 %28, 4
br i1 %min.iters.check194, label %for.body67.preheader254, label %vector.ph195
vector.ph195: ; preds = %for.body67.preheader
%n.vec197 = and i64 %28, -4
%ind.end198 = add i64 %add36, %n.vec197
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %17, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
%29 = getelementptr i64, ptr %vla, i64 %add36
br label %vector.body201
vector.body201: ; preds = %vector.body201, %vector.ph195
%index202 = phi i64 [ 0, %vector.ph195 ], [ %index.next206, %vector.body201 ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph195 ], [ %32, %vector.body201 ]
%vec.phi203 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph195 ], [ %33, %vector.body201 ]
%30 = getelementptr i64, ptr %29, i64 %index202
%wide.load = load <2 x i64>, ptr %30, align 8, !tbaa !5
%31 = getelementptr inbounds i64, ptr %30, i64 2
%wide.load205 = load <2 x i64>, ptr %31, align 8, !tbaa !5
%32 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load, <2 x i64> %vec.phi)
%33 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load205, <2 x i64> %vec.phi203)
%index.next206 = add nuw i64 %index202, 4
%34 = icmp eq i64 %index.next206, %n.vec197
br i1 %34, label %middle.block192, label %vector.body201, !llvm.loop !18
middle.block192: ; preds = %vector.body201
%rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %32, <2 x i64> %33)
%35 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n200 = icmp eq i64 %28, %n.vec197
br i1 %cmp.n200, label %for.cond.cleanup66, label %for.body67.preheader254
for.body67.preheader254: ; preds = %for.body67.preheader, %middle.block192
%j58.0160.ph = phi i64 [ %add36, %for.body67.preheader ], [ %ind.end198, %middle.block192 ]
%max.2159.ph = phi i64 [ %17, %for.body67.preheader ], [ %35, %middle.block192 ]
br label %for.body67
for.cond.cleanup66: ; preds = %for.body67, %middle.block192, %if.else
%max.2.lcssa = phi i64 [ %17, %if.else ], [ %35, %middle.block192 ], [ %spec.select147, %for.body67 ]
%add76 = add nsw i64 %max.2.lcssa, %sum.0163
%inc79 = add nuw nsw i64 %i26.0164, 1
%exitcond179.not = icmp eq i64 %inc79, %.lcssa185
br i1 %exitcond179.not, label %cleanup, label %for.body30, !llvm.loop !19
for.body67: ; preds = %for.body67.preheader254, %for.body67
%j58.0160 = phi i64 [ %inc74, %for.body67 ], [ %j58.0160.ph, %for.body67.preheader254 ]
%max.2159 = phi i64 [ %spec.select147, %for.body67 ], [ %max.2159.ph, %for.body67.preheader254 ]
%arrayidx68 = getelementptr inbounds i64, ptr %vla, i64 %j58.0160
%36 = load i64, ptr %arrayidx68, align 8, !tbaa !5
%spec.select147 = call i64 @llvm.smax.i64(i64 %36, i64 %max.2159)
%inc74 = add i64 %j58.0160, 1
%exitcond178.not = icmp eq i64 %j58.0160, %15
br i1 %exitcond178.not, label %for.cond.cleanup66, label %for.body67, !llvm.loop !20
cleanup: ; preds = %for.cond.cleanup66, %for.cond27.preheader, %for.cond.cleanup43
%sum.1 = phi i64 [ %add53, %for.cond.cleanup43 ], [ 0, %for.cond27.preheader ], [ %add76, %for.cond.cleanup66 ]
%37 = getelementptr i64, ptr %vla2186, i64 %.lcssa185
%arrayidx82 = getelementptr i64, ptr %37, i64 -1
%38 = load i64, ptr %arrayidx82, align 8, !tbaa !5
%cmp83.not = icmp eq i64 %38, -2
br i1 %cmp83.not, label %if.end107, label %if.then84
if.then84: ; preds = %cleanup
%add87 = add nsw i64 %38, 1
%arrayidx88 = getelementptr inbounds i64, ptr %vla, i64 %add87
%39 = load i64, ptr %arrayidx88, align 8, !tbaa !5
%cmp94170 = icmp slt i64 %add87, %.lcssa185
br i1 %cmp94170, label %for.body96.preheader, label %for.cond.cleanup95
for.body96.preheader: ; preds = %if.then84
%40 = xor i64 %38, -1
%41 = add i64 %.lcssa185, %40
%min.iters.check230 = icmp ult i64 %41, 4
br i1 %min.iters.check230, label %for.body96.preheader249, label %vector.ph231
vector.ph231: ; preds = %for.body96.preheader
%n.vec233 = and i64 %41, -4
%ind.end234 = add i64 %add87, %n.vec233
%minmax.ident.splatinsert241 = insertelement <2 x i64> poison, i64 %39, i64 0
%minmax.ident.splat242 = shufflevector <2 x i64> %minmax.ident.splatinsert241, <2 x i64> poison, <2 x i32> zeroinitializer
%42 = getelementptr i64, ptr %vla, i64 %add87
br label %vector.body237
vector.body237: ; preds = %vector.body237, %vector.ph231
%index238 = phi i64 [ 0, %vector.ph231 ], [ %index.next246, %vector.body237 ]
%vec.phi239 = phi <2 x i64> [ %minmax.ident.splat242, %vector.ph231 ], [ %45, %vector.body237 ]
%vec.phi240 = phi <2 x i64> [ %minmax.ident.splat242, %vector.ph231 ], [ %46, %vector.body237 ]
%43 = getelementptr i64, ptr %42, i64 %index238
%wide.load244 = load <2 x i64>, ptr %43, align 8, !tbaa !5
%44 = getelementptr inbounds i64, ptr %43, i64 2
%wide.load245 = load <2 x i64>, ptr %44, align 8, !tbaa !5
%45 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load244, <2 x i64> %vec.phi239)
%46 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load245, <2 x i64> %vec.phi240)
%index.next246 = add nuw i64 %index238, 4
%47 = icmp eq i64 %index.next246, %n.vec233
br i1 %47, label %middle.block228, label %vector.body237, !llvm.loop !21
middle.block228: ; preds = %vector.body237
%rdx.minmax247 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %45, <2 x i64> %46)
%48 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax247)
%cmp.n236 = icmp eq i64 %41, %n.vec233
br i1 %cmp.n236, label %for.cond.cleanup95, label %for.body96.preheader249
for.body96.preheader249: ; preds = %for.body96.preheader, %middle.block228
%j89.0172.ph = phi i64 [ %add87, %for.body96.preheader ], [ %ind.end234, %middle.block228 ]
%max.4171.ph = phi i64 [ %39, %for.body96.preheader ], [ %48, %middle.block228 ]
br label %for.body96
for.cond.cleanup95: ; preds = %for.body96, %middle.block228, %if.then84
%max.4.lcssa = phi i64 [ %39, %if.then84 ], [ %48, %middle.block228 ], [ %spec.select148, %for.body96 ]
%add106 = add nsw i64 %max.4.lcssa, %sum.1
br label %if.end107
for.body96: ; preds = %for.body96.preheader249, %for.body96
%j89.0172 = phi i64 [ %inc103, %for.body96 ], [ %j89.0172.ph, %for.body96.preheader249 ]
%max.4171 = phi i64 [ %spec.select148, %for.body96 ], [ %max.4171.ph, %for.body96.preheader249 ]
%arrayidx97 = getelementptr inbounds i64, ptr %vla, i64 %j89.0172
%49 = load i64, ptr %arrayidx97, align 8, !tbaa !5
%spec.select148 = call i64 @llvm.smax.i64(i64 %49, i64 %max.4171)
%inc103 = add nsw i64 %j89.0172, 1
%exitcond181.not = icmp eq i64 %inc103, %.lcssa185
br i1 %exitcond181.not, label %for.cond.cleanup95, label %for.body96, !llvm.loop !22
if.end107: ; preds = %for.cond.cleanup95, %cleanup
%sum.2 = phi i64 [ %add106, %for.cond.cleanup95 ], [ %sum.1, %cleanup ]
%call108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.2)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
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 uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !23
%dec1 = add nsw i32 %0, -1
store i32 %dec1, ptr %t, align 4, !tbaa !23
%tobool.not2 = icmp eq i32 %0, 0
br i1 %tobool.not2, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
call void @solve()
%1 = load i32, ptr %t, align 4, !tbaa !23
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %t, align 4, !tbaa !23
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !25
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long 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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10, !12, !13}
!17 = distinct !{!17, !10, !13, !12}
!18 = distinct !{!18, !10, !12, !13}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !13, !12}
!21 = distinct !{!21, !10, !12, !13}
!22 = distinct !{!22, !10, !13, !12}
!23 = !{!24, !24, i64 0}
!24 = !{!"int", !7, i64 0}
!25 = distinct !{!25, !10}
|
#include<stdio.h>
#include<math.h>
int main(void)
{
int r,theta,rad=0;
double x,y;
x=0;y=0;
while(1){
scanf("%d,%d",&r,&theta);
if(r==0 && theta==0)
break;
x+=r*cos((double)rad*M_PI/180);
y+=r*sin((double)rad*M_PI/180);
rad+=theta;
//printf("%lf,%lf\n",x,y);
}
//printf("%lf,%lf\n",x,y);
printf("%d\n%d\n",(int)y,(int)x);
//printf("%lf\n",cos(90));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159095/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159095/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d\0A%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
%theta = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %theta) #5
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r, ptr noundef nonnull %theta)
%0 = load i32, ptr %r, align 4, !tbaa !5
%cmp19 = icmp eq i32 %0, 0
%1 = load i32, ptr %theta, align 4
%cmp120 = icmp eq i32 %1, 0
%or.cond21 = select i1 %cmp19, i1 %cmp120, i1 false
br i1 %or.cond21, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end
%2 = phi i32 [ %12, %if.end ], [ %0, %entry ]
%rad.022 = phi i32 [ %add, %if.end ], [ 0, %entry ]
%3 = phi <2 x double> [ %10, %if.end ], [ zeroinitializer, %entry ]
%conv2 = sitofp i32 %rad.022 to double
%mul = fmul double %conv2, 0x400921FB54442D18
%div = fdiv double %mul, 1.800000e+02
%call3 = call double @cos(double noundef %div) #5
%4 = load i32, ptr %r, align 4, !tbaa !5
%5 = insertelement <2 x i32> poison, i32 %2, i64 0
%6 = insertelement <2 x i32> %5, i32 %4, i64 1
%7 = sitofp <2 x i32> %6 to <2 x double>
%call9 = call double @sin(double noundef %div) #5
%8 = insertelement <2 x double> poison, double %call3, i64 0
%9 = insertelement <2 x double> %8, double %call9, i64 1
%10 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %9, <2 x double> %3)
%11 = load i32, ptr %theta, align 4, !tbaa !5
%add = add nsw i32 %11, %rad.022
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r, ptr noundef nonnull %theta)
%12 = load i32, ptr %r, align 4, !tbaa !5
%cmp = icmp eq i32 %12, 0
%13 = load i32, ptr %theta, align 4
%cmp1 = icmp eq i32 %13, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end.loopexit, label %if.end
while.end.loopexit: ; preds = %if.end
%14 = fptosi <2 x double> %10 to <2 x i32>
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%15 = phi <2 x i32> [ zeroinitializer, %entry ], [ %14, %while.end.loopexit ]
%16 = extractelement <2 x i32> %15, i64 0
%17 = extractelement <2 x i32> %15, i64 1
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17, i32 noundef %16)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %theta) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 @cos(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int x, y, gcd, tmp;
scanf("%d %d", &x, &y);
if (x < y) {
tmp = x;
x = y;
y = tmp;
}
while (y > 0) {
tmp = x % y;
x = y;
y = tmp;
}
gcd = x;
printf("%d\n", gcd);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159138/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159138/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp16 = icmp sgt i32 %.pr, 0
br i1 %cmp16, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %x.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1 = icmp sgt i32 %rem, 0
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 %2, ptr %x, align 4, !tbaa !5
store i32 %rem, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %x.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 gcd(int a, int b)
{
if(a % b == 0){
return b;
} else {
return gcd(b, a % b);
}
}
int main()
{
int a, b, c;
scanf("%d %d", &a, &b);
if(a > b){
c = gcd(a, b);
} else {
c = gcd(b, a);
}
printf("%d\n", c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159181/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159181/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i32 [ %a, %entry ], [ %b.tr, %tailrecurse ]
%b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ]
%rem = srem i32 %a.tr, %b.tr
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %tailrecurse
return: ; preds = %tailrecurse
ret i32 %b.tr
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %tailrecurse.i, label %tailrecurse.i6
tailrecurse.i: ; preds = %entry, %tailrecurse.i
%a.tr.i = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %0, %entry ]
%b.tr.i = phi i32 [ %rem.i, %tailrecurse.i ], [ %1, %entry ]
%rem.i = srem i32 %a.tr.i, %b.tr.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %if.end, label %tailrecurse.i
tailrecurse.i6: ; preds = %entry, %tailrecurse.i6
%a.tr.i7 = phi i32 [ %b.tr.i8, %tailrecurse.i6 ], [ %1, %entry ]
%b.tr.i8 = phi i32 [ %rem.i9, %tailrecurse.i6 ], [ %0, %entry ]
%rem.i9 = srem i32 %a.tr.i7, %b.tr.i8
%cmp.i10 = icmp eq i32 %rem.i9, 0
br i1 %cmp.i10, label %if.end, label %tailrecurse.i6
if.end: ; preds = %tailrecurse.i6, %tailrecurse.i
%c.0 = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %b.tr.i8, %tailrecurse.i6 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0)
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d",&a,&b);
if(a<b){
c=a;a=b;b=c;
}
while(1){
c=a%b;
if(c==0)break;
a=b;
b=c;
}
printf("%d\n",b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159260/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159260/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%b.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%a.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem9 = srem i32 %a.promoted, %b.promoted
%cmp110 = icmp eq i32 %rem9, 0
br i1 %cmp110, label %while.end, label %if.end3
if.end3: ; preds = %if.end, %if.end3
%rem12 = phi i32 [ %rem, %if.end3 ], [ %rem9, %if.end ]
%rem811 = phi i32 [ %rem12, %if.end3 ], [ %b.promoted, %if.end ]
%rem = srem i32 %rem811, %rem12
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.cond.while.end_crit_edge, label %if.end3
while.cond.while.end_crit_edge: ; preds = %if.end3
store i32 %rem811, ptr %a, align 4, !tbaa !5
store i32 %rem12, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%.lcssa = phi i32 [ %rem12, %while.cond.while.end_crit_edge ], [ %b.promoted, %if.end ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
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"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.