Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a<b){
printf("a < b\n");
}
if(a>b){
printf("a > b\n");
}
if(a==b){
printf("a == b\n");
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288342/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288342/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre12 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre13 = load i32, ptr %a, align 4, !tbaa !5
%.pre14 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ]
%cmp6 = icmp eq i32 %5, %4
br i1 %cmp6, label %if.then7, label %if.end9
if.then7: ; preds = %if.end5
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end9
if.end9: ; preds = %if.then7, %if.end5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b;
scanf("%d %d", &a, &b);
if (a < b){
printf("a < b\n");
}
else if (a > b){
printf("a > b\n");
}
else {
printf("a == b\n");
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288393/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288393/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a;
int b;
scanf("%d %d", &a, &b);
if (a > b){
printf("a > b\n");
}
else if (a == b){
printf("a == b\n");
}
else {
printf("a < b\n");
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288436/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288436/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.4 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp2 = icmp eq i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
if(a>b)printf("a > b\n");
if(a<b)printf("a < b\n");
if(a==b)printf("a == b\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288487/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288487/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre12 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp2 = icmp slt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre13 = load i32, ptr %a, align 4, !tbaa !5
%.pre14 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ]
%cmp6 = icmp eq i32 %5, %4
br i1 %cmp6, label %if.then7, label %if.end9
if.then7: ; preds = %if.end5
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end9
if.end9: ; preds = %if.then7, %if.end5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
long long int n,m,k,x=1,y=1,a;
scanf("%I64d%I64d%I64d",&n,&m,&k);
if(k<n)
printf("%I64d 1",k+1);
if(k>=n&&k<(n+m-1))
printf("%I64d %I64d",n,1+((k-n+1)%m));
if(k>=(n+m-1)){
k=k-n+1-m;
y=m;
x=n-1;
a=k/(m-1);
x=x-a;
y=m-(k%(m-1));
if(a%2)
y=2+(k%(m-1));
printf("%I64d %I64d",x,y);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28853/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28853/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [16 x i8] c"%I64d%I64d%I64d\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%I64d 1\00", align 1
@.str.2 = private unnamed_addr constant [12 x i8] c"%I64d %I64d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %k)
%0 = load i64, ptr %k, align 8, !tbaa !5
%1 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add = add nsw i64 %0, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add)
%.pre = load i64, ptr %k, align 8, !tbaa !5
%.pre37 = load i64, ptr %n, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i64 [ %.pre37, %if.then ], [ %1, %entry ]
%3 = phi i64 [ %.pre, %if.then ], [ %0, %entry ]
%cmp2.not = icmp slt i64 %3, %2
%.pre41 = load i64, ptr %m, align 8, !tbaa !5
br i1 %cmp2.not, label %if.end10, label %land.lhs.true
land.lhs.true: ; preds = %if.end
%add3 = add i64 %2, -1
%sub = add i64 %add3, %.pre41
%cmp4 = icmp slt i64 %3, %sub
br i1 %cmp4, label %if.then5, label %if.end10
if.then5: ; preds = %land.lhs.true
%sub6 = add nsw i64 %3, 1
%add7 = sub i64 %sub6, %2
%rem = srem i64 %add7, %.pre41
%add8 = add nsw i64 %rem, 1
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %2, i64 noundef %add8)
%.pre38 = load i64, ptr %k, align 8, !tbaa !5
%.pre39 = load i64, ptr %n, align 8, !tbaa !5
%.pre40 = load i64, ptr %m, align 8, !tbaa !5
br label %if.end10
if.end10: ; preds = %if.then5, %land.lhs.true, %if.end
%4 = phi i64 [ %.pre40, %if.then5 ], [ %.pre41, %land.lhs.true ], [ %.pre41, %if.end ]
%5 = phi i64 [ %.pre39, %if.then5 ], [ %2, %land.lhs.true ], [ %2, %if.end ]
%6 = phi i64 [ %.pre38, %if.then5 ], [ %3, %land.lhs.true ], [ %3, %if.end ]
%add11 = add nsw i64 %4, %5
%sub12 = add nsw i64 %add11, -1
%cmp13.not = icmp slt i64 %6, %sub12
br i1 %cmp13.not, label %if.end31, label %if.then14
if.then14: ; preds = %if.end10
%7 = add i64 %6, 1
%sub17 = sub i64 %7, %add11
store i64 %sub17, ptr %k, align 8, !tbaa !5
%sub19 = add nsw i64 %4, -1
%div = sdiv i64 %sub17, %sub19
%8 = xor i64 %div, -1
%sub20 = add i64 %5, %8
%rem22 = srem i64 %sub17, %sub19
%sub23 = sub nsw i64 %4, %rem22
%9 = and i64 %div, 1
%tobool.not = icmp eq i64 %9, 0
%add28 = add nsw i64 %rem22, 2
%spec.select = select i1 %tobool.not, i64 %sub23, i64 %add28
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub20, i64 noundef %spec.select)
br label %if.end31
if.end31: ; preds = %if.then14, %if.end10
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
if(a>b)printf("a > b\n");
if(a<b)printf("a < b\n");
if(a==b)printf("a == b\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288580/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288580/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre12 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp2 = icmp slt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre13 = load i32, ptr %a, align 4, !tbaa !5
%.pre14 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ]
%cmp6 = icmp eq i32 %5, %4
br i1 %cmp6, label %if.then7, label %if.end9
if.then7: ; preds = %if.end5
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end9
if.end9: ; preds = %if.then7, %if.end5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a < b){
printf("a < b");
}
else if(a > b){
printf("a > b");
}
else{
printf("a == b");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288623/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288623/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3
%.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d%d",&a,&b);
if(a<b){
printf("a < b\n");
}
else if(a>b){
printf("a > b\n");
}
else{
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288681/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288681/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a, b;
scanf("%d %d", &a, &b);
if(a > b)
{
printf("a > b\n");
}
else if(a < b)
{
printf("a < b\n");
}
else
{
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288724/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288724/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp2 = icmp slt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a<b){
printf("a < b\n");
}else if(a>b){
printf("a > b\n");
}else{
printf("a == b\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288768/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288768/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
if(a < b){
printf("a < b\n");
}
else if(a > b){
printf("a > b\n");
}
else if(a == b){
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288818/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288818/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.end10.sink.split, label %if.else
if.else: ; preds = %entry
%cmp2 = icmp sgt i32 %0, %1
br i1 %cmp2, label %if.end10.sink.split, label %if.else5
if.else5: ; preds = %if.else
%cmp6 = icmp eq i32 %0, %1
br i1 %cmp6, label %if.end10.sink.split, label %if.end10
if.end10.sink.split: ; preds = %if.else5, %if.else, %entry
%str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ]
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
br label %if.end10
if.end10: ; preds = %if.end10.sink.split, %if.else5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
void update(int v, int* min, int* max) {
if (*min > v) *min = v;
if (*max < v) *max = v;
}
int main(void) {
int a, b, c;
int min, max;
if (scanf("%d%d%d", &a, &b, &c) != 3) return 1;
min = max = a;
update(b, &min, &max);
update(c, &min, &max);
printf("%d %d\n", min, max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288861/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288861/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @update(i32 noundef %v, ptr nocapture noundef %min, ptr nocapture noundef %max) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %min, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %v
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %v, ptr %min, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = load i32, ptr %max, align 4, !tbaa !5
%cmp1 = icmp slt i32 %1, %v
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %v, ptr %max, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
ret void
}
; 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
%c = alloca i32, align 4
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 4, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%cmp.not = icmp eq i32 %call, 3
br i1 %cmp.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%max.0 = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%2 = load i32, ptr %c, align 4, !tbaa !5
%min.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %2)
%max.1 = call i32 @llvm.smax.i32(i32 %max.0, i32 %2)
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.1, i32 noundef %max.1)
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ 0, %if.end ], [ 1, %entry ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #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
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
// AOJ 2299: Tiles are Colorful
// 2017.12.10
#include <stdio.h>
#include <string.h>
int m, n;
char map[501][503];
int mv[4][2] = {{-1,0},{1,0},{0,1},{0,-1}};
int rpos['Z'+1], cpos['Z'+1];
int sr[501], sc[501];
int calc()
{
int r, c, i, r2, c2, a, ans = 0;
for (r = 0; r < m; r++) for (c = 0; c < n; c++)
if ((sr[c] + sc[r]) && map[r][c] == '.' ) {
memset(rpos, -1, sizeof(rpos));
for (i = 0; i < 4; i++) {
if (!sr[c]) { if (i < 2) continue; }
if (!sc[r]) { if (i > 2) continue; }
r2 = r, c2 = c;
while (1) {
r2 += mv[i][0], c2 += mv[i][1];
if (r2 < 0 || r2 >= m || c2 < 0 || c2 >= n) break;
if (map[r2][c2] == '.') continue;
a = map[r2][c2];
if (rpos[a] >= 0) {
map[r2][c2] = '.', sr[c2]--, sc[r2]--;
r2 = rpos[a], c2 = cpos[a];
map[r2][c2] = '.', sr[c2]--, sc[r2]--;
ans += 2;
} else rpos[a] = r2, cpos[a] = c2;
break;
}
}
}
return ans;
}
int main()
{
int r, c, t, k, ans;
char buf[10];
fgets(buf, 10, stdin);
sscanf(buf, "%d%d", &m, &n);
for (k = 0, r = 0; r < m; r++) {
fgets(map[r], 503, stdin);
for (c = 0; c < n; c++) {
if (map[r][c] != '.') k++, sr[c]++, sc[r]++;
}
}
ans = 0;
while (1) {
if (!(t = calc())) break;
ans += t, k -= t;
if (!k) break;
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288904/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288904/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mv = dso_local local_unnamed_addr global [4 x [2 x i32]] [[2 x i32] [i32 -1, i32 0], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 0, i32 -1]], align 16
@m = dso_local global i32 0, align 4
@n = dso_local global i32 0, align 4
@sr = dso_local local_unnamed_addr global [501 x i32] zeroinitializer, align 16
@sc = dso_local local_unnamed_addr global [501 x i32] zeroinitializer, align 16
@map = dso_local global [501 x [503 x i8]] zeroinitializer, align 16
@rpos = dso_local local_unnamed_addr global [91 x i32] zeroinitializer, align 16
@cpos = dso_local local_unnamed_addr global [91 x i32] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@.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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @calc() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @m, align 4, !tbaa !5
%cmp157 = icmp sgt i32 %0, 0
br i1 %cmp157, label %for.cond1.preheader.lr.ph, label %for.end107
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr @n, align 4
%cmp2154 = icmp sgt i32 %1, 0
br i1 %cmp2154, label %for.cond1.preheader.us.preheader, label %for.end107
for.cond1.preheader.us.preheader: ; preds = %for.cond1.preheader.lr.ph
%wide.trip.count169 = zext i32 %0 to i64
%wide.trip.count = zext i32 %1 to i64
%2 = load i32, ptr @mv, align 16
%3 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 0, i64 1), align 4
%4 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 1), align 8
%5 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 1, i64 1), align 4
%6 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 2), align 16
%7 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 2, i64 1), align 4
%8 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 3), align 8
%9 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 3, i64 1), align 4
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc105_crit_edge.us
%indvars.iv166 = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next167, %for.cond1.for.inc105_crit_edge.us ]
%ans.0159.us = phi i32 [ 0, %for.cond1.preheader.us.preheader ], [ %ans.4.us, %for.cond1.for.inc105_crit_edge.us ]
%arrayidx5.us = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %indvars.iv166
%10 = trunc i64 %indvars.iv166 to i32
br label %for.body3.us
for.body3.us: ; preds = %for.cond1.preheader.us, %for.inc102.us
%indvars.iv = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next, %for.inc102.us ]
%ans.1156.us = phi i32 [ %ans.0159.us, %for.cond1.preheader.us ], [ %ans.4.us, %for.inc102.us ]
%arrayidx.us = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %indvars.iv
%11 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx5.us, align 4, !tbaa !5
%add.us = sub i32 0, %12
%tobool.not.us = icmp eq i32 %11, %add.us
br i1 %tobool.not.us, label %for.inc102.us, label %land.lhs.true.us
land.lhs.true.us: ; preds = %for.body3.us
%arrayidx9.us = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %indvars.iv166, i64 %indvars.iv
%13 = load i8, ptr %arrayidx9.us, align 1, !tbaa !9
%cmp10.us = icmp eq i8 %13, 46
br i1 %cmp10.us, label %if.then.us, label %for.inc102.us
if.then.us: ; preds = %land.lhs.true.us
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(364) @rpos, i8 -1, i64 364, i1 false)
%tobool18.us = icmp eq i32 %11, 0
br i1 %tobool18.us, label %while.cond.preheader.us.2, label %while.cond.preheader.us
while.cond.us: ; preds = %while.cond.preheader.us, %if.end52.us
%r2.0.us = phi i32 [ %add36.us, %if.end52.us ], [ %10, %while.cond.preheader.us ]
%c2.0.us = phi i32 [ %add40.us, %if.end52.us ], [ %46, %while.cond.preheader.us ]
%add36.us = add nsw i32 %2, %r2.0.us
%add40.us = add nsw i32 %3, %c2.0.us
%cmp41.us = icmp slt i32 %add36.us, 0
br i1 %cmp41.us, label %while.cond.preheader.us.1, label %lor.lhs.false.us
lor.lhs.false.us: ; preds = %while.cond.us
%cmp43.us = icmp slt i32 %add36.us, %0
%cmp46.us = icmp sgt i32 %add40.us, -1
%or.cond.not149.us = select i1 %cmp43.us, i1 %cmp46.us, i1 false
%cmp49.not.us = icmp slt i32 %add40.us, %1
%or.cond148.us = select i1 %or.cond.not149.us, i1 %cmp49.not.us, i1 false
br i1 %or.cond148.us, label %if.end52.us, label %while.cond.preheader.us.1
if.end52.us: ; preds = %lor.lhs.false.us
%idxprom53.us = zext i32 %add36.us to i64
%idxprom55.us = zext i32 %add40.us to i64
%arrayidx56.us = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %idxprom53.us, i64 %idxprom55.us
%14 = load i8, ptr %arrayidx56.us, align 1, !tbaa !9
%cmp58.us = icmp eq i8 %14, 46
br i1 %cmp58.us, label %while.cond.us, label %if.end61.us
if.end61.us: ; preds = %if.end52.us
%idxprom67.us = sext i8 %14 to i64
%arrayidx68.us = getelementptr inbounds [91 x i32], ptr @rpos, i64 0, i64 %idxprom67.us
%15 = load i32, ptr %arrayidx68.us, align 4, !tbaa !5
%cmp69.us = icmp sgt i32 %15, -1
br i1 %cmp69.us, label %for.inc.us, label %if.else.us
if.else.us: ; preds = %if.end61.us
store i32 %add36.us, ptr %arrayidx68.us, align 4, !tbaa !5
%arrayidx99.us = getelementptr inbounds [91 x i32], ptr @cpos, i64 0, i64 %idxprom67.us
store i32 %add40.us, ptr %arrayidx99.us, align 4, !tbaa !5
br label %while.cond.preheader.us.1
for.inc.us: ; preds = %if.end61.us
store i8 46, ptr %arrayidx56.us, align 1, !tbaa !9
%arrayidx77.us = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %idxprom55.us
%16 = load i32, ptr %arrayidx77.us, align 4, !tbaa !5
%dec.us = add nsw i32 %16, -1
store i32 %dec.us, ptr %arrayidx77.us, align 4, !tbaa !5
%arrayidx79.us = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %idxprom53.us
%17 = load i32, ptr %arrayidx79.us, align 4, !tbaa !5
%dec80.us = add nsw i32 %17, -1
store i32 %dec80.us, ptr %arrayidx79.us, align 4, !tbaa !5
%arrayidx84.us = getelementptr inbounds [91 x i32], ptr @cpos, i64 0, i64 %idxprom67.us
%18 = load i32, ptr %arrayidx84.us, align 4, !tbaa !5
%idxprom85.us = zext i32 %15 to i64
%idxprom87.us = sext i32 %18 to i64
%arrayidx88.us = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %idxprom85.us, i64 %idxprom87.us
store i8 46, ptr %arrayidx88.us, align 1, !tbaa !9
%arrayidx90.us = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %idxprom87.us
%19 = load i32, ptr %arrayidx90.us, align 4, !tbaa !5
%dec91.us = add nsw i32 %19, -1
store i32 %dec91.us, ptr %arrayidx90.us, align 4, !tbaa !5
%arrayidx93.us = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %idxprom85.us
%20 = load i32, ptr %arrayidx93.us, align 4, !tbaa !5
%dec94.us = add nsw i32 %20, -1
store i32 %dec94.us, ptr %arrayidx93.us, align 4, !tbaa !5
%add95.us = add nsw i32 %ans.1156.us, 2
%.pre = load i32, ptr %arrayidx.us, align 4, !tbaa !5
%tobool18.us.1 = icmp eq i32 %.pre, 0
br i1 %tobool18.us.1, label %while.cond.preheader.us.2, label %while.cond.preheader.us.1
while.cond.preheader.us.1: ; preds = %while.cond.us, %lor.lhs.false.us, %if.else.us, %for.inc.us
%ans.3.us173 = phi i32 [ %add95.us, %for.inc.us ], [ %ans.1156.us, %if.else.us ], [ %ans.1156.us, %lor.lhs.false.us ], [ %ans.1156.us, %while.cond.us ]
%21 = trunc i64 %indvars.iv to i32
br label %while.cond.us.1
while.cond.us.1: ; preds = %if.end52.us.1, %while.cond.preheader.us.1
%r2.0.us.1 = phi i32 [ %add36.us.1, %if.end52.us.1 ], [ %10, %while.cond.preheader.us.1 ]
%c2.0.us.1 = phi i32 [ %add40.us.1, %if.end52.us.1 ], [ %21, %while.cond.preheader.us.1 ]
%add36.us.1 = add nsw i32 %4, %r2.0.us.1
%add40.us.1 = add nsw i32 %5, %c2.0.us.1
%cmp41.us.1 = icmp slt i32 %add36.us.1, 0
br i1 %cmp41.us.1, label %while.cond.preheader.us.2, label %lor.lhs.false.us.1
lor.lhs.false.us.1: ; preds = %while.cond.us.1
%cmp43.us.1 = icmp slt i32 %add36.us.1, %0
%cmp46.us.1 = icmp sgt i32 %add40.us.1, -1
%or.cond.not149.us.1 = select i1 %cmp43.us.1, i1 %cmp46.us.1, i1 false
%cmp49.not.us.1 = icmp slt i32 %add40.us.1, %1
%or.cond148.us.1 = select i1 %or.cond.not149.us.1, i1 %cmp49.not.us.1, i1 false
br i1 %or.cond148.us.1, label %if.end52.us.1, label %while.cond.preheader.us.2
if.end52.us.1: ; preds = %lor.lhs.false.us.1
%idxprom53.us.1 = zext i32 %add36.us.1 to i64
%idxprom55.us.1 = zext i32 %add40.us.1 to i64
%arrayidx56.us.1 = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %idxprom53.us.1, i64 %idxprom55.us.1
%22 = load i8, ptr %arrayidx56.us.1, align 1, !tbaa !9
%cmp58.us.1 = icmp eq i8 %22, 46
br i1 %cmp58.us.1, label %while.cond.us.1, label %if.end61.us.1
if.end61.us.1: ; preds = %if.end52.us.1
%idxprom67.us.1 = sext i8 %22 to i64
%arrayidx68.us.1 = getelementptr inbounds [91 x i32], ptr @rpos, i64 0, i64 %idxprom67.us.1
%23 = load i32, ptr %arrayidx68.us.1, align 4, !tbaa !5
%cmp69.us.1 = icmp sgt i32 %23, -1
br i1 %cmp69.us.1, label %if.then71.us.1, label %if.else.us.1
if.else.us.1: ; preds = %if.end61.us.1
store i32 %add36.us.1, ptr %arrayidx68.us.1, align 4, !tbaa !5
%arrayidx99.us.1 = getelementptr inbounds [91 x i32], ptr @cpos, i64 0, i64 %idxprom67.us.1
store i32 %add40.us.1, ptr %arrayidx99.us.1, align 4, !tbaa !5
br label %while.cond.preheader.us.2
if.then71.us.1: ; preds = %if.end61.us.1
store i8 46, ptr %arrayidx56.us.1, align 1, !tbaa !9
%arrayidx77.us.1 = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %idxprom55.us.1
%24 = load i32, ptr %arrayidx77.us.1, align 4, !tbaa !5
%dec.us.1 = add nsw i32 %24, -1
store i32 %dec.us.1, ptr %arrayidx77.us.1, align 4, !tbaa !5
%arrayidx79.us.1 = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %idxprom53.us.1
%25 = load i32, ptr %arrayidx79.us.1, align 4, !tbaa !5
%dec80.us.1 = add nsw i32 %25, -1
store i32 %dec80.us.1, ptr %arrayidx79.us.1, align 4, !tbaa !5
%arrayidx84.us.1 = getelementptr inbounds [91 x i32], ptr @cpos, i64 0, i64 %idxprom67.us.1
%26 = load i32, ptr %arrayidx84.us.1, align 4, !tbaa !5
%idxprom85.us.1 = zext i32 %23 to i64
%idxprom87.us.1 = sext i32 %26 to i64
%arrayidx88.us.1 = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %idxprom85.us.1, i64 %idxprom87.us.1
store i8 46, ptr %arrayidx88.us.1, align 1, !tbaa !9
%arrayidx90.us.1 = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %idxprom87.us.1
%27 = load i32, ptr %arrayidx90.us.1, align 4, !tbaa !5
%dec91.us.1 = add nsw i32 %27, -1
store i32 %dec91.us.1, ptr %arrayidx90.us.1, align 4, !tbaa !5
%arrayidx93.us.1 = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %idxprom85.us.1
%28 = load i32, ptr %arrayidx93.us.1, align 4, !tbaa !5
%dec94.us.1 = add nsw i32 %28, -1
store i32 %dec94.us.1, ptr %arrayidx93.us.1, align 4, !tbaa !5
%add95.us.1 = add nsw i32 %ans.3.us173, 2
br label %while.cond.preheader.us.2
while.cond.preheader.us.2: ; preds = %while.cond.us.1, %lor.lhs.false.us.1, %if.then.us, %if.then71.us.1, %if.else.us.1, %for.inc.us
%ans.3.us.1 = phi i32 [ %add95.us, %for.inc.us ], [ %add95.us.1, %if.then71.us.1 ], [ %ans.3.us173, %if.else.us.1 ], [ %ans.1156.us, %if.then.us ], [ %ans.3.us173, %lor.lhs.false.us.1 ], [ %ans.3.us173, %while.cond.us.1 ]
%29 = trunc i64 %indvars.iv to i32
br label %while.cond.us.2
while.cond.us.2: ; preds = %if.end52.us.2, %while.cond.preheader.us.2
%r2.0.us.2 = phi i32 [ %add36.us.2, %if.end52.us.2 ], [ %10, %while.cond.preheader.us.2 ]
%c2.0.us.2 = phi i32 [ %add40.us.2, %if.end52.us.2 ], [ %29, %while.cond.preheader.us.2 ]
%add36.us.2 = add nsw i32 %6, %r2.0.us.2
%add40.us.2 = add nsw i32 %7, %c2.0.us.2
%cmp41.us.2 = icmp slt i32 %add36.us.2, 0
br i1 %cmp41.us.2, label %if.end23.us.3, label %lor.lhs.false.us.2
lor.lhs.false.us.2: ; preds = %while.cond.us.2
%cmp43.us.2 = icmp slt i32 %add36.us.2, %0
%cmp46.us.2 = icmp sgt i32 %add40.us.2, -1
%or.cond.not149.us.2 = select i1 %cmp43.us.2, i1 %cmp46.us.2, i1 false
%cmp49.not.us.2 = icmp slt i32 %add40.us.2, %1
%or.cond148.us.2 = select i1 %or.cond.not149.us.2, i1 %cmp49.not.us.2, i1 false
br i1 %or.cond148.us.2, label %if.end52.us.2, label %if.end23.us.3
if.end52.us.2: ; preds = %lor.lhs.false.us.2
%idxprom53.us.2 = zext i32 %add36.us.2 to i64
%idxprom55.us.2 = zext i32 %add40.us.2 to i64
%arrayidx56.us.2 = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %idxprom53.us.2, i64 %idxprom55.us.2
%30 = load i8, ptr %arrayidx56.us.2, align 1, !tbaa !9
%cmp58.us.2 = icmp eq i8 %30, 46
br i1 %cmp58.us.2, label %while.cond.us.2, label %if.end61.us.2
if.end61.us.2: ; preds = %if.end52.us.2
%idxprom67.us.2 = sext i8 %30 to i64
%arrayidx68.us.2 = getelementptr inbounds [91 x i32], ptr @rpos, i64 0, i64 %idxprom67.us.2
%31 = load i32, ptr %arrayidx68.us.2, align 4, !tbaa !5
%cmp69.us.2 = icmp sgt i32 %31, -1
br i1 %cmp69.us.2, label %if.then71.us.2, label %if.else.us.2
if.else.us.2: ; preds = %if.end61.us.2
store i32 %add36.us.2, ptr %arrayidx68.us.2, align 4, !tbaa !5
%arrayidx99.us.2 = getelementptr inbounds [91 x i32], ptr @cpos, i64 0, i64 %idxprom67.us.2
store i32 %add40.us.2, ptr %arrayidx99.us.2, align 4, !tbaa !5
br label %if.end23.us.3
if.then71.us.2: ; preds = %if.end61.us.2
store i8 46, ptr %arrayidx56.us.2, align 1, !tbaa !9
%arrayidx77.us.2 = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %idxprom55.us.2
%32 = load i32, ptr %arrayidx77.us.2, align 4, !tbaa !5
%dec.us.2 = add nsw i32 %32, -1
store i32 %dec.us.2, ptr %arrayidx77.us.2, align 4, !tbaa !5
%arrayidx79.us.2 = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %idxprom53.us.2
%33 = load i32, ptr %arrayidx79.us.2, align 4, !tbaa !5
%dec80.us.2 = add nsw i32 %33, -1
store i32 %dec80.us.2, ptr %arrayidx79.us.2, align 4, !tbaa !5
%arrayidx84.us.2 = getelementptr inbounds [91 x i32], ptr @cpos, i64 0, i64 %idxprom67.us.2
%34 = load i32, ptr %arrayidx84.us.2, align 4, !tbaa !5
%idxprom85.us.2 = zext i32 %31 to i64
%idxprom87.us.2 = sext i32 %34 to i64
%arrayidx88.us.2 = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %idxprom85.us.2, i64 %idxprom87.us.2
store i8 46, ptr %arrayidx88.us.2, align 1, !tbaa !9
%arrayidx90.us.2 = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %idxprom87.us.2
%35 = load i32, ptr %arrayidx90.us.2, align 4, !tbaa !5
%dec91.us.2 = add nsw i32 %35, -1
store i32 %dec91.us.2, ptr %arrayidx90.us.2, align 4, !tbaa !5
%arrayidx93.us.2 = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %idxprom85.us.2
%36 = load i32, ptr %arrayidx93.us.2, align 4, !tbaa !5
%dec94.us.2 = add nsw i32 %36, -1
store i32 %dec94.us.2, ptr %arrayidx93.us.2, align 4, !tbaa !5
%add95.us.2 = add nsw i32 %ans.3.us.1, 2
br label %if.end23.us.3
if.end23.us.3: ; preds = %lor.lhs.false.us.2, %while.cond.us.2, %if.else.us.2, %if.then71.us.2
%ans.3.us.2 = phi i32 [ %add95.us.2, %if.then71.us.2 ], [ %ans.3.us.1, %if.else.us.2 ], [ %ans.3.us.1, %while.cond.us.2 ], [ %ans.3.us.1, %lor.lhs.false.us.2 ]
%37 = load i32, ptr %arrayidx5.us, align 4, !tbaa !5
%tobool26.us.3 = icmp eq i32 %37, 0
br i1 %tobool26.us.3, label %for.inc102.us, label %while.cond.preheader.us.3
while.cond.preheader.us.3: ; preds = %if.end23.us.3
%38 = trunc i64 %indvars.iv to i32
br label %while.cond.us.3
while.cond.us.3: ; preds = %if.end52.us.3, %while.cond.preheader.us.3
%r2.0.us.3 = phi i32 [ %add36.us.3, %if.end52.us.3 ], [ %10, %while.cond.preheader.us.3 ]
%c2.0.us.3 = phi i32 [ %add40.us.3, %if.end52.us.3 ], [ %38, %while.cond.preheader.us.3 ]
%add36.us.3 = add nsw i32 %8, %r2.0.us.3
%add40.us.3 = add nsw i32 %9, %c2.0.us.3
%cmp41.us.3 = icmp slt i32 %add36.us.3, 0
br i1 %cmp41.us.3, label %for.inc102.us, label %lor.lhs.false.us.3
lor.lhs.false.us.3: ; preds = %while.cond.us.3
%cmp43.us.3 = icmp slt i32 %add36.us.3, %0
%cmp46.us.3 = icmp sgt i32 %add40.us.3, -1
%or.cond.not149.us.3 = select i1 %cmp43.us.3, i1 %cmp46.us.3, i1 false
%cmp49.not.us.3 = icmp slt i32 %add40.us.3, %1
%or.cond148.us.3 = select i1 %or.cond.not149.us.3, i1 %cmp49.not.us.3, i1 false
br i1 %or.cond148.us.3, label %if.end52.us.3, label %for.inc102.us
if.end52.us.3: ; preds = %lor.lhs.false.us.3
%idxprom53.us.3 = zext i32 %add36.us.3 to i64
%idxprom55.us.3 = zext i32 %add40.us.3 to i64
%arrayidx56.us.3 = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %idxprom53.us.3, i64 %idxprom55.us.3
%39 = load i8, ptr %arrayidx56.us.3, align 1, !tbaa !9
%cmp58.us.3 = icmp eq i8 %39, 46
br i1 %cmp58.us.3, label %while.cond.us.3, label %if.end61.us.3
if.end61.us.3: ; preds = %if.end52.us.3
%idxprom67.us.3 = sext i8 %39 to i64
%arrayidx68.us.3 = getelementptr inbounds [91 x i32], ptr @rpos, i64 0, i64 %idxprom67.us.3
%40 = load i32, ptr %arrayidx68.us.3, align 4, !tbaa !5
%cmp69.us.3 = icmp sgt i32 %40, -1
br i1 %cmp69.us.3, label %if.then71.us.3, label %if.else.us.3
if.else.us.3: ; preds = %if.end61.us.3
store i32 %add36.us.3, ptr %arrayidx68.us.3, align 4, !tbaa !5
%arrayidx99.us.3 = getelementptr inbounds [91 x i32], ptr @cpos, i64 0, i64 %idxprom67.us.3
store i32 %add40.us.3, ptr %arrayidx99.us.3, align 4, !tbaa !5
br label %for.inc102.us
if.then71.us.3: ; preds = %if.end61.us.3
store i8 46, ptr %arrayidx56.us.3, align 1, !tbaa !9
%arrayidx77.us.3 = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %idxprom55.us.3
%41 = load i32, ptr %arrayidx77.us.3, align 4, !tbaa !5
%dec.us.3 = add nsw i32 %41, -1
store i32 %dec.us.3, ptr %arrayidx77.us.3, align 4, !tbaa !5
%arrayidx79.us.3 = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %idxprom53.us.3
%42 = load i32, ptr %arrayidx79.us.3, align 4, !tbaa !5
%dec80.us.3 = add nsw i32 %42, -1
store i32 %dec80.us.3, ptr %arrayidx79.us.3, align 4, !tbaa !5
%arrayidx84.us.3 = getelementptr inbounds [91 x i32], ptr @cpos, i64 0, i64 %idxprom67.us.3
%43 = load i32, ptr %arrayidx84.us.3, align 4, !tbaa !5
%idxprom85.us.3 = zext i32 %40 to i64
%idxprom87.us.3 = sext i32 %43 to i64
%arrayidx88.us.3 = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %idxprom85.us.3, i64 %idxprom87.us.3
store i8 46, ptr %arrayidx88.us.3, align 1, !tbaa !9
%arrayidx90.us.3 = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %idxprom87.us.3
%44 = load i32, ptr %arrayidx90.us.3, align 4, !tbaa !5
%dec91.us.3 = add nsw i32 %44, -1
store i32 %dec91.us.3, ptr %arrayidx90.us.3, align 4, !tbaa !5
%arrayidx93.us.3 = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %idxprom85.us.3
%45 = load i32, ptr %arrayidx93.us.3, align 4, !tbaa !5
%dec94.us.3 = add nsw i32 %45, -1
store i32 %dec94.us.3, ptr %arrayidx93.us.3, align 4, !tbaa !5
%add95.us.3 = add nsw i32 %ans.3.us.2, 2
br label %for.inc102.us
for.inc102.us: ; preds = %lor.lhs.false.us.3, %while.cond.us.3, %if.end23.us.3, %if.else.us.3, %if.then71.us.3, %land.lhs.true.us, %for.body3.us
%ans.4.us = phi i32 [ %ans.1156.us, %land.lhs.true.us ], [ %ans.1156.us, %for.body3.us ], [ %ans.3.us.2, %if.end23.us.3 ], [ %add95.us.3, %if.then71.us.3 ], [ %ans.3.us.2, %if.else.us.3 ], [ %ans.3.us.2, %while.cond.us.3 ], [ %ans.3.us.2, %lor.lhs.false.us.3 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.for.inc105_crit_edge.us, label %for.body3.us, !llvm.loop !10
while.cond.preheader.us: ; preds = %if.then.us
%46 = trunc i64 %indvars.iv to i32
br label %while.cond.us
for.cond1.for.inc105_crit_edge.us: ; preds = %for.inc102.us
%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.end107, label %for.cond1.preheader.us, !llvm.loop !12
for.end107: ; preds = %for.cond1.for.inc105_crit_edge.us, %for.cond1.preheader.lr.ph, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ 0, %for.cond1.preheader.lr.ph ], [ %ans.4.us, %for.cond1.for.inc105_crit_edge.us ]
ret i32 %ans.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%buf = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %buf) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !13
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 10, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull @m, ptr noundef nonnull @n) #5
%1 = load i32, ptr @m, align 4, !tbaa !5
%cmp45 = icmp sgt i32 %1, 0
br i1 %cmp45, label %for.body, label %while.cond.preheader
for.body: ; preds = %entry, %for.inc21
%indvars.iv50 = phi i64 [ %indvars.iv.next51, %for.inc21 ], [ 0, %entry ]
%k.047 = phi i32 [ %k.1.lcssa, %for.inc21 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %indvars.iv50
%2 = load ptr, ptr @stdin, align 8, !tbaa !13
%call4 = call ptr @fgets(ptr noundef nonnull %arrayidx, i32 noundef 503, ptr noundef %2)
%3 = load i32, ptr @n, align 4, !tbaa !5
%cmp642 = icmp sgt i32 %3, 0
br i1 %cmp642, label %for.body7.lr.ph, label %for.inc21
for.body7.lr.ph: ; preds = %for.body
%arrayidx18 = getelementptr inbounds [501 x i32], ptr @sc, i64 0, i64 %indvars.iv50
%wide.trip.count = zext i32 %3 to i64
br label %for.body7
for.body7: ; preds = %for.body7.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next, %for.inc ]
%k.144 = phi i32 [ %k.047, %for.body7.lr.ph ], [ %k.2, %for.inc ]
%arrayidx11 = getelementptr inbounds [501 x [503 x i8]], ptr @map, i64 0, i64 %indvars.iv50, i64 %indvars.iv
%4 = load i8, ptr %arrayidx11, align 1, !tbaa !9
%cmp12.not = icmp eq i8 %4, 46
br i1 %cmp12.not, label %for.inc, label %if.then
if.then: ; preds = %for.body7
%inc = add nsw i32 %k.144, 1
%arrayidx15 = getelementptr inbounds [501 x i32], ptr @sr, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%inc16 = add nsw i32 %5, 1
store i32 %inc16, ptr %arrayidx15, align 4, !tbaa !5
%6 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%inc19 = add nsw i32 %6, 1
store i32 %inc19, ptr %arrayidx18, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body7, %if.then
%k.2 = phi i32 [ %inc, %if.then ], [ %k.144, %for.body7 ]
%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.inc21, label %for.body7, !llvm.loop !15
for.inc21: ; preds = %for.inc, %for.body
%k.1.lcssa = phi i32 [ %k.047, %for.body ], [ %k.2, %for.inc ]
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%7 = load i32, ptr @m, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next51, %8
br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !16
while.cond.preheader: ; preds = %for.inc21, %entry
%k.3.ph = phi i32 [ 0, %entry ], [ %k.1.lcssa, %for.inc21 ]
br label %while.cond
while.cond: ; preds = %while.cond.preheader, %if.end26
%k.3 = phi i32 [ %sub, %if.end26 ], [ %k.3.ph, %while.cond.preheader ]
%ans.0 = phi i32 [ %add, %if.end26 ], [ 0, %while.cond.preheader ]
%call24 = call i32 @calc()
%tobool.not = icmp eq i32 %call24, 0
br i1 %tobool.not, label %while.end, label %if.end26
if.end26: ; preds = %while.cond
%add = add nsw i32 %call24, %ans.0
%sub = sub nsw i32 %k.3, %call24
%tobool27.not = icmp eq i32 %sub, 0
br i1 %tobool27.not, label %while.end, label %while.cond
while.end: ; preds = %if.end26, %while.cond
%ans.1 = phi i32 [ %add, %if.end26 ], [ %ans.0, %while.cond ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %buf) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
|
#include<stdio.h>
int main()
{
long n,k,x,y,z,m;
long i, j;
scanf("%ld %ld", &n,&k);
for (i = 0; i < n; i++) {
if (i == 0) {
scanf("%ld", &y);
m = y;
continue;
}
scanf("%ld",&x);
if (x>m) {
m = x;
}
if (x < y) {
z = y;
y = x;
x = z;
}
while (x%y != 0) {
z = y;
y = x%y;
x = z;
}
}
if (k%y == 0&&k<=m) {
printf("POSSIBLE");
}else{
printf("IMPOSSIBLE");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288955/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288955/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"POSSIBLE\00", align 1
@.str.3 = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%k = alloca i64, align 8
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4
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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp30 = icmp sgt i64 %0, 0
br i1 %cmp30, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.032 = phi i64 [ %inc, %for.inc ], [ 0, %entry ]
%m.031 = phi i64 [ %m.2, %for.inc ], [ undef, %entry ]
%cmp1 = icmp eq i64 %i.032, 0
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %for.body
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %y)
%1 = load i64, ptr %y, align 8, !tbaa !5
br label %for.inc
if.end: ; preds = %for.body
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load i64, ptr %x, align 8, !tbaa !5
%spec.select = call i64 @llvm.smax.i64(i64 %2, i64 %m.031)
%3 = load i64, ptr %y, align 8, !tbaa !5
%cmp7 = icmp slt i64 %2, %3
br i1 %cmp7, label %if.then8, label %if.end9
if.then8: ; preds = %if.end
store i64 %2, ptr %y, align 8, !tbaa !5
store i64 %3, ptr %x, align 8, !tbaa !5
br label %if.end9
if.end9: ; preds = %if.then8, %if.end
%y.promoted = phi i64 [ %2, %if.then8 ], [ %3, %if.end ]
%x.promoted = phi i64 [ %3, %if.then8 ], [ %2, %if.end ]
%rem26 = srem i64 %x.promoted, %y.promoted
%cmp10.not27 = icmp eq i64 %rem26, 0
br i1 %cmp10.not27, label %for.inc, label %while.body
while.body: ; preds = %if.end9, %while.body
%rem29 = phi i64 [ %rem, %while.body ], [ %rem26, %if.end9 ]
%rem2528 = phi i64 [ %rem29, %while.body ], [ %y.promoted, %if.end9 ]
%rem = srem i64 %rem2528, %rem29
%cmp10.not = icmp eq i64 %rem, 0
br i1 %cmp10.not, label %while.cond.for.inc.loopexit_crit_edge, label %while.body, !llvm.loop !9
while.cond.for.inc.loopexit_crit_edge: ; preds = %while.body
store i64 %rem29, ptr %y, align 8, !tbaa !5
store i64 %rem2528, ptr %x, align 8, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end9, %while.cond.for.inc.loopexit_crit_edge, %if.then
%4 = phi i64 [ %1, %if.then ], [ %rem29, %while.cond.for.inc.loopexit_crit_edge ], [ %y.promoted, %if.end9 ]
%m.2 = phi i64 [ %1, %if.then ], [ %spec.select, %while.cond.for.inc.loopexit_crit_edge ], [ %spec.select, %if.end9 ]
%inc = add nuw nsw i64 %i.032, 1
%5 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
%6 = phi i64 [ undef, %entry ], [ %4, %for.inc ]
%m.0.lcssa = phi i64 [ undef, %entry ], [ %m.2, %for.inc ]
%7 = load i64, ptr %k, align 8, !tbaa !5
%rem12 = srem i64 %7, %6
%cmp13 = icmp ne i64 %rem12, 0
%cmp14.not = icmp sgt i64 %7, %m.0.lcssa
%or.cond = select i1 %cmp13, i1 true, i1 %cmp14.not
%.str.3..str.2 = select i1 %or.cond, ptr @.str.3, ptr @.str.2
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
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 speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int sq_cmp(int h, int w, int h2, int w2)
{
int d1 = h * h + w * w , d2 = h2 * h2 + w2 * w2;
if (d1 > d2) return(1);
else if (d1 < d2) return (-1);
else {
if (h > h2) return (1);
else if (h < h2) return (-1);
else return(0);
}
}
int main(void)
{
int h, w, h2, w2, i, j;
while(1)
{
scanf("%d %d", &h, &w);
if (h == 0 && w == 0) break;
h2 = 150;
w2 = 150;
for (i = 1; i <= 150; i++){
for (j = i + 1; j <= 150; j++){
if (sq_cmp(h, w, i, j) == -1 && sq_cmp(h2, w2, i, j)== 1){
h2 = i;
w2 = j;
}
}
}
printf("%d %d\n", h2, w2);
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_288999/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_288999/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sq_cmp(i32 noundef %h, i32 noundef %w, i32 noundef %h2, i32 noundef %w2) local_unnamed_addr #0 {
entry:
%mul = mul nsw i32 %h, %h
%mul1 = mul nsw i32 %w, %w
%add = add nuw nsw i32 %mul1, %mul
%mul2 = mul nsw i32 %h2, %h2
%mul3 = mul nsw i32 %w2, %w2
%add4 = add nuw nsw i32 %mul3, %mul2
%cmp = icmp ugt i32 %add, %add4
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%cmp5 = icmp ult i32 %add, %add4
br i1 %cmp5, label %cleanup, label %if.else7
if.else7: ; preds = %if.else
%cmp8 = icmp sgt i32 %h, %h2
br i1 %cmp8, label %cleanup, label %if.else10
if.else10: ; preds = %if.else7
%cmp11 = icmp slt i32 %h, %h2
%. = sext i1 %cmp11 to i32
br label %cleanup
cleanup: ; preds = %if.else10, %if.else7, %if.else, %entry
%retval.0 = phi i32 [ 1, %entry ], [ -1, %if.else ], [ 1, %if.else7 ], [ %., %if.else10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp62 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp163 = icmp eq i32 %1, 0
%or.cond64 = select i1 %cmp62, i1 %cmp163, i1 false
br i1 %or.cond64, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end15
%2 = phi i32 [ %8, %for.end15 ], [ %1, %entry ]
%3 = phi i32 [ %7, %for.end15 ], [ %0, %entry ]
%mul.i = mul nsw i32 %3, %3
%mul1.i = mul nsw i32 %2, %2
%add.i = add nuw nsw i32 %mul1.i, %mul.i
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.inc.us, %for.body
%h2.1.lcssa = phi i32 [ %h2.058, %for.body ], [ %h2.2.us, %for.inc.us ], [ %h2.2, %for.inc ]
%w2.1.lcssa = phi i32 [ %w2.059, %for.body ], [ %w2.2.us, %for.inc.us ], [ %w2.2, %for.inc ]
%exitcond70.not = icmp eq i32 %add, 151
br i1 %exitcond70.not, label %for.end15, label %for.body, !llvm.loop !9
for.body: ; preds = %for.cond.preheader, %for.cond.loopexit
%i.060 = phi i32 [ 1, %for.cond.preheader ], [ %add, %for.cond.loopexit ]
%w2.059 = phi i32 [ 150, %for.cond.preheader ], [ %w2.1.lcssa, %for.cond.loopexit ]
%h2.058 = phi i32 [ 150, %for.cond.preheader ], [ %h2.1.lcssa, %for.cond.loopexit ]
%add = add nuw nsw i32 %i.060, 1
%cmp452 = icmp ult i32 %i.060, 150
br i1 %cmp452, label %for.body5.lr.ph, label %for.cond.loopexit
for.body5.lr.ph: ; preds = %for.body
%mul2.i = mul nuw nsw i32 %i.060, %i.060
%cmp11.i = icmp slt i32 %3, %i.060
%cmp11.i.fr = freeze i1 %cmp11.i
br i1 %cmp11.i.fr, label %for.body5.us, label %for.body5
for.body5.us: ; preds = %for.body5.lr.ph, %for.inc.us
%j.055.us = phi i32 [ %inc.us, %for.inc.us ], [ %add, %for.body5.lr.ph ]
%w2.154.us = phi i32 [ %w2.2.us, %for.inc.us ], [ %w2.059, %for.body5.lr.ph ]
%h2.153.us = phi i32 [ %h2.2.us, %for.inc.us ], [ %h2.058, %for.body5.lr.ph ]
%mul3.i.us = mul nuw nsw i32 %j.055.us, %j.055.us
%add4.i.us = add nuw nsw i32 %mul3.i.us, %mul2.i
%cmp.i.us = icmp ugt i32 %add.i, %add4.i.us
br i1 %cmp.i.us, label %for.inc.us, label %if.else.i.us
if.else.i.us: ; preds = %for.body5.us
%mul.i29.us = mul nsw i32 %h2.153.us, %h2.153.us
%mul1.i30.us = mul nsw i32 %w2.154.us, %w2.154.us
%add.i31.us = add nuw nsw i32 %mul1.i30.us, %mul.i29.us
%cmp.i35.us = icmp ugt i32 %add.i31.us, %add4.i.us
br i1 %cmp.i35.us, label %sq_cmp.exit44.us.thread.thread, label %sq_cmp.exit44.us
sq_cmp.exit44.us: ; preds = %if.else.i.us
%cmp5.i37.us = icmp uge i32 %add.i31.us, %add4.i.us
%cmp8.i39.us = icmp sgt i32 %h2.153.us, %i.060
%spec.select65 = select i1 %cmp5.i37.us, i1 %cmp8.i39.us, i1 false
%cond.fr71 = freeze i1 %spec.select65
%i.060.h2.153.us = select i1 %cond.fr71, i32 %i.060, i32 %h2.153.us
br i1 %cond.fr71, label %sq_cmp.exit44.us.thread.thread, label %for.inc.us
sq_cmp.exit44.us.thread.thread: ; preds = %sq_cmp.exit44.us, %if.else.i.us
%4 = phi i32 [ %i.060, %if.else.i.us ], [ %i.060.h2.153.us, %sq_cmp.exit44.us ]
br label %for.inc.us
for.inc.us: ; preds = %sq_cmp.exit44.us, %sq_cmp.exit44.us.thread.thread, %for.body5.us
%h2.2.us = phi i32 [ %h2.153.us, %for.body5.us ], [ %4, %sq_cmp.exit44.us.thread.thread ], [ %i.060.h2.153.us, %sq_cmp.exit44.us ]
%w2.2.us = phi i32 [ %w2.154.us, %for.body5.us ], [ %j.055.us, %sq_cmp.exit44.us.thread.thread ], [ %w2.154.us, %sq_cmp.exit44.us ]
%inc.us = add nuw nsw i32 %j.055.us, 1
%exitcond69.not = icmp eq i32 %inc.us, 151
br i1 %exitcond69.not, label %for.cond.loopexit, label %for.body5.us, !llvm.loop !11
for.body5: ; preds = %for.body5.lr.ph, %for.inc
%j.055 = phi i32 [ %inc, %for.inc ], [ %add, %for.body5.lr.ph ]
%w2.154 = phi i32 [ %w2.2, %for.inc ], [ %w2.059, %for.body5.lr.ph ]
%h2.153 = phi i32 [ %h2.2, %for.inc ], [ %h2.058, %for.body5.lr.ph ]
%mul3.i = mul nuw nsw i32 %j.055, %j.055
%add4.i = add nuw nsw i32 %mul3.i, %mul2.i
%cmp5.i = icmp ult i32 %add.i, %add4.i
br i1 %cmp5.i, label %land.lhs.true8, label %for.inc
land.lhs.true8: ; preds = %for.body5
%mul.i29 = mul nsw i32 %h2.153, %h2.153
%mul1.i30 = mul nsw i32 %w2.154, %w2.154
%add.i31 = add nuw nsw i32 %mul1.i30, %mul.i29
%cmp.i35 = icmp ugt i32 %add.i31, %add4.i
br i1 %cmp.i35, label %sq_cmp.exit44.thread, label %sq_cmp.exit44
sq_cmp.exit44: ; preds = %land.lhs.true8
%cmp5.i37 = icmp uge i32 %add.i31, %add4.i
%cmp8.i39 = icmp sgt i32 %h2.153, %i.060
%spec.select66 = select i1 %cmp5.i37, i1 %cmp8.i39, i1 false
%cond.fr77 = freeze i1 %spec.select66
br i1 %cond.fr77, label %sq_cmp.exit44.thread, label %5
sq_cmp.exit44.thread: ; preds = %land.lhs.true8, %sq_cmp.exit44
%retval.0.i4381 = phi i1 [ %cond.fr77, %sq_cmp.exit44 ], [ true, %land.lhs.true8 ]
br label %5
5: ; preds = %sq_cmp.exit44, %sq_cmp.exit44.thread
%retval.0.i4380 = phi i1 [ %retval.0.i4381, %sq_cmp.exit44.thread ], [ %cond.fr77, %sq_cmp.exit44 ]
%6 = phi i32 [ %i.060, %sq_cmp.exit44.thread ], [ %h2.153, %sq_cmp.exit44 ]
%spec.select28 = select i1 %retval.0.i4380, i32 %j.055, i32 %w2.154
br label %for.inc
for.inc: ; preds = %for.body5, %5
%h2.2 = phi i32 [ %6, %5 ], [ %h2.153, %for.body5 ]
%w2.2 = phi i32 [ %spec.select28, %5 ], [ %w2.154, %for.body5 ]
%inc = add nuw nsw i32 %j.055, 1
%exitcond.not = icmp eq i32 %inc, 151
br i1 %exitcond.not, label %for.cond.loopexit, label %for.body5, !llvm.loop !11
for.end15: ; preds = %for.cond.loopexit
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %h2.1.lcssa, i32 noundef %w2.1.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%7 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %7, 0
%8 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %8, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end15, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
struct rect{
int h;
int w;
};
int rect_cmp(struct rect x, struct rect y)
{
if(x.h * x.h + x.w * x.w < y.h * y.h + y.w * y.w){
return -1;
} else if(x.h * x.h + x.w * x.w == y.h * y.h + y.w * y.w){
if(x.h < y.h) return -1;
else if(x.h == y.h) return 0;
else return 1;
} else return 1;
}
int main(void)
{
int H,W;
struct rect x;
struct rect y;
for(;;){
struct rect std;
scanf("%d %d", &std.h, &std.w);
if(!(std.h|std.w)) break;
struct rect ans;
ans.h=150;
ans.w=150;
struct rect cmp;
for(cmp.h = 1; cmp.h < 150; cmp.h++){
for(cmp.w = cmp.h+1; cmp.w < 150; cmp.w++){
if(rect_cmp(std, cmp) < 0 && rect_cmp(cmp, ans) < 0){
ans = cmp;
}
}
}
printf("%d %d\n", ans.h, ans.w);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289048/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289048/source.c"
target datalayout = "e-m:e-p270: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.rect = type { i32, i32 }
@.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 %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @rect_cmp(i64 %x.coerce, i64 %y.coerce) local_unnamed_addr #0 {
entry:
%x.sroa.0.0.extract.trunc = trunc i64 %x.coerce to i32
%x.sroa.7.0.extract.shift = lshr i64 %x.coerce, 32
%x.sroa.7.0.extract.trunc = trunc i64 %x.sroa.7.0.extract.shift to i32
%y.sroa.0.0.extract.trunc = trunc i64 %y.coerce to i32
%y.sroa.7.0.extract.shift = lshr i64 %y.coerce, 32
%y.sroa.7.0.extract.trunc = trunc i64 %y.sroa.7.0.extract.shift to i32
%mul = mul nsw i32 %x.sroa.0.0.extract.trunc, %x.sroa.0.0.extract.trunc
%mul3 = mul nsw i32 %x.sroa.7.0.extract.trunc, %x.sroa.7.0.extract.trunc
%add = add nuw nsw i32 %mul3, %mul
%mul6 = mul nsw i32 %y.sroa.0.0.extract.trunc, %y.sroa.0.0.extract.trunc
%mul9 = mul nsw i32 %y.sroa.7.0.extract.trunc, %y.sroa.7.0.extract.trunc
%add10 = add nuw nsw i32 %mul9, %mul6
%cmp = icmp ult i32 %add, %add10
br i1 %cmp, label %return, label %if.else
if.else: ; preds = %entry
%cmp25 = icmp eq i32 %add, %add10
br i1 %cmp25, label %if.then26, label %return
if.then26: ; preds = %if.else
%cmp29 = icmp slt i32 %x.sroa.0.0.extract.trunc, %y.sroa.0.0.extract.trunc
br i1 %cmp29, label %return, label %if.else31
if.else31: ; preds = %if.then26
%cmp34 = icmp ne i32 %x.sroa.0.0.extract.trunc, %y.sroa.0.0.extract.trunc
%. = zext i1 %cmp34 to i32
br label %return
return: ; preds = %if.else, %if.else31, %if.then26, %entry
%retval.0 = phi i32 [ -1, %entry ], [ -1, %if.then26 ], [ %., %if.else31 ], [ 1, %if.else ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%std = alloca %struct.rect, align 8
%w = getelementptr inbounds %struct.rect, ptr %std, i64 0, i32 1
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %std) #4
%call81 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %std, ptr noundef nonnull %w)
%0 = load i32, ptr %std, align 8, !tbaa !5
%1 = load i32, ptr %w, align 4, !tbaa !10
%or82 = or i32 %1, %0
%tobool.not83 = icmp eq i32 %or82, 0
br i1 %tobool.not83, label %for.end29, label %for.cond6.preheader
for.cond6.preheader: ; preds = %entry, %cleanup
%2 = load i64, ptr %std, align 8
%x.sroa.0.0.extract.trunc.i = trunc i64 %2 to i32
%x.sroa.7.0.extract.shift.i = lshr i64 %2, 32
%x.sroa.7.0.extract.trunc.i = trunc i64 %x.sroa.7.0.extract.shift.i to i32
%mul.i = mul nsw i32 %x.sroa.0.0.extract.trunc.i, %x.sroa.0.0.extract.trunc.i
%mul3.i = mul nsw i32 %x.sroa.7.0.extract.trunc.i, %x.sroa.7.0.extract.trunc.i
%add.i = add nuw nsw i32 %mul3.i, %mul.i
br label %for.body
for.cond6.loopexit: ; preds = %for.inc.us, %for.inc, %for.body
%ans.sroa.6.1.lcssa = phi i32 [ %ans.sroa.6.078, %for.body ], [ %ans.sroa.6.2, %for.inc ], [ %ans.sroa.6.2.us, %for.inc.us ]
%ans.sroa.0.1.lcssa = phi i32 [ %ans.sroa.0.079, %for.body ], [ %ans.sroa.0.2, %for.inc ], [ %ans.sroa.0.2.us, %for.inc.us ]
%exitcond88.not = icmp eq i32 %add, 150
br i1 %exitcond88.not, label %cleanup, label %for.body, !llvm.loop !11
for.body: ; preds = %for.cond6.preheader, %for.cond6.loopexit
%cmp.sroa.0.080 = phi i32 [ 1, %for.cond6.preheader ], [ %add, %for.cond6.loopexit ]
%ans.sroa.0.079 = phi i32 [ 150, %for.cond6.preheader ], [ %ans.sroa.0.1.lcssa, %for.cond6.loopexit ]
%ans.sroa.6.078 = phi i32 [ 150, %for.cond6.preheader ], [ %ans.sroa.6.1.lcssa, %for.cond6.loopexit ]
%add = add nuw nsw i32 %cmp.sroa.0.080, 1
%cmp1372 = icmp ult i32 %cmp.sroa.0.080, 149
br i1 %cmp1372, label %for.body14.lr.ph, label %for.cond6.loopexit
for.body14.lr.ph: ; preds = %for.body
%mul6.i = mul nuw nsw i32 %cmp.sroa.0.080, %cmp.sroa.0.080
%cmp29.i = icmp sgt i32 %cmp.sroa.0.080, %x.sroa.0.0.extract.trunc.i
%cmp29.i.fr = freeze i1 %cmp29.i
br i1 %cmp29.i.fr, label %for.body14, label %for.body14.us
for.body14.us: ; preds = %for.body14.lr.ph, %for.inc.us
%cmp.sroa.10.075.us = phi i32 [ %inc.us, %for.inc.us ], [ %add, %for.body14.lr.ph ]
%ans.sroa.0.174.us = phi i32 [ %ans.sroa.0.2.us, %for.inc.us ], [ %ans.sroa.0.079, %for.body14.lr.ph ]
%ans.sroa.6.173.us = phi i32 [ %ans.sroa.6.2.us, %for.inc.us ], [ %ans.sroa.6.078, %for.body14.lr.ph ]
%mul9.i.us = mul nuw nsw i32 %cmp.sroa.10.075.us, %cmp.sroa.10.075.us
%add10.i.us = add nuw nsw i32 %mul9.i.us, %mul6.i
%cmp.i.us = icmp ult i32 %add.i, %add10.i.us
br i1 %cmp.i.us, label %land.lhs.true.us, label %for.inc.us
land.lhs.true.us: ; preds = %for.body14.us
%mul6.i54.us = mul nsw i32 %ans.sroa.0.174.us, %ans.sroa.0.174.us
%mul9.i55.us = mul nsw i32 %ans.sroa.6.173.us, %ans.sroa.6.173.us
%add10.i56.us = add nuw nsw i32 %mul6.i54.us, %mul9.i55.us
%cmp.i57.us = icmp ult i32 %add10.i.us, %add10.i56.us
br i1 %cmp.i57.us, label %rect_cmp.exit66.us.thread.thread, label %rect_cmp.exit66.us
rect_cmp.exit66.us: ; preds = %land.lhs.true.us
%cmp25.i59.us = icmp eq i32 %add10.i.us, %add10.i56.us
%cmp29.i62.us = icmp slt i32 %cmp.sroa.0.080, %ans.sroa.0.174.us
%spec.select84 = select i1 %cmp25.i59.us, i1 %cmp29.i62.us, i1 false
%cond.fr89 = freeze i1 %spec.select84
%cmp.sroa.10.075.us.ans.sroa.6.173.us = select i1 %cond.fr89, i32 %cmp.sroa.10.075.us, i32 %ans.sroa.6.173.us
br i1 %cond.fr89, label %rect_cmp.exit66.us.thread.thread, label %for.inc.us
rect_cmp.exit66.us.thread.thread: ; preds = %rect_cmp.exit66.us, %land.lhs.true.us
%3 = phi i32 [ %cmp.sroa.10.075.us, %land.lhs.true.us ], [ %cmp.sroa.10.075.us.ans.sroa.6.173.us, %rect_cmp.exit66.us ]
br label %for.inc.us
for.inc.us: ; preds = %rect_cmp.exit66.us, %rect_cmp.exit66.us.thread.thread, %for.body14.us
%ans.sroa.6.2.us = phi i32 [ %ans.sroa.6.173.us, %for.body14.us ], [ %3, %rect_cmp.exit66.us.thread.thread ], [ %cmp.sroa.10.075.us.ans.sroa.6.173.us, %rect_cmp.exit66.us ]
%ans.sroa.0.2.us = phi i32 [ %ans.sroa.0.174.us, %for.body14.us ], [ %cmp.sroa.0.080, %rect_cmp.exit66.us.thread.thread ], [ %ans.sroa.0.174.us, %rect_cmp.exit66.us ]
%inc.us = add nuw nsw i32 %cmp.sroa.10.075.us, 1
%exitcond.not = icmp eq i32 %inc.us, 150
br i1 %exitcond.not, label %for.cond6.loopexit, label %for.body14.us, !llvm.loop !13
for.body14: ; preds = %for.body14.lr.ph, %for.inc
%cmp.sroa.10.075 = phi i32 [ %inc, %for.inc ], [ %add, %for.body14.lr.ph ]
%ans.sroa.0.174 = phi i32 [ %ans.sroa.0.2, %for.inc ], [ %ans.sroa.0.079, %for.body14.lr.ph ]
%ans.sroa.6.173 = phi i32 [ %ans.sroa.6.2, %for.inc ], [ %ans.sroa.6.078, %for.body14.lr.ph ]
%mul9.i = mul nuw nsw i32 %cmp.sroa.10.075, %cmp.sroa.10.075
%add10.i = add nuw nsw i32 %mul9.i, %mul6.i
%or.cond.not = icmp ugt i32 %add.i, %add10.i
br i1 %or.cond.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body14
%mul6.i54 = mul nsw i32 %ans.sroa.0.174, %ans.sroa.0.174
%mul9.i55 = mul nsw i32 %ans.sroa.6.173, %ans.sroa.6.173
%add10.i56 = add nuw nsw i32 %mul6.i54, %mul9.i55
%cmp.i57 = icmp ult i32 %add10.i, %add10.i56
br i1 %cmp.i57, label %rect_cmp.exit66.thread, label %rect_cmp.exit66
rect_cmp.exit66: ; preds = %land.lhs.true
%cmp25.i59 = icmp eq i32 %add10.i, %add10.i56
%cmp29.i62 = icmp slt i32 %cmp.sroa.0.080, %ans.sroa.0.174
%spec.select85 = select i1 %cmp25.i59, i1 %cmp29.i62, i1 false
%cond.fr95 = freeze i1 %spec.select85
br i1 %cond.fr95, label %rect_cmp.exit66.thread, label %4
rect_cmp.exit66.thread: ; preds = %land.lhs.true, %rect_cmp.exit66
%retval.0.i6099 = phi i1 [ %cond.fr95, %rect_cmp.exit66 ], [ true, %land.lhs.true ]
br label %4
4: ; preds = %rect_cmp.exit66, %rect_cmp.exit66.thread
%retval.0.i6098 = phi i1 [ %retval.0.i6099, %rect_cmp.exit66.thread ], [ %cond.fr95, %rect_cmp.exit66 ]
%5 = phi i32 [ %cmp.sroa.10.075, %rect_cmp.exit66.thread ], [ %ans.sroa.6.173, %rect_cmp.exit66 ]
%spec.select48 = select i1 %retval.0.i6098, i32 %cmp.sroa.0.080, i32 %ans.sroa.0.174
br label %for.inc
for.inc: ; preds = %for.body14, %4
%ans.sroa.6.2 = phi i32 [ %5, %4 ], [ %ans.sroa.6.173, %for.body14 ]
%ans.sroa.0.2 = phi i32 [ %spec.select48, %4 ], [ %ans.sroa.0.174, %for.body14 ]
%inc = add nuw nsw i32 %cmp.sroa.10.075, 1
%exitcond87.not = icmp eq i32 %inc, 150
br i1 %exitcond87.not, label %for.cond6.loopexit, label %for.body14, !llvm.loop !13
cleanup: ; preds = %for.cond6.loopexit
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.sroa.0.1.lcssa, i32 noundef %ans.sroa.6.1.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %std) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %std) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %std, ptr noundef nonnull %w)
%6 = load i32, ptr %std, align 8, !tbaa !5
%7 = load i32, ptr %w, align 4, !tbaa !10
%or = or i32 %7, %6
%tobool.not = icmp eq i32 %or, 0
br i1 %tobool.not, label %for.end29, label %for.cond6.preheader
for.end29: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %std) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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, !7, i64 0}
!6 = !{!"rect", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define M 10000
#define E 500000
typedef struct edge {
int from, to, cost;
} Ed;
Ed e[E];
int d[M];
void sp(int,int);
int main(int argc,char* argv[])
{
int vn, en, an;
int i, j, vi;
scanf("%d", &vn);
en=0;
for(i=0; i<vn; i++) {
scanf("%d", &vi);
scanf("%d", &an);
for(j=1; j<=an; j++) {
e[en].from=vi;
scanf("%d %d", &e[en].to, &e[en].cost);
en++;
}
}
sp(vn, en);
for(i=0; i<vn; i++) {
printf("%d %d\n", i, d[i]);
}
return 0;
}
void sp(int vn, int en)
{
int i, new=1;
for(i=1; i<vn; i++) d[i]=INT_MAX;
while(new) {
new=0;
for(i=0; i<en; i++) {
if(d[e[i].from] !=INT_MAX && d[e[i].from]+e[i].cost < d[e[i].to]) {
d[e[i].to] = d[e[i].from]+e[i].cost;
new++;
}
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289099/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289099/source.c"
target datalayout = "e-m:e-p270: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.edge = type { i32, i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@e = dso_local global [500000 x %struct.edge] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@d = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%vn = alloca i32, align 4
%an = alloca i32, align 4
%vi = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %vn) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %an) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %vi) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vn)
%0 = load i32, ptr %vn, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body, label %for.end23
for.body: ; preds = %entry, %for.inc12
%i.039 = phi i32 [ %inc13, %for.inc12 ], [ 0, %entry ]
%en.038 = phi i32 [ %en.1.lcssa, %for.inc12 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vi)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %an)
%1 = load i32, ptr %an, align 4, !tbaa !5
%cmp4.not34 = icmp slt i32 %1, 1
br i1 %cmp4.not34, label %for.inc12, label %for.body5.preheader
for.body5.preheader: ; preds = %for.body
%2 = sext i32 %en.038 to i64
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv = phi i64 [ %2, %for.body5.preheader ], [ %indvars.iv.next, %for.body5 ]
%j.036 = phi i32 [ 1, %for.body5.preheader ], [ %inc11, %for.body5 ]
%3 = load i32, ptr %vi, align 4, !tbaa !5
%arrayidx = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv
store i32 %3, ptr %arrayidx, align 4, !tbaa !9
%to = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv, i32 1
%cost = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv, i32 2
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %to, ptr noundef nonnull %cost)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%inc11 = add nuw nsw i32 %j.036, 1
%4 = load i32, ptr %an, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %j.036, %4
br i1 %cmp4.not.not, label %for.body5, label %for.inc12.loopexit, !llvm.loop !11
for.inc12.loopexit: ; preds = %for.body5
%5 = trunc i64 %indvars.iv.next to i32
br label %for.inc12
for.inc12: ; preds = %for.inc12.loopexit, %for.body
%en.1.lcssa = phi i32 [ %en.038, %for.body ], [ %5, %for.inc12.loopexit ]
%inc13 = add nuw nsw i32 %i.039, 1
%6 = load i32, ptr %vn, align 4, !tbaa !5
%cmp = icmp slt i32 %inc13, %6
br i1 %cmp, label %for.body, label %for.end14, !llvm.loop !13
for.end14: ; preds = %for.inc12
%cmp51.i = icmp sgt i32 %6, 1
br i1 %cmp51.i, label %for.body.preheader.i, label %while.cond.preheader.i
for.body.preheader.i: ; preds = %for.end14
%wide.trip.count.i = zext i32 %6 to i64
%7 = add nsw i64 %wide.trip.count.i, -1
%min.iters.check = icmp ult i32 %6, 9
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %7, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = or i64 %index, 1
%8 = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %offset.idx
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %8, align 4, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %9, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %7, %n.vec
br i1 %cmp.n, label %while.cond.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 1, %for.body.preheader.i ], [ %ind.end, %middle.block ]
br label %for.body.i
while.cond.preheader.i: ; preds = %for.body.i, %middle.block, %for.end14
%cmp253.i = icmp sgt i32 %en.1.lcssa, 0
br i1 %cmp253.i, label %for.cond1.preheader.us.preheader.i, label %sp.exit
for.cond1.preheader.us.preheader.i: ; preds = %while.cond.preheader.i
%wide.trip.count60.i = zext i32 %en.1.lcssa to i64
br label %for.body3.us.i
for.body3.us.i: ; preds = %for.body3.us.i.backedge, %for.cond1.preheader.us.preheader.i
%indvars.iv57.i = phi i64 [ 0, %for.cond1.preheader.us.preheader.i ], [ %indvars.iv57.i.be, %for.body3.us.i.backedge ]
%new.155.us.i = phi i32 [ 0, %for.cond1.preheader.us.preheader.i ], [ %new.155.us.i.be, %for.body3.us.i.backedge ]
%arrayidx5.us.i = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv57.i
%11 = load i32, ptr %arrayidx5.us.i, align 4, !tbaa !9
%idxprom6.us.i = sext i32 %11 to i64
%arrayidx7.us.i = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %idxprom6.us.i
%12 = load i32, ptr %arrayidx7.us.i, align 4, !tbaa !5
%cmp8.not.us.i = icmp eq i32 %12, 2147483647
br i1 %cmp8.not.us.i, label %for.inc36.us.i, label %land.lhs.true.us.i
land.lhs.true.us.i: ; preds = %for.body3.us.i
%cost.us.i = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv57.i, i32 2
%13 = load i32, ptr %cost.us.i, align 4, !tbaa !17
%add.us.i = add nsw i32 %13, %12
%to.us.i = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv57.i, i32 1
%14 = load i32, ptr %to.us.i, align 4, !tbaa !18
%idxprom18.us.i = sext i32 %14 to i64
%arrayidx19.us.i = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %idxprom18.us.i
%15 = load i32, ptr %arrayidx19.us.i, align 4, !tbaa !5
%cmp20.us.i = icmp slt i32 %add.us.i, %15
br i1 %cmp20.us.i, label %if.then.us.i, label %for.inc36.us.i
if.then.us.i: ; preds = %land.lhs.true.us.i
store i32 %add.us.i, ptr %arrayidx19.us.i, align 4, !tbaa !5
%inc35.us.i = add nsw i32 %new.155.us.i, 1
br label %for.inc36.us.i
for.inc36.us.i: ; preds = %if.then.us.i, %land.lhs.true.us.i, %for.body3.us.i
%new.2.us.i = phi i32 [ %inc35.us.i, %if.then.us.i ], [ %new.155.us.i, %land.lhs.true.us.i ], [ %new.155.us.i, %for.body3.us.i ]
%indvars.iv.next58.i = add nuw nsw i64 %indvars.iv57.i, 1
%exitcond61.not.i = icmp eq i64 %indvars.iv.next58.i, %wide.trip.count60.i
br i1 %exitcond61.not.i, label %for.cond1.while.cond.loopexit_crit_edge.us.i, label %for.body3.us.i.backedge
for.body3.us.i.backedge: ; preds = %for.inc36.us.i, %for.cond1.while.cond.loopexit_crit_edge.us.i
%indvars.iv57.i.be = phi i64 [ %indvars.iv.next58.i, %for.inc36.us.i ], [ 0, %for.cond1.while.cond.loopexit_crit_edge.us.i ]
%new.155.us.i.be = phi i32 [ %new.2.us.i, %for.inc36.us.i ], [ 0, %for.cond1.while.cond.loopexit_crit_edge.us.i ]
br label %for.body3.us.i, !llvm.loop !19
for.cond1.while.cond.loopexit_crit_edge.us.i: ; preds = %for.inc36.us.i
%tobool.not.us.i = icmp eq i32 %new.2.us.i, 0
br i1 %tobool.not.us.i, label %sp.exit, label %for.body3.us.i.backedge
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %indvars.iv.i
store i32 2147483647, ptr %arrayidx.i, align 4, !tbaa !5
%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 %while.cond.preheader.i, label %for.body.i, !llvm.loop !20
sp.exit: ; preds = %for.cond1.while.cond.loopexit_crit_edge.us.i, %while.cond.preheader.i
%cmp1642 = icmp sgt i32 %6, 0
br i1 %cmp1642, label %for.body17, label %for.end23
for.body17: ; preds = %sp.exit, %for.body17
%indvars.iv46 = phi i64 [ %indvars.iv.next47, %for.body17 ], [ 0, %sp.exit ]
%arrayidx19 = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %indvars.iv46
%16 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%17 = trunc i64 %indvars.iv46 to i32
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17, i32 noundef %16)
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%18 = load i32, ptr %vn, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp16 = icmp slt i64 %indvars.iv.next47, %19
br i1 %cmp16, label %for.body17, label %for.end23, !llvm.loop !21
for.end23: ; preds = %for.body17, %entry, %sp.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %vi) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %an) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %vn) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @sp(i32 noundef %vn, i32 noundef %en) local_unnamed_addr #3 {
entry:
%cmp51 = icmp sgt i32 %vn, 1
br i1 %cmp51, label %for.body.preheader, label %while.cond.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %vn to i64
%0 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %vn, 9
br i1 %min.iters.check, label %for.body.preheader62, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %0, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %offset.idx
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %2, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
br i1 %cmp.n, label %while.cond.preheader, label %for.body.preheader62
for.body.preheader62: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
while.cond.preheader: ; preds = %for.body, %middle.block, %entry
%cmp253 = icmp sgt i32 %en, 0
br i1 %cmp253, label %for.cond1.preheader.us.preheader, label %while.end
for.cond1.preheader.us.preheader: ; preds = %while.cond.preheader
%wide.trip.count60 = zext i32 %en to i64
br label %for.body3.us
for.body3.us: ; preds = %for.body3.us.backedge, %for.cond1.preheader.us.preheader
%indvars.iv57 = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv57.be, %for.body3.us.backedge ]
%new.155.us = phi i32 [ 0, %for.cond1.preheader.us.preheader ], [ %new.155.us.be, %for.body3.us.backedge ]
%arrayidx5.us = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv57
%4 = load i32, ptr %arrayidx5.us, align 4, !tbaa !9
%idxprom6.us = sext i32 %4 to i64
%arrayidx7.us = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %idxprom6.us
%5 = load i32, ptr %arrayidx7.us, align 4, !tbaa !5
%cmp8.not.us = icmp eq i32 %5, 2147483647
br i1 %cmp8.not.us, label %for.inc36.us, label %land.lhs.true.us
land.lhs.true.us: ; preds = %for.body3.us
%cost.us = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv57, i32 2
%6 = load i32, ptr %cost.us, align 4, !tbaa !17
%add.us = add nsw i32 %6, %5
%to.us = getelementptr inbounds [500000 x %struct.edge], ptr @e, i64 0, i64 %indvars.iv57, i32 1
%7 = load i32, ptr %to.us, align 4, !tbaa !18
%idxprom18.us = sext i32 %7 to i64
%arrayidx19.us = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %idxprom18.us
%8 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
%cmp20.us = icmp slt i32 %add.us, %8
br i1 %cmp20.us, label %if.then.us, label %for.inc36.us
if.then.us: ; preds = %land.lhs.true.us
store i32 %add.us, ptr %arrayidx19.us, align 4, !tbaa !5
%inc35.us = add nsw i32 %new.155.us, 1
br label %for.inc36.us
for.inc36.us: ; preds = %if.then.us, %land.lhs.true.us, %for.body3.us
%new.2.us = phi i32 [ %inc35.us, %if.then.us ], [ %new.155.us, %land.lhs.true.us ], [ %new.155.us, %for.body3.us ]
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
br i1 %exitcond61.not, label %for.cond1.while.cond.loopexit_crit_edge.us, label %for.body3.us.backedge
for.body3.us.backedge: ; preds = %for.inc36.us, %for.cond1.while.cond.loopexit_crit_edge.us
%indvars.iv57.be = phi i64 [ %indvars.iv.next58, %for.inc36.us ], [ 0, %for.cond1.while.cond.loopexit_crit_edge.us ]
%new.155.us.be = phi i32 [ %new.2.us, %for.inc36.us ], [ 0, %for.cond1.while.cond.loopexit_crit_edge.us ]
br label %for.body3.us, !llvm.loop !19
for.cond1.while.cond.loopexit_crit_edge.us: ; preds = %for.inc36.us
%tobool.not.us = icmp eq i32 %new.2.us, 0
br i1 %tobool.not.us, label %while.end, label %for.body3.us.backedge
for.body: ; preds = %for.body.preheader62, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader62 ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %indvars.iv
store i32 2147483647, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !23
while.end: ; preds = %for.cond1.while.cond.loopexit_crit_edge.us, %while.cond.preheader
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"edge", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = !{!10, !6, i64 8}
!18 = !{!10, !6, i64 4}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !16, !15}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12, !15, !16}
!23 = distinct !{!23, !12, !16, !15}
|
#include <stdio.h>
#include <stdlib.h>
#define N 100000
#define INF 1000000
typedef struct{
int v;
int b;
int c;
}data;
void Single(int);
int n,A[N];
data G[500000];
int main()
{
int i,u,k,j,cnt=0;
scanf("%d",&n);
for(i=0;i<n;i++){
G[i].v = -1;
G[i].b = -1;
G[i].c = -1;
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k;j++){
G[cnt].b = u;
scanf("%d%d",&G[cnt].v,&G[cnt].c);
cnt++; //入れた回数をカウント
}
}
Single(cnt); //入れた回数分処理するために引数にいれる
return 0;
}
void Single(int num)
{
int i,flag=0;
for(i=0; i<n; i++)
A[i] = INF; //初期化
A[0] = 0; //始点
while(flag != 1){
flag = 1;
for(i=0;i<num;i++){
if(G[i].c + A[G[i].b] < A[G[i].v]){
A[G[i].v] = G[i].c + A[G[i].b];
flag = 0;
}
}
}
for(i=0;i<n;i++)
printf("%d %d\n",i,A[i]);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289149/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289149/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.data = type { i32, i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@G = dso_local global [500000 x %struct.data] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@A = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%u = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #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
%cmp41 = icmp sgt i32 %0, 0
br i1 %cmp41, label %for.body7.preheader, label %for.cond33.preheader.i.thread
for.cond33.preheader.i.thread: ; preds = %entry
store i32 0, ptr @A, align 16, !tbaa !5
br label %Single.exit
for.body7.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = mul nuw nsw i64 %1, 12
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @G, i8 -1, i64 %2, i1 false), !tbaa !5
br label %for.body7
for.body7: ; preds = %for.body7.preheader, %for.inc26
%cnt.049 = phi i32 [ %cnt.1.lcssa, %for.inc26 ], [ 0, %for.body7.preheader ]
%i.148 = phi i32 [ %inc27, %for.inc26 ], [ 0, %for.body7.preheader ]
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k)
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp1043 = icmp sgt i32 %3, 0
br i1 %cmp1043, label %for.body11.preheader, label %for.inc26
for.body11.preheader: ; preds = %for.body7
%4 = sext i32 %cnt.049 to i64
br label %for.body11
for.body11: ; preds = %for.body11.preheader, %for.body11
%indvars.iv = phi i64 [ %4, %for.body11.preheader ], [ %indvars.iv.next, %for.body11 ]
%j.044 = phi i32 [ 0, %for.body11.preheader ], [ %inc24, %for.body11 ]
%5 = load i32, ptr %u, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv
%b14 = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv, i32 1
store i32 %5, ptr %b14, align 4, !tbaa !9
%c20 = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv, i32 2
%call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx13, ptr noundef nonnull %c20)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%inc24 = add nuw nsw i32 %j.044, 1
%6 = load i32, ptr %k, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc24, %6
br i1 %cmp10, label %for.body11, label %for.inc26.loopexit, !llvm.loop !11
for.inc26.loopexit: ; preds = %for.body11
%7 = trunc i64 %indvars.iv.next to i32
br label %for.inc26
for.inc26: ; preds = %for.inc26.loopexit, %for.body7
%cnt.1.lcssa = phi i32 [ %cnt.049, %for.body7 ], [ %7, %for.inc26.loopexit ]
%inc27 = add nuw nsw i32 %i.148, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
%cmp6 = icmp slt i32 %inc27, %.pr
br i1 %cmp6, label %for.body7, label %for.end28, !llvm.loop !13
for.end28: ; preds = %for.inc26
%cmp55.i = icmp sgt i32 %.pr, 0
br i1 %cmp55.i, label %for.body.preheader.i, label %for.end.i
for.body.preheader.i: ; preds = %for.end28
%wide.trip.count.i = zext i32 %.pr to i64
%min.iters.check = icmp ult i32 %.pr, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%8 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %index
store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %9, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.end.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
store i32 1000000, ptr %arrayidx.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body.i, !llvm.loop !17
for.end.i: ; preds = %for.body.i, %middle.block, %for.end28
%cmp55.i58 = phi i1 [ false, %for.end28 ], [ %cmp55.i, %middle.block ], [ %cmp55.i, %for.body.i ]
store i32 0, ptr @A, align 16, !tbaa !5
%cmp357.i = icmp sgt i32 %cnt.1.lcssa, 0
br i1 %cmp357.i, label %for.cond2.preheader.us.preheader.i, label %for.cond33.preheader.i
for.cond2.preheader.us.preheader.i: ; preds = %for.end.i
%wide.trip.count66.i = zext i32 %cnt.1.lcssa to i64
br label %for.body4.us.i
for.body4.us.i: ; preds = %for.body4.us.i.backedge, %for.cond2.preheader.us.preheader.i
%indvars.iv63.i = phi i64 [ 0, %for.cond2.preheader.us.preheader.i ], [ %indvars.iv63.i.be, %for.body4.us.i.backedge ]
%flag.159.us.i = phi i32 [ 1, %for.cond2.preheader.us.preheader.i ], [ %flag.159.us.i.be, %for.body4.us.i.backedge ]
%arrayidx6.us.i = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv63.i
%c.us.i = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv63.i, i32 2
%11 = load i32, ptr %c.us.i, align 4, !tbaa !18
%b.us.i = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv63.i, i32 1
%12 = load i32, ptr %b.us.i, align 4, !tbaa !9
%idxprom9.us.i = sext i32 %12 to i64
%arrayidx10.us.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom9.us.i
%13 = load i32, ptr %arrayidx10.us.i, align 4, !tbaa !5
%add.us.i = add nsw i32 %13, %11
%14 = load i32, ptr %arrayidx6.us.i, align 4, !tbaa !19
%idxprom13.us.i = sext i32 %14 to i64
%arrayidx14.us.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.us.i
%15 = load i32, ptr %arrayidx14.us.i, align 4, !tbaa !5
%cmp15.us.i = icmp slt i32 %add.us.i, %15
br i1 %cmp15.us.i, label %if.then.us.i, label %for.inc30.us.i
if.then.us.i: ; preds = %for.body4.us.i
store i32 %add.us.i, ptr %arrayidx14.us.i, align 4, !tbaa !5
br label %for.inc30.us.i
for.inc30.us.i: ; preds = %if.then.us.i, %for.body4.us.i
%flag.2.us.i = phi i32 [ 0, %if.then.us.i ], [ %flag.159.us.i, %for.body4.us.i ]
%indvars.iv.next64.i = add nuw nsw i64 %indvars.iv63.i, 1
%exitcond67.not.i = icmp eq i64 %indvars.iv.next64.i, %wide.trip.count66.i
br i1 %exitcond67.not.i, label %for.cond2.while.cond.loopexit_crit_edge.us.i, label %for.body4.us.i.backedge
for.body4.us.i.backedge: ; preds = %for.inc30.us.i, %for.cond2.while.cond.loopexit_crit_edge.us.i
%indvars.iv63.i.be = phi i64 [ %indvars.iv.next64.i, %for.inc30.us.i ], [ 0, %for.cond2.while.cond.loopexit_crit_edge.us.i ]
%flag.159.us.i.be = phi i32 [ %flag.2.us.i, %for.inc30.us.i ], [ 1, %for.cond2.while.cond.loopexit_crit_edge.us.i ]
br label %for.body4.us.i, !llvm.loop !20
for.cond2.while.cond.loopexit_crit_edge.us.i: ; preds = %for.inc30.us.i
%cmp1.not.us.i = icmp eq i32 %flag.2.us.i, 1
br i1 %cmp1.not.us.i, label %for.cond33.preheader.i, label %for.body4.us.i.backedge
for.cond33.preheader.i: ; preds = %for.cond2.while.cond.loopexit_crit_edge.us.i, %for.end.i
br i1 %cmp55.i58, label %for.body35.i, label %Single.exit
for.body35.i: ; preds = %for.cond33.preheader.i, %for.body35.i
%indvars.iv68.i = phi i64 [ %indvars.iv.next69.i, %for.body35.i ], [ 0, %for.cond33.preheader.i ]
%arrayidx37.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv68.i
%16 = load i32, ptr %arrayidx37.i, align 4, !tbaa !5
%17 = trunc i64 %indvars.iv68.i to i32
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17, i32 noundef %16)
%indvars.iv.next69.i = add nuw nsw i64 %indvars.iv68.i, 1
%18 = load i32, ptr @n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp34.i = icmp slt i64 %indvars.iv.next69.i, %19
br i1 %cmp34.i, label %for.body35.i, label %Single.exit, !llvm.loop !21
Single.exit: ; preds = %for.body35.i, %for.cond33.preheader.i.thread, %for.cond33.preheader.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #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 uwtable
define dso_local void @Single(i32 noundef %num) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader71, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%1 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %index
store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %2, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader71
for.body.preheader71: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader71, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader71 ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
store i32 1000000, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !23
for.end: ; preds = %for.body, %middle.block, %entry
store i32 0, ptr @A, align 16, !tbaa !5
%cmp357 = icmp sgt i32 %num, 0
br i1 %cmp357, label %for.cond2.preheader.us.preheader, label %for.cond33.preheader
for.cond2.preheader.us.preheader: ; preds = %for.end
%wide.trip.count66 = zext i32 %num to i64
br label %for.body4.us
for.body4.us: ; preds = %for.body4.us.backedge, %for.cond2.preheader.us.preheader
%indvars.iv63 = phi i64 [ 0, %for.cond2.preheader.us.preheader ], [ %indvars.iv63.be, %for.body4.us.backedge ]
%flag.159.us = phi i32 [ 1, %for.cond2.preheader.us.preheader ], [ %flag.159.us.be, %for.body4.us.backedge ]
%arrayidx6.us = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv63
%c.us = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv63, i32 2
%4 = load i32, ptr %c.us, align 4, !tbaa !18
%b.us = getelementptr inbounds [500000 x %struct.data], ptr @G, i64 0, i64 %indvars.iv63, i32 1
%5 = load i32, ptr %b.us, align 4, !tbaa !9
%idxprom9.us = sext i32 %5 to i64
%arrayidx10.us = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom9.us
%6 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5
%add.us = add nsw i32 %6, %4
%7 = load i32, ptr %arrayidx6.us, align 4, !tbaa !19
%idxprom13.us = sext i32 %7 to i64
%arrayidx14.us = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.us
%8 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5
%cmp15.us = icmp slt i32 %add.us, %8
br i1 %cmp15.us, label %if.then.us, label %for.inc30.us
if.then.us: ; preds = %for.body4.us
store i32 %add.us, ptr %arrayidx14.us, align 4, !tbaa !5
br label %for.inc30.us
for.inc30.us: ; preds = %if.then.us, %for.body4.us
%flag.2.us = phi i32 [ 0, %if.then.us ], [ %flag.159.us, %for.body4.us ]
%indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
%exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count66
br i1 %exitcond67.not, label %for.cond2.while.cond.loopexit_crit_edge.us, label %for.body4.us.backedge
for.body4.us.backedge: ; preds = %for.inc30.us, %for.cond2.while.cond.loopexit_crit_edge.us
%indvars.iv63.be = phi i64 [ %indvars.iv.next64, %for.inc30.us ], [ 0, %for.cond2.while.cond.loopexit_crit_edge.us ]
%flag.159.us.be = phi i32 [ %flag.2.us, %for.inc30.us ], [ 1, %for.cond2.while.cond.loopexit_crit_edge.us ]
br label %for.body4.us, !llvm.loop !20
for.cond2.while.cond.loopexit_crit_edge.us: ; preds = %for.inc30.us
%cmp1.not.us = icmp eq i32 %flag.2.us, 1
br i1 %cmp1.not.us, label %for.cond33.preheader, label %for.body4.us.backedge
for.cond33.preheader: ; preds = %for.cond2.while.cond.loopexit_crit_edge.us, %for.end
br i1 %cmp55, label %for.body35, label %for.end40
for.body35: ; preds = %for.cond33.preheader, %for.body35
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.body35 ], [ 0, %for.cond33.preheader ]
%arrayidx37 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv68
%9 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%10 = trunc i64 %indvars.iv68 to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10, i32 noundef %9)
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%11 = load i32, ptr @n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp34 = icmp slt i64 %indvars.iv.next69, %12
br i1 %cmp34, label %for.body35, label %for.end40, !llvm.loop !21
for.end40: ; preds = %for.body35, %for.cond33.preheader
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12, !16, !15}
!18 = !{!10, !6, i64 8}
!19 = !{!10, !6, i64 0}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12, !15, !16}
!23 = distinct !{!23, !12, !16, !15}
|
#include <stdio.h>
#include <stdlib.h>
int fun(int a,int b,int c)
{
int x;
int diff=a*c-b*c;
int result=diff/b;
result=result*b;
if ( result == diff ) {
return diff/b;
} else {
x=diff%b;
x=b-x;
diff+=x;
return diff/b;
}
}
int main(int argc, char *argv[])
{
int a,b,c,res;
scanf("%d %d %d",&a,&b,&c);
res=fun(a,b,c);
printf("%d",res);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2892/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2892/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @fun(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%mul22 = sub i32 %a, %b
%sub = mul i32 %mul22, %c
%div = sdiv i32 %sub, %b
%rem = srem i32 %sub, %b
%mul2 = mul nsw i32 %div, %b
%cmp = icmp eq i32 %mul2, %sub
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%sub4 = add i32 %sub, %b
%add = sub i32 %sub4, %rem
%div5 = sdiv i32 %add, %b
br label %cleanup
cleanup: ; preds = %entry, %if.else
%retval.0 = phi i32 [ %div5, %if.else ], [ %div, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%mul22.i = sub i32 %0, %1
%sub.i = mul i32 %mul22.i, %2
%div.i = sdiv i32 %sub.i, %1
%rem.i = srem i32 %sub.i, %1
%mul2.i = mul nsw i32 %div.i, %1
%cmp.i = icmp eq i32 %mul2.i, %sub.i
br i1 %cmp.i, label %fun.exit, label %if.else.i
if.else.i: ; preds = %entry
%sub4.i = add i32 %sub.i, %1
%add.i = sub i32 %sub4.i, %rem.i
%div5.i = sdiv i32 %add.i, %1
br label %fun.exit
fun.exit: ; preds = %entry, %if.else.i
%retval.0.i = phi i32 [ %div5.i, %if.else.i ], [ %div.i, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#define INF 1000000000
typedef struct{
int cost; //ノードのコスト
char done; //確定ノード
}Node;
int N;
Node node[100000];
void dijkstra(int g){
int i, j, k,min;
for(i = 0; i < N; i++){ //初期化
node[i].cost = INF;
node[i].done = 0;
}
node[g].cost = 1; //開始地点のコストは1
while(1){
min = INF;
for(i = 0; i < N; i++){
if(!node[i].done && min > node[i].cost)min = node[i].cost;
}
if(node[0].done==1||min==INF)break;
for(i = 0; i < N; i++){
if(node[i].cost == min&&!node[i].done){
node[i].done=1;
if(node[(i+1)%N].cost > node[i].cost + 1){
node[(i+1)%N].cost = node[i].cost + 1;
}
j=(i*10)%N;
while(node[j].cost>node[i].cost){
node[j].cost = node[i].cost;
j=(j*10)%N;
}
}
}
}
}
int main()
{
scanf("%d",&N);
int i,j;
dijkstra(1);
printf("%d\n",node[0].cost);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289242/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289242/source.c"
target datalayout = "e-m:e-p270: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.Node = type { i32, i8 }
@N = dso_local global i32 0, align 4
@node = dso_local local_unnamed_addr global [100000 x %struct.Node] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable
define dso_local void @dijkstra(i32 noundef %g) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @N, align 4, !tbaa !5
%.fr = freeze i32 %0
%cmp115 = icmp sgt i32 %.fr, 0
br i1 %cmp115, label %for.body.preheader, label %for.end.thread
for.end.thread: ; preds = %entry
%idxprom3174 = sext i32 %g to i64
%arrayidx4175 = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %idxprom3174
store i32 1, ptr %arrayidx4175, align 8, !tbaa !9
br label %while.end89
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %.fr to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %.fr, 1
br i1 %1, label %for.end.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv
store i32 1000000000, ptr %arrayidx, align 16, !tbaa !9
%done = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv, i32 1
store i8 0, ptr %done, align 4, !tbaa !11
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv.next
store i32 1000000000, ptr %arrayidx.1, align 8, !tbaa !9
%done.1 = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv.next, i32 1
store i8 0, ptr %done.1, align 4, !tbaa !11
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.unr-lcssa, label %for.body, !llvm.loop !12
for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.unr-lcssa
%arrayidx.epil = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv.unr
store i32 1000000000, ptr %arrayidx.epil, align 8, !tbaa !9
%done.epil = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv.unr, i32 1
store i8 0, ptr %done.epil, align 4, !tbaa !11
br label %for.end
for.end: ; preds = %for.end.unr-lcssa, %for.body.epil
%idxprom3 = sext i32 %g to i64
%arrayidx4 = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %idxprom3
store i32 1, ptr %arrayidx4, align 8, !tbaa !9
br i1 %cmp115, label %while.cond.us.preheader, label %while.end89
while.cond.us.preheader: ; preds = %for.end
%2 = zext i32 %.fr to i64
br label %for.body8.us
for.end21.us: ; preds = %for.inc19.us
%3 = load i8, ptr getelementptr inbounds ([100000 x %struct.Node], ptr @node, i64 0, i64 0, i32 1), align 4, !tbaa !11
%cmp22.us = icmp eq i8 %3, 1
%cmp24.us = icmp eq i32 %min.1.us, 1000000000
%or.cond.us = select i1 %cmp22.us, i1 true, i1 %cmp24.us
br i1 %or.cond.us, label %while.end89, label %for.body31.us.preheader
for.body31.us.preheader: ; preds = %for.end21.us
%add52.us = add nsw i32 %min.1.us, 1
br label %for.body31.us
for.body31.us: ; preds = %for.body31.us.preheader, %for.inc86.us
%indvars.iv168 = phi i64 [ 0, %for.body31.us.preheader ], [ %indvars.iv.next169, %for.inc86.us ]
%arrayidx33.us = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv168
%4 = load i32, ptr %arrayidx33.us, align 8, !tbaa !9
%cmp35.us = icmp eq i32 %4, %min.1.us
br i1 %cmp35.us, label %land.lhs.true37.us, label %for.inc86.us
land.lhs.true37.us: ; preds = %for.body31.us
%done40.us = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv168, i32 1
%5 = load i8, ptr %done40.us, align 4, !tbaa !11
%tobool41.not.us = icmp eq i8 %5, 0
br i1 %tobool41.not.us, label %if.then42.us, label %for.inc86.us
if.then42.us: ; preds = %land.lhs.true37.us
store i8 1, ptr %done40.us, align 4, !tbaa !11
%6 = add nuw nsw i64 %indvars.iv168, 1
%7 = icmp eq i64 %6, %2
%8 = and i64 %6, 4294967295
%idxprom46.us = select i1 %7, i64 0, i64 %8
%arrayidx47.us = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %idxprom46.us
%9 = load i32, ptr %arrayidx47.us, align 8, !tbaa !9
%cmp53.us = icmp sgt i32 %9, %add52.us
br i1 %cmp53.us, label %if.then55.us, label %if.end65.us
if.then55.us: ; preds = %if.then42.us
store i32 %add52.us, ptr %arrayidx47.us, align 8, !tbaa !9
%.pre = load i32, ptr %arrayidx33.us, align 8, !tbaa !9
br label %if.end65.us
if.end65.us: ; preds = %if.then55.us, %if.then42.us
%10 = phi i32 [ %.pre, %if.then55.us ], [ %min.1.us, %if.then42.us ]
%11 = trunc i64 %indvars.iv168 to i32
%mul.pn121.us = mul nsw i32 %11, 10
%j.0122.us = srem i32 %mul.pn121.us, %.fr
%idxprom68123.us = zext i32 %j.0122.us to i64
%arrayidx69124.us = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %idxprom68123.us
%12 = load i32, ptr %arrayidx69124.us, align 8, !tbaa !9
%cmp74125.us = icmp sgt i32 %12, %10
br i1 %cmp74125.us, label %while.body76.us, label %for.inc86.us
for.inc86.us: ; preds = %while.body76.us, %if.end65.us, %land.lhs.true37.us, %for.body31.us
%indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
%exitcond173.not = icmp eq i64 %indvars.iv.next169, %2
br i1 %exitcond173.not, label %for.body8.us.backedge, label %for.body31.us, !llvm.loop !14
while.body76.us: ; preds = %if.end65.us, %while.body76.us
%13 = phi i32 [ %15, %while.body76.us ], [ %10, %if.end65.us ]
%arrayidx69127.us = phi ptr [ %arrayidx69.us, %while.body76.us ], [ %arrayidx69124.us, %if.end65.us ]
%j.0126.us = phi i32 [ %j.0.us, %while.body76.us ], [ %j.0122.us, %if.end65.us ]
store i32 %13, ptr %arrayidx69127.us, align 8, !tbaa !9
%mul.pn.us = mul nsw i32 %j.0126.us, 10
%j.0.us = srem i32 %mul.pn.us, %.fr
%idxprom68.us = sext i32 %j.0.us to i64
%arrayidx69.us = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %idxprom68.us
%14 = load i32, ptr %arrayidx69.us, align 8, !tbaa !9
%15 = load i32, ptr %arrayidx33.us, align 8, !tbaa !9
%cmp74.us = icmp sgt i32 %14, %15
br i1 %cmp74.us, label %while.body76.us, label %for.inc86.us, !llvm.loop !15
for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader
%indvars.iv163 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv163.be, %for.body8.us.backedge ]
%min.0119.us = phi i32 [ 1000000000, %while.cond.us.preheader ], [ %min.0119.us.be, %for.body8.us.backedge ]
%done11.us = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv163, i32 1
%16 = load i8, ptr %done11.us, align 4, !tbaa !11
%tobool.not.us = icmp eq i8 %16, 0
br i1 %tobool.not.us, label %land.lhs.true.us, label %for.inc19.us
land.lhs.true.us: ; preds = %for.body8.us
%arrayidx10.us = getelementptr inbounds [100000 x %struct.Node], ptr @node, i64 0, i64 %indvars.iv163
%17 = load i32, ptr %arrayidx10.us, align 8, !tbaa !9
%spec.select.us = tail call i32 @llvm.smin.i32(i32 %min.0119.us, i32 %17)
br label %for.inc19.us
for.inc19.us: ; preds = %land.lhs.true.us, %for.body8.us
%min.1.us = phi i32 [ %min.0119.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ]
%indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
%exitcond167.not = icmp eq i64 %indvars.iv.next164, %2
br i1 %exitcond167.not, label %for.end21.us, label %for.body8.us.backedge
for.body8.us.backedge: ; preds = %for.inc86.us, %for.inc19.us
%indvars.iv163.be = phi i64 [ %indvars.iv.next164, %for.inc19.us ], [ 0, %for.inc86.us ]
%min.0119.us.be = phi i32 [ %min.1.us, %for.inc19.us ], [ 1000000000, %for.inc86.us ]
br label %for.body8.us, !llvm.loop !14
while.end89: ; preds = %for.end21.us, %for.end, %for.end.thread
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
tail call void @dijkstra(i32 noundef 1)
%0 = load i32, ptr @node, align 16, !tbaa !9
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !7, i64 4}
!11 = !{!10, !7, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
|
#include <stdio.h>
int main(void){
int n;
int day[7];
int week = 0;
int last;
int i;
scanf("%d", &n);
for(i=0; i<7; i++){
scanf("%d", &day[i]);
week += day[i];
if(day[i] != 0){
last = i;
}
}
n = n % week;
if(n == 0){
printf("%d\n", last+1);
return 0;
}
for(i=0; i<7; i++){
n -= day[i];
if(n <= 0){
printf("%d\n", i+1);
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28930/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28930/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%day = alloca [7 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %day) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %day)
%0 = load i32, ptr %day, align 16, !tbaa !5
%arrayidx.1 = getelementptr inbounds [7 x i32], ptr %day, i64 0, i64 1
%call1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add.1 = add nsw i32 %1, %0
%arrayidx.2 = getelementptr inbounds [7 x i32], ptr %day, i64 0, i64 2
%call1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%2 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%add.2 = add nsw i32 %2, %add.1
%arrayidx.3 = getelementptr inbounds [7 x i32], ptr %day, i64 0, i64 3
%call1.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%add.3 = add nsw i32 %3, %add.2
%arrayidx.4 = getelementptr inbounds [7 x i32], ptr %day, i64 0, i64 4
%call1.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%4 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%add.4 = add nsw i32 %4, %add.3
%arrayidx.5 = getelementptr inbounds [7 x i32], ptr %day, i64 0, i64 5
%call1.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%5 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%add.5 = add nsw i32 %5, %add.4
%arrayidx.6 = getelementptr inbounds [7 x i32], ptr %day, i64 0, i64 6
%call1.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6)
%6 = load i32, ptr %arrayidx.6, align 8, !tbaa !5
%add.6 = add nsw i32 %6, %add.5
%7 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %7, %add.6
store i32 %rem, ptr %n, align 4, !tbaa !5
%cmp7 = icmp eq i32 %rem, 0
br i1 %cmp7, label %if.then8, label %for.cond12.preheader
for.cond12.preheader: ; preds = %entry
%8 = load i32, ptr %day, align 16, !tbaa !5
%sub = sub nsw i32 %rem, %8
%cmp17 = icmp slt i32 %sub, 1
br i1 %cmp17, label %if.then18, label %for.inc22
if.then8: ; preds = %entry
%cmp6.not.6 = icmp eq i32 %6, 0
%cmp6.not.5 = icmp eq i32 %5, 0
%cmp6.not.4 = icmp eq i32 %4, 0
%cmp6.not.3 = icmp eq i32 %3, 0
%cmp6.not.2 = icmp eq i32 %2, 0
%cmp6.not.1.not = icmp eq i32 %1, 0
%9 = select i1 %cmp6.not.1.not, i32 1, i32 2
%10 = select i1 %cmp6.not.2, i32 %9, i32 3
%11 = select i1 %cmp6.not.3, i32 %10, i32 4
%12 = select i1 %cmp6.not.4, i32 %11, i32 5
%13 = select i1 %cmp6.not.5, i32 %12, i32 6
%add9 = select i1 %cmp6.not.6, i32 %13, i32 7
br label %cleanup.sink.split
if.then18: ; preds = %for.inc22.5, %for.inc22.4, %for.inc22.3, %for.inc22.2, %for.inc22.1, %for.inc22, %for.cond12.preheader
%i.145.lcssa.wide = phi i32 [ 1, %for.cond12.preheader ], [ 2, %for.inc22 ], [ 3, %for.inc22.1 ], [ 4, %for.inc22.2 ], [ 5, %for.inc22.3 ], [ 6, %for.inc22.4 ], [ 7, %for.inc22.5 ]
%sub.lcssa = phi i32 [ %sub, %for.cond12.preheader ], [ %sub.1, %for.inc22 ], [ %sub.2, %for.inc22.1 ], [ %sub.3, %for.inc22.2 ], [ %sub.4, %for.inc22.3 ], [ %sub.5, %for.inc22.4 ], [ %sub.6, %for.inc22.5 ]
store i32 %sub.lcssa, ptr %n, align 4, !tbaa !5
br label %cleanup.sink.split
for.inc22: ; preds = %for.cond12.preheader
%14 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%sub.1 = sub nsw i32 %sub, %14
%cmp17.1 = icmp slt i32 %sub.1, 1
br i1 %cmp17.1, label %if.then18, label %for.inc22.1
for.inc22.1: ; preds = %for.inc22
%15 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%sub.2 = sub nsw i32 %sub.1, %15
%cmp17.2 = icmp slt i32 %sub.2, 1
br i1 %cmp17.2, label %if.then18, label %for.inc22.2
for.inc22.2: ; preds = %for.inc22.1
%16 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%sub.3 = sub nsw i32 %sub.2, %16
%cmp17.3 = icmp slt i32 %sub.3, 1
br i1 %cmp17.3, label %if.then18, label %for.inc22.3
for.inc22.3: ; preds = %for.inc22.2
%17 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.4 = sub nsw i32 %sub.3, %17
%cmp17.4 = icmp slt i32 %sub.4, 1
br i1 %cmp17.4, label %if.then18, label %for.inc22.4
for.inc22.4: ; preds = %for.inc22.3
%18 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%sub.5 = sub nsw i32 %sub.4, %18
%cmp17.5 = icmp slt i32 %sub.5, 1
br i1 %cmp17.5, label %if.then18, label %for.inc22.5
for.inc22.5: ; preds = %for.inc22.4
%sub.6 = sub nsw i32 %sub.5, %6
%cmp17.6 = icmp slt i32 %sub.6, 1
br i1 %cmp17.6, label %if.then18, label %cleanup
cleanup.sink.split: ; preds = %if.then8, %if.then18
%i.145.lcssa.wide.sink = phi i32 [ %i.145.lcssa.wide, %if.then18 ], [ %add9, %if.then8 ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.145.lcssa.wide.sink)
br label %cleanup
cleanup: ; preds = %cleanup.sink.split, %for.inc22.5
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %day) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int t[300],y[300],a = 0;t[0] = 1;y[0] =1;int p,q;
while(t[a] != 0 && y[a] != 0){
a++;
scanf("%d %d",&t[a],&y[a]);
}
a= 0;
while(t[a] != 0 && y[a] != 0){
a++;
for(p=1;p<=t[a];p++){
for(q=1;q<=y[a];q++){
printf("#");
}
printf("\n");
}
if(t[a] == 0 && y[a] == 0)
break;
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289343/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289343/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
land.rhs.preheader:
%t = alloca [300 x i32], align 16
%y = alloca [300 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %y) #4
store i32 1, ptr %t, align 16, !tbaa !5
store i32 1, ptr %y, align 16, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%indvars.iv = phi i64 [ 0, %land.rhs.preheader ], [ %indvars.iv.next, %while.body ]
%arrayidx4 = getelementptr inbounds [300 x i32], ptr %y, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5.not = icmp eq i32 %0, 0
br i1 %cmp5.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx7 = getelementptr inbounds [300 x i32], ptr %t, i64 0, i64 %indvars.iv.next
%arrayidx9 = getelementptr inbounds [300 x i32], ptr %y, i64 0, i64 %indvars.iv.next
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7, ptr noundef nonnull %arrayidx9)
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp.not = icmp eq i32 %1, 0
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !9
while.end: ; preds = %land.rhs, %while.body
%.pre = load i32, ptr %t, align 16, !tbaa !5
%cmp13.not66 = icmp eq i32 %.pre, 0
br i1 %cmp13.not66, label %while.end42, label %land.rhs14
land.rhs14: ; preds = %while.end, %if.end
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %if.end ], [ 0, %while.end ]
%arrayidx16 = getelementptr inbounds [300 x i32], ptr %y, i64 0, i64 %indvars.iv71
%2 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17.not = icmp eq i32 %2, 0
br i1 %cmp17.not, label %while.end42, label %while.body19
while.body19: ; preds = %land.rhs14
%indvars.iv.next72 = add nuw i64 %indvars.iv71, 1
%arrayidx22 = getelementptr inbounds [300 x i32], ptr %t, i64 0, i64 %indvars.iv.next72
%3 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.not63 = icmp slt i32 %3, 1
br i1 %cmp23.not63, label %for.end34, label %for.cond24.preheader.lr.ph
for.cond24.preheader.lr.ph: ; preds = %while.body19
%arrayidx26 = getelementptr inbounds [300 x i32], ptr %y, i64 0, i64 %indvars.iv.next72
br label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.cond24.preheader.lr.ph, %for.end
%p.064 = phi i32 [ 1, %for.cond24.preheader.lr.ph ], [ %inc33, %for.end ]
%4 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not61 = icmp slt i32 %4, 1
br i1 %cmp27.not61, label %for.end, label %for.body28
for.body28: ; preds = %for.cond24.preheader, %for.body28
%q.062 = phi i32 [ %inc30, %for.body28 ], [ 1, %for.cond24.preheader ]
%putchar57 = call i32 @putchar(i32 35)
%inc30 = add nuw nsw i32 %q.062, 1
%5 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not.not = icmp slt i32 %q.062, %5
br i1 %cmp27.not.not, label %for.body28, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body28, %for.cond24.preheader
%putchar56 = call i32 @putchar(i32 10)
%inc33 = add nuw nsw i32 %p.064, 1
%6 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.not.not = icmp slt i32 %p.064, %6
br i1 %cmp23.not.not, label %for.cond24.preheader, label %for.end34, !llvm.loop !12
for.end34: ; preds = %for.end, %while.body19
%.lcssa = phi i32 [ %3, %while.body19 ], [ %6, %for.end ]
%cmp37 = icmp eq i32 %.lcssa, 0
br i1 %cmp37, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.end34
%arrayidx39 = getelementptr inbounds [300 x i32], ptr %y, i64 0, i64 %indvars.iv.next72
%7 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%cmp40 = icmp eq i32 %7, 0
br i1 %cmp40, label %while.end42, label %if.end
if.end: ; preds = %land.lhs.true, %for.end34
%putchar = call i32 @putchar(i32 10)
%8 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp13.not = icmp eq i32 %8, 0
br i1 %cmp13.not, label %while.end42, label %land.rhs14, !llvm.loop !13
while.end42: ; preds = %land.rhs14, %land.lhs.true, %if.end, %while.end
call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void)
{
int H,W,a,b;
while(1){
scanf("%d %d",&H,&W);
if(H==0 && W==0)
break;
if(H>=1&&H<=300&&W>=1&&W<=300){
for(a=1;a<=H;a++){
for(b=1;b<=W;b++)
printf("#");
putchar('\n');
}}
putchar('\n');
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289400/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289400/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4
%cmp33 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp134 = icmp eq i32 %1, 0
%or.cond35 = select i1 %cmp33, i1 %cmp134, i1 false
br i1 %or.cond35, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end19
%2 = phi i32 [ %12, %if.end19 ], [ %1, %entry ]
%3 = phi i32 [ %11, %if.end19 ], [ %0, %entry ]
%4 = add i32 %3, -301
%or.cond21 = icmp ult i32 %4, -300
%cmp6 = icmp slt i32 %2, 1
%or.cond22.not = select i1 %or.cond21, i1 true, i1 %cmp6
%cmp8 = icmp sgt i32 %2, 300
%or.cond23 = select i1 %or.cond22.not, i1 true, i1 %cmp8
%cmp10.not30 = icmp slt i32 %3, 1
%or.cond36 = or i1 %or.cond23, %cmp10.not30
br i1 %or.cond36, label %if.end19, label %for.cond11.preheader
for.cond11.preheader: ; preds = %if.end, %for.end
%a.031 = phi i32 [ %inc17, %for.end ], [ 1, %if.end ]
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp12.not28 = icmp slt i32 %5, 1
br i1 %cmp12.not28, label %for.end, label %for.body13
for.body13: ; preds = %for.cond11.preheader, %for.body13
%b.029 = phi i32 [ %inc, %for.body13 ], [ 1, %for.cond11.preheader ]
%6 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i = call noundef i32 @putc(i32 noundef 35, ptr noundef %6)
%inc = add nuw nsw i32 %b.029, 1
%7 = load i32, ptr %W, align 4, !tbaa !5
%cmp12.not.not = icmp slt i32 %b.029, %7
br i1 %cmp12.not.not, label %for.body13, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body13, %for.cond11.preheader
%8 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i26 = call noundef i32 @putc(i32 noundef 10, ptr noundef %8)
%inc17 = add nuw nsw i32 %a.031, 1
%9 = load i32, ptr %H, align 4, !tbaa !5
%cmp10.not.not = icmp slt i32 %a.031, %9
br i1 %cmp10.not.not, label %for.cond11.preheader, label %if.end19, !llvm.loop !13
if.end19: ; preds = %for.end, %if.end
%10 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i27 = call noundef i32 @putc(i32 noundef 10, ptr noundef %10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%11 = load i32, ptr %H, align 4
%cmp = icmp eq i32 %11, 0
%12 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %12, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end19, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
int main(void)
{
int h,w;
int i, j;
while (1){
scanf("%d %d", &h, &w);
if (h == 0 && w == 0){
break;
}
for (i = 0; i < h; i++){
for (j = 0; j < w; j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289451/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int H;
int W;
int i;
int j;
while (1){
scanf("%d %d", &H, &W);
if (H == 0 && W == 0){
break;
}
for (i = 1; i <= H; i++){
for (j = 1; j <= W; j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289495/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289495/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp2.not18 = icmp slt i32 %2, 1
br i1 %cmp2.not18, label %for.end10, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not16 = icmp slt i32 %3, 1
br i1 %cmp4.not16, label %for.end, label %for.body5
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 1, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %j.017, %4
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %i.019, %5
br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int h,w,i,n;
while(scanf("%d %d",&h,&w)!=EOF && (h!=0 && w!=0)){
for(n=0;n<h;n++){
for(i=0;i<w;i++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289602/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289602/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%cmp.not24 = icmp eq i32 %call23, -1
br i1 %cmp.not24, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %for.end13
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp1 = icmp ne i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp3 = icmp ne i32 %1, 0
%2 = select i1 %cmp1, i1 %cmp3, i1 false
br i1 %2, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %land.rhs
%cmp521 = icmp sgt i32 %0, 0
br i1 %cmp521, label %for.cond6.preheader, label %for.end13
for.cond6.preheader: ; preds = %for.cond.preheader, %for.end
%n.022 = phi i32 [ %inc12, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp719 = icmp sgt i32 %3, 0
br i1 %cmp719, label %for.body8, label %for.end
for.body8: ; preds = %for.cond6.preheader, %for.body8
%i.020 = phi i32 [ %inc, %for.body8 ], [ 0, %for.cond6.preheader ]
%putchar18 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %i.020, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp7 = icmp slt i32 %inc, %4
br i1 %cmp7, label %for.body8, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body8, %for.cond6.preheader
%putchar17 = call i32 @putchar(i32 10)
%inc12 = add nuw nsw i32 %n.022, 1
%5 = load i32, ptr %h, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc12, %5
br i1 %cmp5, label %for.cond6.preheader, label %for.end13, !llvm.loop !11
for.end13: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !12
while.end: ; preds = %land.rhs, %for.end13, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void)
{
int i,o,k,l;
while(1)
{
scanf("%d %d",&i,&k);
if(i == 0 && k == 0)
{
break;
}
for(o = 0;o < i;o++)
{
for(l = 0;l < k;l++)
{
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289653/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289653/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %k)
%0 = load i32, ptr %i, align 4, !tbaa !5
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %k, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%o.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%l.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %l.017, 1
%4 = load i32, ptr %k, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %o.019, 1
%5 = load i32, ptr %i, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %k)
%6 = load i32, ptr %i, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %k, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void)
{
char a;
scanf("%c", &a);
if(a>=97 && a<=122) printf("a\n");
else printf("A\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289697/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289697/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"A\00", align 1
@str.3 = 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:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1
%1 = add i8 %0, -97
%or.cond = icmp ult i8 %1, 26
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main()
{
char a;
scanf("%c",&a);
if(a>=65&&a<=90)
{
printf("A\n");
}
else
{
printf("a\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289747/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289747/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"a\00", align 1
@str.3 = 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:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1
%1 = add i8 %0, -65
%or.cond = icmp ult i8 %1, 26
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(){
char a;
scanf("%c", &a);
if (a >= 'A' && a <= 'Z'){
printf("A");
}else{
printf("a");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289790/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289790/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1
%1 = add i8 %0, -65
%or.cond = icmp ult i8 %1, 26
%. = select i1 %or.cond, i32 65, i32 97
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main() {
char a[2];
scanf("%s", a);
if(a[0] >= 65 && a[0] <= 90)
printf("A");
else
printf("a");
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289840/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289840/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [2 x i8], align 1
call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1
%1 = add i8 %0, -65
%or.cond = icmp ult i8 %1, 26
%. = select i1 %or.cond, i32 65, i32 97
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(void){
char c;
scanf("%s",&c);
if(c-'Z'>0){
printf("a\n");
}else{
printf("A\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289884/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289884/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"A\00", align 1
@str.3 = 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:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !5
%cmp = icmp sgt i8 %0, 90
%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 1, 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
char ch;
scanf("%s",&ch);
if(ch>='A' && ch<='Z')
printf("A");
else
printf("a");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289927/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289927/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%0 = load i8, ptr %ch, align 1
%1 = add i8 %0, -65
%or.cond = icmp ult i8 %1, 26
%. = select i1 %or.cond, i32 65, i32 97
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
#include <string.h>
int main()
{
char a;
scanf("%c",&a);
if(a>='A'&&a<='Z')printf("A");
else printf("a");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_289978/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_289978/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1
%1 = add i8 %0, -65
%or.cond = icmp ult i8 %1, 26
%. = select i1 %or.cond, i32 65, i32 97
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(void){
char a;
scanf("%c",&a);
if(a>=65&&90>=a){
printf("A\n");
}else{
printf("a\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290019/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290019/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"a\00", align 1
@str.3 = 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:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1
%1 = add i8 %0, -65
%or.cond = icmp ult i8 %1, 26
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
#include<ctype.h>
int main() {
char a;
scanf("%s", &a);
if(islower(a) != 0) {
printf("a");
} else {
printf("A");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290062/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290062/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca 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)
%call1 = tail call ptr @__ctype_b_loc() #6
%0 = load ptr, ptr %call1, align 8, !tbaa !5
%1 = load i8, ptr %a, align 1, !tbaa !9
%idxprom = sext i8 %1 to i64
%arrayidx = getelementptr inbounds i16, ptr %0, i64 %idxprom
%2 = load i16, ptr %arrayidx, align 2, !tbaa !10
%3 = and i16 %2, 512
%cmp.not = icmp eq i16 %3, 0
%. = select i1 %cmp.not, i32 65, i32 97
%putchar = call i32 @putchar(i32 %.)
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 nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !7, i64 0}
|
//A - αlphabet
//Hiia
#include <stdio.h>
#include <stdlib.h>//rannsuu, zettaichi(absolute)
#include <time.h>
//srand((unsigned int) time(0));
#include <math.h>//koudona keisann
#include <string.h>//hairetsu
//#define max(p,q)((p)>(q)?(p):(q))//yoku wakarannkedo bennrisou
//#define min(p,q)((p)<(q)?(p):(q))//ue ni onaji
//#define N
int main()
{
char x;
scanf("%c", &x);
if('a'<=x && x<= 'z') {
printf("a");
}
else{
printf("A");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290105/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290105/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i8, ptr %x, align 1
%1 = add i8 %0, -97
%or.cond = icmp ult i8 %1, 26
%. = select i1 %or.cond, i32 97, i32 65
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 1, 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include<math.h>
#include<limits.h>
int main(){
char a;
scanf("%c",&a);
if(a>='a' && a<='z') printf("a");
else printf("A");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290149/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290149/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1
%1 = add i8 %0, -97
%or.cond = icmp ult i8 %1, 26
%. = select i1 %or.cond, i32 97, i32 65
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(void){
// Your code here!
char c;
scanf("%c",&c);
if(c >= 'A' && c <= 'Z'){
printf("A\n");
}
else{
printf("a\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290192/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290192/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"a\00", align 1
@str.3 = 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:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1
%1 = add i8 %0, -65
%or.cond = icmp ult i8 %1, 26
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 1, 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)"}
|
#include <stdio.h>
#include <math.h>
#define FOR(I, A, B) for(int I = (A); I < (B); I++)
#define N (800)
int H, W, K;
char map[N + 1][N + 1];
int q[N * N][2];
int is_edge(int x, int y) {
return x == 0 || y == 0 || (H - 1) == x || (W - 1) == y;
}
int min(int x, int y) {
return x < y ? x : y;
}
int score(int p[2]) {
int x = p[0];
int y = p[1];
return min(min(x, H - 1 - x), min(y, W - 1 - y));
}
void core() {
int sx = 0, sy = 0;
scanf("%d%d%d", &H, &W, &K);
FOR(i, 0, H)
{
scanf("%s", map[i]);
FOR(j, 0, W)
{
if (map[i][j] == 'S') {
sx = i;
sy = j;
}
}
}
//
int l = 0, r = 1;
q[0][0] = sx;
q[0][1] = sy;
FOR(k, 0, K)
{
if (l == r) {
break;
}
int d = 0;
FOR(i, l, r)
{
int x = q[i][0];
int y = q[i][1];
if (!is_edge(x, y)) {
if (map[x - 1][y] == '.') {
q[r + d][0] = x - 1;
q[r + d][1] = y;
map[x - 1][y] = 'x';
d++;
}
if (map[x + 1][y] == '.') {
q[r + d][0] = x + 1;
q[r + d][1] = y;
map[x + 1][y] = 'x';
d++;
}
if (map[x][y - 1] == '.') {
q[r + d][0] = x;
q[r + d][1] = y - 1;
map[x][y - 1] = 'x';
d++;
}
if (map[x][y + 1] == '.') {
q[r + d][0] = x;
q[r + d][1] = y + 1;
map[x][y + 1] = 'x';
d++;
}
}
}
l = r;
r += d;
}
int min_score = score(q[0]);
FOR(i, 1, r)
{
min_score = min(min_score, score(q[i]));
}
printf("%d\n", (int) ceil(((double) min_score) / K) + 1);
}
int main() {
core();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290235/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290235/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@H = dso_local global i32 0, align 4
@W = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@K = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@map = dso_local global [801 x [801 x i8]] zeroinitializer, align 16
@q = dso_local local_unnamed_addr global [640000 x [2 x i32]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @is_edge(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %x, 0
%cmp1 = icmp eq i32 %y, 0
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %lor.end, label %lor.lhs.false2
lor.lhs.false2: ; preds = %entry
%0 = load i32, ptr @H, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%cmp3 = icmp eq i32 %sub, %x
br i1 %cmp3, label %lor.end, label %lor.rhs
lor.rhs: ; preds = %lor.lhs.false2
%1 = load i32, ptr @W, align 4, !tbaa !5
%sub4 = add nsw i32 %1, -1
%cmp5 = icmp eq i32 %sub4, %y
%2 = zext i1 %cmp5 to i32
br label %lor.end
lor.end: ; preds = %lor.rhs, %lor.lhs.false2, %entry
%lor.ext = phi i32 [ 1, %lor.lhs.false2 ], [ 1, %entry ], [ %2, %lor.rhs ]
ret i32 %lor.ext
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %x, i32 noundef %y) local_unnamed_addr #1 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %x, i32 %y)
ret i32 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @score(ptr nocapture noundef readonly %p) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %p, align 4, !tbaa !5
%arrayidx1 = getelementptr inbounds i32, ptr %p, i64 1
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%2 = load i32, ptr @H, align 4, !tbaa !5
%3 = xor i32 %0, -1
%sub2 = add i32 %2, %3
%cond.i = tail call i32 @llvm.smin.i32(i32 %0, i32 %sub2)
%4 = load i32, ptr @W, align 4, !tbaa !5
%5 = xor i32 %1, -1
%sub4 = add i32 %4, %5
%cond.i10 = tail call i32 @llvm.smin.i32(i32 %1, i32 %sub4)
%cond.i11 = tail call i32 @llvm.smin.i32(i32 %cond.i, i32 %cond.i10)
ret i32 %cond.i11
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @core() local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @H, ptr noundef nonnull @W, ptr noundef nonnull @K)
%0 = load i32, ptr @H, align 4, !tbaa !5
%cmp244 = icmp sgt i32 %0, 0
br i1 %cmp244, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre281.pre = load i32, ptr @W, align 4
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup4, %entry.for.cond.cleanup_crit_edge
%.pre281 = phi i32 [ %.pre281.pre, %entry.for.cond.cleanup_crit_edge ], [ %2, %for.cond.cleanup4 ]
%sy.0.lcssa = phi i32 [ 0, %entry.for.cond.cleanup_crit_edge ], [ %sy.1.lcssa, %for.cond.cleanup4 ]
%sx.0.lcssa = phi i32 [ 0, %entry.for.cond.cleanup_crit_edge ], [ %sx.1.lcssa, %for.cond.cleanup4 ]
%.lcssa238 = phi i32 [ %0, %entry.for.cond.cleanup_crit_edge ], [ %7, %for.cond.cleanup4 ]
store i32 %sx.0.lcssa, ptr @q, align 16, !tbaa !5
store i32 %sy.0.lcssa, ptr getelementptr inbounds ([640000 x [2 x i32]], ptr @q, i64 0, i64 0, i64 1), align 4, !tbaa !5
%1 = load i32, ptr @K, align 4, !tbaa !5
%cmp16255 = icmp slt i32 %1, 1
br i1 %cmp16255, label %cleanup, label %for.cond25.preheader.lr.ph
for.cond25.preheader.lr.ph: ; preds = %for.cond.cleanup
%sub.i = add nsw i32 %.lcssa238, -1
%sub4.i = add nsw i32 %.pre281, -1
br label %for.cond25.preheader
for.body: ; preds = %entry, %for.cond.cleanup4
%indvars.iv267 = phi i64 [ %indvars.iv.next268, %for.cond.cleanup4 ], [ 0, %entry ]
%sx.0247 = phi i32 [ %sx.1.lcssa, %for.cond.cleanup4 ], [ 0, %entry ]
%sy.0246 = phi i32 [ %sy.1.lcssa, %for.cond.cleanup4 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %indvars.iv267
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr @W, align 4
%cmp3239 = icmp sgt i32 %2, 0
br i1 %cmp3239, label %for.body5.preheader, label %for.cond.cleanup4
for.body5.preheader: ; preds = %for.body
%wide.trip.count = zext i32 %2 to i64
%3 = trunc i64 %indvars.iv267 to i32
%xtraiter = and i64 %wide.trip.count, 3
%4 = icmp ult i32 %2, 4
br i1 %4, label %for.cond.cleanup4.loopexit.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body5
for.cond.cleanup4.loopexit.unr-lcssa: ; preds = %for.body5, %for.body5.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body5.preheader ], [ %spec.select.3, %for.body5 ]
%spec.select228.lcssa.ph = phi i32 [ undef, %for.body5.preheader ], [ %spec.select228.3, %for.body5 ]
%indvars.iv.unr = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next.3, %for.body5 ]
%sx.1242.unr = phi i32 [ %sx.0247, %for.body5.preheader ], [ %spec.select228.3, %for.body5 ]
%sy.1241.unr = phi i32 [ %sy.0246, %for.body5.preheader ], [ %spec.select.3, %for.body5 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup4, label %for.body5.epil
for.body5.epil: ; preds = %for.cond.cleanup4.loopexit.unr-lcssa, %for.body5.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body5.epil ], [ %indvars.iv.unr, %for.cond.cleanup4.loopexit.unr-lcssa ]
%sx.1242.epil = phi i32 [ %spec.select228.epil, %for.body5.epil ], [ %sx.1242.unr, %for.cond.cleanup4.loopexit.unr-lcssa ]
%sy.1241.epil = phi i32 [ %spec.select.epil, %for.body5.epil ], [ %sy.1241.unr, %for.cond.cleanup4.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body5.epil ], [ 0, %for.cond.cleanup4.loopexit.unr-lcssa ]
%arrayidx9.epil = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %indvars.iv267, i64 %indvars.iv.epil
%5 = load i8, ptr %arrayidx9.epil, align 1, !tbaa !9
%cmp10.epil = icmp eq i8 %5, 83
%6 = trunc i64 %indvars.iv.epil to i32
%spec.select.epil = select i1 %cmp10.epil, i32 %6, i32 %sy.1241.epil
%spec.select228.epil = select i1 %cmp10.epil, i32 %3, i32 %sx.1242.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup4, label %for.body5.epil, !llvm.loop !10
for.cond.cleanup4: ; preds = %for.cond.cleanup4.loopexit.unr-lcssa, %for.body5.epil, %for.body
%sy.1.lcssa = phi i32 [ %sy.0246, %for.body ], [ %spec.select.lcssa.ph, %for.cond.cleanup4.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body5.epil ]
%sx.1.lcssa = phi i32 [ %sx.0247, %for.body ], [ %spec.select228.lcssa.ph, %for.cond.cleanup4.loopexit.unr-lcssa ], [ %spec.select228.epil, %for.body5.epil ]
%indvars.iv.next268 = add nuw nsw i64 %indvars.iv267, 1
%7 = load i32, ptr @H, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next268, %8
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !12
for.body5: ; preds = %for.body5, %for.body5.preheader.new
%indvars.iv = phi i64 [ 0, %for.body5.preheader.new ], [ %indvars.iv.next.3, %for.body5 ]
%sx.1242 = phi i32 [ %sx.0247, %for.body5.preheader.new ], [ %spec.select228.3, %for.body5 ]
%sy.1241 = phi i32 [ %sy.0246, %for.body5.preheader.new ], [ %spec.select.3, %for.body5 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.3, %for.body5 ]
%arrayidx9 = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %indvars.iv267, i64 %indvars.iv
%9 = load i8, ptr %arrayidx9, align 1, !tbaa !9
%cmp10 = icmp eq i8 %9, 83
%10 = trunc i64 %indvars.iv to i32
%spec.select = select i1 %cmp10, i32 %10, i32 %sy.1241
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx9.1 = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %indvars.iv267, i64 %indvars.iv.next
%11 = load i8, ptr %arrayidx9.1, align 1, !tbaa !9
%cmp10.1 = icmp eq i8 %11, 83
%12 = trunc i64 %indvars.iv.next to i32
%spec.select.1 = select i1 %cmp10.1, i32 %12, i32 %spec.select
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx9.2 = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %indvars.iv267, i64 %indvars.iv.next.1
%13 = load i8, ptr %arrayidx9.2, align 1, !tbaa !9
%cmp10.2 = icmp eq i8 %13, 83
%14 = trunc i64 %indvars.iv.next.1 to i32
%spec.select.2 = select i1 %cmp10.2, i32 %14, i32 %spec.select.1
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx9.3 = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %indvars.iv267, i64 %indvars.iv.next.2
%15 = load i8, ptr %arrayidx9.3, align 1, !tbaa !9
%cmp10.3 = icmp eq i8 %15, 83
%16 = trunc i64 %indvars.iv.next.2 to i32
%spec.select.3 = select i1 %cmp10.3, i32 %16, i32 %spec.select.2
%17 = select i1 %cmp10.3, i1 true, i1 %cmp10.2
%18 = select i1 %17, i1 true, i1 %cmp10.1
%19 = select i1 %18, i1 true, i1 %cmp10
%spec.select228.3 = select i1 %19, i32 %3, i32 %sx.1242
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup4.loopexit.unr-lcssa, label %for.body5, !llvm.loop !14
for.cond25.preheader: ; preds = %for.cond25.preheader.lr.ph, %for.cond.cleanup28
%k.0258 = phi i32 [ 0, %for.cond25.preheader.lr.ph ], [ %inc142, %for.cond.cleanup28 ]
%r.0257 = phi i32 [ 1, %for.cond25.preheader.lr.ph ], [ %add140, %for.cond.cleanup28 ]
%l.0256 = phi i32 [ 0, %for.cond25.preheader.lr.ph ], [ %r.0257, %for.cond.cleanup28 ]
%cmp26251 = icmp slt i32 %l.0256, %r.0257
br i1 %cmp26251, label %for.body29.preheader, label %cleanup.loopexit
for.body29.preheader: ; preds = %for.cond25.preheader
%20 = sext i32 %l.0256 to i64
%wide.trip.count273 = sext i32 %r.0257 to i64
br label %for.body29
for.cond.cleanup28: ; preds = %if.end136
%add140 = add nsw i32 %d.4, %r.0257
%inc142 = add nuw nsw i32 %k.0258, 1
%cmp16 = icmp sge i32 %inc142, %1
%cmp20 = icmp eq i32 %d.4, 0
%or.cond = select i1 %cmp16, i1 true, i1 %cmp20
br i1 %or.cond, label %cleanup.loopexit, label %for.cond25.preheader, !llvm.loop !15
for.body29: ; preds = %for.body29.preheader, %if.end136
%indvars.iv270 = phi i64 [ %20, %for.body29.preheader ], [ %indvars.iv.next271, %if.end136 ]
%d.0252 = phi i32 [ 0, %for.body29.preheader ], [ %d.4, %if.end136 ]
%arrayidx31 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %indvars.iv270
%21 = load i32, ptr %arrayidx31, align 8, !tbaa !5
%arrayidx35 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %indvars.iv270, i64 1
%22 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%cmp.i = icmp eq i32 %21, 0
%cmp1.i = icmp eq i32 %22, 0
%or.cond.i = or i1 %cmp.i, %cmp1.i
%cmp3.i = icmp eq i32 %sub.i, %21
%or.cond237 = select i1 %or.cond.i, i1 true, i1 %cmp3.i
%cmp5.i.not = icmp eq i32 %sub4.i, %22
%or.cond265 = select i1 %or.cond237, i1 true, i1 %cmp5.i.not
br i1 %or.cond265, label %if.end136, label %if.then37
if.then37: ; preds = %for.body29
%sub = add nsw i32 %21, -1
%idxprom38 = sext i32 %sub to i64
%idxprom40 = sext i32 %22 to i64
%arrayidx41 = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %idxprom38, i64 %idxprom40
%23 = load i8, ptr %arrayidx41, align 1, !tbaa !9
%cmp43 = icmp eq i8 %23, 46
br i1 %cmp43, label %if.then45, label %if.end60
if.then45: ; preds = %if.then37
%add = add nsw i32 %d.0252, %r.0257
%idxprom47 = sext i32 %add to i64
%arrayidx48 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom47
store i32 %sub, ptr %arrayidx48, align 8, !tbaa !5
%arrayidx53 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom47, i64 1
store i32 %22, ptr %arrayidx53, align 4, !tbaa !5
store i8 120, ptr %arrayidx41, align 1, !tbaa !9
%inc59 = add nsw i32 %d.0252, 1
br label %if.end60
if.end60: ; preds = %if.then45, %if.then37
%d.1 = phi i32 [ %inc59, %if.then45 ], [ %d.0252, %if.then37 ]
%add61 = add nsw i32 %21, 1
%idxprom62 = sext i32 %add61 to i64
%arrayidx65 = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %idxprom62, i64 %idxprom40
%24 = load i8, ptr %arrayidx65, align 1, !tbaa !9
%cmp67 = icmp eq i8 %24, 46
br i1 %cmp67, label %if.then69, label %if.end85
if.then69: ; preds = %if.end60
%add71 = add nsw i32 %d.1, %r.0257
%idxprom72 = sext i32 %add71 to i64
%arrayidx73 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom72
store i32 %add61, ptr %arrayidx73, align 8, !tbaa !5
%arrayidx78 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom72, i64 1
store i32 %22, ptr %arrayidx78, align 4, !tbaa !5
store i8 120, ptr %arrayidx65, align 1, !tbaa !9
%inc84 = add nsw i32 %d.1, 1
br label %if.end85
if.end85: ; preds = %if.then69, %if.end60
%d.2 = phi i32 [ %inc84, %if.then69 ], [ %d.1, %if.end60 ]
%idxprom86 = sext i32 %21 to i64
%sub88 = add nsw i32 %22, -1
%idxprom89 = sext i32 %sub88 to i64
%arrayidx90 = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %idxprom86, i64 %idxprom89
%25 = load i8, ptr %arrayidx90, align 1, !tbaa !9
%cmp92 = icmp eq i8 %25, 46
br i1 %cmp92, label %if.then94, label %if.end110
if.then94: ; preds = %if.end85
%add95 = add nsw i32 %d.2, %r.0257
%idxprom96 = sext i32 %add95 to i64
%arrayidx97 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom96
store i32 %21, ptr %arrayidx97, align 8, !tbaa !5
%arrayidx103 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom96, i64 1
store i32 %sub88, ptr %arrayidx103, align 4, !tbaa !5
store i8 120, ptr %arrayidx90, align 1, !tbaa !9
%inc109 = add nsw i32 %d.2, 1
br label %if.end110
if.end110: ; preds = %if.then94, %if.end85
%d.3 = phi i32 [ %inc109, %if.then94 ], [ %d.2, %if.end85 ]
%add113 = add nsw i32 %22, 1
%idxprom114 = sext i32 %add113 to i64
%arrayidx115 = getelementptr inbounds [801 x [801 x i8]], ptr @map, i64 0, i64 %idxprom86, i64 %idxprom114
%26 = load i8, ptr %arrayidx115, align 1, !tbaa !9
%cmp117 = icmp eq i8 %26, 46
br i1 %cmp117, label %if.then119, label %if.end136
if.then119: ; preds = %if.end110
%add120 = add nsw i32 %d.3, %r.0257
%idxprom121 = sext i32 %add120 to i64
%arrayidx122 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom121
store i32 %21, ptr %arrayidx122, align 8, !tbaa !5
%arrayidx128 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom121, i64 1
store i32 %add113, ptr %arrayidx128, align 4, !tbaa !5
store i8 120, ptr %arrayidx115, align 1, !tbaa !9
%inc134 = add nsw i32 %d.3, 1
br label %if.end136
if.end136: ; preds = %for.body29, %if.end110, %if.then119
%d.4 = phi i32 [ %inc134, %if.then119 ], [ %d.3, %if.end110 ], [ %d.0252, %for.body29 ]
%indvars.iv.next271 = add nsw i64 %indvars.iv270, 1
%exitcond274.not = icmp eq i64 %indvars.iv.next271, %wide.trip.count273
br i1 %exitcond274.not, label %for.cond.cleanup28, label %for.body29, !llvm.loop !16
cleanup.loopexit: ; preds = %for.cond25.preheader, %for.cond.cleanup28
%add140289 = phi i32 [ %add140, %for.cond.cleanup28 ], [ %r.0257, %for.cond25.preheader ]
%.pre = load i32, ptr @q, align 16, !tbaa !5
%.pre280 = load i32, ptr getelementptr inbounds ([640000 x [2 x i32]], ptr @q, i64 0, i64 0, i64 1), align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %cleanup.loopexit, %for.cond.cleanup
%27 = phi i32 [ %sy.0.lcssa, %for.cond.cleanup ], [ %.pre280, %cleanup.loopexit ]
%28 = phi i32 [ %sx.0.lcssa, %for.cond.cleanup ], [ %.pre, %cleanup.loopexit ]
%r.0.lcssa = phi i32 [ 1, %for.cond.cleanup ], [ %add140289, %cleanup.loopexit ]
%29 = xor i32 %28, -1
%sub2.i = add i32 %.lcssa238, %29
%cond.i.i = tail call i32 @llvm.smin.i32(i32 %28, i32 %sub2.i)
%30 = xor i32 %27, -1
%sub4.i229 = add i32 %.pre281, %30
%cond.i10.i = tail call i32 @llvm.smin.i32(i32 %27, i32 %sub4.i229)
%cond.i11.i = tail call i32 @llvm.smin.i32(i32 %cond.i.i, i32 %cond.i10.i)
%cmp147261 = icmp sgt i32 %r.0.lcssa, 1
br i1 %cmp147261, label %for.body150.preheader, label %for.cond.cleanup149
for.body150.preheader: ; preds = %cleanup
%wide.trip.count278 = zext i32 %r.0.lcssa to i64
%31 = add nsw i64 %wide.trip.count278, -1
%min.iters.check = icmp ult i32 %r.0.lcssa, 9
br i1 %min.iters.check, label %for.body150.preheader299, label %vector.ph
vector.ph: ; preds = %for.body150.preheader
%n.vec = and i64 %31, -8
%ind.end = or i64 %n.vec, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %cond.i11.i, 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 %.lcssa238, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert297 = insertelement <4 x i32> poison, i32 %.pre281, i64 0
%broadcast.splat298 = shufflevector <4 x i32> %broadcast.splatinsert297, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %49, %vector.body ]
%vec.phi292 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %50, %vector.body ]
%offset.idx = or i64 %index, 1
%32 = or i64 %index, 5
%33 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %offset.idx
%34 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %32
%wide.vec = load <8 x i32>, ptr %33, align 8, !tbaa !5
%wide.vec293 = load <8 x i32>, ptr %34, align 8, !tbaa !5
%strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec294 = shufflevector <8 x i32> %wide.vec293, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec295 = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%strided.vec296 = shufflevector <8 x i32> %wide.vec293, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%35 = xor <4 x i32> %strided.vec, <i32 -1, i32 -1, i32 -1, i32 -1>
%36 = xor <4 x i32> %strided.vec294, <i32 -1, i32 -1, i32 -1, i32 -1>
%37 = add <4 x i32> %broadcast.splat, %35
%38 = add <4 x i32> %broadcast.splat, %36
%39 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %strided.vec, <4 x i32> %37)
%40 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %strided.vec294, <4 x i32> %38)
%41 = xor <4 x i32> %strided.vec295, <i32 -1, i32 -1, i32 -1, i32 -1>
%42 = xor <4 x i32> %strided.vec296, <i32 -1, i32 -1, i32 -1, i32 -1>
%43 = add <4 x i32> %broadcast.splat298, %41
%44 = add <4 x i32> %broadcast.splat298, %42
%45 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %strided.vec295, <4 x i32> %43)
%46 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %strided.vec296, <4 x i32> %44)
%47 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %39, <4 x i32> %45)
%48 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %40, <4 x i32> %46)
%49 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %47)
%50 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi292, <4 x i32> %48)
%index.next = add nuw i64 %index, 8
%51 = icmp eq i64 %index.next, %n.vec
br i1 %51, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %49, <4 x i32> %50)
%52 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %31, %n.vec
br i1 %cmp.n, label %for.cond.cleanup149, label %for.body150.preheader299
for.body150.preheader299: ; preds = %for.body150.preheader, %middle.block
%indvars.iv275.ph = phi i64 [ 1, %for.body150.preheader ], [ %ind.end, %middle.block ]
%min_score.0262.ph = phi i32 [ %cond.i11.i, %for.body150.preheader ], [ %52, %middle.block ]
br label %for.body150
for.cond.cleanup149: ; preds = %for.body150, %middle.block, %cleanup
%min_score.0.lcssa = phi i32 [ %cond.i11.i, %cleanup ], [ %52, %middle.block ], [ %cond.i, %for.body150 ]
%conv160 = sitofp i32 %min_score.0.lcssa to double
%conv161 = sitofp i32 %1 to double
%div = fdiv double %conv160, %conv161
%53 = tail call double @llvm.ceil.f64(double %div)
%conv162 = fptosi double %53 to i32
%add163 = add nsw i32 %conv162, 1
%call164 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add163)
ret void
for.body150: ; preds = %for.body150.preheader299, %for.body150
%indvars.iv275 = phi i64 [ %indvars.iv.next276, %for.body150 ], [ %indvars.iv275.ph, %for.body150.preheader299 ]
%min_score.0262 = phi i32 [ %cond.i, %for.body150 ], [ %min_score.0262.ph, %for.body150.preheader299 ]
%arrayidx152 = getelementptr inbounds [640000 x [2 x i32]], ptr @q, i64 0, i64 %indvars.iv275
%54 = load i32, ptr %arrayidx152, align 8, !tbaa !5
%arrayidx1.i = getelementptr inbounds i32, ptr %arrayidx152, i64 1
%55 = load i32, ptr %arrayidx1.i, align 4, !tbaa !5
%56 = xor i32 %54, -1
%sub2.i230 = add i32 %.lcssa238, %56
%cond.i.i231 = tail call i32 @llvm.smin.i32(i32 %54, i32 %sub2.i230)
%57 = xor i32 %55, -1
%sub4.i232 = add i32 %.pre281, %57
%cond.i10.i233 = tail call i32 @llvm.smin.i32(i32 %55, i32 %sub4.i232)
%cond.i11.i234 = tail call i32 @llvm.smin.i32(i32 %cond.i.i231, i32 %cond.i10.i233)
%cond.i = tail call i32 @llvm.smin.i32(i32 %min_score.0262, i32 %cond.i11.i234)
%indvars.iv.next276 = add nuw nsw i64 %indvars.iv275, 1
%exitcond279.not = icmp eq i64 %indvars.iv.next276, %wide.trip.count278
br i1 %exitcond279.not, label %for.cond.cleanup149, label %for.body150, !llvm.loop !20
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #5
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
tail call void @core()
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !13, !19, !18}
|
#include<stdio.h>
int main(){
long long n,i,j,k,a;
scanf("%lld",&n);
for(j=0;n%2==0;j++)n/=2;for(k=1;k*(k+1)/2<=j;k++);a=k-1;
for(i=3;i*i<n;i+=2){for(j=0;n%i==0;j++)n/=i;for(k=1;k*(k+1)/2<=j;k++);a+=k-1;}
printf("%lld",a+(n!=1));
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290279/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290279/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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)
%n.promoted = load i64, ptr %n, align 8, !tbaa !5
%0 = and i64 %n.promoted, 1
%cmp56 = icmp eq i64 %0, 0
br i1 %cmp56, label %for.body, label %for.cond1.preheader
for.cond.for.cond1.preheader_crit_edge: ; preds = %for.body
store i64 %div, ptr %n, align 8, !tbaa !5
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond.for.cond1.preheader_crit_edge, %entry
%n.promoted66 = phi i64 [ %div, %for.cond.for.cond1.preheader_crit_edge ], [ %n.promoted, %entry ]
%j.0.lcssa = phi i64 [ %inc, %for.cond.for.cond1.preheader_crit_edge ], [ 0, %entry ]
br label %for.cond1
for.body: ; preds = %entry, %for.body
%j.058 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%div5557 = phi i64 [ %div, %for.body ], [ %n.promoted, %entry ]
%div = sdiv i64 %div5557, 2
%inc = add nuw nsw i64 %j.058, 1
%1 = and i64 %div, 1
%cmp = icmp eq i64 %1, 0
br i1 %cmp, label %for.body, label %for.cond.for.cond1.preheader_crit_edge, !llvm.loop !9
for.cond1: ; preds = %for.cond1.preheader, %for.cond1
%k.0 = phi i64 [ %add, %for.cond1 ], [ 1, %for.cond1.preheader ]
%add = add nuw nsw i64 %k.0, 1
%mul = mul nsw i64 %add, %k.0
%div253 = lshr i64 %mul, 1
%cmp3.not = icmp ugt i64 %div253, %j.0.lcssa
br i1 %cmp3.not, label %for.end7, label %for.cond1, !llvm.loop !11
for.end7: ; preds = %for.cond1
%sub = add nsw i64 %k.0, -1
%cmp1069 = icmp sgt i64 %n.promoted66, 9
br i1 %cmp1069, label %for.cond12.preheader, label %for.end33
for.cond12.preheader: ; preds = %for.end7, %for.end28
%a.072 = phi i64 [ %add30, %for.end28 ], [ %sub, %for.end7 ]
%i.071 = phi i64 [ %add32, %for.end28 ], [ 3, %for.end7 ]
%div16.lcssa6870 = phi i64 [ %div16.lcssa67, %for.end28 ], [ %n.promoted66, %for.end7 ]
%rem1361 = srem i64 %div16.lcssa6870, %i.071
%cmp1462 = icmp eq i64 %rem1361, 0
br i1 %cmp1462, label %for.body15, label %for.cond20.preheader
for.cond12.for.cond20.preheader_crit_edge: ; preds = %for.body15
store i64 %div16, ptr %n, align 8, !tbaa !5
br label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.cond12.for.cond20.preheader_crit_edge, %for.cond12.preheader
%div16.lcssa67 = phi i64 [ %div16, %for.cond12.for.cond20.preheader_crit_edge ], [ %div16.lcssa6870, %for.cond12.preheader ]
%j.1.lcssa = phi i64 [ %inc18, %for.cond12.for.cond20.preheader_crit_edge ], [ 0, %for.cond12.preheader ]
br label %for.cond20
for.body15: ; preds = %for.cond12.preheader, %for.body15
%j.164 = phi i64 [ %inc18, %for.body15 ], [ 0, %for.cond12.preheader ]
%div166063 = phi i64 [ %div16, %for.body15 ], [ %div16.lcssa6870, %for.cond12.preheader ]
%div16 = sdiv i64 %div166063, %i.071
%inc18 = add nuw nsw i64 %j.164, 1
%rem13 = srem i64 %div16, %i.071
%cmp14 = icmp eq i64 %rem13, 0
br i1 %cmp14, label %for.body15, label %for.cond12.for.cond20.preheader_crit_edge, !llvm.loop !12
for.cond20: ; preds = %for.cond20.preheader, %for.cond20
%k.1 = phi i64 [ %add21, %for.cond20 ], [ 1, %for.cond20.preheader ]
%add21 = add nuw nsw i64 %k.1, 1
%mul22 = mul nsw i64 %add21, %k.1
%div2354 = lshr i64 %mul22, 1
%cmp24.not = icmp ugt i64 %div2354, %j.1.lcssa
br i1 %cmp24.not, label %for.end28, label %for.cond20, !llvm.loop !13
for.end28: ; preds = %for.cond20
%sub29 = add i64 %a.072, -1
%add30 = add i64 %sub29, %k.1
%add32 = add nuw nsw i64 %i.071, 2
%mul9 = mul nsw i64 %add32, %add32
%cmp10 = icmp slt i64 %mul9, %div16.lcssa67
br i1 %cmp10, label %for.cond12.preheader, label %for.end33, !llvm.loop !14
for.end33: ; preds = %for.end28, %for.end7
%a.0.lcssa = phi i64 [ %sub, %for.end7 ], [ %add30, %for.end28 ]
%.lcssa = phi i64 [ %n.promoted66, %for.end7 ], [ %div16.lcssa67, %for.end28 ]
%cmp34 = icmp ne i64 %.lcssa, 1
%conv35 = zext i1 %cmp34 to i64
%add36 = add nsw i64 %a.0.lcssa, %conv35
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add36)
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct NODE {
char body[11];
int time;
int hash;
struct NODE *next;
};
struct NODE *head;
struct NODE *tail;
int node_num = 0;
int change_worm(char *worm);
void add_node(char *worm, int time);
int calc_hash(char *worm);
int change_color(struct NODE *node);
int check_body(char *worm);
int check_hash(int hash);
void free_node(void);
int main(void)
{
char worm[11];
int time;
while (1){
scanf("%s", worm);
if (worm[0] == '0'){
break;
}
time = change_worm(worm);
if (time == -1){
printf("NA\n");
}
else {
printf("%d\n", time);
}
node_num = 0;
free_node();
}
return (0);
}
int change_worm(char *worm)
{
struct NODE *node;
int time;
add_node(worm, 0);
node = head;
while (node != NULL){
// printf("-->%d %s\n", node->time, node->body);
time = change_color(node);
if (time >= 0){
return (time);
}
node = node->next;
}
return (-1);
}
void add_node(char *worm, int time)
{
struct NODE *node;
int hash;
int i;
node = malloc(sizeof(struct NODE));
strcpy(node->body, worm);
node->time = time;
node->hash = calc_hash(node->body);
node->next = NULL;
if (head == NULL){
head = tail = node;
}
else {
tail->next = node;
tail = node;
}
//printf("<%d>\n", ++node_num);
// printf("[%d %s]\n", time, worm);
}
int calc_hash(char *worm)
{
int hash;
int i;
hash = 0;
i = 0;
while (worm[i] != '\0'){
hash *= 3;
switch (worm[i]){
case 'r':
break;
case 'g':
hash++;
break;
case 'b':
hash += 2;
break;
}
i++;
}
return (hash);
}
int change_color(struct NODE *node)
{
int i;
char new_worm[11];
int hash;
if (check_body(node->body) == 1){
return (node->time);
}
i = 0;
while (node->body[i + 1] != '\0'){
if (node->body[i] != node->body[i + 1]){
strcpy(new_worm, node->body);
if (new_worm[i] != 'r' && new_worm[i + 1] != 'r'){
new_worm[i] = new_worm[i + 1] = 'r';
}
else if (new_worm[i] != 'g' && new_worm[i + 1] != 'g'){
new_worm[i] = new_worm[i + 1] = 'g';
}
else if (new_worm[i] != 'b' && new_worm[i + 1] != 'b'){
new_worm[i] = new_worm[i + 1] = 'b';
}
if (check_body(new_worm) == 1){
return (node->time + 1);
}
if (check_hash(calc_hash(new_worm)) == 1){
add_node(new_worm, node->time + 1);
}
}
i++;
}
return (-1);
}
int check_body(char *worm)
{
int i;
char first;
first = worm[0];
i = 1;
while (worm[i] != '\0'){
if (worm[i] != first){
return (0);
}
i++;
}
return (1);
}
int check_hash(int hash)
{
struct NODE *node;
node = head;
while (node != NULL){
if (node->hash == hash){
// printf("<<found>>\n");
return (0);
}
node = node->next;
}
return (1);
}
void free_node(void)
{
struct NODE *node;
struct NODE *del_node;
node = head;
while (node->next != NULL){
del_node = node;
node = node->next;
free(del_node);
}
head = tail = NULL;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290321/source.c"
target datalayout = "e-m:e-p270: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.NODE = type { [11 x i8], i32, i32, ptr }
@node_num = dso_local local_unnamed_addr global i32 0, align 4
@.str = 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
@head = dso_local local_unnamed_addr global ptr null, align 8
@tail = dso_local local_unnamed_addr global ptr null, align 8
@str = private unnamed_addr constant [3 x i8] c"NA\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%worm = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %worm) #10
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %worm)
%0 = load i8, ptr %worm, align 1, !tbaa !5
%cmp19 = icmp eq i8 %0, 48
br i1 %cmp19, label %while.end, label %if.end
if.end: ; preds = %entry, %free_node.exit
%call.i.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
%call1.i.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call.i.i, ptr noundef nonnull dereferenceable(1) %worm) #10
%time2.i.i = getelementptr inbounds %struct.NODE, ptr %call.i.i, i64 0, i32 1
store i32 0, ptr %time2.i.i, align 4, !tbaa !8
%1 = load i8, ptr %call.i.i, align 1, !tbaa !5
%cmp.not13.i.i.i = icmp eq i8 %1, 0
br i1 %cmp.not13.i.i.i, label %add_node.exit.i, label %while.body.i.i.i
while.body.i.i.i: ; preds = %if.end, %sw.epilog.i.i.i
%indvars.iv.i.i.i = phi i64 [ %indvars.iv.next.i.i.i, %sw.epilog.i.i.i ], [ 0, %if.end ]
%2 = phi i8 [ %3, %sw.epilog.i.i.i ], [ %1, %if.end ]
%hash.014.i.i.i = phi i32 [ %hash.1.i.i.i, %sw.epilog.i.i.i ], [ 0, %if.end ]
%conv.i.i.i = sext i8 %2 to i32
%mul.i.i.i = mul nsw i32 %hash.014.i.i.i, 3
switch i32 %conv.i.i.i, label %sw.epilog.i.i.i [
i32 98, label %sw.bb5.i.i.i
i32 103, label %sw.bb.i.i.i
]
sw.bb.i.i.i: ; preds = %while.body.i.i.i
%inc.i.i.i = add nsw i32 %mul.i.i.i, 1
br label %sw.epilog.i.i.i
sw.bb5.i.i.i: ; preds = %while.body.i.i.i
%add.i.i.i = add nsw i32 %mul.i.i.i, 2
br label %sw.epilog.i.i.i
sw.epilog.i.i.i: ; preds = %sw.bb5.i.i.i, %sw.bb.i.i.i, %while.body.i.i.i
%hash.1.i.i.i = phi i32 [ %mul.i.i.i, %while.body.i.i.i ], [ %inc.i.i.i, %sw.bb.i.i.i ], [ %add.i.i.i, %sw.bb5.i.i.i ]
%indvars.iv.next.i.i.i = add nuw nsw i64 %indvars.iv.i.i.i, 1
%arrayidx.i.i.i = getelementptr inbounds i8, ptr %call.i.i, i64 %indvars.iv.next.i.i.i
%3 = load i8, ptr %arrayidx.i.i.i, align 1, !tbaa !5
%cmp.not.i.i.i = icmp eq i8 %3, 0
br i1 %cmp.not.i.i.i, label %add_node.exit.i, label %while.body.i.i.i, !llvm.loop !12
add_node.exit.i: ; preds = %sw.epilog.i.i.i, %if.end
%hash.0.lcssa.i.i.i = phi i32 [ 0, %if.end ], [ %hash.1.i.i.i, %sw.epilog.i.i.i ]
%hash6.i.i = getelementptr inbounds %struct.NODE, ptr %call.i.i, i64 0, i32 2
store i32 %hash.0.lcssa.i.i.i, ptr %hash6.i.i, align 8, !tbaa !14
%next.i.i = getelementptr inbounds %struct.NODE, ptr %call.i.i, i64 0, i32 3
store ptr null, ptr %next.i.i, align 8, !tbaa !15
%4 = load ptr, ptr @head, align 8, !tbaa !16
%cmp.i.i = icmp eq ptr %4, null
%5 = load ptr, ptr @tail, align 8
%next7.i.i = getelementptr inbounds %struct.NODE, ptr %5, i64 0, i32 3
%next7.sink.i.i = select i1 %cmp.i.i, ptr @head, ptr %next7.i.i
store ptr %call.i.i, ptr %next7.sink.i.i, align 8, !tbaa !16
store ptr %call.i.i, ptr @tail, align 8
%node.06.i = load ptr, ptr @head, align 8, !tbaa !16
%cmp.not7.i = icmp eq ptr %node.06.i, null
br i1 %cmp.not7.i, label %if.then6, label %while.body.i
while.cond.i: ; preds = %while.body.i
%next.i = getelementptr inbounds %struct.NODE, ptr %node.08.i, i64 0, i32 3
%node.0.i = load ptr, ptr %next.i, align 8, !tbaa !16
%cmp.not.i = icmp eq ptr %node.0.i, null
br i1 %cmp.not.i, label %if.then6, label %while.body.i, !llvm.loop !17
while.body.i: ; preds = %add_node.exit.i, %while.cond.i
%node.08.i = phi ptr [ %node.0.i, %while.cond.i ], [ %node.06.i, %add_node.exit.i ]
%call.i = call i32 @change_color(ptr noundef nonnull %node.08.i)
%cmp1.i = icmp sgt i32 %call.i, -1
br i1 %cmp1.i, label %if.else, label %while.cond.i
if.then6: ; preds = %while.cond.i, %add_node.exit.i
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end9
if.else: ; preds = %while.body.i
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %call.i)
br label %if.end9
if.end9: ; preds = %if.else, %if.then6
store i32 0, ptr @node_num, align 4, !tbaa !18
%6 = load ptr, ptr @head, align 8, !tbaa !16
%next4.i = getelementptr inbounds %struct.NODE, ptr %6, i64 0, i32 3
%7 = load ptr, ptr %next4.i, align 8, !tbaa !15
%cmp.not5.i = icmp eq ptr %7, null
br i1 %cmp.not5.i, label %free_node.exit, label %while.body.i11
while.body.i11: ; preds = %if.end9, %while.body.i11
%8 = phi ptr [ %9, %while.body.i11 ], [ %7, %if.end9 ]
%node.06.i12 = phi ptr [ %8, %while.body.i11 ], [ %6, %if.end9 ]
call void @free(ptr noundef nonnull %node.06.i12) #10
%next.i13 = getelementptr inbounds %struct.NODE, ptr %8, i64 0, i32 3
%9 = load ptr, ptr %next.i13, align 8, !tbaa !15
%cmp.not.i14 = icmp eq ptr %9, null
br i1 %cmp.not.i14, label %free_node.exit, label %while.body.i11, !llvm.loop !19
free_node.exit: ; preds = %while.body.i11, %if.end9
store ptr null, ptr @tail, align 8, !tbaa !16
store ptr null, ptr @head, align 8, !tbaa !16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %worm)
%10 = load i8, ptr %worm, align 1, !tbaa !5
%cmp = icmp eq i8 %10, 48
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %free_node.exit, %entry
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %worm) #10
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @change_worm(ptr nocapture noundef readonly %worm) local_unnamed_addr #3 {
entry:
%call.i = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
%call1.i = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call.i, ptr noundef nonnull dereferenceable(1) %worm) #10
%time2.i = getelementptr inbounds %struct.NODE, ptr %call.i, i64 0, i32 1
store i32 0, ptr %time2.i, align 4, !tbaa !8
%0 = load i8, ptr %call.i, align 1, !tbaa !5
%cmp.not13.i.i = icmp eq i8 %0, 0
br i1 %cmp.not13.i.i, label %add_node.exit, label %while.body.i.i
while.body.i.i: ; preds = %entry, %sw.epilog.i.i
%indvars.iv.i.i = phi i64 [ %indvars.iv.next.i.i, %sw.epilog.i.i ], [ 0, %entry ]
%1 = phi i8 [ %2, %sw.epilog.i.i ], [ %0, %entry ]
%hash.014.i.i = phi i32 [ %hash.1.i.i, %sw.epilog.i.i ], [ 0, %entry ]
%conv.i.i = sext i8 %1 to i32
%mul.i.i = mul nsw i32 %hash.014.i.i, 3
switch i32 %conv.i.i, label %sw.epilog.i.i [
i32 98, label %sw.bb5.i.i
i32 103, label %sw.bb.i.i
]
sw.bb.i.i: ; preds = %while.body.i.i
%inc.i.i = add nsw i32 %mul.i.i, 1
br label %sw.epilog.i.i
sw.bb5.i.i: ; preds = %while.body.i.i
%add.i.i = add nsw i32 %mul.i.i, 2
br label %sw.epilog.i.i
sw.epilog.i.i: ; preds = %sw.bb5.i.i, %sw.bb.i.i, %while.body.i.i
%hash.1.i.i = phi i32 [ %mul.i.i, %while.body.i.i ], [ %inc.i.i, %sw.bb.i.i ], [ %add.i.i, %sw.bb5.i.i ]
%indvars.iv.next.i.i = add nuw nsw i64 %indvars.iv.i.i, 1
%arrayidx.i.i = getelementptr inbounds i8, ptr %call.i, i64 %indvars.iv.next.i.i
%2 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !5
%cmp.not.i.i = icmp eq i8 %2, 0
br i1 %cmp.not.i.i, label %add_node.exit, label %while.body.i.i, !llvm.loop !12
add_node.exit: ; preds = %sw.epilog.i.i, %entry
%hash.0.lcssa.i.i = phi i32 [ 0, %entry ], [ %hash.1.i.i, %sw.epilog.i.i ]
%hash6.i = getelementptr inbounds %struct.NODE, ptr %call.i, i64 0, i32 2
store i32 %hash.0.lcssa.i.i, ptr %hash6.i, align 8, !tbaa !14
%next.i = getelementptr inbounds %struct.NODE, ptr %call.i, i64 0, i32 3
store ptr null, ptr %next.i, align 8, !tbaa !15
%3 = load ptr, ptr @head, align 8, !tbaa !16
%cmp.i = icmp eq ptr %3, null
%4 = load ptr, ptr @tail, align 8
%next7.i = getelementptr inbounds %struct.NODE, ptr %4, i64 0, i32 3
%next7.sink.i = select i1 %cmp.i, ptr @head, ptr %next7.i
store ptr %call.i, ptr %next7.sink.i, align 8, !tbaa !16
store ptr %call.i, ptr @tail, align 8
%node.06 = load ptr, ptr @head, align 8, !tbaa !16
%cmp.not7 = icmp eq ptr %node.06, null
br i1 %cmp.not7, label %cleanup, label %while.body
while.cond: ; preds = %while.body
%next = getelementptr inbounds %struct.NODE, ptr %node.08, i64 0, i32 3
%node.0 = load ptr, ptr %next, align 8, !tbaa !16
%cmp.not = icmp eq ptr %node.0, null
br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !17
while.body: ; preds = %add_node.exit, %while.cond
%node.08 = phi ptr [ %node.0, %while.cond ], [ %node.06, %add_node.exit ]
%call = tail call i32 @change_color(ptr noundef nonnull %node.08)
%cmp1 = icmp sgt i32 %call, -1
br i1 %cmp1, label %cleanup, label %while.cond
cleanup: ; preds = %while.body, %while.cond, %add_node.exit
%retval.0 = phi i32 [ -1, %add_node.exit ], [ -1, %while.cond ], [ %call, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nounwind uwtable
define dso_local void @free_node() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @head, align 8, !tbaa !16
%next4 = getelementptr inbounds %struct.NODE, ptr %0, i64 0, i32 3
%1 = load ptr, ptr %next4, align 8, !tbaa !15
%cmp.not5 = icmp eq ptr %1, null
br i1 %cmp.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%2 = phi ptr [ %3, %while.body ], [ %1, %entry ]
%node.06 = phi ptr [ %2, %while.body ], [ %0, %entry ]
tail call void @free(ptr noundef nonnull %node.06) #10
%next = getelementptr inbounds %struct.NODE, ptr %2, i64 0, i32 3
%3 = load ptr, ptr %next, align 8, !tbaa !15
%cmp.not = icmp eq ptr %3, null
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !19
while.end: ; preds = %while.body, %entry
store ptr null, ptr @tail, align 8, !tbaa !16
store ptr null, ptr @head, align 8, !tbaa !16
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @add_node(ptr nocapture noundef readonly %worm, i32 noundef %time) local_unnamed_addr #3 {
entry:
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
%call1 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call, ptr noundef nonnull dereferenceable(1) %worm) #10
%time2 = getelementptr inbounds %struct.NODE, ptr %call, i64 0, i32 1
store i32 %time, ptr %time2, align 4, !tbaa !8
%0 = load i8, ptr %call, align 1, !tbaa !5
%cmp.not13.i = icmp eq i8 %0, 0
br i1 %cmp.not13.i, label %calc_hash.exit, label %while.body.i
while.body.i: ; preds = %entry, %sw.epilog.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %sw.epilog.i ], [ 0, %entry ]
%1 = phi i8 [ %2, %sw.epilog.i ], [ %0, %entry ]
%hash.014.i = phi i32 [ %hash.1.i, %sw.epilog.i ], [ 0, %entry ]
%conv.i = sext i8 %1 to i32
%mul.i = mul nsw i32 %hash.014.i, 3
switch i32 %conv.i, label %sw.epilog.i [
i32 98, label %sw.bb5.i
i32 103, label %sw.bb.i
]
sw.bb.i: ; preds = %while.body.i
%inc.i = add nsw i32 %mul.i, 1
br label %sw.epilog.i
sw.bb5.i: ; preds = %while.body.i
%add.i = add nsw i32 %mul.i, 2
br label %sw.epilog.i
sw.epilog.i: ; preds = %sw.bb5.i, %sw.bb.i, %while.body.i
%hash.1.i = phi i32 [ %mul.i, %while.body.i ], [ %inc.i, %sw.bb.i ], [ %add.i, %sw.bb5.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds i8, ptr %call, i64 %indvars.iv.next.i
%2 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%cmp.not.i = icmp eq i8 %2, 0
br i1 %cmp.not.i, label %calc_hash.exit, label %while.body.i, !llvm.loop !12
calc_hash.exit: ; preds = %sw.epilog.i, %entry
%hash.0.lcssa.i = phi i32 [ 0, %entry ], [ %hash.1.i, %sw.epilog.i ]
%hash6 = getelementptr inbounds %struct.NODE, ptr %call, i64 0, i32 2
store i32 %hash.0.lcssa.i, ptr %hash6, align 8, !tbaa !14
%next = getelementptr inbounds %struct.NODE, ptr %call, i64 0, i32 3
store ptr null, ptr %next, align 8, !tbaa !15
%3 = load ptr, ptr @head, align 8, !tbaa !16
%cmp = icmp eq ptr %3, null
%4 = load ptr, ptr @tail, align 8
%next7 = getelementptr inbounds %struct.NODE, ptr %4, i64 0, i32 3
%next7.sink = select i1 %cmp, ptr @head, ptr %next7
store ptr %call, ptr %next7.sink, align 8, !tbaa !16
store ptr %call, ptr @tail, align 8
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @change_color(ptr nocapture noundef readonly %node) local_unnamed_addr #3 {
entry:
%new_worm = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %new_worm) #10
%0 = load i8, ptr %node, align 1, !tbaa !5
%arrayidx114.i = getelementptr inbounds i8, ptr %node, i64 1
%1 = load i8, ptr %arrayidx114.i, align 1, !tbaa !5
%cmp.not15.i = icmp eq i8 %1, 0
br i1 %cmp.not15.i, label %if.then, label %while.body.i
while.cond.i: ; preds = %while.body.i
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
%arrayidx1.i = getelementptr inbounds i8, ptr %node, i64 %indvars.iv.next.i
%2 = load i8, ptr %arrayidx1.i, align 1, !tbaa !5
%cmp.not.i = icmp eq i8 %2, 0
br i1 %cmp.not.i, label %if.then, label %while.body.i, !llvm.loop !20
while.body.i: ; preds = %entry, %while.cond.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 1, %entry ]
%3 = phi i8 [ %2, %while.cond.i ], [ %1, %entry ]
%cmp7.not.i = icmp eq i8 %3, %0
br i1 %cmp7.not.i, label %while.cond.i, label %while.body.lr.ph
while.body.lr.ph: ; preds = %while.body.i
%tail.promoted = load ptr, ptr @tail, align 8
%arrayidx114.i120 = getelementptr inbounds i8, ptr %new_worm, i64 1
%time92 = getelementptr inbounds %struct.NODE, ptr %node, i64 0, i32 1
br label %while.body
if.then: ; preds = %while.cond.i, %entry
%time = getelementptr inbounds %struct.NODE, ptr %node, i64 0, i32 1
%4 = load i32, ptr %time, align 4, !tbaa !8
br label %cleanup
while.body: ; preds = %while.body.lr.ph, %if.end95
%indvars.iv163 = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next164, %if.end95 ]
%indvars.iv = phi i64 [ 1, %while.body.lr.ph ], [ %indvars.iv.next, %if.end95 ]
%5 = phi i8 [ %1, %while.body.lr.ph ], [ %21, %if.end95 ]
%call.i155158 = phi ptr [ %tail.promoted, %while.body.lr.ph ], [ %call.i154, %if.end95 ]
%arrayidx6 = getelementptr inbounds [11 x i8], ptr %node, i64 0, i64 %indvars.iv163
%6 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp13.not = icmp eq i8 %6, %5
br i1 %cmp13.not, label %if.end95, label %if.then15
if.then15: ; preds = %while.body
%call19 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %new_worm, ptr noundef nonnull dereferenceable(1) %node) #10
%arrayidx21 = getelementptr inbounds [11 x i8], ptr %new_worm, i64 0, i64 %indvars.iv163
%7 = load i8, ptr %arrayidx21, align 1, !tbaa !5
%cmp23.not = icmp eq i8 %7, 114
%arrayidx45144 = getelementptr inbounds [11 x i8], ptr %new_worm, i64 0, i64 %indvars.iv
%8 = load i8, ptr %arrayidx45144, align 1, !tbaa !5
br i1 %cmp23.not, label %land.lhs.true42.thread, label %land.lhs.true
land.lhs.true: ; preds = %if.then15
%cmp29.not = icmp eq i8 %8, 114
br i1 %cmp29.not, label %if.else, label %if.then31
if.then31: ; preds = %land.lhs.true
store i8 114, ptr %arrayidx45144, align 1, !tbaa !5
br label %if.end76
if.else: ; preds = %land.lhs.true
%cmp40.not = icmp eq i8 %7, 103
br i1 %cmp40.not, label %if.then68, label %if.then49
land.lhs.true42.thread: ; preds = %if.then15
%cmp47.not145 = icmp eq i8 %8, 103
br i1 %cmp47.not145, label %if.then68, label %if.then49
if.then49: ; preds = %if.else, %land.lhs.true42.thread
store i8 103, ptr %arrayidx45144, align 1, !tbaa !5
br label %if.end76
if.then68: ; preds = %if.else, %land.lhs.true42.thread
%arrayidx64 = getelementptr inbounds [11 x i8], ptr %new_worm, i64 0, i64 %indvars.iv
store i8 98, ptr %arrayidx64, align 1, !tbaa !5
br label %if.end76
if.end76: ; preds = %if.then49, %if.then68, %if.then31
%.sink = phi i8 [ 103, %if.then49 ], [ 98, %if.then68 ], [ 114, %if.then31 ]
store i8 %.sink, ptr %arrayidx21, align 1, !tbaa !5
%9 = load i8, ptr %new_worm, align 1, !tbaa !5
%10 = load i8, ptr %arrayidx114.i120, align 1, !tbaa !5
%cmp.not15.i121 = icmp eq i8 %10, 0
br i1 %cmp.not15.i121, label %if.then81, label %while.body.i122
while.cond.i126: ; preds = %while.body.i122
%indvars.iv.next.i127 = add nuw i64 %indvars.iv.i123, 1
%arrayidx1.i128 = getelementptr inbounds i8, ptr %new_worm, i64 %indvars.iv.next.i127
%11 = load i8, ptr %arrayidx1.i128, align 1, !tbaa !5
%cmp.not.i129 = icmp eq i8 %11, 0
br i1 %cmp.not.i129, label %if.then81, label %while.body.i122, !llvm.loop !20
while.body.i122: ; preds = %if.end76, %while.cond.i126
%indvars.iv.i123 = phi i64 [ %indvars.iv.next.i127, %while.cond.i126 ], [ 1, %if.end76 ]
%12 = phi i8 [ %11, %while.cond.i126 ], [ %10, %if.end76 ]
%cmp7.not.i124 = icmp eq i8 %12, %9
br i1 %cmp7.not.i124, label %while.cond.i126, label %if.end84
if.then81: ; preds = %if.end76, %while.cond.i126
%13 = load i32, ptr %time92, align 4, !tbaa !8
%add83 = add nsw i32 %13, 1
br label %cleanup
if.end84: ; preds = %while.body.i122
%cmp.not13.i = icmp eq i8 %9, 0
br i1 %cmp.not13.i, label %calc_hash.exit, label %while.body.i131
while.body.i131: ; preds = %if.end84, %sw.epilog.i
%indvars.iv.i132 = phi i64 [ %indvars.iv.next.i133, %sw.epilog.i ], [ 0, %if.end84 ]
%14 = phi i8 [ %15, %sw.epilog.i ], [ %9, %if.end84 ]
%hash.014.i = phi i32 [ %hash.1.i, %sw.epilog.i ], [ 0, %if.end84 ]
%conv.i = sext i8 %14 to i32
%mul.i = mul nsw i32 %hash.014.i, 3
switch i32 %conv.i, label %sw.epilog.i [
i32 98, label %sw.bb5.i
i32 103, label %sw.bb.i
]
sw.bb.i: ; preds = %while.body.i131
%inc.i = add nsw i32 %mul.i, 1
br label %sw.epilog.i
sw.bb5.i: ; preds = %while.body.i131
%add.i = add nsw i32 %mul.i, 2
br label %sw.epilog.i
sw.epilog.i: ; preds = %sw.bb5.i, %sw.bb.i, %while.body.i131
%hash.1.i = phi i32 [ %mul.i, %while.body.i131 ], [ %inc.i, %sw.bb.i ], [ %add.i, %sw.bb5.i ]
%indvars.iv.next.i133 = add nuw nsw i64 %indvars.iv.i132, 1
%arrayidx.i = getelementptr inbounds i8, ptr %new_worm, i64 %indvars.iv.next.i133
%15 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%cmp.not.i134 = icmp eq i8 %15, 0
br i1 %cmp.not.i134, label %calc_hash.exit, label %while.body.i131, !llvm.loop !12
calc_hash.exit: ; preds = %sw.epilog.i, %if.end84
%hash.0.lcssa.i = phi i32 [ 0, %if.end84 ], [ %hash.1.i, %sw.epilog.i ]
%node.05.i = load ptr, ptr @head, align 8, !tbaa !16
%cmp.not6.i = icmp eq ptr %node.05.i, null
br i1 %cmp.not6.i, label %if.then90, label %while.body.i135
while.cond.i136: ; preds = %while.body.i135
%next.i = getelementptr inbounds %struct.NODE, ptr %node.07.i, i64 0, i32 3
%node.0.i = load ptr, ptr %next.i, align 8, !tbaa !16
%cmp.not.i137 = icmp eq ptr %node.0.i, null
br i1 %cmp.not.i137, label %if.then90, label %while.body.i135, !llvm.loop !21
while.body.i135: ; preds = %calc_hash.exit, %while.cond.i136
%node.07.i = phi ptr [ %node.0.i, %while.cond.i136 ], [ %node.05.i, %calc_hash.exit ]
%hash1.i = getelementptr inbounds %struct.NODE, ptr %node.07.i, i64 0, i32 2
%16 = load i32, ptr %hash1.i, align 8, !tbaa !14
%cmp2.i = icmp eq i32 %16, %hash.0.lcssa.i
br i1 %cmp2.i, label %if.end95, label %while.cond.i136
if.then90: ; preds = %while.cond.i136, %calc_hash.exit
%17 = load i32, ptr %time92, align 4, !tbaa !8
%add93 = add nsw i32 %17, 1
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
%call1.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call.i, ptr noundef nonnull dereferenceable(1) %new_worm) #10
%time2.i = getelementptr inbounds %struct.NODE, ptr %call.i, i64 0, i32 1
store i32 %add93, ptr %time2.i, align 4, !tbaa !8
%18 = load i8, ptr %call.i, align 1, !tbaa !5
%cmp.not13.i.i = icmp eq i8 %18, 0
br i1 %cmp.not13.i.i, label %add_node.exit, label %while.body.i.i
while.body.i.i: ; preds = %if.then90, %sw.epilog.i.i
%indvars.iv.i.i = phi i64 [ %indvars.iv.next.i.i, %sw.epilog.i.i ], [ 0, %if.then90 ]
%19 = phi i8 [ %20, %sw.epilog.i.i ], [ %18, %if.then90 ]
%hash.014.i.i = phi i32 [ %hash.1.i.i, %sw.epilog.i.i ], [ 0, %if.then90 ]
%conv.i.i = sext i8 %19 to i32
%mul.i.i = mul nsw i32 %hash.014.i.i, 3
switch i32 %conv.i.i, label %sw.epilog.i.i [
i32 98, label %sw.bb5.i.i
i32 103, label %sw.bb.i.i
]
sw.bb.i.i: ; preds = %while.body.i.i
%inc.i.i = add nsw i32 %mul.i.i, 1
br label %sw.epilog.i.i
sw.bb5.i.i: ; preds = %while.body.i.i
%add.i.i = add nsw i32 %mul.i.i, 2
br label %sw.epilog.i.i
sw.epilog.i.i: ; preds = %sw.bb5.i.i, %sw.bb.i.i, %while.body.i.i
%hash.1.i.i = phi i32 [ %mul.i.i, %while.body.i.i ], [ %inc.i.i, %sw.bb.i.i ], [ %add.i.i, %sw.bb5.i.i ]
%indvars.iv.next.i.i = add nuw nsw i64 %indvars.iv.i.i, 1
%arrayidx.i.i = getelementptr inbounds i8, ptr %call.i, i64 %indvars.iv.next.i.i
%20 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !5
%cmp.not.i.i = icmp eq i8 %20, 0
br i1 %cmp.not.i.i, label %add_node.exit, label %while.body.i.i, !llvm.loop !12
add_node.exit: ; preds = %sw.epilog.i.i, %if.then90
%hash.0.lcssa.i.i = phi i32 [ 0, %if.then90 ], [ %hash.1.i.i, %sw.epilog.i.i ]
%hash6.i = getelementptr inbounds %struct.NODE, ptr %call.i, i64 0, i32 2
store i32 %hash.0.lcssa.i.i, ptr %hash6.i, align 8, !tbaa !14
%next.i139 = getelementptr inbounds %struct.NODE, ptr %call.i, i64 0, i32 3
store ptr null, ptr %next.i139, align 8, !tbaa !15
%next7.i = getelementptr inbounds %struct.NODE, ptr %call.i155158, i64 0, i32 3
%next7.sink.i = select i1 %cmp.not6.i, ptr @head, ptr %next7.i
store ptr %call.i, ptr %next7.sink.i, align 8, !tbaa !16
store ptr %call.i, ptr @tail, align 8
br label %if.end95
if.end95: ; preds = %while.body.i135, %add_node.exit, %while.body
%call.i154 = phi ptr [ %call.i, %add_node.exit ], [ %call.i155158, %while.body ], [ %call.i155158, %while.body.i135 ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [11 x i8], ptr %node, i64 0, i64 %indvars.iv.next
%21 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp2.not = icmp eq i8 %21, 0
%indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
br i1 %cmp2.not, label %cleanup, label %while.body, !llvm.loop !22
cleanup: ; preds = %if.end95, %if.then81, %if.then
%retval.0 = phi i32 [ %4, %if.then ], [ %add83, %if.then81 ], [ -1, %if.end95 ]
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %new_worm) #10
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @calc_hash(ptr nocapture noundef readonly %worm) local_unnamed_addr #6 {
entry:
%0 = load i8, ptr %worm, align 1, !tbaa !5
%cmp.not13 = icmp eq i8 %0, 0
br i1 %cmp.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %sw.epilog
%indvars.iv = phi i64 [ %indvars.iv.next, %sw.epilog ], [ 0, %entry ]
%1 = phi i8 [ %2, %sw.epilog ], [ %0, %entry ]
%hash.014 = phi i32 [ %hash.1, %sw.epilog ], [ 0, %entry ]
%conv = sext i8 %1 to i32
%mul = mul nsw i32 %hash.014, 3
switch i32 %conv, label %sw.epilog [
i32 98, label %sw.bb5
i32 103, label %sw.bb
]
sw.bb: ; preds = %while.body
%inc = add nsw i32 %mul, 1
br label %sw.epilog
sw.bb5: ; preds = %while.body
%add = add nsw i32 %mul, 2
br label %sw.epilog
sw.epilog: ; preds = %while.body, %sw.bb5, %sw.bb
%hash.1 = phi i32 [ %mul, %while.body ], [ %inc, %sw.bb ], [ %add, %sw.bb5 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %worm, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %2, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %sw.epilog, %entry
%hash.0.lcssa = phi i32 [ 0, %entry ], [ %hash.1, %sw.epilog ]
ret i32 %hash.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @check_body(ptr nocapture noundef readonly %worm) local_unnamed_addr #6 {
entry:
%0 = load i8, ptr %worm, align 1, !tbaa !5
%arrayidx114 = getelementptr inbounds i8, ptr %worm, i64 1
%1 = load i8, ptr %arrayidx114, align 1, !tbaa !5
%cmp.not15 = icmp eq i8 %1, 0
br i1 %cmp.not15, label %cleanup, label %while.body
while.cond: ; preds = %while.body
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx1 = getelementptr inbounds i8, ptr %worm, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp.not = icmp eq i8 %2, 0
br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !20
while.body: ; preds = %entry, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 1, %entry ]
%3 = phi i8 [ %2, %while.cond ], [ %1, %entry ]
%cmp7.not = icmp eq i8 %3, %0
br i1 %cmp7.not, label %while.cond, label %cleanup
cleanup: ; preds = %while.body, %while.cond, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %while.cond ], [ 0, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @check_hash(i32 noundef %hash) local_unnamed_addr #7 {
entry:
%node.05 = load ptr, ptr @head, align 8, !tbaa !16
%cmp.not6 = icmp eq ptr %node.05, null
br i1 %cmp.not6, label %cleanup, label %while.body
while.cond: ; preds = %while.body
%next = getelementptr inbounds %struct.NODE, ptr %node.07, i64 0, i32 3
%node.0 = load ptr, ptr %next, align 8, !tbaa !16
%cmp.not = icmp eq ptr %node.0, null
br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !21
while.body: ; preds = %entry, %while.cond
%node.07 = phi ptr [ %node.0, %while.cond ], [ %node.05, %entry ]
%hash1 = getelementptr inbounds %struct.NODE, ptr %node.07, i64 0, i32 2
%0 = load i32, ptr %hash1, align 8, !tbaa !14
%cmp2 = icmp eq i32 %0, %hash
br i1 %cmp2, label %cleanup, label %while.cond
cleanup: ; preds = %while.body, %while.cond, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %while.cond ], [ 0, %while.body ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind }
attributes #10 = { nounwind }
attributes #11 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 12}
!9 = !{!"NODE", !6, i64 0, !10, i64 12, !10, i64 16, !11, i64 24}
!10 = !{!"int", !6, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!9, !10, i64 16}
!15 = !{!9, !11, i64 24}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !13}
!18 = !{!10, !10, i64 0}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
|
#include <stdio.h>
#include <string.h>
#pragma warning(disable : 4996)
int main()
{
int N, K,i;
scanf("%d %d", &N, &K);
int count = K;
for (i = 1; i < N; i++) {
count *= (K - 1);
}
printf("%d", count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290372/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290372/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%N = alloca i32, align 4
%K = 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 %K) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %K, align 4, !tbaa !5
%1 = load i32, ptr %N, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %1, 1
br i1 %cmp4, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub = add nsw i32 %0, -1
%2 = add i32 %1, -1
%min.iters.check = icmp ult i32 %1, 9
br i1 %min.iters.check, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %for.body.lr.ph
%n.vec = and i32 %2, -8
%ind.end = or i32 %n.vec, 1
%3 = insertelement <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, i32 %0, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %sub, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %4, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %5, %vector.body ]
%4 = mul <4 x i32> %vec.phi, %broadcast.splat
%5 = mul <4 x i32> %vec.phi7, %broadcast.splat
%index.next = add nuw i32 %index, 8
%6 = icmp eq i32 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %5, %4
%7 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %2, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.body.lr.ph, %middle.block
%count.06.ph = phi i32 [ %0, %for.body.lr.ph ], [ %7, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.lr.ph ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%count.06 = phi i32 [ %mul, %for.body ], [ %count.06.ph, %for.body.preheader ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader ]
%mul = mul nsw i32 %count.06, %sub
%inc = add nuw nsw i32 %i.05, 1
%exitcond.not = icmp eq i32 %inc, %1
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%count.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %mul, %for.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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}
|
#include<stdio.h>
#include<math.h>
int main()
{
int n,k;
int ans;
scanf("%d %d",&n,&k);
ans = k * pow((k-1),(n-1));
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290415/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290415/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = 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 %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%sub = add nsw i32 %0, -1
%conv1 = sitofp i32 %sub to double
%1 = load i32, ptr %n, align 4, !tbaa !5
%sub2 = add nsw i32 %1, -1
%conv3 = sitofp i32 %sub2 to double
%call4 = call double @pow(double noundef %conv1, double noundef %conv3) #4
%mul = fmul double %call4, %conv
%conv5 = fptosi double %mul to i32
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int N, K;
int i;
int way=1;
scanf("%d%d", &N, &K);
for(i=1; i<=(N-1); i++){
way = way * (K-1);
}
way = way * K;
printf("%d", way);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290459/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290459/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = 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 %K) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not.not7 = icmp sgt i32 %0, 1
%.pre = load i32, ptr %K, align 4, !tbaa !5
br i1 %cmp.not.not7, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub1 = add nsw i32 %.pre, -1
%1 = add i32 %0, -1
%min.iters.check = icmp ult i32 %0, 9
br i1 %min.iters.check, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %for.body.lr.ph
%n.vec = and i32 %1, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %sub1, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %2, %vector.body ]
%vec.phi10 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %3, %vector.body ]
%2 = mul <4 x i32> %broadcast.splat, %vec.phi
%3 = mul <4 x i32> %broadcast.splat, %vec.phi10
%index.next = add nuw i32 %index, 8
%4 = icmp eq i32 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %3, %2
%5 = 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.end, label %for.body.preheader
for.body.preheader: ; preds = %for.body.lr.ph, %middle.block
%way.09.ph = phi i32 [ 1, %for.body.lr.ph ], [ %5, %middle.block ]
%i.08.ph = phi i32 [ 1, %for.body.lr.ph ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%way.09 = phi i32 [ %mul, %for.body ], [ %way.09.ph, %for.body.preheader ]
%i.08 = phi i32 [ %inc, %for.body ], [ %i.08.ph, %for.body.preheader ]
%mul = mul nsw i32 %sub1, %way.09
%inc = add nuw nsw i32 %i.08, 1
%exitcond.not = icmp eq i32 %inc, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%way.0.lcssa = phi i32 [ 1, %entry ], [ %5, %middle.block ], [ %mul, %for.body ]
%mul2 = mul nsw i32 %.pre, %way.0.lcssa
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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}
|
#include<stdio.h>
int main(void){
int i=1,n,k;
scanf("%d%d",&n,&k);
while(n-1){
i*=k-1;
n--;
}
printf("%d",k*i);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290501/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290501/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = 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 %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%tobool.not5 = icmp eq i32 %.pr, 1
%.pre = load i32, ptr %k, align 4, !tbaa !5
br i1 %tobool.not5, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%sub1 = add nsw i32 %.pre, -1
%0 = add i32 %.pr, -1
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %while.body.preheader, label %vector.ph
vector.ph: ; preds = %while.body.lr.ph
%n.vec = and i32 %0, -8
%ind.end = sub i32 %.pr, %n.vec
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %sub1, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %2, %vector.body ]
%1 = mul <4 x i32> %broadcast.splat, %vec.phi
%2 = mul <4 x i32> %broadcast.splat, %vec.phi7
%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 %0, %n.vec
br i1 %cmp.n, label %while.cond.while.end_crit_edge, label %while.body.preheader
while.body.preheader: ; preds = %while.body.lr.ph, %middle.block
%i.06.ph = phi i32 [ 1, %while.body.lr.ph ], [ %4, %middle.block ]
%.ph = phi i32 [ %.pr, %while.body.lr.ph ], [ %ind.end, %middle.block ]
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%i.06 = phi i32 [ %mul, %while.body ], [ %i.06.ph, %while.body.preheader ]
%5 = phi i32 [ %dec, %while.body ], [ %.ph, %while.body.preheader ]
%mul = mul nsw i32 %sub1, %i.06
%dec = add nsw i32 %5, -1
%tobool.not = icmp eq i32 %dec, 1
br i1 %tobool.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !13
while.cond.while.end_crit_edge: ; preds = %while.body, %middle.block
%mul.lcssa = phi i32 [ %4, %middle.block ], [ %mul, %while.body ]
store i32 1, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%i.0.lcssa = phi i32 [ %mul.lcssa, %while.cond.while.end_crit_edge ], [ 1, %entry ]
%mul2 = mul nsw i32 %.pre, %i.0.lcssa
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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}
|
#include <stdio.h>
#include <math.h>
long long ans;
int main(void)
{
int n, k;
scanf("%d %d", &n, &k);
if(n == 1){
printf("%d\n", k);
return 0;
}
ans = k*pow((double)(k-1), (double)(n-1));
printf("%lld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290545/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@ans = dso_local local_unnamed_addr global i64 0, align 8
@.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:
%n = alloca i32, align 4
%k = 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 %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
%1 = load i32, ptr %k, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
br label %cleanup
if.end: ; preds = %entry
%conv = sitofp i32 %1 to double
%sub = add nsw i32 %1, -1
%conv2 = sitofp i32 %sub to double
%sub3 = add nsw i32 %0, -1
%conv4 = sitofp i32 %sub3 to double
%call5 = call double @pow(double noundef %conv2, double noundef %conv4) #4
%mul = fmul double %call5, %conv
%conv6 = fptosi double %mul to i64
store i64 %conv6, ptr @ans, align 8, !tbaa !9
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %conv6)
br label %cleanup
cleanup: ; preds = %if.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
|
#include <stdio.h>
int main(void)
{
int n, k, i, s = 0;
scanf("%d %d", &n, &k);
for (i = 0; i < n; i++) {
if (i == 0) {
s = k;
} else {
s *= (k - 1);
}
}
printf("%d\n", s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290589/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290589/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = 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 %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %k, align 4
%sub = add nsw i32 %1, -1
%exitcond.peel.not = icmp eq i32 %0, 1
br i1 %exitcond.peel.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.body.lr.ph
%2 = add i32 %0, -1
%min.iters.check = icmp ult i32 %0, 9
br i1 %min.iters.check, label %for.body.preheader11, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %2, -8
%ind.end = or i32 %n.vec, 1
%3 = insertelement <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, i32 %1, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %sub, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %4, %vector.body ]
%vec.phi10 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %5, %vector.body ]
%4 = mul <4 x i32> %broadcast.splat, %vec.phi
%5 = mul <4 x i32> %broadcast.splat, %vec.phi10
%index.next = add nuw i32 %index, 8
%6 = icmp eq i32 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %5, %4
%7 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %2, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader11
for.body.preheader11: ; preds = %for.body.preheader, %middle.block
%s.08.ph = phi i32 [ %1, %for.body.preheader ], [ %7, %middle.block ]
%i.07.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader11, %for.body
%s.08 = phi i32 [ %mul, %for.body ], [ %s.08.ph, %for.body.preheader11 ]
%i.07 = phi i32 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader11 ]
%mul = mul nsw i32 %sub, %s.08
%inc = add nuw nsw i32 %i.07, 1
%exitcond.not = icmp eq i32 %inc, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14
for.end: ; preds = %for.body, %middle.block, %for.body.lr.ph, %entry
%s.0.lcssa = phi i32 [ 0, %entry ], [ %1, %for.body.lr.ph ], [ %7, %middle.block ], [ %mul, %for.body ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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, !13}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !11, !13, !12}
|
# include"stdio.h"
int main(){
int x;
scanf("%d",&x);
if(x<1200) printf("ABC\n");
else printf("ARC\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290631/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290631/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ARC\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"ABC\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 slt i32 %0, 1200
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 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 x;
scanf("%d",&x);
if(x>=1200) printf("ARC");
else printf("ABC");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290675/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290675/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ARC\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"ABC\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) #3
%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 sgt i32 %0, 1199
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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"}
|
#include<stdio.h>
int main() {
int rating;
scanf("%d",&rating);fflush(stdin);
if (rating < 1200) printf("ABC");
else printf("ARC");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290718/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290718/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [4 x i8] c"ABC\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%rating = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %rating) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %rating)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call1 = call i32 @fflush(ptr noundef %0)
%1 = load i32, ptr %rating, align 4, !tbaa !9
%cmp = icmp slt i32 %1, 1200
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %rating) #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 @fflush(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include <stdio.h>
int main()
{
int x;
scanf("%d", &x);
if (x < 1200) {
printf("ABC\n");
} else {
printf("ARC\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290769/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290769/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ARC\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"ABC\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 slt i32 %0, 1200
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a;
scanf("%d",&a);
if(a<1200) printf("ABC");
else printf("ARC");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290811/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290811/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ABC\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 1200
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main(void){
int x;
scanf("%d",&x);
if(x < 1 || 3000 < x){
printf("存在しません\n");
exit(0);
}else if(x < 1200){
printf("ABC\n");
}else if(x <= 3000){
printf("ARC\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290855/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290855/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ARC\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"ABC\00", align 1
@str.5 = private unnamed_addr constant [19 x i8] c"\E5\AD\98\E5\9C\A8\E3\81\97\E3\81\BE\E3\81\9B\E3\82\93\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4
%1 = add i32 %0, -3001
%or.cond = icmp ult i32 %1, -3000
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%puts13 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
call void @exit(i32 noundef 0) #6
unreachable
if.else: ; preds = %entry
%cmp3 = icmp ult i32 %0, 1200
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(void)
{
int x;
scanf("%d", &x);
if ( x >= 1 && x <= 3000 )
{
if ( x < 1200)
{
printf("ABC");
}else{
printf("ARC");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290899/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290899/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ABC\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"ARC\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) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 3000
br i1 %or.cond, label %if.then, label %if.end6
if.then: ; preds = %entry
%cmp2 = icmp ult i32 %0, 1200
%.str.1..str.2 = select i1 %cmp2, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
br label %if.end6
if.end6: ; preds = %if.then, %entry
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)"}
|
#include <stdio.h>
#include <stdlib.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
ll x[99],y[99],z[99],r[99],s[99];
int main(){
ll n,q;
scanf("%lld%lld",&n,&q);
rep(i,0,n)scanf("%lld%lld%lld%lld%lld",x+i,y+i,z+i,r+i,s+i);
while(q--){
ll a,b,c,d,e,f;
scanf("%lld%lld%lld%lld%lld%lld",&a,&b,&c,&d,&e,&f);
d-=a;e-=b;f-=c;//平行移動して
ll ss=(d*d+e*e+f*f);
ll ans=0;
rep(i,0,n){
ll xx=x[i]-a;
ll yy=y[i]-b;
ll zz=z[i]-c;
ll coe=(xx*d+yy*e+zz*f);//射影して引く
ll xxx=xx*ss-coe*d;
ll yyy=yy*ss-coe*e;
ll zzz=zz*ss-coe*f;
// printf("%lld %lld\n",coe,xxx*xxx+yyy*yyy+zzz*zzz);
if(0<=coe&&coe<=ss){
if(xxx*xxx+yyy*yyy+zzz*zzz<=r[i]*r[i]*ss*ss)ans+=s[i];
}
}
printf("%lld\n",ans);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_290941/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_290941/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [21 x i8] c"%lld%lld%lld%lld%lld\00", align 1
@x = dso_local global [99 x i64] zeroinitializer, align 16
@y = dso_local global [99 x i64] zeroinitializer, align 16
@z = dso_local global [99 x i64] zeroinitializer, align 16
@r = dso_local global [99 x i64] zeroinitializer, align 16
@s = dso_local global [99 x i64] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [25 x i8] c"%lld%lld%lld%lld%lld%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 i64, align 8
%q = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
%d = alloca i64, align 8
%e = alloca i64, align 8
%f = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp86 = icmp sgt i64 %0, 0
br i1 %cmp86, label %for.body, label %while.cond.preheader
while.cond.preheader: ; preds = %for.body, %entry
%1 = load i64, ptr %q, align 8, !tbaa !5
%dec91 = add nsw i64 %1, -1
store i64 %dec91, ptr %q, align 8, !tbaa !5
%tobool.not92 = icmp eq i64 %1, 0
br i1 %tobool.not92, label %while.end, label %while.body
for.body: ; preds = %entry, %for.body
%i.087 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i64, ptr @x, i64 %i.087
%add.ptr1 = getelementptr inbounds i64, ptr @y, i64 %i.087
%add.ptr2 = getelementptr inbounds i64, ptr @z, i64 %i.087
%add.ptr3 = getelementptr inbounds i64, ptr @r, i64 %i.087
%add.ptr4 = getelementptr inbounds i64, ptr @s, i64 %i.087
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr, ptr noundef nonnull %add.ptr1, ptr noundef nonnull %add.ptr2, ptr noundef nonnull %add.ptr3, ptr noundef nonnull %add.ptr4)
%inc = add nuw nsw i64 %i.087, 1
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %2
br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9
while.body: ; preds = %while.cond.preheader, %for.cond.cleanup15
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 %d) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %f) #3
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %f)
%3 = load i64, ptr %a, align 8, !tbaa !5
%4 = load i64, ptr %d, align 8, !tbaa !5
%sub = sub nsw i64 %4, %3
store i64 %sub, ptr %d, align 8, !tbaa !5
%5 = load i64, ptr %b, align 8, !tbaa !5
%6 = load i64, ptr %e, align 8, !tbaa !5
%sub7 = sub nsw i64 %6, %5
store i64 %sub7, ptr %e, align 8, !tbaa !5
%7 = load i64, ptr %c, align 8, !tbaa !5
%8 = load i64, ptr %f, align 8, !tbaa !5
%sub8 = sub nsw i64 %8, %7
store i64 %sub8, ptr %f, align 8, !tbaa !5
%mul = mul nsw i64 %sub, %sub
%mul9 = mul nsw i64 %sub7, %sub7
%add = add nuw nsw i64 %mul9, %mul
%mul10 = mul nsw i64 %sub8, %sub8
%add11 = add nuw nsw i64 %add, %mul10
%9 = load i64, ptr %n, align 8, !tbaa !5
%cmp1488 = icmp sgt i64 %9, 0
br i1 %cmp1488, label %for.body16, label %for.cond.cleanup15
for.cond.cleanup15: ; preds = %if.end52, %while.body
%ans.0.lcssa = phi i64 [ 0, %while.body ], [ %ans.1, %if.end52 ]
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %f) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #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
%10 = load i64, ptr %q, align 8, !tbaa !5
%dec = add nsw i64 %10, -1
store i64 %dec, ptr %q, align 8, !tbaa !5
%tobool.not = icmp eq i64 %10, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
for.body16: ; preds = %while.body, %if.end52
%ans.090 = phi i64 [ %ans.1, %if.end52 ], [ 0, %while.body ]
%i12.089 = phi i64 [ %inc54, %if.end52 ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [99 x i64], ptr @x, i64 0, i64 %i12.089
%11 = load i64, ptr %arrayidx, align 8, !tbaa !5
%sub17 = sub nsw i64 %11, %3
%arrayidx18 = getelementptr inbounds [99 x i64], ptr @y, i64 0, i64 %i12.089
%12 = load i64, ptr %arrayidx18, align 8, !tbaa !5
%sub19 = sub nsw i64 %12, %5
%arrayidx20 = getelementptr inbounds [99 x i64], ptr @z, i64 0, i64 %i12.089
%13 = load i64, ptr %arrayidx20, align 8, !tbaa !5
%sub21 = sub nsw i64 %13, %7
%mul22 = mul nsw i64 %sub17, %sub
%mul23 = mul nsw i64 %sub19, %sub7
%add24 = add nsw i64 %mul23, %mul22
%mul25 = mul nsw i64 %sub21, %sub8
%add26 = add nsw i64 %add24, %mul25
%cmp36 = icmp slt i64 %add26, 0
%cmp37.not = icmp sgt i64 %add26, %add11
%or.cond = select i1 %cmp36, i1 true, i1 %cmp37.not
br i1 %or.cond, label %if.end52, label %if.then
if.then: ; preds = %for.body16
%mul33 = mul nsw i64 %sub21, %add11
%mul34 = mul nsw i64 %add26, %sub8
%sub35 = sub nsw i64 %mul33, %mul34
%mul30 = mul nsw i64 %sub19, %add11
%mul31 = mul nsw i64 %add26, %sub7
%sub32 = sub nsw i64 %mul30, %mul31
%mul27 = mul nsw i64 %sub17, %add11
%mul28 = mul nsw i64 %add26, %sub
%sub29 = sub nsw i64 %mul27, %mul28
%mul38 = mul nsw i64 %sub29, %sub29
%mul39 = mul nsw i64 %sub32, %sub32
%add40 = add nuw nsw i64 %mul38, %mul39
%mul41 = mul nsw i64 %sub35, %sub35
%add42 = add nuw nsw i64 %add40, %mul41
%arrayidx43 = getelementptr inbounds [99 x i64], ptr @r, i64 0, i64 %i12.089
%14 = load i64, ptr %arrayidx43, align 8, !tbaa !5
%15 = mul i64 %14, %add11
%16 = mul i64 %15, %15
%cmp48.not = icmp ugt i64 %add42, %16
br i1 %cmp48.not, label %if.end52, label %if.then49
if.then49: ; preds = %if.then
%arrayidx50 = getelementptr inbounds [99 x i64], ptr @s, i64 0, i64 %i12.089
%17 = load i64, ptr %arrayidx50, align 8, !tbaa !5
%add51 = add nsw i64 %17, %ans.090
br label %if.end52
if.end52: ; preds = %if.then, %if.then49, %for.body16
%ans.1 = phi i64 [ %add51, %if.then49 ], [ %ans.090, %if.then ], [ %ans.090, %for.body16 ]
%inc54 = add nuw nsw i64 %i12.089, 1
%exitcond.not = icmp eq i64 %inc54, %9
br i1 %exitcond.not, label %for.cond.cleanup15, label %for.body16, !llvm.loop !12
while.end: ; preds = %for.cond.cleanup15, %while.cond.preheader
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main()
{
int i, sum = 700;
char s[3];
scanf("%s", s);
for (i = 0; i < 3; i++)
{
if (s[i] == 'o')
sum += 100;
}
printf("%d", sum);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291027/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291027/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%cmp1 = icmp eq i8 %0, 111
%spec.select = select i1 %cmp1, i32 800, i32 700
%arrayidx.1 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 111
%add.1 = add nuw nsw i32 %spec.select, 100
%spec.select.1 = select i1 %cmp1.1, i32 %add.1, i32 %spec.select
%arrayidx.2 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 111
%add.2 = add nuw nsw i32 %spec.select.1, 100
%spec.select.2 = select i1 %cmp1.2, i32 %add.2, i32 %spec.select.1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.2)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
char s[4];
int y=700;
scanf("%s", s);
if(s[0]=='o') y+=100;
if(s[1]=='o') y+=100;
if(s[2]=='o') y+=100;
printf("%d\n", y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291070/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291070/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 111
%spec.select = select i1 %cmp, i32 800, i32 700
%arrayidx2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp4 = icmp eq i8 %1, 111
%add7 = add nuw nsw i32 %spec.select, 100
%y.1 = select i1 %cmp4, i32 %add7, i32 %spec.select
%arrayidx9 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%cmp11 = icmp eq i8 %2, 111
%add14 = add nuw nsw i32 %y.1, 100
%y.2 = select i1 %cmp11, i32 %add14, i32 %y.1
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int i,x,y;
char S[3];
x=700;
for(i=0; i<3; i++){
scanf("%c",&S[i]);
if(S[i]=='o'){
y+=100;
}
else{
x=x;
}
}
printf("%d\n",x+y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291120/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291120/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%arrayidx.1 = getelementptr inbounds [3 x i8], ptr %S, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [3 x i8], ptr %S, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef undef)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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(){
char s[5];
scanf("%s", s);
int p = 700;
for(int i = 0; i < 3; i++){
if(s[i] == 'o'){
p += 100;
}
}
printf("%d", p);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291164/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291164/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, 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
%cmp1 = icmp eq i8 %0, 111
%spec.select = select i1 %cmp1, i32 800, i32 700
%arrayidx.1 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 111
%add.1 = add nuw nsw i32 %spec.select, 100
%spec.select.1 = select i1 %cmp1.1, i32 %add.1, i32 %spec.select
%arrayidx.2 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 111
%add.2 = add nuw nsw i32 %spec.select.1, 100
%spec.select.2 = select i1 %cmp1.2, i32 %add.2, i32 %spec.select.1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.2)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
char input[3];
int price = 700;
for(int i = 0; i < 3; i++){
scanf("%c", &input[i]);
if(input[i] == 'o') price += 100;
}
printf("%d", price);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291207/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291207/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%input = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %input) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%0 = load i8, ptr %input, align 1, !tbaa !5
%cmp3 = icmp eq i8 %0, 111
%spec.select = select i1 %cmp3, i32 800, i32 700
%arrayidx.1 = getelementptr inbounds [3 x i8], ptr %input, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp3.1 = icmp eq i8 %1, 111
%add.1 = add nuw nsw i32 %spec.select, 100
%spec.select.1 = select i1 %cmp3.1, i32 %add.1, i32 %spec.select
%arrayidx.2 = getelementptr inbounds [3 x i8], ptr %input, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%cmp3.2 = icmp eq i8 %2, 111
%add.2 = add nuw nsw i32 %spec.select.1, 100
%spec.select.2 = select i1 %cmp3.2, i32 %add.2, i32 %spec.select.1
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.2)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %input) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(){
int n,i,j,k;
char s[260],c[260];
scanf("%d",&n);
fgets(s,260,stdin);
while(n--){
fgets(s,260,stdin);
for(i=1;1;i+=2){
if(i%13==0)continue;//printf("%d\n",i);
for(j=0;j<26;j++){
for(k=0;s[k];k++){
if('a'<=s[k]&&s[k]<='z')c[k]=((s[k]-'a')*i+j)%26+'a';
else c[k]=s[k];
}
c[k]=0;
if(strstr(c,"that")||strstr(c,"this"))break;
}
if(j-26)break;
}
printf("%s",c);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291250/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291250/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [5 x i8] c"that\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"this\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [260 x i8], align 16
%c = alloca [260 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call1 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 260, ptr noundef %0)
%1 = load i32, ptr %n, align 4, !tbaa !9
%dec72 = add nsw i32 %1, -1
store i32 %dec72, ptr %n, align 4, !tbaa !9
%tobool.not73 = icmp eq i32 %1, 0
br i1 %tobool.not73, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end52
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call3 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 260, ptr noundef %2)
%3 = load i8, ptr %s, align 16
%.fr = freeze i8 %3
%tobool8.not68 = icmp eq i8 %.fr, 0
br i1 %tobool8.not68, label %for.cond.us, label %for.cond
for.cond.us: ; preds = %while.body, %for.inc50.us
%i.0.us = phi i32 [ %add51.us, %for.inc50.us ], [ 1, %while.body ]
%rem.us = urem i32 %i.0.us, 13
%cmp.us = icmp eq i32 %rem.us, 0
br i1 %cmp.us, label %for.inc50.us, label %for.cond7.preheader.us.us
for.inc50.us: ; preds = %for.inc43.us.us, %for.end45.split.us.us, %for.cond.us
%add51.us = add nuw nsw i32 %i.0.us, 2
br label %for.cond.us
for.cond7.preheader.us.us: ; preds = %for.cond.us, %for.inc43.us.us
%j.071.us.us = phi i32 [ %inc44.us.us, %for.inc43.us.us ], [ 0, %for.cond.us ]
store i8 0, ptr %c, align 16, !tbaa !11
%call36.us.us = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %c, ptr noundef nonnull dereferenceable(1) @.str.1) #5
%tobool37.not.us.us = icmp eq ptr %call36.us.us, null
br i1 %tobool37.not.us.us, label %lor.lhs.false.us.us, label %for.end45.split.us.us
lor.lhs.false.us.us: ; preds = %for.cond7.preheader.us.us
%call39.us.us = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %c, ptr noundef nonnull dereferenceable(1) @.str.2) #5
%tobool40.not.us.us = icmp eq ptr %call39.us.us, null
br i1 %tobool40.not.us.us, label %for.inc43.us.us, label %for.end45.split.us.us
for.inc43.us.us: ; preds = %lor.lhs.false.us.us
%inc44.us.us = add nuw nsw i32 %j.071.us.us, 1
%exitcond75.not = icmp eq i32 %inc44.us.us, 26
br i1 %exitcond75.not, label %for.inc50.us, label %for.cond7.preheader.us.us, !llvm.loop !12
for.end45.split.us.us: ; preds = %lor.lhs.false.us.us, %for.cond7.preheader.us.us
%tobool47.not.us = icmp eq i32 %j.071.us.us, 26
br i1 %tobool47.not.us, label %for.inc50.us, label %for.end52
for.cond: ; preds = %while.body, %for.inc50
%i.0 = phi i32 [ %add51, %for.inc50 ], [ 1, %while.body ]
%rem = urem i32 %i.0, 13
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %for.inc50, label %for.cond7.preheader
for.cond7.preheader: ; preds = %for.cond, %for.inc43
%j.071 = phi i32 [ %inc44, %for.inc43 ], [ 0, %for.cond ]
br label %for.body9
for.body9: ; preds = %for.cond7.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.cond7.preheader ], [ %indvars.iv.next, %for.inc ]
%4 = phi i8 [ %.fr, %for.cond7.preheader ], [ %8, %for.inc ]
%5 = add i8 %4, -97
%or.cond = icmp ult i8 %5, 26
br i1 %or.cond, label %if.then19, label %for.inc
if.then19: ; preds = %for.body9
%conv = zext i8 %4 to i32
%sub = add nsw i32 %conv, -97
%mul = mul nsw i32 %sub, %i.0
%add = add nsw i32 %mul, %j.071
%rem23 = srem i32 %add, 26
%6 = trunc i32 %rem23 to i8
%conv25 = add nsw i8 %6, 97
br label %for.inc
for.inc: ; preds = %for.body9, %if.then19
%.sink = phi i8 [ %conv25, %if.then19 ], [ %4, %for.body9 ]
%7 = getelementptr inbounds [260 x i8], ptr %c, i64 0, i64 %indvars.iv
store i8 %.sink, ptr %7, align 1
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [260 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%8 = load i8, ptr %arrayidx, align 1, !tbaa !11
%tobool8.not = icmp eq i8 %8, 0
br i1 %tobool8.not, label %for.cond7.for.end_crit_edge, label %for.body9, !llvm.loop !14
for.cond7.for.end_crit_edge: ; preds = %for.inc
%arrayidx34 = getelementptr inbounds [260 x i8], ptr %c, i64 0, i64 %indvars.iv.next
store i8 0, ptr %arrayidx34, align 1, !tbaa !11
%call36 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %c, ptr noundef nonnull dereferenceable(1) @.str.1) #5
%tobool37.not = icmp eq ptr %call36, null
br i1 %tobool37.not, label %lor.lhs.false, label %for.end45.split
lor.lhs.false: ; preds = %for.cond7.for.end_crit_edge
%call39 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %c, ptr noundef nonnull dereferenceable(1) @.str.2) #5
%tobool40.not = icmp eq ptr %call39, null
br i1 %tobool40.not, label %for.inc43, label %for.end45.split
for.inc43: ; preds = %lor.lhs.false
%inc44 = add nuw nsw i32 %j.071, 1
%exitcond.not = icmp eq i32 %inc44, 26
br i1 %exitcond.not, label %for.inc50, label %for.cond7.preheader, !llvm.loop !12
for.end45.split: ; preds = %for.cond7.for.end_crit_edge, %lor.lhs.false
%tobool47.not = icmp eq i32 %j.071, 26
br i1 %tobool47.not, label %for.inc50, label %for.end52
for.inc50: ; preds = %for.inc43, %for.end45.split, %for.cond
%add51 = add nuw nsw i32 %i.0, 2
br label %for.cond
for.end52: ; preds = %for.end45.split, %for.end45.split.us.us
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %c)
%9 = load i32, ptr %n, align 4, !tbaa !9
%dec = add nsw i32 %9, -1
store i32 %dec, ptr %n, align 4, !tbaa !9
%tobool.not = icmp eq i32 %9, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %for.end52, %entry
call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %s) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
|
#include<stdio.h>
#define max(a,b) ((a)>(b) ? (a):(b))
int dp[101][20000];
int main(void){
int n,w;
int V[101],W[101];
int i,j;
scanf("%d%d",&n,&w);
for(i=1;i<=n;i++){
scanf("%d%d",&V[i],&W[i]);
}
for(i=1;i<=n;i++){
for(j=0;j<=w;j++){
dp[i][j]=max(dp[i][j],dp[i-1][j]);
dp[i][j+W[i]]=max(dp[i-1][j]+V[i],dp[i-1][j+W[i]]);
// printf("dp[%d][%d]=%d\n",i,j+W[i],dp[i][j+W[i]]);
}
}
printf("%d\n",dp[n][w]);
// printf("dp[3][3]=%d\n",dp[3][3]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291308/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291308/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@dp = dso_local local_unnamed_addr global [101 x [20000 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%w = alloca i32, align 4
%V = alloca [101 x i32], align 16
%W = alloca [101 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 %w) #4
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %V) #4
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %W) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %w)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not120 = icmp slt i32 %0, 1
br i1 %cmp.not120, label %for.cond4.preheader.thread, label %for.body
for.cond4.preheader.thread: ; preds = %entry
%.pre141 = load i32, ptr %w, align 4, !tbaa !5
br label %for.end80
for.cond4.preheader: ; preds = %for.body
%cmp5.not124 = icmp slt i32 %7, 1
%.pre = load i32, ptr %w, align 4, !tbaa !5
%cmp8.not122 = icmp slt i32 %.pre, 0
%or.cond = select i1 %cmp5.not124, i1 true, i1 %cmp8.not122
br i1 %or.cond, label %for.end80, label %for.cond7.preheader.preheader
for.cond7.preheader.preheader: ; preds = %for.cond4.preheader
%1 = add i32 %.pre, 1
%2 = add nuw i32 %7, 1
%wide.trip.count137 = zext i32 %2 to i64
%wide.trip.count = zext i32 %1 to i64
%3 = shl nuw nsw i64 %wide.trip.count, 2
%min.iters.check = icmp ult i32 %1, 20
%4 = getelementptr i8, ptr @dp, i64 %3
%5 = getelementptr i8, ptr @dp, i64 %3
%6 = getelementptr i8, ptr %5, i64 80000
%bound1152 = icmp ugt ptr %6, @dp
%n.vec = and i64 %wide.trip.count, 4294967292
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br label %for.cond7.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %V, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [101 x i32], ptr %W, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%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.not.not = icmp slt i64 %indvars.iv, %8
br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond7.preheader: ; preds = %for.cond7.preheader.preheader, %for.cond7.for.inc78_crit_edge
%indvar = phi i64 [ 0, %for.cond7.preheader.preheader ], [ %indvar.next, %for.cond7.for.inc78_crit_edge ]
%indvars.iv133 = phi i64 [ 1, %for.cond7.preheader.preheader ], [ %indvars.iv.next134, %for.cond7.for.inc78_crit_edge ]
%9 = add nsw i64 %indvars.iv133, -1
%arrayidx38 = getelementptr inbounds [101 x i32], ptr %V, i64 0, i64 %indvars.iv133
%10 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%arrayidx43 = getelementptr inbounds [101 x i32], ptr %W, i64 0, i64 %indvars.iv133
%11 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%12 = sext i32 %11 to i64
br i1 %min.iters.check, label %for.body9.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.cond7.preheader
%13 = mul nuw nsw i64 %indvar, 80000
%scevgep148 = getelementptr i8, ptr %4, i64 %13
%scevgep147 = getelementptr i8, ptr @dp, i64 %13
%scevgep144 = getelementptr i8, ptr %6, i64 %13
%gep = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 80000), i64 %13
%14 = shl nsw i64 %12, 2
%scevgep145 = getelementptr i8, ptr %gep, i64 %14
%scevgep146 = getelementptr i8, ptr %scevgep144, i64 %14
%scevgep149 = getelementptr i8, ptr %scevgep147, i64 %14
%scevgep150 = getelementptr i8, ptr %scevgep148, i64 %14
%bound0 = icmp ult ptr %gep, %scevgep146
%bound1 = icmp ult ptr %scevgep145, %scevgep144
%found.conflict = and i1 %bound0, %bound1
%bound0151 = icmp ult ptr %gep, %scevgep148
%found.conflict153 = and i1 %bound0151, %bound1152
%conflict.rdx = or i1 %found.conflict, %found.conflict153
%bound0154 = icmp ult ptr %gep, %scevgep150
%bound1155 = icmp ult ptr %scevgep149, %scevgep144
%found.conflict156 = and i1 %bound0154, %bound1155
%conflict.rdx157 = or i1 %conflict.rdx, %found.conflict156
%bound0158 = icmp ult ptr %scevgep145, %scevgep148
%bound1159 = icmp ult ptr %scevgep147, %scevgep146
%found.conflict160 = and i1 %bound0158, %bound1159
%conflict.rdx165 = or i1 %conflict.rdx157, %found.conflict160
br i1 %conflict.rdx165, label %for.body9.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %10, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%15 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %indvars.iv133, i64 %index
%wide.load = load <4 x i32>, ptr %15, align 16, !tbaa !5, !alias.scope !11, !noalias !14
%16 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %9, i64 %index
%wide.load166 = load <4 x i32>, ptr %16, align 16, !tbaa !5, !alias.scope !18
%17 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %wide.load166)
store <4 x i32> %17, ptr %15, align 16, !tbaa !5, !alias.scope !11, !noalias !14
%18 = add nsw <4 x i32> %broadcast.splat, %wide.load166
%19 = add nsw i64 %index, %12
%20 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %9, i64 %19
%wide.load167 = load <4 x i32>, ptr %20, align 4, !tbaa !5, !alias.scope !19
%21 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %18, <4 x i32> %wide.load167)
%22 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %indvars.iv133, i64 %19
store <4 x i32> %21, ptr %22, align 4, !tbaa !5, !alias.scope !20, !noalias !21
%index.next = add nuw i64 %index, 4
%23 = icmp eq i64 %index.next, %n.vec
br i1 %23, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond7.for.inc78_crit_edge, label %for.body9.preheader
for.body9.preheader: ; preds = %vector.memcheck, %for.cond7.preheader, %middle.block
%indvars.iv129.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.cond7.preheader ], [ %n.vec, %middle.block ]
br label %for.body9
for.body9: ; preds = %for.body9.preheader, %for.body9
%indvars.iv129 = phi i64 [ %indvars.iv.next130, %for.body9 ], [ %indvars.iv129.ph, %for.body9.preheader ]
%arrayidx13 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %indvars.iv133, i64 %indvars.iv129
%24 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%arrayidx17 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %9, i64 %indvars.iv129
%25 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %24, i32 %25)
store i32 %., ptr %arrayidx13, align 4, !tbaa !5
%add = add nsw i32 %10, %25
%26 = add nsw i64 %indvars.iv129, %12
%arrayidx46 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %9, i64 %26
%27 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%cond67 = call i32 @llvm.smax.i32(i32 %add, i32 %27)
%arrayidx74 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %indvars.iv133, i64 %26
store i32 %cond67, ptr %arrayidx74, align 4, !tbaa !5
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%exitcond.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count
br i1 %exitcond.not, label %for.cond7.for.inc78_crit_edge, label %for.body9, !llvm.loop !25
for.cond7.for.inc78_crit_edge: ; preds = %for.body9, %middle.block
%indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
%exitcond138.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count137
%indvar.next = add i64 %indvar, 1
br i1 %exitcond138.not, label %for.end80, label %for.cond7.preheader, !llvm.loop !26
for.end80: ; preds = %for.cond7.for.inc78_crit_edge, %for.cond4.preheader.thread, %for.cond4.preheader
%.pre143 = phi i32 [ %.pre141, %for.cond4.preheader.thread ], [ %.pre, %for.cond4.preheader ], [ %.pre, %for.cond7.for.inc78_crit_edge ]
%.lcssa142 = phi i32 [ %0, %for.cond4.preheader.thread ], [ %7, %for.cond4.preheader ], [ %7, %for.cond7.for.inc78_crit_edge ]
%idxprom81 = sext i32 %.lcssa142 to i64
%idxprom83 = sext i32 %.pre143 to i64
%arrayidx84 = getelementptr inbounds [101 x [20000 x i32]], ptr @dp, i64 0, i64 %idxprom81, i64 %idxprom83
%28 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%call85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %28)
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %V) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <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 = !{!12}
!12 = distinct !{!12, !13}
!13 = distinct !{!13, !"LVerDomain"}
!14 = !{!15, !16, !17}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = !{!16}
!19 = !{!17}
!20 = !{!15}
!21 = !{!16, !17}
!22 = distinct !{!22, !10, !23, !24}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !10, !23}
!26 = distinct !{!26, !10}
|
#include<stdio.h>
#include<limits.h>
#define MAX_N 100001
struct pair{int first,second;};
int n;
struct pair dat[2*MAX_N-1];
int add(int k,int a){
k+=n-1;
dat[k].first+=a;
while(k>0){
k=(k-1)/2;
if(dat[k*2+1].first>dat[k*2+2].first)dat[k]=dat[k*2+1];
else if(dat[k*2+1].first==dat[k*2+2].first){
if(dat[k*2+1].second<dat[k*2+2].second)dat[k]=dat[k*2+1];
else dat[k]=dat[k*2+2];
}
else dat[k]=dat[k*2+2];
}
}
void init(){
int i;
for(i=0;i<n;i++){
struct pair p;
p.first=0;
p.second=i;
dat[i+n-1]=p;
}
for(i=0;i<n;i++)add(i,0);
}
int cnt[100001];
int main(void){
int r,l,now=0,pre=0,i;
scanf("%d %d %d",&n,&r,&l);
init();
while(r--){
int d,t,x;
scanf("%d %d %d",&d,&t,&x);
cnt[now]+=t-pre;
pre=t;
add(d-1,x);
now=dat[0].second;
}
cnt[now]+=l-pre;
int ans=0,p=0;
for(i=0;i<n;i++)if(p<cnt[i])p=cnt[i],ans=i;
printf("%d\n",ans+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291351/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291351/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.pair = type { i32, i32 }
@n = dso_local global i32 0, align 4
@dat = dso_local local_unnamed_addr global [200001 x %struct.pair] zeroinitializer, align 16
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@cnt = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @add(i32 noundef %k, i32 noundef %a) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%sub = add i32 %k, -1
%add = add i32 %sub, %0
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 8, !tbaa !9
%add1 = add nsw i32 %1, %a
store i32 %add1, ptr %arrayidx, align 8, !tbaa !9
%cmp83 = icmp sgt i32 %add, 0
br i1 %cmp83, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end63
%k.addr.084 = phi i32 [ %div82, %if.end63 ], [ %add, %entry ]
%sub2 = add nsw i32 %k.addr.084, -1
%div82 = lshr i32 %sub2, 1
%mul = and i32 %sub2, -2
%add3 = or i32 %sub2, 1
%idxprom4 = zext i32 %add3 to i64
%arrayidx5 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom4
%2 = load i32, ptr %arrayidx5, align 8, !tbaa !9
%add8 = add nuw nsw i32 %mul, 2
%idxprom9 = zext i32 %add8 to i64
%arrayidx10 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom9
%3 = load i32, ptr %arrayidx10, align 16, !tbaa !9
%cmp12 = icmp sgt i32 %2, %3
br i1 %cmp12, label %if.then, label %if.else
if.then: ; preds = %while.body
%idxprom13 = zext i32 %div82 to i64
%arrayidx14 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom13
%4 = load i64, ptr %arrayidx5, align 8
store i64 %4, ptr %arrayidx14, align 8
br label %if.end63
if.else: ; preds = %while.body
%cmp29 = icmp eq i32 %2, %3
br i1 %cmp29, label %if.then30, label %if.else55
if.then30: ; preds = %if.else
%second = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom4, i32 1
%5 = load i32, ptr %second, align 4, !tbaa !11
%second39 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom9, i32 1
%6 = load i32, ptr %second39, align 4, !tbaa !11
%cmp40 = icmp slt i32 %5, %6
%idxprom42 = zext i32 %div82 to i64
%arrayidx43 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom42
br i1 %cmp40, label %if.then41, label %if.else48
if.then41: ; preds = %if.then30
%7 = load i64, ptr %arrayidx5, align 8
store i64 %7, ptr %arrayidx43, align 8
br label %if.end63
if.else48: ; preds = %if.then30
%8 = load i64, ptr %arrayidx10, align 16
store i64 %8, ptr %arrayidx43, align 8
br label %if.end63
if.else55: ; preds = %if.else
%idxprom56 = zext i32 %div82 to i64
%arrayidx57 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom56
%9 = load i64, ptr %arrayidx10, align 16
store i64 %9, ptr %arrayidx57, align 8
br label %if.end63
if.end63: ; preds = %if.else55, %if.else48, %if.then41, %if.then
%cmp.not = icmp ult i32 %sub2, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %if.end63, %entry
ret i32 undef
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %0, 0
br i1 %cmp13, label %for.body.lr.ph, label %for.end6
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %0, -1
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 36
br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %for.body.lr.ph
%1 = add nsw i64 %wide.trip.count, -1
%2 = add i32 %0, -1
%3 = trunc i64 %1 to i32
%4 = add i32 %2, %3
%5 = icmp slt i32 %4, %2
%6 = icmp ugt i64 %1, 4294967295
%7 = or i1 %5, %6
%8 = sext i32 %2 to i64
%9 = shl nsw i64 %8, 3
%scevgep = getelementptr i8, ptr @dat, i64 %9
%mul.result = shl nsw i64 %1, 3
%10 = getelementptr i8, ptr %scevgep, i64 %mul.result
%11 = icmp ult ptr %10, %scevgep
%12 = or i64 %9, 4
%scevgep19 = getelementptr i8, ptr @dat, i64 %12
%mul.result21 = shl nsw i64 %1, 3
%13 = getelementptr i8, ptr %scevgep19, i64 %mul.result21
%14 = icmp ult ptr %13, %scevgep19
%15 = or i1 %11, %7
%16 = or i1 %14, %15
br i1 %16, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%offset.idx = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
%17 = trunc i64 %offset.idx to i32
%18 = or i32 %17, 2
%19 = add i32 %add, %17
%20 = add i32 %add, %18
%21 = sext i32 %19 to i64
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %21
%24 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %22
%interleaved.vec = shufflevector <2 x i32> zeroinitializer, <2 x i32> %vec.ind, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec, ptr %23, align 8
%interleaved.vec24 = shufflevector <2 x i32> zeroinitializer, <2 x i32> %step.add, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec24, ptr %24, align 8
%index.next = add nuw i64 %offset.idx, 4
%vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
%25 = icmp eq i64 %index.next, %n.vec
br i1 %25, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader
for.body.preheader: ; preds = %vector.scevcheck, %for.body.lr.ph, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %for.body.lr.ph ], [ %n.vec, %middle.block ]
%xtraiter = and i64 %wide.trip.count, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%26 = trunc i64 %indvars.iv.ph to i32
%sub.prol = add i32 %add, %26
%idxprom.prol = sext i32 %sub.prol to i64
%arrayidx.prol = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom.prol
store i32 0, ptr %arrayidx.prol, align 8, !tbaa.struct !17
%p.sroa.4.0.arrayidx.sroa_idx.prol = getelementptr inbounds i8, ptr %arrayidx.prol, i64 4
store i32 %26, ptr %p.sroa.4.0.arrayidx.sroa_idx.prol, align 4, !tbaa.struct !18
%indvars.iv.next.prol = or i64 %indvars.iv.ph, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ]
%27 = sub nsw i64 0, %wide.trip.count
%28 = xor i64 %indvars.iv.ph, %27
%29 = icmp eq i64 %28, -1
br i1 %29, label %for.cond1.preheader, label %for.body
for.cond1.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block
br i1 %cmp13, label %for.body3.lr.ph, label %for.end6
for.body3.lr.ph: ; preds = %for.cond1.preheader
%sub.i = add nsw i32 %0, -1
br label %for.body3
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%30 = trunc i64 %indvars.iv to i32
%sub = add i32 %add, %30
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom
store i32 0, ptr %arrayidx, align 8, !tbaa.struct !17
%p.sroa.4.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
store i32 %30, ptr %p.sroa.4.0.arrayidx.sroa_idx, align 4, !tbaa.struct !18
%31 = trunc i64 %indvars.iv to i32
%32 = add i32 %31, 1
%sub.1 = add i32 %0, %31
%idxprom.1 = sext i32 %sub.1 to i64
%arrayidx.1 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom.1
store i32 0, ptr %arrayidx.1, align 8, !tbaa.struct !17
%p.sroa.4.0.arrayidx.sroa_idx.1 = getelementptr inbounds i8, ptr %arrayidx.1, i64 4
store i32 %32, ptr %p.sroa.4.0.arrayidx.sroa_idx.1, align 4, !tbaa.struct !18
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.cond1.preheader, label %for.body, !llvm.loop !19
for.body3: ; preds = %for.body3.lr.ph, %add.exit
%i.116 = phi i32 [ 0, %for.body3.lr.ph ], [ %inc5, %add.exit ]
%add.i = add i32 %sub.i, %i.116
%cmp83.i = icmp sgt i32 %add.i, 0
br i1 %cmp83.i, label %while.body.i, label %add.exit
while.body.i: ; preds = %for.body3, %if.end63.i
%k.addr.084.i = phi i32 [ %div82.i, %if.end63.i ], [ %add.i, %for.body3 ]
%sub2.i = add nsw i32 %k.addr.084.i, -1
%div82.i = lshr i32 %sub2.i, 1
%mul.i = and i32 %sub2.i, -2
%add3.i = or i32 %sub2.i, 1
%idxprom4.i = zext i32 %add3.i to i64
%arrayidx5.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom4.i
%33 = load i32, ptr %arrayidx5.i, align 8, !tbaa !9
%add8.i = add nuw nsw i32 %mul.i, 2
%idxprom9.i = zext i32 %add8.i to i64
%arrayidx10.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom9.i
%34 = load i32, ptr %arrayidx10.i, align 16, !tbaa !9
%cmp12.i = icmp sgt i32 %33, %34
br i1 %cmp12.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %while.body.i
%idxprom13.i = zext i32 %div82.i to i64
%arrayidx14.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom13.i
%35 = load i64, ptr %arrayidx5.i, align 8
store i64 %35, ptr %arrayidx14.i, align 8
br label %if.end63.i
if.else.i: ; preds = %while.body.i
%cmp29.i = icmp eq i32 %33, %34
br i1 %cmp29.i, label %if.then30.i, label %if.else55.i
if.then30.i: ; preds = %if.else.i
%second.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom4.i, i32 1
%36 = load i32, ptr %second.i, align 4, !tbaa !11
%second39.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom9.i, i32 1
%37 = load i32, ptr %second39.i, align 4, !tbaa !11
%cmp40.i = icmp slt i32 %36, %37
%idxprom42.i = zext i32 %div82.i to i64
%arrayidx43.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom42.i
br i1 %cmp40.i, label %if.then41.i, label %if.else48.i
if.then41.i: ; preds = %if.then30.i
%38 = load i64, ptr %arrayidx5.i, align 8
store i64 %38, ptr %arrayidx43.i, align 8
br label %if.end63.i
if.else48.i: ; preds = %if.then30.i
%39 = load i64, ptr %arrayidx10.i, align 16
store i64 %39, ptr %arrayidx43.i, align 8
br label %if.end63.i
if.else55.i: ; preds = %if.else.i
%idxprom56.i = zext i32 %div82.i to i64
%arrayidx57.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom56.i
%40 = load i64, ptr %arrayidx10.i, align 16
store i64 %40, ptr %arrayidx57.i, align 8
br label %if.end63.i
if.end63.i: ; preds = %if.else55.i, %if.else48.i, %if.then41.i, %if.then.i
%cmp.not.i = icmp ult i32 %sub2.i, 2
br i1 %cmp.not.i, label %add.exit, label %while.body.i, !llvm.loop !12
add.exit: ; preds = %if.end63.i, %for.body3
%inc5 = add nuw nsw i32 %i.116, 1
%exitcond18.not = icmp eq i32 %inc5, %0
br i1 %exitcond18.not, label %for.end6, label %for.body3, !llvm.loop !20
for.end6: ; preds = %add.exit, %entry, %for.cond1.preheader
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:
%r = alloca i32, align 4
%l = alloca i32, align 4
%d = alloca i32, align 4
%t = alloca i32, align 4
%x = 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 %l) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %r, ptr noundef nonnull %l)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp13.i = icmp sgt i32 %0, 0
br i1 %cmp13.i, label %for.body.lr.ph.i, label %init.exit
for.body.lr.ph.i: ; preds = %entry
%add.i = add nsw i32 %0, -1
%wide.trip.count.i = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 34
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %for.body.lr.ph.i
%1 = add nsw i64 %wide.trip.count.i, -1
%2 = trunc i64 %1 to i32
%3 = add i32 %add.i, %2
%4 = icmp slt i32 %3, %add.i
%5 = icmp ugt i64 %1, 4294967295
%6 = or i1 %4, %5
%7 = sext i32 %add.i to i64
%8 = shl nsw i64 %7, 3
%scevgep = getelementptr i8, ptr @dat, i64 %8
%mul.result = shl nsw i64 %1, 3
%9 = getelementptr i8, ptr %scevgep, i64 %mul.result
%10 = icmp ult ptr %9, %scevgep
%11 = or i64 %8, 4
%scevgep42 = getelementptr i8, ptr @dat, i64 %11
%mul.result44 = shl nsw i64 %1, 3
%12 = getelementptr i8, ptr %scevgep42, i64 %mul.result44
%13 = icmp ult ptr %12, %scevgep42
%14 = or i1 %10, %6
%15 = or i1 %13, %14
br i1 %15, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%offset.idx = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
%16 = trunc i64 %offset.idx to i32
%17 = or i32 %16, 2
%18 = add i32 %add.i, %16
%19 = add i32 %add.i, %17
%20 = sext i32 %18 to i64
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %20
%23 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %21
%interleaved.vec = shufflevector <2 x i32> zeroinitializer, <2 x i32> %vec.ind, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec, ptr %22, align 8
%interleaved.vec47 = shufflevector <2 x i32> zeroinitializer, <2 x i32> %step.add, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec47, ptr %23, align 8
%index.next = add nuw i64 %offset.idx, 4
%vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
%24 = icmp eq i64 %index.next, %n.vec
br i1 %24, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.body3.i.preheader, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.scevcheck, %for.body.lr.ph.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %for.body.lr.ph.i ], [ %n.vec, %middle.block ]
%xtraiter = and i64 %wide.trip.count.i, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader
%25 = trunc i64 %indvars.iv.i.ph to i32
%sub.i.prol = add i32 %add.i, %25
%idxprom.i.prol = sext i32 %sub.i.prol to i64
%arrayidx.i.prol = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom.i.prol
store i32 0, ptr %arrayidx.i.prol, align 8, !tbaa.struct !17
%p.sroa.4.0.arrayidx.sroa_idx.i.prol = getelementptr inbounds i8, ptr %arrayidx.i.prol, i64 4
store i32 %25, ptr %p.sroa.4.0.arrayidx.sroa_idx.i.prol, align 4, !tbaa.struct !18
%indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%26 = sub nsw i64 0, %wide.trip.count.i
%27 = xor i64 %indvars.iv.i.ph, %26
%28 = icmp eq i64 %27, -1
br i1 %28, label %for.body3.i.preheader, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%29 = trunc i64 %indvars.iv.i to i32
%sub.i = add i32 %add.i, %29
%idxprom.i = sext i32 %sub.i to i64
%arrayidx.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom.i
store i32 0, ptr %arrayidx.i, align 8, !tbaa.struct !17
%p.sroa.4.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
store i32 %29, ptr %p.sroa.4.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !18
%30 = trunc i64 %indvars.iv.i to i32
%31 = add i32 %30, 1
%sub.i.1 = add i32 %0, %30
%idxprom.i.1 = sext i32 %sub.i.1 to i64
%arrayidx.i.1 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom.i.1
store i32 0, ptr %arrayidx.i.1, align 8, !tbaa.struct !17
%p.sroa.4.0.arrayidx.sroa_idx.i.1 = getelementptr inbounds i8, ptr %arrayidx.i.1, i64 4
store i32 %31, ptr %p.sroa.4.0.arrayidx.sroa_idx.i.1, align 4, !tbaa.struct !18
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %wide.trip.count.i
br i1 %exitcond.not.i.1, label %for.body3.i.preheader, label %for.body.i, !llvm.loop !22
for.body3.i.preheader: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block
br label %for.body3.i
for.body3.i: ; preds = %for.body3.i.preheader, %add.exit.i
%i.116.i = phi i32 [ %inc5.i, %add.exit.i ], [ 0, %for.body3.i.preheader ]
%add.i.i = add i32 %i.116.i, %add.i
%cmp83.i.i = icmp sgt i32 %add.i.i, 0
br i1 %cmp83.i.i, label %while.body.i.i, label %add.exit.i
while.body.i.i: ; preds = %for.body3.i, %if.end63.i.i
%k.addr.084.i.i = phi i32 [ %div82.i.i, %if.end63.i.i ], [ %add.i.i, %for.body3.i ]
%sub2.i.i = add nsw i32 %k.addr.084.i.i, -1
%div82.i.i = lshr i32 %sub2.i.i, 1
%mul.i.i = and i32 %sub2.i.i, -2
%add3.i.i = or i32 %sub2.i.i, 1
%idxprom4.i.i = zext i32 %add3.i.i to i64
%arrayidx5.i.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom4.i.i
%32 = load i32, ptr %arrayidx5.i.i, align 8, !tbaa !9
%add8.i.i = add nuw nsw i32 %mul.i.i, 2
%idxprom9.i.i = zext i32 %add8.i.i to i64
%arrayidx10.i.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom9.i.i
%33 = load i32, ptr %arrayidx10.i.i, align 16, !tbaa !9
%cmp12.i.i = icmp sgt i32 %32, %33
br i1 %cmp12.i.i, label %if.then.i.i, label %if.else.i.i
if.then.i.i: ; preds = %while.body.i.i
%idxprom13.i.i = zext i32 %div82.i.i to i64
%arrayidx14.i.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom13.i.i
%34 = load i64, ptr %arrayidx5.i.i, align 8
store i64 %34, ptr %arrayidx14.i.i, align 8
br label %if.end63.i.i
if.else.i.i: ; preds = %while.body.i.i
%cmp29.i.i = icmp eq i32 %32, %33
br i1 %cmp29.i.i, label %if.then30.i.i, label %if.else55.i.i
if.then30.i.i: ; preds = %if.else.i.i
%second.i.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom4.i.i, i32 1
%35 = load i32, ptr %second.i.i, align 4, !tbaa !11
%second39.i.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom9.i.i, i32 1
%36 = load i32, ptr %second39.i.i, align 4, !tbaa !11
%cmp40.i.i = icmp slt i32 %35, %36
%idxprom42.i.i = zext i32 %div82.i.i to i64
%arrayidx43.i.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom42.i.i
br i1 %cmp40.i.i, label %if.then41.i.i, label %if.else48.i.i
if.then41.i.i: ; preds = %if.then30.i.i
%37 = load i64, ptr %arrayidx5.i.i, align 8
store i64 %37, ptr %arrayidx43.i.i, align 8
br label %if.end63.i.i
if.else48.i.i: ; preds = %if.then30.i.i
%38 = load i64, ptr %arrayidx10.i.i, align 16
store i64 %38, ptr %arrayidx43.i.i, align 8
br label %if.end63.i.i
if.else55.i.i: ; preds = %if.else.i.i
%idxprom56.i.i = zext i32 %div82.i.i to i64
%arrayidx57.i.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom56.i.i
%39 = load i64, ptr %arrayidx10.i.i, align 16
store i64 %39, ptr %arrayidx57.i.i, align 8
br label %if.end63.i.i
if.end63.i.i: ; preds = %if.else55.i.i, %if.else48.i.i, %if.then41.i.i, %if.then.i.i
%cmp.not.i.i = icmp ult i32 %sub2.i.i, 2
br i1 %cmp.not.i.i, label %add.exit.i, label %while.body.i.i, !llvm.loop !12
add.exit.i: ; preds = %if.end63.i.i, %for.body3.i
%inc5.i = add nuw nsw i32 %i.116.i, 1
%exitcond18.not.i = icmp eq i32 %inc5.i, %0
br i1 %exitcond18.not.i, label %init.exit, label %for.body3.i, !llvm.loop !20
init.exit: ; preds = %add.exit.i, %entry
%40 = load i32, ptr %r, align 4, !tbaa !5
%dec26 = add nsw i32 %40, -1
store i32 %dec26, ptr %r, align 4, !tbaa !5
%tobool.not27 = icmp eq i32 %40, 0
br i1 %tobool.not27, label %while.end, label %while.body
while.body: ; preds = %init.exit, %add.exit
%pre.0.neg29 = phi i32 [ %pre.0.neg, %add.exit ], [ 0, %init.exit ]
%now.028 = phi i32 [ %55, %add.exit ], [ 0, %init.exit ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %t, ptr noundef nonnull %x)
%41 = load i32, ptr %t, align 4, !tbaa !5
%sub = add i32 %41, %pre.0.neg29
%idxprom = sext i32 %now.028 to i64
%arrayidx = getelementptr inbounds [100001 x i32], ptr @cnt, i64 0, i64 %idxprom
%42 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %sub, %42
store i32 %add, ptr %arrayidx, align 4, !tbaa !5
%43 = load i32, ptr %d, align 4, !tbaa !5
%44 = load i32, ptr %x, align 4, !tbaa !5
%45 = load i32, ptr @n, align 4, !tbaa !5
%sub.i22 = add i32 %43, -2
%add.i23 = add i32 %sub.i22, %45
%idxprom.i24 = sext i32 %add.i23 to i64
%arrayidx.i25 = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom.i24
%46 = load i32, ptr %arrayidx.i25, align 8, !tbaa !9
%add1.i = add nsw i32 %46, %44
store i32 %add1.i, ptr %arrayidx.i25, align 8, !tbaa !9
%cmp83.i = icmp sgt i32 %add.i23, 0
br i1 %cmp83.i, label %while.body.i, label %add.exit
while.body.i: ; preds = %while.body, %if.end63.i
%k.addr.084.i = phi i32 [ %div82.i, %if.end63.i ], [ %add.i23, %while.body ]
%sub2.i = add nsw i32 %k.addr.084.i, -1
%div82.i = lshr i32 %sub2.i, 1
%mul.i = and i32 %sub2.i, -2
%add3.i = or i32 %sub2.i, 1
%idxprom4.i = zext i32 %add3.i to i64
%arrayidx5.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom4.i
%47 = load i32, ptr %arrayidx5.i, align 8, !tbaa !9
%add8.i = add nuw nsw i32 %mul.i, 2
%idxprom9.i = zext i32 %add8.i to i64
%arrayidx10.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom9.i
%48 = load i32, ptr %arrayidx10.i, align 16, !tbaa !9
%cmp12.i = icmp sgt i32 %47, %48
br i1 %cmp12.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %while.body.i
%idxprom13.i = zext i32 %div82.i to i64
%arrayidx14.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom13.i
%49 = load i64, ptr %arrayidx5.i, align 8
store i64 %49, ptr %arrayidx14.i, align 8
br label %if.end63.i
if.else.i: ; preds = %while.body.i
%cmp29.i = icmp eq i32 %47, %48
br i1 %cmp29.i, label %if.then30.i, label %if.else55.i
if.then30.i: ; preds = %if.else.i
%second.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom4.i, i32 1
%50 = load i32, ptr %second.i, align 4, !tbaa !11
%second39.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom9.i, i32 1
%51 = load i32, ptr %second39.i, align 4, !tbaa !11
%cmp40.i = icmp slt i32 %50, %51
%idxprom42.i = zext i32 %div82.i to i64
%arrayidx43.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom42.i
br i1 %cmp40.i, label %if.then41.i, label %if.else48.i
if.then41.i: ; preds = %if.then30.i
%52 = load i64, ptr %arrayidx5.i, align 8
store i64 %52, ptr %arrayidx43.i, align 8
br label %if.end63.i
if.else48.i: ; preds = %if.then30.i
%53 = load i64, ptr %arrayidx10.i, align 16
store i64 %53, ptr %arrayidx43.i, align 8
br label %if.end63.i
if.else55.i: ; preds = %if.else.i
%idxprom56.i = zext i32 %div82.i to i64
%arrayidx57.i = getelementptr inbounds [200001 x %struct.pair], ptr @dat, i64 0, i64 %idxprom56.i
%54 = load i64, ptr %arrayidx10.i, align 16
store i64 %54, ptr %arrayidx57.i, align 8
br label %if.end63.i
if.end63.i: ; preds = %if.else55.i, %if.else48.i, %if.then41.i, %if.then.i
%cmp.not.i = icmp ult i32 %sub2.i, 2
br i1 %cmp.not.i, label %add.exit, label %while.body.i, !llvm.loop !12
add.exit: ; preds = %if.end63.i, %while.body
%55 = load i32, ptr getelementptr inbounds ([200001 x %struct.pair], ptr @dat, i64 0, i64 0, i32 1), align 4, !tbaa !11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
%pre.0.neg = sub i32 0, %41
%56 = load i32, ptr %r, align 4, !tbaa !5
%dec = add nsw i32 %56, -1
store i32 %dec, ptr %r, align 4, !tbaa !5
%tobool.not = icmp eq i32 %56, 0
br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !23
while.end.loopexit: ; preds = %add.exit
%57 = sext i32 %55 to i64
br label %while.end
while.end: ; preds = %while.end.loopexit, %init.exit
%58 = phi i32 [ %0, %init.exit ], [ %45, %while.end.loopexit ]
%now.0.lcssa = phi i64 [ 0, %init.exit ], [ %57, %while.end.loopexit ]
%pre.0.neg.lcssa = phi i32 [ 0, %init.exit ], [ %pre.0.neg, %while.end.loopexit ]
%59 = load i32, ptr %l, align 4, !tbaa !5
%sub4 = add i32 %59, %pre.0.neg.lcssa
%arrayidx6 = getelementptr inbounds [100001 x i32], ptr @cnt, i64 0, i64 %now.0.lcssa
%60 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add7 = add nsw i32 %sub4, %60
store i32 %add7, ptr %arrayidx6, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %58, 0
br i1 %cmp31, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.end
%wide.trip.count = zext i32 %58 to i64
%xtraiter50 = and i64 %wide.trip.count, 1
%61 = icmp eq i32 %58, 1
br i1 %61, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%p.034 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select21.1, %for.body ]
%ans.033 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx9 = getelementptr inbounds [100001 x i32], ptr @cnt, i64 0, i64 %indvars.iv
%62 = load i32, ptr %arrayidx9, align 8, !tbaa !5
%cmp10 = icmp slt i32 %p.034, %62
%63 = trunc i64 %indvars.iv to i32
%spec.select = select i1 %cmp10, i32 %63, i32 %ans.033
%spec.select21 = call i32 @llvm.smax.i32(i32 %p.034, i32 %62)
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx9.1 = getelementptr inbounds [100001 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next
%64 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%cmp10.1 = icmp slt i32 %spec.select21, %64
%65 = trunc i64 %indvars.iv.next to i32
%spec.select.1 = select i1 %cmp10.1, i32 %65, i32 %spec.select
%spec.select21.1 = call i32 @llvm.smax.i32(i32 %spec.select21, i32 %64)
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !24
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%p.034.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select21.1, %for.body ]
%ans.033.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ]
%lcmp.mod51.not = icmp eq i64 %xtraiter50, 0
br i1 %lcmp.mod51.not, label %for.end.loopexit, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx9.epil = getelementptr inbounds [100001 x i32], ptr @cnt, i64 0, i64 %indvars.iv.unr
%66 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5
%cmp10.epil = icmp slt i32 %p.034.unr, %66
%67 = trunc i64 %indvars.iv.unr to i32
%spec.select.epil = select i1 %cmp10.epil, i32 %67, i32 %ans.033.unr
br label %for.end.loopexit
for.end.loopexit: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%68 = add nsw i32 %spec.select.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %while.end
%ans.0.lcssa = phi i32 [ 1, %while.end ], [ %68, %for.end.loopexit ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !6, i64 0}
!10 = !{!"pair", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!18 = !{i64 0, i64 4, !5}
!19 = distinct !{!19, !13, !15}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13, !15, !16}
!22 = distinct !{!22, !13, !15}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
void swap (int *x, int *y) {
int temp;
temp = *x;
*x = *y;
*y = temp;
}
int gcd(int a,int b){
if(a<b){
swap(&a,&b);
}
if(b==0){
return a;
}
int r=a%b;
while(r!=0){
a = b;
b = r;
r = (a%b);
}
return b;
}
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
int modpow(int a,int n,int mod){
int ans=1;
while(n>0){
if(n & 1){
ans=ans*a%mod;
}
a=a*a%mod;
n/=2;
}
return ans;
}
int max(int a,int b){
if(a<b){
return b;
}
else{
return a;
}
}
int min(int a,int b){
if(a<b){
return a;
}
else{
return b;
}
}
void chmax(int *a,int b){
if(*a < b){
*a = b;
}
return;
}
void chmin(int *a,int b){
if(*a > b){
*a =b;
}
return;
}
int main(void){
char w[110];
scanf("%s",w);
int l=strlen(w);
int c[26];
for(int i=0;i<26;i++){
c[i]=0;
}
for(int i=0;i<l;i++){
c[(w[i]-'a')]++;
}
int ans=0;
for(int i=0;i<26;i++){
if(c[i]%2==1){
ans++;
}
}
if(ans==0){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291401/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291401/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: 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 nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
%spec.select14 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%cmp1 = icmp eq i32 %spec.select14, 0
br i1 %cmp1, label %return, label %if.end3
if.end3: ; preds = %entry
%rem = srem i32 %spec.select, %spec.select14
%cmp4.not15 = icmp eq i32 %rem, 0
br i1 %cmp4.not15, label %return, label %while.body
while.body: ; preds = %if.end3, %while.body
%r.017 = phi i32 [ %rem5, %while.body ], [ %rem, %if.end3 ]
%b.addr.116 = phi i32 [ %r.017, %while.body ], [ %spec.select14, %if.end3 ]
%rem5 = srem i32 %b.addr.116, %r.017
%cmp4.not = icmp eq i32 %rem5, 0
br i1 %cmp4.not, label %return, label %while.body, !llvm.loop !9
return: ; preds = %while.body, %if.end3, %entry
%retval.0.in.sroa.speculated = phi i32 [ %spec.select, %entry ], [ %spec.select14, %if.end3 ], [ %r.017, %while.body ]
ret i32 %retval.0.in.sroa.speculated
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dn(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @modpow(i32 noundef %a, i32 noundef %n, i32 noundef %mod) local_unnamed_addr #4 {
entry:
%cmp10 = icmp sgt i32 %n, 0
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%ans.013 = phi i32 [ %ans.1, %if.end ], [ 1, %entry ]
%a.addr.012 = phi i32 [ %rem2, %if.end ], [ %a, %entry ]
%n.addr.011 = phi i32 [ %div9, %if.end ], [ %n, %entry ]
%and = and i32 %n.addr.011, 1
%tobool.not = icmp eq i32 %and, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul nsw i32 %ans.013, %a.addr.012
%rem = srem i32 %mul, %mod
br label %if.end
if.end: ; preds = %if.then, %while.body
%ans.1 = phi i32 [ %rem, %if.then ], [ %ans.013, %while.body ]
%mul1 = mul nsw i32 %a.addr.012, %a.addr.012
%rem2 = srem i32 %mul1, %mod
%div9 = lshr i32 %n.addr.011, 1
%cmp.not = icmp ult i32 %n.addr.011, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %if.end, %entry
%ans.0.lcssa = phi i32 [ 1, %entry ], [ %ans.1, %if.end ]
ret i32 %ans.0.lcssa
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 {
entry:
%b.a = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %b.a
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @chmax(ptr nocapture noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %b
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %b, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @chmin(ptr nocapture noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %b
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %b, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
%w = alloca [110 x i8], align 16
%c = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 110, ptr nonnull %w) #12
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %w) #13
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %c) #12
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %c, i8 0, i64 104, i1 false), !tbaa !5
%conv = trunc i64 %call2 to i32
%cmp648 = icmp sgt i32 %conv, 0
br i1 %cmp648, label %for.body9.preheader, label %for.cond20.preheader
for.body9.preheader: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
%xtraiter = and i64 %call2, 1
%0 = icmp eq i64 %wide.trip.count, 1
br i1 %0, label %for.cond20.preheader.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body9
for.cond20.preheader.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next.1, %for.body9 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond20.preheader.loopexit, label %for.body9.epil
for.body9.epil: ; preds = %for.cond20.preheader.loopexit.unr-lcssa
%arrayidx11.epil = getelementptr inbounds [110 x i8], ptr %w, i64 0, i64 %indvars.iv.unr
%1 = load i8, ptr %arrayidx11.epil, align 1, !tbaa !12
%conv12.epil = sext i8 %1 to i64
%sub.epil = add nsw i64 %conv12.epil, -97
%arrayidx14.epil = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub.epil
%2 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5
%inc15.epil = add nsw i32 %2, 1
store i32 %inc15.epil, ptr %arrayidx14.epil, align 4, !tbaa !5
br label %for.cond20.preheader.loopexit
for.cond20.preheader.loopexit: ; preds = %for.cond20.preheader.loopexit.unr-lcssa, %for.body9.epil
%arrayidx26.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 16
%.pre73 = load i32, ptr %arrayidx26.16.phi.trans.insert, align 16, !tbaa !5
%3 = load <16 x i32>, ptr %c, align 16, !tbaa !5
%4 = and <16 x i32> %3, <i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647>
%5 = icmp eq <16 x i32> %4, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%6 = and i32 %.pre73, -2147483647
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = bitcast <16 x i1> %5 to i16
%10 = call i16 @llvm.ctpop.i16(i16 %9), !range !13
%11 = zext i16 %10 to i32
%op.rdx = add nuw nsw i32 %11, %8
br label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.cond20.preheader.loopexit, %entry
%spec.select.16 = phi i32 [ %op.rdx, %for.cond20.preheader.loopexit ], [ 0, %entry ]
%arrayidx26.17 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 17
%12 = load <8 x i32>, ptr %arrayidx26.17, align 4, !tbaa !5
%13 = and <8 x i32> %12, <i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647>
%14 = icmp eq <8 x i32> %13, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%15 = bitcast <8 x i1> %14 to i8
%16 = call i8 @llvm.ctpop.i8(i8 %15), !range !14
%17 = zext i8 %16 to i32
%op.rdx74 = add nsw i32 %spec.select.16, %17
%arrayidx26.25 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 25
%18 = load i32, ptr %arrayidx26.25, align 4, !tbaa !5
%19 = and i32 %18, -2147483647
%cmp27.25 = icmp eq i32 %19, 1
%inc29.25.neg = sext i1 %cmp27.25 to i32
%cmp33 = icmp eq i32 %op.rdx74, %inc29.25.neg
%str.3.str = select i1 %cmp33, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %c) #12
call void @llvm.lifetime.end.p0(i64 110, ptr nonnull %w) #12
ret i32 0
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%indvars.iv = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next.1, %for.body9 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.1, %for.body9 ]
%arrayidx11 = getelementptr inbounds [110 x i8], ptr %w, i64 0, i64 %indvars.iv
%20 = load i8, ptr %arrayidx11, align 2, !tbaa !12
%conv12 = sext i8 %20 to i64
%sub = add nsw i64 %conv12, -97
%arrayidx14 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub
%21 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%inc15 = add nsw i32 %21, 1
store i32 %inc15, ptr %arrayidx14, align 4, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx11.1 = getelementptr inbounds [110 x i8], ptr %w, i64 0, i64 %indvars.iv.next
%22 = load i8, ptr %arrayidx11.1, align 1, !tbaa !12
%conv12.1 = sext i8 %22 to i64
%sub.1 = add nsw i64 %conv12.1, -97
%arrayidx14.1 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub.1
%23 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5
%inc15.1 = add nsw i32 %23, 1
store i32 %inc15.1, ptr %arrayidx14.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond20.preheader.loopexit.unr-lcssa, label %for.body9, !llvm.loop !15
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
; 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
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.ctpop.i16(i16) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.ctpop.i8(i8) #10
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 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 #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nofree nounwind }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #12 = { nounwind }
attributes #13 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!7, !7, i64 0}
!13 = !{i16 0, i16 17}
!14 = !{i8 0, i8 9}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#include <string.h>
int main() {
char s[101];
int alCnt[26] = {0};
scanf("%s", s);
for (int i = 0; i < strlen(s); i++) {
alCnt[s[i] - 'a']++;
}
for (int i = 0; i < 26; i++) {
if (alCnt[i] % 2 == 1) {
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291445/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291445/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
%alCnt = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alCnt) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alCnt, i8 0, i64 104, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7
%cmp30.not = icmp eq i64 %call2, 0
br i1 %cmp30.not, label %for.cond9, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %call2, 1
%0 = icmp eq i64 %call2, 1
br i1 %0, label %for.cond9.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %call2, -2
br label %for.body
for.cond9.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond9.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%conv4.epil = sext i8 %1 to i64
%sub.epil = add nsw i64 %conv4.epil, -97
%arrayidx6.epil = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 %sub.epil
%2 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !8
%inc.epil = add nsw i32 %2, 1
store i32 %inc.epil, ptr %arrayidx6.epil, align 4, !tbaa !8
br label %for.cond9.preheader
for.cond9.preheader: ; preds = %for.cond9.preheader.unr-lcssa, %for.body.epil
%.pre = load i32, ptr %alCnt, align 16, !tbaa !8
%3 = and i32 %.pre, -2147483647
%4 = icmp eq i32 %3, 1
br i1 %4, label %if.then, label %for.cond9
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx, align 2, !tbaa !5
%conv4 = sext i8 %5 to i64
%sub = add nsw i64 %conv4, -97
%arrayidx6 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 %sub
%6 = load i32, ptr %arrayidx6, align 4, !tbaa !8
%inc = add nsw i32 %6, 1
store i32 %inc, ptr %arrayidx6, align 4, !tbaa !8
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv4.1 = sext i8 %7 to i64
%sub.1 = add nsw i64 %conv4.1, -97
%arrayidx6.1 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 %sub.1
%8 = load i32, ptr %arrayidx6.1, align 4, !tbaa !8
%inc.1 = add nsw i32 %8, 1
store i32 %inc.1, ptr %arrayidx6.1, align 4, !tbaa !8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond9.preheader.unr-lcssa, label %for.body, !llvm.loop !10
for.cond9: ; preds = %entry, %for.cond9.preheader
%arrayidx15.1 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 1
%9 = load i32, ptr %arrayidx15.1, align 4, !tbaa !8
%10 = and i32 %9, -2147483647
%cmp16.1 = icmp eq i32 %10, 1
br i1 %cmp16.1, label %if.then, label %for.cond9.1
for.cond9.1: ; preds = %for.cond9
%arrayidx15.2 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 2
%11 = load i32, ptr %arrayidx15.2, align 8, !tbaa !8
%12 = and i32 %11, -2147483647
%cmp16.2 = icmp eq i32 %12, 1
br i1 %cmp16.2, label %if.then, label %for.cond9.2
for.cond9.2: ; preds = %for.cond9.1
%arrayidx15.3 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 3
%13 = load i32, ptr %arrayidx15.3, align 4, !tbaa !8
%14 = and i32 %13, -2147483647
%cmp16.3 = icmp eq i32 %14, 1
br i1 %cmp16.3, label %if.then, label %for.cond9.3
for.cond9.3: ; preds = %for.cond9.2
%arrayidx15.4 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 4
%15 = load i32, ptr %arrayidx15.4, align 16, !tbaa !8
%16 = and i32 %15, -2147483647
%cmp16.4 = icmp eq i32 %16, 1
br i1 %cmp16.4, label %if.then, label %for.cond9.4
for.cond9.4: ; preds = %for.cond9.3
%arrayidx15.5 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 5
%17 = load i32, ptr %arrayidx15.5, align 4, !tbaa !8
%18 = and i32 %17, -2147483647
%cmp16.5 = icmp eq i32 %18, 1
br i1 %cmp16.5, label %if.then, label %for.cond9.5
for.cond9.5: ; preds = %for.cond9.4
%arrayidx15.6 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 6
%19 = load i32, ptr %arrayidx15.6, align 8, !tbaa !8
%20 = and i32 %19, -2147483647
%cmp16.6 = icmp eq i32 %20, 1
br i1 %cmp16.6, label %if.then, label %for.cond9.6
for.cond9.6: ; preds = %for.cond9.5
%arrayidx15.7 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 7
%21 = load i32, ptr %arrayidx15.7, align 4, !tbaa !8
%22 = and i32 %21, -2147483647
%cmp16.7 = icmp eq i32 %22, 1
br i1 %cmp16.7, label %if.then, label %for.cond9.7
for.cond9.7: ; preds = %for.cond9.6
%arrayidx15.8 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 8
%23 = load i32, ptr %arrayidx15.8, align 16, !tbaa !8
%24 = and i32 %23, -2147483647
%cmp16.8 = icmp eq i32 %24, 1
br i1 %cmp16.8, label %if.then, label %for.cond9.8
for.cond9.8: ; preds = %for.cond9.7
%arrayidx15.9 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 9
%25 = load i32, ptr %arrayidx15.9, align 4, !tbaa !8
%26 = and i32 %25, -2147483647
%cmp16.9 = icmp eq i32 %26, 1
br i1 %cmp16.9, label %if.then, label %for.cond9.9
for.cond9.9: ; preds = %for.cond9.8
%arrayidx15.10 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 10
%27 = load i32, ptr %arrayidx15.10, align 8, !tbaa !8
%28 = and i32 %27, -2147483647
%cmp16.10 = icmp eq i32 %28, 1
br i1 %cmp16.10, label %if.then, label %for.cond9.10
for.cond9.10: ; preds = %for.cond9.9
%arrayidx15.11 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 11
%29 = load i32, ptr %arrayidx15.11, align 4, !tbaa !8
%30 = and i32 %29, -2147483647
%cmp16.11 = icmp eq i32 %30, 1
br i1 %cmp16.11, label %if.then, label %for.cond9.11
for.cond9.11: ; preds = %for.cond9.10
%arrayidx15.12 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 12
%31 = load i32, ptr %arrayidx15.12, align 16, !tbaa !8
%32 = and i32 %31, -2147483647
%cmp16.12 = icmp eq i32 %32, 1
br i1 %cmp16.12, label %if.then, label %for.cond9.12
for.cond9.12: ; preds = %for.cond9.11
%arrayidx15.13 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 13
%33 = load i32, ptr %arrayidx15.13, align 4, !tbaa !8
%34 = and i32 %33, -2147483647
%cmp16.13 = icmp eq i32 %34, 1
br i1 %cmp16.13, label %if.then, label %for.cond9.13
for.cond9.13: ; preds = %for.cond9.12
%arrayidx15.14 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 14
%35 = load i32, ptr %arrayidx15.14, align 8, !tbaa !8
%36 = and i32 %35, -2147483647
%cmp16.14 = icmp eq i32 %36, 1
br i1 %cmp16.14, label %if.then, label %for.cond9.14
for.cond9.14: ; preds = %for.cond9.13
%arrayidx15.15 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 15
%37 = load i32, ptr %arrayidx15.15, align 4, !tbaa !8
%38 = and i32 %37, -2147483647
%cmp16.15 = icmp eq i32 %38, 1
br i1 %cmp16.15, label %if.then, label %for.cond9.15
for.cond9.15: ; preds = %for.cond9.14
%arrayidx15.16 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 16
%39 = load i32, ptr %arrayidx15.16, align 16, !tbaa !8
%40 = and i32 %39, -2147483647
%cmp16.16 = icmp eq i32 %40, 1
br i1 %cmp16.16, label %if.then, label %for.cond9.16
for.cond9.16: ; preds = %for.cond9.15
%arrayidx15.17 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 17
%41 = load i32, ptr %arrayidx15.17, align 4, !tbaa !8
%42 = and i32 %41, -2147483647
%cmp16.17 = icmp eq i32 %42, 1
br i1 %cmp16.17, label %if.then, label %for.cond9.17
for.cond9.17: ; preds = %for.cond9.16
%arrayidx15.18 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 18
%43 = load i32, ptr %arrayidx15.18, align 8, !tbaa !8
%44 = and i32 %43, -2147483647
%cmp16.18 = icmp eq i32 %44, 1
br i1 %cmp16.18, label %if.then, label %for.cond9.18
for.cond9.18: ; preds = %for.cond9.17
%arrayidx15.19 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 19
%45 = load i32, ptr %arrayidx15.19, align 4, !tbaa !8
%46 = and i32 %45, -2147483647
%cmp16.19 = icmp eq i32 %46, 1
br i1 %cmp16.19, label %if.then, label %for.cond9.19
for.cond9.19: ; preds = %for.cond9.18
%arrayidx15.20 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 20
%47 = load i32, ptr %arrayidx15.20, align 16, !tbaa !8
%48 = and i32 %47, -2147483647
%cmp16.20 = icmp eq i32 %48, 1
br i1 %cmp16.20, label %if.then, label %for.cond9.20
for.cond9.20: ; preds = %for.cond9.19
%arrayidx15.21 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 21
%49 = load i32, ptr %arrayidx15.21, align 4, !tbaa !8
%50 = and i32 %49, -2147483647
%cmp16.21 = icmp eq i32 %50, 1
br i1 %cmp16.21, label %if.then, label %for.cond9.21
for.cond9.21: ; preds = %for.cond9.20
%arrayidx15.22 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 22
%51 = load i32, ptr %arrayidx15.22, align 8, !tbaa !8
%52 = and i32 %51, -2147483647
%cmp16.22 = icmp eq i32 %52, 1
br i1 %cmp16.22, label %if.then, label %for.cond9.22
for.cond9.22: ; preds = %for.cond9.21
%arrayidx15.23 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 23
%53 = load i32, ptr %arrayidx15.23, align 4, !tbaa !8
%54 = and i32 %53, -2147483647
%cmp16.23 = icmp eq i32 %54, 1
br i1 %cmp16.23, label %if.then, label %for.cond9.23
for.cond9.23: ; preds = %for.cond9.22
%arrayidx15.24 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 24
%55 = load i32, ptr %arrayidx15.24, align 16, !tbaa !8
%56 = and i32 %55, -2147483647
%cmp16.24 = icmp eq i32 %56, 1
br i1 %cmp16.24, label %if.then, label %for.cond9.24
for.cond9.24: ; preds = %for.cond9.23
%arrayidx15.25 = getelementptr inbounds [26 x i32], ptr %alCnt, i64 0, i64 25
%57 = load i32, ptr %arrayidx15.25, align 4, !tbaa !8
%58 = and i32 %57, -2147483647
%cmp16.25 = icmp eq i32 %58, 1
br i1 %cmp16.25, label %if.then, label %cleanup23
if.then: ; preds = %for.cond9.24, %for.cond9.23, %for.cond9.22, %for.cond9.21, %for.cond9.20, %for.cond9.19, %for.cond9.18, %for.cond9.17, %for.cond9.16, %for.cond9.15, %for.cond9.14, %for.cond9.13, %for.cond9.12, %for.cond9.11, %for.cond9.10, %for.cond9.9, %for.cond9.8, %for.cond9.7, %for.cond9.6, %for.cond9.5, %for.cond9.4, %for.cond9.3, %for.cond9.2, %for.cond9.1, %for.cond9, %for.cond9.preheader
br label %cleanup23
cleanup23: ; preds = %for.cond9.24, %if.then
%str.sink = phi ptr [ @str, %if.then ], [ @str.3, %for.cond9.24 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alCnt) #6
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 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 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
char s[100 + 1];
scanf("%s", s);
int c[26] = {};
for (int i = 0; i < strlen(s); i++) {
c[s[i] - 'a']++;
}
char *ans = "Yes";
for (int i = 0; i < 26; i++) {
if (c[i] % 2 != 0) {
ans = "No";
break;
}
}
puts(ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291496/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291496/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
%c = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %c) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %c, i8 0, i64 104, i1 false)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%cmp26.not = icmp eq i64 %call2, 0
br i1 %cmp26.not, label %for.cond9, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %call2, 1
%0 = icmp eq i64 %call2, 1
br i1 %0, label %for.cond9.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %call2, -2
br label %for.body
for.cond9.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond9.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%conv4.epil = sext i8 %1 to i64
%sub.epil = add nsw i64 %conv4.epil, -97
%arrayidx6.epil = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub.epil
%2 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !8
%inc.epil = add nsw i32 %2, 1
store i32 %inc.epil, ptr %arrayidx6.epil, align 4, !tbaa !8
br label %for.cond9.preheader
for.cond9.preheader: ; preds = %for.cond9.preheader.unr-lcssa, %for.body.epil
%.pre = load i32, ptr %c, align 16, !tbaa !8
%3 = and i32 %.pre, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %for.cond9, label %cleanup
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx, align 2, !tbaa !5
%conv4 = sext i8 %5 to i64
%sub = add nsw i64 %conv4, -97
%arrayidx6 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub
%6 = load i32, ptr %arrayidx6, align 4, !tbaa !8
%inc = add nsw i32 %6, 1
store i32 %inc, ptr %arrayidx6, align 4, !tbaa !8
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv4.1 = sext i8 %7 to i64
%sub.1 = add nsw i64 %conv4.1, -97
%arrayidx6.1 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %sub.1
%8 = load i32, ptr %arrayidx6.1, align 4, !tbaa !8
%inc.1 = add nsw i32 %8, 1
store i32 %inc.1, ptr %arrayidx6.1, align 4, !tbaa !8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond9.preheader.unr-lcssa, label %for.body, !llvm.loop !10
for.cond9: ; preds = %entry, %for.cond9.preheader
%arrayidx15.1 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 1
%9 = load i32, ptr %arrayidx15.1, align 4, !tbaa !8
%10 = and i32 %9, 1
%cmp16.not.1 = icmp eq i32 %10, 0
br i1 %cmp16.not.1, label %for.cond9.1, label %cleanup
for.cond9.1: ; preds = %for.cond9
%arrayidx15.2 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 2
%11 = load i32, ptr %arrayidx15.2, align 8, !tbaa !8
%12 = and i32 %11, 1
%cmp16.not.2 = icmp eq i32 %12, 0
br i1 %cmp16.not.2, label %for.cond9.2, label %cleanup
for.cond9.2: ; preds = %for.cond9.1
%arrayidx15.3 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 3
%13 = load i32, ptr %arrayidx15.3, align 4, !tbaa !8
%14 = and i32 %13, 1
%cmp16.not.3 = icmp eq i32 %14, 0
br i1 %cmp16.not.3, label %for.cond9.3, label %cleanup
for.cond9.3: ; preds = %for.cond9.2
%arrayidx15.4 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 4
%15 = load i32, ptr %arrayidx15.4, align 16, !tbaa !8
%16 = and i32 %15, 1
%cmp16.not.4 = icmp eq i32 %16, 0
br i1 %cmp16.not.4, label %for.cond9.4, label %cleanup
for.cond9.4: ; preds = %for.cond9.3
%arrayidx15.5 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 5
%17 = load i32, ptr %arrayidx15.5, align 4, !tbaa !8
%18 = and i32 %17, 1
%cmp16.not.5 = icmp eq i32 %18, 0
br i1 %cmp16.not.5, label %for.cond9.5, label %cleanup
for.cond9.5: ; preds = %for.cond9.4
%arrayidx15.6 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 6
%19 = load i32, ptr %arrayidx15.6, align 8, !tbaa !8
%20 = and i32 %19, 1
%cmp16.not.6 = icmp eq i32 %20, 0
br i1 %cmp16.not.6, label %for.cond9.6, label %cleanup
for.cond9.6: ; preds = %for.cond9.5
%arrayidx15.7 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 7
%21 = load i32, ptr %arrayidx15.7, align 4, !tbaa !8
%22 = and i32 %21, 1
%cmp16.not.7 = icmp eq i32 %22, 0
br i1 %cmp16.not.7, label %for.cond9.7, label %cleanup
for.cond9.7: ; preds = %for.cond9.6
%arrayidx15.8 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 8
%23 = load i32, ptr %arrayidx15.8, align 16, !tbaa !8
%24 = and i32 %23, 1
%cmp16.not.8 = icmp eq i32 %24, 0
br i1 %cmp16.not.8, label %for.cond9.8, label %cleanup
for.cond9.8: ; preds = %for.cond9.7
%arrayidx15.9 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 9
%25 = load i32, ptr %arrayidx15.9, align 4, !tbaa !8
%26 = and i32 %25, 1
%cmp16.not.9 = icmp eq i32 %26, 0
br i1 %cmp16.not.9, label %for.cond9.9, label %cleanup
for.cond9.9: ; preds = %for.cond9.8
%arrayidx15.10 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 10
%27 = load i32, ptr %arrayidx15.10, align 8, !tbaa !8
%28 = and i32 %27, 1
%cmp16.not.10 = icmp eq i32 %28, 0
br i1 %cmp16.not.10, label %for.cond9.10, label %cleanup
for.cond9.10: ; preds = %for.cond9.9
%arrayidx15.11 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 11
%29 = load i32, ptr %arrayidx15.11, align 4, !tbaa !8
%30 = and i32 %29, 1
%cmp16.not.11 = icmp eq i32 %30, 0
br i1 %cmp16.not.11, label %for.cond9.11, label %cleanup
for.cond9.11: ; preds = %for.cond9.10
%arrayidx15.12 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 12
%31 = load i32, ptr %arrayidx15.12, align 16, !tbaa !8
%32 = and i32 %31, 1
%cmp16.not.12 = icmp eq i32 %32, 0
br i1 %cmp16.not.12, label %for.cond9.12, label %cleanup
for.cond9.12: ; preds = %for.cond9.11
%arrayidx15.13 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 13
%33 = load i32, ptr %arrayidx15.13, align 4, !tbaa !8
%34 = and i32 %33, 1
%cmp16.not.13 = icmp eq i32 %34, 0
br i1 %cmp16.not.13, label %for.cond9.13, label %cleanup
for.cond9.13: ; preds = %for.cond9.12
%arrayidx15.14 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 14
%35 = load i32, ptr %arrayidx15.14, align 8, !tbaa !8
%36 = and i32 %35, 1
%cmp16.not.14 = icmp eq i32 %36, 0
br i1 %cmp16.not.14, label %for.cond9.14, label %cleanup
for.cond9.14: ; preds = %for.cond9.13
%arrayidx15.15 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 15
%37 = load i32, ptr %arrayidx15.15, align 4, !tbaa !8
%38 = and i32 %37, 1
%cmp16.not.15 = icmp eq i32 %38, 0
br i1 %cmp16.not.15, label %for.cond9.15, label %cleanup
for.cond9.15: ; preds = %for.cond9.14
%arrayidx15.16 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 16
%39 = load i32, ptr %arrayidx15.16, align 16, !tbaa !8
%40 = and i32 %39, 1
%cmp16.not.16 = icmp eq i32 %40, 0
br i1 %cmp16.not.16, label %for.cond9.16, label %cleanup
for.cond9.16: ; preds = %for.cond9.15
%arrayidx15.17 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 17
%41 = load i32, ptr %arrayidx15.17, align 4, !tbaa !8
%42 = and i32 %41, 1
%cmp16.not.17 = icmp eq i32 %42, 0
br i1 %cmp16.not.17, label %for.cond9.17, label %cleanup
for.cond9.17: ; preds = %for.cond9.16
%arrayidx15.18 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 18
%43 = load i32, ptr %arrayidx15.18, align 8, !tbaa !8
%44 = and i32 %43, 1
%cmp16.not.18 = icmp eq i32 %44, 0
br i1 %cmp16.not.18, label %for.cond9.18, label %cleanup
for.cond9.18: ; preds = %for.cond9.17
%arrayidx15.19 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 19
%45 = load i32, ptr %arrayidx15.19, align 4, !tbaa !8
%46 = and i32 %45, 1
%cmp16.not.19 = icmp eq i32 %46, 0
br i1 %cmp16.not.19, label %for.cond9.19, label %cleanup
for.cond9.19: ; preds = %for.cond9.18
%arrayidx15.20 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 20
%47 = load i32, ptr %arrayidx15.20, align 16, !tbaa !8
%48 = and i32 %47, 1
%cmp16.not.20 = icmp eq i32 %48, 0
br i1 %cmp16.not.20, label %for.cond9.20, label %cleanup
for.cond9.20: ; preds = %for.cond9.19
%arrayidx15.21 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 21
%49 = load i32, ptr %arrayidx15.21, align 4, !tbaa !8
%50 = and i32 %49, 1
%cmp16.not.21 = icmp eq i32 %50, 0
br i1 %cmp16.not.21, label %for.cond9.21, label %cleanup
for.cond9.21: ; preds = %for.cond9.20
%arrayidx15.22 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 22
%51 = load i32, ptr %arrayidx15.22, align 8, !tbaa !8
%52 = and i32 %51, 1
%cmp16.not.22 = icmp eq i32 %52, 0
br i1 %cmp16.not.22, label %for.cond9.22, label %cleanup
for.cond9.22: ; preds = %for.cond9.21
%arrayidx15.23 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 23
%53 = load i32, ptr %arrayidx15.23, align 4, !tbaa !8
%54 = and i32 %53, 1
%cmp16.not.23 = icmp eq i32 %54, 0
br i1 %cmp16.not.23, label %for.cond9.23, label %cleanup
for.cond9.23: ; preds = %for.cond9.22
%arrayidx15.24 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 24
%55 = load i32, ptr %arrayidx15.24, align 16, !tbaa !8
%56 = and i32 %55, 1
%cmp16.not.24 = icmp eq i32 %56, 0
br i1 %cmp16.not.24, label %for.cond9.24, label %cleanup
for.cond9.24: ; preds = %for.cond9.23
%arrayidx15.25 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 25
%57 = load i32, ptr %arrayidx15.25, align 4, !tbaa !8
%58 = and i32 %57, 1
%cmp16.not.25 = icmp eq i32 %58, 0
%spec.select = select i1 %cmp16.not.25, ptr @.str.1, ptr @.str.2
br label %cleanup
cleanup: ; preds = %for.cond9.24, %for.cond9.23, %for.cond9.22, %for.cond9.21, %for.cond9.20, %for.cond9.19, %for.cond9.18, %for.cond9.17, %for.cond9.16, %for.cond9.15, %for.cond9.14, %for.cond9.13, %for.cond9.12, %for.cond9.11, %for.cond9.10, %for.cond9.9, %for.cond9.8, %for.cond9.7, %for.cond9.6, %for.cond9.5, %for.cond9.4, %for.cond9.3, %for.cond9.2, %for.cond9.1, %for.cond9, %for.cond9.preheader
%ans.0 = phi ptr [ @.str.2, %for.cond9.preheader ], [ @.str.2, %for.cond9 ], [ @.str.2, %for.cond9.1 ], [ @.str.2, %for.cond9.2 ], [ @.str.2, %for.cond9.3 ], [ @.str.2, %for.cond9.4 ], [ @.str.2, %for.cond9.5 ], [ @.str.2, %for.cond9.6 ], [ @.str.2, %for.cond9.7 ], [ @.str.2, %for.cond9.8 ], [ @.str.2, %for.cond9.9 ], [ @.str.2, %for.cond9.10 ], [ @.str.2, %for.cond9.11 ], [ @.str.2, %for.cond9.12 ], [ @.str.2, %for.cond9.13 ], [ @.str.2, %for.cond9.14 ], [ @.str.2, %for.cond9.15 ], [ @.str.2, %for.cond9.16 ], [ @.str.2, %for.cond9.17 ], [ @.str.2, %for.cond9.18 ], [ @.str.2, %for.cond9.19 ], [ @.str.2, %for.cond9.20 ], [ @.str.2, %for.cond9.21 ], [ @.str.2, %for.cond9.22 ], [ @.str.2, %for.cond9.23 ], [ %spec.select, %for.cond9.24 ]
%call21 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %ans.0)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
#include<string.h>
int main()
{
int l,i,j,cnt=0,arrcnt[1000]={0};
char str[10000];
scanf("%s",str);
l=strlen(str);
for(i=0;i<l;i++)
{
arrcnt[str[i]-97]++;
}
for(i=0;i<26;i++)
{
if(arrcnt[i]%2!=0)
{
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291539/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291539/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%arrcnt = alloca [1000 x i32], align 16
%str = alloca [10000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %arrcnt) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %arrcnt, i8 0, i64 4000, i1 false)
call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %str) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #7
%conv = trunc i64 %call2 to i32
%cmp32 = icmp sgt i32 %conv, 0
br i1 %cmp32, label %for.body.preheader, label %for.cond8
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
%xtraiter = and i64 %call2, 1
%0 = icmp eq i64 %wide.trip.count, 1
br i1 %0, label %for.cond8.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body
for.cond8.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond8.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond8.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [10000 x i8], ptr %str, i64 0, i64 %indvars.iv.unr
%1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%conv4.epil = sext i8 %1 to i64
%sub.epil = add nsw i64 %conv4.epil, -97
%arrayidx6.epil = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 %sub.epil
%2 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !8
%inc.epil = add nsw i32 %2, 1
store i32 %inc.epil, ptr %arrayidx6.epil, align 4, !tbaa !8
br label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.cond8.preheader.unr-lcssa, %for.body.epil
%.pre = load i32, ptr %arrcnt, align 16, !tbaa !8
%3 = and i32 %.pre, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %for.cond8, label %if.then
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [10000 x i8], ptr %str, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx, align 2, !tbaa !5
%conv4 = sext i8 %5 to i64
%sub = add nsw i64 %conv4, -97
%arrayidx6 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 %sub
%6 = load i32, ptr %arrayidx6, align 4, !tbaa !8
%inc = add nsw i32 %6, 1
store i32 %inc, ptr %arrayidx6, align 4, !tbaa !8
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [10000 x i8], ptr %str, i64 0, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv4.1 = sext i8 %7 to i64
%sub.1 = add nsw i64 %conv4.1, -97
%arrayidx6.1 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 %sub.1
%8 = load i32, ptr %arrayidx6.1, align 4, !tbaa !8
%inc.1 = add nsw i32 %8, 1
store i32 %inc.1, ptr %arrayidx6.1, align 4, !tbaa !8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond8.preheader.unr-lcssa, label %for.body, !llvm.loop !10
for.cond8: ; preds = %entry, %for.cond8.preheader
%arrayidx13.1 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 1
%9 = load i32, ptr %arrayidx13.1, align 4, !tbaa !8
%10 = and i32 %9, 1
%cmp14.not.1 = icmp eq i32 %10, 0
br i1 %cmp14.not.1, label %for.cond8.1, label %if.then
for.cond8.1: ; preds = %for.cond8
%arrayidx13.2 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 2
%11 = load i32, ptr %arrayidx13.2, align 8, !tbaa !8
%12 = and i32 %11, 1
%cmp14.not.2 = icmp eq i32 %12, 0
br i1 %cmp14.not.2, label %for.cond8.2, label %if.then
for.cond8.2: ; preds = %for.cond8.1
%arrayidx13.3 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 3
%13 = load i32, ptr %arrayidx13.3, align 4, !tbaa !8
%14 = and i32 %13, 1
%cmp14.not.3 = icmp eq i32 %14, 0
br i1 %cmp14.not.3, label %for.cond8.3, label %if.then
for.cond8.3: ; preds = %for.cond8.2
%arrayidx13.4 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 4
%15 = load i32, ptr %arrayidx13.4, align 16, !tbaa !8
%16 = and i32 %15, 1
%cmp14.not.4 = icmp eq i32 %16, 0
br i1 %cmp14.not.4, label %for.cond8.4, label %if.then
for.cond8.4: ; preds = %for.cond8.3
%arrayidx13.5 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 5
%17 = load i32, ptr %arrayidx13.5, align 4, !tbaa !8
%18 = and i32 %17, 1
%cmp14.not.5 = icmp eq i32 %18, 0
br i1 %cmp14.not.5, label %for.cond8.5, label %if.then
for.cond8.5: ; preds = %for.cond8.4
%arrayidx13.6 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 6
%19 = load i32, ptr %arrayidx13.6, align 8, !tbaa !8
%20 = and i32 %19, 1
%cmp14.not.6 = icmp eq i32 %20, 0
br i1 %cmp14.not.6, label %for.cond8.6, label %if.then
for.cond8.6: ; preds = %for.cond8.5
%arrayidx13.7 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 7
%21 = load i32, ptr %arrayidx13.7, align 4, !tbaa !8
%22 = and i32 %21, 1
%cmp14.not.7 = icmp eq i32 %22, 0
br i1 %cmp14.not.7, label %for.cond8.7, label %if.then
for.cond8.7: ; preds = %for.cond8.6
%arrayidx13.8 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 8
%23 = load i32, ptr %arrayidx13.8, align 16, !tbaa !8
%24 = and i32 %23, 1
%cmp14.not.8 = icmp eq i32 %24, 0
br i1 %cmp14.not.8, label %for.cond8.8, label %if.then
for.cond8.8: ; preds = %for.cond8.7
%arrayidx13.9 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 9
%25 = load i32, ptr %arrayidx13.9, align 4, !tbaa !8
%26 = and i32 %25, 1
%cmp14.not.9 = icmp eq i32 %26, 0
br i1 %cmp14.not.9, label %for.cond8.9, label %if.then
for.cond8.9: ; preds = %for.cond8.8
%arrayidx13.10 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 10
%27 = load i32, ptr %arrayidx13.10, align 8, !tbaa !8
%28 = and i32 %27, 1
%cmp14.not.10 = icmp eq i32 %28, 0
br i1 %cmp14.not.10, label %for.cond8.10, label %if.then
for.cond8.10: ; preds = %for.cond8.9
%arrayidx13.11 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 11
%29 = load i32, ptr %arrayidx13.11, align 4, !tbaa !8
%30 = and i32 %29, 1
%cmp14.not.11 = icmp eq i32 %30, 0
br i1 %cmp14.not.11, label %for.cond8.11, label %if.then
for.cond8.11: ; preds = %for.cond8.10
%arrayidx13.12 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 12
%31 = load i32, ptr %arrayidx13.12, align 16, !tbaa !8
%32 = and i32 %31, 1
%cmp14.not.12 = icmp eq i32 %32, 0
br i1 %cmp14.not.12, label %for.cond8.12, label %if.then
for.cond8.12: ; preds = %for.cond8.11
%arrayidx13.13 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 13
%33 = load i32, ptr %arrayidx13.13, align 4, !tbaa !8
%34 = and i32 %33, 1
%cmp14.not.13 = icmp eq i32 %34, 0
br i1 %cmp14.not.13, label %for.cond8.13, label %if.then
for.cond8.13: ; preds = %for.cond8.12
%arrayidx13.14 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 14
%35 = load i32, ptr %arrayidx13.14, align 8, !tbaa !8
%36 = and i32 %35, 1
%cmp14.not.14 = icmp eq i32 %36, 0
br i1 %cmp14.not.14, label %for.cond8.14, label %if.then
for.cond8.14: ; preds = %for.cond8.13
%arrayidx13.15 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 15
%37 = load i32, ptr %arrayidx13.15, align 4, !tbaa !8
%38 = and i32 %37, 1
%cmp14.not.15 = icmp eq i32 %38, 0
br i1 %cmp14.not.15, label %for.cond8.15, label %if.then
for.cond8.15: ; preds = %for.cond8.14
%arrayidx13.16 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 16
%39 = load i32, ptr %arrayidx13.16, align 16, !tbaa !8
%40 = and i32 %39, 1
%cmp14.not.16 = icmp eq i32 %40, 0
br i1 %cmp14.not.16, label %for.cond8.16, label %if.then
for.cond8.16: ; preds = %for.cond8.15
%arrayidx13.17 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 17
%41 = load i32, ptr %arrayidx13.17, align 4, !tbaa !8
%42 = and i32 %41, 1
%cmp14.not.17 = icmp eq i32 %42, 0
br i1 %cmp14.not.17, label %for.cond8.17, label %if.then
for.cond8.17: ; preds = %for.cond8.16
%arrayidx13.18 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 18
%43 = load i32, ptr %arrayidx13.18, align 8, !tbaa !8
%44 = and i32 %43, 1
%cmp14.not.18 = icmp eq i32 %44, 0
br i1 %cmp14.not.18, label %for.cond8.18, label %if.then
for.cond8.18: ; preds = %for.cond8.17
%arrayidx13.19 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 19
%45 = load i32, ptr %arrayidx13.19, align 4, !tbaa !8
%46 = and i32 %45, 1
%cmp14.not.19 = icmp eq i32 %46, 0
br i1 %cmp14.not.19, label %for.cond8.19, label %if.then
for.cond8.19: ; preds = %for.cond8.18
%arrayidx13.20 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 20
%47 = load i32, ptr %arrayidx13.20, align 16, !tbaa !8
%48 = and i32 %47, 1
%cmp14.not.20 = icmp eq i32 %48, 0
br i1 %cmp14.not.20, label %for.cond8.20, label %if.then
for.cond8.20: ; preds = %for.cond8.19
%arrayidx13.21 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 21
%49 = load i32, ptr %arrayidx13.21, align 4, !tbaa !8
%50 = and i32 %49, 1
%cmp14.not.21 = icmp eq i32 %50, 0
br i1 %cmp14.not.21, label %for.cond8.21, label %if.then
for.cond8.21: ; preds = %for.cond8.20
%arrayidx13.22 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 22
%51 = load i32, ptr %arrayidx13.22, align 8, !tbaa !8
%52 = and i32 %51, 1
%cmp14.not.22 = icmp eq i32 %52, 0
br i1 %cmp14.not.22, label %for.cond8.22, label %if.then
for.cond8.22: ; preds = %for.cond8.21
%arrayidx13.23 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 23
%53 = load i32, ptr %arrayidx13.23, align 4, !tbaa !8
%54 = and i32 %53, 1
%cmp14.not.23 = icmp eq i32 %54, 0
br i1 %cmp14.not.23, label %for.cond8.23, label %if.then
for.cond8.23: ; preds = %for.cond8.22
%arrayidx13.24 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 24
%55 = load i32, ptr %arrayidx13.24, align 16, !tbaa !8
%56 = and i32 %55, 1
%cmp14.not.24 = icmp eq i32 %56, 0
br i1 %cmp14.not.24, label %for.cond8.24, label %if.then
for.cond8.24: ; preds = %for.cond8.23
%arrayidx13.25 = getelementptr inbounds [1000 x i32], ptr %arrcnt, i64 0, i64 25
%57 = load i32, ptr %arrayidx13.25, align 4, !tbaa !8
%58 = and i32 %57, 1
%cmp14.not.25 = icmp eq i32 %58, 0
br i1 %cmp14.not.25, label %cleanup, label %if.then
if.then: ; preds = %for.cond8.24, %for.cond8.23, %for.cond8.22, %for.cond8.21, %for.cond8.20, %for.cond8.19, %for.cond8.18, %for.cond8.17, %for.cond8.16, %for.cond8.15, %for.cond8.14, %for.cond8.13, %for.cond8.12, %for.cond8.11, %for.cond8.10, %for.cond8.9, %for.cond8.8, %for.cond8.7, %for.cond8.6, %for.cond8.5, %for.cond8.4, %for.cond8.3, %for.cond8.2, %for.cond8.1, %for.cond8, %for.cond8.preheader
br label %cleanup
cleanup: ; preds = %for.cond8.24, %if.then
%str.sink = phi ptr [ @str.3, %if.then ], [ @str, %for.cond8.24 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %str) #6
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %arrcnt) #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: 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 nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 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 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
void testcase()
{
long int x;
scanf("%ld",&x);
printf("2 %ld\n",x-1);
}
int main()
{
long int test;
scanf("%ld",&test);
while(test--)
testcase();
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_29159/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_29159/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"2 %ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @testcase() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
%sub = add nsw i64 %0, -1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3
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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x.i = alloca i64, align 8
%test = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %test) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %test)
%0 = load i64, ptr %test, align 8, !tbaa !5
%dec1 = add nsw i64 %0, -1
store i64 %dec1, ptr %test, align 8, !tbaa !5
%tobool.not2 = icmp eq i64 %0, 0
br i1 %tobool.not2, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x.i) #3
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x.i)
%1 = load i64, ptr %x.i, align 8, !tbaa !5
%sub.i = add nsw i64 %1, -1
%call1.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x.i) #3
%2 = load i64, ptr %test, align 8, !tbaa !5
%dec = add nsw i64 %2, -1
store i64 %dec, ptr %test, align 8, !tbaa !5
%tobool.not = icmp eq i64 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %test) #3
ret i32 0
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int t;
scanf("%d", &t);
while(t--)
{
int p;
scanf("%d", &p);
printf("%d %d\n", 2, p - 1);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_29164/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_29164/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec3 = add nsw i32 %0, -1
store i32 %dec3, ptr %t, align 4, !tbaa !5
%tobool.not4 = icmp eq i32 %0, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%1 = load i32, ptr %p, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 2, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #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.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
void make_number_of_combination(long long int now[1001][10]) {
int a, i, j;
long long int pre[1001][10] = {{0}};
for (a = 0; a < 101; a++) {
now[a][0] = 1;
for (i = 0; i < 1001; i++) {
if (i+a > 1000)
break;
for (j = 0; j < 9; j++) {
now[i+a][j+1] += pre[i][j];
}
}
for (i = 0; i < 1001; i++) {
for (j = 0; j < 10; j++) {
pre[i][j] = now[i][j];
}
}
}
}
int main(void) {
int n, s;
long long int ans[1001][10] = {{0}};
make_number_of_combination(ans);
while (1) {
scanf("%d %d", &n, &s);
if (n == 0 && s == 0)
break;
printf("%lld\n", ans[s][n-1]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291690/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291690/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @make_number_of_combination(ptr nocapture noundef %now) local_unnamed_addr #0 {
entry:
%pre = alloca [1001 x [10 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 80080, ptr nonnull %pre) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80080) %pre, i8 0, i64 80080, i1 false)
br label %for.body
for.body: ; preds = %entry, %for.end22
%indvars.iv85 = phi i64 [ 0, %entry ], [ %indvars.iv.next86, %for.end22 ]
%indvars.iv83 = phi i64 [ 1001, %entry ], [ %indvars.iv.next84, %for.end22 ]
%arrayidx = getelementptr inbounds [10 x i64], ptr %now, i64 %indvars.iv85
store i64 1, ptr %arrayidx, align 8, !tbaa !5
br label %for.body4
for.body4: ; preds = %for.body, %for.cond6.preheader
%indvars.iv = phi i64 [ 0, %for.body ], [ %indvars.iv.next, %for.cond6.preheader ]
%exitcond = icmp eq i64 %indvars.iv, %indvars.iv83
br i1 %exitcond, label %for.end22, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body4
%0 = add nuw nsw i64 %indvars.iv, %indvars.iv85
%arrayidx12 = getelementptr inbounds [1001 x [10 x i64]], ptr %pre, i64 0, i64 %indvars.iv, i64 0
%arrayidx18 = getelementptr inbounds [10 x i64], ptr %now, i64 %0, i64 1
%1 = load <2 x i64>, ptr %arrayidx12, align 16, !tbaa !5
%2 = load <2 x i64>, ptr %arrayidx18, align 8, !tbaa !5
%3 = add nsw <2 x i64> %2, %1
store <2 x i64> %3, ptr %arrayidx18, align 8, !tbaa !5
%arrayidx12.2 = getelementptr inbounds [1001 x [10 x i64]], ptr %pre, i64 0, i64 %indvars.iv, i64 2
%arrayidx18.2 = getelementptr inbounds [10 x i64], ptr %now, i64 %0, i64 3
%4 = load <2 x i64>, ptr %arrayidx12.2, align 16, !tbaa !5
%5 = load <2 x i64>, ptr %arrayidx18.2, align 8, !tbaa !5
%6 = add nsw <2 x i64> %5, %4
store <2 x i64> %6, ptr %arrayidx18.2, align 8, !tbaa !5
%arrayidx12.4 = getelementptr inbounds [1001 x [10 x i64]], ptr %pre, i64 0, i64 %indvars.iv, i64 4
%arrayidx18.4 = getelementptr inbounds [10 x i64], ptr %now, i64 %0, i64 5
%7 = load <2 x i64>, ptr %arrayidx12.4, align 16, !tbaa !5
%8 = load <2 x i64>, ptr %arrayidx18.4, align 8, !tbaa !5
%9 = add nsw <2 x i64> %8, %7
store <2 x i64> %9, ptr %arrayidx18.4, align 8, !tbaa !5
%arrayidx12.6 = getelementptr inbounds [1001 x [10 x i64]], ptr %pre, i64 0, i64 %indvars.iv, i64 6
%arrayidx18.6 = getelementptr inbounds [10 x i64], ptr %now, i64 %0, i64 7
%10 = load <2 x i64>, ptr %arrayidx12.6, align 16, !tbaa !5
%11 = load <2 x i64>, ptr %arrayidx18.6, align 8, !tbaa !5
%12 = add nsw <2 x i64> %11, %10
store <2 x i64> %12, ptr %arrayidx18.6, align 8, !tbaa !5
%arrayidx12.8 = getelementptr inbounds [1001 x [10 x i64]], ptr %pre, i64 0, i64 %indvars.iv, i64 8
%13 = load i64, ptr %arrayidx12.8, align 16, !tbaa !5
%arrayidx18.8 = getelementptr inbounds [10 x i64], ptr %now, i64 %0, i64 9
%14 = load i64, ptr %arrayidx18.8, align 8, !tbaa !5
%add19.8 = add nsw i64 %14, %13
store i64 %add19.8, ptr %arrayidx18.8, align 8, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond77.not = icmp eq i64 %indvars.iv.next, 1001
br i1 %exitcond77.not, label %for.end22, label %for.body4, !llvm.loop !9
for.end22: ; preds = %for.body4, %for.cond6.preheader
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(80080) %pre, ptr noundef nonnull align 8 dereferenceable(80080) %now, i64 80080, i1 false), !tbaa !5
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%indvars.iv.next84 = add nsw i64 %indvars.iv83, -1
%exitcond90.not = icmp eq i64 %indvars.iv.next86, 101
br i1 %exitcond90.not, label %for.end45, label %for.body, !llvm.loop !11
for.end45: ; preds = %for.end22
call void @llvm.lifetime.end.p0(i64 80080, ptr nonnull %pre) #6
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%s = alloca i32, align 4
%ans = alloca [1001 x [10 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 80080, ptr nonnull %ans) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80080) %ans, i8 0, i64 80080, i1 false)
call void @make_number_of_combination(ptr noundef nonnull %ans)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !12
%cmp6 = icmp eq i32 %0, 0
%1 = load i32, ptr %s, align 4
%cmp17 = icmp eq i32 %1, 0
%or.cond8 = select i1 %cmp6, i1 %cmp17, i1 false
br i1 %or.cond8, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end
%2 = phi i32 [ %6, %if.end ], [ %1, %entry ]
%3 = phi i32 [ %5, %if.end ], [ %0, %entry ]
%idxprom = sext i32 %2 to i64
%sub = add nsw i32 %3, -1
%idxprom2 = sext i32 %sub to i64
%arrayidx3 = getelementptr inbounds [1001 x [10 x i64]], ptr %ans, i64 0, i64 %idxprom, i64 %idxprom2
%4 = load i64, ptr %arrayidx3, align 8, !tbaa !5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s)
%5 = load i32, ptr %n, align 4, !tbaa !12
%cmp = icmp eq i32 %5, 0
%6 = load i32, ptr %s, align 4
%cmp1 = icmp eq i32 %6, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 80080, ptr nonnull %ans) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5
attributes #0 = { nofree 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13, i64 0}
!13 = !{!"int", !7, i64 0}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int calc(int n){
int total=1;
if(n==1){
return total;
}else{
for(int i=1;i<n;i++){
total = total+pow(10,i);
}
}
return total;
}
int main(void){
int a, b;
int cmp;
scanf("%d %d", &a, &b);
if(a>=b){
cmp = b*calc(a);
}else{
cmp = a*calc(b);
}
printf("%d", cmp);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291733/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291733/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 memory(write) uwtable
define dso_local i32 @calc(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp19 = icmp sgt i32 %n, 1
br i1 %cmp19, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%0 = add i32 %n, -1
%1 = add i32 %n, -2
%xtraiter = and i32 %0, 3
%2 = icmp ult i32 %1, 3
br i1 %2, label %cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %0, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%i.011 = phi i32 [ 1, %for.body.preheader.new ], [ %inc.3, %for.body ]
%total.010 = phi i32 [ 1, %for.body.preheader.new ], [ %conv3.3, %for.body ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%conv = sitofp i32 %total.010 to double
%conv2 = sitofp i32 %i.011 to double
%call = tail call double @pow(double noundef 1.000000e+01, double noundef %conv2) #5
%add = fadd double %call, %conv
%conv3 = fptosi double %add to i32
%inc = add nuw nsw i32 %i.011, 1
%conv.1 = sitofp i32 %conv3 to double
%conv2.1 = sitofp i32 %inc to double
%call.1 = tail call double @pow(double noundef 1.000000e+01, double noundef %conv2.1) #5
%add.1 = fadd double %call.1, %conv.1
%conv3.1 = fptosi double %add.1 to i32
%inc.1 = add nuw nsw i32 %i.011, 2
%conv.2 = sitofp i32 %conv3.1 to double
%conv2.2 = sitofp i32 %inc.1 to double
%call.2 = tail call double @pow(double noundef 1.000000e+01, double noundef %conv2.2) #5
%add.2 = fadd double %call.2, %conv.2
%conv3.2 = fptosi double %add.2 to i32
%inc.2 = add nuw nsw i32 %i.011, 3
%conv.3 = sitofp i32 %conv3.2 to double
%conv2.3 = sitofp i32 %inc.2 to double
%call.3 = tail call double @pow(double noundef 1.000000e+01, double noundef %conv2.3) #5
%add.3 = fadd double %call.3, %conv.3
%conv3.3 = fptosi double %add.3 to i32
%inc.3 = add nuw nsw i32 %i.011, 4
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !5
cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%conv3.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %conv3.3, %for.body ]
%i.011.unr = phi i32 [ 1, %for.body.preheader ], [ %inc.3, %for.body ]
%total.010.unr = phi i32 [ 1, %for.body.preheader ], [ %conv3.3, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %cleanup, label %for.body.epil
for.body.epil: ; preds = %cleanup.loopexit.unr-lcssa, %for.body.epil
%i.011.epil = phi i32 [ %inc.epil, %for.body.epil ], [ %i.011.unr, %cleanup.loopexit.unr-lcssa ]
%total.010.epil = phi i32 [ %conv3.epil, %for.body.epil ], [ %total.010.unr, %cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %cleanup.loopexit.unr-lcssa ]
%conv.epil = sitofp i32 %total.010.epil to double
%conv2.epil = sitofp i32 %i.011.epil to double
%call.epil = tail call double @pow(double noundef 1.000000e+01, double noundef %conv2.epil) #5
%add.epil = fadd double %call.epil, %conv.epil
%conv3.epil = fptosi double %add.epil to i32
%inc.epil = add nuw nsw i32 %i.011.epil, 1
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %cleanup, label %for.body.epil, !llvm.loop !7
cleanup: ; preds = %cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%retval.0 = phi i32 [ 1, %entry ], [ %conv3.lcssa.ph, %cleanup.loopexit.unr-lcssa ], [ %conv3.epil, %for.body.epil ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
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 %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !9
%1 = load i32, ptr %b, align 4, !tbaa !9
%cmp1.not = icmp slt i32 %0, %1
br i1 %cmp1.not, label %if.else, label %if.then
if.then: ; preds = %entry
%cmp19.i = icmp sgt i32 %0, 1
br i1 %cmp19.i, label %for.body.i.preheader, label %calc.exit
for.body.i.preheader: ; preds = %if.then
%2 = add i32 %0, -1
%3 = add i32 %0, -2
%xtraiter = and i32 %2, 3
%4 = icmp ult i32 %3, 3
br i1 %4, label %calc.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %2, -4
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%i.011.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.3, %for.body.i ]
%total.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %conv3.i.3, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.3, %for.body.i ]
%conv.i = sitofp i32 %total.010.i to double
%conv2.i = sitofp i32 %i.011.i to double
%call.i = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i) #5
%add.i = fadd double %call.i, %conv.i
%conv3.i = fptosi double %add.i to i32
%inc.i = add nuw nsw i32 %i.011.i, 1
%conv.i.1 = sitofp i32 %conv3.i to double
%conv2.i.1 = sitofp i32 %inc.i to double
%call.i.1 = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i.1) #5
%add.i.1 = fadd double %call.i.1, %conv.i.1
%conv3.i.1 = fptosi double %add.i.1 to i32
%inc.i.1 = add nuw nsw i32 %i.011.i, 2
%conv.i.2 = sitofp i32 %conv3.i.1 to double
%conv2.i.2 = sitofp i32 %inc.i.1 to double
%call.i.2 = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i.2) #5
%add.i.2 = fadd double %call.i.2, %conv.i.2
%conv3.i.2 = fptosi double %add.i.2 to i32
%inc.i.2 = add nuw nsw i32 %i.011.i, 3
%conv.i.3 = sitofp i32 %conv3.i.2 to double
%conv2.i.3 = sitofp i32 %inc.i.2 to double
%call.i.3 = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i.3) #5
%add.i.3 = fadd double %call.i.3, %conv.i.3
%conv3.i.3 = fptosi double %add.i.3 to i32
%inc.i.3 = add nuw nsw i32 %i.011.i, 4
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %calc.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !5
calc.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%conv3.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %conv3.i.3, %for.body.i ]
%i.011.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.3, %for.body.i ]
%total.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %conv3.i.3, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %calc.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %calc.exit.loopexit.unr-lcssa, %for.body.i.epil
%i.011.i.epil = phi i32 [ %inc.i.epil, %for.body.i.epil ], [ %i.011.i.unr, %calc.exit.loopexit.unr-lcssa ]
%total.010.i.epil = phi i32 [ %conv3.i.epil, %for.body.i.epil ], [ %total.010.i.unr, %calc.exit.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body.i.epil ], [ 0, %calc.exit.loopexit.unr-lcssa ]
%conv.i.epil = sitofp i32 %total.010.i.epil to double
%conv2.i.epil = sitofp i32 %i.011.i.epil to double
%call.i.epil = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i.epil) #5
%add.i.epil = fadd double %call.i.epil, %conv.i.epil
%conv3.i.epil = fptosi double %add.i.epil to i32
%inc.i.epil = add nuw nsw i32 %i.011.i.epil, 1
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %calc.exit, label %for.body.i.epil, !llvm.loop !13
calc.exit: ; preds = %calc.exit.loopexit.unr-lcssa, %for.body.i.epil, %if.then
%retval.0.i = phi i32 [ 1, %if.then ], [ %conv3.i.lcssa.ph, %calc.exit.loopexit.unr-lcssa ], [ %conv3.i.epil, %for.body.i.epil ]
%mul = mul nsw i32 %retval.0.i, %1
br label %if.end
if.else: ; preds = %entry
%cmp19.i8 = icmp sgt i32 %1, 1
br i1 %cmp19.i8, label %for.body.i10.preheader, label %calc.exit20
for.body.i10.preheader: ; preds = %if.else
%5 = add i32 %1, -1
%6 = add i32 %1, -2
%xtraiter22 = and i32 %5, 3
%7 = icmp ult i32 %6, 3
br i1 %7, label %calc.exit20.loopexit.unr-lcssa, label %for.body.i10.preheader.new
for.body.i10.preheader.new: ; preds = %for.body.i10.preheader
%unroll_iter26 = and i32 %5, -4
br label %for.body.i10
for.body.i10: ; preds = %for.body.i10, %for.body.i10.preheader.new
%i.011.i11 = phi i32 [ 1, %for.body.i10.preheader.new ], [ %inc.i18.3, %for.body.i10 ]
%total.010.i12 = phi i32 [ 1, %for.body.i10.preheader.new ], [ %conv3.i17.3, %for.body.i10 ]
%niter27 = phi i32 [ 0, %for.body.i10.preheader.new ], [ %niter27.next.3, %for.body.i10 ]
%conv.i13 = sitofp i32 %total.010.i12 to double
%conv2.i14 = sitofp i32 %i.011.i11 to double
%call.i15 = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i14) #5
%add.i16 = fadd double %call.i15, %conv.i13
%conv3.i17 = fptosi double %add.i16 to i32
%inc.i18 = add nuw nsw i32 %i.011.i11, 1
%conv.i13.1 = sitofp i32 %conv3.i17 to double
%conv2.i14.1 = sitofp i32 %inc.i18 to double
%call.i15.1 = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i14.1) #5
%add.i16.1 = fadd double %call.i15.1, %conv.i13.1
%conv3.i17.1 = fptosi double %add.i16.1 to i32
%inc.i18.1 = add nuw nsw i32 %i.011.i11, 2
%conv.i13.2 = sitofp i32 %conv3.i17.1 to double
%conv2.i14.2 = sitofp i32 %inc.i18.1 to double
%call.i15.2 = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i14.2) #5
%add.i16.2 = fadd double %call.i15.2, %conv.i13.2
%conv3.i17.2 = fptosi double %add.i16.2 to i32
%inc.i18.2 = add nuw nsw i32 %i.011.i11, 3
%conv.i13.3 = sitofp i32 %conv3.i17.2 to double
%conv2.i14.3 = sitofp i32 %inc.i18.2 to double
%call.i15.3 = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i14.3) #5
%add.i16.3 = fadd double %call.i15.3, %conv.i13.3
%conv3.i17.3 = fptosi double %add.i16.3 to i32
%inc.i18.3 = add nuw nsw i32 %i.011.i11, 4
%niter27.next.3 = add i32 %niter27, 4
%niter27.ncmp.3 = icmp eq i32 %niter27.next.3, %unroll_iter26
br i1 %niter27.ncmp.3, label %calc.exit20.loopexit.unr-lcssa, label %for.body.i10, !llvm.loop !5
calc.exit20.loopexit.unr-lcssa: ; preds = %for.body.i10, %for.body.i10.preheader
%conv3.i17.lcssa.ph = phi i32 [ undef, %for.body.i10.preheader ], [ %conv3.i17.3, %for.body.i10 ]
%i.011.i11.unr = phi i32 [ 1, %for.body.i10.preheader ], [ %inc.i18.3, %for.body.i10 ]
%total.010.i12.unr = phi i32 [ 1, %for.body.i10.preheader ], [ %conv3.i17.3, %for.body.i10 ]
%lcmp.mod24.not = icmp eq i32 %xtraiter22, 0
br i1 %lcmp.mod24.not, label %calc.exit20, label %for.body.i10.epil
for.body.i10.epil: ; preds = %calc.exit20.loopexit.unr-lcssa, %for.body.i10.epil
%i.011.i11.epil = phi i32 [ %inc.i18.epil, %for.body.i10.epil ], [ %i.011.i11.unr, %calc.exit20.loopexit.unr-lcssa ]
%total.010.i12.epil = phi i32 [ %conv3.i17.epil, %for.body.i10.epil ], [ %total.010.i12.unr, %calc.exit20.loopexit.unr-lcssa ]
%epil.iter23 = phi i32 [ %epil.iter23.next, %for.body.i10.epil ], [ 0, %calc.exit20.loopexit.unr-lcssa ]
%conv.i13.epil = sitofp i32 %total.010.i12.epil to double
%conv2.i14.epil = sitofp i32 %i.011.i11.epil to double
%call.i15.epil = call double @pow(double noundef 1.000000e+01, double noundef %conv2.i14.epil) #5
%add.i16.epil = fadd double %call.i15.epil, %conv.i13.epil
%conv3.i17.epil = fptosi double %add.i16.epil to i32
%inc.i18.epil = add nuw nsw i32 %i.011.i11.epil, 1
%epil.iter23.next = add i32 %epil.iter23, 1
%epil.iter23.cmp.not = icmp eq i32 %epil.iter23.next, %xtraiter22
br i1 %epil.iter23.cmp.not, label %calc.exit20, label %for.body.i10.epil, !llvm.loop !14
calc.exit20: ; preds = %calc.exit20.loopexit.unr-lcssa, %for.body.i10.epil, %if.else
%retval.0.i9 = phi i32 [ 1, %if.else ], [ %conv3.i17.lcssa.ph, %calc.exit20.loopexit.unr-lcssa ], [ %conv3.i17.epil, %for.body.i10.epil ]
%mul4 = mul nsw i32 %retval.0.i9, %0
br label %if.end
if.end: ; preds = %calc.exit20, %calc.exit
%cmp.0 = phi i32 [ %mul, %calc.exit ], [ %mul4, %calc.exit20 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cmp.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.unroll.disable"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C/C++ TBAA"}
!13 = distinct !{!13, !8}
!14 = distinct !{!14, !8}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a<=b){
for(int i=1;i<=b;i++){
printf("%d",a);
}
}else{
for(int i=1;i<=a;i++){
printf("%d",b);
}
}
printf("\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291777/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291777/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %for.cond4.preheader, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp1.not16 = icmp slt i32 %1, 1
br i1 %cmp1.not16, label %if.end, label %for.body
for.cond4.preheader: ; preds = %entry
%cmp5.not18 = icmp slt i32 %0, 1
br i1 %cmp5.not18, label %if.end, label %for.body7
for.body: ; preds = %for.cond.preheader, %for.body
%i.017 = phi i32 [ %inc, %for.body ], [ 1, %for.cond.preheader ]
%2 = load i32, ptr %a, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%inc = add nuw nsw i32 %i.017, 1
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp1.not.not = icmp slt i32 %i.017, %3
br i1 %cmp1.not.not, label %for.body, label %if.end, !llvm.loop !9
for.body7: ; preds = %for.cond4.preheader, %for.body7
%i3.019 = phi i32 [ %inc10, %for.body7 ], [ 1, %for.cond4.preheader ]
%4 = load i32, ptr %b, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%inc10 = add nuw nsw i32 %i3.019, 1
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp5.not.not = icmp slt i32 %i3.019, %5
br i1 %cmp5.not.not, label %for.body7, label %if.end, !llvm.loop !11
if.end: ; preds = %for.body, %for.body7, %for.cond.preheader, %for.cond4.preheader
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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}
|
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int p,a,b;
scanf("%d",&p);
printf("%d %d\n",2,p-1);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_29182/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_29182/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec3 = add nsw i32 %0, -1
store i32 %dec3, ptr %t, align 4, !tbaa !5
%tobool.not4 = icmp eq i32 %0, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%1 = load i32, ptr %p, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 2, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #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.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int i, a, b;
scanf("%d %d", &a, &b);
if (a<b){
for (i=0;i<b;i++){
printf("%d", a);
}
}
else{
for (i=0;i<a;i++){
printf("%d", b);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291870/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291870/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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 %for.cond.preheader, label %for.cond3.preheader
for.cond3.preheader: ; preds = %entry
%cmp414 = icmp sgt i32 %0, 0
br i1 %cmp414, label %for.body5, label %if.end
for.cond.preheader: ; preds = %entry
%cmp116 = icmp sgt i32 %1, 0
br i1 %cmp116, label %for.body, label %if.end
for.body: ; preds = %for.cond.preheader, %for.body
%i.017 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%2 = load i32, ptr %a, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%inc = add nuw nsw i32 %i.017, 1
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %3
br i1 %cmp1, label %for.body, label %if.end, !llvm.loop !9
for.body5: ; preds = %for.cond3.preheader, %for.body5
%i.115 = phi i32 [ %inc8, %for.body5 ], [ 0, %for.cond3.preheader ]
%4 = load i32, ptr %b, align 4, !tbaa !5
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%inc8 = add nuw nsw i32 %i.115, 1
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc8, %5
br i1 %cmp4, label %for.body5, label %if.end, !llvm.loop !11
if.end: ; preds = %for.body5, %for.body, %for.cond3.preheader, %for.cond.preheader
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>
#include <stdlib.h>
#include <math.h>
void output(int a, int b){
for(int i=0; i<b; i++)
printf("%d", a);
printf("\n");
}
int main(void){
int a, b, i;
scanf("%d %d", &a, &b);
if(a<b)
output(a, b);
else
output(b, a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291920/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291920/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @output(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i32 %b, 0
br i1 %cmp3, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
for.body: ; preds = %entry, %for.body
%i.04 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a)
%inc = add nuw nsw i32 %i.04, 1
%exitcond.not = icmp eq i32 %inc, %b
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !5
}
; Function Attrs: mustprogress nocallback nofree 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 nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !7
%1 = load i32, ptr %b, align 4, !tbaa !7
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%cmp3.i = icmp sgt i32 %1, 0
br i1 %cmp3.i, label %for.body.i, label %if.end
for.body.i: ; preds = %if.then, %for.body.i
%i.04.i = phi i32 [ %inc.i, %for.body.i ], [ 0, %if.then ]
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%inc.i = add nuw nsw i32 %i.04.i, 1
%exitcond.not.i = icmp eq i32 %inc.i, %1
br i1 %exitcond.not.i, label %if.end, label %for.body.i, !llvm.loop !5
if.else: ; preds = %entry
%cmp3.i3 = icmp sgt i32 %0, 0
br i1 %cmp3.i3, label %for.body.i5, label %if.end
for.body.i5: ; preds = %if.else, %for.body.i5
%i.04.i6 = phi i32 [ %inc.i8, %for.body.i5 ], [ 0, %if.else ]
%call.i7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%inc.i8 = add nuw nsw i32 %i.04.i6, 1
%exitcond.not.i9 = icmp eq i32 %inc.i8, %0
br i1 %exitcond.not.i9, label %if.end, label %for.body.i5, !llvm.loop !5
if.end: ; preds = %for.body.i5, %for.body.i, %if.else, %if.then
%putchar.i4 = call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
char a[20], b[20];
int main() {
int aa, bb;
scanf("%d%d", &aa, &bb);
for (int i = 0; i < bb; i++) a[i] = '0' + aa;
for (int i = 0; i < aa; i++) b[i] = '0' + bb;
printf("%s\n", strcmp(a, b) < 0 ? a : b);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_291971/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_291971/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@a = dso_local global [20 x i8] zeroinitializer, align 16
@b = dso_local global [20 x i8] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%aa = alloca i32, align 4
%bb = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %aa) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %bb) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %aa, ptr noundef nonnull %bb)
%0 = load i32, ptr %bb, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
%.pre = load i32, ptr %aa, align 4, !tbaa !5
br i1 %cmp22, label %for.body.lr.ph, label %for.cond2.preheader
for.body.lr.ph: ; preds = %entry
%1 = trunc i32 %.pre to i8
%conv = add i8 %1, 48
%2 = zext i32 %0 to i64
call void @llvm.memset.p0.i64(ptr nonnull align 16 @a, i8 %conv, i64 %2, i1 false), !tbaa !9
br label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body.lr.ph, %entry
%cmp324 = icmp sgt i32 %.pre, 0
br i1 %cmp324, label %for.body6.lr.ph, label %for.cond.cleanup5
for.body6.lr.ph: ; preds = %for.cond2.preheader
%3 = trunc i32 %0 to i8
%conv8 = add i8 %3, 48
%4 = zext i32 %.pre to i64
call void @llvm.memset.p0.i64(ptr nonnull align 16 @b, i8 %conv8, i64 %4, i1 false), !tbaa !9
br label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %for.body6.lr.ph, %for.cond2.preheader
%call14 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @a, ptr noundef nonnull dereferenceable(1) @b) #7
%cmp15 = icmp slt i32 %call14, 0
%cond = select i1 %cmp15, ptr @a, ptr @b
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %bb) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %aa) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) 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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include <stdio.h>
int main(){
int a,b;
int a_out=0,b_out=0;
int i;
scanf("%d %d",&a,&b);
if(a<=b){
for(i=0;i<b;i++){
a_out*=10;
a_out+=a;
}
printf("%d",a_out);
} else {
for(i=0;i<a;i++){
b_out*=10;
b_out+=b;
}
printf("%d",b_out);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292013/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292013/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %for.cond3.preheader, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp119 = icmp sgt i32 %1, 0
br i1 %cmp119, label %for.body.preheader, label %if.end
for.body.preheader: ; preds = %for.cond.preheader
%xtraiter = and i32 %1, 7
%2 = icmp ult i32 %1, 8
br i1 %2, label %if.end.loopexit28.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %1, -8
br label %for.body
for.cond3.preheader: ; preds = %entry
%cmp422 = icmp sgt i32 %0, 0
br i1 %cmp422, label %for.body5.preheader, label %if.end
for.body5.preheader: ; preds = %for.cond3.preheader
%xtraiter30 = and i32 %0, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %if.end.loopexit.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter34 = and i32 %0, -8
br label %for.body5
for.body: ; preds = %for.body, %for.body.preheader.new
%a_out.020 = phi i32 [ 0, %for.body.preheader.new ], [ %add.7, %for.body ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i32 %a_out.020, 10
%add = add nsw i32 %mul, %0
%mul.1 = mul nsw i32 %add, 10
%add.1 = add nsw i32 %mul.1, %0
%mul.2 = mul nsw i32 %add.1, 10
%add.2 = add nsw i32 %mul.2, %0
%mul.3 = mul nsw i32 %add.2, 10
%add.3 = add nsw i32 %mul.3, %0
%mul.4 = mul nsw i32 %add.3, 10
%add.4 = add nsw i32 %mul.4, %0
%mul.5 = mul nsw i32 %add.4, 10
%add.5 = add nsw i32 %mul.5, %0
%mul.6 = mul nsw i32 %add.5, 10
%add.6 = add nsw i32 %mul.6, %0
%mul.7 = mul nsw i32 %add.6, 10
%add.7 = add nsw i32 %mul.7, %0
%niter.next.7 = add i32 %niter, 8
%niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %if.end.loopexit28.unr-lcssa, label %for.body, !llvm.loop !9
for.body5: ; preds = %for.body5, %for.body5.preheader.new
%b_out.023 = phi i32 [ 0, %for.body5.preheader.new ], [ %add7.7, %for.body5 ]
%niter35 = phi i32 [ 0, %for.body5.preheader.new ], [ %niter35.next.7, %for.body5 ]
%mul6 = mul nsw i32 %b_out.023, 10
%add7 = add nsw i32 %mul6, %1
%mul6.1 = mul nsw i32 %add7, 10
%add7.1 = add nsw i32 %mul6.1, %1
%mul6.2 = mul nsw i32 %add7.1, 10
%add7.2 = add nsw i32 %mul6.2, %1
%mul6.3 = mul nsw i32 %add7.2, 10
%add7.3 = add nsw i32 %mul6.3, %1
%mul6.4 = mul nsw i32 %add7.3, 10
%add7.4 = add nsw i32 %mul6.4, %1
%mul6.5 = mul nsw i32 %add7.4, 10
%add7.5 = add nsw i32 %mul6.5, %1
%mul6.6 = mul nsw i32 %add7.5, 10
%add7.6 = add nsw i32 %mul6.6, %1
%mul6.7 = mul nsw i32 %add7.6, 10
%add7.7 = add nsw i32 %mul6.7, %1
%niter35.next.7 = add i32 %niter35, 8
%niter35.ncmp.7 = icmp eq i32 %niter35.next.7, %unroll_iter34
br i1 %niter35.ncmp.7, label %if.end.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11
if.end.loopexit.unr-lcssa: ; preds = %for.body5, %for.body5.preheader
%add7.lcssa.ph = phi i32 [ undef, %for.body5.preheader ], [ %add7.7, %for.body5 ]
%b_out.023.unr = phi i32 [ 0, %for.body5.preheader ], [ %add7.7, %for.body5 ]
%lcmp.mod32.not = icmp eq i32 %xtraiter30, 0
br i1 %lcmp.mod32.not, label %if.end, label %for.body5.epil
for.body5.epil: ; preds = %if.end.loopexit.unr-lcssa, %for.body5.epil
%b_out.023.epil = phi i32 [ %add7.epil, %for.body5.epil ], [ %b_out.023.unr, %if.end.loopexit.unr-lcssa ]
%epil.iter31 = phi i32 [ %epil.iter31.next, %for.body5.epil ], [ 0, %if.end.loopexit.unr-lcssa ]
%mul6.epil = mul nsw i32 %b_out.023.epil, 10
%add7.epil = add nsw i32 %mul6.epil, %1
%epil.iter31.next = add i32 %epil.iter31, 1
%epil.iter31.cmp.not = icmp eq i32 %epil.iter31.next, %xtraiter30
br i1 %epil.iter31.cmp.not, label %if.end, label %for.body5.epil, !llvm.loop !12
if.end.loopexit28.unr-lcssa: ; preds = %for.body, %for.body.preheader
%add.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %add.7, %for.body ]
%a_out.020.unr = phi i32 [ 0, %for.body.preheader ], [ %add.7, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %if.end, label %for.body.epil
for.body.epil: ; preds = %if.end.loopexit28.unr-lcssa, %for.body.epil
%a_out.020.epil = phi i32 [ %add.epil, %for.body.epil ], [ %a_out.020.unr, %if.end.loopexit28.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %if.end.loopexit28.unr-lcssa ]
%mul.epil = mul nsw i32 %a_out.020.epil, 10
%add.epil = add nsw i32 %mul.epil, %0
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %if.end, label %for.body.epil, !llvm.loop !14
if.end: ; preds = %if.end.loopexit28.unr-lcssa, %for.body.epil, %if.end.loopexit.unr-lcssa, %for.body5.epil, %for.cond3.preheader, %for.cond.preheader
%b_out.0.lcssa.sink = phi i32 [ 0, %for.cond.preheader ], [ 0, %for.cond3.preheader ], [ %add7.lcssa.ph, %if.end.loopexit.unr-lcssa ], [ %add7.epil, %for.body5.epil ], [ %add.lcssa.ph, %if.end.loopexit28.unr-lcssa ], [ %add.epil, %for.body.epil ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %b_out.0.lcssa.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !13}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
int i;
if(a>b)
{
for(i=1;i<=a;i++)
{
printf("%d",b);
}
}
else
{
for(i=1;i<=b;i++)
{
printf("%d",a);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292057/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292057/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %for.cond.preheader, label %for.cond3.preheader
for.cond3.preheader: ; preds = %entry
%cmp4.not14 = icmp slt i32 %1, 1
br i1 %cmp4.not14, label %if.end, label %for.body5
for.cond.preheader: ; preds = %entry
%cmp1.not16 = icmp slt i32 %0, 1
br i1 %cmp1.not16, label %if.end, label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%i.017 = phi i32 [ %inc, %for.body ], [ 1, %for.cond.preheader ]
%2 = load i32, ptr %b, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%inc = add nuw nsw i32 %i.017, 1
%3 = load i32, ptr %a, align 4, !tbaa !5
%cmp1.not.not = icmp slt i32 %i.017, %3
br i1 %cmp1.not.not, label %for.body, label %if.end, !llvm.loop !9
for.body5: ; preds = %for.cond3.preheader, %for.body5
%i.115 = phi i32 [ %inc8, %for.body5 ], [ 1, %for.cond3.preheader ]
%4 = load i32, ptr %a, align 4, !tbaa !5
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%inc8 = add nuw nsw i32 %i.115, 1
%5 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %i.115, %5
br i1 %cmp4.not.not, label %for.body5, label %if.end, !llvm.loop !11
if.end: ; preds = %for.body5, %for.body, %for.cond3.preheader, %for.cond.preheader
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 main()
{
int n,g,f;
scanf("%d",&n);
if (n%3==0){
f=n/3;
g=2*f;
}
else{
f=n/3;
g=2*f+1;
}
printf("%d",g);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_29210/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_29210/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 3
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %0, 3
%mul = shl nsw i32 %div, 1
%add = zext i1 %cmp to i32
%g.0 = or i32 %mul, %add
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %g.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int x,b,t,candies;
scanf("%d %d %d", &x,&b,&t);
if(x>t) printf("0\n");
else
{
candies=b*(t/x);
printf("%d\n", candies);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292143/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292143/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #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 %x, ptr noundef nonnull %b, ptr noundef nonnull %t)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %1, %0
%mul = mul nsw i32 %div, %2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int a,b,t;
scanf("%d%d%d", &a,&b,&t);
printf("%d\n", t/a*b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292187/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292187/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %2, %div
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int A, B, T;
scanf("%d%d%d", &A, &B, &T);
int times = T/A; //times回生産する
printf("%d\n", B*times);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292244/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292244/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%T = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%1 = load i32, ptr %A, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%2 = load i32, ptr %B, align 4, !tbaa !5
%mul = mul nsw i32 %2, %div
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int A,B,T,cou;
scanf("%d %d %d",&A,&B,&T);
cou=T/A;
printf("%d",cou*B);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292288/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292288/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%T = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%1 = load i32, ptr %A, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%2 = load i32, ptr %B, align 4, !tbaa !5
%mul = mul nsw i32 %2, %div
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,t,c;
scanf("%d%d%d",&a,&b,&t);
c=(t+0.5)/a;
printf("%d\n",c*b);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292330/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292330/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%add = fadd double %conv, 5.000000e-01
%1 = load i32, ptr %a, align 4, !tbaa !5
%conv1 = sitofp i32 %1 to double
%div = fdiv double %add, %conv1
%conv2 = fptosi double %div to i32
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %2, %conv2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b,t;
int i;
scanf("%d %d %d",&a,&b,&t);
double time = t + 0.5;
int sum = 0;
for(i = 1; time > a * i; i++){
sum = sum + b;
}
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292381/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292381/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%add = fadd double %conv, 5.000000e-01
%1 = load i32, ptr %a, align 4, !tbaa !5
%conv17 = sitofp i32 %1 to double
%cmp8 = fcmp ogt double %add, %conv17
br i1 %cmp8, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%sum.010 = phi i32 [ 0, %for.body.lr.ph ], [ %add3, %for.body ]
%i.09 = phi i32 [ 1, %for.body.lr.ph ], [ %inc, %for.body ]
%add3 = add nsw i32 %2, %sum.010
%inc = add nuw nsw i32 %i.09, 1
%mul = mul nsw i32 %1, %inc
%conv1 = sitofp i32 %mul to double
%cmp = fcmp ogt double %add, %conv1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add3, %for.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int a,b,t;
scanf("%d %d %d",&a,&b,&t);
printf("%d",t/a*b);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292424/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292424/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %2, %div
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b, t;
scanf("%d %d %d", &a, &b, &t);
printf("%d\n", b * (t / a) );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292468/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292468/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %t, align 4, !tbaa !5
%2 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %1, %2
%mul = mul nsw i32 %div, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,s,t;
scanf("%d %d %d",&a,&b,&t);
s=(t/a)*b;
printf("%d\n",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292510/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292510/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %2, %div
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
int a;
int b;
int t;
int result;
scanf("%d %d %d", &a, &b, &t);
result = (int)(((float)t + 0.5) / (float)a) * b;
printf("%d", result);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292561/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292561/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%conv = sitofp i32 %0 to float
%conv1 = fpext float %conv to double
%add = fadd double %conv1, 5.000000e-01
%1 = load i32, ptr %a, align 4, !tbaa !5
%conv2 = sitofp i32 %1 to float
%conv3 = fpext float %conv2 to double
%div = fdiv double %add, %conv3
%conv4 = fptosi double %div to i32
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %2, %conv4
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int A, B, T;
scanf("%d %d %d", &A, &B, &T);
int X = 0;
for(int i = T; i >= 0; i -= A) {
if(i >= A)
X += B;
}
printf("%d\n", X);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292604/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292604/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%T = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, -1
br i1 %cmp6, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %A, align 4, !tbaa !5
%2 = load i32, ptr %B, align 4
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%X.0.lcssa = phi i32 [ 0, %entry ], [ %X.1, %for.body ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %X.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
for.body: ; preds = %for.body.lr.ph, %for.body
%i.08 = phi i32 [ %0, %for.body.lr.ph ], [ %sub, %for.body ]
%X.07 = phi i32 [ 0, %for.body.lr.ph ], [ %X.1, %for.body ]
%cmp1.not = icmp slt i32 %i.08, %1
%add = select i1 %cmp1.not, i32 0, i32 %2
%X.1 = add nsw i32 %add, %X.07
%sub = sub nsw i32 %i.08, %1
%cmp = icmp sgt i32 %sub, -1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#define MOD 1000000007
int main(){
long a,b,x;
scanf("%ld%ld%ld",&a,&b,&x);
printf("%ld\n",(x+(x-b>0)*(x-b)/(a-b)%MOD*(b%MOD))%MOD);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292648/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292648/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%x = 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 %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%mul = call i64 @llvm.smax.i64(i64 %sub, i64 0)
%2 = load i64, ptr %a, align 8, !tbaa !5
%sub3 = sub nsw i64 %2, %1
%div = sdiv i64 %mul, %sub3
%rem = srem i64 %div, 1000000007
%rem4 = srem i64 %1, 1000000007
%mul5 = mul nsw i64 %rem, %rem4
%add = add nsw i64 %mul5, %0
%rem6 = srem i64 %add, 1000000007
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %rem6)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #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.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int Map[101][101];
int N, u, k, temp;
scanf("%d\n",&N);
for (int ix = 0; ix < N; ix++)
for (int jx = 0; jx < N; jx++)
Map[ix][jx] = 0;
for (int ix = 0; ix < N; ix++){
scanf("%d %d",&u,&k);
for (int kx = 0; kx < k; kx++){
scanf("%d",&temp);
Map[u-1][temp-1] = 1;
}
}
for (int ix = 0; ix < N; ix++)
for (int jx = 0; jx < N; jx++){
if (jx == N-1) printf("%d\n",Map[ix][jx]);
else printf("%d ",Map[ix][jx]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292691/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292691/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%Map = alloca [101 x [101 x i32]], align 16
%N = alloca i32, align 4
%u = alloca i32, align 4
%k = alloca i32, align 4
%temp = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %Map) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp75 = icmp sgt i32 %0, 0
br i1 %cmp75, label %for.cond1.preheader.us.preheader, label %for.cond.cleanup35
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond11.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
%invariant.gep = getelementptr i8, ptr %Map, i64 404
%invariant.gep101 = getelementptr i8, ptr %Map, i64 808
%invariant.gep103 = getelementptr i8, ptr %Map, i64 1212
%invariant.gep105 = getelementptr i8, ptr %Map, i64 1616
%invariant.gep107 = getelementptr i8, ptr %Map, i64 2020
%invariant.gep109 = getelementptr i8, ptr %Map, i64 2424
%invariant.gep111 = getelementptr i8, ptr %Map, i64 2828
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 404
%scevgep = getelementptr i8, ptr %Map, i64 %4
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 404
%gep = getelementptr i8, ptr %invariant.gep, i64 %5
call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 404
%gep102 = getelementptr i8, ptr %invariant.gep101, i64 %6
call void @llvm.memset.p0.i64(ptr align 8 %gep102, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 404
%gep104 = getelementptr i8, ptr %invariant.gep103, i64 %7
call void @llvm.memset.p0.i64(ptr align 4 %gep104, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 404
%gep106 = getelementptr i8, ptr %invariant.gep105, i64 %8
call void @llvm.memset.p0.i64(ptr align 16 %gep106, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 404
%gep108 = getelementptr i8, ptr %invariant.gep107, i64 %9
call void @llvm.memset.p0.i64(ptr align 4 %gep108, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 404
%gep110 = getelementptr i8, ptr %invariant.gep109, i64 %10
call void @llvm.memset.p0.i64(ptr align 8 %gep110, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 404
%gep112 = getelementptr i8, ptr %invariant.gep111, i64 %11
call void @llvm.memset.p0.i64(ptr align 4 %gep112, i8 0, i64 %2, i1 false), !tbaa !5
%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.cond11.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9
for.cond11.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond11.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond11.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond11.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond11.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 404
%scevgep.epil = getelementptr i8, ptr %Map, i64 %12
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%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.cond11.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11
for.cond11.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond11.preheader.unr-lcssa
br i1 %cmp75, label %for.body14, label %for.cond.cleanup35
for.cond33.preheader: ; preds = %for.cond.cleanup18
%cmp3483 = icmp sgt i32 %14, 0
br i1 %cmp3483, label %for.cond38.preheader, label %for.cond.cleanup35
for.body14: ; preds = %for.cond11.preheader, %for.cond.cleanup18
%ix10.080 = phi i32 [ %inc30, %for.cond.cleanup18 ], [ 0, %for.cond11.preheader ]
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp1777 = icmp sgt i32 %13, 0
br i1 %cmp1777, label %for.body19, label %for.cond.cleanup18
for.cond.cleanup18: ; preds = %for.body19, %for.body14
%inc30 = add nuw nsw i32 %ix10.080, 1
%14 = load i32, ptr %N, align 4, !tbaa !5
%cmp12 = icmp slt i32 %inc30, %14
br i1 %cmp12, label %for.body14, label %for.cond33.preheader, !llvm.loop !13
for.body19: ; preds = %for.body14, %for.body19
%kx.078 = phi i32 [ %inc27, %for.body19 ], [ 0, %for.body14 ]
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %temp)
%15 = load i32, ptr %u, align 4, !tbaa !5
%sub = add nsw i32 %15, -1
%idxprom21 = sext i32 %sub to i64
%16 = load i32, ptr %temp, align 4, !tbaa !5
%sub23 = add nsw i32 %16, -1
%idxprom24 = sext i32 %sub23 to i64
%arrayidx25 = getelementptr inbounds [101 x [101 x i32]], ptr %Map, i64 0, i64 %idxprom21, i64 %idxprom24
store i32 1, ptr %arrayidx25, align 4, !tbaa !5
%inc27 = add nuw nsw i32 %kx.078, 1
%17 = load i32, ptr %k, align 4, !tbaa !5
%cmp17 = icmp slt i32 %inc27, %17
br i1 %cmp17, label %for.body19, label %for.cond.cleanup18, !llvm.loop !14
for.cond38.preheader: ; preds = %for.cond33.preheader, %for.cond.cleanup40
%18 = phi i32 [ %19, %for.cond.cleanup40 ], [ %14, %for.cond33.preheader ]
%indvars.iv89 = phi i64 [ %indvars.iv.next90, %for.cond.cleanup40 ], [ 0, %for.cond33.preheader ]
%cmp3981 = icmp sgt i32 %18, 0
br i1 %cmp3981, label %for.body41, label %for.cond38.preheader.for.cond.cleanup40_crit_edge
for.cond38.preheader.for.cond.cleanup40_crit_edge: ; preds = %for.cond38.preheader
%.pre = sext i32 %18 to i64
br label %for.cond.cleanup40
for.cond.cleanup35: ; preds = %for.cond.cleanup40, %entry, %for.cond11.preheader, %for.cond33.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %Map) #4
ret i32 0
for.cond.cleanup40: ; preds = %for.body41, %for.cond38.preheader.for.cond.cleanup40_crit_edge
%.pre-phi = phi i64 [ %.pre, %for.cond38.preheader.for.cond.cleanup40_crit_edge ], [ %24, %for.body41 ]
%19 = phi i32 [ %18, %for.cond38.preheader.for.cond.cleanup40_crit_edge ], [ %23, %for.body41 ]
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%cmp34 = icmp slt i64 %indvars.iv.next90, %.pre-phi
br i1 %cmp34, label %for.cond38.preheader, label %for.cond.cleanup35, !llvm.loop !15
for.body41: ; preds = %for.cond38.preheader, %for.body41
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body41 ], [ 0, %for.cond38.preheader ]
%20 = phi i32 [ %23, %for.body41 ], [ %18, %for.cond38.preheader ]
%sub42 = add nsw i32 %20, -1
%21 = zext i32 %sub42 to i64
%cmp43 = icmp eq i64 %indvars.iv, %21
%arrayidx47 = getelementptr inbounds [101 x [101 x i32]], ptr %Map, i64 0, i64 %indvars.iv89, i64 %indvars.iv
%22 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%.str..str.3 = select i1 %cmp43, ptr @.str, ptr @.str.3
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str..str.3, i32 noundef %22)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%23 = load i32, ptr %N, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp39 = icmp slt i64 %indvars.iv.next, %24
br i1 %cmp39, label %for.body41, label %for.cond.cleanup40, !llvm.loop !17
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
#define N 100
int main(){
int i,j,n,u,k,v;
int V[N][N];
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
V[i][j]=0;
}
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k;j++){
scanf("%d",&v);
V[u-1][v-1]=1;
}
}
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(j) printf(" ");
printf("%d",V[i][j]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292734/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292734/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%u = alloca i32, align 4
%k = alloca i32, align 4
%v = alloca i32, align 4
%V = alloca [100 x [100 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 %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %V) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.cond1.preheader.us.preheader, label %for.end46
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
%invariant.gep = getelementptr i8, ptr %V, i64 400
%invariant.gep83 = getelementptr i8, ptr %V, i64 800
%invariant.gep85 = getelementptr i8, ptr %V, i64 1200
%invariant.gep87 = getelementptr i8, ptr %V, i64 1600
%invariant.gep89 = getelementptr i8, ptr %V, i64 2000
%invariant.gep91 = getelementptr i8, ptr %V, i64 2400
%invariant.gep93 = getelementptr i8, ptr %V, i64 2800
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 400
%scevgep = getelementptr i8, ptr %V, i64 %4
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 400
%gep = getelementptr i8, ptr %invariant.gep, i64 %5
call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 400
%gep84 = getelementptr i8, ptr %invariant.gep83, i64 %6
call void @llvm.memset.p0.i64(ptr align 16 %gep84, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 400
%gep86 = getelementptr i8, ptr %invariant.gep85, i64 %7
call void @llvm.memset.p0.i64(ptr align 16 %gep86, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 400
%gep88 = getelementptr i8, ptr %invariant.gep87, i64 %8
call void @llvm.memset.p0.i64(ptr align 16 %gep88, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 400
%gep90 = getelementptr i8, ptr %invariant.gep89, i64 %9
call void @llvm.memset.p0.i64(ptr align 16 %gep90, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 400
%gep92 = getelementptr i8, ptr %invariant.gep91, i64 %10
call void @llvm.memset.p0.i64(ptr align 16 %gep92, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 400
%gep94 = getelementptr i8, ptr %invariant.gep93, i64 %11
call void @llvm.memset.p0.i64(ptr align 16 %gep94, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 400
%scevgep.epil = getelementptr i8, ptr %V, i64 %12
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp65, label %for.body11, label %for.end46
for.cond28.preheader: ; preds = %for.inc25
%cmp2973 = icmp sgt i32 %17, 0
br i1 %cmp2973, label %for.cond31.preheader, label %for.end46
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%i.170 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp1467 = icmp sgt i32 %13, 0
br i1 %cmp1467, label %for.body15, label %for.inc25
for.body15: ; preds = %for.body11, %for.body15
%j.168 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%14 = load i32, ptr %u, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%idxprom17 = sext i32 %sub to i64
%15 = load i32, ptr %v, align 4, !tbaa !5
%sub19 = add nsw i32 %15, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr %V, i64 0, i64 %idxprom17, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.168, 1
%16 = load i32, ptr %k, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc23, %16
br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !13
for.inc25: ; preds = %for.body15, %for.body11
%inc26 = add nuw nsw i32 %i.170, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc26, %17
br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !14
for.cond31.preheader: ; preds = %for.cond28.preheader, %for.end42
%18 = phi i32 [ %24, %for.end42 ], [ %17, %for.cond28.preheader ]
%indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.end42 ], [ 0, %for.cond28.preheader ]
%cmp3271 = icmp sgt i32 %18, 0
br i1 %cmp3271, label %if.end.peel, label %for.end42
if.end.peel: ; preds = %for.cond31.preheader
%arrayidx38.peel = getelementptr inbounds [100 x [100 x i32]], ptr %V, i64 0, i64 %indvars.iv79, i64 0
%19 = load i32, ptr %arrayidx38.peel, align 16, !tbaa !5
%call39.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19)
%20 = load i32, ptr %n, align 4, !tbaa !5
%cmp32.peel = icmp sgt i32 %20, 1
br i1 %cmp32.peel, label %if.end, label %for.end42
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar62 = call i32 @putchar(i32 32)
%arrayidx38 = getelementptr inbounds [100 x [100 x i32]], ptr %V, i64 0, i64 %indvars.iv79, i64 %indvars.iv
%21 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%22 = load i32, ptr %n, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp32 = icmp slt i64 %indvars.iv.next, %23
br i1 %cmp32, label %if.end, label %for.end42, !llvm.loop !15
for.end42: ; preds = %if.end, %if.end.peel, %for.cond31.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
%24 = load i32, ptr %n, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp29 = icmp slt i64 %indvars.iv.next80, %25
br i1 %cmp29, label %for.cond31.preheader, label %for.end46, !llvm.loop !17
for.end46: ; preds = %for.end42, %entry, %for.cond9.preheader, %for.cond28.preheader
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %V) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
int main(){
int i,j,v,n,m,k;
int V[150][150];
scanf("%d",&n);
for(i = 0; i < n; i++){
scanf("%d%d",&v,&m);
if(m != 0){
for(j = 0; j < m; j++){
scanf("%d",&k);
V[v-1][k-1] = 1;
}
}
}
for(i = 0; i < n; i++){
j = 0;
printf("%d",V[i][j]);
for(j = 1; j < n; j++){
printf(" %d",V[i][j]);
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292785/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292785/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%v = alloca i32, align 4
%n = alloca i32, align 4
%m = alloca i32, align 4
%k = alloca i32, align 4
%V = alloca [150 x [150 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #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 %k) #4
call void @llvm.lifetime.start.p0(i64 90000, ptr nonnull %V) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp48 = icmp sgt i32 %0, 0
br i1 %cmp48, label %for.body, label %for.end35
for.cond13.preheader: ; preds = %for.inc10
%1 = icmp sgt i32 %6, 0
br i1 %1, label %for.body15, label %for.end35
for.body: ; preds = %entry, %for.inc10
%i.049 = phi i32 [ %inc11, %for.inc10 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %m)
%2 = load i32, ptr %m, align 4
%cmp446 = icmp sgt i32 %2, 0
br i1 %cmp446, label %for.body5, label %for.inc10
for.body5: ; preds = %for.body, %for.body5
%j.047 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%3 = load i32, ptr %v, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%idxprom = sext i32 %sub to i64
%4 = load i32, ptr %k, align 4, !tbaa !5
%sub7 = add nsw i32 %4, -1
%idxprom8 = sext i32 %sub7 to i64
%arrayidx9 = getelementptr inbounds [150 x [150 x i32]], ptr %V, i64 0, i64 %idxprom, i64 %idxprom8
store i32 1, ptr %arrayidx9, align 4, !tbaa !5
%inc = add nuw nsw i32 %j.047, 1
%5 = load i32, ptr %m, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %5
br i1 %cmp4, label %for.body5, label %for.inc10, !llvm.loop !9
for.inc10: ; preds = %for.body5, %for.body
%inc11 = add nuw nsw i32 %i.049, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc11, %6
br i1 %cmp, label %for.body, label %for.cond13.preheader, !llvm.loop !11
for.body15: ; preds = %for.cond13.preheader, %for.end31
%indvars.iv55 = phi i64 [ %indvars.iv.next56, %for.end31 ], [ 0, %for.cond13.preheader ]
%arrayidx17 = getelementptr inbounds [150 x [150 x i32]], ptr %V, i64 0, i64 %indvars.iv55
%7 = load i32, ptr %arrayidx17, align 8, !tbaa !5
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp2250 = icmp sgt i32 %8, 1
br i1 %cmp2250, label %for.body23, label %for.end31
for.body23: ; preds = %for.body15, %for.body23
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body23 ], [ 1, %for.body15 ]
%arrayidx27 = getelementptr inbounds [150 x [150 x i32]], ptr %V, i64 0, i64 %indvars.iv55, i64 %indvars.iv
%9 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9)
%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
%cmp22 = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp22, label %for.body23, label %for.end31, !llvm.loop !12
for.end31: ; preds = %for.body23, %for.body15
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp14 = icmp slt i64 %indvars.iv.next56, %13
br i1 %cmp14, label %for.body15, label %for.end35, !llvm.loop !13
for.end35: ; preds = %for.end31, %entry, %for.cond13.preheader
call void @llvm.lifetime.end.p0(i64 90000, ptr nonnull %V) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 4, ptr nonnull %v) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(){
int n,k,u,v,i,j,d[101][101];
scanf("%d",&n);
for(i=0;i<n;i++)
for(j=0;j<n;j++)
d[i][j]=0;
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k;j++){
scanf("%d",&v);
d[i][v-1]=1;
}
}
for(i=0;i<n;i++){
if(i!=0)printf("\n");
for(j=0;j<n;j++){
printf("%d",d[i][j]);
if(j!=n-1)printf(" ");
}
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292842/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292842/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%u = alloca i32, align 4
%v = alloca i32, align 4
%d = alloca [101 x [101 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 %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %d) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp73 = icmp sgt i32 %0, 0
br i1 %cmp73, label %for.cond1.preheader.us.preheader, label %for.end50
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
%invariant.gep = getelementptr i8, ptr %d, i64 404
%invariant.gep103 = getelementptr i8, ptr %d, i64 808
%invariant.gep105 = getelementptr i8, ptr %d, i64 1212
%invariant.gep107 = getelementptr i8, ptr %d, i64 1616
%invariant.gep109 = getelementptr i8, ptr %d, i64 2020
%invariant.gep111 = getelementptr i8, ptr %d, i64 2424
%invariant.gep113 = getelementptr i8, ptr %d, i64 2828
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 404
%scevgep = getelementptr i8, ptr %d, i64 %4
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 404
%gep = getelementptr i8, ptr %invariant.gep, i64 %5
call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 404
%gep104 = getelementptr i8, ptr %invariant.gep103, i64 %6
call void @llvm.memset.p0.i64(ptr align 8 %gep104, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 404
%gep106 = getelementptr i8, ptr %invariant.gep105, i64 %7
call void @llvm.memset.p0.i64(ptr align 4 %gep106, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 404
%gep108 = getelementptr i8, ptr %invariant.gep107, i64 %8
call void @llvm.memset.p0.i64(ptr align 16 %gep108, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 404
%gep110 = getelementptr i8, ptr %invariant.gep109, i64 %9
call void @llvm.memset.p0.i64(ptr align 4 %gep110, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 404
%gep112 = getelementptr i8, ptr %invariant.gep111, i64 %10
call void @llvm.memset.p0.i64(ptr align 8 %gep112, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 404
%gep114 = getelementptr i8, ptr %invariant.gep113, i64 %11
call void @llvm.memset.p0.i64(ptr align 4 %gep114, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 404
%scevgep.epil = getelementptr i8, ptr %d, i64 %12
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp73, label %for.body11, label %for.end50
for.cond27.preheader: ; preds = %for.inc24
%cmp2881 = icmp sgt i32 %16, 0
br i1 %cmp2881, label %for.body29, label %for.end50
for.body11: ; preds = %for.cond9.preheader, %for.inc24
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc24 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp1475 = icmp sgt i32 %13, 0
br i1 %cmp1475, label %for.body15, label %for.inc24
for.body15: ; preds = %for.body11, %for.body15
%j.176 = phi i32 [ %inc22, %for.body15 ], [ 0, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%14 = load i32, ptr %v, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%idxprom19 = sext i32 %sub to i64
%arrayidx20 = getelementptr inbounds [101 x [101 x i32]], ptr %d, i64 0, i64 %indvars.iv, i64 %idxprom19
store i32 1, ptr %arrayidx20, align 4, !tbaa !5
%inc22 = add nuw nsw i32 %j.176, 1
%15 = load i32, ptr %k, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc22, %15
br i1 %cmp14, label %for.body15, label %for.inc24, !llvm.loop !13
for.inc24: ; preds = %for.body15, %for.body11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp10 = icmp slt i64 %indvars.iv.next, %17
br i1 %cmp10, label %for.body11, label %for.cond27.preheader, !llvm.loop !14
for.body29: ; preds = %for.cond27.preheader, %for.inc48
%18 = phi i32 [ %25, %for.inc48 ], [ %16, %for.cond27.preheader ]
%indvars.iv89 = phi i64 [ %indvars.iv.next90, %for.inc48 ], [ 0, %for.cond27.preheader ]
%cmp30.not = icmp eq i64 %indvars.iv89, 0
br i1 %cmp30.not, label %if.end, label %if.then
if.then: ; preds = %for.body29
%putchar69 = call i32 @putchar(i32 10)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body29
%19 = phi i32 [ %.pre, %if.then ], [ %18, %for.body29 ]
%cmp3379 = icmp sgt i32 %19, 0
br i1 %cmp3379, label %for.body34, label %if.end.for.inc48_crit_edge
if.end.for.inc48_crit_edge: ; preds = %if.end
%.pre93 = sext i32 %19 to i64
br label %for.inc48
for.body34: ; preds = %if.end, %for.inc45
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.inc45 ], [ 0, %if.end ]
%arrayidx38 = getelementptr inbounds [101 x [101 x i32]], ptr %d, i64 0, i64 %indvars.iv89, i64 %indvars.iv86
%20 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20)
%21 = load i32, ptr %n, align 4, !tbaa !5
%sub40 = add nsw i32 %21, -1
%22 = zext i32 %sub40 to i64
%cmp41.not = icmp eq i64 %indvars.iv86, %22
br i1 %cmp41.not, label %for.inc45, label %if.then42
if.then42: ; preds = %for.body34
%putchar70 = call i32 @putchar(i32 32)
%.pre92 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc45
for.inc45: ; preds = %for.body34, %if.then42
%23 = phi i32 [ %21, %for.body34 ], [ %.pre92, %if.then42 ]
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%24 = sext i32 %23 to i64
%cmp33 = icmp slt i64 %indvars.iv.next87, %24
br i1 %cmp33, label %for.body34, label %for.inc48, !llvm.loop !15
for.inc48: ; preds = %for.inc45, %if.end.for.inc48_crit_edge
%.pre-phi = phi i64 [ %.pre93, %if.end.for.inc48_crit_edge ], [ %24, %for.inc45 ]
%25 = phi i32 [ %19, %if.end.for.inc48_crit_edge ], [ %23, %for.inc45 ]
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%cmp28 = icmp slt i64 %indvars.iv.next90, %.pre-phi
br i1 %cmp28, label %for.body29, label %for.end50, !llvm.loop !16
for.end50: ; preds = %for.inc48, %entry, %for.cond9.preheader, %for.cond27.preheader
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#define MAX 100
int main(void)
{
int i, j, n, u, k, v, a[MAX+1][MAX+1]={0};
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%d %d", &u, &k);
for (j=0; j<k; j++) {
scanf("%d",&v);
a[u][v] = 1;
}
}
for (i=1; i<=n; i++) {
for (j=1; j<=n-1; j++) {
printf("%d ", a[i][j]);
}
printf("%d\n", a[i][n]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292907/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292907/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%u = alloca i32, align 4
%k = alloca i32, align 4
%v = alloca i32, align 4
%a = alloca [101 x [101 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 %u) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #4
call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %a) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) %a, i8 0, i64 40804, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp44 = icmp sgt i32 %0, 0
br i1 %cmp44, label %for.body, label %for.end32
for.cond11.preheader: ; preds = %for.inc8
%cmp12.not48 = icmp slt i32 %5, 1
br i1 %cmp12.not48, label %for.end32, label %for.cond14.preheader
for.body: ; preds = %entry, %for.inc8
%i.045 = phi i32 [ %inc9, %for.inc8 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k)
%1 = load i32, ptr %k, align 4, !tbaa !5
%cmp342 = icmp sgt i32 %1, 0
br i1 %cmp342, label %for.body4, label %for.inc8
for.body4: ; preds = %for.body, %for.body4
%j.043 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%2 = load i32, ptr %u, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%3 = load i32, ptr %v, align 4, !tbaa !5
%idxprom6 = sext i32 %3 to i64
%arrayidx7 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %idxprom, i64 %idxprom6
store i32 1, ptr %arrayidx7, align 4, !tbaa !5
%inc = add nuw nsw i32 %j.043, 1
%4 = load i32, ptr %k, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc, %4
br i1 %cmp3, label %for.body4, label %for.inc8, !llvm.loop !9
for.inc8: ; preds = %for.body4, %for.body
%inc9 = add nuw nsw i32 %i.045, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc9, %5
br i1 %cmp, label %for.body, label %for.cond11.preheader, !llvm.loop !11
for.cond14.preheader: ; preds = %for.cond11.preheader, %for.end24
%6 = phi i32 [ %11, %for.end24 ], [ %5, %for.cond11.preheader ]
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.end24 ], [ 1, %for.cond11.preheader ]
%cmp15.not.not46 = icmp sgt i32 %6, 1
br i1 %cmp15.not.not46, label %for.body16, label %for.cond14.preheader.for.end24_crit_edge
for.cond14.preheader.for.end24_crit_edge: ; preds = %for.cond14.preheader
%.pre = sext i32 %6 to i64
br label %for.end24
for.body16: ; preds = %for.cond14.preheader, %for.body16
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body16 ], [ 1, %for.cond14.preheader ]
%arrayidx20 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv52, i64 %indvars.iv
%7 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp15.not.not = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp15.not.not, label %for.body16, label %for.end24, !llvm.loop !12
for.end24: ; preds = %for.body16, %for.cond14.preheader.for.end24_crit_edge
%idxprom27.pre-phi = phi i64 [ %.pre, %for.cond14.preheader.for.end24_crit_edge ], [ %9, %for.body16 ]
%arrayidx28 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv52, i64 %idxprom27.pre-phi
%10 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %10)
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp12.not.not = icmp slt i64 %indvars.iv52, %12
br i1 %cmp12.not.not, label %for.cond14.preheader, label %for.end32, !llvm.loop !13
for.end32: ; preds = %for.end24, %entry, %for.cond11.preheader
call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define MAX 100
int main(){
int n, i, j, u, adj, num;
scanf("%d", &n);
int ans[n+1][n+1];
for( i=0; i<n+1; i++){
for( j=0; j<n+1; j++){
ans[i][j] = 0;
}
}
for( i=0; i<n; i++){
scanf("%d %d", &u, &adj);
if( adj == 0 )continue;
for( j=0; j<adj; j++){
scanf("%d", &num);
ans[u][num] = 1;
}
}
for( i=1; i<n+1; i++){
for( j=1; j<n; j++){
printf("%d ", ans[i][j]);
}
printf("%d\n", ans[i][j]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292950/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292950/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%u = alloca i32, align 4
%adj = alloca i32, align 4
%num = 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 %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %adj) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%3 = mul nuw i64 %1, %1
%vla = alloca i32, i64 %3, align 16
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not72 = icmp slt i32 %4, 0
br i1 %cmp.not72, label %for.end53, label %for.cond3.preheader.preheader
for.cond3.preheader.preheader: ; preds = %entry
%5 = shl nuw nsw i64 %1, 2
%6 = add nuw i32 %4, 1
%7 = zext i32 %6 to i64
%8 = shl nuw nsw i64 %7, 2
%xtraiter = and i64 %7, 7
%9 = icmp ult i32 %4, 7
br i1 %9, label %for.cond12.preheader.unr-lcssa, label %for.cond3.preheader.preheader.new
for.cond3.preheader.preheader.new: ; preds = %for.cond3.preheader.preheader
%unroll_iter = and i64 %7, 4294967288
br label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond3.preheader, %for.cond3.preheader.preheader.new
%indvar = phi i64 [ 0, %for.cond3.preheader.preheader.new ], [ %indvar.next.7, %for.cond3.preheader ]
%niter = phi i64 [ 0, %for.cond3.preheader.preheader.new ], [ %niter.next.7, %for.cond3.preheader ]
%10 = mul nuw nsw i64 %5, %indvar
%scevgep = getelementptr i8, ptr %vla, i64 %10
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %scevgep, i8 0, i64 %8, i1 false), !tbaa !5
%indvar.next = or i64 %indvar, 1
%11 = mul nuw nsw i64 %5, %indvar.next
%scevgep.1 = getelementptr i8, ptr %vla, i64 %11
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.1, i8 0, i64 %8, i1 false), !tbaa !5
%indvar.next.1 = or i64 %indvar, 2
%12 = mul nuw nsw i64 %5, %indvar.next.1
%scevgep.2 = getelementptr i8, ptr %vla, i64 %12
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep.2, i8 0, i64 %8, i1 false), !tbaa !5
%indvar.next.2 = or i64 %indvar, 3
%13 = mul nuw nsw i64 %5, %indvar.next.2
%scevgep.3 = getelementptr i8, ptr %vla, i64 %13
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.3, i8 0, i64 %8, i1 false), !tbaa !5
%indvar.next.3 = or i64 %indvar, 4
%14 = mul nuw nsw i64 %5, %indvar.next.3
%scevgep.4 = getelementptr i8, ptr %vla, i64 %14
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %scevgep.4, i8 0, i64 %8, i1 false), !tbaa !5
%indvar.next.4 = or i64 %indvar, 5
%15 = mul nuw nsw i64 %5, %indvar.next.4
%scevgep.5 = getelementptr i8, ptr %vla, i64 %15
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.5, i8 0, i64 %8, i1 false), !tbaa !5
%indvar.next.5 = or i64 %indvar, 6
%16 = mul nuw nsw i64 %5, %indvar.next.5
%scevgep.6 = getelementptr i8, ptr %vla, i64 %16
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep.6, i8 0, i64 %8, i1 false), !tbaa !5
%indvar.next.6 = or i64 %indvar, 7
%17 = mul nuw nsw i64 %5, %indvar.next.6
%scevgep.7 = getelementptr i8, ptr %vla, i64 %17
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.7, i8 0, i64 %8, i1 false), !tbaa !5
%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.cond12.preheader.unr-lcssa, label %for.cond3.preheader, !llvm.loop !9
for.cond12.preheader.unr-lcssa: ; preds = %for.cond3.preheader, %for.cond3.preheader.preheader
%indvar.unr = phi i64 [ 0, %for.cond3.preheader.preheader ], [ %indvar.next.7, %for.cond3.preheader ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond12.preheader, label %for.cond3.preheader.epil
for.cond3.preheader.epil: ; preds = %for.cond12.preheader.unr-lcssa, %for.cond3.preheader.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond3.preheader.epil ], [ %indvar.unr, %for.cond12.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond3.preheader.epil ], [ 0, %for.cond12.preheader.unr-lcssa ]
%18 = mul nuw nsw i64 %5, %indvar.epil
%scevgep.epil = getelementptr i8, ptr %vla, i64 %18
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep.epil, i8 0, i64 %8, i1 false), !tbaa !5
%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.cond12.preheader, label %for.cond3.preheader.epil, !llvm.loop !11
for.cond12.preheader: ; preds = %for.cond3.preheader.epil, %for.cond12.preheader.unr-lcssa
%cmp1376 = icmp sgt i32 %4, 0
br i1 %cmp1376, label %for.body14, label %for.end53
for.cond31.preheader: ; preds = %for.inc28
%cmp33.not80 = icmp slt i32 %24, 1
br i1 %cmp33.not80, label %for.end53, label %for.cond35.preheader
for.body14: ; preds = %for.cond12.preheader, %for.inc28
%i.177 = phi i32 [ %inc29, %for.inc28 ], [ 0, %for.cond12.preheader ]
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %adj)
%19 = load i32, ptr %adj, align 4
%cmp1874 = icmp sgt i32 %19, 0
br i1 %cmp1874, label %for.body19, label %for.inc28
for.body19: ; preds = %for.body14, %for.body19
%j.175 = phi i32 [ %inc26, %for.body19 ], [ 0, %for.body14 ]
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%20 = load i32, ptr %u, align 4, !tbaa !5
%idxprom21 = sext i32 %20 to i64
%21 = mul nsw i64 %idxprom21, %1
%arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %21
%22 = load i32, ptr %num, align 4, !tbaa !5
%idxprom23 = sext i32 %22 to i64
%arrayidx24 = getelementptr inbounds i32, ptr %arrayidx22, i64 %idxprom23
store i32 1, ptr %arrayidx24, align 4, !tbaa !5
%inc26 = add nuw nsw i32 %j.175, 1
%23 = load i32, ptr %adj, align 4, !tbaa !5
%cmp18 = icmp slt i32 %inc26, %23
br i1 %cmp18, label %for.body19, label %for.inc28, !llvm.loop !13
for.inc28: ; preds = %for.body19, %for.body14
%inc29 = add nuw nsw i32 %i.177, 1
%24 = load i32, ptr %n, align 4, !tbaa !5
%cmp13 = icmp slt i32 %inc29, %24
br i1 %cmp13, label %for.body14, label %for.cond31.preheader, !llvm.loop !14
for.cond35.preheader: ; preds = %for.cond31.preheader, %for.end45
%25 = phi i32 [ %31, %for.end45 ], [ %24, %for.cond31.preheader ]
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.end45 ], [ 1, %for.cond31.preheader ]
%cmp3678 = icmp sgt i32 %25, 1
%26 = mul nuw nsw i64 %indvars.iv85, %1
br i1 %cmp3678, label %for.body37.lr.ph, label %for.end45
for.body37.lr.ph: ; preds = %for.cond35.preheader
%arrayidx39 = getelementptr inbounds i32, ptr %vla, i64 %26
br label %for.body37
for.body37: ; preds = %for.body37.lr.ph, %for.body37
%indvars.iv = phi i64 [ 1, %for.body37.lr.ph ], [ %indvars.iv.next, %for.body37 ]
%arrayidx41 = getelementptr inbounds i32, ptr %arrayidx39, i64 %indvars.iv
%27 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%28 = load i32, ptr %n, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp36 = icmp slt i64 %indvars.iv.next, %29
br i1 %cmp36, label %for.body37, label %for.end45, !llvm.loop !15
for.end45: ; preds = %for.body37, %for.cond35.preheader
%j.2.lcssa = phi i64 [ 1, %for.cond35.preheader ], [ %indvars.iv.next, %for.body37 ]
%arrayidx47 = getelementptr inbounds i32, ptr %vla, i64 %26
%idxprom48 = and i64 %j.2.lcssa, 4294967295
%arrayidx49 = getelementptr inbounds i32, ptr %arrayidx47, i64 %idxprom48
%30 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %30)
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%31 = load i32, ptr %n, align 4, !tbaa !5
%32 = sext i32 %31 to i64
%cmp33.not.not = icmp slt i64 %indvars.iv85, %32
br i1 %cmp33.not.not, label %for.cond35.preheader, label %for.end53, !llvm.loop !16
for.end53: ; preds = %for.end45, %entry, %for.cond12.preheader, %for.cond31.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %adj) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
#define N 101
int main(){
int n, m, l, o, i, j;
int g[N][N];
for( i = 0; i < N; i++){
for( j = 0; j < N; j ++){
g[i][j] = 0;
}}
scanf("%d", &n);
for( i = 1; i <= n; i++){
scanf("%d%d", &m, &l);
for( j = 1; j <= l; j++){
scanf("%d", &o);
g[m][o] = 1;
}
}
for(i = 1; i <= n; i++){
for( j = 1; j <= n; j++){
printf("%d",g[i][j]);
if(j != n) printf(" ");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292994/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292994/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%o = alloca i32, align 4
%g = alloca [101 x [101 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 %l) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %o) #5
call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %g) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) %g, i8 0, i64 40804, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp10.not67 = icmp slt i32 %0, 1
br i1 %cmp10.not67, label %for.end46, label %for.body11
for.cond27.preheader: ; preds = %for.inc24
%cmp28.not71 = icmp slt i32 %5, 1
br i1 %cmp28.not71, label %for.end46, label %for.cond30.preheader
for.body11: ; preds = %entry, %for.inc24
%i.168 = phi i32 [ %inc25, %for.inc24 ], [ 1, %entry ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %l)
%1 = load i32, ptr %l, align 4, !tbaa !5
%cmp14.not65 = icmp slt i32 %1, 1
br i1 %cmp14.not65, label %for.inc24, label %for.body15
for.body15: ; preds = %for.body11, %for.body15
%j.166 = phi i32 [ %inc22, %for.body15 ], [ 1, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %o)
%2 = load i32, ptr %m, align 4, !tbaa !5
%idxprom17 = sext i32 %2 to i64
%3 = load i32, ptr %o, align 4, !tbaa !5
%idxprom19 = sext i32 %3 to i64
%arrayidx20 = getelementptr inbounds [101 x [101 x i32]], ptr %g, i64 0, i64 %idxprom17, i64 %idxprom19
store i32 1, ptr %arrayidx20, align 4, !tbaa !5
%inc22 = add nuw nsw i32 %j.166, 1
%4 = load i32, ptr %l, align 4, !tbaa !5
%cmp14.not.not = icmp slt i32 %j.166, %4
br i1 %cmp14.not.not, label %for.body15, label %for.inc24, !llvm.loop !9
for.inc24: ; preds = %for.body15, %for.body11
%inc25 = add nuw nsw i32 %i.168, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp10.not.not = icmp slt i32 %i.168, %5
br i1 %cmp10.not.not, label %for.body11, label %for.cond27.preheader, !llvm.loop !11
for.cond30.preheader: ; preds = %for.cond27.preheader, %for.end42
%6 = phi i32 [ %12, %for.end42 ], [ %5, %for.cond27.preheader ]
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.end42 ], [ 1, %for.cond27.preheader ]
%cmp31.not69 = icmp slt i32 %6, 1
br i1 %cmp31.not69, label %for.end42, label %for.body32
for.body32: ; preds = %for.cond30.preheader, %for.inc40
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc40 ], [ 1, %for.cond30.preheader ]
%arrayidx36 = getelementptr inbounds [101 x [101 x i32]], ptr %g, i64 0, i64 %indvars.iv76, i64 %indvars.iv
%7 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = zext i32 %8 to i64
%cmp38.not = icmp eq i64 %indvars.iv, %9
br i1 %cmp38.not, label %for.inc40, label %if.then
if.then: ; preds = %for.body32
%putchar62 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc40
for.inc40: ; preds = %for.body32, %if.then
%10 = phi i32 [ %8, %for.body32 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = sext i32 %10 to i64
%cmp31.not.not = icmp slt i64 %indvars.iv, %11
br i1 %cmp31.not.not, label %for.body32, label %for.end42, !llvm.loop !12
for.end42: ; preds = %for.inc40, %for.cond30.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp28.not.not = icmp slt i64 %indvars.iv76, %13
br i1 %cmp28.not.not, label %for.cond30.preheader, label %for.end46, !llvm.loop !13
for.end46: ; preds = %for.end42, %entry, %for.cond27.preheader
call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %g) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %o) #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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define N 100
int main(){
int i,j,n,u,v,k;
int aij[N][N];
scanf("%d",&n);
for(i=0; i<N; i++){
for(j=0; j<N; j++) aij[i][j]=0;
}
for(i=0; i<n; i++){
scanf("%d",&u);
scanf("%d",&k);
for(j=0; j<k; j++){
scanf("%d",&v);
aij[u-1][v-1]=1;
}
}
for(i=0; i<n; i++){
for(j=0; j<n-1; j++) printf("%d ",aij[i][j]);
printf("%d",aij[i][n-1]);
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293036/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293036/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%u = alloca i32, align 4
%v = alloca i32, align 4
%k = alloca i32, align 4
%aij = alloca [100 x [100 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 %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %aij) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %aij, i8 0, i64 40000, i1 false), !tbaa !5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp1073 = icmp sgt i32 %0, 0
br i1 %cmp1073, label %for.body11, label %for.end53
for.cond29.preheader: ; preds = %for.inc26
%cmp3078 = icmp sgt i32 %5, 0
br i1 %cmp3078, label %for.cond32.preheader, label %for.end53
for.body11: ; preds = %entry, %for.inc26
%i.174 = phi i32 [ %inc27, %for.inc26 ], [ 0, %entry ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %u)
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%1 = load i32, ptr %k, align 4, !tbaa !5
%cmp1571 = icmp sgt i32 %1, 0
br i1 %cmp1571, label %for.body16, label %for.inc26
for.body16: ; preds = %for.body11, %for.body16
%j.172 = phi i32 [ %inc24, %for.body16 ], [ 0, %for.body11 ]
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%2 = load i32, ptr %u, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom18 = sext i32 %sub to i64
%3 = load i32, ptr %v, align 4, !tbaa !5
%sub20 = add nsw i32 %3, -1
%idxprom21 = sext i32 %sub20 to i64
%arrayidx22 = getelementptr inbounds [100 x [100 x i32]], ptr %aij, i64 0, i64 %idxprom18, i64 %idxprom21
store i32 1, ptr %arrayidx22, align 4, !tbaa !5
%inc24 = add nuw nsw i32 %j.172, 1
%4 = load i32, ptr %k, align 4, !tbaa !5
%cmp15 = icmp slt i32 %inc24, %4
br i1 %cmp15, label %for.body16, label %for.inc26, !llvm.loop !9
for.inc26: ; preds = %for.body16, %for.body11
%inc27 = add nuw nsw i32 %i.174, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc27, %5
br i1 %cmp10, label %for.body11, label %for.cond29.preheader, !llvm.loop !11
for.cond32.preheader: ; preds = %for.cond29.preheader, %for.end43
%6 = phi i32 [ %11, %for.end43 ], [ %5, %for.cond29.preheader ]
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.end43 ], [ 0, %for.cond29.preheader ]
%cmp3476 = icmp sgt i32 %6, 1
br i1 %cmp3476, label %for.body35, label %for.cond32.preheader.for.end43_crit_edge
for.cond32.preheader.for.end43_crit_edge: ; preds = %for.cond32.preheader
%sub3375 = add nsw i32 %6, -1
%.pre = sext i32 %sub3375 to i64
br label %for.end43
for.body35: ; preds = %for.cond32.preheader, %for.body35
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body35 ], [ 0, %for.cond32.preheader ]
%arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %aij, i64 0, i64 %indvars.iv84, i64 %indvars.iv
%7 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%sub33 = add nsw i32 %8, -1
%9 = sext i32 %sub33 to i64
%cmp34 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp34, label %for.body35, label %for.end43, !llvm.loop !12
for.end43: ; preds = %for.body35, %for.cond32.preheader.for.end43_crit_edge
%idxprom47.pre-phi = phi i64 [ %.pre, %for.cond32.preheader.for.end43_crit_edge ], [ %9, %for.body35 ]
%arrayidx48 = getelementptr inbounds [100 x [100 x i32]], ptr %aij, i64 0, i64 %indvars.iv84, i64 %idxprom47.pre-phi
%10 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp30 = icmp slt i64 %indvars.iv.next85, %12
br i1 %cmp30, label %for.cond32.preheader, label %for.end53, !llvm.loop !13
for.end53: ; preds = %for.end43, %entry, %for.cond29.preheader
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %aij) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.