Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
typedef long long ll;
ll gcd(ll u,ll v) {
ll r = u % v;
if( r == 0LL ) return v;
return gcd(v,r);
}
int main() {
ll u,v;
scanf("%lld %lld",&u,&v);
printf("%lld\n",gcd(u,v));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159303/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159303/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %u, i64 noundef %v) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%u.tr = phi i64 [ %u, %entry ], [ %v.tr, %tailrecurse ]
%v.tr = phi i64 [ %v, %entry ], [ %rem, %tailrecurse ]
%rem = srem i64 %u.tr, %v.tr
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %cleanup, label %tailrecurse
cleanup: ; preds = %tailrecurse
ret i64 %v.tr
}
; 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:
%u = alloca i64, align 8
%v = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %u) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %v) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %u, ptr noundef nonnull %v)
%0 = load i64, ptr %u, align 8, !tbaa !5
%1 = load i64, ptr %v, align 8, !tbaa !5
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %entry
%u.tr.i = phi i64 [ %0, %entry ], [ %v.tr.i, %tailrecurse.i ]
%v.tr.i = phi i64 [ %1, %entry ], [ %rem.i, %tailrecurse.i ]
%rem.i = srem i64 %u.tr.i, %v.tr.i
%cmp.i = icmp eq i64 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %tailrecurse.i
gcd.exit: ; preds = %tailrecurse.i
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %v.tr.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %v) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %u) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!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,c;
scanf("%d%d",&a,&b);
while((c=a%b)!=0)
{
a=b;
b=c;
}
printf("%d\n",b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159347/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159347/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%rem3 = srem i32 %a.promoted, %b.promoted
%cmp.not4 = icmp eq i32 %rem3, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%rem6 = phi i32 [ %rem, %while.body ], [ %rem3, %entry ]
%rem25 = phi i32 [ %rem6, %while.body ], [ %b.promoted, %entry ]
%rem = srem i32 %rem25, %rem6
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %rem25, ptr %a, align 4, !tbaa !5
store i32 %rem6, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%.lcssa = phi i32 [ %rem6, %while.cond.while.end_crit_edge ], [ %b.promoted, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int x,y,i,d;
while(1){
scanf("%d %d", &x,&y);
if(x>=1 && y<=1000000000)break;
}
if(x>y){
d=x%y;
for(i=d ; i>0 ; i--){
if(y%i==0 && d%i==0)break;
}
}
else if(x<y){
d=y%x;
for(i=d ; i>0 ; i--){
if(x%i==0 && d%i==0) break;
}
}
else i=x;
printf("%d\n", i);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159390/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159390/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp1 = icmp slt i32 %1, 1000000001
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %while.cond
while.end: ; preds = %while.cond
%cmp2 = icmp sgt i32 %0, %1
br i1 %cmp2, label %if.then3, label %if.else
if.then3: ; preds = %while.end
%rem = srem i32 %0, %1
%cmp450.not = icmp eq i32 %rem, 0
br i1 %cmp450.not, label %if.end30, label %for.body
for.body: ; preds = %if.then3, %for.inc
%i.051 = phi i32 [ %dec, %for.inc ], [ %rem, %if.then3 ]
%rem5 = srem i32 %1, %i.051
%cmp6 = icmp eq i32 %rem5, 0
br i1 %cmp6, label %land.lhs.true7, label %for.inc
land.lhs.true7: ; preds = %for.body
%rem8 = urem i32 %rem, %i.051
%cmp9 = icmp eq i32 %rem8, 0
br i1 %cmp9, label %if.end30, label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true7
%dec = add nsw i32 %i.051, -1
%cmp4 = icmp sgt i32 %i.051, 1
br i1 %cmp4, label %for.body, label %if.end30, !llvm.loop !9
if.else: ; preds = %while.end
%cmp12 = icmp slt i32 %0, %1
br i1 %cmp12, label %if.then13, label %if.end30
if.then13: ; preds = %if.else
%rem14 = urem i32 %1, %0
%cmp1647.not = icmp eq i32 %rem14, 0
br i1 %cmp1647.not, label %if.end30, label %for.body17
for.body17: ; preds = %if.then13, %for.inc25
%i.148 = phi i32 [ %dec26, %for.inc25 ], [ %rem14, %if.then13 ]
%rem18 = srem i32 %0, %i.148
%cmp19 = icmp eq i32 %rem18, 0
br i1 %cmp19, label %land.lhs.true20, label %for.inc25
land.lhs.true20: ; preds = %for.body17
%rem21 = srem i32 %rem14, %i.148
%cmp22 = icmp eq i32 %rem21, 0
br i1 %cmp22, label %if.end30, label %for.inc25
for.inc25: ; preds = %for.body17, %land.lhs.true20
%dec26 = add nsw i32 %i.148, -1
%cmp16 = icmp sgt i32 %i.148, 1
br i1 %cmp16, label %for.body17, label %if.end30, !llvm.loop !11
if.end30: ; preds = %for.inc25, %land.lhs.true20, %land.lhs.true7, %for.inc, %if.then13, %if.then3, %if.else
%i.2 = phi i32 [ %0, %if.else ], [ 0, %if.then3 ], [ 0, %if.then13 ], [ %i.051, %land.lhs.true7 ], [ 0, %for.inc ], [ 0, %for.inc25 ], [ %i.148, %land.lhs.true20 ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int x,y,smo,big,arr=1,arr2,ans;
scanf("%d%d",&x,&y);
if(x>=y){
smo=y;
big=x;
}
else{
smo=x;
big=y;
}
while(1){
arr=(big%smo);
if(arr==0){
ans=smo;
break;
}
arr2=smo;
smo=arr;
big=arr2;
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159440/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159440/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = 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 %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%.10 = call i32 @llvm.smin.i32(i32 %0, i32 %1)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%big.1 = phi i32 [ %., %entry ], [ %smo.1, %while.cond ]
%smo.1 = phi i32 [ %.10, %entry ], [ %rem, %while.cond ]
%rem = srem i32 %big.1, %smo.1
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %if.then2, label %while.cond
if.then2: ; preds = %while.cond
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %smo.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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: 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 i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int gcd(int a, int b) {
if (b == 0) return a;
else return gcd(b, a % b);
}
int main(void) {
int x, y;
scanf("%d %d", &x, &y);
printf("%d\n", gcd(x, y));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159484/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159484/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%b.tr6 = phi i32 [ %rem, %if.else ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.else ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.else ]
ret i32 %a.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%x = alloca i32, align 4
%y = 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 %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp4.i = icmp eq i32 %1, 0
br i1 %cmp4.i, label %gcd.exit, label %if.else.i
if.else.i: ; preds = %entry, %if.else.i
%b.tr6.i = phi i32 [ %rem.i, %if.else.i ], [ %1, %entry ]
%a.tr5.i = phi i32 [ %b.tr6.i, %if.else.i ], [ %0, %entry ]
%rem.i = srem i32 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %if.else.i
gcd.exit: ; preds = %if.else.i, %entry
%a.tr.lcssa.i = phi i32 [ %0, %entry ], [ %b.tr6.i, %if.else.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.tr.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int gcd(long int x, long int y);
int main(void) {
long int x = 0;
long int y = 0;
scanf("%ld %ld", &x, &y);
printf("%d\n", gcd(x, y));
return 0;
}
int gcd(long int x, long int y) {
long int tmp = 0;
if (x < y) {
tmp = x;
x = y;
y = tmp;
}
while (y > 0) {
tmp = x % y;
x = y;
y = tmp;
}
return x;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159527/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159527/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5
store i64 0, ptr %x, align 8, !tbaa !5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #5
store i64 0, ptr %y, align 8, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i64, ptr %x, align 8, !tbaa !5
%1 = load i64, ptr %y, align 8, !tbaa !5
%spec.select.i = call i64 @llvm.smax.i64(i64 %0, i64 %1)
%spec.select10.i = call i64 @llvm.smin.i64(i64 %0, i64 %1)
%cmp111.i = icmp sgt i64 %spec.select10.i, 0
br i1 %cmp111.i, label %while.body.i, label %gcd.exit
while.body.i: ; preds = %entry, %while.body.i
%y.addr.113.i = phi i64 [ %rem.i, %while.body.i ], [ %spec.select10.i, %entry ]
%x.addr.112.i = phi i64 [ %y.addr.113.i, %while.body.i ], [ %spec.select.i, %entry ]
%rem.i = srem i64 %x.addr.112.i, %y.addr.113.i
%cmp1.i = icmp sgt i64 %rem.i, 0
br i1 %cmp1.i, label %while.body.i, label %gcd.exit, !llvm.loop !9
gcd.exit: ; preds = %while.body.i, %entry
%x.addr.1.lcssa.i = phi i64 [ %spec.select.i, %entry ], [ %y.addr.113.i, %while.body.i ]
%conv.i = trunc i64 %x.addr.1.lcssa.i to i32
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 {
entry:
%spec.select = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
%spec.select10 = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
%cmp111 = icmp sgt i64 %spec.select10, 0
br i1 %cmp111, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%y.addr.113 = phi i64 [ %rem, %while.body ], [ %spec.select10, %entry ]
%x.addr.112 = phi i64 [ %y.addr.113, %while.body ], [ %spec.select, %entry ]
%rem = srem i64 %x.addr.112, %y.addr.113
%cmp1 = icmp sgt i64 %rem, 0
br i1 %cmp1, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%x.addr.1.lcssa = phi i64 [ %spec.select, %entry ], [ %y.addr.113, %while.body ]
%conv = trunc i64 %x.addr.1.lcssa to i32
ret i32 %conv
}
; 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) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int a, b;
int gcd;
scanf("%d%d", &a, &b);
if( a > b ) {
gcd = a % b;
while(1) {
if(((b % gcd) == 0) && (((a % b) % gcd) == 0)) break;
else gcd--;
}
}
else if( a < b ) {
gcd = b % a;
while(1) {
if(((a % gcd) == 0) && (((b % a) % gcd) == 0)) break;
else gcd--;
}
}
else gcd = a;
printf("%d\n", gcd);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159570/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else7
if.then: ; preds = %entry
%rem = srem i32 %0, %1
br label %while.cond
while.cond: ; preds = %if.else, %if.then
%gcd.0 = phi i32 [ %rem, %if.then ], [ %dec, %if.else ]
%rem1 = srem i32 %1, %gcd.0
%cmp2 = icmp eq i32 %rem1, 0
br i1 %cmp2, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %while.cond
%rem4 = srem i32 %rem, %gcd.0
%cmp5 = icmp eq i32 %rem4, 0
br i1 %cmp5, label %if.end26, label %if.else
if.else: ; preds = %land.lhs.true, %while.cond
%dec = add nsw i32 %gcd.0, -1
br label %while.cond
if.else7: ; preds = %entry
%cmp8 = icmp slt i32 %0, %1
br i1 %cmp8, label %if.then9, label %if.end26
if.then9: ; preds = %if.else7
%rem10 = srem i32 %1, %0
br label %while.cond11
while.cond11: ; preds = %if.else20, %if.then9
%gcd.1 = phi i32 [ %rem10, %if.then9 ], [ %dec21, %if.else20 ]
%rem13 = srem i32 %0, %gcd.1
%cmp14 = icmp eq i32 %rem13, 0
br i1 %cmp14, label %land.lhs.true15, label %if.else20
land.lhs.true15: ; preds = %while.cond11
%rem17 = srem i32 %rem10, %gcd.1
%cmp18 = icmp eq i32 %rem17, 0
br i1 %cmp18, label %if.end26, label %if.else20
if.else20: ; preds = %land.lhs.true15, %while.cond11
%dec21 = add nsw i32 %gcd.1, -1
br label %while.cond11
if.end26: ; preds = %land.lhs.true15, %land.lhs.true, %if.else7
%gcd.2 = phi i32 [ %0, %if.else7 ], [ %gcd.0, %land.lhs.true ], [ %gcd.1, %land.lhs.true15 ]
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %gcd.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 x,y;
scanf("%d%d",&x,&y);
while(1){
if(x<y) y=y%x;
else x=x%y;
if(x==0||y==0) break;
}
if(x==0) printf("%d\n",y);
else if(y==0) printf("%d\n",x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159613/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159613/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%x.promoted = load i32, ptr %x, align 4, !tbaa !5
%y.promoted = load i32, ptr %y, align 4
br label %while.cond
while.cond: ; preds = %if.end, %entry
%rem22 = phi i32 [ %rem21, %if.end ], [ %y.promoted, %entry ]
%.pr20 = phi i32 [ %.pr19, %if.end ], [ %x.promoted, %entry ]
%cmp = icmp slt i32 %.pr20, %rem22
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %while.cond
%rem = srem i32 %rem22, %.pr20
store i32 %rem, ptr %y, align 4, !tbaa !5
br label %if.end
if.else: ; preds = %while.cond
%rem1 = srem i32 %.pr20, %rem22
store i32 %rem1, ptr %x, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.else, %if.then
%rem21 = phi i32 [ %rem22, %if.else ], [ %rem, %if.then ]
%.pr19 = phi i32 [ %rem1, %if.else ], [ %.pr20, %if.then ]
%cmp2 = icmp eq i32 %.pr19, 0
%cmp3 = icmp eq i32 %rem21, 0
%or.cond = or i1 %cmp3, %cmp2
br i1 %or.cond, label %while.end, label %while.cond
while.end: ; preds = %if.end
%brmerge = or i1 %cmp2, %cmp3
br i1 %brmerge, label %if.end14.sink.split, label %if.end14
if.end14.sink.split: ; preds = %while.end
%rem21.mux = select i1 %cmp2, i32 %rem21, i32 %.pr19
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem21.mux)
br label %if.end14
if.end14: ; preds = %while.end, %if.end14.sink.split
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int x,y,z,n;
scanf("%d %d",&x,&y);
if( x < y ){
n = x;
x = y;
y = n;
}
z = x % y;
while( z != 0){
x = y;
y = z;
z = x % y;
}
printf("%d\n",y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159657/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159657/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem = srem i32 %3, %2
%cmp1.not7 = icmp eq i32 %rem, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%z.09 = phi i32 [ %rem2, %while.body ], [ %rem, %if.end ]
%z.068 = phi i32 [ %z.09, %while.body ], [ %2, %if.end ]
%rem2 = srem i32 %z.068, %z.09
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %z.068, ptr %x, align 4, !tbaa !5
store i32 %z.09, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %z.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int a,b,S,i,x;
scanf("%d%d",&a,&b);
if(a>=b)
{
x=a;
a=b;
b=x;
}
while(b>0)
{
x=a%b;
a=b;
b=x;
}
printf("%d\n",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159707/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159707/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%a.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp16 = icmp sgt i32 %.pr, 0
br i1 %cmp16, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %a.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1 = icmp sgt i32 %rem, 0
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 %rem, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %a.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 x, y, itizi, amari = -1;
scanf("%d %d", &x, &y);
if (y >= x){
itizi = x;
x = y;
y = itizi;
}
amari = x % y;
if(amari == 0){
printf("%d\n", y);
}else {
while( (y % amari) != 0){
x = y;
y = amari;
amari = x % y;
}
printf("%d\n", amari);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159750/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159750/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %y, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
store i32 %0, ptr %x, align 4, !tbaa !5
store i32 %1, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%y.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%rem = srem i32 %2, %y.promoted
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %if.end8, label %while.cond.preheader
while.cond.preheader: ; preds = %if.end
%rem414 = srem i32 %y.promoted, %rem
%cmp5.not15 = icmp eq i32 %rem414, 0
br i1 %cmp5.not15, label %if.end8, label %while.body
while.body: ; preds = %while.cond.preheader, %while.body
%rem418 = phi i32 [ %rem4, %while.body ], [ %rem414, %while.cond.preheader ]
%amari.017 = phi i32 [ %rem418, %while.body ], [ %rem, %while.cond.preheader ]
%amari.01316 = phi i32 [ %amari.017, %while.body ], [ %y.promoted, %while.cond.preheader ]
%rem4 = srem i32 %amari.017, %rem418
%cmp5.not = icmp eq i32 %rem4, 0
br i1 %cmp5.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %amari.01316, ptr %x, align 4, !tbaa !5
store i32 %amari.017, ptr %y, align 4, !tbaa !5
br label %if.end8
if.end8: ; preds = %while.cond.preheader, %while.cond.while.end_crit_edge, %if.end
%amari.0.lcssa.sink = phi i32 [ %y.promoted, %if.end ], [ %rem418, %while.cond.while.end_crit_edge ], [ %rem, %while.cond.preheader ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %amari.0.lcssa.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int gcd(int a,int b){
if(a==b) return a;
else if(a>b) return gcd(a-b,b);
else return gcd(a,b-a);
return 0;
}
int main(void){
int x,y;
scanf("%d %d",&x,&y);
printf("%d\n",gcd(x,y));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159794/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159794/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp1619 = icmp eq i32 %a, %b
br i1 %cmp1619, label %return, label %if.else.lr.ph
if.else.lr.ph: ; preds = %entry, %if.then2
%b.tr.ph21 = phi i32 [ %b.tr17, %if.then2 ], [ %b, %entry ]
%a.tr.ph20 = phi i32 [ %sub, %if.then2 ], [ %a, %entry ]
br label %if.else
if.else: ; preds = %if.else.lr.ph, %if.else3
%b.tr17 = phi i32 [ %b.tr.ph21, %if.else.lr.ph ], [ %sub4, %if.else3 ]
%cmp1 = icmp sgt i32 %a.tr.ph20, %b.tr17
br i1 %cmp1, label %if.then2, label %if.else3
if.then2: ; preds = %if.else
%sub = sub nsw i32 %a.tr.ph20, %b.tr17
%cmp16 = icmp eq i32 %sub, %b.tr17
br i1 %cmp16, label %return, label %if.else.lr.ph
if.else3: ; preds = %if.else
%sub4 = sub nsw i32 %b.tr17, %a.tr.ph20
%cmp = icmp eq i32 %a.tr.ph20, %sub4
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.then2, %if.else3, %entry
%a.tr.ph.lcssa = phi i32 [ %a, %entry ], [ %a.tr.ph20, %if.else3 ], [ %b.tr17, %if.then2 ]
ret i32 %a.tr.ph.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%x = alloca i32, align 4
%y = 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 %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp1619.i = icmp eq i32 %0, %1
br i1 %cmp1619.i, label %gcd.exit, label %if.else.lr.ph.i
if.else.lr.ph.i: ; preds = %entry, %if.then2.i
%b.tr.ph21.i = phi i32 [ %b.tr17.i, %if.then2.i ], [ %1, %entry ]
%a.tr.ph20.i = phi i32 [ %sub.i, %if.then2.i ], [ %0, %entry ]
br label %if.else.i
if.else.i: ; preds = %if.else3.i, %if.else.lr.ph.i
%b.tr17.i = phi i32 [ %b.tr.ph21.i, %if.else.lr.ph.i ], [ %sub4.i, %if.else3.i ]
%cmp1.i = icmp sgt i32 %a.tr.ph20.i, %b.tr17.i
br i1 %cmp1.i, label %if.then2.i, label %if.else3.i
if.then2.i: ; preds = %if.else.i
%sub.i = sub nsw i32 %a.tr.ph20.i, %b.tr17.i
%cmp16.i = icmp eq i32 %sub.i, %b.tr17.i
br i1 %cmp16.i, label %gcd.exit, label %if.else.lr.ph.i
if.else3.i: ; preds = %if.else.i
%sub4.i = sub nsw i32 %b.tr17.i, %a.tr.ph20.i
%cmp.i = icmp eq i32 %a.tr.ph20.i, %sub4.i
br i1 %cmp.i, label %gcd.exit, label %if.else.i
gcd.exit: ; preds = %if.then2.i, %if.else3.i, %entry
%a.tr.ph.lcssa.i = phi i32 [ %0, %entry ], [ %a.tr.ph20.i, %if.else3.i ], [ %b.tr17.i, %if.then2.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.tr.ph.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int gcd(int a, int b) {
if (0 == b) return a;
return gcd(b, a%b);
}
int main(int argc, char** argv) {
int a, b;
while (~scanf("%d%d", &a, &b)) {
printf("%d\n", gcd(a,b));
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159837/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159837/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ]
ret i32 %a.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%tobool.not4 = icmp eq i32 %call3, -1
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %gcd.exit
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.i = icmp eq i32 %1, 0
br i1 %cmp4.i, label %gcd.exit, label %if.end.i
if.end.i: ; preds = %while.body, %if.end.i
%b.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %1, %while.body ]
%a.tr5.i = phi i32 [ %b.tr6.i, %if.end.i ], [ %0, %while.body ]
%rem.i = srem i32 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %if.end.i
gcd.exit: ; preds = %if.end.i, %while.body
%a.tr.lcssa.i = phi i32 [ %0, %while.body ], [ %b.tr6.i, %if.end.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.tr.lcssa.i)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %gcd.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int gcd(int a,int b)
{
if(a%b==0)
return b;
else
return(gcd(b,a%b));
}
int main(void)
{
int x,y,tmp;
scanf("%d %d",&x,&y);
if(y>x){
tmp=x;
x=y;
y=tmp;
}
printf("%d\n",gcd(x,y));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159880/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159880/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i32 [ %a, %entry ], [ %b.tr, %tailrecurse ]
%b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ]
%rem = srem i32 %a.tr, %b.tr
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %tailrecurse
return: ; preds = %tailrecurse
ret i32 %b.tr
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%x = alloca i32, align 4
%y = 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 %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %y, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %tailrecurse.i.preheader
if.then: ; preds = %entry
store i32 %0, ptr %x, align 4, !tbaa !5
store i32 %1, ptr %y, align 4, !tbaa !5
br label %tailrecurse.i.preheader
tailrecurse.i.preheader: ; preds = %if.then, %entry
%a.tr.i.ph = phi i32 [ %1, %entry ], [ %0, %if.then ]
%b.tr.i.ph = phi i32 [ %0, %entry ], [ %1, %if.then ]
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i.preheader, %tailrecurse.i
%a.tr.i = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %a.tr.i.ph, %tailrecurse.i.preheader ]
%b.tr.i = phi i32 [ %rem.i, %tailrecurse.i ], [ %b.tr.i.ph, %tailrecurse.i.preheader ]
%rem.i = srem i32 %a.tr.i, %b.tr.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %tailrecurse.i
gcd.exit: ; preds = %tailrecurse.i
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %b.tr.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int x,y,z;
scanf("%d%d",&x,&y);
while(x%y!=0){
z = x%y;
x = y;
y = z;
}
printf("%d\n",y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159923/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159923/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%x.promoted = load i32, ptr %x, align 4, !tbaa !5
%y.promoted = load i32, ptr %y, align 4, !tbaa !5
%rem4 = srem i32 %x.promoted, %y.promoted
%cmp.not5 = icmp eq i32 %rem4, 0
br i1 %cmp.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%rem7 = phi i32 [ %rem, %while.body ], [ %rem4, %entry ]
%rem36 = phi i32 [ %rem7, %while.body ], [ %y.promoted, %entry ]
%rem = srem i32 %rem36, %rem7
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %rem36, ptr %x, align 4, !tbaa !5
store i32 %rem7, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%.lcssa = phi i32 [ %rem7, %while.cond.while.end_crit_edge ], [ %y.promoted, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include"stdio.h"
int main()
{
int a,b;
int num;
scanf("%d%d",&a,&b);
if(a<b)
{
num=a;
a=b;
b=num;
}
while((num=a%b)!=0)
{
a=b;
b=num;
}
printf("%d\n",b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159967/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159967/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%b.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%a.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem6 = srem i32 %a.promoted, %b.promoted
%cmp1.not7 = icmp eq i32 %rem6, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%rem9 = phi i32 [ %rem, %while.body ], [ %rem6, %if.end ]
%rem58 = phi i32 [ %rem9, %while.body ], [ %b.promoted, %if.end ]
%rem = srem i32 %rem58, %rem9
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %rem58, ptr %a, align 4, !tbaa !5
store i32 %rem9, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%.lcssa = phi i32 [ %rem9, %while.cond.while.end_crit_edge ], [ %b.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int x,y,z,d;
scanf("%d%d",&x,&y);
if(x<y){
while((d=y%x)!= 0){
y=x;
x=d;
}
printf("%d\n",x);
}
else{
while((d=x%y)!=0){
x=y;
y=d;
}
printf("%d\n",y);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160015/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160015/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %while.cond.preheader, label %while.cond3.preheader
while.cond3.preheader: ; preds = %entry
%rem412 = srem i32 %0, %1
%cmp5.not13 = icmp eq i32 %rem412, 0
br i1 %cmp5.not13, label %if.end, label %while.body6
while.cond.preheader: ; preds = %entry
%rem19 = srem i32 %1, %0
%cmp1.not20 = icmp eq i32 %rem19, 0
br i1 %cmp1.not20, label %if.end, label %while.body
while.body: ; preds = %while.cond.preheader, %while.body
%rem22 = phi i32 [ %rem, %while.body ], [ %rem19, %while.cond.preheader ]
%rem1821 = phi i32 [ %rem22, %while.body ], [ %0, %while.cond.preheader ]
%rem = srem i32 %rem1821, %rem22
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %rem1821, ptr %y, align 4, !tbaa !5
store i32 %rem22, ptr %x, align 4, !tbaa !5
br label %if.end
while.body6: ; preds = %while.cond3.preheader, %while.body6
%rem415 = phi i32 [ %rem4, %while.body6 ], [ %rem412, %while.cond3.preheader ]
%rem41114 = phi i32 [ %rem415, %while.body6 ], [ %1, %while.cond3.preheader ]
%rem4 = srem i32 %rem41114, %rem415
%cmp5.not = icmp eq i32 %rem4, 0
br i1 %cmp5.not, label %while.cond3.while.end7_crit_edge, label %while.body6, !llvm.loop !11
while.cond3.while.end7_crit_edge: ; preds = %while.body6
store i32 %rem41114, ptr %x, align 4, !tbaa !5
store i32 %rem415, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %while.cond3.preheader, %while.cond3.while.end7_crit_edge, %while.cond.preheader, %while.cond.while.end_crit_edge
%.lcssa10.sink = phi i32 [ %rem22, %while.cond.while.end_crit_edge ], [ %0, %while.cond.preheader ], [ %rem415, %while.cond3.while.end7_crit_edge ], [ %1, %while.cond3.preheader ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa10.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int x,y,z,ans;
scanf("%d %d",&x,&y);
if(x>=y){
while(1){
z=x%y;
if(z==0){
ans=y;
break;
}
x=y;
y=z;
}
}
else if(y>x){
while(1){
z=y%x;
if(z==0){
ans=x;
break;
}
y=x;
x=z;
}
}
printf("%d\n",ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160059/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160059/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %while.cond5.preheader, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%rem21 = srem i32 %0, %1
%cmp122 = icmp eq i32 %rem21, 0
br i1 %cmp122, label %if.end13, label %if.end
while.cond5.preheader: ; preds = %entry
%rem728 = srem i32 %1, %0
%cmp829 = icmp eq i32 %rem728, 0
br i1 %cmp829, label %if.end13, label %if.end10
if.end: ; preds = %while.cond.preheader, %if.end
%rem24 = phi i32 [ %rem, %if.end ], [ %rem21, %while.cond.preheader ]
%rem2023 = phi i32 [ %rem24, %if.end ], [ %1, %while.cond.preheader ]
%rem = srem i32 %rem2023, %rem24
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.cond.if.end13.loopexit18_crit_edge, label %if.end
if.end10: ; preds = %while.cond5.preheader, %if.end10
%rem731 = phi i32 [ %rem7, %if.end10 ], [ %rem728, %while.cond5.preheader ]
%rem72730 = phi i32 [ %rem731, %if.end10 ], [ %0, %while.cond5.preheader ]
%rem7 = srem i32 %rem72730, %rem731
%cmp8 = icmp eq i32 %rem7, 0
br i1 %cmp8, label %while.cond5.if.end13.loopexit_crit_edge, label %if.end10
while.cond5.if.end13.loopexit_crit_edge: ; preds = %if.end10
store i32 %rem72730, ptr %y, align 4, !tbaa !5
store i32 %rem731, ptr %x, align 4, !tbaa !5
br label %if.end13
while.cond.if.end13.loopexit18_crit_edge: ; preds = %if.end
store i32 %rem2023, ptr %x, align 4, !tbaa !5
store i32 %rem24, ptr %y, align 4, !tbaa !5
br label %if.end13
if.end13: ; preds = %while.cond.preheader, %while.cond.if.end13.loopexit18_crit_edge, %while.cond5.preheader, %while.cond5.if.end13.loopexit_crit_edge
%ans.0 = phi i32 [ %rem731, %while.cond5.if.end13.loopexit_crit_edge ], [ %0, %while.cond5.preheader ], [ %rem24, %while.cond.if.end13.loopexit18_crit_edge ], [ %1, %while.cond.preheader ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int x,y,z;
scanf("%d%d",&x,&y);
z = x % y ;
while(z> 0){
z = x % y;
x = y;
y = z;
}
printf("%d\n",x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160101/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160101/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp5 = icmp sgt i32 %rem, 0
br i1 %cmp5, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%2 = phi i32 [ %rem146, %while.body ], [ %0, %entry ]
%rem146 = phi i32 [ %rem1, %while.body ], [ %1, %entry ]
%rem1 = srem i32 %2, %rem146
%cmp = icmp sgt i32 %rem1, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %rem146, ptr %x, align 4, !tbaa !5
store i32 %rem1, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%3 = phi i32 [ %rem146, %while.cond.while.end_crit_edge ], [ %0, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b,remainder,tmp;
scanf("%d%d",&a,&b);
if(a<b){
tmp=a;
a=b;
b=tmp;
}
remainder=a%b;
while(remainder!=0){
a=b;
b=remainder;
remainder=a%b;
}
printf("%d\n",b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160145/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160145/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem = srem i32 %3, %2
%cmp1.not7 = icmp eq i32 %rem, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%remainder.09 = phi i32 [ %rem2, %while.body ], [ %rem, %if.end ]
%remainder.068 = phi i32 [ %remainder.09, %while.body ], [ %2, %if.end ]
%rem2 = srem i32 %remainder.068, %remainder.09
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %remainder.068, ptr %a, align 4, !tbaa !5
store i32 %remainder.09, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %remainder.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
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>
#include <stdlib.h>
int main(){
int a,b,c;
scanf("%d%d",&a,&b);
if (a<1||b<1||a>1000000000||b>1000000000) {
printf("atai yokunai\n");
exit(1);
}
if (a<b){
c=a;
a=b;
b=c;
}
while(b>0){
c=a%b;
a=b;
b=c;
}
printf("%d\n",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160202/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160202/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [13 x i8] c"atai yokunai\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 1
%2 = add i32 %0, -1000000001
%3 = icmp ult i32 %2, -1000000000
%or.cond12 = select i1 %3, i1 true, i1 %cmp1
%cmp5 = icmp sgt i32 %1, 1000000000
%or.cond13 = select i1 %or.cond12, i1 true, i1 %cmp5
br i1 %or.cond13, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
call void @exit(i32 noundef 1) #7
unreachable
if.end: ; preds = %entry
%spec.select = call i32 @llvm.umax.i32(i32 %0, i32 %1)
%spec.select21 = call i32 @llvm.umin.i32(i32 %0, i32 %1)
br label %while.body
while.body: ; preds = %if.end, %while.body
%4 = phi i32 [ %rem20, %while.body ], [ %spec.select21, %if.end ]
%5 = phi i32 [ %4, %while.body ], [ %spec.select, %if.end ]
%rem20 = urem i32 %5, %4
%cmp10.not = icmp eq i32 %rem20, 0
br i1 %cmp10.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body
store i32 %4, ptr %a, align 4, !tbaa !7
store i32 %rem20, ptr %b, align 4, !tbaa !7
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #5
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int a,b,c;
int main()
{
scanf("%d%d",&a,&b);
if(b<a)b^=a^=b^=a;
for(;b!=0;a=b,b=c)c=a%b;
printf("%d\n",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160268/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160268/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 i32 0, align 4
@b = dso_local global i32 0, align 4
@c = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b)
%0 = load i32, ptr @b, align 4, !tbaa !5
%1 = load i32, ptr @a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %0, ptr @a, align 4, !tbaa !5
store i32 %1, ptr @b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%a.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%.pr = phi i32 [ %1, %if.then ], [ %0, %entry ]
%cmp3.not7 = icmp eq i32 %.pr, 0
br i1 %cmp3.not7, label %for.end, label %for.body
for.body: ; preds = %if.end, %for.body
%2 = phi i32 [ %rem, %for.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %for.body ], [ %a.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp3.not = icmp eq i32 %rem, 0
br i1 %cmp3.not, label %for.cond.for.end_crit_edge, label %for.body, !llvm.loop !9
for.cond.for.end_crit_edge: ; preds = %for.body
store i32 0, ptr @c, align 4, !tbaa !5
store i32 %2, ptr @a, align 4, !tbaa !5
store i32 0, ptr @b, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %if.end
%4 = phi i32 [ %2, %for.cond.for.end_crit_edge ], [ %a.promoted, %if.end ]
%call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int x,y;
scanf("%d%d",&x,&y);
if(x<y){
int i=x;
x=y;
y=i;
}
while(y>0){
int i=x%y;
x=y;
y=i;
}
printf("%d\n",x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160354/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160354/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp16 = icmp sgt i32 %.pr, 0
br i1 %cmp16, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %x.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1 = icmp sgt i32 %rem, 0
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %rem, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %x.promoted, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int x,y,z;
scanf("%d %d",&x,&y);
while(x>0)
{
z=y%x;
y=x;
x=z;
}
printf("%d\n",y);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160404/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160404/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%.pr = load i32, ptr %x, align 4, !tbaa !5
%y.promoted = load i32, ptr %y, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %.pr, 0
br i1 %cmp2, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%0 = phi i32 [ %rem, %while.body ], [ %.pr, %entry ]
%1 = phi i32 [ %0, %while.body ], [ %y.promoted, %entry ]
%rem = srem i32 %1, %0
%cmp = icmp sgt i32 %rem, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %0, ptr %y, align 4, !tbaa !5
store i32 %rem, ptr %x, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%2 = phi i32 [ %0, %while.cond.while.end_crit_edge ], [ %y.promoted, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int x,y,a,d;
scanf("%d%d",&x,&y);
if(x<y){
a=x;
x=y;
y=a;
}
while((d=x%y)!=0){
x=y;
y=d;
}
printf("%d\n",y);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160448/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160448/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%y.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem5 = srem i32 %x.promoted, %y.promoted
%cmp1.not6 = icmp eq i32 %rem5, 0
br i1 %cmp1.not6, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%rem8 = phi i32 [ %rem, %while.body ], [ %rem5, %if.end ]
%rem47 = phi i32 [ %rem8, %while.body ], [ %y.promoted, %if.end ]
%rem = srem i32 %rem47, %rem8
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %rem47, ptr %x, align 4, !tbaa !5
store i32 %rem8, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%.lcssa = phi i32 [ %rem8, %while.cond.while.end_crit_edge ], [ %y.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int a,b,r,c;
scanf("%d%d",&a,&b);
if(a<b){
c = a;
a = b;
b = c;
}
r = a%b;
while(r!=0)
{
a = b;
b = r;
r = a%b;
}
printf("%d\n",b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160491/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160491/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem = srem i32 %3, %2
%cmp1.not7 = icmp eq i32 %rem, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%r.09 = phi i32 [ %rem2, %while.body ], [ %rem, %if.end ]
%r.068 = phi i32 [ %r.09, %while.body ], [ %2, %if.end ]
%rem2 = srem i32 %r.068, %r.09
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %r.068, ptr %a, align 4, !tbaa !5
store i32 %r.09, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %r.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
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 x,y,z,r;
scanf("%d%d",&x,&y);
if(x<y){
z = x;
x = y;
y = z;
}
while(y>0)
{
if(x>=y)
{
r = x%y;
x = y;
y = r;
}
}
printf("%d\n",x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160534/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160534/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%y.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp113 = icmp sgt i32 %y.promoted, 0
br i1 %cmp113, label %while.body, label %while.end
while.body: ; preds = %if.end, %if.end4
%rem1015 = phi i32 [ %rem9, %if.end4 ], [ %y.promoted, %if.end ]
%rem101214 = phi i32 [ %rem1011, %if.end4 ], [ %x.promoted, %if.end ]
%cmp2.not = icmp slt i32 %rem101214, %rem1015
br i1 %cmp2.not, label %if.end4, label %if.then3
if.then3: ; preds = %while.body
%rem = urem i32 %rem101214, %rem1015
store i32 %rem1015, ptr %x, align 4, !tbaa !5
store i32 %rem, ptr %y, align 4, !tbaa !5
br label %if.end4
if.end4: ; preds = %if.then3, %while.body
%rem1011 = phi i32 [ %rem1015, %if.then3 ], [ %rem101214, %while.body ]
%rem9 = phi i32 [ %rem, %if.then3 ], [ %rem1015, %while.body ]
%cmp1 = icmp sgt i32 %rem9, 0
br i1 %cmp1, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end4, %if.end
%2 = phi i32 [ %x.promoted, %if.end ], [ %rem1011, %if.end4 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int gcd(int x, int y)
{
int tmp, r;
if(x < y)
{
tmp = x;
x = y;
y = tmp;
}
while(y > 0){
r = x % y;
x = y;
y = r;
}
return x;
}
int main(void)
{
int x, y;
scanf("%d %d", &x, &y);
printf("%d\n", gcd(x, y));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160592/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160592/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%spec.select = tail call i32 @llvm.smin.i32(i32 %x, i32 %y)
%spec.select9 = tail call i32 @llvm.smax.i32(i32 %x, i32 %y)
%cmp110 = icmp sgt i32 %spec.select, 0
br i1 %cmp110, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%x.addr.112 = phi i32 [ %y.addr.111, %while.body ], [ %spec.select9, %entry ]
%y.addr.111 = phi i32 [ %rem, %while.body ], [ %spec.select, %entry ]
%rem = srem i32 %x.addr.112, %y.addr.111
%cmp1 = icmp sgt i32 %rem, 0
br i1 %cmp1, label %while.body, label %while.end, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%x.addr.1.lcssa = phi i32 [ %spec.select9, %entry ], [ %y.addr.111, %while.body ]
ret i32 %x.addr.1.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !7
%1 = load i32, ptr %y, align 4, !tbaa !7
%spec.select.i = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%spec.select9.i = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%cmp110.i = icmp sgt i32 %spec.select.i, 0
br i1 %cmp110.i, label %while.body.i, label %gcd.exit
while.body.i: ; preds = %entry, %while.body.i
%x.addr.112.i = phi i32 [ %y.addr.111.i, %while.body.i ], [ %spec.select9.i, %entry ]
%y.addr.111.i = phi i32 [ %rem.i, %while.body.i ], [ %spec.select.i, %entry ]
%rem.i = srem i32 %x.addr.112.i, %y.addr.111.i
%cmp1.i = icmp sgt i32 %rem.i, 0
br i1 %cmp1.i, label %while.body.i, label %gcd.exit, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %entry
%x.addr.1.lcssa.i = phi i32 [ %spec.select9.i, %entry ], [ %y.addr.111.i, %while.body.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.addr.1.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int x, y, z, temp;
scanf("%d %d", &x, &y);
if (x <= y) { // swap
temp = x;
x = y;
y = temp;
}
while (y > 0) { // euclidean algorithm
z = x % y;
x = y;
y = z;
}
printf("%d\n", x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160635/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160635/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp15 = icmp sgt i32 %.pr, 0
br i1 %cmp15, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %x.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1 = icmp sgt i32 %rem, 0
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %rem, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %x.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b,c;
scanf("%d %d",&a,&b);
if(a < b){
c = a;
a = b;
b= c;
}
while(1){
if(a % b == 0){
printf("%d\n",b);
break;
}
c = a % b;
a = b;
b = c;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160679/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160679/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%b.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%a.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem9 = srem i32 %a.promoted, %b.promoted
%cmp110 = icmp eq i32 %rem9, 0
br i1 %cmp110, label %if.then2, label %if.end4
while.cond.if.then2_crit_edge: ; preds = %if.end4
store i32 %rem811, ptr %a, align 4, !tbaa !5
store i32 %rem12, ptr %b, align 4, !tbaa !5
br label %if.then2
if.then2: ; preds = %while.cond.if.then2_crit_edge, %if.end
%.lcssa = phi i32 [ %rem12, %while.cond.if.then2_crit_edge ], [ %b.promoted, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
if.end4: ; preds = %if.end, %if.end4
%rem12 = phi i32 [ %rem, %if.end4 ], [ %rem9, %if.end ]
%rem811 = phi i32 [ %rem12, %if.end4 ], [ %b.promoted, %if.end ]
%rem = srem i32 %rem811, %rem12
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.cond.if.then2_crit_edge, label %if.end4
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 m, n, tmp;
scanf("%d %d", &m, &n);
if (m < n)
{
tmp = m;
m = n;
n = tmp;
}
for (;;)
{
tmp = m % n;
m = n;
n = tmp;
if (n == 0) break;
}
printf("%d\n", m);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160721/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160721/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%0 = load i32, ptr %m, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%spec.select11 = call i32 @llvm.smax.i32(i32 %0, i32 %1)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%rem8 = phi i32 [ %rem, %for.cond ], [ %spec.select, %entry ]
%2 = phi i32 [ %rem8, %for.cond ], [ %spec.select11, %entry ]
%rem = srem i32 %2, %rem8
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.end, label %for.cond
for.end: ; preds = %for.cond
store i32 %rem8, ptr %m, align 4, !tbaa !5
store i32 0, ptr %n, align 4, !tbaa !5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b,c,r;
scanf("%d%d",&a,&b);
if(a>b){
c=a;
a=b;
b=c;
}
while(b>0){
r=a%b;
a=b;
b=r;
}
printf("%d\n",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160765/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160765/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%a.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp15 = icmp sgt i32 %.pr, 0
br i1 %cmp15, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %a.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1 = icmp sgt i32 %rem, 0
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 %rem, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %a.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 n,m,k,l;
scanf("%d%d",&n,&m);
if(n<m){
l=n;
n=m;
m=l;
}
k=n%m;
while(k!=0){
n=m;
m=k;
k=n%m;
}
printf("%d\n",m);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160808/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160808/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %n, align 4, !tbaa !5
store i32 %0, ptr %m, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem = srem i32 %3, %2
%cmp1.not7 = icmp eq i32 %rem, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%k.09 = phi i32 [ %rem2, %while.body ], [ %rem, %if.end ]
%k.068 = phi i32 [ %k.09, %while.body ], [ %2, %if.end ]
%rem2 = srem i32 %k.068, %k.09
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %k.068, ptr %n, align 4, !tbaa !5
store i32 %k.09, ptr %m, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %k.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int i, x, y, z, a, flag = 0;
scanf("%d %d", &x, &y);
if(x<y){
z = x;
}else if(x>y){
z = y;
flag = 1;
}else{
flag = 2;
}
if(flag == 0){
for(i = y%x; i > 0; i--){
if(y % i == 0){
if(x % i == 0){
printf("%d\n", i);
break;
}
}
}
}else if(flag == 1){
for(i = x%y; i > 0; i--){
if(x % i == 0){
if(y % i == 0){
printf("%d\n", i);
break;
}
}
}
}else{
printf("%d\n", x);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160851/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160851/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then6, label %if.else17
if.then6: ; preds = %entry
%rem = srem i32 %1, %0
%cmp757 = icmp sgt i32 %rem, 0
br i1 %cmp757, label %for.body, label %if.end39
for.body: ; preds = %if.then6, %for.inc
%i.058 = phi i32 [ %dec, %for.inc ], [ %rem, %if.then6 ]
%rem8 = srem i32 %1, %i.058
%cmp9 = icmp eq i32 %rem8, 0
br i1 %cmp9, label %if.then10, label %for.inc
if.then10: ; preds = %for.body
%rem11 = srem i32 %0, %i.058
%cmp12 = icmp eq i32 %rem11, 0
br i1 %cmp12, label %if.end39.sink.split, label %for.inc
for.inc: ; preds = %for.body, %if.then10
%dec = add nsw i32 %i.058, -1
%cmp7 = icmp sgt i32 %i.058, 1
br i1 %cmp7, label %for.body, label %if.end39, !llvm.loop !9
if.else17: ; preds = %entry
%cmp1 = icmp sgt i32 %0, %1
br i1 %cmp1, label %if.then19, label %if.end39.sink.split
if.then19: ; preds = %if.else17
%rem20 = srem i32 %0, %1
%cmp2255 = icmp sgt i32 %rem20, 0
br i1 %cmp2255, label %for.body23, label %if.end39
for.body23: ; preds = %if.then19, %for.inc33
%i.156 = phi i32 [ %dec34, %for.inc33 ], [ %rem20, %if.then19 ]
%rem24 = srem i32 %0, %i.156
%cmp25 = icmp eq i32 %rem24, 0
br i1 %cmp25, label %if.then26, label %for.inc33
if.then26: ; preds = %for.body23
%rem27 = srem i32 %1, %i.156
%cmp28 = icmp eq i32 %rem27, 0
br i1 %cmp28, label %if.end39.sink.split, label %for.inc33
for.inc33: ; preds = %for.body23, %if.then26
%dec34 = add nsw i32 %i.156, -1
%cmp22 = icmp sgt i32 %i.156, 1
br i1 %cmp22, label %for.body23, label %if.end39, !llvm.loop !11
if.end39.sink.split: ; preds = %if.then26, %if.then10, %if.else17
%.sink = phi i32 [ %0, %if.else17 ], [ %i.058, %if.then10 ], [ %i.156, %if.then26 ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
br label %if.end39
if.end39: ; preds = %for.inc33, %for.inc, %if.end39.sink.split, %if.then19, %if.then6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int GCD(int,int);
int main(){
int x,y;
int gcd;
scanf("%d %d",&x,&y);
gcd = GCD(x,y);
printf("%d\n",gcd);
}
int GCD(int x,int y){
int z;
if(y>x){
z = y;
y = x;
x = z;
}
while(1){
z = x%y;
if(z==0)break;
x = y;
y = z;
}
return y;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160901/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160901/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%spec.select.i = call i32 @llvm.smax.i32(i32 %1, i32 %0)
%spec.select12.i = call i32 @llvm.smin.i32(i32 %1, i32 %0)
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %entry
%x.addr.1.i = phi i32 [ %spec.select.i, %entry ], [ %y.addr.1.i, %while.cond.i ]
%y.addr.1.i = phi i32 [ %spec.select12.i, %entry ], [ %rem.i, %while.cond.i ]
%rem.i = srem i32 %x.addr.1.i, %y.addr.1.i
%cmp1.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.i, label %GCD.exit, label %while.cond.i
GCD.exit: ; preds = %while.cond.i
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.addr.1.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @GCD(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %y, i32 %x)
%spec.select12 = tail call i32 @llvm.smin.i32(i32 %y, i32 %x)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.1 = phi i32 [ %spec.select, %entry ], [ %y.addr.1, %while.cond ]
%y.addr.1 = phi i32 [ %spec.select12, %entry ], [ %rem, %while.cond ]
%rem = srem i32 %x.addr.1, %y.addr.1
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.end, label %while.cond
while.end: ; preds = %while.cond
ret i32 %y.addr.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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a[20];
int v[20];
int n;
int b;
int i;
int max;
scanf("%d", &n);
max = 0;
for (i = 0; i < n; i++){
scanf("%d %d", &a[i], &v[i]);
if (max < v[i]){
max = v[i];
b = a[i];
}
}
for (i = 0; i < n; i++){
if (max == v[i] && a[i] < b){
b = a[i];
}
}
printf("%d %d\n", b, max);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160945/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160945/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%a = alloca [20 x i32], align 16
%v = alloca [20 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp43 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp43)
br label %for.body
for.cond11.preheader: ; preds = %for.inc
%cmp1249 = icmp sgt i32 %4, 0
br i1 %cmp1249, label %for.body13.preheader, label %for.end26
for.body13.preheader: ; preds = %for.cond11.preheader
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %4, 1
br i1 %1, label %for.end26.loopexit.unr-lcssa, label %for.body13.preheader.new
for.body13.preheader.new: ; preds = %for.body13.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body13
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%max.046 = phi i32 [ %max.1, %for.inc ], [ 0, %entry ]
%b.044 = phi i32 [ %b.1, %for.inc ], [ undef, %entry ]
%arrayidx = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [20 x i32], ptr %v, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp6 = icmp slt i32 %max.046, %2
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%b.1 = phi i32 [ %3, %if.then ], [ %b.044, %for.body ]
%max.1 = phi i32 [ %2, %if.then ], [ %max.046, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond11.preheader, !llvm.loop !9
for.body13: ; preds = %for.inc24.1, %for.body13.preheader.new
%indvars.iv55 = phi i64 [ 0, %for.body13.preheader.new ], [ %indvars.iv.next56.1, %for.inc24.1 ]
%b.250 = phi i32 [ %b.1, %for.body13.preheader.new ], [ %b.3.1, %for.inc24.1 ]
%niter = phi i64 [ 0, %for.body13.preheader.new ], [ %niter.next.1, %for.inc24.1 ]
%arrayidx15 = getelementptr inbounds [20 x i32], ptr %v, i64 0, i64 %indvars.iv55
%6 = load i32, ptr %arrayidx15, align 8, !tbaa !5
%cmp16 = icmp eq i32 %max.1, %6
br i1 %cmp16, label %land.lhs.true, label %for.inc24
land.lhs.true: ; preds = %for.body13
%arrayidx18 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 %indvars.iv55
%7 = load i32, ptr %arrayidx18, align 8, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %7, i32 %b.250)
br label %for.inc24
for.inc24: ; preds = %land.lhs.true, %for.body13
%b.3 = phi i32 [ %b.250, %for.body13 ], [ %spec.select, %land.lhs.true ]
%indvars.iv.next56 = or i64 %indvars.iv55, 1
%arrayidx15.1 = getelementptr inbounds [20 x i32], ptr %v, i64 0, i64 %indvars.iv.next56
%8 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%cmp16.1 = icmp eq i32 %max.1, %8
br i1 %cmp16.1, label %land.lhs.true.1, label %for.inc24.1
land.lhs.true.1: ; preds = %for.inc24
%arrayidx18.1 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 %indvars.iv.next56
%9 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5
%spec.select.1 = call i32 @llvm.smin.i32(i32 %9, i32 %b.3)
br label %for.inc24.1
for.inc24.1: ; preds = %land.lhs.true.1, %for.inc24
%b.3.1 = phi i32 [ %b.3, %for.inc24 ], [ %spec.select.1, %land.lhs.true.1 ]
%indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 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.end26.loopexit.unr-lcssa, label %for.body13, !llvm.loop !11
for.end26.loopexit.unr-lcssa: ; preds = %for.inc24.1, %for.body13.preheader
%b.3.lcssa.ph = phi i32 [ undef, %for.body13.preheader ], [ %b.3.1, %for.inc24.1 ]
%indvars.iv55.unr = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next56.1, %for.inc24.1 ]
%b.250.unr = phi i32 [ %b.1, %for.body13.preheader ], [ %b.3.1, %for.inc24.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end26, label %for.body13.epil
for.body13.epil: ; preds = %for.end26.loopexit.unr-lcssa
%arrayidx15.epil = getelementptr inbounds [20 x i32], ptr %v, i64 0, i64 %indvars.iv55.unr
%10 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !5
%cmp16.epil = icmp eq i32 %max.1, %10
br i1 %cmp16.epil, label %land.lhs.true.epil, label %for.end26
land.lhs.true.epil: ; preds = %for.body13.epil
%arrayidx18.epil = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 %indvars.iv55.unr
%11 = load i32, ptr %arrayidx18.epil, align 4, !tbaa !5
%spec.select.epil = call i32 @llvm.smin.i32(i32 %11, i32 %b.250.unr)
br label %for.end26
for.end26: ; preds = %for.end26.loopexit.unr-lcssa, %land.lhs.true.epil, %for.body13.epil, %for.cond11.preheader
%b.2.lcssa = phi i32 [ %b.1, %for.cond11.preheader ], [ %b.3.lcssa.ph, %for.end26.loopexit.unr-lcssa ], [ %b.250.unr, %for.body13.epil ], [ %spec.select.epil, %land.lhs.true.epil ]
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %b.2.lcssa, i32 noundef %max.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: 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}
|
#include <stdio.h>
int main() {
int n, a_min, v_max = -1;
scanf("%d", &n);
while(n--) {
int a, v;
scanf("%d%d", &a, &v);
if (v_max < v || (v_max == v && a < a_min)) {
a_min = a;
v_max = v;
}
}
printf("%d %d\n", a_min, v_max);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160996/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160996/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec8 = add nsw i32 %0, -1
store i32 %dec8, ptr %n, align 4, !tbaa !5
%tobool.not9 = icmp ne i32 %0, 0
call void @llvm.assume(i1 %tobool.not9)
br label %while.body
while.body: ; preds = %entry, %if.end
%v_max.011 = phi i32 [ %v_max.1, %if.end ], [ -1, %entry ]
%a_min.010 = phi i32 [ %a_min.1, %if.end ], [ undef, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %v)
%1 = load i32, ptr %v, align 4, !tbaa !5
%cmp = icmp slt i32 %v_max.011, %1
%.pre = load i32, ptr %a, align 4
br i1 %cmp, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %while.body
%cmp2 = icmp eq i32 %v_max.011, %1
%cmp3 = icmp slt i32 %.pre, %a_min.010
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %lor.lhs.false, %while.body
br label %if.end
if.end: ; preds = %if.then, %lor.lhs.false
%a_min.1 = phi i32 [ %.pre, %if.then ], [ %a_min.010, %lor.lhs.false ]
%v_max.1 = phi i32 [ %1, %if.then ], [ %v_max.011, %lor.lhs.false ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
%2 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %a_min.1, i32 noundef %v_max.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
char S[15];
scanf("%s", S);
if(S[5]=='0' && S[6]<='4' &&S[6] >='1'){
printf("Heisei\n");
}else{
printf("TBD\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161045/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161045/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"TBD\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"Heisei\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [15 x i8], align 1
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%arrayidx = getelementptr inbounds [15 x i8], ptr %S, i64 0, i64 5
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 48
%arrayidx2 = getelementptr inbounds [15 x i8], ptr %S, i64 0, i64 6
%1 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp slt i8 %1, 53
%or.cond = select i1 %cmp, i1 %cmp4, i1 false
%cmp9 = icmp sgt i8 %1, 48
%or.cond13 = select i1 %or.cond, i1 %cmp9, i1 false
%str.3.str = select i1 %or.cond13, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main() {
char s[11], t[11] = "2019/04/30";
scanf("%s", s);
if (strcmp(s, t) <= 0) {
printf("Heisei\n");
} else {
printf("TBD\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161089/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161089/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.t = private unnamed_addr constant [11 x i8] c"2019/04/30\00", align 1
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"Heisei\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%memcmp = call i32 @memcmp(ptr noundef nonnull dereferenceable(11) %s, ptr noundef nonnull dereferenceable(11) @__const.main.t, i64 11)
%cmp = icmp slt i32 %memcmp, 1
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind willreturn memory(argmem: read) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
#include<string.h>
int main (void)
{
char date[11];
scanf("%s", date);
if(strcmp(date,"2019/04/30")<=0)
printf("Heisei\n");
else
printf("TBD\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161146/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161146/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"2019/04/30\00", align 1
@str = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
@str.4 = private unnamed_addr constant [7 x i8] c"Heisei\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%date = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %date) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %date)
%memcmp = call i32 @memcmp(ptr noundef nonnull dereferenceable(11) %date, ptr noundef nonnull dereferenceable(11) @.str.1, i64 11)
%cmp = icmp slt i32 %memcmp, 1
%str.4.str = select i1 %cmp, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %date) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind willreturn memory(argmem: read) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(){
int t,i;scanf("%d",&t);
for(i=0;i<t;i++){
long int n,m,b;
scanf("%ld",&n);
m=n/3;
b=n%3;
if(b==0){
printf("%ld %ld\n",m,m);
}
if(b==1){
printf("%ld %ld\n",m+1,m);
}
if(b==2){
printf("%ld %ld\n",m,m+1);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16119/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16119/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end12
%i.022 = phi i32 [ %inc, %if.end12 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !9
%div = sdiv i64 %1, 3
%rem = srem i64 %1, 3
switch i64 %rem, label %if.end12 [
i64 0, label %if.then
i64 1, label %if.then5
i64 2, label %if.then9
]
if.then: ; preds = %for.body
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div, i64 noundef %div)
br label %if.end12
if.then5: ; preds = %for.body
%add = add nsw i64 %div, 1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add, i64 noundef %div)
br label %if.end12
if.then9: ; preds = %for.body
%add10 = add nsw i64 %div, 1
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div, i64 noundef %add10)
br label %if.end12
if.end12: ; preds = %if.then5, %if.then, %for.body, %if.then9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
%inc = add nuw nsw i32 %i.022, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %if.end12, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int Check(char S[16]){
int i, Y, M, D, y, m, d;
Y = 2019;
M = 4;
D = 30;
y = 0;
for(i = 0;i < 4;i++) y = y * 10 + S[i] - '0';
if(Y < y) return 0;
else if(Y > y) return 1;
m = 0;
for(i = 0;i < 2;i++) m = m * 10 + S[i+5] - '0';
if(M < m) return 0;
else if(M > m) return 1;
d = 0;
for(i = 0;i < 2;i++) d = d * 10 + S[i+8] - '0';
if(D < d) return 0;
else return 1;
}
int main(void){
char S[16];
scanf("%s", S);
if(Check(S) == 0) printf("TBD\n");
else printf("Heisei\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161232/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161232/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"Heisei\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @Check(ptr nocapture noundef readonly %S) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %S, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%1 = mul nsw i32 %conv, 10
%arrayidx.1 = getelementptr inbounds i8, ptr %S, i64 1
%2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.1 = sext i8 %2 to i32
%add.1 = add nsw i32 %1, -528
%sub.1 = add nsw i32 %add.1, %conv.1
%mul.2 = mul nsw i32 %sub.1, 10
%arrayidx.2 = getelementptr inbounds i8, ptr %S, i64 2
%3 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%conv.2 = sext i8 %3 to i32
%add.2 = add nsw i32 %mul.2, -48
%sub.2 = add nsw i32 %add.2, %conv.2
%mul.3 = mul nsw i32 %sub.2, 10
%arrayidx.3 = getelementptr inbounds i8, ptr %S, i64 3
%4 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%conv.3 = sext i8 %4 to i32
%add.3 = add nsw i32 %mul.3, -48
%sub.3 = add nsw i32 %add.3, %conv.3
%cmp1 = icmp sgt i32 %sub.3, 2019
br i1 %cmp1, label %cleanup, label %if.else
if.else: ; preds = %entry
%cmp3.not = icmp eq i32 %sub.3, 2019
br i1 %cmp3.not, label %for.body10.preheader, label %cleanup
for.body10.preheader: ; preds = %if.else
%arrayidx14 = getelementptr inbounds i8, ptr %S, i64 5
%5 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%conv15 = sext i8 %5 to i32
%6 = mul nsw i32 %conv15, 10
%arrayidx14.1 = getelementptr inbounds i8, ptr %S, i64 6
%7 = load i8, ptr %arrayidx14.1, align 1, !tbaa !5
%conv15.1 = sext i8 %7 to i32
%add16.1 = add nsw i32 %6, -528
%sub17.1 = add nsw i32 %add16.1, %conv15.1
%cmp21 = icmp sgt i32 %sub17.1, 4
br i1 %cmp21, label %cleanup, label %if.else24
if.else24: ; preds = %for.body10.preheader
%cmp25.not = icmp eq i32 %sub17.1, 4
br i1 %cmp25.not, label %for.body33.preheader, label %cleanup
for.body33.preheader: ; preds = %if.else24
%arrayidx37 = getelementptr inbounds i8, ptr %S, i64 8
%8 = load i8, ptr %arrayidx37, align 1, !tbaa !5
%conv38 = sext i8 %8 to i32
%9 = mul nsw i32 %conv38, 10
%arrayidx37.1 = getelementptr inbounds i8, ptr %S, i64 9
%10 = load i8, ptr %arrayidx37.1, align 1, !tbaa !5
%conv38.1 = sext i8 %10 to i32
%add39.1 = add nsw i32 %9, -528
%sub40.1 = add nsw i32 %add39.1, %conv38.1
%cmp44 = icmp slt i32 %sub40.1, 31
%. = zext i1 %cmp44 to i32
br label %cleanup
cleanup: ; preds = %for.body33.preheader, %if.else24, %for.body10.preheader, %if.else, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 1, %if.else ], [ 0, %for.body10.preheader ], [ 1, %if.else24 ], [ %., %for.body33.preheader ]
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:
%S = alloca [16 x i8], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %S) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i8, ptr %S, align 16, !tbaa !5
%conv.i = sext i8 %0 to i32
%1 = mul nsw i32 %conv.i, 10
%arrayidx.1.i = getelementptr inbounds i8, ptr %S, i64 1
%2 = load i8, ptr %arrayidx.1.i, align 1, !tbaa !5
%conv.1.i = sext i8 %2 to i32
%add.1.i = add nsw i32 %1, -528
%sub.1.i = add nsw i32 %add.1.i, %conv.1.i
%mul.2.i = mul nsw i32 %sub.1.i, 10
%arrayidx.2.i = getelementptr inbounds i8, ptr %S, i64 2
%3 = load i8, ptr %arrayidx.2.i, align 2, !tbaa !5
%conv.2.i = sext i8 %3 to i32
%add.2.i = add nsw i32 %conv.2.i, -48
%sub.2.i = add nsw i32 %add.2.i, %mul.2.i
%mul.3.i = mul nsw i32 %sub.2.i, 10
%arrayidx.3.i = getelementptr inbounds i8, ptr %S, i64 3
%4 = load i8, ptr %arrayidx.3.i, align 1, !tbaa !5
%conv.3.i = sext i8 %4 to i32
%add.3.i = add nsw i32 %conv.3.i, -48
%sub.3.i = add nsw i32 %add.3.i, %mul.3.i
%cmp1.i = icmp sgt i32 %sub.3.i, 2019
br i1 %cmp1.i, label %if.end, label %if.else.i
if.else.i: ; preds = %entry
%cmp3.not.i = icmp eq i32 %sub.3.i, 2019
br i1 %cmp3.not.i, label %for.body10.preheader.i, label %if.else
for.body10.preheader.i: ; preds = %if.else.i
%arrayidx14.i = getelementptr inbounds i8, ptr %S, i64 5
%5 = load i8, ptr %arrayidx14.i, align 1, !tbaa !5
%conv15.i = sext i8 %5 to i32
%6 = mul nsw i32 %conv15.i, 10
%arrayidx14.1.i = getelementptr inbounds i8, ptr %S, i64 6
%7 = load i8, ptr %arrayidx14.1.i, align 2, !tbaa !5
%conv15.1.i = sext i8 %7 to i32
%add16.1.i = add nsw i32 %6, -528
%sub17.1.i = add nsw i32 %add16.1.i, %conv15.1.i
%cmp21.i = icmp sgt i32 %sub17.1.i, 4
br i1 %cmp21.i, label %if.end, label %if.else24.i
if.else24.i: ; preds = %for.body10.preheader.i
%cmp25.not.i = icmp eq i32 %sub17.1.i, 4
br i1 %cmp25.not.i, label %Check.exit, label %if.else
Check.exit: ; preds = %if.else24.i
%arrayidx37.i = getelementptr inbounds i8, ptr %S, i64 8
%8 = load i8, ptr %arrayidx37.i, align 8, !tbaa !5
%conv38.i = sext i8 %8 to i32
%9 = mul nsw i32 %conv38.i, 10
%arrayidx37.1.i = getelementptr inbounds i8, ptr %S, i64 9
%10 = load i8, ptr %arrayidx37.1.i, align 1, !tbaa !5
%conv38.1.i = sext i8 %10 to i32
%add39.1.i = add nsw i32 %9, -528
%sub40.1.i = add nsw i32 %add39.1.i, %conv38.1.i
%cmp44.i = icmp sgt i32 %sub40.1.i, 30
br i1 %cmp44.i, label %if.end, label %if.else
if.else: ; preds = %if.else24.i, %if.else.i, %Check.exit
br label %if.end
if.end: ; preds = %Check.exit, %entry, %for.body10.preheader.i, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.body10.preheader.i ], [ @str.3, %entry ], [ @str.3, %Check.exit ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %S) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int y, m, d;
scanf("%d/%d/%d", &y, &m, &d);
if(m<=4){
printf("Heisei");
}
else{
printf("TBD");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161283/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161283/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"Heisei\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%y = alloca i32, align 4
%m = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y, ptr noundef nonnull %m, ptr noundef nonnull %d)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 5
%.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 %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i=0;i<n;i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1; rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)(n),(int)(n))
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll modpow(ll a, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1) res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
void initialize(){
}
int main(void){
initialize();
ll n,m,i,j,result=0,dMin=-1;
int a[LIMIT2]={0};
char s[LIMIT1];
scanf("%lld",&n);
for(i=1;i<=sqrt(n);i++){
if(n%i == 0){
if(dMin==-1) dMin = i + n/i;
else dMin = min(dMin, i + n/i);
}
}
printf("%lld",dMin-2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161326/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161326/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dx = dso_local local_unnamed_addr global [8 x i32] [i32 1, i32 0, i32 -1, i32 0, i32 1, i32 -1, i32 -1, i32 1], align 16
@dy = dso_local local_unnamed_addr global [8 x i32] [i32 0, i32 1, i32 0, i32 -1, i32 1, i32 1, i32 -1, i32 -1], align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @nPr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #0 {
entry:
%conv = sext i32 %r to i64
%cmp6 = icmp sgt i32 %r, 0
br i1 %cmp6, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%conv2 = sext i32 %n to i64
%xtraiter = and i64 %conv, 7
%0 = icmp ult i32 %r, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %conv, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%result.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul.7, %for.body ]
%i.07 = phi i64 [ 0, %for.body.lr.ph.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.7, %for.body ]
%sub = sub nsw i64 %conv2, %i.07
%mul = mul nsw i64 %result.08, %sub
%inc.neg = xor i64 %i.07, -1
%sub.1 = add i64 %inc.neg, %conv2
%mul.1 = mul nsw i64 %mul, %sub.1
%inc.1 = or i64 %i.07, 2
%sub.2 = sub nsw i64 %conv2, %inc.1
%mul.2 = mul nsw i64 %mul.1, %sub.2
%inc.2 = or i64 %i.07, 3
%sub.3 = sub nsw i64 %conv2, %inc.2
%mul.3 = mul nsw i64 %mul.2, %sub.3
%inc.3 = or i64 %i.07, 4
%sub.4 = sub nsw i64 %conv2, %inc.3
%mul.4 = mul nsw i64 %mul.3, %sub.4
%inc.4 = or i64 %i.07, 5
%sub.5 = sub nsw i64 %conv2, %inc.4
%mul.5 = mul nsw i64 %mul.4, %sub.5
%inc.5 = or i64 %i.07, 6
%sub.6 = sub nsw i64 %conv2, %inc.5
%mul.6 = mul nsw i64 %mul.5, %sub.6
%inc.6 = or i64 %i.07, 7
%sub.7 = sub nsw i64 %conv2, %inc.6
%mul.7 = mul nsw i64 %mul.6, %sub.7
%inc.7 = add nuw nsw i64 %i.07, 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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !5
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul.7, %for.body ]
%result.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul.7, %for.body ]
%i.07.unr = phi i64 [ 0, %for.body.lr.ph ], [ %inc.7, %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.loopexit.unr-lcssa, %for.body.epil
%result.08.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %result.08.unr, %for.end.loopexit.unr-lcssa ]
%i.07.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%sub.epil = sub nsw i64 %conv2, %i.07.epil
%mul.epil = mul nsw i64 %result.08.epil, %sub.epil
%inc.epil = add nuw nsw i64 %i.07.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.end, label %for.body.epil, !llvm.loop !7
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %result.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @nCr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #2 {
entry:
%sub = sub nsw i32 %n, %r
%cond = tail call i32 @llvm.smin.i32(i32 %sub, i32 %r)
%conv = sext i32 %cond to i64
%cmp216 = icmp sgt i32 %cond, 0
br i1 %cmp216, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%conv4 = sext i32 %n to i64
%xtraiter = and i64 %conv, 1
%0 = icmp eq i32 %cond, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %conv, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%result.018 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.017 = phi i64 [ 0, %for.body.lr.ph.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub5 = sub nsw i64 %conv4, %i.017
%mul = mul nsw i64 %result.018, %sub5
%add = or i64 %i.017, 1
%div = sdiv i64 %mul, %add
%sub5.1 = sub nsw i64 %conv4, %add
%mul.1 = mul nsw i64 %div, %sub5.1
%add.1 = add nuw nsw i64 %i.017, 2
%div.1 = sdiv i64 %mul.1, %add.1
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%result.018.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.017.unr = phi i64 [ 0, %for.body.lr.ph ], [ %add.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.loopexit.unr-lcssa
%sub5.epil = sub nsw i64 %conv4, %i.017.unr
%mul.epil = mul nsw i64 %result.018.unr, %sub5.epil
%add.epil = add nuw nsw i64 %i.017.unr, 1
%div.epil = sdiv i64 %mul.epil, %add.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !10
%1 = load i32, ptr %b, align 4, !tbaa !10
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !10
%1 = load i32, ptr %b, align 4, !tbaa !10
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upchar(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %left, ptr noundef nonnull dereferenceable(1) %right) #11
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downchar(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %right, ptr noundef nonnull dereferenceable(1) %left) #11
ret i32 %call
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @modpow(i64 noundef %a, i64 noundef %n, i64 noundef %mod) local_unnamed_addr #0 {
entry:
%cmp9 = icmp sgt i64 %n, 0
br i1 %cmp9, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%res.012 = phi i64 [ %res.1, %if.end ], [ 1, %entry ]
%a.addr.011 = phi i64 [ %rem2, %if.end ], [ %a, %entry ]
%n.addr.010 = phi i64 [ %shr, %if.end ], [ %n, %entry ]
%and = and i64 %n.addr.010, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul nsw i64 %res.012, %a.addr.011
%rem = srem i64 %mul, %mod
br label %if.end
if.end: ; preds = %if.then, %while.body
%res.1 = phi i64 [ %rem, %if.then ], [ %res.012, %while.body ]
%mul1 = mul nsw i64 %a.addr.011, %a.addr.011
%rem2 = srem i64 %mul1, %mod
%shr = lshr i64 %n.addr.010, 1
%cmp.not = icmp ult i64 %n.addr.010, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %if.end, %entry
%res.0.lcssa = phi i64 [ 1, %entry ], [ %res.1, %if.end ]
ret i64 %res.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @initialize() local_unnamed_addr #6 {
entry:
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #12
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !15
%conv128 = sitofp i64 %0 to double
%call229 = call double @sqrt(double noundef %conv128) #12
%cmp30 = fcmp ult double %call229, 1.000000e+00
br i1 %cmp30, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.032 = phi i64 [ %inc, %for.inc ], [ 1, %entry ]
%dMin.031 = phi i64 [ %dMin.1, %for.inc ], [ -1, %entry ]
%1 = load i64, ptr %n, align 8, !tbaa !15
%rem = srem i64 %1, %i.032
%div = sdiv i64 %1, %i.032
%cmp4 = icmp eq i64 %rem, 0
br i1 %cmp4, label %if.then, label %for.inc
if.then: ; preds = %for.body
%cmp6 = icmp eq i64 %dMin.031, -1
%add = add nsw i64 %div, %i.032
br i1 %cmp6, label %for.inc, label %if.else
if.else: ; preds = %if.then
%dMin.0.add10 = call i64 @llvm.smin.i64(i64 %dMin.031, i64 %add)
br label %for.inc
for.inc: ; preds = %if.then, %for.body, %if.else
%dMin.1 = phi i64 [ %dMin.0.add10, %if.else ], [ %dMin.031, %for.body ], [ %add, %if.then ]
%inc = add nuw nsw i64 %i.032, 1
%conv = sitofp i64 %inc to double
%conv1 = sitofp i64 %1 to double
%call2 = call double @sqrt(double noundef %conv1) #12
%cmp = fcmp ult double %call2, %conv
br i1 %cmp, label %for.end.loopexit, label %for.body, !llvm.loop !17
for.end.loopexit: ; preds = %for.inc
%2 = add nsw i64 %dMin.1, -2
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%dMin.0.lcssa = phi i64 [ -3, %entry ], [ %2, %for.end.loopexit ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %dMin.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #12
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.unroll.disable"}
!9 = distinct !{!9, !6}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C/C++ TBAA"}
!14 = distinct !{!14, !6}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !12, i64 0}
!17 = distinct !{!17, !6}
|
#include<stdio.h>
#include<stdlib.h>
typedef long long int ll;
int main()
{
ll t,i;
scanf("%lld",&t);
for(i=0;i<t;i++)
{
ll n;
scanf("%lld",&n);
if(n%3==0)
{
printf("%lld %lld\n",n/3,n/3);
}
else if(n%3==1)
{
printf("%lld %lld\n",(n/3)+1,n/3);
}
else
{
printf("%lld %lld\n",n/3,(n/3)+1);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16137/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16137/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%cmp18 = icmp sgt i64 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end16
%i.019 = phi i64 [ %inc, %if.end16 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !5
%rem = srem i64 %1, 3
%div12 = sdiv i64 %1, 3
switch i64 %rem, label %if.else11 [
i64 0, label %if.then
i64 1, label %if.then7
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div12, i64 noundef %div12)
br label %if.end16
if.then7: ; preds = %for.body
%add = add nsw i64 %div12, 1
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add, i64 noundef %div12)
br label %if.end16
if.else11: ; preds = %for.body
%add14 = add nsw i64 %div12, 1
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div12, i64 noundef %add14)
br label %if.end16
if.end16: ; preds = %if.then7, %if.else11, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
%inc = add nuw nsw i64 %i.019, 1
%2 = load i64, ptr %t, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end16, %entry
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include<string.h>
int main()
{
int t,i,j,cancel,b[26];
char a[51];
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%s",a);
for(j=0;j<26;j++)
{
b[j]=0;
}
for(j=0,cancel=0;j<strlen(a);j++)
{
b[a[j]-97]++;
if(b[(int)a[j]-97]>2)
{
cancel++;
}
}
printf("%d\n",(strlen(a)-cancel)/2);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16142/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16142/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%b = alloca [26 x i32], align 16
%a = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp52 = icmp sgt i32 %0, 0
br i1 %cmp52, label %for.body, label %for.end36
for.body: ; preds = %entry, %for.end28
%i.053 = phi i32 [ %inc35, %for.end28 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %b, i8 0, i64 104, i1 false), !tbaa !5
%call7 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%cmp847.not = icmp eq i64 %call7, 0
br i1 %cmp847.not, label %for.end28, label %for.body10.preheader
for.body10.preheader: ; preds = %for.body
%xtraiter = and i64 %call7, 1
%1 = icmp eq i64 %call7, 1
br i1 %1, label %for.end28.loopexit.unr-lcssa, label %for.body10.preheader.new
for.body10.preheader.new: ; preds = %for.body10.preheader
%unroll_iter = and i64 %call7, -2
br label %for.body10
for.body10: ; preds = %for.body10, %for.body10.preheader.new
%indvars.iv = phi i64 [ 0, %for.body10.preheader.new ], [ %indvars.iv.next.1, %for.body10 ]
%cancel.049 = phi i32 [ 0, %for.body10.preheader.new ], [ %spec.select.1, %for.body10 ]
%niter = phi i64 [ 0, %for.body10.preheader.new ], [ %niter.next.1, %for.body10 ]
%arrayidx12 = getelementptr inbounds [51 x i8], ptr %a, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx12, align 2, !tbaa !9
%conv13 = sext i8 %2 to i64
%sub = add nsw i64 %conv13, -97
%arrayidx15 = getelementptr inbounds [26 x i32], ptr %b, i64 0, i64 %sub
%3 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%inc16 = add nsw i32 %3, 1
store i32 %inc16, ptr %arrayidx15, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %3, 1
%inc25 = zext i1 %cmp23 to i32
%spec.select = add nuw nsw i32 %cancel.049, %inc25
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx12.1 = getelementptr inbounds [51 x i8], ptr %a, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx12.1, align 1, !tbaa !9
%conv13.1 = sext i8 %4 to i64
%sub.1 = add nsw i64 %conv13.1, -97
%arrayidx15.1 = getelementptr inbounds [26 x i32], ptr %b, i64 0, i64 %sub.1
%5 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%inc16.1 = add nsw i32 %5, 1
store i32 %inc16.1, ptr %arrayidx15.1, align 4, !tbaa !5
%cmp23.1 = icmp sgt i32 %5, 1
%inc25.1 = zext i1 %cmp23.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc25.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end28.loopexit.unr-lcssa, label %for.body10, !llvm.loop !10
for.end28.loopexit.unr-lcssa: ; preds = %for.body10, %for.body10.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body10.preheader ], [ %spec.select.1, %for.body10 ]
%indvars.iv.unr = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next.1, %for.body10 ]
%cancel.049.unr = phi i32 [ 0, %for.body10.preheader ], [ %spec.select.1, %for.body10 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end28, label %for.body10.epil
for.body10.epil: ; preds = %for.end28.loopexit.unr-lcssa
%arrayidx12.epil = getelementptr inbounds [51 x i8], ptr %a, i64 0, i64 %indvars.iv.unr
%6 = load i8, ptr %arrayidx12.epil, align 1, !tbaa !9
%conv13.epil = sext i8 %6 to i64
%sub.epil = add nsw i64 %conv13.epil, -97
%arrayidx15.epil = getelementptr inbounds [26 x i32], ptr %b, i64 0, i64 %sub.epil
%7 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !5
%inc16.epil = add nsw i32 %7, 1
store i32 %inc16.epil, ptr %arrayidx15.epil, align 4, !tbaa !5
%cmp23.epil = icmp sgt i32 %7, 1
%inc25.epil = zext i1 %cmp23.epil to i32
%spec.select.epil = add nuw nsw i32 %cancel.049.unr, %inc25.epil
br label %for.end28
for.end28: ; preds = %for.body10.epil, %for.end28.loopexit.unr-lcssa, %for.body
%cancel.0.lcssa = phi i32 [ 0, %for.body ], [ %spec.select.lcssa.ph, %for.end28.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body10.epil ]
%conv31 = sext i32 %cancel.0.lcssa to i64
%sub32 = sub i64 %call7, %conv31
%div45 = lshr i64 %sub32, 1
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div45)
%inc35 = add nuw nsw i32 %i.053, 1
%8 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc35, %8
br i1 %cmp, label %for.body, label %for.end36, !llvm.loop !12
for.end36: ; preds = %for.end28, %entry
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
#include<math.h>
int main()
{
long long n,tmp;
scanf("%lld",&n);
long i;
long long answ=n-1;
for(i=2;i<3000000;i++)
{
if(n%i==0)
{
tmp=i+(n/i)-2;
if(tmp<answ)
answ=tmp;
}
}
printf("%lld",answ);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161463/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161463/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%sub = add nsw i64 %0, -1
br label %for.body
for.body: ; preds = %entry, %for.inc
%answ.014 = phi i64 [ %sub, %entry ], [ %answ.1, %for.inc ]
%i.013 = phi i64 [ 2, %entry ], [ %inc, %for.inc ]
%rem = srem i64 %0, %i.013
%div = sdiv i64 %0, %i.013
%cmp1 = icmp eq i64 %rem, 0
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%add = add nsw i64 %i.013, -2
%sub2 = add i64 %add, %div
%spec.select = call i64 @llvm.smin.i64(i64 %sub2, i64 %answ.014)
br label %for.inc
for.inc: ; preds = %if.then, %for.body
%answ.1 = phi i64 [ %answ.014, %for.body ], [ %spec.select, %if.then ]
%inc = add nuw nsw i64 %i.013, 1
%exitcond.not = icmp eq i64 %inc, 3000000
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %answ.1)
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.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main (void)
{
long int A,B,C,D;
scanf("%ld", &A);
C = A;
for(int i = 1;i<C;i++){
if(A%i == 0){
C = A/i;
B = i;
D=0;
}
D = D+1;
if(D == 1000000){
break;
}
}
long int d;
d = (B-1) + (C-1);
printf("%ld",d);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161506/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161506/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%0 = load i64, ptr %A, align 8, !tbaa !5
%cmp33 = icmp sgt i64 %0, 1
br i1 %cmp33, label %for.body, label %cleanup
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%D.036 = phi i64 [ %add32, %for.inc ], [ undef, %entry ]
%C.035 = phi i64 [ %C.131, %for.inc ], [ %0, %entry ]
%B.034 = phi i64 [ %B.130, %for.inc ], [ undef, %entry ]
%rem = srem i64 %0, %indvars.iv
%div = sdiv i64 %0, %indvars.iv
%cmp3 = icmp eq i64 %rem, 0
br i1 %cmp3, label %for.inc, label %if.end
if.end: ; preds = %for.body
%add = add nsw i64 %D.036, 1
%cmp7 = icmp eq i64 %add, 1000000
br i1 %cmp7, label %cleanup.loopexit, label %for.inc
for.inc: ; preds = %for.body, %if.end
%add32 = phi i64 [ %add, %if.end ], [ 1, %for.body ]
%C.131 = phi i64 [ %C.035, %if.end ], [ %div, %for.body ]
%B.130 = phi i64 [ %B.034, %if.end ], [ %indvars.iv, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp = icmp sgt i64 %C.131, %indvars.iv.next
br i1 %cmp, label %for.body, label %cleanup.loopexit, !llvm.loop !9
cleanup.loopexit: ; preds = %if.end, %for.inc
%B.0.lcssa.ph = phi i64 [ %B.130, %for.inc ], [ %B.034, %if.end ]
%C.0.lcssa.ph = phi i64 [ %C.131, %for.inc ], [ %C.035, %if.end ]
%1 = add i64 %B.0.lcssa.ph, -2
br label %cleanup
cleanup: ; preds = %cleanup.loopexit, %entry
%B.0.lcssa = phi i64 [ undef, %entry ], [ %1, %cleanup.loopexit ]
%C.0.lcssa = phi i64 [ %0, %entry ], [ %C.0.lcssa.ph, %cleanup.loopexit ]
%add12 = add i64 %B.0.lcssa, %C.0.lcssa
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add12)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int t,n;
scanf("%d",&t);
for(int i=0;i<t;i++)
{
scanf("%d",&n);
if(n%3==0)
{
printf("%d %d\n",n/3,n/3);
}
else if(n%3==2)
{
printf("%d %d\n",n/3,((n/3)+1));
}
else if(n%3==1)
{
printf("%d %d\n",((n/3)+1),n/3);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16155/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16155/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.023 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %1, 3
%div15 = sdiv i32 %1, 3
switch i32 %rem, label %for.inc [
i32 0, label %if.then
i32 2, label %if.then7
i32 1, label %if.then14
]
if.then: ; preds = %for.body
%div = sdiv i32 %1, 3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div)
br label %for.inc
if.then7: ; preds = %for.body
%div8 = sdiv i32 %1, 3
%add = add nsw i32 %div8, 1
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div8, i32 noundef %add)
br label %for.inc
if.then14: ; preds = %for.body
%add16 = add nsw i32 %div15, 1
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add16, i32 noundef %div15)
br label %for.inc
for.inc: ; preds = %for.body, %if.then, %if.then14, %if.then7
%inc = add nuw nsw i32 %i.023, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main(int argc,const char *argv[]){
int i,n,S[1001];
double a,ave,sum;
while(1){
ave=0;
a=0;
sum=0;
scanf("%d",&n);
if(n==0){
break;
}
for(i=0;i<n;i++){
scanf("%d",&S[i]);
sum+=S[i];
}
ave= (double)sum/n;
for(i=0;i<n;i++){
a=a+(S[i]-ave)*(S[i]-ave);
}
a=a/(double)n;
a=sqrt(a);
printf("%lf\n",a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161593/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161593/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%S = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %S) #5
%call45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp46 = icmp eq i32 %0, 0
br i1 %cmp46, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end19
%1 = phi i32 [ %16, %for.end19 ], [ %0, %entry ]
%cmp137 = icmp sgt i32 %1, 0
br i1 %cmp137, label %for.body, label %for.end.thread
for.end.thread: ; preds = %for.cond.preheader
%conv555 = sitofp i32 %1 to double
br label %for.end19
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%sum.039 = phi double [ %add, %for.body ], [ 0.000000e+00, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1001 x i32], ptr %S, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sitofp i32 %2 to double
%add = fadd double %sum.039, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%conv5 = sitofp i32 %3 to double
%div = fdiv double %add, %conv5
%cmp741 = icmp sgt i32 %3, 0
br i1 %cmp741, label %for.body9.preheader, label %for.end19
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 3
%5 = icmp ult i32 %3, 4
br i1 %5, label %for.end19.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body9
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%indvars.iv50 = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next51.3, %for.body9 ]
%a.043 = phi double [ 0.000000e+00, %for.body9.preheader.new ], [ %13, %for.body9 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ]
%arrayidx11 = getelementptr inbounds [1001 x i32], ptr %S, i64 0, i64 %indvars.iv50
%6 = load i32, ptr %arrayidx11, align 16, !tbaa !5
%conv12 = sitofp i32 %6 to double
%sub = fsub double %conv12, %div
%7 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %a.043)
%indvars.iv.next51 = or i64 %indvars.iv50, 1
%arrayidx11.1 = getelementptr inbounds [1001 x i32], ptr %S, i64 0, i64 %indvars.iv.next51
%8 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%conv12.1 = sitofp i32 %8 to double
%sub.1 = fsub double %conv12.1, %div
%9 = call double @llvm.fmuladd.f64(double %sub.1, double %sub.1, double %7)
%indvars.iv.next51.1 = or i64 %indvars.iv50, 2
%arrayidx11.2 = getelementptr inbounds [1001 x i32], ptr %S, i64 0, i64 %indvars.iv.next51.1
%10 = load i32, ptr %arrayidx11.2, align 8, !tbaa !5
%conv12.2 = sitofp i32 %10 to double
%sub.2 = fsub double %conv12.2, %div
%11 = call double @llvm.fmuladd.f64(double %sub.2, double %sub.2, double %9)
%indvars.iv.next51.2 = or i64 %indvars.iv50, 3
%arrayidx11.3 = getelementptr inbounds [1001 x i32], ptr %S, i64 0, i64 %indvars.iv.next51.2
%12 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5
%conv12.3 = sitofp i32 %12 to double
%sub.3 = fsub double %conv12.3, %div
%13 = call double @llvm.fmuladd.f64(double %sub.3, double %sub.3, double %11)
%indvars.iv.next51.3 = add nuw nsw i64 %indvars.iv50, 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.end19.loopexit.unr-lcssa, label %for.body9, !llvm.loop !11
for.end19.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%.lcssa61.ph = phi double [ undef, %for.body9.preheader ], [ %13, %for.body9 ]
%indvars.iv50.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next51.3, %for.body9 ]
%a.043.unr = phi double [ 0.000000e+00, %for.body9.preheader ], [ %13, %for.body9 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end19, label %for.body9.epil
for.body9.epil: ; preds = %for.end19.loopexit.unr-lcssa, %for.body9.epil
%indvars.iv50.epil = phi i64 [ %indvars.iv.next51.epil, %for.body9.epil ], [ %indvars.iv50.unr, %for.end19.loopexit.unr-lcssa ]
%a.043.epil = phi double [ %15, %for.body9.epil ], [ %a.043.unr, %for.end19.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.end19.loopexit.unr-lcssa ]
%arrayidx11.epil = getelementptr inbounds [1001 x i32], ptr %S, i64 0, i64 %indvars.iv50.epil
%14 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%conv12.epil = sitofp i32 %14 to double
%sub.epil = fsub double %conv12.epil, %div
%15 = call double @llvm.fmuladd.f64(double %sub.epil, double %sub.epil, double %a.043.epil)
%indvars.iv.next51.epil = add nuw nsw i64 %indvars.iv50.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.end19, label %for.body9.epil, !llvm.loop !12
for.end19: ; preds = %for.end19.loopexit.unr-lcssa, %for.body9.epil, %for.end.thread, %for.end
%conv558 = phi double [ %conv5, %for.end ], [ %conv555, %for.end.thread ], [ %conv5, %for.body9.epil ], [ %conv5, %for.end19.loopexit.unr-lcssa ]
%a.0.lcssa = phi double [ 0.000000e+00, %for.end ], [ 0.000000e+00, %for.end.thread ], [ %.lcssa61.ph, %for.end19.loopexit.unr-lcssa ], [ %15, %for.body9.epil ]
%div21 = fdiv double %a.0.lcssa, %conv558
%call22 = call double @sqrt(double noundef %div21) #5
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call22)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %16, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end19, %entry
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %S) #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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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"}
|
#include <stdio.h>
#include <math.h>
int main(void)
{
int data[1000];
int i, n;
double sum, ave, devsq, var, stdev;
while(1)
{
scanf("%d", &n);
if( n==0 )break;
sum=0;
for(i=0; i<n; i++)
{
scanf("%d", &data[i]);
sum+=data[i];
}
ave = sum/n;
var=0;
for(i=0; i<n; i++)
var += ((double)data[i]-ave)*((double)data[i]-ave);
var /= (double)n;
stdev = sqrt(var);
printf("%.8f\n",stdev);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161643/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161643/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%.8f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%data = alloca [1000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %data) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp45 = icmp eq i32 %0, 0
br i1 %cmp45, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end19
%1 = phi i32 [ %16, %for.end19 ], [ %0, %entry ]
%cmp136 = icmp sgt i32 %1, 0
br i1 %cmp136, label %for.body, label %for.end.thread
for.end.thread: ; preds = %for.cond.preheader
%conv554 = sitofp i32 %1 to double
br label %for.end19
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%sum.037 = phi double [ %add, %for.body ], [ 0.000000e+00, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sitofp i32 %2 to double
%add = fadd double %sum.037, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%conv5 = sitofp i32 %3 to double
%div = fdiv double %add, %conv5
%cmp740 = icmp sgt i32 %3, 0
br i1 %cmp740, label %for.body9.preheader, label %for.end19
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 3
%5 = icmp ult i32 %3, 4
br i1 %5, label %for.end19.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body9
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%indvars.iv49 = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next50.3, %for.body9 ]
%var.041 = phi double [ 0.000000e+00, %for.body9.preheader.new ], [ %13, %for.body9 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ]
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv49
%6 = load i32, ptr %arrayidx11, align 16, !tbaa !5
%conv12 = sitofp i32 %6 to double
%sub = fsub double %conv12, %div
%7 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %var.041)
%indvars.iv.next50 = or i64 %indvars.iv49, 1
%arrayidx11.1 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv.next50
%8 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%conv12.1 = sitofp i32 %8 to double
%sub.1 = fsub double %conv12.1, %div
%9 = call double @llvm.fmuladd.f64(double %sub.1, double %sub.1, double %7)
%indvars.iv.next50.1 = or i64 %indvars.iv49, 2
%arrayidx11.2 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv.next50.1
%10 = load i32, ptr %arrayidx11.2, align 8, !tbaa !5
%conv12.2 = sitofp i32 %10 to double
%sub.2 = fsub double %conv12.2, %div
%11 = call double @llvm.fmuladd.f64(double %sub.2, double %sub.2, double %9)
%indvars.iv.next50.2 = or i64 %indvars.iv49, 3
%arrayidx11.3 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv.next50.2
%12 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5
%conv12.3 = sitofp i32 %12 to double
%sub.3 = fsub double %conv12.3, %div
%13 = call double @llvm.fmuladd.f64(double %sub.3, double %sub.3, double %11)
%indvars.iv.next50.3 = add nuw nsw i64 %indvars.iv49, 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.end19.loopexit.unr-lcssa, label %for.body9, !llvm.loop !11
for.end19.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%.lcssa60.ph = phi double [ undef, %for.body9.preheader ], [ %13, %for.body9 ]
%indvars.iv49.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next50.3, %for.body9 ]
%var.041.unr = phi double [ 0.000000e+00, %for.body9.preheader ], [ %13, %for.body9 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end19, label %for.body9.epil
for.body9.epil: ; preds = %for.end19.loopexit.unr-lcssa, %for.body9.epil
%indvars.iv49.epil = phi i64 [ %indvars.iv.next50.epil, %for.body9.epil ], [ %indvars.iv49.unr, %for.end19.loopexit.unr-lcssa ]
%var.041.epil = phi double [ %15, %for.body9.epil ], [ %var.041.unr, %for.end19.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.end19.loopexit.unr-lcssa ]
%arrayidx11.epil = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv49.epil
%14 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%conv12.epil = sitofp i32 %14 to double
%sub.epil = fsub double %conv12.epil, %div
%15 = call double @llvm.fmuladd.f64(double %sub.epil, double %sub.epil, double %var.041.epil)
%indvars.iv.next50.epil = add nuw nsw i64 %indvars.iv49.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.end19, label %for.body9.epil, !llvm.loop !12
for.end19: ; preds = %for.end19.loopexit.unr-lcssa, %for.body9.epil, %for.end.thread, %for.end
%conv557 = phi double [ %conv5, %for.end ], [ %conv554, %for.end.thread ], [ %conv5, %for.body9.epil ], [ %conv5, %for.end19.loopexit.unr-lcssa ]
%var.0.lcssa = phi double [ 0.000000e+00, %for.end ], [ 0.000000e+00, %for.end.thread ], [ %.lcssa60.ph, %for.end19.loopexit.unr-lcssa ], [ %15, %for.body9.epil ]
%div21 = fdiv double %var.0.lcssa, %conv557
%call22 = call double @sqrt(double noundef %div21) #5
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call22)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %16, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end19, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %data) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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"}
|
#include <stdio.h>
#include <math.h>
int main(){
int n,i,sum,s[1000];
double ave,a;
while(1){
sum=0;
ave=0.0;
a=0.0;
scanf("%d",&n);
if(n==0) break;
for(i=0;i<n;i++){
scanf("%d",&s[i]);
sum=sum+s[i];
}
ave=(double)sum/n;
for(i=0;i<n;i++){
a=a+(s[i]-ave)*(s[i]-ave);
}
printf("%lf\n",sqrt(a/n));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161687/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161687/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %s) #5
%call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp44 = icmp eq i32 %0, 0
br i1 %cmp44, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end19
%1 = phi i32 [ %16, %for.end19 ], [ %0, %entry ]
%cmp135 = icmp sgt i32 %1, 0
br i1 %cmp135, label %for.body, label %for.end.thread
for.end.thread: ; preds = %for.cond.preheader
%conv554 = sitofp i32 %1 to double
br label %for.end19
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%sum.037 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %2, %sum.037
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%conv = sitofp i32 %add to double
%conv5 = sitofp i32 %3 to double
%div = fdiv double %conv, %conv5
%cmp739 = icmp sgt i32 %3, 0
br i1 %cmp739, label %for.body9.preheader, label %for.end19
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 3
%5 = icmp ult i32 %3, 4
br i1 %5, label %for.end19.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body9
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%indvars.iv48 = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next49.3, %for.body9 ]
%a.041 = phi double [ 0.000000e+00, %for.body9.preheader.new ], [ %13, %for.body9 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ]
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv48
%6 = load i32, ptr %arrayidx11, align 16, !tbaa !5
%conv12 = sitofp i32 %6 to double
%sub = fsub double %conv12, %div
%7 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %a.041)
%indvars.iv.next49 = or i64 %indvars.iv48, 1
%arrayidx11.1 = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv.next49
%8 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%conv12.1 = sitofp i32 %8 to double
%sub.1 = fsub double %conv12.1, %div
%9 = call double @llvm.fmuladd.f64(double %sub.1, double %sub.1, double %7)
%indvars.iv.next49.1 = or i64 %indvars.iv48, 2
%arrayidx11.2 = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv.next49.1
%10 = load i32, ptr %arrayidx11.2, align 8, !tbaa !5
%conv12.2 = sitofp i32 %10 to double
%sub.2 = fsub double %conv12.2, %div
%11 = call double @llvm.fmuladd.f64(double %sub.2, double %sub.2, double %9)
%indvars.iv.next49.2 = or i64 %indvars.iv48, 3
%arrayidx11.3 = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv.next49.2
%12 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5
%conv12.3 = sitofp i32 %12 to double
%sub.3 = fsub double %conv12.3, %div
%13 = call double @llvm.fmuladd.f64(double %sub.3, double %sub.3, double %11)
%indvars.iv.next49.3 = add nuw nsw i64 %indvars.iv48, 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.end19.loopexit.unr-lcssa, label %for.body9, !llvm.loop !11
for.end19.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%.lcssa60.ph = phi double [ undef, %for.body9.preheader ], [ %13, %for.body9 ]
%indvars.iv48.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next49.3, %for.body9 ]
%a.041.unr = phi double [ 0.000000e+00, %for.body9.preheader ], [ %13, %for.body9 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end19, label %for.body9.epil
for.body9.epil: ; preds = %for.end19.loopexit.unr-lcssa, %for.body9.epil
%indvars.iv48.epil = phi i64 [ %indvars.iv.next49.epil, %for.body9.epil ], [ %indvars.iv48.unr, %for.end19.loopexit.unr-lcssa ]
%a.041.epil = phi double [ %15, %for.body9.epil ], [ %a.041.unr, %for.end19.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.end19.loopexit.unr-lcssa ]
%arrayidx11.epil = getelementptr inbounds [1000 x i32], ptr %s, i64 0, i64 %indvars.iv48.epil
%14 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%conv12.epil = sitofp i32 %14 to double
%sub.epil = fsub double %conv12.epil, %div
%15 = call double @llvm.fmuladd.f64(double %sub.epil, double %sub.epil, double %a.041.epil)
%indvars.iv.next49.epil = add nuw nsw i64 %indvars.iv48.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.end19, label %for.body9.epil, !llvm.loop !12
for.end19: ; preds = %for.end19.loopexit.unr-lcssa, %for.body9.epil, %for.end.thread, %for.end
%conv557 = phi double [ %conv5, %for.end ], [ %conv554, %for.end.thread ], [ %conv5, %for.body9.epil ], [ %conv5, %for.end19.loopexit.unr-lcssa ]
%a.0.lcssa = phi double [ 0.000000e+00, %for.end ], [ 0.000000e+00, %for.end.thread ], [ %.lcssa60.ph, %for.end19.loopexit.unr-lcssa ], [ %15, %for.body9.epil ]
%div21 = fdiv double %a.0.lcssa, %conv557
%call22 = call double @sqrt(double noundef %div21) #5
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call22)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %16, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end19, %entry
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %s) #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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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"}
|
#include <stdio.h>
int main()
{
char a,b,c;
scanf("%d",&b);
if (b == 1)
printf("Hello World");
else
{
scanf("%d",&a);
scanf("%d",&c);
printf("%d",a+c);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161737/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161737/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %b, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%1 = load i8, ptr %a, align 1, !tbaa !5
%conv5 = sext i8 %1 to i32
%2 = load i8, ptr %c, align 1, !tbaa !5
%conv6 = sext i8 %2 to i32
%add = add nsw i32 %conv6, %conv5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 n,a,b;
scanf("%d",&n);
if(n==2){
scanf("%d%d",&a,&b);
printf("%d",a+b);
}else{
printf("Hello World");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161788/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161788/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 2
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
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 N;
scanf("%d", &N);
if(N == 1)
printf("Hello World\n");
else{
int A, B;
scanf("%d%d", &A, &B);
printf("%d\n", A+B);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161830/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161830/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%d%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %A, ptr noundef nonnull %B)
%1 = load i32, ptr %A, align 4, !tbaa !5
%2 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 N;
scanf("%d",&N);
if(N==1){
printf("Hello World");
}
if(N==2){
int A,B;
scanf("%d",&A);
scanf("%d",&B);
printf("%d\n",A+B);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161874/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161874/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
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)
%.pr = load i32, ptr %N, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i32 [ %.pr, %if.then ], [ %0, %entry ]
%cmp2 = icmp eq i32 %1, 2
br i1 %cmp2, label %if.then3, label %if.end7
if.then3: ; preds = %if.end
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%2 = load i32, ptr %A, align 4, !tbaa !5
%3 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %3, %2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
br label %if.end7
if.end7: ; preds = %if.then3, %if.end
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 n;
int a,b;
scanf("%d",&n);
if(n==1){
printf("Hello World");
}
else if(n==2){
scanf("%d",&a);
scanf("%d",&b);
printf("%d",a+b);
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161924/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161924/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
switch i32 %0, label %if.end7 [
i32 1, label %if.then
i32 2, label %if.then3
]
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end7
if.then3: ; preds = %entry
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
br label %if.end7
if.end7: ; preds = %entry, %if.then3, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
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 n,a,b;
scanf("%d",&n);
if(n==1) printf("Hello World");
if(n==2)
{
scanf("%d %d",&a,&b);
printf("%d",a+b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161968/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161968/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"Hello World\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 i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
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)
%.pr = load i32, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i32 [ %.pr, %if.then ], [ %0, %entry ]
%cmp2 = icmp eq i32 %1, 2
br i1 %cmp2, label %if.then3, label %if.end6
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %3, %2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
br label %if.end6
if.end6: ; preds = %if.then3, %if.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
struct evt {
int floor;
int time;
};
int evtcmp(const void* a, const void*b)
{
struct evt* e = (struct evt*) a;
struct evt* f = (struct evt*) b;
return (e->floor < f->floor) - (e->floor > f->floor);
}
int main()
{
int n, s;
scanf("%d %d", &n, &s);
struct evt evts[1001];
int i;
for (i = 0; i < n; i++) {
scanf("%d %d", &evts[i].floor, &evts[i].time);
}
qsort(evts, n, sizeof(struct evt), evtcmp);
int time = 0;
for (i = 0; i < n; i++) {
if (evts[i].floor < s) {
time += (s - evts[i].floor);
s = evts[i].floor;
}
if (evts[i].time > time) {
time = evts[i].time;
}
}
if (s > 0) {
time += s;
}
printf("%d\n", time);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16201/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16201/source.c"
target datalayout = "e-m:e-p270: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.evt = type { i32, i32 }
@.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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @evtcmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%conv = zext i1 %cmp to i32
%cmp4 = icmp sgt i32 %0, %1
%conv5.neg = sext i1 %cmp4 to i32
%sub = add nsw i32 %conv5.neg, %conv
ret i32 %sub
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%s = alloca i32, align 4
%evts = alloca [1001 x %struct.evt], 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s)
call void @llvm.lifetime.start.p0(i64 8008, ptr nonnull %evts) #6
%0 = load i32, ptr %n, align 4, !tbaa !10
%cmp57 = icmp sgt i32 %0, 0
br i1 %cmp57, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 x %struct.evt], ptr %evts, i64 0, i64 %indvars.iv
%time = getelementptr inbounds [1001 x %struct.evt], ptr %evts, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %time)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !10
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull %evts, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @evtcmp) #6
%3 = load i32, ptr %n, align 4, !tbaa !10
%s.promoted = load i32, ptr %s, align 4, !tbaa !10
%cmp659 = icmp sgt i32 %3, 0
br i1 %cmp659, label %for.body8.preheader, label %for.end32
for.body8.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %3, 1
br i1 %4, label %for.end32.loopexit.unr-lcssa, label %for.body8.preheader.new
for.body8.preheader.new: ; preds = %for.body8.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body8
for.body8: ; preds = %if.end.1, %for.body8.preheader.new
%indvars.iv65 = phi i64 [ 0, %for.body8.preheader.new ], [ %indvars.iv.next66.1, %if.end.1 ]
%time4.061 = phi i32 [ 0, %for.body8.preheader.new ], [ %spec.select.1, %if.end.1 ]
%5 = phi i32 [ %s.promoted, %for.body8.preheader.new ], [ %10, %if.end.1 ]
%niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %if.end.1 ]
%arrayidx10 = getelementptr inbounds [1001 x %struct.evt], ptr %evts, i64 0, i64 %indvars.iv65
%6 = load i32, ptr %arrayidx10, align 16, !tbaa !5
%cmp12 = icmp slt i32 %6, %5
br i1 %cmp12, label %if.then, label %if.end
if.then: ; preds = %for.body8
%sub = sub i32 %time4.061, %6
%add = add i32 %sub, %5
store i32 %6, ptr %s, align 4, !tbaa !10
br label %if.end
if.end: ; preds = %if.then, %for.body8
%7 = phi i32 [ %6, %if.then ], [ %5, %for.body8 ]
%time4.1 = phi i32 [ %add, %if.then ], [ %time4.061, %for.body8 ]
%time22 = getelementptr inbounds [1001 x %struct.evt], ptr %evts, i64 0, i64 %indvars.iv65, i32 1
%8 = load i32, ptr %time22, align 4, !tbaa !13
%spec.select = call i32 @llvm.smax.i32(i32 %8, i32 %time4.1)
%indvars.iv.next66 = or i64 %indvars.iv65, 1
%arrayidx10.1 = getelementptr inbounds [1001 x %struct.evt], ptr %evts, i64 0, i64 %indvars.iv.next66
%9 = load i32, ptr %arrayidx10.1, align 8, !tbaa !5
%cmp12.1 = icmp slt i32 %9, %7
br i1 %cmp12.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %if.end
%sub.1 = sub i32 %spec.select, %9
%add.1 = add i32 %sub.1, %7
store i32 %9, ptr %s, align 4, !tbaa !10
br label %if.end.1
if.end.1: ; preds = %if.then.1, %if.end
%10 = phi i32 [ %9, %if.then.1 ], [ %7, %if.end ]
%time4.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %spec.select, %if.end ]
%time22.1 = getelementptr inbounds [1001 x %struct.evt], ptr %evts, i64 0, i64 %indvars.iv.next66, i32 1
%11 = load i32, ptr %time22.1, align 4, !tbaa !13
%spec.select.1 = call i32 @llvm.smax.i32(i32 %11, i32 %time4.1.1)
%indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 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.end32.loopexit.unr-lcssa, label %for.body8, !llvm.loop !14
for.end32.loopexit.unr-lcssa: ; preds = %if.end.1, %for.body8.preheader
%.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %10, %if.end.1 ]
%spec.select.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %spec.select.1, %if.end.1 ]
%indvars.iv65.unr = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next66.1, %if.end.1 ]
%time4.061.unr = phi i32 [ 0, %for.body8.preheader ], [ %spec.select.1, %if.end.1 ]
%.unr = phi i32 [ %s.promoted, %for.body8.preheader ], [ %10, %if.end.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end32, label %for.body8.epil
for.body8.epil: ; preds = %for.end32.loopexit.unr-lcssa
%arrayidx10.epil = getelementptr inbounds [1001 x %struct.evt], ptr %evts, i64 0, i64 %indvars.iv65.unr
%12 = load i32, ptr %arrayidx10.epil, align 8, !tbaa !5
%cmp12.epil = icmp slt i32 %12, %.unr
br i1 %cmp12.epil, label %if.then.epil, label %if.end.epil
if.then.epil: ; preds = %for.body8.epil
%sub.epil = sub i32 %time4.061.unr, %12
%add.epil = add i32 %sub.epil, %.unr
store i32 %12, ptr %s, align 4, !tbaa !10
br label %if.end.epil
if.end.epil: ; preds = %if.then.epil, %for.body8.epil
%13 = phi i32 [ %12, %if.then.epil ], [ %.unr, %for.body8.epil ]
%time4.1.epil = phi i32 [ %add.epil, %if.then.epil ], [ %time4.061.unr, %for.body8.epil ]
%time22.epil = getelementptr inbounds [1001 x %struct.evt], ptr %evts, i64 0, i64 %indvars.iv65.unr, i32 1
%14 = load i32, ptr %time22.epil, align 4, !tbaa !13
%spec.select.epil = call i32 @llvm.smax.i32(i32 %14, i32 %time4.1.epil)
br label %for.end32
for.end32: ; preds = %if.end.epil, %for.end32.loopexit.unr-lcssa, %for.end
%15 = phi i32 [ %s.promoted, %for.end ], [ %.lcssa.ph, %for.end32.loopexit.unr-lcssa ], [ %13, %if.end.epil ]
%time4.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select.lcssa.ph, %for.end32.loopexit.unr-lcssa ], [ %spec.select.epil, %if.end.epil ]
%add36 = call i32 @llvm.smax.i32(i32 %15, i32 0)
%spec.select56 = add nsw i32 %add36, %time4.0.lcssa
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select56)
call void @llvm.lifetime.end.p0(i64 8008, ptr nonnull %evts) #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 #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"evt", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !7, i64 4}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
int main(void){
int a, b;
int n;
scanf("%d", &n);
if (n == 1){
printf("Hello World\n");
}else{
scanf("%d\n%d", &a, &b);
printf("%d", a + b);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162053/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162053/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A%d\00", align 1
@str = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq 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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 argc, char const *argv[])
{
int n,a,b;
scanf("%d",&n);
if(!(n - 1)){
printf("Hello World\n");
}
else{
scanf(" %d %d",&a,&b);
printf("%d\n",a + b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162110/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162110/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c" %d %d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %0, 1
br i1 %tobool.not, 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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 H,W,m,hmax=0,wmax=0;
scanf("%d %d %d",&H,&W,&m);
int hbomb[H+1],h[m+1],wbomb[W+1],w[m+1];
for(int i=1;i<=H;i++){
hbomb[i]=0;
}
for(int i=1;i<=W;i++){
wbomb[i]=0;
}
for(int i=1;i<=m;i++){
scanf("%d %d",&h[i],&w[i]);
hbomb[h[i]]+=1;
wbomb[w[i]]+=1;
}
for(int i=1;i<=H;i++){
if(hmax<hbomb[i]){
hmax=hbomb[i];
}
}
for(int i=1;i<=W;i++){
if(wmax<wbomb[i]){
wmax=wbomb[i];
}
}
int hbox[H+1],wbox[W+1];
int hcount=0,wcount=0,count=0;
for(int i=1;i<=H;i++){
if(hbomb[i]==hmax){
hbox[i]=1;
hcount+=1;
}
else{hbox[i]=0;}
}
for(int i=1;i<=W;i++){
if(wbomb[i]==wmax){
wbox[i]=1;
wcount+=1;
}
else{
wbox[i]=0;
}
}
for(int i=1;i<=m;i++){
if(hbox[h[i]]==1 && wbox[w[i]]==1){
count+=1;
}
}
if(count==hcount*wcount){
printf("%d",hmax+wmax-1);
return 0;
}
else{
printf("%d",hmax+wmax);
return 0;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162161/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162161/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W, ptr noundef nonnull %m)
%0 = load i32, ptr %H, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %m, align 4, !tbaa !5
%add1 = add nsw i32 %3, 1
%4 = zext i32 %add1 to i64
%vla2 = alloca i32, i64 %4, align 16
%5 = load i32, ptr %W, align 4, !tbaa !5
%add3 = add nsw i32 %5, 1
%6 = zext i32 %add3 to i64
%vla4 = alloca i32, i64 %6, align 16
%vla6 = alloca i32, i64 %4, align 16
%7 = load i32, ptr %H, align 4, !tbaa !5
%cmp.not186 = icmp slt i32 %7, 1
br i1 %cmp.not186, label %for.cond8.preheader, label %for.body.preheader
for.body.preheader: ; preds = %entry
%scevgep = getelementptr i8, ptr %vla, i64 4
%8 = zext i32 %7 to i64
%9 = shl nuw nsw i64 %8, 2
call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %9, i1 false), !tbaa !5
br label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.body.preheader, %entry
%cmp9.not188 = icmp slt i32 %5, 1
br i1 %cmp9.not188, label %for.cond18.preheader, label %for.body11.preheader
for.body11.preheader: ; preds = %for.cond8.preheader
%scevgep215 = getelementptr i8, ptr %vla4, i64 4
%10 = zext i32 %5 to i64
%11 = shl nuw nsw i64 %10, 2
call void @llvm.memset.p0.i64(ptr align 4 %scevgep215, i8 0, i64 %11, i1 false), !tbaa !5
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.body11.preheader, %for.cond8.preheader
%cmp19.not190 = icmp slt i32 %3, 1
br i1 %cmp19.not190, label %for.cond41.preheader, label %for.body21
for.cond41.preheader.loopexit: ; preds = %for.body21
%.pre = load i32, ptr %H, align 4, !tbaa !5
br label %for.cond41.preheader
for.cond41.preheader: ; preds = %for.cond41.preheader.loopexit, %for.cond18.preheader
%12 = phi i32 [ %7, %for.cond18.preheader ], [ %.pre, %for.cond41.preheader.loopexit ]
%.lcssa185 = phi i32 [ %3, %for.cond18.preheader ], [ %25, %for.cond41.preheader.loopexit ]
%cmp42.not192 = icmp slt i32 %12, 1
br i1 %cmp42.not192, label %for.cond54.preheader, label %for.body44.preheader
for.body44.preheader: ; preds = %for.cond41.preheader
%13 = add nuw i32 %12, 1
%wide.trip.count = zext i32 %13 to i64
%14 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %12, 8
br i1 %min.iters.check, label %for.body44.preheader316, label %vector.ph
vector.ph: ; preds = %for.body44.preheader
%n.vec = and i64 %14, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.phi248 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%offset.idx = or i64 %index, 1
%15 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 4
%wide.load249 = load <4 x i32>, ptr %16, align 4, !tbaa !5
%17 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%18 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi248, <4 x i32> %wide.load249)
%index.next = add nuw i64 %index, 8
%19 = icmp eq i64 %index.next, %n.vec
br i1 %19, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %17, <4 x i32> %18)
%20 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %14, %n.vec
br i1 %cmp.n, label %for.cond54.preheader, label %for.body44.preheader316
for.body44.preheader316: ; preds = %for.body44.preheader, %middle.block
%indvars.iv218.ph = phi i64 [ 1, %for.body44.preheader ], [ %ind.end, %middle.block ]
%hmax.0194.ph = phi i32 [ 0, %for.body44.preheader ], [ %20, %middle.block ]
br label %for.body44
for.body21: ; preds = %for.cond18.preheader, %for.body21
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body21 ], [ 1, %for.cond18.preheader ]
%arrayidx23 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv
%arrayidx25 = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx23, ptr noundef nonnull %arrayidx25)
%21 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%idxprom29 = sext i32 %21 to i64
%arrayidx30 = getelementptr inbounds i32, ptr %vla, i64 %idxprom29
%22 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%add31 = add nsw i32 %22, 1
store i32 %add31, ptr %arrayidx30, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%idxprom34 = sext i32 %23 to i64
%arrayidx35 = getelementptr inbounds i32, ptr %vla4, i64 %idxprom34
%24 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%add36 = add nsw i32 %24, 1
store i32 %add36, ptr %arrayidx35, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%25 = load i32, ptr %m, align 4, !tbaa !5
%26 = sext i32 %25 to i64
%cmp19.not.not = icmp slt i64 %indvars.iv, %26
br i1 %cmp19.not.not, label %for.body21, label %for.cond41.preheader.loopexit, !llvm.loop !13
for.cond54.preheader: ; preds = %for.body44, %middle.block, %for.cond41.preheader
%hmax.0.lcssa = phi i32 [ 0, %for.cond41.preheader ], [ %20, %middle.block ], [ %spec.select, %for.body44 ]
%27 = load i32, ptr %W, align 4, !tbaa !5
%cmp55.not197 = icmp slt i32 %27, 1
%.pre242 = add i32 %27, 1
%.pre243 = zext i32 %.pre242 to i64
br i1 %cmp55.not197, label %for.cond.cleanup56, label %for.body57.preheader
for.body57.preheader: ; preds = %for.cond54.preheader
%28 = add nsw i64 %.pre243, -1
%min.iters.check252 = icmp ult i64 %28, 8
br i1 %min.iters.check252, label %for.body57.preheader313, label %vector.ph253
vector.ph253: ; preds = %for.body57.preheader
%n.vec255 = and i64 %28, -8
%ind.end256 = or i64 %n.vec255, 1
br label %vector.body259
vector.body259: ; preds = %vector.body259, %vector.ph253
%index260 = phi i64 [ 0, %vector.ph253 ], [ %index.next266, %vector.body259 ]
%vec.phi261 = phi <4 x i32> [ zeroinitializer, %vector.ph253 ], [ %31, %vector.body259 ]
%vec.phi262 = phi <4 x i32> [ zeroinitializer, %vector.ph253 ], [ %32, %vector.body259 ]
%offset.idx263 = or i64 %index260, 1
%29 = getelementptr inbounds i32, ptr %vla4, i64 %offset.idx263
%wide.load264 = load <4 x i32>, ptr %29, align 4, !tbaa !5
%30 = getelementptr inbounds i32, ptr %29, i64 4
%wide.load265 = load <4 x i32>, ptr %30, align 4, !tbaa !5
%31 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi261, <4 x i32> %wide.load264)
%32 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi262, <4 x i32> %wide.load265)
%index.next266 = add nuw i64 %index260, 8
%33 = icmp eq i64 %index.next266, %n.vec255
br i1 %33, label %middle.block250, label %vector.body259, !llvm.loop !14
middle.block250: ; preds = %vector.body259
%rdx.minmax267 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %31, <4 x i32> %32)
%34 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax267)
%cmp.n258 = icmp eq i64 %28, %n.vec255
br i1 %cmp.n258, label %for.cond.cleanup56, label %for.body57.preheader313
for.body57.preheader313: ; preds = %for.body57.preheader, %middle.block250
%indvars.iv221.ph = phi i64 [ 1, %for.body57.preheader ], [ %ind.end256, %middle.block250 ]
%wmax.0198.ph = phi i32 [ 0, %for.body57.preheader ], [ %34, %middle.block250 ]
br label %for.body57
for.body44: ; preds = %for.body44.preheader316, %for.body44
%indvars.iv218 = phi i64 [ %indvars.iv.next219, %for.body44 ], [ %indvars.iv218.ph, %for.body44.preheader316 ]
%hmax.0194 = phi i32 [ %spec.select, %for.body44 ], [ %hmax.0194.ph, %for.body44.preheader316 ]
%arrayidx46 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv218
%35 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %hmax.0194, i32 %35)
%indvars.iv.next219 = add nuw nsw i64 %indvars.iv218, 1
%exitcond.not = icmp eq i64 %indvars.iv.next219, %wide.trip.count
br i1 %exitcond.not, label %for.cond54.preheader, label %for.body44, !llvm.loop !15
for.cond.cleanup56: ; preds = %for.body57, %middle.block250, %for.cond54.preheader
%wmax.0.lcssa = phi i32 [ 0, %for.cond54.preheader ], [ %34, %middle.block250 ], [ %spec.select182, %for.body57 ]
%add68 = add i32 %12, 1
%36 = zext i32 %add68 to i64
%vla69 = alloca i32, i64 %36, align 16
%vla71 = alloca i32, i64 %.pre243, align 16
br i1 %cmp42.not192, label %for.cond91.preheader, label %for.body76.preheader
for.body76.preheader: ; preds = %for.cond.cleanup56
%37 = add nsw i64 %36, -1
%min.iters.check271 = icmp ult i64 %37, 8
br i1 %min.iters.check271, label %for.body76.preheader310, label %vector.ph272
vector.ph272: ; preds = %for.body76.preheader
%n.vec274 = and i64 %37, -8
%ind.end275 = or i64 %n.vec274, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %hmax.0.lcssa, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body278
vector.body278: ; preds = %vector.body278, %vector.ph272
%index279 = phi i64 [ 0, %vector.ph272 ], [ %index.next285, %vector.body278 ]
%vec.phi280 = phi <4 x i32> [ zeroinitializer, %vector.ph272 ], [ %46, %vector.body278 ]
%vec.phi281 = phi <4 x i32> [ zeroinitializer, %vector.ph272 ], [ %47, %vector.body278 ]
%offset.idx282 = or i64 %index279, 1
%38 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx282
%wide.load283 = load <4 x i32>, ptr %38, align 4, !tbaa !5
%39 = getelementptr inbounds i32, ptr %38, i64 4
%wide.load284 = load <4 x i32>, ptr %39, align 4, !tbaa !5
%40 = icmp eq <4 x i32> %wide.load283, %broadcast.splat
%41 = icmp eq <4 x i32> %wide.load284, %broadcast.splat
%42 = zext <4 x i1> %40 to <4 x i32>
%43 = zext <4 x i1> %41 to <4 x i32>
%44 = zext <4 x i1> %40 to <4 x i32>
%45 = zext <4 x i1> %41 to <4 x i32>
%46 = add <4 x i32> %vec.phi280, %44
%47 = add <4 x i32> %vec.phi281, %45
%48 = getelementptr inbounds i32, ptr %vla69, i64 %offset.idx282
store <4 x i32> %42, ptr %48, align 4
%49 = getelementptr inbounds i32, ptr %48, i64 4
store <4 x i32> %43, ptr %49, align 4
%index.next285 = add nuw i64 %index279, 8
%50 = icmp eq i64 %index.next285, %n.vec274
br i1 %50, label %middle.block269, label %vector.body278, !llvm.loop !16
middle.block269: ; preds = %vector.body278
%bin.rdx = add <4 x i32> %47, %46
%51 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n277 = icmp eq i64 %37, %n.vec274
br i1 %cmp.n277, label %for.cond91.preheader, label %for.body76.preheader310
for.body76.preheader310: ; preds = %for.body76.preheader, %middle.block269
%indvars.iv226.ph = phi i64 [ 1, %for.body76.preheader ], [ %ind.end275, %middle.block269 ]
%hcount.0203.ph = phi i32 [ 0, %for.body76.preheader ], [ %51, %middle.block269 ]
br label %for.body76
for.body57: ; preds = %for.body57.preheader313, %for.body57
%indvars.iv221 = phi i64 [ %indvars.iv.next222, %for.body57 ], [ %indvars.iv221.ph, %for.body57.preheader313 ]
%wmax.0198 = phi i32 [ %spec.select182, %for.body57 ], [ %wmax.0198.ph, %for.body57.preheader313 ]
%arrayidx59 = getelementptr inbounds i32, ptr %vla4, i64 %indvars.iv221
%52 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%spec.select182 = call i32 @llvm.smax.i32(i32 %wmax.0198, i32 %52)
%indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1
%exitcond225.not = icmp eq i64 %indvars.iv.next222, %.pre243
br i1 %exitcond225.not, label %for.cond.cleanup56, label %for.body57, !llvm.loop !17
for.cond91.preheader: ; preds = %for.body76, %middle.block269, %for.cond.cleanup56
%hcount.0.lcssa = phi i32 [ 0, %for.cond.cleanup56 ], [ %51, %middle.block269 ], [ %spec.select245, %for.body76 ]
br i1 %cmp55.not197, label %for.cond110.preheader, label %for.body94.preheader
for.body94.preheader: ; preds = %for.cond91.preheader
%53 = add nsw i64 %.pre243, -1
%min.iters.check289 = icmp ult i64 %53, 8
br i1 %min.iters.check289, label %for.body94.preheader308, label %vector.ph290
vector.ph290: ; preds = %for.body94.preheader
%n.vec292 = and i64 %53, -8
%ind.end293 = or i64 %n.vec292, 1
%broadcast.splatinsert303 = insertelement <4 x i32> poison, i32 %wmax.0.lcssa, i64 0
%broadcast.splat304 = shufflevector <4 x i32> %broadcast.splatinsert303, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body296
vector.body296: ; preds = %vector.body296, %vector.ph290
%index297 = phi i64 [ 0, %vector.ph290 ], [ %index.next305, %vector.body296 ]
%vec.phi298 = phi <4 x i32> [ zeroinitializer, %vector.ph290 ], [ %62, %vector.body296 ]
%vec.phi299 = phi <4 x i32> [ zeroinitializer, %vector.ph290 ], [ %63, %vector.body296 ]
%offset.idx300 = or i64 %index297, 1
%54 = getelementptr inbounds i32, ptr %vla4, i64 %offset.idx300
%wide.load301 = load <4 x i32>, ptr %54, align 4, !tbaa !5
%55 = getelementptr inbounds i32, ptr %54, i64 4
%wide.load302 = load <4 x i32>, ptr %55, align 4, !tbaa !5
%56 = icmp eq <4 x i32> %wide.load301, %broadcast.splat304
%57 = icmp eq <4 x i32> %wide.load302, %broadcast.splat304
%58 = zext <4 x i1> %56 to <4 x i32>
%59 = zext <4 x i1> %57 to <4 x i32>
%60 = zext <4 x i1> %56 to <4 x i32>
%61 = zext <4 x i1> %57 to <4 x i32>
%62 = add <4 x i32> %vec.phi298, %60
%63 = add <4 x i32> %vec.phi299, %61
%64 = getelementptr inbounds i32, ptr %vla71, i64 %offset.idx300
store <4 x i32> %58, ptr %64, align 4
%65 = getelementptr inbounds i32, ptr %64, i64 4
store <4 x i32> %59, ptr %65, align 4
%index.next305 = add nuw i64 %index297, 8
%66 = icmp eq i64 %index.next305, %n.vec292
br i1 %66, label %middle.block287, label %vector.body296, !llvm.loop !18
middle.block287: ; preds = %vector.body296
%bin.rdx306 = add <4 x i32> %63, %62
%67 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx306)
%cmp.n295 = icmp eq i64 %53, %n.vec292
br i1 %cmp.n295, label %for.cond110.preheader, label %for.body94.preheader308
for.body94.preheader308: ; preds = %for.body94.preheader, %middle.block287
%indvars.iv231.ph = phi i64 [ 1, %for.body94.preheader ], [ %ind.end293, %middle.block287 ]
%wcount.0207.ph = phi i32 [ 0, %for.body94.preheader ], [ %67, %middle.block287 ]
br label %for.body94
for.body76: ; preds = %for.body76.preheader310, %for.body76
%indvars.iv226 = phi i64 [ %indvars.iv.next227, %for.body76 ], [ %indvars.iv226.ph, %for.body76.preheader310 ]
%hcount.0203 = phi i32 [ %spec.select245, %for.body76 ], [ %hcount.0203.ph, %for.body76.preheader310 ]
%arrayidx78 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv226
%68 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%cmp79 = icmp eq i32 %68, %hmax.0.lcssa
%spec.select244 = zext i1 %cmp79 to i32
%add83 = zext i1 %cmp79 to i32
%spec.select245 = add nuw nsw i32 %hcount.0203, %add83
%69 = getelementptr inbounds i32, ptr %vla69, i64 %indvars.iv226
store i32 %spec.select244, ptr %69, align 4
%indvars.iv.next227 = add nuw nsw i64 %indvars.iv226, 1
%exitcond230.not = icmp eq i64 %indvars.iv.next227, %36
br i1 %exitcond230.not, label %for.cond91.preheader, label %for.body76, !llvm.loop !19
for.cond110.preheader: ; preds = %for.body94, %middle.block287, %for.cond91.preheader
%wcount.0.lcssa = phi i32 [ 0, %for.cond91.preheader ], [ %67, %middle.block287 ], [ %spec.select247, %for.body94 ]
%cmp111.not210 = icmp slt i32 %.lcssa185, 1
br i1 %cmp111.not210, label %for.cond.cleanup112, label %for.body113.preheader
for.body113.preheader: ; preds = %for.cond110.preheader
%70 = add i32 %.lcssa185, 1
%wide.trip.count239 = zext i32 %70 to i64
%71 = add nsw i64 %wide.trip.count239, -1
%xtraiter = and i64 %71, 1
%72 = icmp eq i32 %70, 2
br i1 %72, label %for.cond.cleanup112.loopexit.unr-lcssa, label %for.body113.preheader.new
for.body113.preheader.new: ; preds = %for.body113.preheader
%unroll_iter = and i64 %71, -2
br label %for.body113
for.body94: ; preds = %for.body94.preheader308, %for.body94
%indvars.iv231 = phi i64 [ %indvars.iv.next232, %for.body94 ], [ %indvars.iv231.ph, %for.body94.preheader308 ]
%wcount.0207 = phi i32 [ %spec.select247, %for.body94 ], [ %wcount.0207.ph, %for.body94.preheader308 ]
%arrayidx96 = getelementptr inbounds i32, ptr %vla4, i64 %indvars.iv231
%73 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%cmp97 = icmp eq i32 %73, %wmax.0.lcssa
%spec.select246 = zext i1 %cmp97 to i32
%add101 = zext i1 %cmp97 to i32
%spec.select247 = add nuw nsw i32 %wcount.0207, %add101
%74 = getelementptr inbounds i32, ptr %vla71, i64 %indvars.iv231
store i32 %spec.select246, ptr %74, align 4
%indvars.iv.next232 = add nuw nsw i64 %indvars.iv231, 1
%exitcond235.not = icmp eq i64 %indvars.iv.next232, %.pre243
br i1 %exitcond235.not, label %for.cond110.preheader, label %for.body94, !llvm.loop !20
for.cond.cleanup112.loopexit.unr-lcssa: ; preds = %for.inc127.1, %for.body113.preheader
%count.1.lcssa.ph = phi i32 [ undef, %for.body113.preheader ], [ %count.1.1, %for.inc127.1 ]
%indvars.iv236.unr = phi i64 [ 1, %for.body113.preheader ], [ %indvars.iv.next237.1, %for.inc127.1 ]
%count.0211.unr = phi i32 [ 0, %for.body113.preheader ], [ %count.1.1, %for.inc127.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup112, label %for.body113.epil
for.body113.epil: ; preds = %for.cond.cleanup112.loopexit.unr-lcssa
%arrayidx115.epil = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv236.unr
%75 = load i32, ptr %arrayidx115.epil, align 4, !tbaa !5
%idxprom116.epil = sext i32 %75 to i64
%arrayidx117.epil = getelementptr inbounds i32, ptr %vla69, i64 %idxprom116.epil
%76 = load i32, ptr %arrayidx117.epil, align 4, !tbaa !5
%cmp118.epil = icmp eq i32 %76, 1
br i1 %cmp118.epil, label %land.lhs.true.epil, label %for.cond.cleanup112
land.lhs.true.epil: ; preds = %for.body113.epil
%arrayidx120.epil = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv236.unr
%77 = load i32, ptr %arrayidx120.epil, align 4, !tbaa !5
%idxprom121.epil = sext i32 %77 to i64
%arrayidx122.epil = getelementptr inbounds i32, ptr %vla71, i64 %idxprom121.epil
%78 = load i32, ptr %arrayidx122.epil, align 4, !tbaa !5
%cmp123.epil = icmp eq i32 %78, 1
%add125.epil = zext i1 %cmp123.epil to i32
%spec.select183.epil = add nsw i32 %count.0211.unr, %add125.epil
br label %for.cond.cleanup112
for.cond.cleanup112: ; preds = %for.cond.cleanup112.loopexit.unr-lcssa, %land.lhs.true.epil, %for.body113.epil, %for.cond110.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond110.preheader ], [ %count.1.lcssa.ph, %for.cond.cleanup112.loopexit.unr-lcssa ], [ %count.0211.unr, %for.body113.epil ], [ %spec.select183.epil, %land.lhs.true.epil ]
%mul = mul nsw i32 %wcount.0.lcssa, %hcount.0.lcssa
%cmp130 = icmp eq i32 %count.0.lcssa, %mul
%add132 = sext i1 %cmp130 to i32
%add135.sink.v = add nsw i32 %hmax.0.lcssa, %add132
%add135.sink = add i32 %add135.sink.v, %wmax.0.lcssa
%call136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add135.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #6
ret i32 0
for.body113: ; preds = %for.inc127.1, %for.body113.preheader.new
%indvars.iv236 = phi i64 [ 1, %for.body113.preheader.new ], [ %indvars.iv.next237.1, %for.inc127.1 ]
%count.0211 = phi i32 [ 0, %for.body113.preheader.new ], [ %count.1.1, %for.inc127.1 ]
%niter = phi i64 [ 0, %for.body113.preheader.new ], [ %niter.next.1, %for.inc127.1 ]
%arrayidx115 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv236
%79 = load i32, ptr %arrayidx115, align 4, !tbaa !5
%idxprom116 = sext i32 %79 to i64
%arrayidx117 = getelementptr inbounds i32, ptr %vla69, i64 %idxprom116
%80 = load i32, ptr %arrayidx117, align 4, !tbaa !5
%cmp118 = icmp eq i32 %80, 1
br i1 %cmp118, label %land.lhs.true, label %for.inc127
land.lhs.true: ; preds = %for.body113
%arrayidx120 = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv236
%81 = load i32, ptr %arrayidx120, align 4, !tbaa !5
%idxprom121 = sext i32 %81 to i64
%arrayidx122 = getelementptr inbounds i32, ptr %vla71, i64 %idxprom121
%82 = load i32, ptr %arrayidx122, align 4, !tbaa !5
%cmp123 = icmp eq i32 %82, 1
%add125 = zext i1 %cmp123 to i32
%spec.select183 = add nsw i32 %count.0211, %add125
br label %for.inc127
for.inc127: ; preds = %land.lhs.true, %for.body113
%count.1 = phi i32 [ %count.0211, %for.body113 ], [ %spec.select183, %land.lhs.true ]
%indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1
%arrayidx115.1 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next237
%83 = load i32, ptr %arrayidx115.1, align 4, !tbaa !5
%idxprom116.1 = sext i32 %83 to i64
%arrayidx117.1 = getelementptr inbounds i32, ptr %vla69, i64 %idxprom116.1
%84 = load i32, ptr %arrayidx117.1, align 4, !tbaa !5
%cmp118.1 = icmp eq i32 %84, 1
br i1 %cmp118.1, label %land.lhs.true.1, label %for.inc127.1
land.lhs.true.1: ; preds = %for.inc127
%arrayidx120.1 = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv.next237
%85 = load i32, ptr %arrayidx120.1, align 4, !tbaa !5
%idxprom121.1 = sext i32 %85 to i64
%arrayidx122.1 = getelementptr inbounds i32, ptr %vla71, i64 %idxprom121.1
%86 = load i32, ptr %arrayidx122.1, align 4, !tbaa !5
%cmp123.1 = icmp eq i32 %86, 1
%add125.1 = zext i1 %cmp123.1 to i32
%spec.select183.1 = add nsw i32 %count.1, %add125.1
br label %for.inc127.1
for.inc127.1: ; preds = %land.lhs.true.1, %for.inc127
%count.1.1 = phi i32 [ %count.1, %for.inc127 ], [ %spec.select183.1, %land.lhs.true.1 ]
%indvars.iv.next237.1 = add nuw nsw i64 %indvars.iv236, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup112.loopexit.unr-lcssa, label %for.body113, !llvm.loop !21
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10, !11, !12}
!17 = distinct !{!17, !10, !12, !11}
!18 = distinct !{!18, !10, !11, !12}
!19 = distinct !{!19, !10, !12, !11}
!20 = distinct !{!20, !10, !12, !11}
!21 = distinct !{!21, !10}
|
#pragma GCC optimize("Ofast")
#include<stdio.h>
int main(void)
{
int n = 0, a = 0, b;
int d[200000];
char c=getchar_unlocked();
while(c<='9'&&c>='0') {n=(n<<1)+(n<<3)+c-'0'; c=getchar_unlocked();}
int* e = d + n;
do
{
d[n] = 0;
c=getchar_unlocked();
while(c<='9'&&c>='0') {d[n]=(d[n]<<1)+(d[n]<<3)+c-'0'; c=getchar_unlocked();}
a ^= d[n];
} while(--n);
while(d != e)
{
printf("%d ", a ^ *e);
--e;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162219/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162219/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca [200000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %d) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4
%.pre108.pre.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%.pre108.pre = phi ptr [ %.pre108.pre.pre, %cond.true.i ], [ %0, %cond.false.i ]
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%sext95 = shl i32 %cond.i, 24
%4 = add i32 %sext95, -788529153
%5 = icmp ult i32 %4, 184549375
br i1 %5, label %while.body, label %while.end
while.body: ; preds = %getchar_unlocked.exit, %getchar_unlocked.exit74
%6 = phi ptr [ %10, %getchar_unlocked.exit74 ], [ %.pre108.pre, %getchar_unlocked.exit ]
%c.0.in97 = phi i32 [ %cond.i70, %getchar_unlocked.exit74 ], [ %cond.i, %getchar_unlocked.exit ]
%n.096 = phi i32 [ %sub, %getchar_unlocked.exit74 ], [ 0, %getchar_unlocked.exit ]
%conv1 = and i32 %c.0.in97, 255
%add = mul i32 %n.096, 10
%add8 = add i32 %add, -48
%sub = add i32 %add8, %conv1
%_IO_read_ptr.i65 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1
%7 = load ptr, ptr %_IO_read_ptr.i65, align 8, !tbaa !9
%_IO_read_end.i66 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2
%8 = load ptr, ptr %_IO_read_end.i66, align 8, !tbaa !14
%cmp.not.i67 = icmp ult ptr %7, %8
br i1 %cmp.not.i67, label %cond.false.i71, label %cond.true.i68, !prof !15
cond.true.i68: ; preds = %while.body
%call.i69 = tail call i32 @__uflow(ptr noundef nonnull %6) #4
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit74
cond.false.i71: ; preds = %while.body
%incdec.ptr.i72 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i72, ptr %_IO_read_ptr.i65, align 8, !tbaa !9
%9 = load i8, ptr %7, align 1, !tbaa !16
%conv3.i73 = zext i8 %9 to i32
br label %getchar_unlocked.exit74
getchar_unlocked.exit74: ; preds = %cond.true.i68, %cond.false.i71
%10 = phi ptr [ %.pre, %cond.true.i68 ], [ %6, %cond.false.i71 ]
%cond.i70 = phi i32 [ %call.i69, %cond.true.i68 ], [ %conv3.i73, %cond.false.i71 ]
%sext = shl i32 %cond.i70, 24
%11 = add i32 %sext, -788529153
%12 = icmp ult i32 %11, 184549375
br i1 %12, label %while.body, label %while.end, !llvm.loop !17
while.end: ; preds = %getchar_unlocked.exit74, %getchar_unlocked.exit
%.pre108 = phi ptr [ %.pre108.pre, %getchar_unlocked.exit ], [ %10, %getchar_unlocked.exit74 ]
%n.0.lcssa = phi i32 [ 0, %getchar_unlocked.exit ], [ %sub, %getchar_unlocked.exit74 ]
%idx.ext = sext i32 %n.0.lcssa to i64
br label %do.body
do.body: ; preds = %while.end37, %while.end
%.pre106109 = phi ptr [ %.pre106110, %while.end37 ], [ %.pre108, %while.end ]
%13 = phi ptr [ %27, %while.end37 ], [ %.pre108, %while.end ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.end37 ], [ %idx.ext, %while.end ]
%a.0 = phi i32 [ %xor, %while.end37 ], [ 0, %while.end ]
%arrayidx = getelementptr inbounds [200000 x i32], ptr %d, i64 0, i64 %indvars.iv
store i32 0, ptr %arrayidx, align 4, !tbaa !19
%_IO_read_ptr.i75 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i75, align 8, !tbaa !9
%_IO_read_end.i76 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i76, align 8, !tbaa !14
%cmp.not.i77 = icmp ult ptr %14, %15
br i1 %cmp.not.i77, label %cond.false.i81, label %cond.true.i78, !prof !15
cond.true.i78: ; preds = %do.body
%call.i79 = tail call i32 @__uflow(ptr noundef nonnull %13) #4
%.pre107 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit84
cond.false.i81: ; preds = %do.body
%incdec.ptr.i82 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i82, ptr %_IO_read_ptr.i75, align 8, !tbaa !9
%16 = load i8, ptr %14, align 1, !tbaa !16
%conv3.i83 = zext i8 %16 to i32
br label %getchar_unlocked.exit84
getchar_unlocked.exit84: ; preds = %cond.true.i78, %cond.false.i81
%.pre106 = phi ptr [ %.pre107, %cond.true.i78 ], [ %.pre106109, %cond.false.i81 ]
%17 = phi ptr [ %.pre107, %cond.true.i78 ], [ %13, %cond.false.i81 ]
%cond.i80 = phi i32 [ %call.i79, %cond.true.i78 ], [ %conv3.i83, %cond.false.i81 ]
%sext6498 = shl i32 %cond.i80, 24
%18 = add i32 %sext6498, -788529153
%19 = icmp ult i32 %18, 184549375
br i1 %19, label %while.body22, label %while.end37
while.body22: ; preds = %getchar_unlocked.exit84, %getchar_unlocked.exit94
%.pre106112 = phi ptr [ %.pre106111, %getchar_unlocked.exit94 ], [ %.pre106, %getchar_unlocked.exit84 ]
%20 = phi ptr [ %24, %getchar_unlocked.exit94 ], [ %.pre106, %getchar_unlocked.exit84 ]
%sub32100 = phi i32 [ %sub32, %getchar_unlocked.exit94 ], [ 0, %getchar_unlocked.exit84 ]
%c.1.in99 = phi i32 [ %cond.i90, %getchar_unlocked.exit94 ], [ %cond.i80, %getchar_unlocked.exit84 ]
%conv14 = and i32 %c.1.in99, 255
%add29 = mul i32 %sub32100, 10
%add31 = add nsw i32 %conv14, -48
%sub32 = add i32 %add31, %add29
store i32 %sub32, ptr %arrayidx, align 4, !tbaa !19
%_IO_read_ptr.i85 = getelementptr inbounds %struct._IO_FILE, ptr %20, i64 0, i32 1
%21 = load ptr, ptr %_IO_read_ptr.i85, align 8, !tbaa !9
%_IO_read_end.i86 = getelementptr inbounds %struct._IO_FILE, ptr %20, i64 0, i32 2
%22 = load ptr, ptr %_IO_read_end.i86, align 8, !tbaa !14
%cmp.not.i87 = icmp ult ptr %21, %22
br i1 %cmp.not.i87, label %cond.false.i91, label %cond.true.i88, !prof !15
cond.true.i88: ; preds = %while.body22
%call.i89 = tail call i32 @__uflow(ptr noundef nonnull %20) #4
%.pre105 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit94
cond.false.i91: ; preds = %while.body22
%incdec.ptr.i92 = getelementptr inbounds i8, ptr %21, i64 1
store ptr %incdec.ptr.i92, ptr %_IO_read_ptr.i85, align 8, !tbaa !9
%23 = load i8, ptr %21, align 1, !tbaa !16
%conv3.i93 = zext i8 %23 to i32
br label %getchar_unlocked.exit94
getchar_unlocked.exit94: ; preds = %cond.true.i88, %cond.false.i91
%.pre106111 = phi ptr [ %.pre105, %cond.true.i88 ], [ %.pre106112, %cond.false.i91 ]
%24 = phi ptr [ %.pre105, %cond.true.i88 ], [ %20, %cond.false.i91 ]
%cond.i90 = phi i32 [ %call.i89, %cond.true.i88 ], [ %conv3.i93, %cond.false.i91 ]
%sext64 = shl i32 %cond.i90, 24
%25 = add i32 %sext64, -788529153
%26 = icmp ult i32 %25, 184549375
br i1 %26, label %while.body22, label %while.end37, !llvm.loop !20
while.end37: ; preds = %getchar_unlocked.exit94, %getchar_unlocked.exit84
%.pre106110 = phi ptr [ %.pre106, %getchar_unlocked.exit84 ], [ %.pre106111, %getchar_unlocked.exit94 ]
%27 = phi ptr [ %17, %getchar_unlocked.exit84 ], [ %24, %getchar_unlocked.exit94 ]
%28 = phi i32 [ 0, %getchar_unlocked.exit84 ], [ %sub32, %getchar_unlocked.exit94 ]
%xor = xor i32 %28, %a.0
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%29 = and i64 %indvars.iv.next, 4294967295
%tobool.not = icmp eq i64 %29, 0
br i1 %tobool.not, label %while.cond40.preheader, label %do.body, !llvm.loop !21
while.cond40.preheader: ; preds = %while.end37
%cmp42.not101 = icmp eq i32 %n.0.lcssa, 0
br i1 %cmp42.not101, label %while.end47, label %while.body44.preheader
while.body44.preheader: ; preds = %while.cond40.preheader
%add.ptr = getelementptr inbounds i32, ptr %d, i64 %idx.ext
br label %while.body44
while.body44: ; preds = %while.body44.preheader, %while.body44
%e.0102 = phi ptr [ %incdec.ptr, %while.body44 ], [ %add.ptr, %while.body44.preheader ]
%30 = load i32, ptr %e.0102, align 4, !tbaa !19
%xor45 = xor i32 %30, %xor
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %xor45)
%incdec.ptr = getelementptr inbounds i32, ptr %e.0102, i64 -1
%cmp42.not = icmp eq ptr %d, %incdec.ptr
br i1 %cmp42.not, label %while.end47, label %while.body44, !llvm.loop !22
while.end47: ; preds = %while.body44, %while.cond40.preheader
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %d) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
declare i32 @__uflow(ptr noundef) local_unnamed_addr #3
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
|
#include<stdio.h>
void paixu(int left,int right);
int a[101],b[101],v[1000];
int main()
{
int n,s,i,j,k,ans;
scanf("%d%d",&n,&s);
for(i=1;i<=n;i++)
scanf("%d%d",&a[i],&b[i]);
paixu(1,n);
int temp=s, time=0;
i=j=1;
while(i<=n)
{
time+=temp-a[i];
temp=a[i];
if(time<b[i])
time=b[i];
i++;
}
time+=temp;
printf("%d",time);
return 0;
}
void paixu(int left,int right)
{
int i,j,t,temp;
if(left>right)
return;
temp=a[left];
i=left;
j=right;
while(i!=j)
{
while(a[j]<=temp&&i<j)j--;
while(a[i]>=temp&&i<j)i++;
if(i<j)
{
t=a[i];
a[i]=a[j];
a[j]=t;
t=b[i];
b[i]=b[j];
b[j]=t;
}
}
a[left]=a[i];
a[i]=temp;
t=b[left];
b[left]=b[i];
b[i]=t;
paixu(left,i-1);
paixu(i+1,right);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16227/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16227/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [101 x i32] zeroinitializer, align 16
@b = dso_local global [101 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@v = dso_local local_unnamed_addr global [1000 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = 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 %s) #5
%call = 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 !5
%cmp.not31 = icmp slt i32 %0, 1
br i1 %cmp.not31, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [101 x i32], ptr @b, 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
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @paixu(i32 noundef 1, i32 noundef %.lcssa)
%3 = load i32, ptr %s, align 4, !tbaa !5
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.not33 = icmp slt i32 %4, 1
br i1 %cmp4.not33, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %for.end
%5 = zext i32 %4 to i64
%xtraiter = and i64 %5, 1
%6 = icmp eq i32 %4, 1
br i1 %6, label %while.end.loopexit.unr-lcssa, label %while.body.preheader.new
while.body.preheader.new: ; preds = %while.body.preheader
%unroll_iter = and i64 %5, 4294967294
br label %while.body
while.body: ; preds = %while.body, %while.body.preheader.new
%indvars.iv42 = phi i64 [ 1, %while.body.preheader.new ], [ %indvars.iv.next43.1, %while.body ]
%time.036 = phi i32 [ 0, %while.body.preheader.new ], [ %spec.select.1, %while.body ]
%temp.035 = phi i32 [ %3, %while.body.preheader.new ], [ %9, %while.body ]
%niter = phi i64 [ 0, %while.body.preheader.new ], [ %niter.next.1, %while.body ]
%arrayidx6 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv42
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub = add i32 %time.036, %temp.035
%add = sub i32 %sub, %7
%arrayidx10 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv42
%8 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %add, i32 %8)
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%arrayidx6.1 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv.next43
%9 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%sub.1 = add i32 %spec.select, %7
%add.1 = sub i32 %sub.1, %9
%arrayidx10.1 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv.next43
%10 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%spec.select.1 = call i32 @llvm.smax.i32(i32 %add.1, i32 %10)
%indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 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 %while.end.loopexit.unr-lcssa, label %while.body, !llvm.loop !11
while.end.loopexit.unr-lcssa: ; preds = %while.body, %while.body.preheader
%.lcssa49.ph = phi i32 [ undef, %while.body.preheader ], [ %9, %while.body ]
%spec.select.lcssa.ph = phi i32 [ undef, %while.body.preheader ], [ %spec.select.1, %while.body ]
%indvars.iv42.unr = phi i64 [ 1, %while.body.preheader ], [ %indvars.iv.next43.1, %while.body ]
%time.036.unr = phi i32 [ 0, %while.body.preheader ], [ %spec.select.1, %while.body ]
%temp.035.unr = phi i32 [ %3, %while.body.preheader ], [ %9, %while.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.end, label %while.body.epil
while.body.epil: ; preds = %while.end.loopexit.unr-lcssa
%arrayidx6.epil = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv42.unr
%11 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5
%sub.epil = add i32 %time.036.unr, %temp.035.unr
%add.epil = sub i32 %sub.epil, %11
%arrayidx10.epil = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv42.unr
%12 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5
%spec.select.epil = call i32 @llvm.smax.i32(i32 %add.epil, i32 %12)
br label %while.end
while.end: ; preds = %while.body.epil, %while.end.loopexit.unr-lcssa, %for.end
%temp.0.lcssa = phi i32 [ %3, %for.end ], [ %.lcssa49.ph, %while.end.loopexit.unr-lcssa ], [ %11, %while.body.epil ]
%time.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select.lcssa.ph, %while.end.loopexit.unr-lcssa ], [ %spec.select.epil, %while.body.epil ]
%add15 = add nsw i32 %time.0.lcssa, %temp.0.lcssa
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add15)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @paixu(i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 {
entry:
%cmp94 = icmp sgt i32 %left, %right
br i1 %cmp94, label %cleanup, label %if.end
if.end: ; preds = %entry, %while.end36
%left.tr95 = phi i32 [ %add, %while.end36 ], [ %left, %entry ]
%idxprom = sext i32 %left.tr95 to i64
%arrayidx = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1.not91 = icmp eq i32 %left.tr95, %right
br i1 %cmp1.not91, label %while.end36, label %while.cond2.preheader
while.cond2.preheader: ; preds = %if.end, %if.end35
%i.093 = phi i32 [ %9, %if.end35 ], [ %left.tr95, %if.end ]
%j.092 = phi i32 [ %5, %if.end35 ], [ %right, %if.end ]
%1 = sext i32 %j.092 to i64
%2 = sext i32 %i.093 to i64
br label %while.cond2
while.cond2: ; preds = %while.cond2, %while.cond2.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond2 ], [ %1, %while.cond2.preheader ]
%arrayidx4 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp sle i32 %3, %0
%cmp6 = icmp sgt i64 %indvars.iv, %2
%4 = and i1 %cmp6, %cmp5
%indvars.iv.next = add nsw i64 %indvars.iv, -1
br i1 %4, label %while.cond2, label %while.cond8.preheader, !llvm.loop !12
while.cond8.preheader: ; preds = %while.cond2
%5 = trunc i64 %indvars.iv to i32
%sext = shl i64 %indvars.iv, 32
%6 = ashr exact i64 %sext, 32
br label %while.cond8
while.cond8: ; preds = %while.cond8, %while.cond8.preheader
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %while.cond8 ], [ %2, %while.cond8.preheader ]
%arrayidx10 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv98
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp sge i32 %7, %0
%cmp13 = icmp slt i64 %indvars.iv98, %6
%8 = and i1 %cmp13, %cmp11
%indvars.iv.next99 = add nsw i64 %indvars.iv98, 1
br i1 %8, label %while.cond8, label %while.end16, !llvm.loop !13
while.end16: ; preds = %while.cond8
%9 = trunc i64 %indvars.iv98 to i32
br i1 %cmp13, label %if.then18, label %if.end35
if.then18: ; preds = %while.end16
store i32 %3, ptr %arrayidx10, align 4, !tbaa !5
store i32 %7, ptr %arrayidx4, align 4, !tbaa !5
%arrayidx28 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv98
%10 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%arrayidx30 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv
%11 = load i32, ptr %arrayidx30, align 4, !tbaa !5
store i32 %11, ptr %arrayidx28, align 4, !tbaa !5
store i32 %10, ptr %arrayidx30, align 4, !tbaa !5
br label %if.end35
if.end35: ; preds = %if.then18, %while.end16
%cmp1.not = icmp eq i32 %9, %5
br i1 %cmp1.not, label %while.end36, label %while.cond2.preheader, !llvm.loop !14
while.end36: ; preds = %if.end35, %if.end
%i.0.lcssa = phi i32 [ %right, %if.end ], [ %5, %if.end35 ]
%idxprom37 = sext i32 %i.0.lcssa to i64
%arrayidx38 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %idxprom37
%12 = load i32, ptr %arrayidx38, align 4, !tbaa !5
store i32 %12, ptr %arrayidx, align 4, !tbaa !5
store i32 %0, ptr %arrayidx38, align 4, !tbaa !5
%arrayidx44 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %idxprom
%13 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%arrayidx46 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %idxprom37
%14 = load i32, ptr %arrayidx46, align 4, !tbaa !5
store i32 %14, ptr %arrayidx44, align 4, !tbaa !5
store i32 %13, ptr %arrayidx46, align 4, !tbaa !5
%sub = add nsw i32 %i.0.lcssa, -1
tail call void @paixu(i32 noundef %left.tr95, i32 noundef %sub)
%add = add nsw i32 %i.0.lcssa, 1
%cmp.not = icmp slt i32 %i.0.lcssa, %right
br i1 %cmp.not, label %if.end, label %cleanup
cleanup: ; preds = %while.end36, %entry
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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
typedef long long ll;
ll min(ll x, ll y) {
return x < y ? x : y;
}
int main() {
ll a, b, c;
scanf("%lld%lld%lld", &a, &b, &c);
if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0) {
printf("0\n");
} else {
printf("%lld\n", min(a * b, min(b * c, c * a)));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162312/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162312/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = and i64 %0, 1
%cmp = icmp eq i64 %1, 0
br i1 %cmp, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%2 = load i64, ptr %b, align 8, !tbaa !5
%3 = and i64 %2, 1
%cmp2 = icmp eq i64 %3, 0
br i1 %cmp2, label %if.then, label %lor.lhs.false3
lor.lhs.false3: ; preds = %lor.lhs.false
%4 = load i64, ptr %c, align 8, !tbaa !5
%5 = and i64 %4, 1
%cmp5 = icmp eq i64 %5, 0
br i1 %cmp5, label %if.then, label %if.else
if.then: ; preds = %lor.lhs.false3, %lor.lhs.false, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %lor.lhs.false3
%mul = mul nsw i64 %2, %0
%mul7 = mul nsw i64 %4, %2
%mul8 = mul nsw i64 %4, %0
%cond.i = call i64 @llvm.smin.i64(i64 %mul7, i64 %mul8)
%cond.i12 = call i64 @llvm.smin.i64(i64 %mul, i64 %cond.i)
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %cond.i12)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree nounwind }
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"}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef long long int lli;
int main(void){
lli a,b,c;
scanf("%lld%lld%lld",&a,&b,&c);
if(!(a%2) || !(b%2) || !(c%2)){
printf("%d\n", 0);
}else{
if(a >= b && a >= c){
printf("%lld\n",b*c);
}else if(b >= a && b >= c){
printf("%lld\n", a*c);
}else if(c >= a && c >= b){
printf("%lld\n", a*b);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162356/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162356/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = and i64 %0, 1
%tobool.not = icmp eq i64 %1, 0
br i1 %tobool.not, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%2 = load i64, ptr %b, align 8, !tbaa !5
%3 = and i64 %2, 1
%tobool2.not = icmp eq i64 %3, 0
br i1 %tobool2.not, label %if.then, label %lor.lhs.false3
lor.lhs.false3: ; preds = %lor.lhs.false
%4 = load i64, ptr %c, align 8, !tbaa !5
%5 = and i64 %4, 1
%tobool5.not = icmp eq i64 %5, 0
br i1 %tobool5.not, label %if.then, label %if.else
if.then: ; preds = %lor.lhs.false3, %lor.lhs.false, %entry
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
br label %if.end26
if.else: ; preds = %lor.lhs.false3
%cmp.not = icmp slt i64 %0, %2
%cmp7.not = icmp slt i64 %0, %4
%or.cond = or i1 %cmp.not, %cmp7.not
br i1 %or.cond, label %if.else10, label %if.then8
if.then8: ; preds = %if.else
%mul = mul nsw i64 %4, %2
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul)
br label %if.end26
if.else10: ; preds = %if.else
%cmp11.not = icmp slt i64 %2, %0
%cmp13.not = icmp slt i64 %2, %4
%or.cond35 = or i1 %cmp11.not, %cmp13.not
br i1 %or.cond35, label %if.else17, label %if.then14
if.then14: ; preds = %if.else10
%mul15 = mul nsw i64 %4, %0
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul15)
br label %if.end26
if.else17: ; preds = %if.else10
%cmp18.not = icmp slt i64 %4, %0
%cmp20.not = icmp slt i64 %4, %2
%or.cond36 = or i1 %cmp18.not, %cmp20.not
br i1 %or.cond36, label %if.end26, label %if.then21
if.then21: ; preds = %if.else17
%mul22 = mul nsw i64 %2, %0
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul22)
br label %if.end26
if.end26: ; preds = %if.then8, %if.else17, %if.then21, %if.then14, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int i,j;
int h,w;
while(1){
scanf("%d %d",&h,&w);
if(h==0&&w==0)
break;
for(i=0;i<h;i++){
if(i==0 || i==h-1){
for(j=0;j<w;j++)
printf("#");
}
else{
printf("#");
for(j=0;j<w-2;j++)
printf(".");
printf("#");
}
puts("");
}
puts("");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162406/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162406/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%call45 = 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
%cmp46 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp147 = icmp eq i32 %1, 0
%or.cond48 = select i1 %cmp46, i1 %cmp147, i1 false
br i1 %or.cond48, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end24
%2 = phi i32 [ %9, %for.end24 ], [ %0, %entry ]
%cmp243 = icmp sgt i32 %2, 0
br i1 %cmp243, label %for.body, label %for.end24
for.body: ; preds = %for.cond.preheader, %if.end20
%3 = phi i32 [ %8, %if.end20 ], [ %2, %for.cond.preheader ]
%i.044 = phi i32 [ %inc23, %if.end20 ], [ 0, %for.cond.preheader ]
%cmp3 = icmp eq i32 %i.044, 0
%sub = add nsw i32 %3, -1
%cmp4 = icmp eq i32 %i.044, %sub
%or.cond37 = select i1 %cmp3, i1 true, i1 %cmp4
br i1 %or.cond37, label %for.cond6.preheader, label %if.else
for.cond6.preheader: ; preds = %for.body
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp741 = icmp sgt i32 %4, 0
br i1 %cmp741, label %for.body8, label %if.end20
for.body8: ; preds = %for.cond6.preheader, %for.body8
%j.042 = phi i32 [ %inc, %for.body8 ], [ 0, %for.cond6.preheader ]
%putchar36 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.042, 1
%5 = load i32, ptr %w, align 4, !tbaa !5
%cmp7 = icmp slt i32 %inc, %5
br i1 %cmp7, label %for.body8, label %if.end20, !llvm.loop !9
if.else: ; preds = %for.body
%putchar32 = call i32 @putchar(i32 35)
%6 = load i32, ptr %w, align 4, !tbaa !5
%cmp1339 = icmp sgt i32 %6, 2
br i1 %cmp1339, label %for.body14, label %for.end18
for.body14: ; preds = %if.else, %for.body14
%j.140 = phi i32 [ %inc17, %for.body14 ], [ 0, %if.else ]
%putchar34 = call i32 @putchar(i32 46)
%inc17 = add nuw nsw i32 %j.140, 1
%7 = load i32, ptr %w, align 4, !tbaa !5
%sub12 = add nsw i32 %7, -2
%cmp13 = icmp slt i32 %inc17, %sub12
br i1 %cmp13, label %for.body14, label %for.end18, !llvm.loop !11
for.end18: ; preds = %for.body14, %if.else
%putchar33 = call i32 @putchar(i32 35)
br label %if.end20
if.end20: ; preds = %for.body8, %for.cond6.preheader, %for.end18
%putchar35 = call i32 @putchar(i32 10)
%inc23 = add nuw nsw i32 %i.044, 1
%8 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc23, %8
br i1 %cmp2, label %for.body, label %for.end24, !llvm.loop !12
for.end24: ; preds = %if.end20, %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)
%9 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %10, 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.end24, %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>
#define SQ(x) (x)*(x)
typedef long long ll;
int main()
{
ll n, m, c=0, cm=0, i, j, val, sr=0;
scanf("%I64d %I64d",&n,&m);
ll q = n/m;
ll rem = n - q*m;
//printf("%d",rem);
ll fin = q*m;
ll mod = m ;
for(i=1;i<=m;++i){
for(j=1;j<=m;++j){
val = i*i + j*j;
if(val % m == 0){
++cm;
if(i<=rem) ++sr;
}
//printf("%I64d %I64d %I64d %I64d\n",i,j,cm,sr);
}
}
c = q*q*cm + sr*2*q;
//printf("%I64d %I64d\n",fin,sr);
for(i = fin+1;i<=n;++i)
{
for(j=fin+1;j<=n;++j){
val = ((i%mod)*(i%mod) + (SQ((j%mod))))%mod;
if(val % m == 0) ++c;
}
}
printf("%I64d",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16245/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16245/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%I64d %I64d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%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
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = load i64, ptr %m, align 8, !tbaa !5
%div = sdiv i64 %0, %1
%mul = mul nsw i64 %div, %1
%sub.recomposed = srem i64 %0, %1
%cmp.not84 = icmp slt i64 %1, 1
br i1 %cmp.not84, label %for.end16, label %for.cond2.preheader.preheader
for.cond2.preheader.preheader: ; preds = %entry
%xtraiter = and i64 %1, 1
%2 = icmp eq i64 %1, 1
%unroll_iter = and i64 %1, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.cond2.for.inc14_crit_edge
%cm.087 = phi i64 [ %cm.2.lcssa, %for.cond2.for.inc14_crit_edge ], [ 0, %for.cond2.preheader.preheader ]
%i.086 = phi i64 [ %inc15, %for.cond2.for.inc14_crit_edge ], [ 1, %for.cond2.preheader.preheader ]
%sr.085 = phi i64 [ %sr.2.lcssa, %for.cond2.for.inc14_crit_edge ], [ 0, %for.cond2.preheader.preheader ]
%mul5 = mul nsw i64 %i.086, %i.086
%cmp9.not = icmp sle i64 %i.086, %sub.recomposed
br i1 %2, label %for.cond2.for.inc14_crit_edge.unr-lcssa, label %for.body4
for.body4: ; preds = %for.cond2.preheader, %for.body4
%cm.182 = phi i64 [ %cm.2.1, %for.body4 ], [ %cm.087, %for.cond2.preheader ]
%j.081 = phi i64 [ %inc13.1, %for.body4 ], [ 1, %for.cond2.preheader ]
%sr.180 = phi i64 [ %sr.2.1, %for.body4 ], [ %sr.085, %for.cond2.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body4 ], [ 0, %for.cond2.preheader ]
%mul6 = mul nsw i64 %j.081, %j.081
%add = add nuw nsw i64 %mul6, %mul5
%rem7 = srem i64 %add, %1
%cmp8 = icmp eq i64 %rem7, 0
%narrow = select i1 %cmp8, i1 %cmp9.not, i1 false
%spec.select = zext i1 %narrow to i64
%sr.2 = add nsw i64 %sr.180, %spec.select
%inc = zext i1 %cmp8 to i64
%cm.2 = add nsw i64 %cm.182, %inc
%inc13 = add nuw i64 %j.081, 1
%mul6.1 = mul nsw i64 %inc13, %inc13
%add.1 = add nuw nsw i64 %mul6.1, %mul5
%rem7.1 = srem i64 %add.1, %1
%cmp8.1 = icmp eq i64 %rem7.1, 0
%narrow.1 = select i1 %cmp8.1, i1 %cmp9.not, i1 false
%spec.select.1 = zext i1 %narrow.1 to i64
%sr.2.1 = add nsw i64 %sr.2, %spec.select.1
%inc.1 = zext i1 %cmp8.1 to i64
%cm.2.1 = add nsw i64 %cm.2, %inc.1
%inc13.1 = add nuw i64 %j.081, 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.cond2.for.inc14_crit_edge.unr-lcssa, label %for.body4, !llvm.loop !9
for.cond2.for.inc14_crit_edge.unr-lcssa: ; preds = %for.body4, %for.cond2.preheader
%sr.2.lcssa.ph = phi i64 [ undef, %for.cond2.preheader ], [ %sr.2.1, %for.body4 ]
%cm.2.lcssa.ph = phi i64 [ undef, %for.cond2.preheader ], [ %cm.2.1, %for.body4 ]
%cm.182.unr = phi i64 [ %cm.087, %for.cond2.preheader ], [ %cm.2.1, %for.body4 ]
%j.081.unr = phi i64 [ 1, %for.cond2.preheader ], [ %inc13.1, %for.body4 ]
%sr.180.unr = phi i64 [ %sr.085, %for.cond2.preheader ], [ %sr.2.1, %for.body4 ]
br i1 %lcmp.mod.not, label %for.cond2.for.inc14_crit_edge, label %for.body4.epil
for.body4.epil: ; preds = %for.cond2.for.inc14_crit_edge.unr-lcssa
%mul6.epil = mul nsw i64 %j.081.unr, %j.081.unr
%add.epil = add nuw nsw i64 %mul6.epil, %mul5
%rem7.epil = srem i64 %add.epil, %1
%cmp8.epil = icmp eq i64 %rem7.epil, 0
%narrow.epil = select i1 %cmp8.epil, i1 %cmp9.not, i1 false
%spec.select.epil = zext i1 %narrow.epil to i64
%sr.2.epil = add nsw i64 %sr.180.unr, %spec.select.epil
%inc.epil = zext i1 %cmp8.epil to i64
%cm.2.epil = add nsw i64 %cm.182.unr, %inc.epil
br label %for.cond2.for.inc14_crit_edge
for.cond2.for.inc14_crit_edge: ; preds = %for.cond2.for.inc14_crit_edge.unr-lcssa, %for.body4.epil
%sr.2.lcssa = phi i64 [ %sr.2.lcssa.ph, %for.cond2.for.inc14_crit_edge.unr-lcssa ], [ %sr.2.epil, %for.body4.epil ]
%cm.2.lcssa = phi i64 [ %cm.2.lcssa.ph, %for.cond2.for.inc14_crit_edge.unr-lcssa ], [ %cm.2.epil, %for.body4.epil ]
%inc15 = add nuw i64 %i.086, 1
%exitcond100.not = icmp eq i64 %i.086, %1
br i1 %exitcond100.not, label %for.end16.loopexit, label %for.cond2.preheader, !llvm.loop !11
for.end16.loopexit: ; preds = %for.cond2.for.inc14_crit_edge
%3 = shl i64 %sr.2.lcssa, 1
br label %for.end16
for.end16: ; preds = %for.end16.loopexit, %entry
%sr.0.lcssa = phi i64 [ 0, %entry ], [ %3, %for.end16.loopexit ]
%cm.0.lcssa = phi i64 [ 0, %entry ], [ %cm.2.lcssa, %for.end16.loopexit ]
%mul18 = mul i64 %cm.0.lcssa, %div
%reass.add = add i64 %mul18, %sr.0.lcssa
%reass.mul = mul i64 %reass.add, %div
%add22 = add nsw i64 %mul, 1
%cmp24.not95.not = icmp slt i64 %mul, %0
br i1 %cmp24.not95.not, label %for.cond27.preheader, label %for.end48
for.cond27.preheader: ; preds = %for.end16, %for.cond27.for.inc46_crit_edge
%c.097 = phi i64 [ %spec.select78, %for.cond27.for.inc46_crit_edge ], [ %reass.mul, %for.end16 ]
%i.196 = phi i64 [ %inc47, %for.cond27.for.inc46_crit_edge ], [ %add22, %for.end16 ]
%rem30 = srem i64 %i.196, %1
%mul32 = mul nsw i64 %rem30, %rem30
br label %for.body29
for.body29: ; preds = %for.cond27.preheader, %for.body29
%c.193 = phi i64 [ %c.097, %for.cond27.preheader ], [ %spec.select78, %for.body29 ]
%j.192 = phi i64 [ %add22, %for.cond27.preheader ], [ %inc44, %for.body29 ]
%rem33 = srem i64 %j.192, %1
%mul35 = mul nsw i64 %rem33, %rem33
%add36 = add nuw nsw i64 %mul35, %mul32
%rem37 = srem i64 %add36, %1
%cmp39 = icmp eq i64 %rem37, 0
%inc41 = zext i1 %cmp39 to i64
%spec.select78 = add nsw i64 %c.193, %inc41
%inc44 = add nsw i64 %j.192, 1
%cmp28.not.not = icmp slt i64 %j.192, %0
br i1 %cmp28.not.not, label %for.body29, label %for.cond27.for.inc46_crit_edge, !llvm.loop !12
for.cond27.for.inc46_crit_edge: ; preds = %for.body29
%inc47 = add nsw i64 %i.196, 1
%cmp24.not.not = icmp slt i64 %i.196, %0
br i1 %cmp24.not.not, label %for.cond27.preheader, label %for.end48, !llvm.loop !13
for.end48: ; preds = %for.cond27.for.inc46_crit_edge, %for.end16
%c.0.lcssa = phi i64 [ %reass.mul, %for.end16 ], [ %spec.select78, %for.cond27.for.inc46_crit_edge ]
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %c.0.lcssa)
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"}
!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,arr[107]={0};
scanf("%d", &n);
for(int i=0;i<n;i++)
{
int r;
scanf("%d", &r);
for(int j=0;j<r;j++)
{ int l;
scanf("%d", &l);
arr[l]++;
}
}
for(int i=0;i<=100;i++)
{ if(arr[i]==n)
printf("%d ",i);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16250/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16250/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%arr = alloca [107 x i32], align 16
%r = alloca i32, align 4
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 428, ptr nonnull %arr) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(428) %arr, i8 0, i64 428, 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
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.body15.preheader
for.body15.preheader: ; preds = %for.cond.cleanup4, %entry
br label %for.body15
for.body: ; preds = %entry, %for.cond.cleanup4
%i.032 = phi i32 [ %inc9, %for.cond.cleanup4 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp329 = icmp sgt i32 %1, 0
br i1 %cmp329, label %for.body5, label %for.cond.cleanup4
for.cond.cleanup4: ; preds = %for.body5, %for.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
%inc9 = add nuw nsw i32 %i.032, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc9, %2
br i1 %cmp, label %for.body, label %for.body15.preheader, !llvm.loop !9
for.body5: ; preds = %for.body, %for.body5
%j.030 = phi i32 [ %inc7, %for.body5 ], [ 0, %for.body ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%3 = load i32, ptr %l, align 4, !tbaa !5
%idxprom = sext i32 %3 to i64
%arrayidx = getelementptr inbounds [107 x i32], ptr %arr, i64 0, i64 %idxprom
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %4, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5
%inc7 = add nuw nsw i32 %j.030, 1
%5 = load i32, ptr %r, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc7, %5
br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !11
for.cond.cleanup14: ; preds = %for.inc20
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 428, ptr nonnull %arr) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body15: ; preds = %for.body15.preheader, %for.inc20
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc20 ], [ 0, %for.body15.preheader ]
%arrayidx17 = getelementptr inbounds [107 x i32], ptr %arr, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp eq i32 %6, %7
br i1 %cmp18, label %if.then, label %for.inc20
if.then: ; preds = %for.body15
%8 = trunc i64 %indvars.iv to i32
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
br label %for.inc20
for.inc20: ; preds = %for.body15, %if.then
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 101
br i1 %exitcond.not, label %for.cond.cleanup14, label %for.body15, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main()
{
int h,w,i,s;
while(1){
scanf("%d %d",&h,&w);
if(h==0 && w==0)break;
for(i=0; i<h; i++){
if(i==0||i==h-1){
for(s=0;s<w;s++){
printf("#");
}
puts("");
}else{
for(s=0;s<w;s++){
if(s==0||s==w-1){
printf("#");
}else{
printf(".");
}
}
puts("");
}
}
puts("");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162550/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162550/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%call54 = 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
%cmp55 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp156 = icmp eq i32 %1, 0
%or.cond57 = select i1 %cmp55, i1 %cmp156, i1 false
br i1 %or.cond57, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end30
%2 = phi i32 [ %9, %for.end30 ], [ %0, %entry ]
%cmp252 = icmp sgt i32 %2, 0
br i1 %cmp252, label %for.body, label %for.end30
for.body: ; preds = %for.cond.preheader, %for.inc28
%3 = phi i32 [ %8, %for.inc28 ], [ %2, %for.cond.preheader ]
%i.053 = phi i32 [ %inc29, %for.inc28 ], [ 0, %for.cond.preheader ]
%cmp3 = icmp eq i32 %i.053, 0
%sub = add nsw i32 %3, -1
%cmp4 = icmp eq i32 %i.053, %sub
%or.cond46 = select i1 %cmp3, i1 true, i1 %cmp4
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp750 = icmp sgt i32 %4, 0
br i1 %or.cond46, label %for.cond6.preheader, label %for.cond11.preheader
for.cond11.preheader: ; preds = %for.body
br i1 %cmp750, label %for.inc23.peel, label %for.inc28
for.inc23.peel: ; preds = %for.cond11.preheader
%putchar43.peel = call i32 @putchar(i32 35)
%.pre = load i32, ptr %w, align 4, !tbaa !5
%cmp12.peel = icmp sgt i32 %.pre, 1
br i1 %cmp12.peel, label %for.body13, label %for.inc28
for.cond6.preheader: ; preds = %for.body
br i1 %cmp750, label %for.body8, label %for.inc28
for.body8: ; preds = %for.cond6.preheader, %for.body8
%s.051 = phi i32 [ %inc, %for.body8 ], [ 0, %for.cond6.preheader ]
%putchar45 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %s.051, 1
%5 = load i32, ptr %w, align 4, !tbaa !5
%cmp7 = icmp slt i32 %inc, %5
br i1 %cmp7, label %for.body8, label %for.inc28, !llvm.loop !9
for.body13: ; preds = %for.inc23.peel, %for.body13
%6 = phi i32 [ %7, %for.body13 ], [ %.pre, %for.inc23.peel ]
%s.149 = phi i32 [ %inc24, %for.body13 ], [ 1, %for.inc23.peel ]
%sub16 = add nsw i32 %6, -1
%cmp17 = icmp eq i32 %s.149, %sub16
%. = select i1 %cmp17, i32 35, i32 46
%putchar43 = call i32 @putchar(i32 %.)
%inc24 = add nuw nsw i32 %s.149, 1
%7 = load i32, ptr %w, align 4, !tbaa !5
%cmp12 = icmp slt i32 %inc24, %7
br i1 %cmp12, label %for.body13, label %for.inc28, !llvm.loop !11
for.inc28: ; preds = %for.body13, %for.body8, %for.cond11.preheader, %for.inc23.peel, %for.cond6.preheader
%putchar44 = call i32 @putchar(i32 10)
%inc29 = add nuw nsw i32 %i.053, 1
%8 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc29, %8
br i1 %cmp2, label %for.body, label %for.end30, !llvm.loop !13
for.end30: ; preds = %for.inc28, %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)
%9 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %10, 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.end30, %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}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void) {
int i,j;
int h, w;
while(1){
scanf("%d %d", &h,&w);
if(h==0 && w==0) break;
for(i=0; i<w; i++) printf("#");
printf("\n");
for(i=0; i<h-2; i++){
printf("#");
for(j=0; j<w-2; j++){
printf(".");
}
printf("#\n");
}
for(i=0; i<w; i++) printf("#");
printf("\n\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162594/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162594/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"\0A\00", align 1
@str.6 = private unnamed_addr constant [2 x i8] c"#\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
%call50 = 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
%cmp51 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp152 = icmp eq i32 %1, 0
%or.cond53 = select i1 %cmp51, i1 %cmp152, i1 false
br i1 %or.cond53, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end27
%2 = phi i32 [ %11, %for.end27 ], [ %1, %entry ]
%cmp240 = icmp sgt i32 %2, 0
br i1 %cmp240, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%i.041 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%putchar39 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %i.041, 1
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc, %3
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%4 = load i32, ptr %h, align 4, !tbaa !5
%cmp646 = icmp sgt i32 %4, 2
br i1 %cmp646, label %for.body7, label %for.cond21.preheader
for.cond21.preheader: ; preds = %for.end16, %for.end
%5 = load i32, ptr %w, align 4, !tbaa !5
%cmp2248 = icmp sgt i32 %5, 0
br i1 %cmp2248, label %for.body23, label %for.end27
for.body7: ; preds = %for.end, %for.end16
%i.147 = phi i32 [ %inc19, %for.end16 ], [ 0, %for.end ]
%putchar36 = call i32 @putchar(i32 35)
%6 = load i32, ptr %w, align 4, !tbaa !5
%cmp1143 = icmp sgt i32 %6, 2
br i1 %cmp1143, label %for.body12, label %for.end16
for.body12: ; preds = %for.body7, %for.body12
%j.044 = phi i32 [ %inc15, %for.body12 ], [ 0, %for.body7 ]
%putchar38 = call i32 @putchar(i32 46)
%inc15 = add nuw nsw i32 %j.044, 1
%7 = load i32, ptr %w, align 4, !tbaa !5
%sub10 = add nsw i32 %7, -2
%cmp11 = icmp slt i32 %inc15, %sub10
br i1 %cmp11, label %for.body12, label %for.end16, !llvm.loop !11
for.end16: ; preds = %for.body12, %for.body7
%puts37 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
%inc19 = add nuw nsw i32 %i.147, 1
%8 = load i32, ptr %h, align 4, !tbaa !5
%sub = add nsw i32 %8, -2
%cmp6 = icmp slt i32 %inc19, %sub
br i1 %cmp6, label %for.body7, label %for.cond21.preheader, !llvm.loop !12
for.body23: ; preds = %for.cond21.preheader, %for.body23
%i.249 = phi i32 [ %inc26, %for.body23 ], [ 0, %for.cond21.preheader ]
%putchar35 = call i32 @putchar(i32 35)
%inc26 = add nuw nsw i32 %i.249, 1
%9 = load i32, ptr %w, align 4, !tbaa !5
%cmp22 = icmp slt i32 %inc26, %9
br i1 %cmp22, label %for.body23, label %for.end27, !llvm.loop !13
for.end27: ; preds = %for.body23, %for.cond21.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%10 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %10, 0
%11 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %11, 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.end27, %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
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main()
{
int a, b;
int i, j;
while( scanf("%d %d",&a,&b) != 0 ){
if(a == 0 && b == 0)
break;
for(i = 0; i < a; i++){
for(j = 0; j < b; j++){
if(i == 0 || i == a-1)
printf("#");
else if(j ==0 || j == b-1)
printf("#");
else
printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162651/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162651/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not44 = icmp eq i32 %call43, 0
br i1 %cmp.not44, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end24
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp2 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp1, i1 %cmp2, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %while.body
%cmp340 = icmp sgt i32 %0, 0
br i1 %cmp340, label %for.cond4.preheader, label %for.end24
for.cond4.preheader: ; preds = %for.cond.preheader, %for.end
%i.041 = phi i32 [ %inc23, %for.end ], [ 0, %for.cond.preheader ]
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp537 = icmp sgt i32 %2, 0
br i1 %cmp537, label %for.body6.lr.ph, label %for.end
for.body6.lr.ph: ; preds = %for.cond4.preheader
%cmp7 = icmp eq i32 %i.041, 0
br i1 %cmp7, label %for.body6.us, label %for.body6.preheader
for.body6.preheader: ; preds = %for.body6.lr.ph
%putchar35.peel = call i32 @putchar(i32 35)
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp5.peel = icmp sgt i32 %3, 1
br i1 %cmp5.peel, label %for.body6, label %for.end
for.body6.us: ; preds = %for.body6.lr.ph, %for.body6.us
%j.038.us = phi i32 [ %inc.us, %for.body6.us ], [ 0, %for.body6.lr.ph ]
%putchar35.us = call i32 @putchar(i32 35)
%inc.us = add nuw nsw i32 %j.038.us, 1
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp5.us = icmp slt i32 %inc.us, %4
br i1 %cmp5.us, label %for.body6.us, label %for.end, !llvm.loop !9
for.body6: ; preds = %for.body6.preheader, %for.body6
%5 = phi i32 [ %8, %for.body6 ], [ %3, %for.body6.preheader ]
%j.038 = phi i32 [ %inc, %for.body6 ], [ 1, %for.body6.preheader ]
%6 = load i32, ptr %a, align 4, !tbaa !5
%sub = add nsw i32 %6, -1
%cmp8 = icmp eq i32 %i.041, %sub
%sub13 = add nsw i32 %5, -1
%cmp14 = icmp eq i32 %j.038, %sub13
%7 = select i1 %cmp8, i1 true, i1 %cmp14
%.sink = select i1 %7, i32 35, i32 46
%putchar35 = call i32 @putchar(i32 %.sink)
%inc = add nuw nsw i32 %j.038, 1
%8 = load i32, ptr %b, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc, %8
br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body6, %for.body6.us, %for.body6.preheader, %for.cond4.preheader
%putchar32 = call i32 @putchar(i32 10)
%inc23 = add nuw nsw i32 %i.041, 1
%9 = load i32, ptr %a, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc23, %9
br i1 %cmp3, label %for.cond4.preheader, label %for.end24, !llvm.loop !13
for.end24: ; 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 %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %for.end24, %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main(){
int h,w,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++){
if(i==0 || i==h-1 || j==0 || j==w-1)printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162709/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162709/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%call39 = 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
%cmp40 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp141 = icmp eq i32 %1, 0
%or.cond42 = select i1 %cmp40, i1 %cmp141, i1 false
br i1 %or.cond42, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end20
%2 = phi i32 [ %9, %for.end20 ], [ %0, %entry ]
%cmp236 = icmp sgt i32 %2, 0
br i1 %cmp236, label %for.cond3.preheader, label %for.end20
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.037 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp433 = icmp sgt i32 %3, 0
br i1 %cmp433, label %for.body5.lr.ph, label %for.end
for.body5.lr.ph: ; preds = %for.cond3.preheader
%cmp6 = icmp eq i32 %i.037, 0
br i1 %cmp6, label %for.body5.us, label %for.body5
for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us
%j.034.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ]
%putchar31.us = call i32 @putchar(i32 35)
%inc.us = add nuw nsw i32 %j.034.us, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp4.us = icmp slt i32 %inc.us, %4
br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%5 = phi i32 [ %7, %for.body5 ], [ %3, %for.body5.lr.ph ]
%j.034 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body5.lr.ph ]
%6 = load i32, ptr %h, align 4, !tbaa !5
%sub = add nsw i32 %6, -1
%cmp7 = icmp eq i32 %i.037, %sub
%cmp9 = icmp eq i32 %j.034, 0
%or.cond22 = or i1 %cmp9, %cmp7
%sub11 = add nsw i32 %5, -1
%cmp12 = icmp eq i32 %j.034, %sub11
%or.cond32 = select i1 %or.cond22, i1 true, i1 %cmp12
%. = select i1 %or.cond32, i32 35, i32 46
%putchar31 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.034, 1
%7 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %7
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader
%putchar29 = call i32 @putchar(i32 10)
%inc19 = add nuw nsw i32 %i.037, 1
%8 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc19, %8
br i1 %cmp2, label %for.cond3.preheader, label %for.end20, !llvm.loop !11
for.end20: ; 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)
%9 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %10, 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.end20, %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()
{
int n,arr[100][101],i,j,k,rmin=101,ri,ans[100],flag1,l,m,p=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&arr[i][0]);
if(arr[i][0]<rmin)
{rmin=arr[i][0];
ri=i;}
for(j=1;j<=arr[i][0];j++)
scanf("%d",&arr[i][j]);
}
for(k=1;k<=rmin;k++)
{flag1=0;
for(l=0;l<n;l++)
{if(l==ri)
continue;
for(m=1;m<=arr[l][0];m++)
if(arr[ri][k]==arr[l][m])
{flag1++;
break;}}
if(flag1==(n-1))
{ans[p]=arr[ri][k];
p++;}
}
for(i=0;i<p;i++)
printf("%d ",ans[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16276/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16276/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%arr = alloca [100 x [101 x i32]], align 16
%ans = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40400, ptr nonnull %arr) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %ans) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp110 = icmp sgt i32 %0, 0
br i1 %cmp110, label %for.body, label %for.end78
for.cond24.preheader: ; preds = %for.inc21
%cmp25.not122 = icmp slt i32 %spec.select, 1
br i1 %cmp25.not122, label %for.end78, label %for.cond27.preheader.lr.ph
for.cond27.preheader.lr.ph: ; preds = %for.cond24.preheader
%cmp28118 = icmp sgt i32 %12, 0
%idxprom39 = sext i32 %spec.select107 to i64
%sub = add nsw i32 %12, -1
br i1 %cmp28118, label %for.cond27.preheader.us.preheader, label %for.end78
for.cond27.preheader.us.preheader: ; preds = %for.cond27.preheader.lr.ph
%1 = zext i32 %spec.select107 to i64
%2 = add nuw nsw i32 %spec.select, 1
%wide.trip.count169 = zext i32 %2 to i64
%wide.trip.count164 = zext i32 %12 to i64
br label %for.cond27.preheader.us
for.cond27.preheader.us: ; preds = %for.cond27.preheader.us.preheader, %for.inc67.us
%indvars.iv166 = phi i64 [ 1, %for.cond27.preheader.us.preheader ], [ %indvars.iv.next167, %for.inc67.us ]
%p.0124.us = phi i32 [ 0, %for.cond27.preheader.us.preheader ], [ %p.1.us, %for.inc67.us ]
%arrayidx42.us = getelementptr inbounds [100 x [101 x i32]], ptr %arr, i64 0, i64 %idxprom39, i64 %indvars.iv166
br label %for.body29.us
if.then58.us: ; preds = %for.cond27.for.end56_crit_edge.us
%3 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5
%idxprom63.us = sext i32 %p.0124.us to i64
%arrayidx64.us = getelementptr inbounds [100 x i32], ptr %ans, i64 0, i64 %idxprom63.us
store i32 %3, ptr %arrayidx64.us, align 4, !tbaa !5
%inc65.us = add nsw i32 %p.0124.us, 1
br label %for.inc67.us
for.inc67.us: ; preds = %if.then58.us, %for.cond27.for.end56_crit_edge.us
%p.1.us = phi i32 [ %inc65.us, %if.then58.us ], [ %p.0124.us, %for.cond27.for.end56_crit_edge.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.cond70.preheader, label %for.cond27.preheader.us, !llvm.loop !9
for.body29.us: ; preds = %for.cond27.preheader.us, %for.inc54.us
%indvars.iv161 = phi i64 [ 0, %for.cond27.preheader.us ], [ %indvars.iv.next162, %for.inc54.us ]
%flag1.0119.us = phi i32 [ 0, %for.cond27.preheader.us ], [ %flag1.1.us, %for.inc54.us ]
%cmp30.us = icmp eq i64 %indvars.iv161, %1
br i1 %cmp30.us, label %for.inc54.us, label %for.cond33.preheader.us
for.cond33.us: ; preds = %for.body38.us
%indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
%exitcond.not = icmp eq i64 %indvars.iv.next158, %wide.trip.count160
br i1 %exitcond.not, label %for.inc54.us, label %for.body38.us, !llvm.loop !11
for.body38.us: ; preds = %for.body38.lr.ph.us, %for.cond33.us
%indvars.iv157 = phi i64 [ 1, %for.body38.lr.ph.us ], [ %indvars.iv.next158, %for.cond33.us ]
%arrayidx46.us = getelementptr inbounds [100 x [101 x i32]], ptr %arr, i64 0, i64 %indvars.iv161, i64 %indvars.iv157
%4 = load i32, ptr %arrayidx46.us, align 4, !tbaa !5
%cmp47.us = icmp eq i32 %6, %4
br i1 %cmp47.us, label %if.then48.us, label %for.cond33.us
if.then48.us: ; preds = %for.body38.us
%inc49.us = add nsw i32 %flag1.0119.us, 1
br label %for.inc54.us
for.inc54.us: ; preds = %for.cond33.us, %for.cond33.preheader.us, %if.then48.us, %for.body29.us
%flag1.1.us = phi i32 [ %flag1.0119.us, %for.body29.us ], [ %inc49.us, %if.then48.us ], [ %flag1.0119.us, %for.cond33.preheader.us ], [ %flag1.0119.us, %for.cond33.us ]
%indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
%exitcond165.not = icmp eq i64 %indvars.iv.next162, %wide.trip.count164
br i1 %exitcond165.not, label %for.cond27.for.end56_crit_edge.us, label %for.body29.us, !llvm.loop !12
for.cond33.preheader.us: ; preds = %for.body29.us
%arrayidx35.us = getelementptr inbounds [100 x [101 x i32]], ptr %arr, i64 0, i64 %indvars.iv161
%5 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5
%cmp37.not116.us = icmp slt i32 %5, 1
br i1 %cmp37.not116.us, label %for.inc54.us, label %for.body38.lr.ph.us
for.body38.lr.ph.us: ; preds = %for.cond33.preheader.us
%6 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5
%7 = add nuw i32 %5, 1
%wide.trip.count160 = zext i32 %7 to i64
br label %for.body38.us
for.cond27.for.end56_crit_edge.us: ; preds = %for.inc54.us
%cmp57.us = icmp eq i32 %flag1.1.us, %sub
br i1 %cmp57.us, label %if.then58.us, label %for.inc67.us
for.body: ; preds = %entry, %for.inc21
%indvars.iv147 = phi i64 [ %indvars.iv.next148, %for.inc21 ], [ 0, %entry ]
%ri.0113 = phi i32 [ %spec.select107, %for.inc21 ], [ undef, %entry ]
%rmin.0112 = phi i32 [ %spec.select, %for.inc21 ], [ 101, %entry ]
%arrayidx = getelementptr inbounds [100 x [101 x i32]], ptr %arr, i64 0, i64 %indvars.iv147
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%8 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp6 = icmp slt i32 %8, %rmin.0112
%spec.select = call i32 @llvm.smin.i32(i32 %8, i32 %rmin.0112)
%9 = trunc i64 %indvars.iv147 to i32
%spec.select107 = select i1 %cmp6, i32 %9, i32 %ri.0113
%cmp14.not108 = icmp slt i32 %8, 1
br i1 %cmp14.not108, label %for.inc21, label %for.body15
for.body15: ; preds = %for.body, %for.body15
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body15 ], [ 1, %for.body ]
%arrayidx19 = getelementptr inbounds [100 x [101 x i32]], ptr %arr, i64 0, i64 %indvars.iv147, i64 %indvars.iv
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %arrayidx, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp14.not.not = icmp slt i64 %indvars.iv, %11
br i1 %cmp14.not.not, label %for.body15, label %for.inc21, !llvm.loop !13
for.inc21: ; preds = %for.body15, %for.body
%indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp = icmp slt i64 %indvars.iv.next148, %13
br i1 %cmp, label %for.body, label %for.cond24.preheader, !llvm.loop !14
for.cond70.preheader: ; preds = %for.inc67.us
%cmp71141 = icmp sgt i32 %p.1.us, 0
br i1 %cmp71141, label %for.body72.preheader, label %for.end78
for.body72.preheader: ; preds = %for.cond70.preheader
%wide.trip.count174 = zext i32 %p.1.us to i64
br label %for.body72
for.body72: ; preds = %for.body72.preheader, %for.body72
%indvars.iv171 = phi i64 [ 0, %for.body72.preheader ], [ %indvars.iv.next172, %for.body72 ]
%arrayidx74 = getelementptr inbounds [100 x i32], ptr %ans, i64 0, i64 %indvars.iv171
%14 = load i32, ptr %arrayidx74, align 4, !tbaa !5
%call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%exitcond175.not = icmp eq i64 %indvars.iv.next172, %wide.trip.count174
br i1 %exitcond175.not, label %for.end78, label %for.body72, !llvm.loop !15
for.end78: ; preds = %for.body72, %entry, %for.cond27.preheader.lr.ph, %for.cond24.preheader, %for.cond70.preheader
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %ans) #4
call void @llvm.lifetime.end.p0(i64 40400, ptr nonnull %arr) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int x,y,z;
char mp[12][12][12];
void nul(int a,int b,int c,char from, char to){
if(a<0||b<0||c<0||a>=x||b>=y||c>=z||mp[a][b][c]!=from) return;
mp[a][b][c]=to;
nul(a-1,b,c,from,to);
nul(a+1,b,c,from,to);
nul(a,b-1,c,from,to);
nul(a,b+1,c,from,to);
nul(a,b,c-1,from,to);
nul(a,b,c+1,from,to);
}
int main(){
int i,j,k,l,m,n;
while(scanf("%d%d%d",&x,&y,&z)==3){
rep(i,x) rep(j,y) scanf("%s",mp[i][j]);
scanf("%d%d",&i,&j); i--; j--;
nul(0,i,j,'.','@');
n=0;
rep(i,x) rep(j,y) rep(k,z) if(mp[i][j][k]=='@') n++;
printf("%d\n",n);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16281/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16281/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@x = dso_local global i32 0, align 4
@y = dso_local global i32 0, align 4
@z = dso_local global i32 0, align 4
@mp = dso_local global [12 x [12 x [12 x i8]]] zeroinitializer, align 16
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @nul(i32 noundef %a, i32 noundef %b, i32 noundef %c, i8 noundef signext %from, i8 noundef signext %to) local_unnamed_addr #0 {
entry:
%idxprom = zext i32 %a to i64
%idxprom11 = zext i32 %b to i64
%0 = or i32 %b, %a
%1 = or i32 %0, %c
%or.cond28.not70 = icmp sgt i32 %1, -1
%2 = load i32, ptr @x, align 4
%cmp5.not71 = icmp sgt i32 %2, %a
%or.cond72 = select i1 %or.cond28.not70, i1 %cmp5.not71, i1 false
%3 = load i32, ptr @y, align 4
%cmp7.not73 = icmp sgt i32 %3, %b
%or.cond6874 = select i1 %or.cond72, i1 %cmp7.not73, i1 false
%4 = load i32, ptr @z, align 4
%cmp9.not75 = icmp sgt i32 %4, %c
%or.cond6976 = select i1 %or.cond6874, i1 %cmp9.not75, i1 false
br i1 %or.cond6976, label %lor.lhs.false10.lr.ph, label %return
lor.lhs.false10.lr.ph: ; preds = %entry
%sub = add nsw i32 %a, -1
%add = add nuw nsw i32 %a, 1
%sub24 = add nsw i32 %b, -1
%add25 = add nuw nsw i32 %b, 1
%5 = zext i32 %c to i64
br label %lor.lhs.false10
lor.lhs.false10: ; preds = %lor.lhs.false10.lr.ph, %if.end
%indvars.iv = phi i64 [ %5, %lor.lhs.false10.lr.ph ], [ %indvars.iv.next, %if.end ]
%arrayidx14 = getelementptr inbounds [12 x [12 x [12 x i8]]], ptr @mp, i64 0, i64 %idxprom, i64 %idxprom11, i64 %indvars.iv
%6 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%cmp16.not = icmp eq i8 %6, %from
br i1 %cmp16.not, label %if.end, label %return
if.end: ; preds = %lor.lhs.false10
store i8 %to, ptr %arrayidx14, align 1, !tbaa !5
%7 = trunc i64 %indvars.iv to i32
tail call void @nul(i32 noundef %sub, i32 noundef %b, i32 noundef %7, i8 noundef signext %from, i8 noundef signext %to)
tail call void @nul(i32 noundef %add, i32 noundef %b, i32 noundef %7, i8 noundef signext %from, i8 noundef signext %to)
tail call void @nul(i32 noundef %a, i32 noundef %sub24, i32 noundef %7, i8 noundef signext %from, i8 noundef signext %to)
tail call void @nul(i32 noundef %a, i32 noundef %add25, i32 noundef %7, i8 noundef signext %from, i8 noundef signext %to)
%sub26 = add nsw i32 %7, -1
tail call void @nul(i32 noundef %a, i32 noundef %b, i32 noundef %sub26, i8 noundef signext %from, i8 noundef signext %to)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%8 = trunc i64 %indvars.iv.next to i32
%9 = or i32 %0, %8
%or.cond28.not = icmp sgt i32 %9, -1
%10 = load i32, ptr @x, align 4
%cmp5.not = icmp sgt i32 %10, %a
%or.cond = select i1 %or.cond28.not, i1 %cmp5.not, i1 false
%11 = load i32, ptr @y, align 4
%cmp7.not = icmp sgt i32 %11, %b
%or.cond68 = select i1 %or.cond, i1 %cmp7.not, i1 false
%12 = load i32, ptr @z, align 4
%cmp9.not = icmp sgt i32 %12, %8
%or.cond69 = select i1 %or.cond68, i1 %cmp9.not, i1 false
br i1 %or.cond69, label %lor.lhs.false10, label %return
return: ; preds = %lor.lhs.false10, %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%i = alloca i32, align 4
%j = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #5
%call77 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @z)
%cmp78 = icmp eq i32 %call77, 3
br i1 %cmp78, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %for.end39
store i32 0, ptr %i, align 4, !tbaa !8
%0 = load i32, ptr @x, align 4, !tbaa !8
%cmp149 = icmp sgt i32 %0, 0
br i1 %cmp149, label %for.cond2.preheader.lr.ph, label %for.end10
for.cond2.preheader.lr.ph: ; preds = %for.cond.preheader
%1 = load i32, ptr @y, align 4, !tbaa !8
%2 = icmp sgt i32 %1, 0
br i1 %2, label %for.cond2.preheader, label %for.cond2.preheader.lr.ph.split.us
for.cond2.preheader.lr.ph.split.us: ; preds = %for.cond2.preheader.lr.ph
store i32 0, ptr %j, align 4, !tbaa !8
store i32 %0, ptr %i, align 4, !tbaa !8
br label %for.end10
for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.inc8
%3 = phi i32 [ %9, %for.inc8 ], [ %0, %for.cond2.preheader.lr.ph ]
%4 = phi i32 [ %inc9, %for.inc8 ], [ 0, %for.cond2.preheader.lr.ph ]
%5 = phi i32 [ %11, %for.inc8 ], [ %1, %for.cond2.preheader.lr.ph ]
store i32 0, ptr %j, align 4, !tbaa !8
%cmp347 = icmp sgt i32 %5, 0
br i1 %cmp347, label %for.body4, label %for.inc8
for.body4: ; preds = %for.cond2.preheader, %for.body4
%storemerge4648 = phi i32 [ %inc, %for.body4 ], [ 0, %for.cond2.preheader ]
%6 = load i32, ptr %i, align 4, !tbaa !8
%idxprom = sext i32 %6 to i64
%idxprom5 = sext i32 %storemerge4648 to i64
%arrayidx6 = getelementptr inbounds [12 x [12 x [12 x i8]]], ptr @mp, i64 0, i64 %idxprom, i64 %idxprom5
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%7 = load i32, ptr %j, align 4, !tbaa !8
%inc = add nsw i32 %7, 1
store i32 %inc, ptr %j, align 4, !tbaa !8
%8 = load i32, ptr @y, align 4, !tbaa !8
%cmp3 = icmp slt i32 %inc, %8
br i1 %cmp3, label %for.body4, label %for.inc8.loopexit, !llvm.loop !10
for.inc8.loopexit: ; preds = %for.body4
%.pre = load i32, ptr %i, align 4, !tbaa !8
%.pre92 = load i32, ptr @x, align 4, !tbaa !8
br label %for.inc8
for.inc8: ; preds = %for.inc8.loopexit, %for.cond2.preheader
%9 = phi i32 [ %.pre92, %for.inc8.loopexit ], [ %3, %for.cond2.preheader ]
%10 = phi i32 [ %.pre, %for.inc8.loopexit ], [ %4, %for.cond2.preheader ]
%11 = phi i32 [ %8, %for.inc8.loopexit ], [ %5, %for.cond2.preheader ]
%inc9 = add nsw i32 %10, 1
store i32 %inc9, ptr %i, align 4, !tbaa !8
%cmp1 = icmp slt i32 %inc9, %9
br i1 %cmp1, label %for.cond2.preheader, label %for.end10, !llvm.loop !12
for.end10: ; preds = %for.inc8, %for.cond2.preheader.lr.ph.split.us, %for.cond.preheader
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i, ptr noundef nonnull %j)
%12 = load i32, ptr %i, align 4, !tbaa !8
%dec = add nsw i32 %12, -1
store i32 %dec, ptr %i, align 4, !tbaa !8
%13 = load i32, ptr %j, align 4, !tbaa !8
%dec12 = add nsw i32 %13, -1
store i32 %dec12, ptr %j, align 4, !tbaa !8
call void @nul(i32 noundef 0, i32 noundef %dec, i32 noundef %dec12, i8 noundef signext 46, i8 noundef signext 64)
%14 = load i32, ptr @x, align 4, !tbaa !8
%cmp1460 = icmp sgt i32 %14, 0
br i1 %cmp1460, label %for.cond16.preheader.lr.ph, label %for.end39
for.cond16.preheader.lr.ph: ; preds = %for.end10
%15 = load i32, ptr @y, align 4, !tbaa !8
%cmp1754 = icmp sgt i32 %15, 0
%16 = load i32, ptr @z, align 4
br i1 %cmp1754, label %for.cond16.preheader.lr.ph.split.us, label %for.cond13.for.end39_crit_edge
for.cond16.preheader.lr.ph.split.us: ; preds = %for.cond16.preheader.lr.ph
%cmp2051 = icmp sgt i32 %16, 0
br i1 %cmp2051, label %for.cond16.preheader.us.us.preheader, label %for.cond13.for.end39_crit_edge
for.cond16.preheader.us.us.preheader: ; preds = %for.cond16.preheader.lr.ph.split.us
%wide.trip.count90 = zext i32 %14 to i64
%wide.trip.count85 = zext i32 %15 to i64
%wide.trip.count = zext i32 %16 to i64
%min.iters.check = icmp ult i32 %16, 8
%n.vec = and i64 %wide.trip.count, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br label %for.cond16.preheader.us.us
for.cond16.preheader.us.us: ; preds = %for.cond16.preheader.us.us.preheader, %for.cond16.for.inc37_crit_edge.split.us.us.us
%indvars.iv87 = phi i64 [ 0, %for.cond16.preheader.us.us.preheader ], [ %indvars.iv.next88, %for.cond16.for.inc37_crit_edge.split.us.us.us ]
%n.062.us.us = phi i32 [ 0, %for.cond16.preheader.us.us.preheader ], [ %spec.select.us.us.us.lcssa, %for.cond16.for.inc37_crit_edge.split.us.us.us ]
br label %for.cond19.preheader.us.us.us
for.cond19.preheader.us.us.us: ; preds = %for.cond19.for.inc34_crit_edge.us.us.us, %for.cond16.preheader.us.us
%indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.cond19.for.inc34_crit_edge.us.us.us ], [ 0, %for.cond16.preheader.us.us ]
%n.156.us.us.us = phi i32 [ %spec.select.us.us.us.lcssa, %for.cond19.for.inc34_crit_edge.us.us.us ], [ %n.062.us.us, %for.cond16.preheader.us.us ]
br i1 %min.iters.check, label %for.body21.us.us.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond19.preheader.us.us.us
%17 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %n.156.us.us.us, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %17, %vector.ph ], [ %24, %vector.body ]
%vec.phi93 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
%18 = getelementptr inbounds [12 x [12 x [12 x i8]]], ptr @mp, i64 0, i64 %indvars.iv87, i64 %indvars.iv82, i64 %index
%wide.load = load <4 x i8>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds i8, ptr %18, i64 4
%wide.load94 = load <4 x i8>, ptr %19, align 4, !tbaa !5
%20 = icmp eq <4 x i8> %wide.load, <i8 64, i8 64, i8 64, i8 64>
%21 = icmp eq <4 x i8> %wide.load94, <i8 64, i8 64, i8 64, i8 64>
%22 = zext <4 x i1> %20 to <4 x i32>
%23 = zext <4 x i1> %21 to <4 x i32>
%24 = add <4 x i32> %vec.phi, %22
%25 = add <4 x i32> %vec.phi93, %23
%index.next = add nuw i64 %index, 8
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %25, %24
%27 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond19.for.inc34_crit_edge.us.us.us, label %for.body21.us.us.us.preheader
for.body21.us.us.us.preheader: ; preds = %for.cond19.preheader.us.us.us, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.cond19.preheader.us.us.us ], [ %n.vec, %middle.block ]
%n.253.us.us.us.ph = phi i32 [ %n.156.us.us.us, %for.cond19.preheader.us.us.us ], [ %27, %middle.block ]
br label %for.body21.us.us.us
for.body21.us.us.us: ; preds = %for.body21.us.us.us.preheader, %for.body21.us.us.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body21.us.us.us ], [ %indvars.iv.ph, %for.body21.us.us.us.preheader ]
%n.253.us.us.us = phi i32 [ %spec.select.us.us.us, %for.body21.us.us.us ], [ %n.253.us.us.us.ph, %for.body21.us.us.us.preheader ]
%arrayidx27.us.us.us = getelementptr inbounds [12 x [12 x [12 x i8]]], ptr @mp, i64 0, i64 %indvars.iv87, i64 %indvars.iv82, i64 %indvars.iv
%28 = load i8, ptr %arrayidx27.us.us.us, align 1, !tbaa !5
%cmp28.us.us.us = icmp eq i8 %28, 64
%inc30.us.us.us = zext i1 %cmp28.us.us.us to i32
%spec.select.us.us.us = add nsw i32 %n.253.us.us.us, %inc30.us.us.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond19.for.inc34_crit_edge.us.us.us, label %for.body21.us.us.us, !llvm.loop !17
for.cond19.for.inc34_crit_edge.us.us.us: ; preds = %for.body21.us.us.us, %middle.block
%spec.select.us.us.us.lcssa = phi i32 [ %27, %middle.block ], [ %spec.select.us.us.us, %for.body21.us.us.us ]
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
br i1 %exitcond86.not, label %for.cond16.for.inc37_crit_edge.split.us.us.us, label %for.cond19.preheader.us.us.us, !llvm.loop !18
for.cond16.for.inc37_crit_edge.split.us.us.us: ; preds = %for.cond19.for.inc34_crit_edge.us.us.us
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90
br i1 %exitcond91.not, label %for.cond13.for.end39_crit_edge, label %for.cond16.preheader.us.us, !llvm.loop !19
for.cond13.for.end39_crit_edge: ; preds = %for.cond16.for.inc37_crit_edge.split.us.us.us, %for.cond16.preheader.lr.ph.split.us, %for.cond16.preheader.lr.ph
%.us-phi72 = phi i32 [ 0, %for.cond16.preheader.lr.ph ], [ %15, %for.cond16.preheader.lr.ph.split.us ], [ %15, %for.cond16.for.inc37_crit_edge.split.us.us.us ]
%.us-phi74 = phi i32 [ 0, %for.cond16.preheader.lr.ph ], [ 0, %for.cond16.preheader.lr.ph.split.us ], [ %spec.select.us.us.us.lcssa, %for.cond16.for.inc37_crit_edge.split.us.us.us ]
store i32 %.us-phi72, ptr %j, align 4, !tbaa !8
br label %for.end39
for.end39: ; preds = %for.cond13.for.end39_crit_edge, %for.end10
%storemerge44.lcssa = phi i32 [ %14, %for.cond13.for.end39_crit_edge ], [ 0, %for.end10 ]
%n.0.lcssa = phi i32 [ %.us-phi74, %for.cond13.for.end39_crit_edge ], [ 0, %for.end10 ]
store i32 %storemerge44.lcssa, ptr %i, align 4, !tbaa !8
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %n.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @z)
%cmp = icmp eq i32 %call, 3
br i1 %cmp, label %for.cond.preheader, label %while.end, !llvm.loop !20
while.end: ; preds = %for.end39, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !11, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !11, !16, !15}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
|
#include <stdio.h>
int main() {
int n, i, a[200002], ans=1, flag=0;
scanf("%d %d %d", &n, &a[0], &a[1]);
if (a[0] < a[1])flag = 1;//単調増加
if (a[0] > a[1])flag = -1;//単調減少
for (i = 2; i < n; i++) {
scanf("%d", &a[i]);
if (a[i - 1] > a[i]) {
if (flag == 0) {
flag = -1;
}
else if (flag == 1) {
flag = 0;
ans++;
}
}
else if (a[i - 1] < a[i]) {
if (flag == 0) {
flag = 1;
}
else if (flag == -1) {
flag = 0;
ans++;
}
}
}
printf("%d", ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162860/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%a = alloca [200002 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %a) #3
%arrayidx1 = getelementptr inbounds [200002 x i32], ptr %a, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp957 = icmp sgt i32 %0, 2
br i1 %cmp957, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = load i32, ptr %a, align 16, !tbaa !5
%2 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %1, %2
%cmp = icmp slt i32 %1, %2
%spec.select = zext i1 %cmp to i32
%flag.1 = select i1 %cmp6, i32 -1, i32 %spec.select
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%flag.260 = phi i32 [ %flag.1, %for.body.preheader ], [ %flag.3, %for.inc ]
%ans.059 = phi i32 [ 1, %for.body.preheader ], [ %ans.1, %for.inc ]
%arrayidx10 = getelementptr inbounds [200002 x i32], ptr %a, i64 0, i64 %indvars.iv
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx10)
%3 = add nsw i64 %indvars.iv, -1
%arrayidx13 = getelementptr inbounds [200002 x i32], ptr %a, i64 0, i64 %3
%4 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %4, %5
br i1 %cmp16, label %if.then17, label %if.else24
if.then17: ; preds = %for.body
switch i32 %flag.260, label %for.inc.fold.split [
i32 0, label %for.inc
i32 1, label %if.then21
]
if.then21: ; preds = %if.then17
%inc = add nsw i32 %ans.059, 1
br label %for.inc
if.else24: ; preds = %for.body
%cmp30 = icmp slt i32 %4, %5
br i1 %cmp30, label %if.then31, label %for.inc
if.then31: ; preds = %if.else24
switch i32 %flag.260, label %for.inc.fold.split56 [
i32 0, label %for.inc
i32 -1, label %if.then36
]
if.then36: ; preds = %if.then31
%inc37 = add nsw i32 %ans.059, 1
br label %for.inc
for.inc.fold.split: ; preds = %if.then17
br label %for.inc
for.inc.fold.split56: ; preds = %if.then31
br label %for.inc
for.inc: ; preds = %if.then31, %for.inc.fold.split56, %if.then17, %for.inc.fold.split, %if.then21, %if.then36, %if.else24
%ans.1 = phi i32 [ %inc, %if.then21 ], [ %inc37, %if.then36 ], [ %ans.059, %if.else24 ], [ %ans.059, %if.then17 ], [ %ans.059, %for.inc.fold.split ], [ %ans.059, %if.then31 ], [ %ans.059, %for.inc.fold.split56 ]
%flag.3 = phi i32 [ 0, %if.then21 ], [ 0, %if.then36 ], [ %flag.260, %if.else24 ], [ -1, %if.then17 ], [ %flag.260, %for.inc.fold.split ], [ 1, %if.then31 ], [ %flag.260, %for.inc.fold.split56 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp9 = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp9, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%ans.0.lcssa = phi i32 [ 1, %entry ], [ %ans.1, %for.inc ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n;
int a[100000];
char d = 'n';
int i;
int ans = 1;
/* input */
scanf("%d", &n);
for(i=0; i<n; i++)
scanf("%d", &a[i]);
/* to do */
for(i=1; i<n; i++){
if(a[i-1] < a[i]){ //増加
if(d == 'n'){
d = 'u';
continue;
}
else if(d == 'd'){
d = 'n';
ans++;
continue;
}
else if(d == 'u')
continue;
}
else if(a[i-1] > a[i]){ //減少
if(d == 'n'){
d = 'd';
continue;
}
else if(d == 'u'){
d = 'n';
ans++;
continue;
}
else if(d == 'd')
continue;
}
}
/* output */
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162910/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162910/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp73 = icmp sgt i32 %0, 0
br i1 %cmp73, label %for.body, label %for.end56
for.cond2.preheader: ; preds = %for.body
%cmp375 = icmp sgt i32 %1, 1
br i1 %cmp375, label %for.body4.preheader, label %for.end56
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %1 to i64
%.pre = load i32, ptr %a, align 16, !tbaa !5
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.preheader, %for.inc54
%3 = phi i32 [ %.pre, %for.body4.preheader ], [ %4, %for.inc54 ]
%indvars.iv82 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next83, %for.inc54 ]
%ans.078 = phi i32 [ 1, %for.body4.preheader ], [ %ans.1, %for.inc54 ]
%d.076 = phi i8 [ 110, %for.body4.preheader ], [ %d.1, %for.inc54 ]
%arrayidx8 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv82
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp slt i32 %3, %4
br i1 %cmp9, label %if.then, label %if.else25
if.then: ; preds = %for.body4
switch i8 %d.076, label %for.inc54.fold.split [
i8 110, label %for.inc54
i8 100, label %if.then16
]
if.then16: ; preds = %if.then
%inc17 = add nsw i32 %ans.078, 1
br label %for.inc54
if.else25: ; preds = %for.body4
%cmp31 = icmp sgt i32 %3, %4
br i1 %cmp31, label %if.then33, label %for.inc54
if.then33: ; preds = %if.else25
switch i8 %d.076, label %for.inc54.fold.split72 [
i8 110, label %for.inc54
i8 117, label %if.then42
]
if.then42: ; preds = %if.then33
%inc43 = add nsw i32 %ans.078, 1
br label %for.inc54
for.inc54.fold.split: ; preds = %if.then
br label %for.inc54
for.inc54.fold.split72: ; preds = %if.then33
br label %for.inc54
for.inc54: ; preds = %if.then33, %for.inc54.fold.split72, %if.then, %for.inc54.fold.split, %if.else25, %if.then42, %if.then16
%d.1 = phi i8 [ 110, %if.then16 ], [ 110, %if.then42 ], [ %d.076, %if.else25 ], [ 117, %if.then ], [ %d.076, %for.inc54.fold.split ], [ 100, %if.then33 ], [ %d.076, %for.inc54.fold.split72 ]
%ans.1 = phi i32 [ %inc17, %if.then16 ], [ %inc43, %if.then42 ], [ %ans.078, %if.else25 ], [ %ans.078, %if.then ], [ %ans.078, %for.inc54.fold.split ], [ %ans.078, %if.then33 ], [ %ans.078, %for.inc54.fold.split72 ]
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%exitcond.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count
br i1 %exitcond.not, label %for.end56, label %for.body4, !llvm.loop !11
for.end56: ; preds = %for.inc54, %entry, %for.cond2.preheader
%ans.0.lcssa = phi i32 [ 1, %for.cond2.preheader ], [ 1, %entry ], [ %ans.1, %for.inc54 ]
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
// AtCoder ABC131: D - Megalomania
// 2019.9.4 bal4u
#include <stdio.h>
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in() { // 非負整数の入力
int n = 0, c = gc();
do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
return n;
}
typedef struct { int a, b; } T;
T t[200005]; int N;
void Qsort(T *a, int l, int r) {
int i, j, m; T t;
i = l, j = r, m = a[(l+r) >> 1].b;
while (1) {
while (a[i].b < m) i++;
while (m < a[j].b) j--;
if (i >= j) break;
t = a[i], a[i] = a[j], a[j] = t;
i++, j--;
}
if (l+1 < i) Qsort(a, l, i-1);
if (j+1 < r) Qsort(a, j+1, r);
}
int main()
{
int i, s;
N = in(); for (i = 0; i < N; i++) {
t[i].a = in(), t[i].b = in();
if (t[i].a > t[i].b) goto No;
}
Qsort(t, 0, N-1);
s = 0; for (i = 0; i < N; i++) {
s += t[i].a;
if (s > t[i].b) goto No;
}
puts("Yes"); return 0;
No: puts("No"); return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162954/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162954/source.c"
target datalayout = "e-m:e-p270: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.T = type { i32, i32 }
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@N = dso_local local_unnamed_addr global i32 0, align 4
@t = dso_local global [200005 x %struct.T] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4
%.pre13.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %do.body.preheader
do.body.preheader: ; preds = %cond.true.i, %cond.false.i
%.ph = phi ptr [ %0, %cond.false.i ], [ %.pre13.pre, %cond.true.i ]
%c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %do.body
do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit12
%4 = phi ptr [ %8, %getchar_unlocked.exit12 ], [ %.ph, %do.body.preheader ]
%n.0 = phi i32 [ %add, %getchar_unlocked.exit12 ], [ 0, %do.body.preheader ]
%c.0 = phi i32 [ %cond.i8, %getchar_unlocked.exit12 ], [ %c.0.ph, %do.body.preheader ]
%mul = mul nsw i32 %n.0, 10
%and = and i32 %c.0, 15
%add = add nsw i32 %and, %mul
%_IO_read_ptr.i3 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i3, align 8, !tbaa !9
%_IO_read_end.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i4, align 8, !tbaa !14
%cmp.not.i5 = icmp ult ptr %5, %6
br i1 %cmp.not.i5, label %cond.false.i9, label %cond.true.i6, !prof !15
cond.true.i6: ; preds = %do.body
%call.i7 = tail call i32 @__uflow(ptr noundef nonnull %4) #4
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12
cond.false.i9: ; preds = %do.body
%incdec.ptr.i10 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i10, ptr %_IO_read_ptr.i3, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i11 = zext i8 %7 to i32
br label %getchar_unlocked.exit12
getchar_unlocked.exit12: ; preds = %cond.true.i6, %cond.false.i9
%8 = phi ptr [ %.pre, %cond.true.i6 ], [ %4, %cond.false.i9 ]
%cond.i8 = phi i32 [ %call.i7, %cond.true.i6 ], [ %conv3.i11, %cond.false.i9 ]
%cmp = icmp sgt i32 %cond.i8, 47
br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17
do.end: ; preds = %getchar_unlocked.exit12
ret i32 %add
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @Qsort(ptr nocapture noundef %a, i32 noundef %l, i32 noundef %r) local_unnamed_addr #1 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end28, %entry
%l.tr = phi i32 [ %l, %entry ], [ %add29, %if.end28 ]
%add = add nsw i32 %l.tr, %r
%shr = ashr i32 %add, 1
%idxprom = sext i32 %shr to i64
%b = getelementptr inbounds %struct.T, ptr %a, i64 %idxprom, i32 1
%0 = load i32, ptr %b, align 4, !tbaa !19
br label %while.cond
while.cond: ; preds = %if.end, %tailrecurse
%j.0 = phi i32 [ %r, %tailrecurse ], [ %dec23, %if.end ]
%i.0 = phi i32 [ %l.tr, %tailrecurse ], [ %inc22, %if.end ]
%1 = sext i32 %i.0 to i64
br label %while.cond1
while.cond1: ; preds = %while.cond1, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond1 ], [ %1, %while.cond ]
%b4 = getelementptr inbounds %struct.T, ptr %a, i64 %indvars.iv, i32 1
%2 = load i32, ptr %b4, align 4, !tbaa !19
%cmp = icmp slt i32 %2, %0
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp, label %while.cond1, label %while.cond6.preheader, !llvm.loop !21
while.cond6.preheader: ; preds = %while.cond1
%3 = trunc i64 %indvars.iv to i32
%4 = sext i32 %j.0 to i64
br label %while.cond6
while.cond6: ; preds = %while.cond6, %while.cond6.preheader
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %while.cond6 ], [ %4, %while.cond6.preheader ]
%b9 = getelementptr inbounds %struct.T, ptr %a, i64 %indvars.iv64, i32 1
%5 = load i32, ptr %b9, align 4, !tbaa !19
%cmp10 = icmp slt i32 %0, %5
%indvars.iv.next65 = add i64 %indvars.iv64, -1
br i1 %cmp10, label %while.cond6, label %while.end12, !llvm.loop !22
while.end12: ; preds = %while.cond6
%6 = trunc i64 %indvars.iv64 to i32
%cmp13.not = icmp slt i32 %3, %6
br i1 %cmp13.not, label %if.end, label %while.end24
if.end: ; preds = %while.end12
%arrayidx3.le = getelementptr inbounds %struct.T, ptr %a, i64 %indvars.iv
%arrayidx8.le = getelementptr inbounds %struct.T, ptr %a, i64 %indvars.iv64
%7 = load i64, ptr %arrayidx3.le, align 4
%8 = load i64, ptr %arrayidx8.le, align 4
store i64 %8, ptr %arrayidx3.le, align 4
store i64 %7, ptr %arrayidx8.le, align 4
%inc22 = add nsw i32 %3, 1
%dec23 = add nsw i32 %6, -1
br label %while.cond
while.end24: ; preds = %while.end12
%add25 = add nsw i32 %l.tr, 1
%cmp26 = icmp slt i32 %add25, %3
br i1 %cmp26, label %if.then27, label %if.end28
if.then27: ; preds = %while.end24
%sub = add nsw i32 %3, -1
tail call void @Qsort(ptr noundef nonnull %a, i32 noundef %l.tr, i32 noundef %sub)
br label %if.end28
if.end28: ; preds = %if.then27, %while.end24
%add29 = add nsw i32 %6, 1
%cmp30 = icmp slt i32 %add29, %r
br i1 %cmp30, label %tailrecurse, label %if.end33
if.end33: ; preds = %if.end28
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14
%cmp.not.i.i = icmp ult ptr %1, %2
br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4
%.pre13.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i.preheader
cond.false.i.i: ; preds = %entry
%incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i.i = zext i8 %3 to i32
br label %do.body.i.preheader
do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i
%.ph135 = phi ptr [ %0, %cond.false.i.i ], [ %.pre13.pre.i, %cond.true.i.i ]
%c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ]
br label %do.body.i
do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit12.i
%4 = phi ptr [ %8, %getchar_unlocked.exit12.i ], [ %.ph135, %do.body.i.preheader ]
%n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit12.i ], [ 0, %do.body.i.preheader ]
%c.0.i = phi i32 [ %cond.i8.i, %getchar_unlocked.exit12.i ], [ %c.0.i.ph, %do.body.i.preheader ]
%mul.i = mul nsw i32 %n.0.i, 10
%and.i = and i32 %c.0.i, 15
%add.i = add nsw i32 %and.i, %mul.i
%_IO_read_ptr.i3.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i3.i, align 8, !tbaa !9
%_IO_read_end.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i4.i, align 8, !tbaa !14
%cmp.not.i5.i = icmp ult ptr %5, %6
br i1 %cmp.not.i5.i, label %cond.false.i9.i, label %cond.true.i6.i, !prof !15
cond.true.i6.i: ; preds = %do.body.i
%call.i7.i = tail call i32 @__uflow(ptr noundef nonnull %4) #4
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12.i
cond.false.i9.i: ; preds = %do.body.i
%incdec.ptr.i10.i = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i10.i, ptr %_IO_read_ptr.i3.i, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i11.i = zext i8 %7 to i32
br label %getchar_unlocked.exit12.i
getchar_unlocked.exit12.i: ; preds = %cond.false.i9.i, %cond.true.i6.i
%8 = phi ptr [ %.pre.i, %cond.true.i6.i ], [ %4, %cond.false.i9.i ]
%cond.i8.i = phi i32 [ %call.i7.i, %cond.true.i6.i ], [ %conv3.i11.i, %cond.false.i9.i ]
%cmp.i = icmp sgt i32 %cond.i8.i, 47
br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17
in.exit: ; preds = %getchar_unlocked.exit12.i
store i32 %add.i, ptr @N, align 4, !tbaa !23
%cmp104 = icmp sgt i32 %add.i, 0
br i1 %cmp104, label %for.body, label %for.end.thread
for.end.thread: ; preds = %in.exit
%sub116 = add nsw i32 %add.i, -1
tail call void @Qsort(ptr noundef nonnull @t, i32 noundef 0, i32 noundef %sub116)
br label %cleanup
for.cond: ; preds = %in.exit101
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr @N, align 4, !tbaa !23
%10 = sext i32 %9 to i64
%cmp = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !24
for.body: ; preds = %in.exit, %for.cond
%11 = phi ptr [ %31, %for.cond ], [ %8, %in.exit ]
%12 = phi ptr [ %32, %for.cond ], [ %8, %in.exit ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %in.exit ]
%_IO_read_ptr.i.i40 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1
%13 = load ptr, ptr %_IO_read_ptr.i.i40, align 8, !tbaa !9
%_IO_read_end.i.i41 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2
%14 = load ptr, ptr %_IO_read_end.i.i41, align 8, !tbaa !14
%cmp.not.i.i42 = icmp ult ptr %13, %14
br i1 %cmp.not.i.i42, label %cond.false.i.i67, label %cond.true.i.i43, !prof !15
cond.true.i.i43: ; preds = %for.body
%call.i.i44 = tail call i32 @__uflow(ptr noundef nonnull %12) #4
%.pre13.pre.i45 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i49.preheader
cond.false.i.i67: ; preds = %for.body
%incdec.ptr.i.i68 = getelementptr inbounds i8, ptr %13, i64 1
store ptr %incdec.ptr.i.i68, ptr %_IO_read_ptr.i.i40, align 8, !tbaa !9
%15 = load i8, ptr %13, align 1, !tbaa !16
%conv3.i.i69 = zext i8 %15 to i32
br label %do.body.i49.preheader
do.body.i49.preheader: ; preds = %cond.false.i.i67, %cond.true.i.i43
%.ph129 = phi ptr [ %11, %cond.false.i.i67 ], [ %.pre13.pre.i45, %cond.true.i.i43 ]
%.ph130 = phi ptr [ %12, %cond.false.i.i67 ], [ %.pre13.pre.i45, %cond.true.i.i43 ]
%c.0.i51.ph = phi i32 [ %conv3.i.i69, %cond.false.i.i67 ], [ %call.i.i44, %cond.true.i.i43 ]
br label %do.body.i49
do.body.i49: ; preds = %do.body.i49.preheader, %getchar_unlocked.exit12.i61
%16 = phi ptr [ %21, %getchar_unlocked.exit12.i61 ], [ %.ph129, %do.body.i49.preheader ]
%17 = phi ptr [ %22, %getchar_unlocked.exit12.i61 ], [ %.ph130, %do.body.i49.preheader ]
%n.0.i50 = phi i32 [ %add.i54, %getchar_unlocked.exit12.i61 ], [ 0, %do.body.i49.preheader ]
%c.0.i51 = phi i32 [ %cond.i8.i62, %getchar_unlocked.exit12.i61 ], [ %c.0.i51.ph, %do.body.i49.preheader ]
%mul.i52 = mul nsw i32 %n.0.i50, 10
%and.i53 = and i32 %c.0.i51, 15
%add.i54 = add nsw i32 %and.i53, %mul.i52
%_IO_read_ptr.i3.i55 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 1
%18 = load ptr, ptr %_IO_read_ptr.i3.i55, align 8, !tbaa !9
%_IO_read_end.i4.i56 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 2
%19 = load ptr, ptr %_IO_read_end.i4.i56, align 8, !tbaa !14
%cmp.not.i5.i57 = icmp ult ptr %18, %19
br i1 %cmp.not.i5.i57, label %cond.false.i9.i64, label %cond.true.i6.i58, !prof !15
cond.true.i6.i58: ; preds = %do.body.i49
%call.i7.i59 = tail call i32 @__uflow(ptr noundef nonnull %17) #4
%.pre.i60 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12.i61
cond.false.i9.i64: ; preds = %do.body.i49
%incdec.ptr.i10.i65 = getelementptr inbounds i8, ptr %18, i64 1
store ptr %incdec.ptr.i10.i65, ptr %_IO_read_ptr.i3.i55, align 8, !tbaa !9
%20 = load i8, ptr %18, align 1, !tbaa !16
%conv3.i11.i66 = zext i8 %20 to i32
br label %getchar_unlocked.exit12.i61
getchar_unlocked.exit12.i61: ; preds = %cond.false.i9.i64, %cond.true.i6.i58
%21 = phi ptr [ %.pre.i60, %cond.true.i6.i58 ], [ %16, %cond.false.i9.i64 ]
%22 = phi ptr [ %.pre.i60, %cond.true.i6.i58 ], [ %17, %cond.false.i9.i64 ]
%cond.i8.i62 = phi i32 [ %call.i7.i59, %cond.true.i6.i58 ], [ %conv3.i11.i66, %cond.false.i9.i64 ]
%cmp.i63 = icmp sgt i32 %cond.i8.i62, 47
br i1 %cmp.i63, label %do.body.i49, label %in.exit70, !llvm.loop !17
in.exit70: ; preds = %getchar_unlocked.exit12.i61
%arrayidx = getelementptr inbounds [200005 x %struct.T], ptr @t, i64 0, i64 %indvars.iv
store i32 %add.i54, ptr %arrayidx, align 8, !tbaa !25
%_IO_read_ptr.i.i71 = getelementptr inbounds %struct._IO_FILE, ptr %21, i64 0, i32 1
%23 = load ptr, ptr %_IO_read_ptr.i.i71, align 8, !tbaa !9
%_IO_read_end.i.i72 = getelementptr inbounds %struct._IO_FILE, ptr %21, i64 0, i32 2
%24 = load ptr, ptr %_IO_read_end.i.i72, align 8, !tbaa !14
%cmp.not.i.i73 = icmp ult ptr %23, %24
br i1 %cmp.not.i.i73, label %cond.false.i.i98, label %cond.true.i.i74, !prof !15
cond.true.i.i74: ; preds = %in.exit70
%call.i.i75 = tail call i32 @__uflow(ptr noundef nonnull %21) #4
%.pre13.pre.i76 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i80.preheader
cond.false.i.i98: ; preds = %in.exit70
%incdec.ptr.i.i99 = getelementptr inbounds i8, ptr %23, i64 1
store ptr %incdec.ptr.i.i99, ptr %_IO_read_ptr.i.i71, align 8, !tbaa !9
%25 = load i8, ptr %23, align 1, !tbaa !16
%conv3.i.i100 = zext i8 %25 to i32
br label %do.body.i80.preheader
do.body.i80.preheader: ; preds = %cond.false.i.i98, %cond.true.i.i74
%.ph128 = phi ptr [ %21, %cond.false.i.i98 ], [ %.pre13.pre.i76, %cond.true.i.i74 ]
%c.0.i82.ph = phi i32 [ %conv3.i.i100, %cond.false.i.i98 ], [ %call.i.i75, %cond.true.i.i74 ]
br label %do.body.i80
do.body.i80: ; preds = %do.body.i80.preheader, %getchar_unlocked.exit12.i92
%26 = phi ptr [ %31, %getchar_unlocked.exit12.i92 ], [ %.ph128, %do.body.i80.preheader ]
%27 = phi ptr [ %32, %getchar_unlocked.exit12.i92 ], [ %.ph128, %do.body.i80.preheader ]
%n.0.i81 = phi i32 [ %add.i85, %getchar_unlocked.exit12.i92 ], [ 0, %do.body.i80.preheader ]
%c.0.i82 = phi i32 [ %cond.i8.i93, %getchar_unlocked.exit12.i92 ], [ %c.0.i82.ph, %do.body.i80.preheader ]
%mul.i83 = mul nsw i32 %n.0.i81, 10
%and.i84 = and i32 %c.0.i82, 15
%add.i85 = add nsw i32 %and.i84, %mul.i83
%_IO_read_ptr.i3.i86 = getelementptr inbounds %struct._IO_FILE, ptr %27, i64 0, i32 1
%28 = load ptr, ptr %_IO_read_ptr.i3.i86, align 8, !tbaa !9
%_IO_read_end.i4.i87 = getelementptr inbounds %struct._IO_FILE, ptr %27, i64 0, i32 2
%29 = load ptr, ptr %_IO_read_end.i4.i87, align 8, !tbaa !14
%cmp.not.i5.i88 = icmp ult ptr %28, %29
br i1 %cmp.not.i5.i88, label %cond.false.i9.i95, label %cond.true.i6.i89, !prof !15
cond.true.i6.i89: ; preds = %do.body.i80
%call.i7.i90 = tail call i32 @__uflow(ptr noundef nonnull %27) #4
%.pre.i91 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12.i92
cond.false.i9.i95: ; preds = %do.body.i80
%incdec.ptr.i10.i96 = getelementptr inbounds i8, ptr %28, i64 1
store ptr %incdec.ptr.i10.i96, ptr %_IO_read_ptr.i3.i86, align 8, !tbaa !9
%30 = load i8, ptr %28, align 1, !tbaa !16
%conv3.i11.i97 = zext i8 %30 to i32
br label %getchar_unlocked.exit12.i92
getchar_unlocked.exit12.i92: ; preds = %cond.false.i9.i95, %cond.true.i6.i89
%31 = phi ptr [ %.pre.i91, %cond.true.i6.i89 ], [ %26, %cond.false.i9.i95 ]
%32 = phi ptr [ %.pre.i91, %cond.true.i6.i89 ], [ %27, %cond.false.i9.i95 ]
%cond.i8.i93 = phi i32 [ %call.i7.i90, %cond.true.i6.i89 ], [ %conv3.i11.i97, %cond.false.i9.i95 ]
%cmp.i94 = icmp sgt i32 %cond.i8.i93, 47
br i1 %cmp.i94, label %do.body.i80, label %in.exit101, !llvm.loop !17
in.exit101: ; preds = %getchar_unlocked.exit12.i92
%b = getelementptr inbounds [200005 x %struct.T], ptr @t, i64 0, i64 %indvars.iv, i32 1
store i32 %add.i85, ptr %b, align 4, !tbaa !19
%33 = load i32, ptr %arrayidx, align 8, !tbaa !25
%cmp11 = icmp sgt i32 %33, %add.i85
br i1 %cmp11, label %cleanup, label %for.cond
for.end: ; preds = %for.cond
%sub = add nsw i32 %9, -1
tail call void @Qsort(ptr noundef nonnull @t, i32 noundef 0, i32 noundef %sub)
%cmp13106 = icmp sgt i32 %9, 0
br i1 %cmp13106, label %for.body14.preheader, label %cleanup
for.body14.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %9 to i64
br label %for.body14
for.cond12: ; preds = %for.body14
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%exitcond.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body14, !llvm.loop !26
for.body14: ; preds = %for.body14.preheader, %for.cond12
%indvars.iv112 = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next113, %for.cond12 ]
%s.0108 = phi i32 [ 0, %for.body14.preheader ], [ %add, %for.cond12 ]
%arrayidx16 = getelementptr inbounds [200005 x %struct.T], ptr @t, i64 0, i64 %indvars.iv112
%34 = load i32, ptr %arrayidx16, align 8, !tbaa !25
%add = add nsw i32 %34, %s.0108
%b20 = getelementptr inbounds [200005 x %struct.T], ptr @t, i64 0, i64 %indvars.iv112, i32 1
%35 = load i32, ptr %b20, align 4, !tbaa !19
%cmp21 = icmp sgt i32 %add, %35
br i1 %cmp21, label %cleanup, label %for.cond12
cleanup: ; preds = %in.exit101, %for.body14, %for.cond12, %for.end, %for.end.thread
%.str.1.sink = phi ptr [ @.str, %for.end.thread ], [ @.str, %for.end ], [ @.str, %for.cond12 ], [ @.str.1, %for.body14 ], [ @.str.1, %in.exit101 ]
%call28 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
declare i32 @__uflow(ptr noundef) local_unnamed_addr #3
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !11, i64 4}
!20 = !{!"", !11, i64 0, !11, i64 4}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = !{!11, !11, i64 0}
!24 = distinct !{!24, !18}
!25 = !{!20, !11, i64 0}
!26 = distinct !{!26, !18}
|
#include<stdio.h>
#include<stdlib.h>
long long int a[200005], b[200005];
int asc(const void* x, const void* y)
{
if (b[*(int*)x] > b[*(int*)y])return 1;
if (b[*(int*)x] < b[*(int*)y])return -1;
return 0;
}
int main()
{
int n;
scanf("%d", &n);
int i;
for (i = 0; i < n; i++)
scanf("%lld %lld", &a[i], &b[i]);
int c[200005];
for (i = 0; i < n; i++)
c[i] = i;
qsort(c, n, sizeof(int), asc);
long long int now = 0;
for (i = 0; i < n; i++)
{
now += a[c[i]];
if (now > b[c[i]])
{
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162998/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@b = dso_local global [200005 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@a = dso_local global [200005 x i64] zeroinitializer, align 16
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @asc(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [200005 x i64], ptr @b, i64 0, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !9
%2 = load i32, ptr %y, align 4, !tbaa !5
%idxprom1 = sext i32 %2 to i64
%arrayidx2 = getelementptr inbounds [200005 x i64], ptr @b, i64 0, i64 %idxprom1
%3 = load i64, ptr %arrayidx2, align 8, !tbaa !9
%cmp = icmp sgt i64 %1, %3
%cmp7 = icmp slt i64 %1, %3
%. = sext i1 %cmp7 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%c = alloca [200005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp47 = icmp sgt i32 %0, 0
br i1 %cmp47, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %c) #6
br label %for.end11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [200005 x i64], ptr @b, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %c) #6
%cmp549 = icmp sgt i32 %1, 0
br i1 %cmp549, label %for.body6.preheader, label %for.end11
for.body6.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body6.preheader68, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%3 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
store <4 x i32> %step.add, ptr %4, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end11, label %for.body6.preheader68
for.body6.preheader68: ; preds = %for.body6.preheader, %middle.block
%indvars.iv56.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ]
br label %for.body6
for.body6: ; preds = %for.body6.preheader68, %for.body6
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body6 ], [ %indvars.iv56.ph, %for.body6.preheader68 ]
%arrayidx8 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %indvars.iv56
%6 = trunc i64 %indvars.iv56 to i32
store i32 %6, ptr %arrayidx8, align 4, !tbaa !5
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%exitcond.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count
br i1 %exitcond.not, label %for.end11, label %for.body6, !llvm.loop !16
for.end11: ; preds = %for.body6, %middle.block, %for.end.thread, %for.end
%.lcssa66 = phi i32 [ %0, %for.end.thread ], [ %1, %for.end ], [ %1, %middle.block ], [ %1, %for.body6 ]
%conv = sext i32 %.lcssa66 to i64
call void @qsort(ptr noundef nonnull %c, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @asc) #6
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp1351 = icmp sgt i32 %7, 0
br i1 %cmp1351, label %for.body15.preheader, label %cleanup
for.body15.preheader: ; preds = %for.end11
%wide.trip.count62 = zext i32 %7 to i64
br label %for.body15
for.cond12: ; preds = %for.body15
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%exitcond63.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count62
br i1 %exitcond63.not, label %cleanup, label %for.body15, !llvm.loop !17
for.body15: ; preds = %for.body15.preheader, %for.cond12
%indvars.iv59 = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next60, %for.cond12 ]
%now.053 = phi i64 [ 0, %for.body15.preheader ], [ %add, %for.cond12 ]
%arrayidx17 = getelementptr inbounds [200005 x i32], ptr %c, i64 0, i64 %indvars.iv59
%8 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%idxprom18 = sext i32 %8 to i64
%arrayidx19 = getelementptr inbounds [200005 x i64], ptr @a, i64 0, i64 %idxprom18
%9 = load i64, ptr %arrayidx19, align 8, !tbaa !9
%add = add nsw i64 %9, %now.053
%arrayidx23 = getelementptr inbounds [200005 x i64], ptr @b, i64 0, i64 %idxprom18
%10 = load i64, ptr %arrayidx23, align 8, !tbaa !9
%cmp24 = icmp sgt i64 %add, %10
br i1 %cmp24, label %cleanup, label %for.cond12
cleanup: ; preds = %for.cond12, %for.body15, %for.end11
%str.sink = phi ptr [ @str, %for.end11 ], [ @str.4, %for.body15 ], [ @str, %for.cond12 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
!17 = distinct !{!17, !12}
|
#include<stdio.h>
int main()
{
int a,b,a2=0,b2=0,a3=0,b3=0,a5=0,b5=0;
scanf("%d %d",&a,&b);
while(a%2==0)
{
++a2;
a/=2;
}
while(a%3==0)
{
++a3;
a/=3;
}
while(a%5==0)
{
++a5;
a/=5;
}
while(b%2==0)
{
++b2;
b/=2;
}
while(b%3==0)
{
++b3;
b/=3;
}
while(b%5==0)
{
++b5;
b/=5;
}
if(a!=b)
{
printf("-1");
return 0;
}
else
{
int ans=0;
if(a2>b2)
ans=a2-b2;
else
ans=b2-a2;
if(a3>b3)
ans=ans+a3-b3;
else
ans=ans+b3-a3;
if(a5>b5)
ans=ans+a5-b5;
else
ans=ans+b5-a5;
printf("%d",ans);
return 0;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16304/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16304/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%0 = and i32 %a.promoted, 1
%cmp89 = icmp eq i32 %0, 0
br i1 %cmp89, label %while.body, label %while.cond1.preheader
while.cond.while.cond1.preheader_crit_edge: ; preds = %while.body
store i32 %div, ptr %a, align 4, !tbaa !5
br label %while.cond1.preheader
while.cond1.preheader: ; preds = %while.cond.while.cond1.preheader_crit_edge, %entry
%a.promoted92 = phi i32 [ %div, %while.cond.while.cond1.preheader_crit_edge ], [ %a.promoted, %entry ]
%a2.0.lcssa = phi i32 [ %inc, %while.cond.while.cond1.preheader_crit_edge ], [ 0, %entry ]
%rem294 = srem i32 %a.promoted92, 3
%cmp395 = icmp eq i32 %rem294, 0
br i1 %cmp395, label %while.body4, label %while.cond8.preheader
while.body: ; preds = %entry, %while.body
%a2.091 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%div8890 = phi i32 [ %div, %while.body ], [ %a.promoted, %entry ]
%inc = add nuw nsw i32 %a2.091, 1
%div = sdiv i32 %div8890, 2
%1 = and i32 %div, 1
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %while.body, label %while.cond.while.cond1.preheader_crit_edge, !llvm.loop !9
while.cond1.while.cond8.preheader_crit_edge: ; preds = %while.body4
store i32 %div6, ptr %a, align 4, !tbaa !5
br label %while.cond8.preheader
while.cond8.preheader: ; preds = %while.cond1.while.cond8.preheader_crit_edge, %while.cond1.preheader
%a.promoted99 = phi i32 [ %div6, %while.cond1.while.cond8.preheader_crit_edge ], [ %a.promoted92, %while.cond1.preheader ]
%a3.0.lcssa = phi i32 [ %inc5, %while.cond1.while.cond8.preheader_crit_edge ], [ 0, %while.cond1.preheader ]
%rem9101 = srem i32 %a.promoted99, 5
%cmp10102 = icmp eq i32 %rem9101, 0
br i1 %cmp10102, label %while.body11, label %while.cond15.preheader
while.body4: ; preds = %while.cond1.preheader, %while.body4
%a3.097 = phi i32 [ %inc5, %while.body4 ], [ 0, %while.cond1.preheader ]
%div69396 = phi i32 [ %div6, %while.body4 ], [ %a.promoted92, %while.cond1.preheader ]
%inc5 = add nuw nsw i32 %a3.097, 1
%div6 = sdiv i32 %div69396, 3
%rem2 = srem i32 %div6, 3
%cmp3 = icmp eq i32 %rem2, 0
br i1 %cmp3, label %while.body4, label %while.cond1.while.cond8.preheader_crit_edge, !llvm.loop !11
while.cond8.while.cond15.preheader_crit_edge: ; preds = %while.body11
store i32 %div13, ptr %a, align 4, !tbaa !5
br label %while.cond15.preheader
while.cond15.preheader: ; preds = %while.cond8.while.cond15.preheader_crit_edge, %while.cond8.preheader
%a5.0.lcssa = phi i32 [ %inc12, %while.cond8.while.cond15.preheader_crit_edge ], [ 0, %while.cond8.preheader ]
%.lcssa87 = phi i32 [ %div13, %while.cond8.while.cond15.preheader_crit_edge ], [ %a.promoted99, %while.cond8.preheader ]
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%2 = and i32 %b.promoted, 1
%cmp17108 = icmp eq i32 %2, 0
br i1 %cmp17108, label %while.body18, label %while.cond22.preheader
while.body11: ; preds = %while.cond8.preheader, %while.body11
%a5.0104 = phi i32 [ %inc12, %while.body11 ], [ 0, %while.cond8.preheader ]
%div13100103 = phi i32 [ %div13, %while.body11 ], [ %a.promoted99, %while.cond8.preheader ]
%inc12 = add nuw nsw i32 %a5.0104, 1
%div13 = sdiv i32 %div13100103, 5
%rem9 = srem i32 %div13, 5
%cmp10 = icmp eq i32 %rem9, 0
br i1 %cmp10, label %while.body11, label %while.cond8.while.cond15.preheader_crit_edge, !llvm.loop !12
while.cond15.while.cond22.preheader_crit_edge: ; preds = %while.body18
store i32 %div20, ptr %b, align 4, !tbaa !5
br label %while.cond22.preheader
while.cond22.preheader: ; preds = %while.cond15.while.cond22.preheader_crit_edge, %while.cond15.preheader
%b.promoted112 = phi i32 [ %div20, %while.cond15.while.cond22.preheader_crit_edge ], [ %b.promoted, %while.cond15.preheader ]
%b2.0.lcssa = phi i32 [ %inc19, %while.cond15.while.cond22.preheader_crit_edge ], [ 0, %while.cond15.preheader ]
%rem23114 = srem i32 %b.promoted112, 3
%cmp24115 = icmp eq i32 %rem23114, 0
br i1 %cmp24115, label %while.body25, label %while.cond29.preheader
while.body18: ; preds = %while.cond15.preheader, %while.body18
%b2.0110 = phi i32 [ %inc19, %while.body18 ], [ 0, %while.cond15.preheader ]
%div20107109 = phi i32 [ %div20, %while.body18 ], [ %b.promoted, %while.cond15.preheader ]
%inc19 = add nuw nsw i32 %b2.0110, 1
%div20 = sdiv i32 %div20107109, 2
%3 = and i32 %div20, 1
%cmp17 = icmp eq i32 %3, 0
br i1 %cmp17, label %while.body18, label %while.cond15.while.cond22.preheader_crit_edge, !llvm.loop !13
while.cond22.while.cond29.preheader_crit_edge: ; preds = %while.body25
store i32 %div27, ptr %b, align 4, !tbaa !5
br label %while.cond29.preheader
while.cond29.preheader: ; preds = %while.cond22.while.cond29.preheader_crit_edge, %while.cond22.preheader
%b.promoted119 = phi i32 [ %div27, %while.cond22.while.cond29.preheader_crit_edge ], [ %b.promoted112, %while.cond22.preheader ]
%b3.0.lcssa = phi i32 [ %inc26, %while.cond22.while.cond29.preheader_crit_edge ], [ 0, %while.cond22.preheader ]
%rem30121 = srem i32 %b.promoted119, 5
%cmp31122 = icmp eq i32 %rem30121, 0
br i1 %cmp31122, label %while.body32, label %while.end35
while.body25: ; preds = %while.cond22.preheader, %while.body25
%b3.0117 = phi i32 [ %inc26, %while.body25 ], [ 0, %while.cond22.preheader ]
%div27113116 = phi i32 [ %div27, %while.body25 ], [ %b.promoted112, %while.cond22.preheader ]
%inc26 = add nuw nsw i32 %b3.0117, 1
%div27 = sdiv i32 %div27113116, 3
%rem23 = srem i32 %div27, 3
%cmp24 = icmp eq i32 %rem23, 0
br i1 %cmp24, label %while.body25, label %while.cond22.while.cond29.preheader_crit_edge, !llvm.loop !14
while.body32: ; preds = %while.cond29.preheader, %while.body32
%b5.0124 = phi i32 [ %inc33, %while.body32 ], [ 0, %while.cond29.preheader ]
%div34120123 = phi i32 [ %div34, %while.body32 ], [ %b.promoted119, %while.cond29.preheader ]
%inc33 = add nuw nsw i32 %b5.0124, 1
%div34 = sdiv i32 %div34120123, 5
%rem30 = srem i32 %div34, 5
%cmp31 = icmp eq i32 %rem30, 0
br i1 %cmp31, label %while.body32, label %while.cond29.while.end35_crit_edge, !llvm.loop !15
while.cond29.while.end35_crit_edge: ; preds = %while.body32
store i32 %div34, ptr %b, align 4, !tbaa !5
br label %while.end35
while.end35: ; preds = %while.cond29.while.end35_crit_edge, %while.cond29.preheader
%b5.0.lcssa = phi i32 [ %inc33, %while.cond29.while.end35_crit_edge ], [ 0, %while.cond29.preheader ]
%.lcssa = phi i32 [ %div34, %while.cond29.while.end35_crit_edge ], [ %b.promoted119, %while.cond29.preheader ]
%cmp36.not = icmp eq i32 %.lcssa87, %.lcssa
br i1 %cmp36.not, label %if.else, label %if.then
if.then: ; preds = %while.end35
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
if.else: ; preds = %while.end35
%cmp38 = icmp ugt i32 %a2.0.lcssa, %b2.0.lcssa
%sub = sub nsw i32 %a2.0.lcssa, %b2.0.lcssa
%sub41 = sub nsw i32 %b2.0.lcssa, %a2.0.lcssa
%ans.0 = select i1 %cmp38, i32 %sub, i32 %sub41
%cmp42 = icmp ugt i32 %a3.0.lcssa, %b3.0.lcssa
%add = add nsw i32 %ans.0, %a3.0.lcssa
%sub44 = sub i32 %add, %b3.0.lcssa
%add46 = sub i32 %ans.0, %a3.0.lcssa
%sub47 = add i32 %add46, %b3.0.lcssa
%ans.1 = select i1 %cmp42, i32 %sub44, i32 %sub47
%cmp49 = icmp ugt i32 %a5.0.lcssa, %b5.0.lcssa
%add51 = add nsw i32 %ans.1, %a5.0.lcssa
%sub52 = sub i32 %add51, %b5.0.lcssa
%add54 = sub i32 %ans.1, %a5.0.lcssa
%sub55 = add i32 %add54, %b5.0.lcssa
%ans.2 = select i1 %cmp49, i32 %sub52, i32 %sub55
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.2)
br label %cleanup
cleanup: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
long long sumf(long long, long long);
int main()
{
long long n, a;
long long ans, sum;
scanf("%d", &n);
ans = sumf(1, 0) + sumf(n - 1, 0);
for (a = 2; a <= n / 2; ++a)
{
sum = sumf(a, 0) + sumf(n - a, 0);
if (ans > sum)
{
ans = sum;
}
}
printf("%d", ans);
return 0;
}
long long sumf(long long a, long long sum)
{
if (a < 10)
{
return sum + a;
}
else
{
sumf(a / 10, sum + a % 10);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163090/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163090/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp7.i = icmp sgt i64 %0, 10
br i1 %cmp7.i, label %if.else.i.preheader, label %sumf.exit
if.else.i.preheader: ; preds = %entry
%sub = add nsw i64 %0, -1
br label %if.else.i
if.else.i: ; preds = %if.else.i.preheader, %if.else.i
%sum.tr9.i = phi i64 [ %add1.i, %if.else.i ], [ 0, %if.else.i.preheader ]
%a.tr8.i = phi i64 [ %div.i, %if.else.i ], [ %sub, %if.else.i.preheader ]
%div.i = udiv i64 %a.tr8.i, 10
%rem.i = urem i64 %a.tr8.i, 10
%add1.i = add nuw nsw i64 %rem.i, %sum.tr9.i
%cmp.i = icmp ult i64 %a.tr8.i, 100
br i1 %cmp.i, label %sumf.exit.loopexit, label %if.else.i
sumf.exit.loopexit: ; preds = %if.else.i
%1 = add nuw nsw i64 %div.i, 1
br label %sumf.exit
sumf.exit: ; preds = %sumf.exit.loopexit, %entry
%a.tr.lcssa.i = phi i64 [ %0, %entry ], [ %1, %sumf.exit.loopexit ]
%sum.tr.lcssa.i = phi i64 [ 0, %entry ], [ %add1.i, %sumf.exit.loopexit ]
%2 = add i64 %a.tr.lcssa.i, %sum.tr.lcssa.i
%add = select i1 %cmp7.i, i64 undef, i64 %2
%cmp.not40 = icmp slt i64 %0, 4
br i1 %cmp.not40, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %sumf.exit
%div4344 = lshr i64 %0, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %sumf.exit39
%a.042 = phi i64 [ %inc, %sumf.exit39 ], [ 2, %for.body.preheader ]
%ans.041 = phi i64 [ %spec.select, %sumf.exit39 ], [ %add, %for.body.preheader ]
%cmp7.i14 = icmp ugt i64 %a.042, 9
br i1 %cmp7.i14, label %if.else.i19, label %sumf.exit26
if.else.i19: ; preds = %for.body, %if.else.i19
%sum.tr9.i20 = phi i64 [ %add1.i24, %if.else.i19 ], [ 0, %for.body ]
%a.tr8.i21 = phi i64 [ %div.i22, %if.else.i19 ], [ %a.042, %for.body ]
%div.i22 = udiv i64 %a.tr8.i21, 10
%rem.i23 = urem i64 %a.tr8.i21, 10
%add1.i24 = add nuw nsw i64 %rem.i23, %sum.tr9.i20
%cmp.i25 = icmp ult i64 %a.tr8.i21, 100
br i1 %cmp.i25, label %sumf.exit26, label %if.else.i19
sumf.exit26: ; preds = %if.else.i19, %for.body
%a.tr.lcssa.i15 = phi i64 [ %a.042, %for.body ], [ %div.i22, %if.else.i19 ]
%sum.tr.lcssa.i16 = phi i64 [ 0, %for.body ], [ %add1.i24, %if.else.i19 ]
%add.i17 = add nsw i64 %sum.tr.lcssa.i16, %a.tr.lcssa.i15
%current.ret.tr6.i18 = select i1 %cmp7.i14, i64 undef, i64 %add.i17
%sub4 = sub nsw i64 %0, %a.042
%cmp7.i27 = icmp sgt i64 %sub4, 9
br i1 %cmp7.i27, label %if.else.i32, label %sumf.exit39
if.else.i32: ; preds = %sumf.exit26, %if.else.i32
%sum.tr9.i33 = phi i64 [ %add1.i37, %if.else.i32 ], [ 0, %sumf.exit26 ]
%a.tr8.i34 = phi i64 [ %div.i35, %if.else.i32 ], [ %sub4, %sumf.exit26 ]
%div.i35 = udiv i64 %a.tr8.i34, 10
%rem.i36 = urem i64 %a.tr8.i34, 10
%add1.i37 = add nuw nsw i64 %rem.i36, %sum.tr9.i33
%cmp.i38 = icmp ult i64 %a.tr8.i34, 100
br i1 %cmp.i38, label %sumf.exit39, label %if.else.i32
sumf.exit39: ; preds = %if.else.i32, %sumf.exit26
%a.tr.lcssa.i28 = phi i64 [ %sub4, %sumf.exit26 ], [ %div.i35, %if.else.i32 ]
%sum.tr.lcssa.i29 = phi i64 [ 0, %sumf.exit26 ], [ %add1.i37, %if.else.i32 ]
%add.i30 = add nsw i64 %sum.tr.lcssa.i29, %a.tr.lcssa.i28
%current.ret.tr6.i31 = select i1 %cmp7.i27, i64 undef, i64 %add.i30
%add6 = add nsw i64 %current.ret.tr6.i31, %current.ret.tr6.i18
%spec.select = call i64 @llvm.smin.i64(i64 %ans.041, i64 %add6)
%inc = add nuw nsw i64 %a.042, 1
%exitcond.not = icmp eq i64 %a.042, %div4344
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %sumf.exit39, %sumf.exit
%ans.0.lcssa = phi i64 [ %add, %sumf.exit ], [ %spec.select, %sumf.exit39 ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @sumf(i64 noundef %a, i64 noundef %sum) local_unnamed_addr #3 {
entry:
%cmp7 = icmp sgt i64 %a, 9
br i1 %cmp7, label %if.else, label %if.then
if.then: ; preds = %if.else, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %div, %if.else ]
%sum.tr.lcssa = phi i64 [ %sum, %entry ], [ %add1, %if.else ]
%add = add nsw i64 %sum.tr.lcssa, %a.tr.lcssa
%current.ret.tr6 = select i1 %cmp7, i64 undef, i64 %add
ret i64 %current.ret.tr6
if.else: ; preds = %entry, %if.else
%sum.tr9 = phi i64 [ %add1, %if.else ], [ %sum, %entry ]
%a.tr8 = phi i64 [ %div, %if.else ], [ %a, %entry ]
%div = udiv i64 %a.tr8, 10
%rem = urem i64 %a.tr8, 10
%add1 = add nsw i64 %rem, %sum.tr9
%cmp = icmp ult i64 %a.tr8, 100
br i1 %cmp, label %if.then, label %if.else
}
; 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.smin.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
/*
cat <<EOF >mistaken-paste
*/
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 200000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 300000
#define M_MAX 200000
#ifdef __cplusplus
#include <queue>
#include <stack>
// #include <tuple>
#include <set>
#include <map>
// using namespace std; // HELL
using std::queue;
using std::priority_queue;
using std::stack;
// using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
ull n, m;
ull h, w;
ull k;
ull q;
ull vua, vub, vuc, vud, vue, vuf;
sll vsa, vsb, vsc, vsd, vse, vsf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
size_t slen;
size_t tlen;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (x < y) {
return gcd(y, x);
} else if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
void printUquotient (ull left, ull right) {
const int32_t digits = 20;
printf("%llu.", left / right);
left %= right;
for (int32_t i = 0; i < digits; i++) {
left *= 10;
printf("%1d", left / right);
left %= right;
}
puts("");
return;
}
void printSquotient (sll left, sll right) {
if (left * right < 0) putchar('-');
printUquotient(sdiff(left, 0), sdiff(right, 0));
return;
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#ifdef __cplusplus
bool setfind (set<ull> s, ull x) {
return (s.find(x) != s.end());
}
#endif
// double distance (sll x1, sll y1, sll x2, sll y2) {
// double xdist2, ydist2, origindist, dist;
// xdist2 = (x1 - x2) * (x1 - x2);
// ydist2 = (y1 - y2) * (y1 - y2);
// return sqrt(xdist2 + ydist2);
// }
int32_t pullcomp (const void *left, const void *right) {
ull l = *(ull*)left;
ull r = *(ull*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t psllcomp (const void *left, const void *right) {
sll l = *(sll*)left;
sll r = *(sll*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pcharcomp (const void *left, const void *right) {
char l = *(char*)left;
char r = *(char*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
int32_t phwllABcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
return 0;
}
int32_t ptriplecomp (const void *left, const void *right) {
hwllc l = *(hwllc*)left;
hwllc r = *(hwllc*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
if (l.c < r.c) {
return -1;
}
if (l.c > r.c) {
return +1;
}
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
ull parent[N_MAX];
ull rank[N_MAX];
void uf_init (ull n) {
for (sll i = 0; i < n; i++) {
parent[i] = i;
rank[i] = 0;
}
}
ull uf_find (ull x) {
if (parent[x] == x) return x;
return parent[x] = uf_find(parent[x]);
}
bool uf_union (ull a, ull b) {
a = uf_find(a);
b = uf_find(b);
if (a == b) return false;
if (rank[a] > rank[b]) {
parent[b] = a;
} else {
parent[a] = b;
if (rank[a] == rank[b]) {
rank[b]++;
}
}
return true;
}
sll a[N_MAX];
sll b[N_MAX];
sll c[N_MAX];
// char s[N_MAX];
char s[3010][3010];
ull dp[N_MAX + 1];
ull digits (ull x) {
if (!x) return 0;
return (x % 10) + digits(x / 10);
}
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
ull *dpcell;
result = BIG;
for (i = 1; i < n; i++) {
result = umin(result, digits(i) + digits(n - i));
}
printf("%lld\n", result);
// printf("%.12lf\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("Takahashi");
return 0;
fail:
// puts("NO");
puts("No");
// puts("0");
// puts("-1");
// puts("-1 -1 -1");
// puts("Aoki");
return 1;
}
int32_t main (void) {
int32_t i, j;
int32_t x, y;
// scanf("%lf%lf", &vda, &vdb, &vdc);
// scanf("%lld%lld", &vsa, &vsb, &vsc, &vsd);
// scanf("%llu%llu", &vua, &vub, &vuc, &vud);
// scanf("%*llu%*llu");
scanf("%llu", &n, &m);
// scanf("%llu", &k, &n);
// scanf("%llu%llu", &h, &w);
// scanf("%llu%llu%llu", &vua, &vub, &vuc, &vud, &vue, &vuf);
// vua--;
// vub--;
// scanf("%lld%lld", &vsa, &vsb, &vsc);
// scanf("%s", s);
// scanf("%s", t);
// scanf("%llu", &k);
// scanf("%llu", &q);
// for (i = 0; i < n; i++) {
// scanf("%lld", &a[i]);
// // scanf("%lld", &b[i]);
// // scanf("%llu", &c[i]);
// // a[i]--;
// // b[i]--;
// // c[i]--;
// }
// scanf("%llu", &q);
// for (i = 0; i < h; i++) {
// for (j = 0; j < w; j++) {
// scanf("%llu", &a[i][j]);
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", &s[i]);
// }
// scanf("%llu", &k);
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163133/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163133/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%llu.\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%1d\00", align 1
@parent = dso_local local_unnamed_addr global [300000 x i64] zeroinitializer, align 16
@rank = dso_local local_unnamed_addr global [300000 x i64] zeroinitializer, align 16
@n = dso_local global i64 0, align 8
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@m = dso_local global i64 0, align 8
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@vua = dso_local local_unnamed_addr global i64 0, align 8
@vub = dso_local local_unnamed_addr global i64 0, align 8
@vuc = dso_local local_unnamed_addr global i64 0, align 8
@vud = dso_local local_unnamed_addr global i64 0, align 8
@vue = dso_local local_unnamed_addr global i64 0, align 8
@vuf = dso_local local_unnamed_addr global i64 0, align 8
@vsa = dso_local local_unnamed_addr global i64 0, align 8
@vsb = dso_local local_unnamed_addr global i64 0, align 8
@vsc = dso_local local_unnamed_addr global i64 0, align 8
@vsd = dso_local local_unnamed_addr global i64 0, align 8
@vse = dso_local local_unnamed_addr global i64 0, align 8
@vsf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@slen = dso_local local_unnamed_addr global i64 0, align 8
@tlen = dso_local local_unnamed_addr global i64 0, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@a = dso_local local_unnamed_addr global [300000 x i64] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [300000 x i64] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [300000 x i64] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [3010 x [3010 x i8]] zeroinitializer, align 16
@dp = dso_local local_unnamed_addr global [300001 x i64] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ]
%y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ]
%cmp = icmp ult i64 %x.tr, %y.tr
br i1 %cmp, label %tailrecurse.backedge, label %if.else
if.else: ; preds = %tailrecurse
%cmp1 = icmp eq i64 %y.tr, 0
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%rem = urem i64 %x.tr, %y.tr
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.else3, %tailrecurse
%y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ]
br label %tailrecurse
return: ; preds = %if.else
ret i64 %x.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%tobool.not12 = icmp eq i64 %x, 0
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.015, %a.addr.014
%rem = urem i64 %mul, %modulo
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ]
%div11 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.014, %a.addr.014
%rem3 = urem i64 %mul2, %modulo
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%sub = add i64 %modulo, -2
%tobool.not12.i = icmp eq i64 %sub, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %entry, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, %modulo
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, %modulo
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5
bitpow.exit: ; preds = %if.end.i, %entry
%result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ]
%mul = mul i64 %result.0.lcssa.i, %a
%rem = urem i64 %mul, %modulo
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not = icmp ult i64 %a, %b
%sub = sub i64 %a, %b
%sub1 = sub i64 %b, %a
%retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %a, %b
%retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printUquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 {
entry:
%div = udiv i64 %left, %right
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div)
%left.addr.0 = urem i64 %left, %right
%mul = mul i64 %left.addr.0, 10
%div1 = udiv i64 %mul, %right
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1)
%left.addr.0.1 = urem i64 %mul, %right
%mul.1 = mul i64 %left.addr.0.1, 10
%div1.1 = udiv i64 %mul.1, %right
%call2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.1)
%left.addr.0.2 = urem i64 %mul.1, %right
%mul.2 = mul i64 %left.addr.0.2, 10
%div1.2 = udiv i64 %mul.2, %right
%call2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.2)
%left.addr.0.3 = urem i64 %mul.2, %right
%mul.3 = mul i64 %left.addr.0.3, 10
%div1.3 = udiv i64 %mul.3, %right
%call2.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.3)
%left.addr.0.4 = urem i64 %mul.3, %right
%mul.4 = mul i64 %left.addr.0.4, 10
%div1.4 = udiv i64 %mul.4, %right
%call2.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.4)
%left.addr.0.5 = urem i64 %mul.4, %right
%mul.5 = mul i64 %left.addr.0.5, 10
%div1.5 = udiv i64 %mul.5, %right
%call2.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.5)
%left.addr.0.6 = urem i64 %mul.5, %right
%mul.6 = mul i64 %left.addr.0.6, 10
%div1.6 = udiv i64 %mul.6, %right
%call2.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.6)
%left.addr.0.7 = urem i64 %mul.6, %right
%mul.7 = mul i64 %left.addr.0.7, 10
%div1.7 = udiv i64 %mul.7, %right
%call2.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.7)
%left.addr.0.8 = urem i64 %mul.7, %right
%mul.8 = mul i64 %left.addr.0.8, 10
%div1.8 = udiv i64 %mul.8, %right
%call2.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.8)
%left.addr.0.9 = urem i64 %mul.8, %right
%mul.9 = mul i64 %left.addr.0.9, 10
%div1.9 = udiv i64 %mul.9, %right
%call2.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.9)
%left.addr.0.10 = urem i64 %mul.9, %right
%mul.10 = mul i64 %left.addr.0.10, 10
%div1.10 = udiv i64 %mul.10, %right
%call2.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.10)
%left.addr.0.11 = urem i64 %mul.10, %right
%mul.11 = mul i64 %left.addr.0.11, 10
%div1.11 = udiv i64 %mul.11, %right
%call2.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.11)
%left.addr.0.12 = urem i64 %mul.11, %right
%mul.12 = mul i64 %left.addr.0.12, 10
%div1.12 = udiv i64 %mul.12, %right
%call2.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.12)
%left.addr.0.13 = urem i64 %mul.12, %right
%mul.13 = mul i64 %left.addr.0.13, 10
%div1.13 = udiv i64 %mul.13, %right
%call2.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.13)
%left.addr.0.14 = urem i64 %mul.13, %right
%mul.14 = mul i64 %left.addr.0.14, 10
%div1.14 = udiv i64 %mul.14, %right
%call2.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.14)
%left.addr.0.15 = urem i64 %mul.14, %right
%mul.15 = mul i64 %left.addr.0.15, 10
%div1.15 = udiv i64 %mul.15, %right
%call2.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.15)
%left.addr.0.16 = urem i64 %mul.15, %right
%mul.16 = mul i64 %left.addr.0.16, 10
%div1.16 = udiv i64 %mul.16, %right
%call2.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.16)
%left.addr.0.17 = urem i64 %mul.16, %right
%mul.17 = mul i64 %left.addr.0.17, 10
%div1.17 = udiv i64 %mul.17, %right
%call2.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.17)
%left.addr.0.18 = urem i64 %mul.17, %right
%mul.18 = mul i64 %left.addr.0.18, 10
%div1.18 = udiv i64 %mul.18, %right
%call2.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.18)
%left.addr.0.19 = urem i64 %mul.18, %right
%mul.19 = mul i64 %left.addr.0.19, 10
%div1.19 = udiv i64 %mul.19, %right
%call2.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.19)
%0 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %0)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @printSquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 {
entry:
%mul = mul nsw i64 %right, %left
%cmp = icmp slt i64 %mul, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i = tail call noundef i32 @putc(i32 noundef 45, ptr noundef %0)
br label %if.end
if.end: ; preds = %if.then, %entry
%retval.0.i = tail call i64 @llvm.abs.i64(i64 %left, i1 true)
%retval.0.i5 = tail call i64 @llvm.abs.i64(i64 %right, i1 true)
tail call void @printUquotient(i64 noundef %retval.0.i, i64 noundef %retval.0.i5)
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 {
entry:
%tobool.not6 = icmp eq i64 %n, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ]
%0 = trunc i64 %n.addr.07 to i32
%1 = and i32 %0, 1
%spec.select = add i32 %1, %result.08
%div5 = lshr i64 %n.addr.07, 1
%tobool.not = icmp ult i64 %n.addr.07, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !12
%1 = load i64, ptr %right, align 8, !tbaa !12
%cmp = icmp ult i64 %0, %1
%cmp1 = icmp ugt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !12
%1 = load i64, ptr %right, align 8, !tbaa !12
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i8, ptr %left, align 1, !tbaa !14
%1 = load i8, ptr %right, align 1, !tbaa !14
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp sgt i8 %0, %1
%. = zext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 {
entry:
%0 = load ptr, ptr %left, align 8, !tbaa !7
%1 = load ptr, ptr %right, align 8, !tbaa !7
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #13
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !15
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @uf_init(i64 noundef %n) local_unnamed_addr #8 {
entry:
%cmp6.not = icmp eq i64 %n, 0
br i1 %cmp6.not, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = shl nuw i64 %n, 3
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @rank, i8 0, i64 %0, i1 false), !tbaa !12
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%1 = getelementptr inbounds [300000 x i64], ptr @parent, i64 0, i64 %index
store <2 x i64> %vec.ind, ptr %1, align 16, !tbaa !12
%2 = getelementptr inbounds i64, ptr %1, i64 2
store <2 x i64> %step.add, ptr %2, align 16, !tbaa !12
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
ret void
for.body: ; preds = %for.body.preheader9, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds [300000 x i64], ptr @parent, i64 0, i64 %i.07
store i64 %i.07, ptr %arrayidx, align 8, !tbaa !12
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !21
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @uf_find(i64 noundef %x) local_unnamed_addr #9 {
entry:
%arrayidx = getelementptr inbounds [300000 x i64], ptr @parent, i64 0, i64 %x
%0 = load i64, ptr %arrayidx, align 8, !tbaa !12
%cmp = icmp eq i64 %0, %x
br i1 %cmp, label %common.ret7, label %if.end
common.ret7: ; preds = %entry, %if.end
%common.ret7.op = phi i64 [ %call, %if.end ], [ %x, %entry ]
ret i64 %common.ret7.op
if.end: ; preds = %entry
%call = tail call i64 @uf_find(i64 noundef %0)
store i64 %call, ptr %arrayidx, align 8, !tbaa !12
br label %common.ret7
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local zeroext i1 @uf_union(i64 noundef %a, i64 noundef %b) local_unnamed_addr #10 {
entry:
%call = tail call i64 @uf_find(i64 noundef %a)
%call1 = tail call i64 @uf_find(i64 noundef %b)
%cmp = icmp ne i64 %call, %call1
br i1 %cmp, label %if.end, label %return
if.end: ; preds = %entry
%arrayidx = getelementptr inbounds [300000 x i64], ptr @rank, i64 0, i64 %call
%0 = load i64, ptr %arrayidx, align 8, !tbaa !12
%arrayidx2 = getelementptr inbounds [300000 x i64], ptr @rank, i64 0, i64 %call1
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !12
%cmp3 = icmp ugt i64 %0, %1
br i1 %cmp3, label %if.then4, label %if.else
if.then4: ; preds = %if.end
%arrayidx5 = getelementptr inbounds [300000 x i64], ptr @parent, i64 0, i64 %call1
store i64 %call, ptr %arrayidx5, align 8, !tbaa !12
br label %return
if.else: ; preds = %if.end
%arrayidx6 = getelementptr inbounds [300000 x i64], ptr @parent, i64 0, i64 %call
store i64 %call1, ptr %arrayidx6, align 8, !tbaa !12
%cmp9 = icmp eq i64 %0, %1
br i1 %cmp9, label %if.then10, label %return
if.then10: ; preds = %if.else
%inc = add i64 %0, 1
store i64 %inc, ptr %arrayidx2, align 8, !tbaa !12
br label %return
return: ; preds = %if.then4, %if.then10, %if.else, %entry
ret i1 %cmp
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @digits(i64 noundef %x) local_unnamed_addr #1 {
entry:
%tobool.not3 = icmp eq i64 %x, 0
br i1 %tobool.not3, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%x.tr5 = phi i64 [ %div, %if.end ], [ %x, %entry ]
%accumulator.tr4 = phi i64 [ %add, %if.end ], [ 0, %entry ]
%rem = urem i64 %x.tr5, 10
%div = udiv i64 %x.tr5, 10
%add = add i64 %rem, %accumulator.tr4
%tobool.not = icmp ult i64 %x.tr5, 10
br i1 %tobool.not, label %return, label %if.end
return: ; preds = %if.end, %entry
%accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %if.end ]
ret i64 %accumulator.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #3 {
entry:
%0 = load i64, ptr @n, align 8, !tbaa !12
%cmp27 = icmp ugt i64 %0, 1
br i1 %cmp27, label %if.end.i.preheader, label %for.end
if.end.i.preheader: ; preds = %entry, %digits.exit26
%i.029 = phi i64 [ %inc, %digits.exit26 ], [ 1, %entry ]
%result.028 = phi i64 [ %cond.i, %digits.exit26 ], [ 2000000007, %entry ]
br label %if.end.i
if.end.i: ; preds = %if.end.i.preheader, %if.end.i
%x.tr5.i = phi i64 [ %div.i, %if.end.i ], [ %i.029, %if.end.i.preheader ]
%accumulator.tr4.i = phi i64 [ %add.i, %if.end.i ], [ 0, %if.end.i.preheader ]
%rem.i = urem i64 %x.tr5.i, 10
%div.i = udiv i64 %x.tr5.i, 10
%add.i = add i64 %rem.i, %accumulator.tr4.i
%tobool.not.i = icmp ult i64 %x.tr5.i, 10
br i1 %tobool.not.i, label %digits.exit, label %if.end.i
digits.exit: ; preds = %if.end.i
%sub = sub i64 %0, %i.029
%tobool.not3.i = icmp eq i64 %sub, 0
br i1 %tobool.not3.i, label %digits.exit26, label %if.end.i19
if.end.i19: ; preds = %digits.exit, %if.end.i19
%x.tr5.i20 = phi i64 [ %div.i23, %if.end.i19 ], [ %sub, %digits.exit ]
%accumulator.tr4.i21 = phi i64 [ %add.i24, %if.end.i19 ], [ 0, %digits.exit ]
%rem.i22 = urem i64 %x.tr5.i20, 10
%div.i23 = udiv i64 %x.tr5.i20, 10
%add.i24 = add i64 %rem.i22, %accumulator.tr4.i21
%tobool.not.i25 = icmp ult i64 %x.tr5.i20, 10
br i1 %tobool.not.i25, label %digits.exit26, label %if.end.i19
digits.exit26: ; preds = %if.end.i19, %digits.exit
%accumulator.tr.lcssa.i = phi i64 [ 0, %digits.exit ], [ %add.i24, %if.end.i19 ]
%add = add i64 %accumulator.tr.lcssa.i, %add.i
%cond.i = tail call i64 @llvm.umin.i64(i64 %result.028, i64 %add)
%inc = add nuw nsw i64 %i.029, 1
%exitcond.not = icmp eq i64 %inc, %0
br i1 %exitcond.not, label %for.end, label %if.end.i.preheader, !llvm.loop !22
for.end: ; preds = %digits.exit26, %entry
%result.0.lcssa = phi i64 [ 2000000007, %entry ], [ %cond.i, %digits.exit26 ]
%call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %result.0.lcssa)
ret i64 0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i64, ptr @n, align 8, !tbaa !12
%cmp27.i = icmp ugt i64 %0, 1
br i1 %cmp27.i, label %if.end.i.preheader.i, label %solve.exit
if.end.i.preheader.i: ; preds = %entry, %digits.exit26.i
%i.029.i = phi i64 [ %inc.i, %digits.exit26.i ], [ 1, %entry ]
%result.028.i = phi i64 [ %cond.i.i, %digits.exit26.i ], [ 2000000007, %entry ]
br label %if.end.i.i
if.end.i.i: ; preds = %if.end.i.i, %if.end.i.preheader.i
%x.tr5.i.i = phi i64 [ %div.i.i, %if.end.i.i ], [ %i.029.i, %if.end.i.preheader.i ]
%accumulator.tr4.i.i = phi i64 [ %add.i.i, %if.end.i.i ], [ 0, %if.end.i.preheader.i ]
%rem.i.i = urem i64 %x.tr5.i.i, 10
%div.i.i = udiv i64 %x.tr5.i.i, 10
%add.i.i = add i64 %rem.i.i, %accumulator.tr4.i.i
%tobool.not.i.i = icmp ult i64 %x.tr5.i.i, 10
br i1 %tobool.not.i.i, label %digits.exit.i, label %if.end.i.i
digits.exit.i: ; preds = %if.end.i.i
%sub.i = sub i64 %0, %i.029.i
%tobool.not3.i.i = icmp eq i64 %sub.i, 0
br i1 %tobool.not3.i.i, label %digits.exit26.i, label %if.end.i19.i
if.end.i19.i: ; preds = %digits.exit.i, %if.end.i19.i
%x.tr5.i20.i = phi i64 [ %div.i23.i, %if.end.i19.i ], [ %sub.i, %digits.exit.i ]
%accumulator.tr4.i21.i = phi i64 [ %add.i24.i, %if.end.i19.i ], [ 0, %digits.exit.i ]
%rem.i22.i = urem i64 %x.tr5.i20.i, 10
%div.i23.i = udiv i64 %x.tr5.i20.i, 10
%add.i24.i = add i64 %rem.i22.i, %accumulator.tr4.i21.i
%tobool.not.i25.i = icmp ult i64 %x.tr5.i20.i, 10
br i1 %tobool.not.i25.i, label %digits.exit26.i, label %if.end.i19.i
digits.exit26.i: ; preds = %if.end.i19.i, %digits.exit.i
%accumulator.tr.lcssa.i.i = phi i64 [ 0, %digits.exit.i ], [ %add.i24.i, %if.end.i19.i ]
%add.i = add i64 %accumulator.tr.lcssa.i.i, %add.i.i
%cond.i.i = tail call i64 @llvm.umin.i64(i64 %result.028.i, i64 %add.i)
%inc.i = add nuw nsw i64 %i.029.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %0
br i1 %exitcond.not.i, label %solve.exit, label %if.end.i.preheader.i, !llvm.loop !22
solve.exit: ; preds = %digits.exit26.i, %entry
%result.0.lcssa.i = phi i64 [ 2000000007, %entry ], [ %cond.i.i, %digits.exit26.i ]
%call3.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %result.0.lcssa.i)
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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(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 #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nosync nounwind memory(write, 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 #9 = { 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 #10 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{!9, !9, i64 0}
!15 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!16 = !{i64 0, i64 8, !12}
!17 = !{i64 0, i64 8, !12, i64 8, i64 8, !12, i64 16, i64 8, !12}
!18 = distinct !{!18, !6, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !6, !20, !19}
!22 = distinct !{!22, !6}
|
#include<stdio.h>
int main(){
int N,x;
scanf("%d",&N);
if(400<=N && N<600){
x = 8;
}else if(600<=N && N<800){
x = 7;
}else if(800<=N && N<1000){
x = 6;
}else if(1000<=N && N<1200){
x = 5;
}else if(1200<=N && N<1400){
x = 4;
}else if(1400<=N && N<1600){
x = 3;
}else if(1600<=N && N<1800){
x = 2;
}else if(1800<=N && N<2000){
x = 1;
}
printf("%d\n",x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163184/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163184/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4
%1 = add i32 %0, -400
%or.cond = icmp ult i32 %1, 200
br i1 %or.cond, label %if.end42, label %if.else
if.else: ; preds = %entry
%2 = add i32 %0, -600
%or.cond44 = icmp ult i32 %2, 200
br i1 %or.cond44, label %if.end42, label %if.else6
if.else6: ; preds = %if.else
%3 = add i32 %0, -800
%or.cond45 = icmp ult i32 %3, 200
br i1 %or.cond45, label %if.end42, label %if.else11
if.else11: ; preds = %if.else6
%4 = add i32 %0, -1000
%or.cond46 = icmp ult i32 %4, 200
br i1 %or.cond46, label %if.end42, label %if.else16
if.else16: ; preds = %if.else11
%5 = add i32 %0, -1200
%or.cond47 = icmp ult i32 %5, 200
br i1 %or.cond47, label %if.end42, label %if.else21
if.else21: ; preds = %if.else16
%6 = add i32 %0, -1400
%or.cond48 = icmp ult i32 %6, 200
br i1 %or.cond48, label %if.end42, label %if.else26
if.else26: ; preds = %if.else21
%7 = add i32 %0, -1600
%or.cond49 = icmp ult i32 %7, 200
%spec.select = select i1 %or.cond49, i32 2, i32 1
br label %if.end42
if.end42: ; preds = %if.else26, %if.else21, %if.else16, %if.else11, %if.else6, %if.else, %entry
%x.0 = phi i32 [ 8, %entry ], [ 7, %if.else ], [ 6, %if.else6 ], [ 5, %if.else11 ], [ 4, %if.else16 ], [ 3, %if.else21 ], [ %spec.select, %if.else26 ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.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)"}
|
#include<stdio.h>
int main(void){
int x;
scanf("%d",&x);
if(x>= 400 && x<=599){
printf("%d",8);
}
else if(x>=600 && x<=799){
printf("%d",7);
}
else if(x>=800 && x<=999){
printf("%d",6);
}
else if(x>=1000 && x<=1199){
printf("%d",5);
}
else if(x>=1200 && x<=1399){
printf("%d",4);
}
else if(x>=1400 && x<=1599){
printf("%d",3);
}
else if(x>=1600 && x<=1799){
printf("%d",2);
}
else if(x>=1800 && x<=1999){
printf("%d",1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163227/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163227/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #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, -400
%or.cond = icmp ult i32 %1, 200
br i1 %or.cond, label %if.end50.sink.split, label %if.else
if.else: ; preds = %entry
%2 = add i32 %0, -600
%or.cond51 = icmp ult i32 %2, 200
br i1 %or.cond51, label %if.end50.sink.split, label %if.else8
if.else8: ; preds = %if.else
%3 = add i32 %0, -800
%or.cond52 = icmp ult i32 %3, 200
br i1 %or.cond52, label %if.end50.sink.split, label %if.else14
if.else14: ; preds = %if.else8
%4 = add i32 %0, -1000
%or.cond53 = icmp ult i32 %4, 200
br i1 %or.cond53, label %if.end50.sink.split, label %if.else20
if.else20: ; preds = %if.else14
%5 = add i32 %0, -1200
%or.cond54 = icmp ult i32 %5, 200
br i1 %or.cond54, label %if.end50.sink.split, label %if.else26
if.else26: ; preds = %if.else20
%6 = add i32 %0, -1400
%or.cond55 = icmp ult i32 %6, 200
br i1 %or.cond55, label %if.end50.sink.split, label %if.else32
if.else32: ; preds = %if.else26
%7 = add i32 %0, -1600
%or.cond56 = icmp ult i32 %7, 200
br i1 %or.cond56, label %if.end50.sink.split, label %if.else38
if.else38: ; preds = %if.else32
%8 = add i32 %0, -1800
%or.cond57 = icmp ult i32 %8, 200
br i1 %or.cond57, label %if.end50.sink.split, label %if.end50
if.end50.sink.split: ; preds = %if.else38, %if.else32, %if.else26, %if.else20, %if.else14, %if.else8, %if.else, %entry
%.sink = phi i32 [ 8, %entry ], [ 7, %if.else ], [ 6, %if.else8 ], [ 5, %if.else14 ], [ 4, %if.else20 ], [ 3, %if.else26 ], [ 2, %if.else32 ], [ 1, %if.else38 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.sink)
br label %if.end50
if.end50: ; preds = %if.end50.sink.split, %if.else38
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<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007
//#define DEBUG
//qsort用、昇順
int compare_int(const void *a, const void *b)
{
return *(int*)a-*(int*)b;
}
//qsort(array, 10, sizeof(int), compare_int)
int main(){
int x, r;
scanf("%d", &x);
r = 8;
r = r - (x-400)/200;
printf("%d\n", r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163270/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163270/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%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
%sub = add nsw i32 %0, -400
%div.neg = sdiv i32 %sub, -200
%sub1 = add nsw i32 %div.neg, 8
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int abs(int n)
{
if (n < 0)
n *= -1;
return n;
}
int main()
{
int n, z, w;
scanf("%d %d %d", &n, &z, &w);
int i, j, k;
int a[2003];
for (i = 0; i < n; i++)
scanf("%d", &a[n - i - 1]);
a[n] = w;
int dp[2][2003];
dp[0][0] = dp[1][0] = abs(a[0] - a[1]);
for (i = 1; i < n; i++)
{
k = abs(a[i + 1] - a[0]);
for (j = 0; j < i; j++)
if (k < dp[1][j])
k = dp[1][j];
dp[0][i] = k;
k = abs(a[i + 1] - a[0]);
for (j = 0; j < i; j++)
if (k > dp[0][j])
k = dp[0][j];
dp[1][i] = k;
}
printf("%d\n", dp[0][n - 1]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163320/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163320/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @abs(i32 noundef %n) local_unnamed_addr #0 {
entry:
%spec.select = tail call i32 @llvm.abs.i32(i32 %n, i1 true)
ret i32 %spec.select
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%z = alloca i32, align 4
%w = alloca i32, align 4
%a = alloca [2003 x i32], align 16
%dp = alloca [2 x [2003 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %z, ptr noundef nonnull %w)
call void @llvm.lifetime.start.p0(i64 8012, ptr nonnull %a) #6
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp90 = icmp sgt i32 %0, 0
br i1 %cmp90, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%1 = phi i32 [ %3, %for.body ], [ %0, %entry ]
%i.091 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%2 = xor i32 %i.091, -1
%sub1 = add i32 %1, %2
%idxprom = sext i32 %sub1 to i64
%arrayidx = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 %idxprom
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i32 %i.091, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
%4 = load i32, ptr %w, align 4, !tbaa !5
%idxprom3 = sext i32 %.lcssa to i64
%arrayidx4 = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 %idxprom3
store i32 %4, ptr %arrayidx4, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 16024, ptr nonnull %dp) #6
%5 = load i32, ptr %a, align 16, !tbaa !5
%arrayidx6 = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 1
%6 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub7 = sub nsw i32 %5, %6
%7 = call i32 @llvm.abs.i32(i32 %sub7, i1 true)
%arrayidx8 = getelementptr inbounds [2 x [2003 x i32]], ptr %dp, i64 0, i64 1
store i32 %7, ptr %arrayidx8, align 4, !tbaa !5
store i32 %7, ptr %dp, align 16, !tbaa !5
%cmp1396 = icmp sgt i32 %.lcssa, 1
br i1 %cmp1396, label %for.body14.preheader, label %for.end60
for.body14.preheader: ; preds = %for.end
%wide.trip.count108 = zext i32 %.lcssa to i64
br label %for.body14
for.body14: ; preds = %for.body14.preheader, %for.end54
%indvars.iv105 = phi i64 [ 1, %for.body14.preheader ], [ %indvars.iv.next106, %for.end54 ]
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%arrayidx16 = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 %indvars.iv.next106
%8 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%sub18 = sub nsw i32 %8, %5
%9 = call i32 @llvm.abs.i32(i32 %sub18, i1 true)
%min.iters.check116 = icmp ult i64 %indvars.iv105, 8
br i1 %min.iters.check116, label %for.body21.preheader, label %vector.ph117
vector.ph117: ; preds = %for.body14
%n.vec119 = and i64 %indvars.iv105, 9223372036854775800
%minmax.ident.splatinsert126 = insertelement <4 x i32> poison, i32 %9, i64 0
%minmax.ident.splat127 = shufflevector <4 x i32> %minmax.ident.splatinsert126, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body122
vector.body122: ; preds = %vector.body122, %vector.ph117
%index123 = phi i64 [ 0, %vector.ph117 ], [ %index.next130, %vector.body122 ]
%vec.phi124 = phi <4 x i32> [ %minmax.ident.splat127, %vector.ph117 ], [ %12, %vector.body122 ]
%vec.phi125 = phi <4 x i32> [ %minmax.ident.splat127, %vector.ph117 ], [ %13, %vector.body122 ]
%10 = getelementptr inbounds [2 x [2003 x i32]], ptr %dp, i64 0, i64 1, i64 %index123
%wide.load128 = load <4 x i32>, ptr %10, align 4, !tbaa !5
%11 = getelementptr inbounds i32, ptr %10, i64 4
%wide.load129 = load <4 x i32>, ptr %11, align 4, !tbaa !5
%12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi124, <4 x i32> %wide.load128)
%13 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi125, <4 x i32> %wide.load129)
%index.next130 = add nuw i64 %index123, 8
%14 = icmp eq i64 %index.next130, %n.vec119
br i1 %14, label %middle.block114, label %vector.body122, !llvm.loop !11
middle.block114: ; preds = %vector.body122
%rdx.minmax131 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %12, <4 x i32> %13)
%15 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax131)
%cmp.n121 = icmp eq i64 %indvars.iv105, %n.vec119
br i1 %cmp.n121, label %for.end31, label %for.body21.preheader
for.body21.preheader: ; preds = %for.body14, %middle.block114
%indvars.iv.ph = phi i64 [ 0, %for.body14 ], [ %n.vec119, %middle.block114 ]
%k.093.ph = phi i32 [ %9, %for.body14 ], [ %15, %middle.block114 ]
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body21 ], [ %indvars.iv.ph, %for.body21.preheader ]
%k.093 = phi i32 [ %spec.select, %for.body21 ], [ %k.093.ph, %for.body21.preheader ]
%arrayidx24 = getelementptr inbounds [2 x [2003 x i32]], ptr %dp, i64 0, i64 1, i64 %indvars.iv
%16 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %k.093, i32 %16)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv105
br i1 %exitcond.not, label %for.end31, label %for.body21, !llvm.loop !14
for.end31: ; preds = %for.body21, %middle.block114
%spec.select.lcssa = phi i32 [ %15, %middle.block114 ], [ %spec.select, %for.body21 ]
%arrayidx34 = getelementptr inbounds [2003 x i32], ptr %dp, i64 0, i64 %indvars.iv105
store i32 %spec.select.lcssa, ptr %arrayidx34, align 4, !tbaa !5
%min.iters.check = icmp ult i64 %indvars.iv105, 8
br i1 %min.iters.check, label %for.body42.preheader, label %vector.ph
vector.ph: ; preds = %for.end31
%n.vec = and i64 %indvars.iv105, 9223372036854775800
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %9, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %19, %vector.body ]
%vec.phi112 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %20, %vector.body ]
%17 = getelementptr inbounds [2003 x i32], ptr %dp, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %17, align 16, !tbaa !5
%18 = getelementptr inbounds i32, ptr %17, i64 4
%wide.load113 = load <4 x i32>, ptr %18, align 16, !tbaa !5
%19 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%20 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi112, <4 x i32> %wide.load113)
%index.next = add nuw i64 %index, 8
%21 = icmp eq i64 %index.next, %n.vec
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %19, <4 x i32> %20)
%22 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %indvars.iv105, %n.vec
br i1 %cmp.n, label %for.end54, label %for.body42.preheader
for.body42.preheader: ; preds = %for.end31, %middle.block
%indvars.iv100.ph = phi i64 [ 0, %for.end31 ], [ %n.vec, %middle.block ]
%k.295.ph = phi i32 [ %9, %for.end31 ], [ %22, %middle.block ]
br label %for.body42
for.body42: ; preds = %for.body42.preheader, %for.body42
%indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body42 ], [ %indvars.iv100.ph, %for.body42.preheader ]
%k.295 = phi i32 [ %spec.select89, %for.body42 ], [ %k.295.ph, %for.body42.preheader ]
%arrayidx45 = getelementptr inbounds [2003 x i32], ptr %dp, i64 0, i64 %indvars.iv100
%23 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%spec.select89 = call i32 @llvm.smin.i32(i32 %k.295, i32 %23)
%indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
%exitcond104.not = icmp eq i64 %indvars.iv.next101, %indvars.iv105
br i1 %exitcond104.not, label %for.end54, label %for.body42, !llvm.loop !16
for.end54: ; preds = %for.body42, %middle.block
%spec.select89.lcssa = phi i32 [ %22, %middle.block ], [ %spec.select89, %for.body42 ]
%arrayidx57 = getelementptr inbounds [2 x [2003 x i32]], ptr %dp, i64 0, i64 1, i64 %indvars.iv105
store i32 %spec.select89.lcssa, ptr %arrayidx57, align 4, !tbaa !5
%exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108
br i1 %exitcond109.not, label %for.end60, label %for.body14, !llvm.loop !17
for.end60: ; preds = %for.end54, %for.end
%sub62 = add nsw i32 %.lcssa, -1
%idxprom63 = sext i32 %sub62 to i64
%arrayidx64 = getelementptr inbounds [2003 x i32], ptr %dp, i64 0, i64 %idxprom63
%24 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24)
call void @llvm.lifetime.end.p0(i64 16024, ptr nonnull %dp) #6
call void @llvm.lifetime.end.p0(i64 8012, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10, !12, !13}
!16 = distinct !{!16, !10, !13, !12}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
int main(){
int n,sum = 0;
scanf("%d",&n);
for(int i=1;i<=n;i++){
sum += i;
}
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163364/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163364/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not5 = icmp slt i32 %0, 1
br i1 %cmp.not5, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = shl nuw i32 %0, 1
%2 = add nsw i32 %0, -1
%3 = zext i32 %2 to i33
%4 = add nsw i32 %0, -2
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %1, %8
%10 = add i32 %9, -1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %10, %for.body.preheader ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,sum=0;
scanf("%d",&n);
for(int i=0;i<=n;i++)
{
sum = sum+i;
}
printf("%d\n",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163407/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163407/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not5 = icmp slt i32 %0, 0
br i1 %cmp.not5, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = zext i32 %0 to i33
%2 = add nsw i32 %0, -1
%3 = zext i32 %2 to i33
%4 = mul i33 %1, %3
%5 = lshr i33 %4, 1
%6 = trunc i33 %5 to i32
%7 = add i32 %0, %6
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %7, %for.body.preheader ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
printf("%d",n*(n+1)/2);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163450/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163450/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%add = add nsw i32 %0, 1
%mul = mul nsw i32 %add, %0
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div)
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 n,a,i;
scanf("%d",&n);
a=0;
for (i=1;i<=n;i++){
a=a+i;
}
printf("%d\n",a);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163494/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163494/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not5 = icmp slt i32 %0, 1
br i1 %cmp.not5, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = shl nuw i32 %0, 1
%2 = add nsw i32 %0, -1
%3 = zext i32 %2 to i33
%4 = add nsw i32 %0, -2
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %1, %8
%10 = add i32 %9, -1
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%a.0.lcssa = phi i32 [ 0, %entry ], [ %10, %for.body.preheader ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa)
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 n;scanf("%d",&n);
int ans;
if(n%2 == 0)
ans = ((n/2)*2+1)*n/2;
else
ans = (n/2+1)*n;
printf("%d",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163537/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163537/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
%div = sdiv i32 %0, 2
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = shl nsw i32 %div, 1
%add = or i32 %mul, 1
%mul1 = mul nsw i32 %add, %0
%div2 = sdiv i32 %mul1, 2
br label %if.end
if.else: ; preds = %entry
%add4 = add nsw i32 %div, 1
%mul5 = mul nsw i32 %add4, %0
br label %if.end
if.end: ; preds = %if.else, %if.then
%ans.0 = phi i32 [ %div2, %if.then ], [ %mul5, %if.else ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.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 a,b,c=0,i;
scanf("%d",&a);
for(i=1;i<=a;i++) {
c=c+i;}
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163580/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163580/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #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.not5 = icmp slt i32 %0, 1
br i1 %cmp.not5, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = shl nuw i32 %0, 1
%2 = add nsw i32 %0, -1
%3 = zext i32 %2 to i33
%4 = add nsw i32 %0, -2
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %1, %8
%10 = add i32 %9, -1
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%c.0.lcssa = phi i32 [ 0, %entry ], [ %10, %for.body.preheader ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int sum;
sum=(n*(n+1))/2;
printf("%d",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163623/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163623/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%add = add nsw i32 %0, 1
%mul = mul nsw i32 %add, %0
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div)
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 children,i,candy;
char str[4];
fgets(str,sizeof(str),stdin);
sscanf(str,"%d",&children);
for(i=1;i<=children;i++)
{
candy += i;
}
printf("%d",candy);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163667/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163667/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%children = alloca i32, align 4
%str = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %children) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %str) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 4, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %str, ptr noundef nonnull @.str, ptr noundef nonnull %children) #4
%1 = load i32, ptr %children, align 4, !tbaa !9
%cmp.not7 = icmp sgt i32 %1, 0
call void @llvm.assume(i1 %cmp.not7)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef undef)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %str) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %children) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
#define MAX 100
int main()
{
int n, a[MAX],i,m,x,y;
scanf("%d",&n);
for(i=0; i<n; i++)
scanf("%d",&a[i]);
scanf("%d",&m);
for(i=0; i<m; i++)
{
scanf("%d%d",&x,&y);
if (x!=1 && x!=n)
{
a[x-2] += y-1;
a[x] += a[x-1] -y;
a[x-1] = 0;
}
else if (x==1)
{
a[x] += a[x-1] - y;
a[x-1] = 0;
}
else
{
a[x-2] += y-1;
a[x-1] = 0;
}
}
for(i=0; i<n; i++)
printf("%d\n",a[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16371/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16371/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [100 x i32], align 16
%m = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp467 = icmp sgt i32 %3, 0
br i1 %cmp467, label %for.body5.lr.ph, label %for.end.for.cond47.preheader_crit_edge
for.end.for.cond47.preheader_crit_edge: ; preds = %for.end
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond47.preheader
for.body5.lr.ph: ; preds = %for.end
%arrayidx29 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 1
br label %for.body5
for.cond47.preheader: ; preds = %for.inc44, %for.end.for.cond47.preheader_crit_edge
%4 = phi i32 [ %.pre, %for.end.for.cond47.preheader_crit_edge ], [ %6, %for.inc44 ]
%cmp4869 = icmp sgt i32 %4, 0
br i1 %cmp4869, label %for.body49, label %for.end55
for.body5: ; preds = %for.body5.lr.ph, %for.inc44
%i.168 = phi i32 [ 0, %for.body5.lr.ph ], [ %inc45, %for.inc44 ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%5 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not = icmp eq i32 %5, 1
%6 = load i32, ptr %n, align 4
%cmp8.not = icmp eq i32 %5, %6
%or.cond = select i1 %cmp7.not, i1 true, i1 %cmp8.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %for.body5
%7 = load i32, ptr %y, align 4, !tbaa !5
%sub = add nsw i32 %7, -1
%sub9 = add nsw i32 %5, -2
%idxprom10 = sext i32 %sub9 to i64
%arrayidx11 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom10
%8 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%add = add nsw i32 %sub, %8
store i32 %add, ptr %arrayidx11, align 4, !tbaa !5
%sub12 = add nsw i32 %5, -1
%idxprom13 = sext i32 %sub12 to i64
%arrayidx14 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom13
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%sub15 = sub i32 %9, %7
%idxprom16 = sext i32 %5 to i64
%arrayidx17 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom16
%10 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%add18 = add nsw i32 %sub15, %10
store i32 %add18, ptr %arrayidx17, align 4, !tbaa !5
store i32 0, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc44
if.else: ; preds = %for.body5
br i1 %cmp7.not, label %if.then23, label %if.else34
if.then23: ; preds = %if.else
%11 = load i32, ptr %a, align 16, !tbaa !5
%12 = load i32, ptr %y, align 4, !tbaa !5
%sub27 = sub i32 %11, %12
%13 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%add30 = add nsw i32 %sub27, %13
store i32 %add30, ptr %arrayidx29, align 4, !tbaa !5
store i32 0, ptr %a, align 16, !tbaa !5
br label %for.inc44
if.else34: ; preds = %if.else
%14 = load i32, ptr %y, align 4, !tbaa !5
%sub35 = add nsw i32 %14, -1
%sub36 = add nsw i32 %5, -2
%idxprom37 = sext i32 %sub36 to i64
%arrayidx38 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom37
%15 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%add39 = add nsw i32 %sub35, %15
store i32 %add39, ptr %arrayidx38, align 4, !tbaa !5
%sub40 = add nsw i32 %5, -1
%idxprom41 = sext i32 %sub40 to i64
%arrayidx42 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom41
store i32 0, ptr %arrayidx42, align 4, !tbaa !5
br label %for.inc44
for.inc44: ; preds = %if.then, %if.else34, %if.then23
%inc45 = add nuw nsw i32 %i.168, 1
%16 = load i32, ptr %m, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc45, %16
br i1 %cmp4, label %for.body5, label %for.cond47.preheader, !llvm.loop !11
for.body49: ; preds = %for.cond47.preheader, %for.body49
%indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body49 ], [ 0, %for.cond47.preheader ]
%arrayidx51 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv72
%17 = load i32, ptr %arrayidx51, align 4, !tbaa !5
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp48 = icmp slt i64 %indvars.iv.next73, %19
br i1 %cmp48, label %for.body49, label %for.end55, !llvm.loop !12
for.end55: ; preds = %for.body49, %for.cond47.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
printf("%d\n", n*(n + 1) / 2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163753/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163753/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%mul = mul nsw i32 %add, %0
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 func(int a)
{
if (a == 1)
{
return 1;
}
else {
return func(a - 1)+a;
}
}
int main()
{
int num, ans;
//階乗を求める
scanf("%d", &num);
ans = func(num);
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163797/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163797/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @func(i32 noundef %a) local_unnamed_addr #0 {
entry:
%cmp3 = icmp eq i32 %a, 1
br i1 %cmp3, label %return, label %if.else.preheader
if.else.preheader: ; preds = %entry
%0 = add i32 %a, -1
%1 = add i32 %a, -2
%2 = mul i32 %0, %1
%3 = zext i32 %1 to i33
%4 = add i32 %a, -3
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %2, %a
%10 = sub i32 %9, %8
%11 = add nsw i32 %10, 1
br label %return
return: ; preds = %if.else.preheader, %entry
%accumulator.tr.lcssa = phi i32 [ 1, %entry ], [ %11, %if.else.preheader ]
ret i32 %accumulator.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
%cmp3.i = icmp eq i32 %0, 1
br i1 %cmp3.i, label %func.exit, label %if.else.preheader.i
if.else.preheader.i: ; preds = %entry
%1 = add i32 %0, -1
%2 = add i32 %0, -2
%3 = mul i32 %1, %2
%4 = zext i32 %2 to i33
%5 = add i32 %0, -3
%6 = zext i32 %5 to i33
%7 = mul i33 %4, %6
%8 = lshr i33 %7, 1
%9 = trunc i33 %8 to i32
%10 = add i32 %0, 1
%11 = add i32 %10, %3
%12 = sub i32 %11, %9
br label %func.exit
func.exit: ; preds = %entry, %if.else.preheader.i
%accumulator.tr.lcssa.i = phi i32 [ 1, %entry ], [ %12, %if.else.preheader.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %accumulator.tr.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int count=0;
void countday(int,int);
int main()
{
char a[100];
char b[100];
scanf("%s",a);
scanf("%s",b);
int day1,day2,month1,month2,year1,year2,day11,month11,year11,year,month,day,t;
year1=(a[0]-48)*1000+(a[1]-48)*100+(a[2]-48)*10+(a[3]-48);
year2=(b[0]-48)*1000+(b[1]-48)*100+(b[2]-48)*10+(b[3]-48);
month1=(a[5]-48)*10+a[6]-48;
month2=(b[5]-48)*10+b[6]-48;
day1=(a[8]-48)*10+a[9]-48;
day2=(b[8]-48)*10+b[9]-48;
long s=0;
if(year1>year2 || ( year1==year2 && month1>month2 ) || (year1==year2 && month1==month2 && day1>day2))
{
t=day1;
day1=day2;
day2=t;
t=month1;
month1=month2;
month2=t;
t=year1;
year1=year2;
year2=t;
}
/*printf("Enter the privous date (DD) \n");
scanf("%d",&day1);
printf("Enter the privous month (MM) \n");
scanf("%d",&month1);
printf("Enter the privous year,for not being ambiguous input plz enter in YYYY format,else it will be a y2k bug\n");
scanf("%d",&year1);
printf("Enter the later date (DD)\n");
scanf("%d",&day2);
printf("Enter the later month (DD)\n");
scanf("%d",&month2);
printf("Enter the later year,for not being ambiguous input plz enter in YYYY format,else it will be a y2k bug\n");
scanf("%d",&year2);*/
day11=day1;
month11=month1;
year11=year1;
for(year=year11;year<=year2;year++)
{
for(month=month11;month<=12;month++)
{
if(year==year2 && month==month2)
{
countday(day11,day2);
break;
}
else
{
if(month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12) //These are the months having 31 days
{
countday(day11,31);
}
else if(month==4 || month==6 || month==9 || month==11) //These are the months having 30 days
{
countday(day11,30);
}
else if(month==2) //This is for february only
{
if((year%400==0) || (year%4==0 && year%100!=0)) //This is for checking a leap year
{
countday(day11,29);
}
else
{
countday(day11,28);
}
}
day11=1;
}
}
month11=1;
}
printf("%d\n",(count-1));
return 0;
}
//This function will start from the previous date and keep on counting each day as long as it come to the later date.
void countday(int ddin, int ddfnl)
{
int i;
for(i=ddin;i<=ddfnl;i++)
{
count++;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16384/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16384/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@count = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@switch.table.main.2 = private unnamed_addr constant [12 x i32] [i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [100 x i8], align 16
%b = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %a, align 16, !tbaa !5
%conv = sext i8 %0 to i32
%1 = mul nsw i32 %conv, 1000
%arrayidx3 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 1
%2 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%conv4 = sext i8 %2 to i32
%3 = mul nsw i32 %conv4, 100
%mul6 = add nsw i32 %3, %1
%arrayidx7 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 2
%4 = load i8, ptr %arrayidx7, align 2, !tbaa !5
%conv8 = sext i8 %4 to i32
%5 = mul nsw i32 %conv8, 10
%mul10 = add nsw i32 %mul6, %5
%arrayidx12 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 3
%6 = load i8, ptr %arrayidx12, align 1, !tbaa !5
%conv13 = sext i8 %6 to i32
%sub14 = add nsw i32 %mul10, %conv13
%add15 = add nsw i32 %sub14, -53328
%7 = load i8, ptr %b, align 16, !tbaa !5
%conv17 = sext i8 %7 to i32
%8 = mul nsw i32 %conv17, 1000
%arrayidx20 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 1
%9 = load i8, ptr %arrayidx20, align 1, !tbaa !5
%conv21 = sext i8 %9 to i32
%10 = mul nsw i32 %conv21, 100
%mul23 = add nsw i32 %10, %8
%arrayidx25 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 2
%11 = load i8, ptr %arrayidx25, align 2, !tbaa !5
%conv26 = sext i8 %11 to i32
%12 = mul nsw i32 %conv26, 10
%mul28 = add nsw i32 %mul23, %12
%arrayidx30 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 3
%13 = load i8, ptr %arrayidx30, align 1, !tbaa !5
%conv31 = sext i8 %13 to i32
%sub32 = add nsw i32 %mul28, %conv31
%add33 = add nsw i32 %sub32, -53328
%arrayidx34 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 5
%14 = load i8, ptr %arrayidx34, align 1, !tbaa !5
%conv35 = sext i8 %14 to i32
%15 = mul nsw i32 %conv35, 10
%mul37 = add nsw i32 %15, -480
%arrayidx38 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 6
%16 = load i8, ptr %arrayidx38, align 2, !tbaa !5
%conv39 = sext i8 %16 to i32
%add40 = add nsw i32 %mul37, %conv39
%sub41 = add nsw i32 %add40, -48
%arrayidx42 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 5
%17 = load i8, ptr %arrayidx42, align 1, !tbaa !5
%conv43 = sext i8 %17 to i32
%18 = mul nsw i32 %conv43, 10
%mul45 = add nsw i32 %18, -480
%arrayidx46 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 6
%19 = load i8, ptr %arrayidx46, align 2, !tbaa !5
%conv47 = sext i8 %19 to i32
%add48 = add nsw i32 %mul45, %conv47
%sub49 = add nsw i32 %add48, -48
%arrayidx50 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 8
%20 = load i8, ptr %arrayidx50, align 8, !tbaa !5
%conv51 = sext i8 %20 to i32
%21 = mul nsw i32 %conv51, 10
%mul53 = add nsw i32 %21, -480
%arrayidx54 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 9
%22 = load i8, ptr %arrayidx54, align 1, !tbaa !5
%conv55 = sext i8 %22 to i32
%add56 = add nsw i32 %mul53, %conv55
%sub57 = add nsw i32 %add56, -48
%arrayidx58 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 8
%23 = load i8, ptr %arrayidx58, align 8, !tbaa !5
%conv59 = sext i8 %23 to i32
%24 = mul nsw i32 %conv59, 10
%mul61 = add nsw i32 %24, -480
%arrayidx62 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 9
%25 = load i8, ptr %arrayidx62, align 1, !tbaa !5
%conv63 = sext i8 %25 to i32
%add64 = add nsw i32 %mul61, %conv63
%sub65 = add nsw i32 %add64, -48
%cmp = icmp sgt i32 %sub14, %sub32
br i1 %cmp, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%cmp67 = icmp eq i32 %sub14, %sub32
%cmp69 = icmp sgt i32 %add40, %add48
%or.cond204 = select i1 %cmp67, i1 %cmp69, i1 false
br i1 %or.cond204, label %if.then, label %lor.lhs.false71
lor.lhs.false71: ; preds = %lor.lhs.false
%cmp75 = icmp eq i32 %add40, %add48
%or.cond205 = select i1 %cmp67, i1 %cmp75, i1 false
%cmp78 = icmp sgt i32 %add56, %add64
%or.cond206 = select i1 %or.cond205, i1 %cmp78, i1 false
br i1 %or.cond206, label %if.then, label %if.end
if.then: ; preds = %lor.lhs.false71, %lor.lhs.false, %entry
br label %if.end
if.end: ; preds = %if.then, %lor.lhs.false71
%year1.0 = phi i32 [ %add33, %if.then ], [ %add15, %lor.lhs.false71 ]
%year2.0 = phi i32 [ %add15, %if.then ], [ %add33, %lor.lhs.false71 ]
%month2.0 = phi i32 [ %sub41, %if.then ], [ %sub49, %lor.lhs.false71 ]
%month1.0 = phi i32 [ %sub49, %if.then ], [ %sub41, %lor.lhs.false71 ]
%day2.0 = phi i32 [ %sub57, %if.then ], [ %sub65, %lor.lhs.false71 ]
%day1.0 = phi i32 [ %sub65, %if.then ], [ %sub57, %lor.lhs.false71 ]
%year1.0.fr = freeze i32 %year1.0
%cmp80.not266 = icmp sgt i32 %year1.0.fr, %year2.0
%.pre = load i32, ptr @count, align 4, !tbaa !8
br i1 %cmp80.not266, label %for.end149, label %for.cond82.preheader.lr.ph
for.cond82.preheader.lr.ph: ; preds = %if.end
%26 = add nsw i32 %day2.0, 1
br label %for.cond82.preheader
for.cond82.preheader: ; preds = %for.cond82.preheader.lr.ph, %for.end
%27 = phi i32 [ %.pre, %for.cond82.preheader.lr.ph ], [ %104, %for.end ]
%year.0269 = phi i32 [ %year1.0.fr, %for.cond82.preheader.lr.ph ], [ %inc148, %for.end ]
%month11.0268 = phi i32 [ %month1.0, %for.cond82.preheader.lr.ph ], [ 1, %for.end ]
%day11.0267 = phi i32 [ %day1.0, %for.cond82.preheader.lr.ph ], [ %day11.1226, %for.end ]
%28 = phi i32 [ %.pre, %for.cond82.preheader.lr.ph ], [ %105, %for.end ]
%day11.1.neg227 = sub nsw i32 0, %day11.0267
%cmp83228 = icmp slt i32 %month11.0268, 13
br i1 %cmp83228, label %for.body85.lr.ph, label %for.end
for.body85.lr.ph: ; preds = %for.cond82.preheader
%cmp86 = icmp eq i32 %year.0269, %year2.0
%cmp86.fr = freeze i1 %cmp86
%rem = srem i32 %year.0269, 400
%cmp130 = icmp eq i32 %rem, 0
%29 = and i32 %year.0269, 3
%cmp134 = icmp ne i32 %29, 0
%rem137 = srem i32 %year.0269, 100
%cmp138.not = icmp eq i32 %rem137, 0
%or.cond = or i1 %cmp134, %cmp138.not
br i1 %cmp130, label %for.body85.lr.ph.split.us, label %for.body85.lr.ph.split
for.body85.lr.ph.split.us: ; preds = %for.body85.lr.ph
br i1 %cmp86.fr, label %for.body85.us.preheader, label %for.body85.us.us.preheader
for.body85.us.us.preheader: ; preds = %for.body85.lr.ph.split.us
switch i32 %month11.0268, label %if.end145.us.us.peel [
i32 12, label %if.then112.us.us.peel
i32 10, label %if.then112.us.us.peel
i32 8, label %if.then112.us.us.peel
i32 7, label %if.then112.us.us.peel
i32 5, label %if.then112.us.us.peel
i32 3, label %if.then112.us.us.peel
i32 1, label %if.then112.us.us.peel
i32 11, label %if.then125.us.us.peel
i32 9, label %if.then125.us.us.peel
i32 6, label %if.then125.us.us.peel
i32 4, label %if.then125.us.us.peel
i32 2, label %if.then129.us.us.peel
]
if.then129.us.us.peel: ; preds = %for.body85.us.us.preheader
%cmp.not4.i216.us.us.peel = icmp sgt i32 %day11.0267, 29
br i1 %cmp.not4.i216.us.us.peel, label %if.end145.us.us.peel.thread, label %if.end145.us.us.peel.thread.sink.split
if.then125.us.us.peel: ; preds = %for.body85.us.us.preheader, %for.body85.us.us.preheader, %for.body85.us.us.preheader, %for.body85.us.us.preheader
%cmp.not4.i212.us.us.peel = icmp sgt i32 %day11.0267, 30
br i1 %cmp.not4.i212.us.us.peel, label %if.end145.us.us.peel.thread, label %if.end145.us.us.peel.thread.sink.split
if.then112.us.us.peel: ; preds = %for.body85.us.us.preheader, %for.body85.us.us.preheader, %for.body85.us.us.preheader, %for.body85.us.us.preheader, %for.body85.us.us.preheader, %for.body85.us.us.preheader, %for.body85.us.us.preheader
%cmp.not4.i208.us.us.peel = icmp sgt i32 %day11.0267, 31
br i1 %cmp.not4.i208.us.us.peel, label %if.end145.us.us.peel, label %for.body.preheader.i209.us.us.peel
for.body.preheader.i209.us.us.peel: ; preds = %if.then112.us.us.peel
%reass.sub303 = sub i32 %28, %day11.0267
%30 = add i32 %reass.sub303, 32
store i32 %30, ptr @count, align 4, !tbaa !8
br label %if.end145.us.us.peel
if.end145.us.us.peel.thread.sink.split: ; preds = %if.then125.us.us.peel, %if.then129.us.us.peel
%.sink388 = phi i32 [ 30, %if.then129.us.us.peel ], [ 31, %if.then125.us.us.peel ]
%reass.sub301 = sub i32 %28, %day11.0267
%31 = add i32 %reass.sub301, %.sink388
store i32 %31, ptr @count, align 4, !tbaa !8
br label %if.end145.us.us.peel.thread
if.end145.us.us.peel.thread: ; preds = %if.end145.us.us.peel.thread.sink.split, %if.then125.us.us.peel, %if.then129.us.us.peel
%.ph = phi i32 [ %27, %if.then125.us.us.peel ], [ %27, %if.then129.us.us.peel ], [ %31, %if.end145.us.us.peel.thread.sink.split ]
%.ph307 = phi i32 [ %28, %if.then125.us.us.peel ], [ %28, %if.then129.us.us.peel ], [ %31, %if.end145.us.us.peel.thread.sink.split ]
%inc.us.us.peel308 = add nuw nsw i32 %month11.0268, 1
br label %for.body85.us.us.preheader401
if.end145.us.us.peel: ; preds = %for.body.preheader.i209.us.us.peel, %if.then112.us.us.peel, %for.body85.us.us.preheader
%32 = phi i32 [ %30, %for.body.preheader.i209.us.us.peel ], [ %27, %if.then112.us.us.peel ], [ %27, %for.body85.us.us.preheader ]
%33 = phi i32 [ %30, %for.body.preheader.i209.us.us.peel ], [ %28, %if.then112.us.us.peel ], [ %28, %for.body85.us.us.preheader ]
%inc.us.us.peel = add nsw i32 %month11.0268, 1
%exitcond289.peel.not = icmp eq i32 %inc.us.us.peel, 13
br i1 %exitcond289.peel.not, label %for.end, label %for.body85.us.us.preheader401
for.body85.us.us.preheader401: ; preds = %if.end145.us.us.peel.thread, %if.end145.us.us.peel
%.ph402 = phi i32 [ %32, %if.end145.us.us.peel ], [ %.ph, %if.end145.us.us.peel.thread ]
%month.0230.us.us.ph = phi i32 [ %inc.us.us.peel, %if.end145.us.us.peel ], [ %inc.us.us.peel308, %if.end145.us.us.peel.thread ]
%.ph404 = phi i32 [ %33, %if.end145.us.us.peel ], [ %.ph307, %if.end145.us.us.peel.thread ]
%34 = sub i32 1, %month.0230.us.us.ph
%xtraiter435 = and i32 %34, 1
%lcmp.mod436.not = icmp eq i32 %xtraiter435, 0
br i1 %lcmp.mod436.not, label %for.body85.us.us.prol.loopexit, label %for.body85.us.us.prol
for.body85.us.us.prol: ; preds = %for.body85.us.us.preheader401
%switch.tableidx.prol = add i32 %month.0230.us.us.ph, -1
%35 = icmp ult i32 %switch.tableidx.prol, 12
br i1 %35, label %switch.lookup.prol, label %if.end145.us.us.prol
switch.lookup.prol: ; preds = %for.body85.us.us.prol
%36 = sext i32 %switch.tableidx.prol to i64
%switch.gep.prol = getelementptr inbounds [12 x i32], ptr @switch.table.main.2, i64 0, i64 %36
%switch.load.prol = load i32, ptr %switch.gep.prol, align 4
%37 = add i32 %.ph404, %switch.load.prol
store i32 %37, ptr @count, align 4, !tbaa !8
br label %if.end145.us.us.prol
if.end145.us.us.prol: ; preds = %switch.lookup.prol, %for.body85.us.us.prol
%38 = phi i32 [ %.ph402, %for.body85.us.us.prol ], [ %37, %switch.lookup.prol ]
%39 = phi i32 [ %.ph404, %for.body85.us.us.prol ], [ %37, %switch.lookup.prol ]
%inc.us.us.prol = add nsw i32 %month.0230.us.us.ph, 1
br label %for.body85.us.us.prol.loopexit
for.body85.us.us.prol.loopexit: ; preds = %if.end145.us.us.prol, %for.body85.us.us.preheader401
%.lcssa425.unr = phi i32 [ undef, %for.body85.us.us.preheader401 ], [ %38, %if.end145.us.us.prol ]
%.lcssa424.unr = phi i32 [ undef, %for.body85.us.us.preheader401 ], [ %39, %if.end145.us.us.prol ]
%.unr437 = phi i32 [ %.ph402, %for.body85.us.us.preheader401 ], [ %38, %if.end145.us.us.prol ]
%month.0230.us.us.unr = phi i32 [ %month.0230.us.us.ph, %for.body85.us.us.preheader401 ], [ %inc.us.us.prol, %if.end145.us.us.prol ]
%.unr439 = phi i32 [ %.ph404, %for.body85.us.us.preheader401 ], [ %39, %if.end145.us.us.prol ]
%40 = icmp eq i32 %month.0230.us.us.ph, 12
br i1 %40, label %for.end, label %for.body85.us.us
for.body85.us.preheader: ; preds = %for.body85.lr.ph.split.us
%cmp89.us.peel = icmp eq i32 %month11.0268, %month2.0
br i1 %cmp89.us.peel, label %if.then91, label %if.else.us.peel
if.else.us.peel: ; preds = %for.body85.us.preheader
switch i32 %month11.0268, label %if.end145.us.peel [
i32 12, label %if.then112.us.peel
i32 10, label %if.then112.us.peel
i32 8, label %if.then112.us.peel
i32 7, label %if.then112.us.peel
i32 5, label %if.then112.us.peel
i32 3, label %if.then112.us.peel
i32 1, label %if.then112.us.peel
i32 11, label %if.then125.us.peel
i32 9, label %if.then125.us.peel
i32 6, label %if.then125.us.peel
i32 4, label %if.then125.us.peel
i32 2, label %if.then129.us.peel
]
if.then129.us.peel: ; preds = %if.else.us.peel
%cmp.not4.i216.us.peel = icmp sgt i32 %day11.0267, 29
br i1 %cmp.not4.i216.us.peel, label %if.end145.us.peel.thread, label %if.end145.us.peel.thread.sink.split
if.then125.us.peel: ; preds = %if.else.us.peel, %if.else.us.peel, %if.else.us.peel, %if.else.us.peel
%cmp.not4.i212.us.peel = icmp sgt i32 %day11.0267, 30
br i1 %cmp.not4.i212.us.peel, label %if.end145.us.peel.thread, label %if.end145.us.peel.thread.sink.split
if.then112.us.peel: ; preds = %if.else.us.peel, %if.else.us.peel, %if.else.us.peel, %if.else.us.peel, %if.else.us.peel, %if.else.us.peel, %if.else.us.peel
%cmp.not4.i208.us.peel = icmp sgt i32 %day11.0267, 31
br i1 %cmp.not4.i208.us.peel, label %if.end145.us.peel, label %for.body.preheader.i209.us.peel
for.body.preheader.i209.us.peel: ; preds = %if.then112.us.peel
%reass.sub306 = sub i32 %28, %day11.0267
%41 = add i32 %reass.sub306, 32
store i32 %41, ptr @count, align 4, !tbaa !8
br label %if.end145.us.peel
if.end145.us.peel.thread.sink.split: ; preds = %if.then125.us.peel, %if.then129.us.peel
%.sink = phi i32 [ 30, %if.then129.us.peel ], [ 31, %if.then125.us.peel ]
%reass.sub304 = sub i32 %28, %day11.0267
%42 = add i32 %reass.sub304, %.sink
store i32 %42, ptr @count, align 4, !tbaa !8
br label %if.end145.us.peel.thread
if.end145.us.peel.thread: ; preds = %if.end145.us.peel.thread.sink.split, %if.then125.us.peel, %if.then129.us.peel
%.ph311 = phi i32 [ %27, %if.then125.us.peel ], [ %27, %if.then129.us.peel ], [ %42, %if.end145.us.peel.thread.sink.split ]
%.ph312 = phi i32 [ %28, %if.then125.us.peel ], [ %28, %if.then129.us.peel ], [ %42, %if.end145.us.peel.thread.sink.split ]
%inc.us.peel313 = add nuw nsw i32 %month11.0268, 1
br label %for.body85.us.preheader397
if.end145.us.peel: ; preds = %for.body.preheader.i209.us.peel, %if.then112.us.peel, %if.else.us.peel
%43 = phi i32 [ %41, %for.body.preheader.i209.us.peel ], [ %27, %if.then112.us.peel ], [ %27, %if.else.us.peel ]
%44 = phi i32 [ %41, %for.body.preheader.i209.us.peel ], [ %28, %if.then112.us.peel ], [ %28, %if.else.us.peel ]
%inc.us.peel = add nsw i32 %month11.0268, 1
%exitcond291.peel.not = icmp eq i32 %inc.us.peel, 13
br i1 %exitcond291.peel.not, label %for.end, label %for.body85.us.preheader397
for.body85.us.preheader397: ; preds = %if.end145.us.peel.thread, %if.end145.us.peel
%.ph398 = phi i32 [ %43, %if.end145.us.peel ], [ %.ph311, %if.end145.us.peel.thread ]
%month.0230.us.ph = phi i32 [ %inc.us.peel, %if.end145.us.peel ], [ %inc.us.peel313, %if.end145.us.peel.thread ]
%.ph400 = phi i32 [ %44, %if.end145.us.peel ], [ %.ph312, %if.end145.us.peel.thread ]
br label %for.body85.us
for.body85.us.us: ; preds = %for.body85.us.us.prol.loopexit, %if.end145.us.us.1
%45 = phi i32 [ %57, %if.end145.us.us.1 ], [ %.unr437, %for.body85.us.us.prol.loopexit ]
%46 = phi i32 [ %58, %if.end145.us.us.1 ], [ %.unr439, %for.body85.us.us.prol.loopexit ]
%month.0230.us.us = phi i32 [ %inc.us.us.1, %if.end145.us.us.1 ], [ %month.0230.us.us.unr, %for.body85.us.us.prol.loopexit ]
%47 = phi i32 [ %59, %if.end145.us.us.1 ], [ %.unr439, %for.body85.us.us.prol.loopexit ]
%switch.tableidx = add i32 %month.0230.us.us, -1
%48 = icmp ult i32 %switch.tableidx, 12
br i1 %48, label %switch.lookup, label %if.end145.us.us
switch.lookup: ; preds = %for.body85.us.us
%49 = sext i32 %switch.tableidx to i64
%switch.gep = getelementptr inbounds [12 x i32], ptr @switch.table.main.2, i64 0, i64 %49
%switch.load = load i32, ptr %switch.gep, align 4
%50 = add i32 %47, %switch.load
store i32 %50, ptr @count, align 4, !tbaa !8
br label %if.end145.us.us
if.end145.us.us: ; preds = %for.body85.us.us, %switch.lookup
%51 = phi i32 [ %45, %for.body85.us.us ], [ %50, %switch.lookup ]
%52 = phi i32 [ %46, %for.body85.us.us ], [ %50, %switch.lookup ]
%53 = phi i32 [ %47, %for.body85.us.us ], [ %50, %switch.lookup ]
%54 = icmp ult i32 %month.0230.us.us, 12
br i1 %54, label %switch.lookup.1, label %if.end145.us.us.1
switch.lookup.1: ; preds = %if.end145.us.us
%55 = sext i32 %month.0230.us.us to i64
%switch.gep.1 = getelementptr inbounds [12 x i32], ptr @switch.table.main.2, i64 0, i64 %55
%switch.load.1 = load i32, ptr %switch.gep.1, align 4
%56 = add i32 %53, %switch.load.1
store i32 %56, ptr @count, align 4, !tbaa !8
br label %if.end145.us.us.1
if.end145.us.us.1: ; preds = %switch.lookup.1, %if.end145.us.us
%57 = phi i32 [ %51, %if.end145.us.us ], [ %56, %switch.lookup.1 ]
%58 = phi i32 [ %52, %if.end145.us.us ], [ %56, %switch.lookup.1 ]
%59 = phi i32 [ %53, %if.end145.us.us ], [ %56, %switch.lookup.1 ]
%inc.us.us.1 = add nsw i32 %month.0230.us.us, 2
%exitcond289.not.1 = icmp eq i32 %inc.us.us.1, 13
br i1 %exitcond289.not.1, label %for.end, label %for.body85.us.us, !llvm.loop !10
for.body85.us: ; preds = %for.body85.us.preheader397, %if.end145.us
%60 = phi i32 [ %66, %if.end145.us ], [ %.ph398, %for.body85.us.preheader397 ]
%61 = phi i32 [ %67, %if.end145.us ], [ %.ph400, %for.body85.us.preheader397 ]
%month.0230.us = phi i32 [ %inc.us, %if.end145.us ], [ %month.0230.us.ph, %for.body85.us.preheader397 ]
%62 = phi i32 [ %68, %if.end145.us ], [ %.ph400, %for.body85.us.preheader397 ]
%cmp89.us = icmp eq i32 %month.0230.us, %month2.0
br i1 %cmp89.us, label %if.then91, label %if.else.us
if.else.us: ; preds = %for.body85.us
%switch.tableidx390 = add i32 %month.0230.us, -1
%63 = icmp ult i32 %switch.tableidx390, 12
br i1 %63, label %switch.lookup389, label %if.end145.us
switch.lookup389: ; preds = %if.else.us
%64 = sext i32 %switch.tableidx390 to i64
%switch.gep391 = getelementptr inbounds [12 x i32], ptr @switch.table.main.2, i64 0, i64 %64
%switch.load392 = load i32, ptr %switch.gep391, align 4
%65 = add i32 %62, %switch.load392
store i32 %65, ptr @count, align 4, !tbaa !8
br label %if.end145.us
if.end145.us: ; preds = %if.else.us, %switch.lookup389
%66 = phi i32 [ %60, %if.else.us ], [ %65, %switch.lookup389 ]
%67 = phi i32 [ %61, %if.else.us ], [ %65, %switch.lookup389 ]
%68 = phi i32 [ %62, %if.else.us ], [ %65, %switch.lookup389 ]
%inc.us = add nsw i32 %month.0230.us, 1
%exitcond291.not = icmp eq i32 %inc.us, 13
br i1 %exitcond291.not, label %for.end, label %for.body85.us, !llvm.loop !13
for.body85.lr.ph.split: ; preds = %for.body85.lr.ph
br i1 %cmp86.fr, label %for.body85.preheader, label %for.body85.us234.preheader
for.body85.us234.preheader: ; preds = %for.body85.lr.ph.split
switch i32 %month11.0268, label %if.end145.us251.peel [
i32 12, label %if.then112.us248.peel
i32 10, label %if.then112.us248.peel
i32 8, label %if.then112.us248.peel
i32 7, label %if.then112.us248.peel
i32 5, label %if.then112.us248.peel
i32 3, label %if.then112.us248.peel
i32 1, label %if.then112.us248.peel
i32 11, label %if.then125.us245.peel
i32 9, label %if.then125.us245.peel
i32 6, label %if.then125.us245.peel
i32 4, label %if.then125.us245.peel
i32 2, label %if.then129.us241.peel
]
if.then129.us241.peel: ; preds = %for.body85.us234.preheader
br i1 %or.cond, label %if.else141.us.peel, label %if.then140.us242.peel
if.then140.us242.peel: ; preds = %if.then129.us241.peel
%cmp.not4.i216.us243.peel = icmp sgt i32 %day11.0267, 29
br i1 %cmp.not4.i216.us243.peel, label %if.end145.us251.peel.thread, label %if.end145.us251.peel.thread.sink.split
if.else141.us.peel: ; preds = %if.then129.us241.peel
%cmp.not4.i220.us.peel = icmp sgt i32 %day11.0267, 28
br i1 %cmp.not4.i220.us.peel, label %if.end145.us251.peel.thread, label %if.end145.us251.peel.thread.sink.split
if.then125.us245.peel: ; preds = %for.body85.us234.preheader, %for.body85.us234.preheader, %for.body85.us234.preheader, %for.body85.us234.preheader
%cmp.not4.i212.us246.peel = icmp sgt i32 %day11.0267, 30
br i1 %cmp.not4.i212.us246.peel, label %if.end145.us251.peel.thread, label %if.end145.us251.peel.thread.sink.split
if.then112.us248.peel: ; preds = %for.body85.us234.preheader, %for.body85.us234.preheader, %for.body85.us234.preheader, %for.body85.us234.preheader, %for.body85.us234.preheader, %for.body85.us234.preheader, %for.body85.us234.preheader
%cmp.not4.i208.us249.peel = icmp sgt i32 %day11.0267, 31
br i1 %cmp.not4.i208.us249.peel, label %if.end145.us251.peel, label %for.body.preheader.i209.us250.peel
for.body.preheader.i209.us250.peel: ; preds = %if.then112.us248.peel
%reass.sub296 = sub i32 %28, %day11.0267
%69 = add i32 %reass.sub296, 32
store i32 %69, ptr @count, align 4, !tbaa !8
br label %if.end145.us251.peel
if.end145.us251.peel.thread.sink.split: ; preds = %if.then125.us245.peel, %if.else141.us.peel, %if.then140.us242.peel
%.sink393 = phi i32 [ 30, %if.then140.us242.peel ], [ 29, %if.else141.us.peel ], [ 31, %if.then125.us245.peel ]
%reass.sub = sub i32 %28, %day11.0267
%70 = add i32 %reass.sub, %.sink393
store i32 %70, ptr @count, align 4, !tbaa !8
br label %if.end145.us251.peel.thread
if.end145.us251.peel.thread: ; preds = %if.end145.us251.peel.thread.sink.split, %if.then125.us245.peel, %if.else141.us.peel, %if.then140.us242.peel
%.ph316 = phi i32 [ %27, %if.then125.us245.peel ], [ %27, %if.then140.us242.peel ], [ %27, %if.else141.us.peel ], [ %70, %if.end145.us251.peel.thread.sink.split ]
%.ph317 = phi i32 [ %28, %if.then125.us245.peel ], [ %28, %if.then140.us242.peel ], [ %28, %if.else141.us.peel ], [ %70, %if.end145.us251.peel.thread.sink.split ]
%inc.us252.peel318 = add nuw nsw i32 %month11.0268, 1
br label %for.body85.us234.preheader412
if.end145.us251.peel: ; preds = %for.body.preheader.i209.us250.peel, %if.then112.us248.peel, %for.body85.us234.preheader
%71 = phi i32 [ %69, %for.body.preheader.i209.us250.peel ], [ %27, %if.then112.us248.peel ], [ %27, %for.body85.us234.preheader ]
%72 = phi i32 [ %69, %for.body.preheader.i209.us250.peel ], [ %28, %if.then112.us248.peel ], [ %28, %for.body85.us234.preheader ]
%inc.us252.peel = add nsw i32 %month11.0268, 1
%exitcond.peel.not = icmp eq i32 %inc.us252.peel, 13
br i1 %exitcond.peel.not, label %for.end, label %for.body85.us234.preheader412
for.body85.us234.preheader412: ; preds = %if.end145.us251.peel.thread, %if.end145.us251.peel
%.ph413 = phi i32 [ %71, %if.end145.us251.peel ], [ %.ph316, %if.end145.us251.peel.thread ]
%month.0230.us236.ph = phi i32 [ %inc.us252.peel, %if.end145.us251.peel ], [ %inc.us252.peel318, %if.end145.us251.peel.thread ]
%.ph415 = phi i32 [ %72, %if.end145.us251.peel ], [ %.ph317, %if.end145.us251.peel.thread ]
%73 = sub i32 1, %month.0230.us236.ph
%xtraiter = and i32 %73, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body85.us234.prol.loopexit, label %for.body85.us234.prol
for.body85.us234.prol: ; preds = %for.body85.us234.preheader412
switch i32 %month.0230.us236.ph, label %if.end145.us251.prol [
i32 12, label %for.body.preheader.i209.us250.prol
i32 10, label %for.body.preheader.i209.us250.prol
i32 8, label %for.body.preheader.i209.us250.prol
i32 7, label %for.body.preheader.i209.us250.prol
i32 5, label %for.body.preheader.i209.us250.prol
i32 3, label %for.body.preheader.i209.us250.prol
i32 1, label %for.body.preheader.i209.us250.prol
i32 11, label %if.end145.us251.sink.split.prol
i32 9, label %if.end145.us251.sink.split.prol
i32 6, label %if.end145.us251.sink.split.prol
i32 4, label %if.end145.us251.sink.split.prol
i32 2, label %if.then129.us241.prol
]
if.then129.us241.prol: ; preds = %for.body85.us234.prol
%..prol = select i1 %or.cond, i32 28, i32 29
br label %if.end145.us251.sink.split.prol
for.body.preheader.i209.us250.prol: ; preds = %for.body85.us234.prol, %for.body85.us234.prol, %for.body85.us234.prol, %for.body85.us234.prol, %for.body85.us234.prol, %for.body85.us234.prol, %for.body85.us234.prol
br label %if.end145.us251.sink.split.prol
if.end145.us251.sink.split.prol: ; preds = %for.body.preheader.i209.us250.prol, %if.then129.us241.prol, %for.body85.us234.prol, %for.body85.us234.prol, %for.body85.us234.prol, %for.body85.us234.prol
%.sink367.prol = phi i32 [ 31, %for.body.preheader.i209.us250.prol ], [ %..prol, %if.then129.us241.prol ], [ 30, %for.body85.us234.prol ], [ 30, %for.body85.us234.prol ], [ 30, %for.body85.us234.prol ], [ 30, %for.body85.us234.prol ]
%74 = add i32 %.ph415, %.sink367.prol
store i32 %74, ptr @count, align 4, !tbaa !8
br label %if.end145.us251.prol
if.end145.us251.prol: ; preds = %if.end145.us251.sink.split.prol, %for.body85.us234.prol
%75 = phi i32 [ %.ph413, %for.body85.us234.prol ], [ %74, %if.end145.us251.sink.split.prol ]
%76 = phi i32 [ %.ph415, %for.body85.us234.prol ], [ %74, %if.end145.us251.sink.split.prol ]
%inc.us252.prol = add nsw i32 %month.0230.us236.ph, 1
br label %for.body85.us234.prol.loopexit
for.body85.us234.prol.loopexit: ; preds = %if.end145.us251.prol, %for.body85.us234.preheader412
%.lcssa417.unr = phi i32 [ undef, %for.body85.us234.preheader412 ], [ %75, %if.end145.us251.prol ]
%.lcssa.unr = phi i32 [ undef, %for.body85.us234.preheader412 ], [ %76, %if.end145.us251.prol ]
%.unr = phi i32 [ %.ph413, %for.body85.us234.preheader412 ], [ %75, %if.end145.us251.prol ]
%month.0230.us236.unr = phi i32 [ %month.0230.us236.ph, %for.body85.us234.preheader412 ], [ %inc.us252.prol, %if.end145.us251.prol ]
%.unr434 = phi i32 [ %.ph415, %for.body85.us234.preheader412 ], [ %76, %if.end145.us251.prol ]
%77 = icmp eq i32 %month.0230.us236.ph, 12
br i1 %77, label %for.end, label %for.body85.us234.preheader412.new
for.body85.us234.preheader412.new: ; preds = %for.body85.us234.prol.loopexit
%. = select i1 %or.cond, i32 28, i32 29
%..1 = select i1 %or.cond, i32 28, i32 29
br label %for.body85.us234
for.body85.preheader: ; preds = %for.body85.lr.ph.split
%cmp89.peel = icmp eq i32 %month11.0268, %month2.0
br i1 %cmp89.peel, label %if.then91, label %if.else.peel
if.else.peel: ; preds = %for.body85.preheader
switch i32 %month11.0268, label %if.end145.peel [
i32 12, label %if.then112.peel
i32 10, label %if.then112.peel
i32 8, label %if.then112.peel
i32 7, label %if.then112.peel
i32 5, label %if.then112.peel
i32 3, label %if.then112.peel
i32 1, label %if.then112.peel
i32 11, label %if.then125.peel
i32 9, label %if.then125.peel
i32 6, label %if.then125.peel
i32 4, label %if.then125.peel
i32 2, label %if.then129.peel
]
if.then129.peel: ; preds = %if.else.peel
br i1 %or.cond, label %if.else141.peel, label %if.then140.peel
if.then140.peel: ; preds = %if.then129.peel
%cmp.not4.i216.peel = icmp sgt i32 %day11.0267, 29
br i1 %cmp.not4.i216.peel, label %if.end145.peel.thread, label %if.end145.peel.thread.sink.split
if.else141.peel: ; preds = %if.then129.peel
%cmp.not4.i220.peel = icmp sgt i32 %day11.0267, 28
br i1 %cmp.not4.i220.peel, label %if.end145.peel.thread, label %if.end145.peel.thread.sink.split
if.then125.peel: ; preds = %if.else.peel, %if.else.peel, %if.else.peel, %if.else.peel
%cmp.not4.i212.peel = icmp sgt i32 %day11.0267, 30
br i1 %cmp.not4.i212.peel, label %if.end145.peel.thread, label %if.end145.peel.thread.sink.split
if.then112.peel: ; preds = %if.else.peel, %if.else.peel, %if.else.peel, %if.else.peel, %if.else.peel, %if.else.peel, %if.else.peel
%cmp.not4.i208.peel = icmp sgt i32 %day11.0267, 31
br i1 %cmp.not4.i208.peel, label %if.end145.peel, label %for.body.preheader.i209.peel
for.body.preheader.i209.peel: ; preds = %if.then112.peel
%reass.sub300 = sub i32 %28, %day11.0267
%78 = add i32 %reass.sub300, 32
store i32 %78, ptr @count, align 4, !tbaa !8
br label %if.end145.peel
if.end145.peel.thread.sink.split: ; preds = %if.then125.peel, %if.else141.peel, %if.then140.peel
%.sink394 = phi i32 [ 30, %if.then140.peel ], [ 29, %if.else141.peel ], [ 31, %if.then125.peel ]
%reass.sub297 = sub i32 %28, %day11.0267
%79 = add i32 %reass.sub297, %.sink394
store i32 %79, ptr @count, align 4, !tbaa !8
br label %if.end145.peel.thread
if.end145.peel.thread: ; preds = %if.end145.peel.thread.sink.split, %if.then125.peel, %if.else141.peel, %if.then140.peel
%.ph321 = phi i32 [ %27, %if.then125.peel ], [ %27, %if.then140.peel ], [ %27, %if.else141.peel ], [ %79, %if.end145.peel.thread.sink.split ]
%.ph322 = phi i32 [ %28, %if.then125.peel ], [ %28, %if.then140.peel ], [ %28, %if.else141.peel ], [ %79, %if.end145.peel.thread.sink.split ]
%inc.peel323 = add nuw nsw i32 %month11.0268, 1
br label %for.body85.preheader406
if.end145.peel: ; preds = %for.body.preheader.i209.peel, %if.then112.peel, %if.else.peel
%80 = phi i32 [ %78, %for.body.preheader.i209.peel ], [ %27, %if.then112.peel ], [ %27, %if.else.peel ]
%81 = phi i32 [ %78, %for.body.preheader.i209.peel ], [ %28, %if.then112.peel ], [ %28, %if.else.peel ]
%inc.peel = add nsw i32 %month11.0268, 1
%exitcond287.peel.not = icmp eq i32 %inc.peel, 13
br i1 %exitcond287.peel.not, label %for.end, label %for.body85.preheader406
for.body85.preheader406: ; preds = %if.end145.peel.thread, %if.end145.peel
%.ph407 = phi i32 [ %80, %if.end145.peel ], [ %.ph321, %if.end145.peel.thread ]
%month.0230.ph = phi i32 [ %inc.peel, %if.end145.peel ], [ %inc.peel323, %if.end145.peel.thread ]
%.ph409 = phi i32 [ %81, %if.end145.peel ], [ %.ph322, %if.end145.peel.thread ]
%.396 = select i1 %or.cond, i32 28, i32 29
br label %for.body85
for.body85.us234: ; preds = %if.end145.us251.1, %for.body85.us234.preheader412.new
%82 = phi i32 [ %.unr, %for.body85.us234.preheader412.new ], [ %90, %if.end145.us251.1 ]
%83 = phi i32 [ %.unr434, %for.body85.us234.preheader412.new ], [ %91, %if.end145.us251.1 ]
%month.0230.us236 = phi i32 [ %month.0230.us236.unr, %for.body85.us234.preheader412.new ], [ %inc.us252.1, %if.end145.us251.1 ]
%84 = phi i32 [ %.unr434, %for.body85.us234.preheader412.new ], [ %92, %if.end145.us251.1 ]
switch i32 %month.0230.us236, label %if.end145.us251 [
i32 12, label %for.body.preheader.i209.us250
i32 10, label %for.body.preheader.i209.us250
i32 8, label %for.body.preheader.i209.us250
i32 7, label %for.body.preheader.i209.us250
i32 5, label %for.body.preheader.i209.us250
i32 3, label %for.body.preheader.i209.us250
i32 1, label %for.body.preheader.i209.us250
i32 11, label %if.end145.us251.sink.split
i32 9, label %if.end145.us251.sink.split
i32 6, label %if.end145.us251.sink.split
i32 4, label %if.end145.us251.sink.split
i32 2, label %if.then129.us241
]
if.then129.us241: ; preds = %for.body85.us234
br label %if.end145.us251.sink.split
for.body.preheader.i209.us250: ; preds = %for.body85.us234, %for.body85.us234, %for.body85.us234, %for.body85.us234, %for.body85.us234, %for.body85.us234, %for.body85.us234
br label %if.end145.us251.sink.split
if.end145.us251.sink.split: ; preds = %for.body85.us234, %for.body85.us234, %for.body85.us234, %for.body85.us234, %if.then129.us241, %for.body.preheader.i209.us250
%.sink367 = phi i32 [ 31, %for.body.preheader.i209.us250 ], [ %., %if.then129.us241 ], [ 30, %for.body85.us234 ], [ 30, %for.body85.us234 ], [ 30, %for.body85.us234 ], [ 30, %for.body85.us234 ]
%85 = add i32 %84, %.sink367
store i32 %85, ptr @count, align 4, !tbaa !8
br label %if.end145.us251
if.end145.us251: ; preds = %if.end145.us251.sink.split, %for.body85.us234
%86 = phi i32 [ %82, %for.body85.us234 ], [ %85, %if.end145.us251.sink.split ]
%87 = phi i32 [ %83, %for.body85.us234 ], [ %85, %if.end145.us251.sink.split ]
%88 = phi i32 [ %84, %for.body85.us234 ], [ %85, %if.end145.us251.sink.split ]
switch i32 %month.0230.us236, label %if.end145.us251.1 [
i32 11, label %for.body.preheader.i209.us250.1
i32 9, label %for.body.preheader.i209.us250.1
i32 7, label %for.body.preheader.i209.us250.1
i32 6, label %for.body.preheader.i209.us250.1
i32 4, label %for.body.preheader.i209.us250.1
i32 2, label %for.body.preheader.i209.us250.1
i32 0, label %for.body.preheader.i209.us250.1
i32 10, label %if.end145.us251.sink.split.1
i32 8, label %if.end145.us251.sink.split.1
i32 5, label %if.end145.us251.sink.split.1
i32 3, label %if.end145.us251.sink.split.1
i32 1, label %if.then129.us241.1
]
if.then129.us241.1: ; preds = %if.end145.us251
br label %if.end145.us251.sink.split.1
for.body.preheader.i209.us250.1: ; preds = %if.end145.us251, %if.end145.us251, %if.end145.us251, %if.end145.us251, %if.end145.us251, %if.end145.us251, %if.end145.us251
br label %if.end145.us251.sink.split.1
if.end145.us251.sink.split.1: ; preds = %for.body.preheader.i209.us250.1, %if.then129.us241.1, %if.end145.us251, %if.end145.us251, %if.end145.us251, %if.end145.us251
%.sink367.1 = phi i32 [ 31, %for.body.preheader.i209.us250.1 ], [ %..1, %if.then129.us241.1 ], [ 30, %if.end145.us251 ], [ 30, %if.end145.us251 ], [ 30, %if.end145.us251 ], [ 30, %if.end145.us251 ]
%89 = add i32 %88, %.sink367.1
store i32 %89, ptr @count, align 4, !tbaa !8
br label %if.end145.us251.1
if.end145.us251.1: ; preds = %if.end145.us251.sink.split.1, %if.end145.us251
%90 = phi i32 [ %86, %if.end145.us251 ], [ %89, %if.end145.us251.sink.split.1 ]
%91 = phi i32 [ %87, %if.end145.us251 ], [ %89, %if.end145.us251.sink.split.1 ]
%92 = phi i32 [ %88, %if.end145.us251 ], [ %89, %if.end145.us251.sink.split.1 ]
%inc.us252.1 = add nsw i32 %month.0230.us236, 2
%exitcond.not.1 = icmp eq i32 %inc.us252.1, 13
br i1 %exitcond.not.1, label %for.end, label %for.body85.us234, !llvm.loop !14
for.body85: ; preds = %for.body85.preheader406, %if.end145
%93 = phi i32 [ %101, %if.end145 ], [ %.ph407, %for.body85.preheader406 ]
%94 = phi i32 [ %102, %if.end145 ], [ %.ph409, %for.body85.preheader406 ]
%month.0230 = phi i32 [ %inc, %if.end145 ], [ %month.0230.ph, %for.body85.preheader406 ]
%95 = phi i32 [ %103, %if.end145 ], [ %.ph409, %for.body85.preheader406 ]
%cmp89 = icmp eq i32 %month.0230, %month2.0
br i1 %cmp89, label %if.then91, label %if.else
if.then91: ; preds = %for.body85, %for.body85.us, %for.body85.preheader, %for.body85.us.preheader
%96 = phi i32 [ %27, %for.body85.us.preheader ], [ %27, %for.body85.preheader ], [ %60, %for.body85.us ], [ %93, %for.body85 ]
%97 = phi i32 [ %28, %for.body85.us.preheader ], [ %28, %for.body85.preheader ], [ %61, %for.body85.us ], [ %94, %for.body85 ]
%.us-phi = phi i32 [ %day11.0267, %for.body85.us.preheader ], [ %day11.0267, %for.body85.preheader ], [ 1, %for.body85.us ], [ 1, %for.body85 ]
%.us-phi232 = phi i32 [ %day11.1.neg227, %for.body85.us.preheader ], [ %day11.1.neg227, %for.body85.preheader ], [ -1, %for.body85.us ], [ -1, %for.body85 ]
%cmp.not4.i = icmp sgt i32 %.us-phi, %day2.0
br i1 %cmp.not4.i, label %for.end, label %for.body.preheader.i
for.body.preheader.i: ; preds = %if.then91
%98 = add nsw i32 %26, %.us-phi232
%99 = add i32 %98, %97
store i32 %99, ptr @count, align 4, !tbaa !8
br label %for.end
if.else: ; preds = %for.body85
switch i32 %month.0230, label %if.end145 [
i32 12, label %if.end145.sink.split
i32 10, label %if.end145.sink.split
i32 8, label %if.end145.sink.split
i32 7, label %if.end145.sink.split
i32 5, label %if.end145.sink.split
i32 3, label %if.end145.sink.split
i32 1, label %if.end145.sink.split
i32 11, label %for.body.preheader.i213
i32 9, label %for.body.preheader.i213
i32 6, label %for.body.preheader.i213
i32 4, label %for.body.preheader.i213
i32 2, label %if.then129
]
for.body.preheader.i213: ; preds = %if.else, %if.else, %if.else, %if.else
br label %if.end145.sink.split
if.then129: ; preds = %if.else
br label %if.end145.sink.split
if.end145.sink.split: ; preds = %if.then129, %if.else, %if.else, %if.else, %if.else, %if.else, %if.else, %if.else, %for.body.preheader.i213
%.sink395 = phi i32 [ 30, %for.body.preheader.i213 ], [ 31, %if.else ], [ 31, %if.else ], [ 31, %if.else ], [ 31, %if.else ], [ 31, %if.else ], [ 31, %if.else ], [ 31, %if.else ], [ %.396, %if.then129 ]
%100 = add i32 %95, %.sink395
store i32 %100, ptr @count, align 4, !tbaa !8
br label %if.end145
if.end145: ; preds = %if.end145.sink.split, %if.else
%101 = phi i32 [ %93, %if.else ], [ %100, %if.end145.sink.split ]
%102 = phi i32 [ %94, %if.else ], [ %100, %if.end145.sink.split ]
%103 = phi i32 [ %95, %if.else ], [ %100, %if.end145.sink.split ]
%inc = add nsw i32 %month.0230, 1
%exitcond287.not = icmp eq i32 %inc, 13
br i1 %exitcond287.not, label %for.end, label %for.body85, !llvm.loop !15
for.end: ; preds = %for.body85.us234.prol.loopexit, %if.end145.us251.1, %if.end145, %for.body85.us.us.prol.loopexit, %if.end145.us.us.1, %if.end145.us, %if.end145.us251.peel, %if.end145.peel, %if.end145.us.us.peel, %if.end145.us.peel, %for.cond82.preheader, %for.body.preheader.i, %if.then91
%104 = phi i32 [ %99, %for.body.preheader.i ], [ %96, %if.then91 ], [ %27, %for.cond82.preheader ], [ %43, %if.end145.us.peel ], [ %32, %if.end145.us.us.peel ], [ %80, %if.end145.peel ], [ %71, %if.end145.us251.peel ], [ %66, %if.end145.us ], [ %.lcssa425.unr, %for.body85.us.us.prol.loopexit ], [ %57, %if.end145.us.us.1 ], [ %101, %if.end145 ], [ %.lcssa417.unr, %for.body85.us234.prol.loopexit ], [ %90, %if.end145.us251.1 ]
%105 = phi i32 [ %99, %for.body.preheader.i ], [ %97, %if.then91 ], [ %28, %for.cond82.preheader ], [ %44, %if.end145.us.peel ], [ %33, %if.end145.us.us.peel ], [ %81, %if.end145.peel ], [ %72, %if.end145.us251.peel ], [ %67, %if.end145.us ], [ %.lcssa424.unr, %for.body85.us.us.prol.loopexit ], [ %58, %if.end145.us.us.1 ], [ %102, %if.end145 ], [ %.lcssa.unr, %for.body85.us234.prol.loopexit ], [ %91, %if.end145.us251.1 ]
%day11.1226 = phi i32 [ %.us-phi, %for.body.preheader.i ], [ %.us-phi, %if.then91 ], [ %day11.0267, %for.cond82.preheader ], [ 1, %if.end145.us.peel ], [ 1, %if.end145.us.us.peel ], [ 1, %if.end145.peel ], [ 1, %if.end145.us251.peel ], [ 1, %if.end145.us ], [ 1, %if.end145.us.us.1 ], [ 1, %for.body85.us.us.prol.loopexit ], [ 1, %if.end145 ], [ 1, %if.end145.us251.1 ], [ 1, %for.body85.us234.prol.loopexit ]
%inc148 = add nsw i32 %year.0269, 1
%exitcond293 = icmp eq i32 %year.0269, %year2.0
br i1 %exitcond293, label %for.end149, label %for.cond82.preheader, !llvm.loop !16
for.end149: ; preds = %for.end, %if.end
%106 = phi i32 [ %.pre, %if.end ], [ %104, %for.end ]
%sub150 = add nsw i32 %106, -1
%call151 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub150)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @countday(i32 noundef %ddin, i32 noundef %ddfnl) local_unnamed_addr #3 {
entry:
%cmp.not4 = icmp sgt i32 %ddin, %ddfnl
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%count.promoted = load i32, ptr @count, align 4, !tbaa !8
%0 = add i32 %count.promoted, %ddfnl
%1 = add i32 %0, 1
%2 = sub i32 %1, %ddin
store i32 %2, ptr @count, align 4, !tbaa !8
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11, !12}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !11, !12}
!14 = distinct !{!14, !11, !12}
!15 = distinct !{!15, !11, !12}
!16 = distinct !{!16, !11}
|
#include <stdio.h>
#include <stdint.h>
int main() {
uint32_t N;
scanf("%u", &N);
uint32_t count = 0;
for(uint32_t i=1;i<=N;i++)
count += i;
printf("%u\n", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163883/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163883/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%u\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%u\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not5 = icmp eq i32 %0, 0
br i1 %cmp.not5, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add i32 %0, 1
%umax = call i32 @llvm.umax.i32(i32 %1, i32 2)
%2 = shl i32 %umax, 1
%3 = add i32 %umax, -2
%4 = zext i32 %3 to i33
%5 = add i32 %umax, -3
%6 = zext i32 %5 to i33
%7 = mul i33 %4, %6
%8 = lshr i33 %7, 1
%9 = trunc i33 %8 to i32
%10 = add i32 %2, %9
%11 = add i32 %10, -3
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %11, %for.body.preheader ]
%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 %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <math.h>
#define MOD 1000000007
#define REP(i,n) for ((i)=0;i<(n);i++)
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define LL long long
#define ULL unsigned long long
int main(void) {
long ans = 0;
int n,i;
scanf("%d", &n);
for(i = 1; i<=n;i++){
ans += i;
}
printf("%ld", ans);
return 0;
}
/* 最後の改行忘れるな!! */
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_163926/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_163926/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca 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
%cmp.not5 = icmp slt i32 %0, 1
br i1 %cmp.not5, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nsw i32 %0, -1
%2 = zext i32 %1 to i64
%3 = shl nuw nsw i64 %2, 1
%4 = zext i32 %1 to i64
%5 = add nsw i32 %0, -2
%6 = zext i32 %5 to i64
%7 = mul nuw nsw i64 %4, %6
%8 = lshr i64 %7, 1
%9 = add nuw nsw i64 %3, %8
%10 = add nuw nsw i64 %9, 1
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %10, %for.body.preheader ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
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"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.