Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
#include <stdlib.h>
int cmp(const void*a,const void*b){
return *(int*)a-*(int*)b;
}
int main(void){
int n,k;
scanf("%d%d",&n,&k);
int x[n];
int i;
for(i=0;i<n;i++)scanf("%d",&x[i]);
int ans = 0;
for(i=0;i<n;i++){
if( (2*x[i])>abs(k-x[i])*2){
ans += abs(k-x[i])*2;
}else ans+= 2*x[i];
}
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255524/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255524/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load 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:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp33 = icmp sgt i32 %3, 0
br i1 %cmp33, label %for.body, label %for.end21
for.cond2.preheader: ; preds = %for.body
%cmp335 = icmp sgt i32 %21, 0
br i1 %cmp335, label %for.body4.lr.ph, label %for.end21
for.body4.lr.ph: ; preds = %for.cond2.preheader
%4 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %21 to i64
%min.iters.check = icmp ult i32 %21, 8
br i1 %min.iters.check, label %for.body4.preheader, label %vector.ph
vector.ph: ; preds = %for.body4.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %4, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%5 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load47 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = shl nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
%8 = shl nsw <4 x i32> %wide.load47, <i32 1, i32 1, i32 1, i32 1>
%9 = sub nsw <4 x i32> %broadcast.splat, %wide.load
%10 = sub nsw <4 x i32> %broadcast.splat, %wide.load47
%11 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %9, i1 true)
%12 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %10, i1 true)
%13 = shl nuw nsw <4 x i32> %11, <i32 1, i32 1, i32 1, i32 1>
%14 = shl nuw nsw <4 x i32> %12, <i32 1, i32 1, i32 1, i32 1>
%15 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %7, <4 x i32> %13)
%16 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %8, <4 x i32> %14)
%17 = add <4 x i32> %15, %vec.phi
%18 = add <4 x i32> %16, %vec.phi46
%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
%bin.rdx = add <4 x i32> %18, %17
%20 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end21, label %for.body4.preheader
for.body4.preheader: ; preds = %for.body4.lr.ph, %middle.block
%indvars.iv41.ph = phi i64 [ 0, %for.body4.lr.ph ], [ %n.vec, %middle.block ]
%ans.037.ph = phi i32 [ 0, %for.body4.lr.ph ], [ %20, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%21 = load i32, ptr %n, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp = icmp slt i64 %indvars.iv.next, %22
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader, %for.body4
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body4 ], [ %indvars.iv41.ph, %for.body4.preheader ]
%ans.037 = phi i32 [ %ans.1, %for.body4 ], [ %ans.037.ph, %for.body4.preheader ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv41
%23 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%mul = shl nsw i32 %23, 1
%sub = sub nsw i32 %4, %23
%24 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%mul9 = shl nuw nsw i32 %24, 1
%mul9.mul = call i32 @llvm.smin.i32(i32 %mul, i32 %mul9)
%ans.1 = add nsw i32 %mul9.mul, %ans.037
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%exitcond.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count
br i1 %exitcond.not, label %for.end21, label %for.body4, !llvm.loop !14
for.end21: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %20, %middle.block ], [ %ans.1, %for.body4 ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(void)
{
int n, k, x;
int a, b;
int i, min, sum;
scanf("%d %d", &n, &k);
for(i = 1; i <= n; i++){
scanf("%d", &x);
a = x * 2;
b = (k - x) * 2;
if(a < b){
min = a;
}else{
min = b;
}
sum += min;
}
printf("%d", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255582/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255582/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%x = 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 %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not9 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp.not9)
br label %for.body
for.body: ; preds = %entry, %for.body
%sum.011 = phi i32 [ %add, %for.body ], [ undef, %entry ]
%i.010 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%2 = load i32, ptr %k, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
%mul2 = shl nsw i32 %sub, 1
%mul.mul2 = call i32 @llvm.smin.i32(i32 %mul, i32 %mul2)
%add = add nsw i32 %mul.mul2, %sum.011
%inc = add nuw nsw i32 %i.010, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.010, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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"}
|
#include <stdio.h>
int main (){
int n,k,i,x,count;
scanf("%d %d",&n,&k);
for(i=0; i<n; i++){
scanf("%d",&x);
if(x<k-x){
count+=2*x;
}else{
count+=(2*k-2*x);
}
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255625/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255625/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%x = 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 %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp11)
br label %for.body
for.body: ; preds = %entry, %for.body
%count.013 = phi i32 [ %count.1, %for.body ], [ undef, %entry ]
%i.012 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%2 = load i32, ptr %k, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
%mul.pn.in = call i32 @llvm.smin.i32(i32 %1, i32 %sub)
%mul.pn = shl nsw i32 %mul.pn.in, 1
%count.1 = add nsw i32 %mul.pn, %count.013
%inc = add nuw nsw i32 %i.012, 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
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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"}
|
#include <stdio.h>
#include <stdlib.h>
int mark=0;
void perm(long int a[],int k,int n){ //Time limit
int i,c=0;
long int temp;
if(k==n-1){
for(i=1;i<n;i++){
if(a[i-1]*a[i]%4==0)
c++;
}
if(c==n-1)
mark=1;
}else{
for(i=k;i<n;i++){
temp=a[k];a[k]=a[i];a[i]=temp;
perm(a,k+1,n);
temp=a[k];a[k]=a[i];a[i]=temp;
}
}
}
int main()
{
long int n,n4=0,n2=0;
scanf("%ld",&n);
long int a[n];
int i=0;
for(i=0;i<n;i++){
scanf("%ld",&a[i]);
}
/*perm(a,0,n);
if(mark)
printf("Yes");
else
printf("No");*/
for(i=0;i<n;i++){
if(a[i]%4==0)
n4++;
else if(a[i]%2==0)
n2++;
}
if(2*n4+n2>=n||2*n4+1==n)
printf("Yes");
else
printf("No");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255669/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255669/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mark = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @perm(ptr nocapture noundef %a, i32 noundef %k, i32 noundef %n) local_unnamed_addr #0 {
entry:
%sub = add nsw i32 %n, -1
%cmp = icmp eq i32 %sub, %k
br i1 %cmp, label %for.cond.preheader, label %for.cond12.preheader
for.cond12.preheader: ; preds = %entry
%cmp1366 = icmp slt i32 %k, %n
br i1 %cmp1366, label %for.body14.lr.ph, label %if.end34
for.body14.lr.ph: ; preds = %for.cond12.preheader
%idxprom15 = sext i32 %k to i64
%arrayidx16 = getelementptr inbounds i64, ptr %a, i64 %idxprom15
%add = add nsw i32 %k, 1
br label %for.body14
for.cond.preheader: ; preds = %entry
%cmp168 = icmp sgt i32 %n, 1
br i1 %cmp168, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %n to i64
%.pre = load i64, ptr %a, align 8, !tbaa !5
%0 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %0, 1
%1 = icmp eq i32 %n, 2
br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %0, -2
%invariant.gep = getelementptr i64, ptr %a, i64 1
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%2 = phi i64 [ %.pre, %for.body.preheader.new ], [ %5, %for.body ]
%indvars.iv72 = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next73.1, %for.body ]
%c.069 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %indvars.iv72
%3 = load i64, ptr %arrayidx4, align 8, !tbaa !5
%mul = mul nsw i64 %3, %2
%4 = and i64 %mul, 3
%cmp5 = icmp eq i64 %4, 0
%inc = zext i1 %cmp5 to i32
%spec.select = add nuw nsw i32 %c.069, %inc
%gep = getelementptr i64, ptr %invariant.gep, i64 %indvars.iv72
%5 = load i64, ptr %gep, align 8, !tbaa !5
%mul.1 = mul nsw i64 %5, %3
%6 = and i64 %mul.1, 3
%cmp5.1 = icmp eq i64 %6, 0
%inc.1 = zext i1 %cmp5.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%indvars.iv.next73.1 = add nuw nsw i64 %indvars.iv72, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.body ]
%.unr = phi i64 [ %.pre, %for.body.preheader ], [ %5, %for.body ]
%indvars.iv72.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next73.1, %for.body ]
%c.069.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.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
%arrayidx4.epil = getelementptr inbounds i64, ptr %a, i64 %indvars.iv72.unr
%7 = load i64, ptr %arrayidx4.epil, align 8, !tbaa !5
%mul.epil = mul nsw i64 %7, %.unr
%8 = and i64 %mul.epil, 3
%cmp5.epil = icmp eq i64 %8, 0
%inc.epil = zext i1 %cmp5.epil to i32
%spec.select.epil = add nuw nsw i32 %c.069.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %for.cond.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%cmp9 = icmp eq i32 %c.0.lcssa, %k
br i1 %cmp9, label %if.then10, label %if.end34
if.then10: ; preds = %for.end
store i32 1, ptr @mark, align 4, !tbaa !11
br label %if.end34
for.body14: ; preds = %for.body14.lr.ph, %for.body14
%indvars.iv = phi i64 [ %idxprom15, %for.body14.lr.ph ], [ %indvars.iv.next, %for.body14 ]
%9 = load i64, ptr %arrayidx16, align 8, !tbaa !5
%arrayidx18 = getelementptr inbounds i64, ptr %a, i64 %indvars.iv
%10 = load i64, ptr %arrayidx18, align 8, !tbaa !5
store i64 %10, ptr %arrayidx16, align 8, !tbaa !5
store i64 %9, ptr %arrayidx18, align 8, !tbaa !5
tail call void @perm(ptr noundef %a, i32 noundef %add, i32 noundef %n)
%11 = load i64, ptr %arrayidx16, align 8, !tbaa !5
%12 = load i64, ptr %arrayidx18, align 8, !tbaa !5
store i64 %12, ptr %arrayidx16, align 8, !tbaa !5
store i64 %11, ptr %arrayidx18, align 8, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %lftr.wideiv, %n
br i1 %exitcond.not, label %if.end34, label %for.body14, !llvm.loop !13
if.end34: ; preds = %for.body14, %for.cond12.preheader, %for.end, %if.then10
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp44 = icmp sgt i64 %2, 0
br i1 %cmp44, label %for.body, label %for.end23
for.cond3.preheader: ; preds = %for.body
%cmp547 = icmp sgt i64 %24, 0
br i1 %cmp547, label %for.body7.preheader, label %for.end23
for.body7.preheader: ; preds = %for.cond3.preheader
%min.iters.check = icmp ult i64 %24, 4
br i1 %min.iters.check, label %for.body7.preheader68, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %24, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%vec.phi62 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
%vec.phi63 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi64 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%3 = getelementptr inbounds i64, ptr %vla, i64 %index
%wide.load = load <2 x i64>, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds i64, ptr %3, i64 2
%wide.load65 = load <2 x i64>, ptr %4, align 16, !tbaa !5
%5 = and <2 x i64> %wide.load, <i64 3, i64 3>
%6 = and <2 x i64> %wide.load65, <i64 3, i64 3>
%7 = icmp eq <2 x i64> %5, zeroinitializer
%8 = icmp eq <2 x i64> %6, zeroinitializer
%9 = and <2 x i64> %wide.load, <i64 1, i64 1>
%10 = and <2 x i64> %wide.load65, <i64 1, i64 1>
%11 = xor <2 x i64> %9, <i64 1, i64 1>
%12 = xor <2 x i64> %10, <i64 1, i64 1>
%13 = select <2 x i1> %7, <2 x i64> zeroinitializer, <2 x i64> %11
%14 = select <2 x i1> %8, <2 x i64> zeroinitializer, <2 x i64> %12
%15 = add <2 x i64> %vec.phi63, %13
%16 = add <2 x i64> %vec.phi64, %14
%17 = zext <2 x i1> %7 to <2 x i64>
%18 = zext <2 x i1> %8 to <2 x i64>
%19 = add <2 x i64> %vec.phi, %17
%20 = add <2 x i64> %vec.phi62, %18
%index.next = add nuw i64 %index, 4
%21 = icmp eq i64 %index.next, %n.vec
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx66 = add <2 x i64> %16, %15
%22 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx66)
%bin.rdx = add <2 x i64> %20, %19
%23 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %24, %n.vec
br i1 %cmp.n, label %for.end23.loopexit, label %for.body7.preheader68
for.body7.preheader68: ; preds = %for.body7.preheader, %middle.block
%indvars.iv56.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ]
%n4.049.ph = phi i64 [ 0, %for.body7.preheader ], [ %23, %middle.block ]
%n2.048.ph = phi i64 [ 0, %for.body7.preheader ], [ %22, %middle.block ]
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%24 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp sgt i64 %24, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !17
for.body7: ; preds = %for.body7.preheader68, %for.body7
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body7 ], [ %indvars.iv56.ph, %for.body7.preheader68 ]
%n4.049 = phi i64 [ %n4.1, %for.body7 ], [ %n4.049.ph, %for.body7.preheader68 ]
%n2.048 = phi i64 [ %n2.1, %for.body7 ], [ %n2.048.ph, %for.body7.preheader68 ]
%arrayidx9 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv56
%25 = load i64, ptr %arrayidx9, align 8, !tbaa !5
%26 = and i64 %25, 3
%cmp10 = icmp eq i64 %26, 0
%27 = and i64 %25, 1
%28 = xor i64 %27, 1
%spec.select = select i1 %cmp10, i64 0, i64 %28
%n2.1 = add i64 %n2.048, %spec.select
%inc12 = zext i1 %cmp10 to i64
%n4.1 = add nuw nsw i64 %n4.049, %inc12
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%exitcond.not = icmp eq i64 %indvars.iv.next57, %24
br i1 %exitcond.not, label %for.end23.loopexit, label %for.body7, !llvm.loop !18
for.end23.loopexit: ; preds = %for.body7, %middle.block
%n2.1.lcssa = phi i64 [ %22, %middle.block ], [ %n2.1, %for.body7 ]
%n4.1.lcssa = phi i64 [ %23, %middle.block ], [ %n4.1, %for.body7 ]
%29 = shl nuw nsw i64 %n4.1.lcssa, 1
br label %for.end23
for.end23: ; preds = %entry, %for.end23.loopexit, %for.cond3.preheader
%.lcssa61 = phi i64 [ %24, %for.cond3.preheader ], [ %24, %for.end23.loopexit ], [ %2, %entry ]
%n2.0.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ %n2.1.lcssa, %for.end23.loopexit ], [ 0, %entry ]
%n4.0.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ %29, %for.end23.loopexit ], [ 0, %entry ]
%add = add nsw i64 %n4.0.lcssa, %n2.0.lcssa
%cmp24.not = icmp sge i64 %add, %.lcssa61
%add27 = or i64 %n4.0.lcssa, 1
%cmp28 = icmp eq i64 %add27, %.lcssa61
%or.cond = or i1 %cmp24.not, %cmp28
%.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5
attributes #0 = { nofree nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !16, !15}
|
#include <stdio.h>
int main() {
int n,a,p = 0,d = 0,q = 0;
scanf("%d",&n);
for(int i = 0; i < n; i++) {
scanf("%d",&a);
if(a%2 == 0) {
if(a%4 == 0) {
q++;
} else {
d++;
}
}
}
p = n - d - q;
// printf("%d%d%d",p,d,q);
if(d == 0) {
if(q >= p - 1) printf("Yes");
else printf("No");
} else {
if(q >= p) printf("Yes");
else printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255719/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255719/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %if.then11
for.cond.cleanup: ; preds = %for.inc
%1 = add i32 %q.1, %d.1
%sub9 = sub i32 %5, %1
%cmp10 = icmp eq i32 %d.1, 0
br i1 %cmp10, label %if.then11, label %if.else19
for.body: ; preds = %entry, %for.inc
%i.037 = phi i32 [ %inc8, %for.inc ], [ 0, %entry ]
%q.036 = phi i32 [ %q.1, %for.inc ], [ 0, %entry ]
%d.035 = phi i32 [ %d.1, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = and i32 %2, 1
%cmp2 = icmp eq i32 %3, 0
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
%4 = and i32 %2, 3
%cmp4 = icmp eq i32 %4, 0
br i1 %cmp4, label %if.then5, label %if.else
if.then5: ; preds = %if.then
%inc = add nsw i32 %q.036, 1
br label %for.inc
if.else: ; preds = %if.then
%inc6 = add nsw i32 %d.035, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.else, %if.then5
%d.1 = phi i32 [ %d.035, %if.then5 ], [ %inc6, %if.else ], [ %d.035, %for.body ]
%q.1 = phi i32 [ %inc, %if.then5 ], [ %q.036, %if.else ], [ %q.036, %for.body ]
%inc8 = add nuw nsw i32 %i.037, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc8, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then11: ; preds = %entry, %for.cond.cleanup
%sub947 = phi i32 [ %sub9, %for.cond.cleanup ], [ %0, %entry ]
%q.0.lcssa46 = phi i32 [ %q.1, %for.cond.cleanup ], [ 0, %entry ]
%sub12 = add nsw i32 %sub947, -1
%cmp13.not = icmp slt i32 %q.0.lcssa46, %sub12
br label %if.end26
if.else19: ; preds = %for.cond.cleanup
%cmp20.not = icmp slt i32 %q.1, %sub9
br label %if.end26
if.end26: ; preds = %if.else19, %if.then11
%cmp20.not.sink = phi i1 [ %cmp20.not, %if.else19 ], [ %cmp13.not, %if.then11 ]
%.str.2..str.148 = select i1 %cmp20.not.sink, ptr @.str.2, ptr @.str.1
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.148)
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: 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 min(int a, int b){return a < b ? a : b;}
int main(){
int i = 0, h, n;
scanf("%d%d",&h,&n);
int a[n], b[n], dp[h];
for(; i < n; i++)
scanf("%d%d",&a[i],&b[i]);
for(i= 0; i < h; i++)
dp[i] = (1 + i / a[0]) * b[0];
for(i = 1; i < n; i++)
for(int j = 0; j < h; j++){
if(j < a[i])
dp[j] = min(dp[j], b[i]);
else
dp[j] = min(dp[j], dp[j - a[i]] + b[i]);
}
printf("%d\n",dp[h - 1]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255762/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255762/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%h = alloca i32, align 4
%n = 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 %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%5 = load i32, ptr %h, align 4, !tbaa !5
%6 = zext i32 %5 to i64
%vla2 = alloca i32, i64 %6, align 16
%cmp76 = icmp sgt i32 %3, 0
br i1 %cmp76, label %for.body, label %for.cond6.preheader
for.cond6.preheader.loopexit: ; preds = %for.body
%.pre = load i32, ptr %h, align 4, !tbaa !5
br label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.cond6.preheader.loopexit, %entry
%7 = phi i32 [ %5, %entry ], [ %.pre, %for.cond6.preheader.loopexit ]
%.lcssa75 = phi i32 [ %3, %entry ], [ %11, %for.cond6.preheader.loopexit ]
%cmp778 = icmp slt i32 %7, 1
br i1 %cmp778, label %for.end49, label %for.body8.lr.ph
for.body8.lr.ph: ; preds = %for.cond6.preheader
%8 = load i32, ptr %vla, align 16, !tbaa !5
%9 = load i32, ptr %vla1, align 16, !tbaa !5
%wide.trip.count = zext i32 %7 to i64
%xtraiter = and i64 %wide.trip.count, 1
%10 = icmp eq i32 %7, 1
br i1 %10, label %for.cond16.preheader.unr-lcssa, label %for.body8.lr.ph.new
for.body8.lr.ph.new: ; preds = %for.body8.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp, label %for.body, label %for.cond6.preheader.loopexit, !llvm.loop !9
for.cond16.preheader.unr-lcssa: ; preds = %for.body8, %for.body8.lr.ph
%indvars.iv87.unr = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next88.1, %for.body8 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond16.preheader, label %for.body8.epil
for.body8.epil: ; preds = %for.cond16.preheader.unr-lcssa
%13 = trunc i64 %indvars.iv87.unr to i32
%div.epil = sdiv i32 %13, %8
%add.epil = add nsw i32 %div.epil, 1
%mul.epil = mul nsw i32 %add.epil, %9
%arrayidx12.epil = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv87.unr
store i32 %mul.epil, ptr %arrayidx12.epil, align 4, !tbaa !5
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond16.preheader.unr-lcssa, %for.body8.epil
%cmp1783 = icmp slt i32 %.lcssa75, 2
%brmerge = or i1 %cmp1783, %cmp778
br i1 %brmerge, label %for.end49, label %for.cond19.preheader.us.preheader
for.cond19.preheader.us.preheader: ; preds = %for.cond16.preheader
%wide.trip.count99 = zext i32 %.lcssa75 to i64
%wide.trip.count94 = zext i32 %7 to i64
br label %for.cond19.preheader.us
for.cond19.preheader.us: ; preds = %for.cond19.preheader.us.preheader, %for.cond19.for.cond.cleanup_crit_edge.us
%indvars.iv96 = phi i64 [ 1, %for.cond19.preheader.us.preheader ], [ %indvars.iv.next97, %for.cond19.for.cond.cleanup_crit_edge.us ]
%arrayidx23.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv96
%14 = load i32, ptr %arrayidx23.us, align 4, !tbaa !5
%arrayidx39.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv96
%15 = sext i32 %14 to i64
br label %for.body21.us
for.body21.us: ; preds = %for.cond19.preheader.us, %for.inc44.us
%indvars.iv90 = phi i64 [ 0, %for.cond19.preheader.us ], [ %indvars.iv.next91, %for.inc44.us ]
%cmp24.us = icmp slt i64 %indvars.iv90, %15
%arrayidx26.us = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv90
%16 = load i32, ptr %arrayidx26.us, align 4, !tbaa !5
br i1 %cmp24.us, label %if.then.us, label %if.else.us
if.else.us: ; preds = %for.body21.us
%17 = sub nsw i64 %indvars.iv90, %15
%arrayidx37.us = getelementptr inbounds i32, ptr %vla2, i64 %17
%18 = load i32, ptr %arrayidx37.us, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5
%add40.us = add nsw i32 %19, %18
br label %for.inc44.us
if.then.us: ; preds = %for.body21.us
%20 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5
br label %for.inc44.us
for.inc44.us: ; preds = %if.then.us, %if.else.us
%.sink = phi i32 [ %20, %if.then.us ], [ %add40.us, %if.else.us ]
%cond.i.us = call i32 @llvm.smin.i32(i32 %16, i32 %.sink)
store i32 %cond.i.us, ptr %arrayidx26.us, align 4, !tbaa !5
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%exitcond95.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count94
br i1 %exitcond95.not, label %for.cond19.for.cond.cleanup_crit_edge.us, label %for.body21.us, !llvm.loop !11
for.cond19.for.cond.cleanup_crit_edge.us: ; preds = %for.inc44.us
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
br i1 %exitcond100.not, label %for.end49, label %for.cond19.preheader.us, !llvm.loop !12
for.body8: ; preds = %for.body8, %for.body8.lr.ph.new
%indvars.iv87 = phi i64 [ 0, %for.body8.lr.ph.new ], [ %indvars.iv.next88.1, %for.body8 ]
%niter = phi i64 [ 0, %for.body8.lr.ph.new ], [ %niter.next.1, %for.body8 ]
%21 = trunc i64 %indvars.iv87 to i32
%div = sdiv i32 %21, %8
%add = add nsw i32 %div, 1
%mul = mul nsw i32 %add, %9
%arrayidx12 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv87
store i32 %mul, ptr %arrayidx12, align 8, !tbaa !5
%indvars.iv.next88 = or i64 %indvars.iv87, 1
%22 = trunc i64 %indvars.iv.next88 to i32
%div.1 = sdiv i32 %22, %8
%add.1 = add nsw i32 %div.1, 1
%mul.1 = mul nsw i32 %add.1, %9
%arrayidx12.1 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next88
store i32 %mul.1, ptr %arrayidx12.1, align 4, !tbaa !5
%indvars.iv.next88.1 = add nuw nsw i64 %indvars.iv87, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond16.preheader.unr-lcssa, label %for.body8, !llvm.loop !13
for.end49: ; preds = %for.cond19.for.cond.cleanup_crit_edge.us, %for.cond16.preheader, %for.cond6.preheader
%sub50 = add nsw i32 %7, -1
%idxprom51 = sext i32 %sub50 to i64
%arrayidx52 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom51
%23 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %23)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 willreturn
declare ptr @llvm.stacksave.p0() #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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
// ABC 153-E
// 2020.1.26 bal4u
#include <stdio.h>
#include <string.h>
#define gc() getchar_unlocked()
int in() { // 非負整数の入力
int n = 0, c = gc();
do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
return n;
}
int N;
int dp[30005];
int main()
{
int i, H, ans;
H = in(), N = in();
memset(dp, -1, sizeof(dp));
dp[0] = 0;
while (N--) {
int A = in(), B = in();
for (i = 0; i <= H; ++i) if (dp[i] >= 0) {
if (dp[i+A] < 0 || dp[i] + B < dp[i+A]) dp[i+A] = dp[i] + B;
}
}
ans = 0x5fffffff;
for (i = H; i <= H+10000; ++i) if (dp[i] >= 0 && dp[i] < ans) ans = dp[i];
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255805/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255805/source.c"
target datalayout = "e-m:e-p270: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] }
@N = dso_local local_unnamed_addr global i32 0, align 4
@dp = dso_local local_unnamed_addr global [30005 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4
%.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: 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
%.ph181 = 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 ], [ %.ph181, %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 i32 %n.0.i, 10
%and.i = and i32 %c.0.i, 15
%add.i = add 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
%_IO_read_ptr.i.i62 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1
%9 = load ptr, ptr %_IO_read_ptr.i.i62, align 8, !tbaa !9
%_IO_read_end.i.i63 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2
%10 = load ptr, ptr %_IO_read_end.i.i63, align 8, !tbaa !14
%cmp.not.i.i64 = icmp ult ptr %9, %10
br i1 %cmp.not.i.i64, label %cond.false.i.i89, label %cond.true.i.i65, !prof !15
cond.true.i.i65: ; preds = %in.exit
%call.i.i66 = tail call i32 @__uflow(ptr noundef nonnull %8) #4
%.pre13.pre.i67 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i71.preheader
cond.false.i.i89: ; preds = %in.exit
%incdec.ptr.i.i90 = getelementptr inbounds i8, ptr %9, i64 1
store ptr %incdec.ptr.i.i90, ptr %_IO_read_ptr.i.i62, align 8, !tbaa !9
%11 = load i8, ptr %9, align 1, !tbaa !16
%conv3.i.i91 = zext i8 %11 to i32
br label %do.body.i71.preheader
do.body.i71.preheader: ; preds = %cond.false.i.i89, %cond.true.i.i65
%.ph179 = phi ptr [ %8, %cond.false.i.i89 ], [ %.pre13.pre.i67, %cond.true.i.i65 ]
%c.0.i73.ph = phi i32 [ %conv3.i.i91, %cond.false.i.i89 ], [ %call.i.i66, %cond.true.i.i65 ]
br label %do.body.i71
do.body.i71: ; preds = %do.body.i71.preheader, %getchar_unlocked.exit12.i83
%12 = phi ptr [ %16, %getchar_unlocked.exit12.i83 ], [ %.ph179, %do.body.i71.preheader ]
%n.0.i72 = phi i32 [ %add.i76, %getchar_unlocked.exit12.i83 ], [ 0, %do.body.i71.preheader ]
%c.0.i73 = phi i32 [ %cond.i8.i84, %getchar_unlocked.exit12.i83 ], [ %c.0.i73.ph, %do.body.i71.preheader ]
%mul.i74 = mul nsw i32 %n.0.i72, 10
%and.i75 = and i32 %c.0.i73, 15
%add.i76 = add nsw i32 %and.i75, %mul.i74
%_IO_read_ptr.i3.i77 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1
%13 = load ptr, ptr %_IO_read_ptr.i3.i77, align 8, !tbaa !9
%_IO_read_end.i4.i78 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2
%14 = load ptr, ptr %_IO_read_end.i4.i78, align 8, !tbaa !14
%cmp.not.i5.i79 = icmp ult ptr %13, %14
br i1 %cmp.not.i5.i79, label %cond.false.i9.i86, label %cond.true.i6.i80, !prof !15
cond.true.i6.i80: ; preds = %do.body.i71
%call.i7.i81 = tail call i32 @__uflow(ptr noundef nonnull %12) #4
%.pre.i82 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12.i83
cond.false.i9.i86: ; preds = %do.body.i71
%incdec.ptr.i10.i87 = getelementptr inbounds i8, ptr %13, i64 1
store ptr %incdec.ptr.i10.i87, ptr %_IO_read_ptr.i3.i77, align 8, !tbaa !9
%15 = load i8, ptr %13, align 1, !tbaa !16
%conv3.i11.i88 = zext i8 %15 to i32
br label %getchar_unlocked.exit12.i83
getchar_unlocked.exit12.i83: ; preds = %cond.false.i9.i86, %cond.true.i6.i80
%16 = phi ptr [ %.pre.i82, %cond.true.i6.i80 ], [ %12, %cond.false.i9.i86 ]
%cond.i8.i84 = phi i32 [ %call.i7.i81, %cond.true.i6.i80 ], [ %conv3.i11.i88, %cond.false.i9.i86 ]
%cmp.i85 = icmp sgt i32 %cond.i8.i84, 47
br i1 %cmp.i85, label %do.body.i71, label %in.exit92, !llvm.loop !17
in.exit92: ; preds = %getchar_unlocked.exit12.i83
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120020) @dp, i8 -1, i64 120020, i1 false)
store i32 0, ptr @dp, align 16, !tbaa !19
%dec157 = add nsw i32 %add.i76, -1
store i32 %dec157, ptr @N, align 4, !tbaa !19
%tobool.not158 = icmp eq i32 %add.i76, 0
br i1 %tobool.not158, label %for.cond23.preheader, label %while.body.lr.ph
while.body.lr.ph: ; preds = %in.exit92
%cmp.not155 = icmp slt i32 %add.i, 0
%17 = or i32 %mul.i, 1
%18 = and i32 %c.0.i, 15
%19 = add i32 %17, %18
%wide.trip.count = zext i32 %19 to i64
br label %while.body
while.condthread-pre-split: ; preds = %for.inc, %for.cond.preheader
%.pr = load i32, ptr @N, align 4, !tbaa !19
%dec = add nsw i32 %.pr, -1
store i32 %dec, ptr @N, align 4, !tbaa !19
%tobool.not = icmp eq i32 %.pr, 0
br i1 %tobool.not, label %for.cond23.preheader, label %while.body
for.cond23.preheader: ; preds = %while.condthread-pre-split, %in.exit92
%add24 = add nsw i32 %add.i, 10000
%20 = sext i32 %add.i to i64
%21 = sext i32 %add24 to i64
br label %for.body26
while.body: ; preds = %while.body.lr.ph, %while.condthread-pre-split
%22 = phi ptr [ %16, %while.body.lr.ph ], [ %42, %while.condthread-pre-split ]
%23 = phi ptr [ %16, %while.body.lr.ph ], [ %43, %while.condthread-pre-split ]
%_IO_read_ptr.i.i93 = getelementptr inbounds %struct._IO_FILE, ptr %23, i64 0, i32 1
%24 = load ptr, ptr %_IO_read_ptr.i.i93, align 8, !tbaa !9
%_IO_read_end.i.i94 = getelementptr inbounds %struct._IO_FILE, ptr %23, i64 0, i32 2
%25 = load ptr, ptr %_IO_read_end.i.i94, align 8, !tbaa !14
%cmp.not.i.i95 = icmp ult ptr %24, %25
br i1 %cmp.not.i.i95, label %cond.false.i.i120, label %cond.true.i.i96, !prof !15
cond.true.i.i96: ; preds = %while.body
%call.i.i97 = tail call i32 @__uflow(ptr noundef nonnull %23) #4
%.pre13.pre.i98 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i102.preheader
cond.false.i.i120: ; preds = %while.body
%incdec.ptr.i.i121 = getelementptr inbounds i8, ptr %24, i64 1
store ptr %incdec.ptr.i.i121, ptr %_IO_read_ptr.i.i93, align 8, !tbaa !9
%26 = load i8, ptr %24, align 1, !tbaa !16
%conv3.i.i122 = zext i8 %26 to i32
br label %do.body.i102.preheader
do.body.i102.preheader: ; preds = %cond.false.i.i120, %cond.true.i.i96
%.ph175 = phi ptr [ %22, %cond.false.i.i120 ], [ %.pre13.pre.i98, %cond.true.i.i96 ]
%.ph176 = phi ptr [ %23, %cond.false.i.i120 ], [ %.pre13.pre.i98, %cond.true.i.i96 ]
%c.0.i104.ph = phi i32 [ %conv3.i.i122, %cond.false.i.i120 ], [ %call.i.i97, %cond.true.i.i96 ]
br label %do.body.i102
do.body.i102: ; preds = %do.body.i102.preheader, %getchar_unlocked.exit12.i114
%27 = phi ptr [ %32, %getchar_unlocked.exit12.i114 ], [ %.ph175, %do.body.i102.preheader ]
%28 = phi ptr [ %33, %getchar_unlocked.exit12.i114 ], [ %.ph176, %do.body.i102.preheader ]
%n.0.i103 = phi i32 [ %add.i107, %getchar_unlocked.exit12.i114 ], [ 0, %do.body.i102.preheader ]
%c.0.i104 = phi i32 [ %cond.i8.i115, %getchar_unlocked.exit12.i114 ], [ %c.0.i104.ph, %do.body.i102.preheader ]
%mul.i105 = mul nsw i32 %n.0.i103, 10
%and.i106 = and i32 %c.0.i104, 15
%add.i107 = add nsw i32 %and.i106, %mul.i105
%_IO_read_ptr.i3.i108 = getelementptr inbounds %struct._IO_FILE, ptr %28, i64 0, i32 1
%29 = load ptr, ptr %_IO_read_ptr.i3.i108, align 8, !tbaa !9
%_IO_read_end.i4.i109 = getelementptr inbounds %struct._IO_FILE, ptr %28, i64 0, i32 2
%30 = load ptr, ptr %_IO_read_end.i4.i109, align 8, !tbaa !14
%cmp.not.i5.i110 = icmp ult ptr %29, %30
br i1 %cmp.not.i5.i110, label %cond.false.i9.i117, label %cond.true.i6.i111, !prof !15
cond.true.i6.i111: ; preds = %do.body.i102
%call.i7.i112 = tail call i32 @__uflow(ptr noundef nonnull %28) #4
%.pre.i113 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12.i114
cond.false.i9.i117: ; preds = %do.body.i102
%incdec.ptr.i10.i118 = getelementptr inbounds i8, ptr %29, i64 1
store ptr %incdec.ptr.i10.i118, ptr %_IO_read_ptr.i3.i108, align 8, !tbaa !9
%31 = load i8, ptr %29, align 1, !tbaa !16
%conv3.i11.i119 = zext i8 %31 to i32
br label %getchar_unlocked.exit12.i114
getchar_unlocked.exit12.i114: ; preds = %cond.false.i9.i117, %cond.true.i6.i111
%32 = phi ptr [ %.pre.i113, %cond.true.i6.i111 ], [ %27, %cond.false.i9.i117 ]
%33 = phi ptr [ %.pre.i113, %cond.true.i6.i111 ], [ %28, %cond.false.i9.i117 ]
%cond.i8.i115 = phi i32 [ %call.i7.i112, %cond.true.i6.i111 ], [ %conv3.i11.i119, %cond.false.i9.i117 ]
%cmp.i116 = icmp sgt i32 %cond.i8.i115, 47
br i1 %cmp.i116, label %do.body.i102, label %in.exit123, !llvm.loop !17
in.exit123: ; preds = %getchar_unlocked.exit12.i114
%_IO_read_ptr.i.i124 = getelementptr inbounds %struct._IO_FILE, ptr %32, i64 0, i32 1
%34 = load ptr, ptr %_IO_read_ptr.i.i124, align 8, !tbaa !9
%_IO_read_end.i.i125 = getelementptr inbounds %struct._IO_FILE, ptr %32, i64 0, i32 2
%35 = load ptr, ptr %_IO_read_end.i.i125, align 8, !tbaa !14
%cmp.not.i.i126 = icmp ult ptr %34, %35
br i1 %cmp.not.i.i126, label %cond.false.i.i151, label %cond.true.i.i127, !prof !15
cond.true.i.i127: ; preds = %in.exit123
%call.i.i128 = tail call i32 @__uflow(ptr noundef nonnull %32) #4
%.pre13.pre.i129 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i133.preheader
cond.false.i.i151: ; preds = %in.exit123
%incdec.ptr.i.i152 = getelementptr inbounds i8, ptr %34, i64 1
store ptr %incdec.ptr.i.i152, ptr %_IO_read_ptr.i.i124, align 8, !tbaa !9
%36 = load i8, ptr %34, align 1, !tbaa !16
%conv3.i.i153 = zext i8 %36 to i32
br label %do.body.i133.preheader
do.body.i133.preheader: ; preds = %cond.false.i.i151, %cond.true.i.i127
%.ph174 = phi ptr [ %32, %cond.false.i.i151 ], [ %.pre13.pre.i129, %cond.true.i.i127 ]
%c.0.i135.ph = phi i32 [ %conv3.i.i153, %cond.false.i.i151 ], [ %call.i.i128, %cond.true.i.i127 ]
br label %do.body.i133
do.body.i133: ; preds = %do.body.i133.preheader, %getchar_unlocked.exit12.i145
%37 = phi ptr [ %42, %getchar_unlocked.exit12.i145 ], [ %.ph174, %do.body.i133.preheader ]
%38 = phi ptr [ %43, %getchar_unlocked.exit12.i145 ], [ %.ph174, %do.body.i133.preheader ]
%n.0.i134 = phi i32 [ %add.i138, %getchar_unlocked.exit12.i145 ], [ 0, %do.body.i133.preheader ]
%c.0.i135 = phi i32 [ %cond.i8.i146, %getchar_unlocked.exit12.i145 ], [ %c.0.i135.ph, %do.body.i133.preheader ]
%mul.i136 = mul nsw i32 %n.0.i134, 10
%and.i137 = and i32 %c.0.i135, 15
%add.i138 = add nsw i32 %and.i137, %mul.i136
%_IO_read_ptr.i3.i139 = getelementptr inbounds %struct._IO_FILE, ptr %38, i64 0, i32 1
%39 = load ptr, ptr %_IO_read_ptr.i3.i139, align 8, !tbaa !9
%_IO_read_end.i4.i140 = getelementptr inbounds %struct._IO_FILE, ptr %38, i64 0, i32 2
%40 = load ptr, ptr %_IO_read_end.i4.i140, align 8, !tbaa !14
%cmp.not.i5.i141 = icmp ult ptr %39, %40
br i1 %cmp.not.i5.i141, label %cond.false.i9.i148, label %cond.true.i6.i142, !prof !15
cond.true.i6.i142: ; preds = %do.body.i133
%call.i7.i143 = tail call i32 @__uflow(ptr noundef nonnull %38) #4
%.pre.i144 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12.i145
cond.false.i9.i148: ; preds = %do.body.i133
%incdec.ptr.i10.i149 = getelementptr inbounds i8, ptr %39, i64 1
store ptr %incdec.ptr.i10.i149, ptr %_IO_read_ptr.i3.i139, align 8, !tbaa !9
%41 = load i8, ptr %39, align 1, !tbaa !16
%conv3.i11.i150 = zext i8 %41 to i32
br label %getchar_unlocked.exit12.i145
getchar_unlocked.exit12.i145: ; preds = %cond.false.i9.i148, %cond.true.i6.i142
%42 = phi ptr [ %.pre.i144, %cond.true.i6.i142 ], [ %37, %cond.false.i9.i148 ]
%43 = phi ptr [ %.pre.i144, %cond.true.i6.i142 ], [ %38, %cond.false.i9.i148 ]
%cond.i8.i146 = phi i32 [ %call.i7.i143, %cond.true.i6.i142 ], [ %conv3.i11.i150, %cond.false.i9.i148 ]
%cmp.i147 = icmp sgt i32 %cond.i8.i146, 47
br i1 %cmp.i147, label %do.body.i133, label %for.cond.preheader, !llvm.loop !17
for.cond.preheader: ; preds = %getchar_unlocked.exit12.i145
br i1 %cmp.not155, label %while.condthread-pre-split, label %for.body.preheader, !llvm.loop !20
for.body.preheader: ; preds = %for.cond.preheader
%44 = sext i32 %add.i107 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds [30005 x i32], ptr @dp, i64 0, i64 %indvars.iv
%45 = load i32, ptr %arrayidx, align 4, !tbaa !19
%cmp4 = icmp sgt i32 %45, -1
br i1 %cmp4, label %if.then, label %for.inc
if.then: ; preds = %for.body
%46 = add nsw i64 %indvars.iv, %44
%arrayidx6 = getelementptr inbounds [30005 x i32], ptr @dp, i64 0, i64 %46
%47 = load i32, ptr %arrayidx6, align 4, !tbaa !19
%cmp7 = icmp slt i32 %47, 0
%add10 = add nsw i32 %45, %add.i138
%cmp14 = icmp slt i32 %add10, %47
%or.cond = select i1 %cmp7, i1 true, i1 %cmp14
br i1 %or.cond, label %if.then15, label %for.inc
if.then15: ; preds = %if.then
store i32 %add10, ptr %arrayidx6, align 4, !tbaa !19
br label %for.inc
for.inc: ; preds = %if.then, %for.body, %if.then15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %while.condthread-pre-split, label %for.body, !llvm.loop !21
for.body26: ; preds = %for.cond23.preheader, %for.body26
%indvars.iv163 = phi i64 [ %20, %for.cond23.preheader ], [ %indvars.iv.next164, %for.body26 ]
%ans.0159 = phi i32 [ 1610612735, %for.cond23.preheader ], [ %ans.1, %for.body26 ]
%arrayidx28 = getelementptr inbounds [30005 x i32], ptr @dp, i64 0, i64 %indvars.iv163
%48 = load i32, ptr %arrayidx28, align 4, !tbaa !19
%cmp29 = icmp sgt i32 %48, -1
%cmp32 = icmp slt i32 %48, %ans.0159
%or.cond61 = select i1 %cmp29, i1 %cmp32, i1 false
%ans.1 = select i1 %or.cond61, i32 %48, i32 %ans.0159
%indvars.iv.next164 = add nsw i64 %indvars.iv163, 1
%cmp25.not.not = icmp slt i64 %indvars.iv163, %21
br i1 %cmp25.not.not, label %for.body26, label %for.end39, !llvm.loop !22
for.end39: ; preds = %for.body26
%call40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.1)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
declare i32 @__uflow(ptr noundef) local_unnamed_addr #3
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int i;
char s[200000]={};
scanf("%s",&s);
int l=strlen(s);
for(i=0;i<l;i++){
if(s[i]=='?') printf("D");
else printf("%c",s[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255849/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255849/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [200000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 200000, ptr nonnull %s) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200000) %s, i8 0, i64 200000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7
%conv = trunc i64 %call1 to i32
%cmp15 = icmp sgt i32 %conv, 0
br i1 %cmp15, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call1, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds [200000 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp4 = icmp eq i8 %0, 63
%narrow = select i1 %cmp4, i8 68, i8 %0
%.sink = sext i8 %narrow to i32
%putchar14 = call i32 @putchar(i32 %.sink)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 200000, ptr nonnull %s) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void){
char a[1000000];
int n,i;
scanf("%s",a);
n=strlen(a);
for(i=0;i<n;i++){
if(a[i]=='?'){
a[i]='D';
}
}
printf("%s\n",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255892/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255892/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [1000000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%conv = trunc i64 %call2 to i32
%cmp14 = icmp sgt i32 %conv, 0
br i1 %cmp14, label %iter.check, label %for.end
iter.check: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check17 = icmp ult i64 %wide.trip.count, 32
br i1 %min.iters.check17, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.mod.vf = and i64 %call2, 31
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %pred.store.continue80, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue80 ]
%0 = or i64 %index, 16
%1 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %index
%wide.load = load <16 x i8>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i8, ptr %1, i64 16
%wide.load18 = load <16 x i8>, ptr %2, align 16, !tbaa !5
%3 = icmp eq <16 x i8> %wide.load, <i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63>
%4 = icmp eq <16 x i8> %wide.load18, <i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63>
%5 = extractelement <16 x i1> %3, i64 0
br i1 %5, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%6 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %index
store i8 68, ptr %6, align 16, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%7 = extractelement <16 x i1> %3, i64 1
br i1 %7, label %pred.store.if19, label %pred.store.continue20
pred.store.if19: ; preds = %pred.store.continue
%8 = or i64 %index, 1
%9 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %8
store i8 68, ptr %9, align 1, !tbaa !5
br label %pred.store.continue20
pred.store.continue20: ; preds = %pred.store.if19, %pred.store.continue
%10 = extractelement <16 x i1> %3, i64 2
br i1 %10, label %pred.store.if21, label %pred.store.continue22
pred.store.if21: ; preds = %pred.store.continue20
%11 = or i64 %index, 2
%12 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %11
store i8 68, ptr %12, align 2, !tbaa !5
br label %pred.store.continue22
pred.store.continue22: ; preds = %pred.store.if21, %pred.store.continue20
%13 = extractelement <16 x i1> %3, i64 3
br i1 %13, label %pred.store.if23, label %pred.store.continue24
pred.store.if23: ; preds = %pred.store.continue22
%14 = or i64 %index, 3
%15 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %14
store i8 68, ptr %15, align 1, !tbaa !5
br label %pred.store.continue24
pred.store.continue24: ; preds = %pred.store.if23, %pred.store.continue22
%16 = extractelement <16 x i1> %3, i64 4
br i1 %16, label %pred.store.if25, label %pred.store.continue26
pred.store.if25: ; preds = %pred.store.continue24
%17 = or i64 %index, 4
%18 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %17
store i8 68, ptr %18, align 4, !tbaa !5
br label %pred.store.continue26
pred.store.continue26: ; preds = %pred.store.if25, %pred.store.continue24
%19 = extractelement <16 x i1> %3, i64 5
br i1 %19, label %pred.store.if27, label %pred.store.continue28
pred.store.if27: ; preds = %pred.store.continue26
%20 = or i64 %index, 5
%21 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %20
store i8 68, ptr %21, align 1, !tbaa !5
br label %pred.store.continue28
pred.store.continue28: ; preds = %pred.store.if27, %pred.store.continue26
%22 = extractelement <16 x i1> %3, i64 6
br i1 %22, label %pred.store.if29, label %pred.store.continue30
pred.store.if29: ; preds = %pred.store.continue28
%23 = or i64 %index, 6
%24 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %23
store i8 68, ptr %24, align 2, !tbaa !5
br label %pred.store.continue30
pred.store.continue30: ; preds = %pred.store.if29, %pred.store.continue28
%25 = extractelement <16 x i1> %3, i64 7
br i1 %25, label %pred.store.if31, label %pred.store.continue32
pred.store.if31: ; preds = %pred.store.continue30
%26 = or i64 %index, 7
%27 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %26
store i8 68, ptr %27, align 1, !tbaa !5
br label %pred.store.continue32
pred.store.continue32: ; preds = %pred.store.if31, %pred.store.continue30
%28 = extractelement <16 x i1> %3, i64 8
br i1 %28, label %pred.store.if33, label %pred.store.continue34
pred.store.if33: ; preds = %pred.store.continue32
%29 = or i64 %index, 8
%30 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %29
store i8 68, ptr %30, align 8, !tbaa !5
br label %pred.store.continue34
pred.store.continue34: ; preds = %pred.store.if33, %pred.store.continue32
%31 = extractelement <16 x i1> %3, i64 9
br i1 %31, label %pred.store.if35, label %pred.store.continue36
pred.store.if35: ; preds = %pred.store.continue34
%32 = or i64 %index, 9
%33 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %32
store i8 68, ptr %33, align 1, !tbaa !5
br label %pred.store.continue36
pred.store.continue36: ; preds = %pred.store.if35, %pred.store.continue34
%34 = extractelement <16 x i1> %3, i64 10
br i1 %34, label %pred.store.if37, label %pred.store.continue38
pred.store.if37: ; preds = %pred.store.continue36
%35 = or i64 %index, 10
%36 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %35
store i8 68, ptr %36, align 2, !tbaa !5
br label %pred.store.continue38
pred.store.continue38: ; preds = %pred.store.if37, %pred.store.continue36
%37 = extractelement <16 x i1> %3, i64 11
br i1 %37, label %pred.store.if39, label %pred.store.continue40
pred.store.if39: ; preds = %pred.store.continue38
%38 = or i64 %index, 11
%39 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %38
store i8 68, ptr %39, align 1, !tbaa !5
br label %pred.store.continue40
pred.store.continue40: ; preds = %pred.store.if39, %pred.store.continue38
%40 = extractelement <16 x i1> %3, i64 12
br i1 %40, label %pred.store.if41, label %pred.store.continue42
pred.store.if41: ; preds = %pred.store.continue40
%41 = or i64 %index, 12
%42 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %41
store i8 68, ptr %42, align 4, !tbaa !5
br label %pred.store.continue42
pred.store.continue42: ; preds = %pred.store.if41, %pred.store.continue40
%43 = extractelement <16 x i1> %3, i64 13
br i1 %43, label %pred.store.if43, label %pred.store.continue44
pred.store.if43: ; preds = %pred.store.continue42
%44 = or i64 %index, 13
%45 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %44
store i8 68, ptr %45, align 1, !tbaa !5
br label %pred.store.continue44
pred.store.continue44: ; preds = %pred.store.if43, %pred.store.continue42
%46 = extractelement <16 x i1> %3, i64 14
br i1 %46, label %pred.store.if45, label %pred.store.continue46
pred.store.if45: ; preds = %pred.store.continue44
%47 = or i64 %index, 14
%48 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %47
store i8 68, ptr %48, align 2, !tbaa !5
br label %pred.store.continue46
pred.store.continue46: ; preds = %pred.store.if45, %pred.store.continue44
%49 = extractelement <16 x i1> %3, i64 15
br i1 %49, label %pred.store.if47, label %pred.store.continue48
pred.store.if47: ; preds = %pred.store.continue46
%50 = or i64 %index, 15
%51 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %50
store i8 68, ptr %51, align 1, !tbaa !5
br label %pred.store.continue48
pred.store.continue48: ; preds = %pred.store.if47, %pred.store.continue46
%52 = extractelement <16 x i1> %4, i64 0
br i1 %52, label %pred.store.if49, label %pred.store.continue50
pred.store.if49: ; preds = %pred.store.continue48
%53 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %0
store i8 68, ptr %53, align 16, !tbaa !5
br label %pred.store.continue50
pred.store.continue50: ; preds = %pred.store.if49, %pred.store.continue48
%54 = extractelement <16 x i1> %4, i64 1
br i1 %54, label %pred.store.if51, label %pred.store.continue52
pred.store.if51: ; preds = %pred.store.continue50
%55 = or i64 %index, 17
%56 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %55
store i8 68, ptr %56, align 1, !tbaa !5
br label %pred.store.continue52
pred.store.continue52: ; preds = %pred.store.if51, %pred.store.continue50
%57 = extractelement <16 x i1> %4, i64 2
br i1 %57, label %pred.store.if53, label %pred.store.continue54
pred.store.if53: ; preds = %pred.store.continue52
%58 = or i64 %index, 18
%59 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %58
store i8 68, ptr %59, align 2, !tbaa !5
br label %pred.store.continue54
pred.store.continue54: ; preds = %pred.store.if53, %pred.store.continue52
%60 = extractelement <16 x i1> %4, i64 3
br i1 %60, label %pred.store.if55, label %pred.store.continue56
pred.store.if55: ; preds = %pred.store.continue54
%61 = or i64 %index, 19
%62 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %61
store i8 68, ptr %62, align 1, !tbaa !5
br label %pred.store.continue56
pred.store.continue56: ; preds = %pred.store.if55, %pred.store.continue54
%63 = extractelement <16 x i1> %4, i64 4
br i1 %63, label %pred.store.if57, label %pred.store.continue58
pred.store.if57: ; preds = %pred.store.continue56
%64 = or i64 %index, 20
%65 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %64
store i8 68, ptr %65, align 4, !tbaa !5
br label %pred.store.continue58
pred.store.continue58: ; preds = %pred.store.if57, %pred.store.continue56
%66 = extractelement <16 x i1> %4, i64 5
br i1 %66, label %pred.store.if59, label %pred.store.continue60
pred.store.if59: ; preds = %pred.store.continue58
%67 = or i64 %index, 21
%68 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %67
store i8 68, ptr %68, align 1, !tbaa !5
br label %pred.store.continue60
pred.store.continue60: ; preds = %pred.store.if59, %pred.store.continue58
%69 = extractelement <16 x i1> %4, i64 6
br i1 %69, label %pred.store.if61, label %pred.store.continue62
pred.store.if61: ; preds = %pred.store.continue60
%70 = or i64 %index, 22
%71 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %70
store i8 68, ptr %71, align 2, !tbaa !5
br label %pred.store.continue62
pred.store.continue62: ; preds = %pred.store.if61, %pred.store.continue60
%72 = extractelement <16 x i1> %4, i64 7
br i1 %72, label %pred.store.if63, label %pred.store.continue64
pred.store.if63: ; preds = %pred.store.continue62
%73 = or i64 %index, 23
%74 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %73
store i8 68, ptr %74, align 1, !tbaa !5
br label %pred.store.continue64
pred.store.continue64: ; preds = %pred.store.if63, %pred.store.continue62
%75 = extractelement <16 x i1> %4, i64 8
br i1 %75, label %pred.store.if65, label %pred.store.continue66
pred.store.if65: ; preds = %pred.store.continue64
%76 = or i64 %index, 24
%77 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %76
store i8 68, ptr %77, align 8, !tbaa !5
br label %pred.store.continue66
pred.store.continue66: ; preds = %pred.store.if65, %pred.store.continue64
%78 = extractelement <16 x i1> %4, i64 9
br i1 %78, label %pred.store.if67, label %pred.store.continue68
pred.store.if67: ; preds = %pred.store.continue66
%79 = or i64 %index, 25
%80 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %79
store i8 68, ptr %80, align 1, !tbaa !5
br label %pred.store.continue68
pred.store.continue68: ; preds = %pred.store.if67, %pred.store.continue66
%81 = extractelement <16 x i1> %4, i64 10
br i1 %81, label %pred.store.if69, label %pred.store.continue70
pred.store.if69: ; preds = %pred.store.continue68
%82 = or i64 %index, 26
%83 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %82
store i8 68, ptr %83, align 2, !tbaa !5
br label %pred.store.continue70
pred.store.continue70: ; preds = %pred.store.if69, %pred.store.continue68
%84 = extractelement <16 x i1> %4, i64 11
br i1 %84, label %pred.store.if71, label %pred.store.continue72
pred.store.if71: ; preds = %pred.store.continue70
%85 = or i64 %index, 27
%86 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %85
store i8 68, ptr %86, align 1, !tbaa !5
br label %pred.store.continue72
pred.store.continue72: ; preds = %pred.store.if71, %pred.store.continue70
%87 = extractelement <16 x i1> %4, i64 12
br i1 %87, label %pred.store.if73, label %pred.store.continue74
pred.store.if73: ; preds = %pred.store.continue72
%88 = or i64 %index, 28
%89 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %88
store i8 68, ptr %89, align 4, !tbaa !5
br label %pred.store.continue74
pred.store.continue74: ; preds = %pred.store.if73, %pred.store.continue72
%90 = extractelement <16 x i1> %4, i64 13
br i1 %90, label %pred.store.if75, label %pred.store.continue76
pred.store.if75: ; preds = %pred.store.continue74
%91 = or i64 %index, 29
%92 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %91
store i8 68, ptr %92, align 1, !tbaa !5
br label %pred.store.continue76
pred.store.continue76: ; preds = %pred.store.if75, %pred.store.continue74
%93 = extractelement <16 x i1> %4, i64 14
br i1 %93, label %pred.store.if77, label %pred.store.continue78
pred.store.if77: ; preds = %pred.store.continue76
%94 = or i64 %index, 30
%95 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %94
store i8 68, ptr %95, align 2, !tbaa !5
br label %pred.store.continue78
pred.store.continue78: ; preds = %pred.store.if77, %pred.store.continue76
%96 = extractelement <16 x i1> %4, i64 15
br i1 %96, label %pred.store.if79, label %pred.store.continue80
pred.store.if79: ; preds = %pred.store.continue78
%97 = or i64 %index, 31
%98 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %97
store i8 68, ptr %98, align 1, !tbaa !5
br label %pred.store.continue80
pred.store.continue80: ; preds = %pred.store.if79, %pred.store.continue78
%index.next = add nuw i64 %index, 32
%99 = icmp eq i64 %index.next, %n.vec
br i1 %99, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %pred.store.continue80
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.mod.vf81 = and i64 %call2, 7
%n.vec82 = sub nsw i64 %wide.trip.count, %n.mod.vf81
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %pred.store.continue101, %vec.epilog.ph
%index84 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next102, %pred.store.continue101 ]
%100 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %index84
%wide.load85 = load <8 x i8>, ptr %100, align 1, !tbaa !5
%101 = icmp eq <8 x i8> %wide.load85, <i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63, i8 63>
%102 = extractelement <8 x i1> %101, i64 0
br i1 %102, label %pred.store.if86, label %pred.store.continue87
pred.store.if86: ; preds = %vec.epilog.vector.body
%103 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %index84
store i8 68, ptr %103, align 1, !tbaa !5
br label %pred.store.continue87
pred.store.continue87: ; preds = %pred.store.if86, %vec.epilog.vector.body
%104 = extractelement <8 x i1> %101, i64 1
br i1 %104, label %pred.store.if88, label %pred.store.continue89
pred.store.if88: ; preds = %pred.store.continue87
%105 = add i64 %index84, 1
%106 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %105
store i8 68, ptr %106, align 1, !tbaa !5
br label %pred.store.continue89
pred.store.continue89: ; preds = %pred.store.if88, %pred.store.continue87
%107 = extractelement <8 x i1> %101, i64 2
br i1 %107, label %pred.store.if90, label %pred.store.continue91
pred.store.if90: ; preds = %pred.store.continue89
%108 = add i64 %index84, 2
%109 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %108
store i8 68, ptr %109, align 1, !tbaa !5
br label %pred.store.continue91
pred.store.continue91: ; preds = %pred.store.if90, %pred.store.continue89
%110 = extractelement <8 x i1> %101, i64 3
br i1 %110, label %pred.store.if92, label %pred.store.continue93
pred.store.if92: ; preds = %pred.store.continue91
%111 = add i64 %index84, 3
%112 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %111
store i8 68, ptr %112, align 1, !tbaa !5
br label %pred.store.continue93
pred.store.continue93: ; preds = %pred.store.if92, %pred.store.continue91
%113 = extractelement <8 x i1> %101, i64 4
br i1 %113, label %pred.store.if94, label %pred.store.continue95
pred.store.if94: ; preds = %pred.store.continue93
%114 = add i64 %index84, 4
%115 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %114
store i8 68, ptr %115, align 1, !tbaa !5
br label %pred.store.continue95
pred.store.continue95: ; preds = %pred.store.if94, %pred.store.continue93
%116 = extractelement <8 x i1> %101, i64 5
br i1 %116, label %pred.store.if96, label %pred.store.continue97
pred.store.if96: ; preds = %pred.store.continue95
%117 = add i64 %index84, 5
%118 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %117
store i8 68, ptr %118, align 1, !tbaa !5
br label %pred.store.continue97
pred.store.continue97: ; preds = %pred.store.if96, %pred.store.continue95
%119 = extractelement <8 x i1> %101, i64 6
br i1 %119, label %pred.store.if98, label %pred.store.continue99
pred.store.if98: ; preds = %pred.store.continue97
%120 = add i64 %index84, 6
%121 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %120
store i8 68, ptr %121, align 1, !tbaa !5
br label %pred.store.continue99
pred.store.continue99: ; preds = %pred.store.if98, %pred.store.continue97
%122 = extractelement <8 x i1> %101, i64 7
br i1 %122, label %pred.store.if100, label %pred.store.continue101
pred.store.if100: ; preds = %pred.store.continue99
%123 = add i64 %index84, 7
%124 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %123
store i8 68, ptr %124, align 1, !tbaa !5
br label %pred.store.continue101
pred.store.continue101: ; preds = %pred.store.if100, %pred.store.continue99
%index.next102 = add nuw i64 %index84, 8
%125 = icmp eq i64 %index.next102, %n.vec82
br i1 %125, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !12
vec.epilog.middle.block: ; preds = %pred.store.continue101
%cmp.n83 = icmp eq i64 %n.mod.vf81, 0
br i1 %cmp.n83, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec82, %vec.epilog.middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %indvars.iv.ph, %for.body.preheader ]
%arrayidx = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %indvars.iv
%126 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp5 = icmp eq i8 %126, 63
br i1 %cmp5, label %if.then, label %for.inc
if.then: ; preds = %for.body
store i8 68, ptr %arrayidx, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.inc, %middle.block, %vec.epilog.middle.block, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %a)
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !10, !11}
!13 = distinct !{!13, !9, !11, !10}
|
#include <stdio.h>
char T[222222];
int main(void) {
int mareitaso;
if (scanf("%222221s", T) != 1) return 1;
for (mareitaso = 0; T[mareitaso] != '\0'; mareitaso++) {
putchar(T[mareitaso] == '?' ? 'D' : (unsigned char)T[mareitaso]);
}
putchar('\n');
return 0;
}
/*
D → 指数++, 前がPなら指数++
P → なし
Pにすると次で加点される可能性があるが、Dにして今加点しちゃったほうが不利にならない
*/
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255935/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255935/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%222221s\00", align 1
@T = dso_local global [222222 x i8] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; 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 @T)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %for.cond, label %cleanup
for.cond: ; preds = %entry, %cond.end
%indvars.iv = phi i64 [ %indvars.iv.next, %cond.end ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [222222 x i8], ptr @T, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %cond.false [
i8 0, label %for.end
i8 63, label %cond.end
]
cond.false: ; preds = %for.cond
%conv10 = zext i8 %0 to i32
br label %cond.end
cond.end: ; preds = %for.cond, %cond.false
%cond = phi i32 [ %conv10, %cond.false ], [ 68, %for.cond ]
%1 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i = tail call i32 @putc(i32 noundef %cond, ptr noundef %1)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !10
for.end: ; preds = %for.cond
%2 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i16 = tail call i32 @putc(i32 noundef 10, ptr noundef %2)
br label %cleanup
cleanup: ; preds = %entry, %for.end
%retval.0 = phi i32 [ 0, %for.end ], [ 1, %entry ]
ret i32 %retval.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 @putc(i32 noundef, ptr nocapture noundef) 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
long long int N,A,B;
long long int i;
long long int h[100000];
long long int K;
long long int left,right;
long long int sum;
scanf("%lld %lld %lld",&N,&A,&B);
//printf("%d\n", N);
for(i=0;i<N;++i){
scanf("%lld",&h[i]);
}
left=0;
right=1000000000;
while(left!=right){
K=(right+left)/2;
sum=0;
for(i=0;i<N;i++){
if(h[i]-K*B > 0){
// sum += (h[i]-K*B)%(A-B) ? (h[i]-B*K)/(A-B)+1 : (h[i]-B*K)/(A-B);
if((h[i]-K*B)%(A-B)==0){
sum += (h[i]-B*K)/(A-B);
}else{
sum += (h[i]-B*K)/(A-B)+1;
}
}
}
if(sum <= K){
right=K;
}else{
left=K+1;
}
}
printf("%lld\n", left);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255979/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255979/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%A = alloca i64, align 8
%B = alloca i64, align 8
%h = alloca [100000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %h) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp56 = icmp sgt i64 %0, 0
br i1 %cmp56, label %for.body, label %while.body.preheader
while.cond.preheader: ; preds = %for.body
%cmp458 = icmp sgt i64 %4, 0
%1 = load i64, ptr %B, align 8
%2 = load i64, ptr %A, align 8
%sub11 = sub nsw i64 %2, %1
br i1 %cmp458, label %while.body.us, label %while.body.preheader
while.body.preheader: ; preds = %entry, %while.cond.preheader
br label %while.body
while.body.us: ; preds = %while.cond.preheader, %for.cond3.for.end30_crit_edge.us
%right.063.us = phi i64 [ %right.1.us, %for.cond3.for.end30_crit_edge.us ], [ 1000000000, %while.cond.preheader ]
%left.062.us = phi i64 [ %left.1.us, %for.cond3.for.end30_crit_edge.us ], [ 0, %while.cond.preheader ]
%add.us = add nsw i64 %right.063.us, %left.062.us
%div.us = sdiv i64 %add.us, 2
%mul.us = mul nsw i64 %1, %div.us
br label %for.body5.us
for.body5.us: ; preds = %while.body.us, %for.inc28.us
%sum.060.us = phi i64 [ 0, %while.body.us ], [ %sum.1.us, %for.inc28.us ]
%i.159.us = phi i64 [ 0, %while.body.us ], [ %inc29.us, %for.inc28.us ]
%arrayidx6.us = getelementptr inbounds [100000 x i64], ptr %h, i64 0, i64 %i.159.us
%3 = load i64, ptr %arrayidx6.us, align 8, !tbaa !5
%sub.us = sub nsw i64 %3, %mul.us
%cmp7.us = icmp sgt i64 %sub.us, 0
br i1 %cmp7.us, label %if.then.us, label %for.inc28.us
if.then.us: ; preds = %for.body5.us
%rem.us = srem i64 %sub.us, %sub11
%cmp12.us = icmp eq i64 %rem.us, 0
%div18.us = sdiv i64 %sub.us, %sub11
br i1 %cmp12.us, label %if.then13.us, label %if.else.us
if.else.us: ; preds = %if.then.us
%add25.us = add i64 %sum.060.us, 1
%add26.us = add i64 %add25.us, %div18.us
br label %for.inc28.us
if.then13.us: ; preds = %if.then.us
%add19.us = add nsw i64 %div18.us, %sum.060.us
br label %for.inc28.us
for.inc28.us: ; preds = %if.then13.us, %if.else.us, %for.body5.us
%sum.1.us = phi i64 [ %add19.us, %if.then13.us ], [ %add26.us, %if.else.us ], [ %sum.060.us, %for.body5.us ]
%inc29.us = add nuw nsw i64 %i.159.us, 1
%exitcond.not = icmp eq i64 %inc29.us, %4
br i1 %exitcond.not, label %for.cond3.for.end30_crit_edge.us, label %for.body5.us, !llvm.loop !9
for.cond3.for.end30_crit_edge.us: ; preds = %for.inc28.us
%cmp31.not.us = icmp sgt i64 %sum.1.us, %div.us
%add34.us = add nsw i64 %div.us, 1
%left.1.us = select i1 %cmp31.not.us, i64 %add34.us, i64 %left.062.us
%right.1.us = select i1 %cmp31.not.us, i64 %right.063.us, i64 %div.us
%cmp2.not.us = icmp eq i64 %left.1.us, %right.1.us
br i1 %cmp2.not.us, label %while.end, label %while.body.us, !llvm.loop !11
for.body: ; preds = %entry, %for.body
%i.057 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr %h, i64 0, i64 %i.057
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.057, 1
%4 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %4
br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !12
while.body: ; preds = %while.body.preheader, %while.body
%right.063 = phi i64 [ %right.1, %while.body ], [ 1000000000, %while.body.preheader ]
%left.062 = phi i64 [ %left.1, %while.body ], [ 0, %while.body.preheader ]
%add = add nsw i64 %right.063, %left.062
%div = sdiv i64 %add, 2
%cmp31.not = icmp slt i64 %add, -1
%add34 = add nsw i64 %div, 1
%left.1 = select i1 %cmp31.not, i64 %add34, i64 %left.062
%right.1 = select i1 %cmp31.not, i64 %right.063, i64 %div
%cmp2.not = icmp eq i64 %left.1, %right.1
br i1 %cmp2.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %for.cond3.for.end30_crit_edge.us
%.us-phi = phi i64 [ %left.1.us, %for.cond3.for.end30_crit_edge.us ], [ %left.1, %while.body ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.us-phi)
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %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}
|
#include<stdio.h>
int main(void)
{
int A,B,C,D,N,c[101]={0},i,j,temp,max,x,y,goukei[200],n;
scanf("%d %d %d %d",&N,&A,&B,&D);
for(C=0;C<N;C++){
scanf("%d",&c[C]);
}
for(i=0;i<N-1;i++){
for(j=N-1;j>i;j--){
if(c[i]<c[j]){
temp=c[j];
c[j]=c[i];
c[i]=temp;
}
}
}
x=D;
y=A;
for(i=0;i<N;i++){
x=x+c[i];
y=y+B;
goukei[i]=0;
goukei[i]=x/y;
}
max=D/A;
for(i=0;i<N;i++){
if(goukei[i]>max){
max=goukei[i];
}
}
printf("%d\n",max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256035/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256035/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%D = alloca i32, align 4
%N = alloca i32, align 4
%c = alloca [101 x i32], align 16
%goukei = alloca [200 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %c) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) %c, i8 0, i64 404, i1 false)
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %goukei) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp80 = icmp sgt i32 %0, 0
br i1 %cmp80, label %for.body, label %for.end26.thread
for.end26.thread: ; preds = %entry
%1 = load i32, ptr %D, align 4, !tbaa !5
%2 = load i32, ptr %A, align 4, !tbaa !5
%div40121 = sdiv i32 %1, %2
br label %for.end53
for.cond2.preheader: ; preds = %for.body
%cmp383 = icmp sgt i32 %5, 1
br i1 %cmp383, label %for.cond6.preheader.preheader, label %for.end26
for.cond6.preheader.preheader: ; preds = %for.cond2.preheader
%sub = add nsw i32 %5, -1
%3 = zext i32 %5 to i64
%4 = add nsw i64 %3, -1
%wide.trip.count = zext i32 %sub to i64
br label %for.cond6.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc24
%indvars.iv98 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next99, %for.inc24 ]
%arrayidx10 = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %indvars.iv98
%.pre = load i32, ptr %arrayidx10, align 4, !tbaa !5
br label %for.body8
for.body8: ; preds = %for.cond6.preheader, %for.inc22
%7 = phi i32 [ %.pre, %for.cond6.preheader ], [ %9, %for.inc22 ]
%indvars.iv95 = phi i64 [ %4, %for.cond6.preheader ], [ %indvars.iv.next96, %for.inc22 ]
%arrayidx12 = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %indvars.iv95
%8 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp slt i32 %7, %8
br i1 %cmp13, label %if.then, label %for.inc22
if.then: ; preds = %for.body8
store i32 %7, ptr %arrayidx12, align 4, !tbaa !5
store i32 %8, ptr %arrayidx10, align 4, !tbaa !5
br label %for.inc22
for.inc22: ; preds = %for.body8, %if.then
%9 = phi i32 [ %7, %for.body8 ], [ %8, %if.then ]
%indvars.iv.next96 = add nsw i64 %indvars.iv95, -1
%cmp7 = icmp sgt i64 %indvars.iv.next96, %indvars.iv98
br i1 %cmp7, label %for.body8, label %for.inc24, !llvm.loop !11
for.inc24: ; preds = %for.inc22
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count
br i1 %exitcond.not, label %for.end26, label %for.cond6.preheader, !llvm.loop !12
for.end26: ; preds = %for.inc24, %for.cond2.preheader
%10 = load i32, ptr %D, align 4, !tbaa !5
%11 = load i32, ptr %A, align 4, !tbaa !5
%cmp2885 = icmp sgt i32 %5, 0
br i1 %cmp2885, label %for.body29.lr.ph, label %for.end39.thread
for.end39.thread: ; preds = %for.end26
%div40120 = sdiv i32 %10, %11
br label %for.end53
for.body29.lr.ph: ; preds = %for.end26
%12 = load i32, ptr %B, align 4, !tbaa !5
%wide.trip.count104 = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count104, 1
%13 = icmp eq i32 %5, 1
br i1 %13, label %for.end39.unr-lcssa, label %for.body29.lr.ph.new
for.body29.lr.ph.new: ; preds = %for.body29.lr.ph
%unroll_iter = and i64 %wide.trip.count104, 4294967294
br label %for.body29
for.body29: ; preds = %for.body29, %for.body29.lr.ph.new
%indvars.iv101 = phi i64 [ 0, %for.body29.lr.ph.new ], [ %indvars.iv.next102.1, %for.body29 ]
%y.088 = phi i32 [ %11, %for.body29.lr.ph.new ], [ %add32.1, %for.body29 ]
%x.087 = phi i32 [ %10, %for.body29.lr.ph.new ], [ %add.1, %for.body29 ]
%niter = phi i64 [ 0, %for.body29.lr.ph.new ], [ %niter.next.1, %for.body29 ]
%arrayidx31 = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %indvars.iv101
%14 = load i32, ptr %arrayidx31, align 8, !tbaa !5
%add = add nsw i32 %14, %x.087
%add32 = add nsw i32 %12, %y.088
%arrayidx34 = getelementptr inbounds [200 x i32], ptr %goukei, i64 0, i64 %indvars.iv101
%div = sdiv i32 %add, %add32
store i32 %div, ptr %arrayidx34, align 8, !tbaa !5
%indvars.iv.next102 = or i64 %indvars.iv101, 1
%arrayidx31.1 = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %indvars.iv.next102
%15 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5
%add.1 = add nsw i32 %15, %add
%add32.1 = add nsw i32 %12, %add32
%arrayidx34.1 = getelementptr inbounds [200 x i32], ptr %goukei, i64 0, i64 %indvars.iv.next102
%div.1 = sdiv i32 %add.1, %add32.1
store i32 %div.1, ptr %arrayidx34.1, align 4, !tbaa !5
%indvars.iv.next102.1 = add nuw nsw i64 %indvars.iv101, 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.end39.unr-lcssa, label %for.body29, !llvm.loop !13
for.end39.unr-lcssa: ; preds = %for.body29, %for.body29.lr.ph
%indvars.iv101.unr = phi i64 [ 0, %for.body29.lr.ph ], [ %indvars.iv.next102.1, %for.body29 ]
%y.088.unr = phi i32 [ %11, %for.body29.lr.ph ], [ %add32.1, %for.body29 ]
%x.087.unr = phi i32 [ %10, %for.body29.lr.ph ], [ %add.1, %for.body29 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end39, label %for.body29.epil
for.body29.epil: ; preds = %for.end39.unr-lcssa
%arrayidx31.epil = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %indvars.iv101.unr
%16 = load i32, ptr %arrayidx31.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %16, %x.087.unr
%add32.epil = add nsw i32 %12, %y.088.unr
%arrayidx34.epil = getelementptr inbounds [200 x i32], ptr %goukei, i64 0, i64 %indvars.iv101.unr
%div.epil = sdiv i32 %add.epil, %add32.epil
store i32 %div.epil, ptr %arrayidx34.epil, align 4, !tbaa !5
br label %for.end39
for.end39: ; preds = %for.end39.unr-lcssa, %for.body29.epil
%div40 = sdiv i32 %10, %11
br i1 %cmp2885, label %for.body43.preheader, label %for.end53
for.body43.preheader: ; preds = %for.end39
%wide.trip.count109 = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body43.preheader126, label %vector.ph
vector.ph: ; preds = %for.body43.preheader
%n.vec = and i64 %wide.trip.count104, 4294967288
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %div40, 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.phi124 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %20, %vector.body ]
%17 = getelementptr inbounds [200 x i32], ptr %goukei, 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.load125 = load <4 x i32>, ptr %18, align 16, !tbaa !5
%19 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
%20 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load125, <4 x i32> %vec.phi124)
%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 !14
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %19, <4 x i32> %20)
%22 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count104
br i1 %cmp.n, label %for.end53, label %for.body43.preheader126
for.body43.preheader126: ; preds = %for.body43.preheader, %middle.block
%indvars.iv106.ph = phi i64 [ 0, %for.body43.preheader ], [ %n.vec, %middle.block ]
%max.091.ph = phi i32 [ %div40, %for.body43.preheader ], [ %22, %middle.block ]
br label %for.body43
for.body43: ; preds = %for.body43.preheader126, %for.body43
%indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.body43 ], [ %indvars.iv106.ph, %for.body43.preheader126 ]
%max.091 = phi i32 [ %spec.select, %for.body43 ], [ %max.091.ph, %for.body43.preheader126 ]
%arrayidx45 = getelementptr inbounds [200 x i32], ptr %goukei, i64 0, i64 %indvars.iv106
%23 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %23, i32 %max.091)
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109
br i1 %exitcond110.not, label %for.end53, label %for.body43, !llvm.loop !17
for.end53: ; preds = %for.body43, %middle.block, %for.end26.thread, %for.end39.thread, %for.end39
%max.0.lcssa = phi i32 [ %div40, %for.end39 ], [ %div40120, %for.end39.thread ], [ %div40121, %for.end26.thread ], [ %22, %middle.block ], [ %spec.select, %for.body43 ]
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %goukei) #5
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10, !16, !15}
|
#include<stdio.h>
int main(){
int s=0,n,k,a,b,i,j,m[101],x,y;
scanf("%d%d%d%d",&n,&a,&b,&k);
for(i=0;i<n;i++)scanf("%d",&m[i]);
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(m[i]<m[j]){
x=m[i];
m[i]=m[j];
m[j]=x;
}
}
}
for(i=1;i<=n;i++){
x=0;
for(j=0;j<i;j++)x+=m[j];
y=(k+x)/(a+b*i);
if(s<y)s=y;
}
printf("%d\n",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256086/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256086/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%m = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #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 404, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp72 = icmp sgt i32 %0, 0
br i1 %cmp72, label %for.body, label %for.end46
for.cond2.preheader: ; preds = %for.body
%cmp376 = icmp sgt i32 %2, 0
br i1 %cmp376, label %for.body4.preheader, label %for.end46
for.body4.preheader: ; preds = %for.cond2.preheader
%1 = zext i32 %2 to i64
%wide.trip.count94 = zext i32 %2 to i64
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %m, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond2.loopexit: ; preds = %for.inc21, %for.body4
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count94
br i1 %exitcond95.not, label %for.cond27.preheader, label %for.body4, !llvm.loop !11
for.cond27.preheader: ; preds = %for.cond2.loopexit
%cmp28.not80 = icmp slt i32 %2, 1
br i1 %cmp28.not80, label %for.end46, label %for.cond30.preheader.lr.ph
for.cond30.preheader.lr.ph: ; preds = %for.cond27.preheader
%4 = load i32, ptr %k, align 4, !tbaa !5
%5 = load i32, ptr %a, align 4, !tbaa !5
%6 = load i32, ptr %b, align 4, !tbaa !5
%7 = add nuw i32 %2, 1
%wide.trip.count104 = zext i32 %7 to i64
br label %for.cond30.preheader
for.body4: ; preds = %for.body4.preheader, %for.cond2.loopexit
%indvars.iv91 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next92, %for.cond2.loopexit ]
%indvars.iv86 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next87, %for.cond2.loopexit ]
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%cmp674 = icmp ult i64 %indvars.iv.next92, %1
br i1 %cmp674, label %for.body7.lr.ph, label %for.cond2.loopexit
for.body7.lr.ph: ; preds = %for.body4
%arrayidx9 = getelementptr inbounds [101 x i32], ptr %m, i64 0, i64 %indvars.iv91
br label %for.body7
for.body7: ; preds = %for.body7.lr.ph, %for.inc21
%indvars.iv88 = phi i64 [ %indvars.iv86, %for.body7.lr.ph ], [ %indvars.iv.next89, %for.inc21 ]
%8 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [101 x i32], ptr %m, i64 0, i64 %indvars.iv88
%9 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp slt i32 %8, %9
br i1 %cmp12, label %if.then, label %for.inc21
if.then: ; preds = %for.body7
store i32 %9, ptr %arrayidx9, align 4, !tbaa !5
store i32 %8, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc21
for.inc21: ; preds = %for.body7, %if.then
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count94
br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body7, !llvm.loop !12
for.cond30.preheader: ; preds = %for.cond30.preheader.lr.ph, %for.end38
%indvars.iv101 = phi i64 [ 1, %for.cond30.preheader.lr.ph ], [ %indvars.iv.next102, %for.end38 ]
%s.082 = phi i32 [ 0, %for.cond30.preheader.lr.ph ], [ %spec.select, %for.end38 ]
%min.iters.check = icmp ult i64 %indvars.iv101, 8
br i1 %min.iters.check, label %for.body32.preheader, label %vector.ph
vector.ph: ; preds = %for.cond30.preheader
%n.vec = and i64 %indvars.iv101, 9223372036854775800
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 ], [ %12, %vector.body ]
%vec.phi111 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%10 = getelementptr inbounds [101 x i32], ptr %m, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = getelementptr inbounds i32, ptr %10, i64 4
%wide.load112 = load <4 x i32>, ptr %11, align 16, !tbaa !5
%12 = add <4 x i32> %wide.load, %vec.phi
%13 = add <4 x i32> %wide.load112, %vec.phi111
%index.next = add nuw i64 %index, 8
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %13, %12
%15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %indvars.iv101, %n.vec
br i1 %cmp.n, label %for.end38, label %for.body32.preheader
for.body32.preheader: ; preds = %for.cond30.preheader, %middle.block
%indvars.iv96.ph = phi i64 [ 0, %for.cond30.preheader ], [ %n.vec, %middle.block ]
%x.079.ph = phi i32 [ 0, %for.cond30.preheader ], [ %15, %middle.block ]
br label %for.body32
for.body32: ; preds = %for.body32.preheader, %for.body32
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.body32 ], [ %indvars.iv96.ph, %for.body32.preheader ]
%x.079 = phi i32 [ %add35, %for.body32 ], [ %x.079.ph, %for.body32.preheader ]
%arrayidx34 = getelementptr inbounds [101 x i32], ptr %m, i64 0, i64 %indvars.iv96
%16 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%add35 = add nsw i32 %16, %x.079
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%exitcond100.not = icmp eq i64 %indvars.iv.next97, %indvars.iv101
br i1 %exitcond100.not, label %for.end38, label %for.body32, !llvm.loop !16
for.end38: ; preds = %for.body32, %middle.block
%add35.lcssa = phi i32 [ %15, %middle.block ], [ %add35, %for.body32 ]
%add39 = add nsw i32 %4, %add35.lcssa
%17 = trunc i64 %indvars.iv101 to i32
%mul = mul nsw i32 %6, %17
%add40 = add nsw i32 %mul, %5
%div = sdiv i32 %add39, %add40
%spec.select = call i32 @llvm.smax.i32(i32 %s.082, i32 %div)
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
br i1 %exitcond105.not, label %for.end46, label %for.cond30.preheader, !llvm.loop !17
for.end46: ; preds = %for.end38, %entry, %for.cond2.preheader, %for.cond27.preheader
%s.0.lcssa = phi i32 [ 0, %for.cond27.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %spec.select, %for.end38 ]
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %s.0.lcssa)
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %m) #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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
int main(void){
int n , i , a[26] , r;
while(1){
scanf("%d" , &n);
if(n==0) break;
for(i=0;i<n;i++) scanf("%d" , &a[i]);
r = 32;
for(i=0;;i++){
r -= (r-1) % 5;
printf("%d\n" , r);
r -= a[i%n];
if(r<0) r=0;
printf("%d\n" , r);
if(r==0) break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256129/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256129/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #4
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp33 = icmp eq i32 %0, 0
br i1 %cmp33, label %while.end, label %for.cond.preheader
while.cond.loopexit: ; preds = %for.cond3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%2 = phi i32 [ %1, %while.cond.loopexit ], [ %0, %entry ]
%cmp130 = icmp sgt i32 %2, 0
br i1 %cmp130, label %for.body, label %for.cond3.preheader
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond3.preheader, !llvm.loop !9
for.cond3.preheader: ; preds = %for.body, %for.cond.preheader
br label %for.cond3
for.cond3: ; preds = %for.cond3.preheader, %for.cond3
%i.1 = phi i32 [ %inc18, %for.cond3 ], [ 0, %for.cond3.preheader ]
%r.0 = phi i32 [ %spec.store.select, %for.cond3 ], [ 32, %for.cond3.preheader ]
%sub = add nsw i32 %r.0, -1
%rem = srem i32 %sub, 5
%sub4 = sub nsw i32 %r.0, %rem
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub4)
%5 = load i32, ptr %n, align 4, !tbaa !5
%rem6 = srem i32 %i.1, %5
%idxprom7 = zext i32 %rem6 to i64
%arrayidx8 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %idxprom7
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%sub9 = sub nsw i32 %sub4, %6
%spec.store.select = call i32 @llvm.smax.i32(i32 %sub9, i32 0)
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.store.select)
%cmp14 = icmp slt i32 %sub9, 1
%inc18 = add nuw nsw i32 %i.1, 1
br i1 %cmp14, label %while.cond.loopexit, label %for.cond3
while.end: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int m[6];
int i, j, I, N;
double f;
scanf("%d", &N);
for(I = 0; I < 6; ++ I) m[I] = 0;
for(I = 0; I < N; ++ I) {
scanf("%lf", &f);
if(f < 165.0) {
m[0] ++;
} else if(f < 170) {
m[1] ++;
} else if(f < 175) {
m[2] ++;
} else if(f < 180) {
m[3] ++;
} else if(f < 185) {
m[4] ++;
} else {
m[5] ++;
}
}
for(i = 0; i < 6; ++ i) {
printf("%d:", i + 1);
for(j = 0; j < m[i]; ++ j) printf("*");
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256187/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256187/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d:\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%f = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %f) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp264 = icmp sgt i32 %0, 0
br i1 %cmp264, label %for.body3, label %for.cond37.preheader.thread
for.cond37.preheader.thread: ; preds = %entry
%call4095 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.end49
for.cond37.preheader: ; preds = %for.inc34
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
%cmp4476 = icmp sgt i32 %3, 0
br i1 %cmp4476, label %for.body45, label %for.end49
for.body3: ; preds = %entry, %for.inc34
%inc1175 = phi i32 [ %inc1174, %for.inc34 ], [ 0, %entry ]
%inc1673 = phi i32 [ %inc1672, %for.inc34 ], [ 0, %entry ]
%inc2171 = phi i32 [ %inc2170, %for.inc34 ], [ 0, %entry ]
%inc2669 = phi i32 [ %inc2668, %for.inc34 ], [ 0, %entry ]
%inc2967 = phi i32 [ %inc2966, %for.inc34 ], [ 0, %entry ]
%I.165 = phi i32 [ %inc35, %for.inc34 ], [ 0, %entry ]
%1 = phi i32 [ %3, %for.inc34 ], [ 0, %entry ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %f)
%2 = load double, ptr %f, align 8, !tbaa !9
%cmp5 = fcmp olt double %2, 1.650000e+02
br i1 %cmp5, label %if.then, label %if.else
if.then: ; preds = %for.body3
%inc7 = add nsw i32 %1, 1
br label %for.inc34
if.else: ; preds = %for.body3
%cmp8 = fcmp olt double %2, 1.700000e+02
br i1 %cmp8, label %if.then9, label %if.else12
if.then9: ; preds = %if.else
%inc11 = add nsw i32 %inc1175, 1
br label %for.inc34
if.else12: ; preds = %if.else
%cmp13 = fcmp olt double %2, 1.750000e+02
br i1 %cmp13, label %if.then14, label %if.else17
if.then14: ; preds = %if.else12
%inc16 = add nsw i32 %inc1673, 1
br label %for.inc34
if.else17: ; preds = %if.else12
%cmp18 = fcmp olt double %2, 1.800000e+02
br i1 %cmp18, label %if.then19, label %if.else22
if.then19: ; preds = %if.else17
%inc21 = add nsw i32 %inc2171, 1
br label %for.inc34
if.else22: ; preds = %if.else17
%cmp23 = fcmp olt double %2, 1.850000e+02
br i1 %cmp23, label %if.then24, label %if.else27
if.then24: ; preds = %if.else22
%inc26 = add nsw i32 %inc2669, 1
br label %for.inc34
if.else27: ; preds = %if.else22
%inc29 = add nsw i32 %inc2967, 1
br label %for.inc34
for.inc34: ; preds = %if.then, %if.then14, %if.then24, %if.else27, %if.then19, %if.then9
%inc1174 = phi i32 [ %inc1175, %if.then ], [ %inc1175, %if.then14 ], [ %inc1175, %if.then24 ], [ %inc1175, %if.else27 ], [ %inc1175, %if.then19 ], [ %inc11, %if.then9 ]
%inc1672 = phi i32 [ %inc1673, %if.then ], [ %inc16, %if.then14 ], [ %inc1673, %if.then24 ], [ %inc1673, %if.else27 ], [ %inc1673, %if.then19 ], [ %inc1673, %if.then9 ]
%inc2170 = phi i32 [ %inc2171, %if.then ], [ %inc2171, %if.then14 ], [ %inc2171, %if.then24 ], [ %inc2171, %if.else27 ], [ %inc21, %if.then19 ], [ %inc2171, %if.then9 ]
%inc2668 = phi i32 [ %inc2669, %if.then ], [ %inc2669, %if.then14 ], [ %inc26, %if.then24 ], [ %inc2669, %if.else27 ], [ %inc2669, %if.then19 ], [ %inc2669, %if.then9 ]
%inc2966 = phi i32 [ %inc2967, %if.then ], [ %inc2967, %if.then14 ], [ %inc2967, %if.then24 ], [ %inc29, %if.else27 ], [ %inc2967, %if.then19 ], [ %inc2967, %if.then9 ]
%3 = phi i32 [ %inc7, %if.then ], [ %1, %if.then14 ], [ %1, %if.then24 ], [ %1, %if.else27 ], [ %1, %if.then19 ], [ %1, %if.then9 ]
%inc35 = add nuw nsw i32 %I.165, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc35, %4
br i1 %cmp2, label %for.body3, label %for.cond37.preheader, !llvm.loop !11
for.body45: ; preds = %for.cond37.preheader, %for.body45
%j.077 = phi i32 [ %inc48, %for.body45 ], [ 0, %for.cond37.preheader ]
%putchar62 = call i32 @putchar(i32 42)
%inc48 = add nuw nsw i32 %j.077, 1
%exitcond.not = icmp eq i32 %inc48, %3
br i1 %exitcond.not, label %for.end49, label %for.body45, !llvm.loop !13
for.end49: ; preds = %for.body45, %for.cond37.preheader.thread, %for.cond37.preheader
%m.sroa.18.0101 = phi i32 [ 0, %for.cond37.preheader.thread ], [ %inc2966, %for.cond37.preheader ], [ %inc2966, %for.body45 ]
%m.sroa.15.0100 = phi i32 [ 0, %for.cond37.preheader.thread ], [ %inc2668, %for.cond37.preheader ], [ %inc2668, %for.body45 ]
%m.sroa.12.099 = phi i32 [ 0, %for.cond37.preheader.thread ], [ %inc2170, %for.cond37.preheader ], [ %inc2170, %for.body45 ]
%m.sroa.9.098 = phi i32 [ 0, %for.cond37.preheader.thread ], [ %inc1672, %for.cond37.preheader ], [ %inc1672, %for.body45 ]
%m.sroa.6.097 = phi i32 [ 0, %for.cond37.preheader.thread ], [ %inc1174, %for.cond37.preheader ], [ %inc1174, %for.body45 ]
%putchar = call i32 @putchar(i32 10)
%call40.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
%cmp4476.1 = icmp sgt i32 %m.sroa.6.097, 0
br i1 %cmp4476.1, label %for.body45.1, label %for.end49.1
for.body45.1: ; preds = %for.end49, %for.body45.1
%j.077.1 = phi i32 [ %inc48.1, %for.body45.1 ], [ 0, %for.end49 ]
%putchar62.1 = call i32 @putchar(i32 42)
%inc48.1 = add nuw nsw i32 %j.077.1, 1
%exitcond.1.not = icmp eq i32 %inc48.1, %m.sroa.6.097
br i1 %exitcond.1.not, label %for.end49.1, label %for.body45.1, !llvm.loop !13
for.end49.1: ; preds = %for.body45.1, %for.end49
%putchar.1 = call i32 @putchar(i32 10)
%call40.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
%cmp4476.2 = icmp sgt i32 %m.sroa.9.098, 0
br i1 %cmp4476.2, label %for.body45.2, label %for.end49.2
for.body45.2: ; preds = %for.end49.1, %for.body45.2
%j.077.2 = phi i32 [ %inc48.2, %for.body45.2 ], [ 0, %for.end49.1 ]
%putchar62.2 = call i32 @putchar(i32 42)
%inc48.2 = add nuw nsw i32 %j.077.2, 1
%exitcond.2.not = icmp eq i32 %inc48.2, %m.sroa.9.098
br i1 %exitcond.2.not, label %for.end49.2, label %for.body45.2, !llvm.loop !13
for.end49.2: ; preds = %for.body45.2, %for.end49.1
%putchar.2 = call i32 @putchar(i32 10)
%call40.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
%cmp4476.3 = icmp sgt i32 %m.sroa.12.099, 0
br i1 %cmp4476.3, label %for.body45.3, label %for.end49.3
for.body45.3: ; preds = %for.end49.2, %for.body45.3
%j.077.3 = phi i32 [ %inc48.3, %for.body45.3 ], [ 0, %for.end49.2 ]
%putchar62.3 = call i32 @putchar(i32 42)
%inc48.3 = add nuw nsw i32 %j.077.3, 1
%exitcond.3.not = icmp eq i32 %inc48.3, %m.sroa.12.099
br i1 %exitcond.3.not, label %for.end49.3, label %for.body45.3, !llvm.loop !13
for.end49.3: ; preds = %for.body45.3, %for.end49.2
%putchar.3 = call i32 @putchar(i32 10)
%call40.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
%cmp4476.4 = icmp sgt i32 %m.sroa.15.0100, 0
br i1 %cmp4476.4, label %for.body45.4, label %for.end49.4
for.body45.4: ; preds = %for.end49.3, %for.body45.4
%j.077.4 = phi i32 [ %inc48.4, %for.body45.4 ], [ 0, %for.end49.3 ]
%putchar62.4 = call i32 @putchar(i32 42)
%inc48.4 = add nuw nsw i32 %j.077.4, 1
%exitcond.4.not = icmp eq i32 %inc48.4, %m.sroa.15.0100
br i1 %exitcond.4.not, label %for.end49.4, label %for.body45.4, !llvm.loop !13
for.end49.4: ; preds = %for.body45.4, %for.end49.3
%putchar.4 = call i32 @putchar(i32 10)
%call40.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
%cmp4476.5 = icmp sgt i32 %m.sroa.18.0101, 0
br i1 %cmp4476.5, label %for.body45.5, label %for.end49.5
for.body45.5: ; preds = %for.end49.4, %for.body45.5
%j.077.5 = phi i32 [ %inc48.5, %for.body45.5 ], [ 0, %for.end49.4 ]
%putchar62.5 = call i32 @putchar(i32 42)
%inc48.5 = add nuw nsw i32 %j.077.5, 1
%exitcond.5.not = icmp eq i32 %inc48.5, %m.sroa.18.0101
br i1 %exitcond.5.not, label %for.end49.5, label %for.body45.5, !llvm.loop !13
for.end49.5: ; preds = %for.body45.5, %for.end49.4
%putchar.5 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %f) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define def 1670
typedef long long ll;
int case_num, a[def + 5];
int n;
void sign() {
int sign_num = 1;
for (int i = 1; i < 1670; i++) {
if((i % 3 == 0) || (i % 10 == 3)) {
continue;
} else {
a[sign_num++] = i;
}
}
}
int main() {
sign();
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &case_num);
printf("%d\n", a[case_num]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25623/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25623/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@a = dso_local local_unnamed_addr global [1675 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@case_num = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @sign() local_unnamed_addr #0 {
entry:
br label %for.body
for.cond.cleanup: ; preds = %for.inc
ret void
for.body: ; preds = %entry, %for.inc
%i.012 = phi i32 [ 1, %entry ], [ %inc4, %for.inc ]
%sign_num.011 = phi i32 [ 1, %entry ], [ %sign_num.1, %for.inc ]
%rem.lhs.trunc = trunc i32 %i.012 to i16
%rem9 = urem i16 %rem.lhs.trunc, 3
%cmp1 = icmp eq i16 %rem9, 0
%rem210 = urem i16 %rem.lhs.trunc, 10
%cmp3 = icmp eq i16 %rem210, 3
%or.cond = or i1 %cmp1, %cmp3
br i1 %or.cond, label %for.inc, label %if.else
if.else: ; preds = %for.body
%inc = add nsw i32 %sign_num.011, 1
%idxprom = sext i32 %sign_num.011 to i64
%arrayidx = getelementptr inbounds [1675 x i32], ptr @a, i64 0, i64 %idxprom
store i32 %i.012, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.else
%sign_num.1 = phi i32 [ %sign_num.011, %for.body ], [ %inc, %if.else ]
%inc4 = add nuw nsw i32 %i.012, 1
%exitcond.not = icmp eq i32 %inc4, 1670
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %entry
%i.012.i = phi i32 [ 1, %entry ], [ %inc4.i, %for.inc.i ]
%sign_num.011.i = phi i32 [ 1, %entry ], [ %sign_num.1.i, %for.inc.i ]
%rem.lhs.trunc.i = trunc i32 %i.012.i to i16
%rem9.i = urem i16 %rem.lhs.trunc.i, 3
%cmp1.i = icmp eq i16 %rem9.i, 0
%rem210.i = urem i16 %rem.lhs.trunc.i, 10
%cmp3.i = icmp eq i16 %rem210.i, 3
%or.cond.i = or i1 %cmp1.i, %cmp3.i
br i1 %or.cond.i, label %for.inc.i, label %if.else.i
if.else.i: ; preds = %for.body.i
%inc.i = add nsw i32 %sign_num.011.i, 1
%idxprom.i = sext i32 %sign_num.011.i to i64
%arrayidx.i = getelementptr inbounds [1675 x i32], ptr @a, i64 0, i64 %idxprom.i
store i32 %i.012.i, ptr %arrayidx.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.else.i, %for.body.i
%sign_num.1.i = phi i32 [ %sign_num.011.i, %for.body.i ], [ %inc.i, %if.else.i ]
%inc4.i = add nuw nsw i32 %i.012.i, 1
%exitcond.not.i = icmp eq i32 %inc4.i, 1670
br i1 %exitcond.not.i, label %sign.exit, label %for.body.i, !llvm.loop !9
sign.exit: ; preds = %for.inc.i
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %sign.exit
ret i32 0
for.body: ; preds = %sign.exit, %for.body
%i.05 = phi i32 [ %inc, %for.body ], [ 0, %sign.exit ]
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @case_num)
%1 = load i32, ptr @case_num, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [1675 x i32], ptr @a, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%inc = add nuw nsw i32 %i.05, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree norecurse 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 #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
double t;
int i,x,n,g[6]={0};
scanf("%d",&n);
for(i=n;i>0;i--)
{
scanf("%lf",&t);
x=((int)t-165);
if(x<0)g[0]++;
else if(x>=20)g[5]++;
else g[x/5+1]++;
}
for(i=0;i<6;puts(""),i++)
{
printf("%d:",i+1);
for(;g[i]>0;putchar('*'),g[i]--);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256280/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256280/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d:\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca double, align 8
%n = alloca i32, align 4
%g = alloca [6 x i32], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %g) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %g, i8 0, i64 24, 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
%cmp45 = icmp sgt i32 %0, 0
br i1 %cmp45, label %for.body.lr.ph, label %for.cond13.preheader.thread
for.cond13.preheader.thread: ; preds = %entry
%call1855 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc31
for.body.lr.ph: ; preds = %entry
%arrayidx7 = getelementptr inbounds [6 x i32], ptr %g, i64 0, i64 5
br label %for.body
for.cond13.preheader: ; preds = %for.inc
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
%cmp2248 = icmp sgt i32 %6, 0
br i1 %cmp2248, label %for.inc25, label %for.inc31
for.body: ; preds = %for.body.lr.ph, %for.inc
%i.046 = phi i32 [ %0, %for.body.lr.ph ], [ %dec, %for.inc ]
%1 = phi i32 [ 0, %for.body.lr.ph ], [ %6, %for.inc ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%2 = load double, ptr %t, align 8, !tbaa !9
%conv = fptosi double %2 to i32
%cmp2 = icmp slt i32 %conv, 165
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %1, 1
br label %for.inc
if.else: ; preds = %for.body
%cmp4 = icmp ugt i32 %conv, 184
br i1 %cmp4, label %if.then6, label %if.else9
if.then6: ; preds = %if.else
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%inc8 = add nsw i32 %3, 1
store i32 %inc8, ptr %arrayidx7, align 4, !tbaa !5
br label %for.inc
if.else9: ; preds = %if.else
%4 = trunc i32 %conv to i8
%div.lhs.trunc = add nsw i8 %4, 91
%div44 = udiv i8 %div.lhs.trunc, 5
%narrow = add nuw nsw i8 %div44, 1
%idxprom = zext i8 %narrow to i64
%arrayidx10 = getelementptr inbounds [6 x i32], ptr %g, i64 0, i64 %idxprom
%5 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%inc11 = add nsw i32 %5, 1
store i32 %inc11, ptr %arrayidx10, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else9, %if.then6
%6 = phi i32 [ %inc, %if.then ], [ %1, %if.else9 ], [ %1, %if.then6 ]
%dec = add nsw i32 %i.046, -1
%cmp = icmp sgt i32 %i.046, 1
br i1 %cmp, label %for.body, label %for.cond13.preheader, !llvm.loop !11
for.inc25: ; preds = %for.cond13.preheader, %for.inc25
%dec294749 = phi i32 [ %dec29, %for.inc25 ], [ %6, %for.cond13.preheader ]
%7 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i = call noundef i32 @putc(i32 noundef 42, ptr noundef %7)
%dec29 = add nsw i32 %dec294749, -1
%cmp22 = icmp ugt i32 %dec294749, 1
br i1 %cmp22, label %for.inc25, label %for.inc31, !llvm.loop !15
for.inc31: ; preds = %for.inc25, %for.cond13.preheader.thread, %for.cond13.preheader
%8 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i43 = call noundef i32 @putc(i32 noundef 10, ptr noundef %8)
%call18.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
%arrayidx21.1 = getelementptr inbounds [6 x i32], ptr %g, i64 0, i64 1
%arrayidx21.promoted.1 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
%cmp2248.1 = icmp sgt i32 %arrayidx21.promoted.1, 0
br i1 %cmp2248.1, label %for.inc25.1, label %for.inc31.1
for.inc25.1: ; preds = %for.inc31, %for.inc25.1
%dec294749.1 = phi i32 [ %dec29.1, %for.inc25.1 ], [ %arrayidx21.promoted.1, %for.inc31 ]
%9 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i.1 = call noundef i32 @putc(i32 noundef 42, ptr noundef %9)
%dec29.1 = add nsw i32 %dec294749.1, -1
%cmp22.1 = icmp ugt i32 %dec294749.1, 1
br i1 %cmp22.1, label %for.inc25.1, label %for.inc31.1, !llvm.loop !15
for.inc31.1: ; preds = %for.inc25.1, %for.inc31
%10 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i43.1 = call noundef i32 @putc(i32 noundef 10, ptr noundef %10)
%call18.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
%arrayidx21.2 = getelementptr inbounds [6 x i32], ptr %g, i64 0, i64 2
%arrayidx21.promoted.2 = load i32, ptr %arrayidx21.2, align 8, !tbaa !5
%cmp2248.2 = icmp sgt i32 %arrayidx21.promoted.2, 0
br i1 %cmp2248.2, label %for.inc25.2, label %for.inc31.2
for.inc25.2: ; preds = %for.inc31.1, %for.inc25.2
%dec294749.2 = phi i32 [ %dec29.2, %for.inc25.2 ], [ %arrayidx21.promoted.2, %for.inc31.1 ]
%11 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i.2 = call noundef i32 @putc(i32 noundef 42, ptr noundef %11)
%dec29.2 = add nsw i32 %dec294749.2, -1
%cmp22.2 = icmp ugt i32 %dec294749.2, 1
br i1 %cmp22.2, label %for.inc25.2, label %for.inc31.2, !llvm.loop !15
for.inc31.2: ; preds = %for.inc25.2, %for.inc31.1
%12 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i43.2 = call noundef i32 @putc(i32 noundef 10, ptr noundef %12)
%call18.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
%arrayidx21.3 = getelementptr inbounds [6 x i32], ptr %g, i64 0, i64 3
%arrayidx21.promoted.3 = load i32, ptr %arrayidx21.3, align 4, !tbaa !5
%cmp2248.3 = icmp sgt i32 %arrayidx21.promoted.3, 0
br i1 %cmp2248.3, label %for.inc25.3, label %for.inc31.3
for.inc25.3: ; preds = %for.inc31.2, %for.inc25.3
%dec294749.3 = phi i32 [ %dec29.3, %for.inc25.3 ], [ %arrayidx21.promoted.3, %for.inc31.2 ]
%13 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i.3 = call noundef i32 @putc(i32 noundef 42, ptr noundef %13)
%dec29.3 = add nsw i32 %dec294749.3, -1
%cmp22.3 = icmp ugt i32 %dec294749.3, 1
br i1 %cmp22.3, label %for.inc25.3, label %for.inc31.3, !llvm.loop !15
for.inc31.3: ; preds = %for.inc25.3, %for.inc31.2
%14 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i43.3 = call noundef i32 @putc(i32 noundef 10, ptr noundef %14)
%call18.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
%arrayidx21.4 = getelementptr inbounds [6 x i32], ptr %g, i64 0, i64 4
%arrayidx21.promoted.4 = load i32, ptr %arrayidx21.4, align 16, !tbaa !5
%cmp2248.4 = icmp sgt i32 %arrayidx21.promoted.4, 0
br i1 %cmp2248.4, label %for.inc25.4, label %for.inc31.4
for.inc25.4: ; preds = %for.inc31.3, %for.inc25.4
%dec294749.4 = phi i32 [ %dec29.4, %for.inc25.4 ], [ %arrayidx21.promoted.4, %for.inc31.3 ]
%15 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i.4 = call noundef i32 @putc(i32 noundef 42, ptr noundef %15)
%dec29.4 = add nsw i32 %dec294749.4, -1
%cmp22.4 = icmp ugt i32 %dec294749.4, 1
br i1 %cmp22.4, label %for.inc25.4, label %for.inc31.4, !llvm.loop !15
for.inc31.4: ; preds = %for.inc25.4, %for.inc31.3
%16 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i43.4 = call noundef i32 @putc(i32 noundef 10, ptr noundef %16)
%call18.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
%arrayidx21.5 = getelementptr inbounds [6 x i32], ptr %g, i64 0, i64 5
%arrayidx21.promoted.5 = load i32, ptr %arrayidx21.5, align 4, !tbaa !5
%cmp2248.5 = icmp sgt i32 %arrayidx21.promoted.5, 0
br i1 %cmp2248.5, label %for.inc25.5, label %for.inc31.5
for.inc25.5: ; preds = %for.inc31.4, %for.inc25.5
%dec294749.5 = phi i32 [ %dec29.5, %for.inc25.5 ], [ %arrayidx21.promoted.5, %for.inc31.4 ]
%17 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i.5 = call noundef i32 @putc(i32 noundef 42, ptr noundef %17)
%dec29.5 = add nsw i32 %dec294749.5, -1
%cmp22.5 = icmp ugt i32 %dec294749.5, 1
br i1 %cmp22.5, label %for.inc25.5, label %for.inc31.5, !llvm.loop !15
for.inc31.5: ; preds = %for.inc25.5, %for.inc31.4
%18 = load ptr, ptr @stdout, align 8, !tbaa !13
%call.i43.5 = call noundef i32 @putc(i32 noundef 10, ptr noundef %18)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !12}
|
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//ABC114A
int main(void) {
int n, k, i, cou=0, tmp;
scanf("%d", &n);
if(n==3||n==5||n==7) printf("YES");
else printf("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256323/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256323/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; 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
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end
if.end: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %entry ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(void){
int n;
scanf("%d",&n);
if(n==3||n==5||n==7){
printf("YES");
}else{
printf("NO");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256367/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256367/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; 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
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end
if.end: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %entry ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(void)
{
int X;
scanf("%d", &X);
if (X == 7 || X == 5 || X == 3)
puts("YES");
else
puts("NO");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256417/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256417/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%0 = load i32, ptr %X, align 4
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end
if.end: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %entry ]
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress 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(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(void) {
int age;
if (scanf("%1d", &age) != EOF) {
if (age == 3 || age == 5 || age == 7) {
printf("YES");
} else {
printf("NO");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256460/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256460/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%1d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%age = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %age) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %age)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %if.end8, label %if.then
if.then: ; preds = %entry
%0 = load i32, ptr %age, align 4
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end8.sink.split
switch.lookup: ; preds = %if.then
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end8.sink.split
if.end8.sink.split: ; preds = %if.then, %switch.lookup
%.str.1.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %if.then ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
br label %if.end8
if.end8: ; preds = %if.end8.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %age) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(void)
{
int x;
scanf("%d", &x);
if (x == 5 || x == 7 || x == 3)
puts("YES");
else
puts("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256503/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256503/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end
if.end: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %entry ]
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress 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(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(void){
int n;
scanf("%d",&n);
if(n==3||n==5||n==7) printf("YES");
else printf("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256547/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256547/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; 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
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end
if.end: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %entry ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(void){
// Your code here!
int N;
scanf("%d",&N);
if(N == 3 || N == 5 || N == 7)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256590/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256590/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end
if.end: ; preds = %entry, %switch.lookup
%str.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @str, %entry ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
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(void){
int i;
scanf("%d", &i);
if(i==3 || i==5 || i==7){
printf("YES");
}
else{
printf("NO");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256633/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256633/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end
if.end: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %entry ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(){
int x;
scanf("%d",&x);
if(x == 3 || x == 5 || x == 7) printf("YES");
else printf("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256684/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256684/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4
%switch.tableidx = add i32 %0, -3
%1 = icmp ult i32 %switch.tableidx, 5
br i1 %1, label %switch.lookup, label %if.end
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end
if.end: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %entry ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
#include<string.h>
int main(void)
{
int len,n=0,w=0,s=0,e=0;
char str[1010];
scanf("%s",str);
len=strlen(str);
for(int i=0;i<len;i++){
switch(str[i]){
case 'N':n++;break;
case 'W':w++;break;
case 'S':s++;break;
case 'E':e++;break;
}
}
puts((n==0&&s!=0)||(s==0&&n!=0)||(w==0&&e!=0)||(e==0&&w!=0)?"No":"Yes");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256734/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256734/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [1010 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1010, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #5
%conv = trunc i64 %call2 to i32
%cmp44 = icmp sgt i32 %conv, 0
br i1 %cmp44, label %for.body.preheader, label %lor.rhs
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
%xtraiter = and i64 %call2, 1
%0 = icmp eq i64 %wide.trip.count, 1
br i1 %0, label %for.cond.cleanup.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body
for.cond.cleanup.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%n.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %n.1.1, %for.inc.1 ]
%w.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %w.1.1, %for.inc.1 ]
%s.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %s.1.1, %for.inc.1 ]
%e.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %e.1.1, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%e.048.unr = phi i32 [ 0, %for.body.preheader ], [ %e.1.1, %for.inc.1 ]
%s.047.unr = phi i32 [ 0, %for.body.preheader ], [ %s.1.1, %for.inc.1 ]
%w.046.unr = phi i32 [ 0, %for.body.preheader ], [ %w.1.1, %for.inc.1 ]
%n.045.unr = phi i32 [ 0, %for.body.preheader ], [ %n.1.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.unr-lcssa
%arrayidx.epil = getelementptr inbounds [1010 x i8], ptr %str, i64 0, i64 %indvars.iv.unr
%1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%conv4.epil = sext i8 %1 to i32
switch i32 %conv4.epil, label %for.cond.cleanup [
i32 78, label %sw.bb.epil
i32 87, label %sw.bb5.epil
i32 83, label %sw.bb7.epil
i32 69, label %sw.bb9.epil
]
sw.bb9.epil: ; preds = %for.body.epil
%inc10.epil = add nsw i32 %e.048.unr, 1
br label %for.cond.cleanup
sw.bb7.epil: ; preds = %for.body.epil
%inc8.epil = add nsw i32 %s.047.unr, 1
br label %for.cond.cleanup
sw.bb5.epil: ; preds = %for.body.epil
%inc6.epil = add nsw i32 %w.046.unr, 1
br label %for.cond.cleanup
sw.bb.epil: ; preds = %for.body.epil
%inc.epil = add nsw i32 %n.045.unr, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.epil, %sw.bb9.epil, %sw.bb7.epil, %sw.bb5.epil, %sw.bb.epil, %for.cond.cleanup.unr-lcssa
%n.1.lcssa = phi i32 [ %n.1.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %n.045.unr, %for.body.epil ], [ %n.045.unr, %sw.bb9.epil ], [ %n.045.unr, %sw.bb7.epil ], [ %n.045.unr, %sw.bb5.epil ], [ %inc.epil, %sw.bb.epil ]
%w.1.lcssa = phi i32 [ %w.1.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %w.046.unr, %for.body.epil ], [ %w.046.unr, %sw.bb9.epil ], [ %w.046.unr, %sw.bb7.epil ], [ %inc6.epil, %sw.bb5.epil ], [ %w.046.unr, %sw.bb.epil ]
%s.1.lcssa = phi i32 [ %s.1.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %s.047.unr, %for.body.epil ], [ %s.047.unr, %sw.bb9.epil ], [ %inc8.epil, %sw.bb7.epil ], [ %s.047.unr, %sw.bb5.epil ], [ %s.047.unr, %sw.bb.epil ]
%e.1.lcssa = phi i32 [ %e.1.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %e.048.unr, %for.body.epil ], [ %inc10.epil, %sw.bb9.epil ], [ %e.048.unr, %sw.bb7.epil ], [ %e.048.unr, %sw.bb5.epil ], [ %e.048.unr, %sw.bb.epil ]
%cmp12 = icmp eq i32 %n.1.lcssa, 0
%cmp14 = icmp ne i32 %s.1.lcssa, 0
%or.cond = select i1 %cmp12, i1 %cmp14, i1 false
br i1 %or.cond, label %lor.end, label %lor.lhs.false
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%e.048 = phi i32 [ 0, %for.body.preheader.new ], [ %e.1.1, %for.inc.1 ]
%s.047 = phi i32 [ 0, %for.body.preheader.new ], [ %s.1.1, %for.inc.1 ]
%w.046 = phi i32 [ 0, %for.body.preheader.new ], [ %w.1.1, %for.inc.1 ]
%n.045 = phi i32 [ 0, %for.body.preheader.new ], [ %n.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds [1010 x i8], ptr %str, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 2, !tbaa !5
%conv4 = sext i8 %2 to i32
switch i32 %conv4, label %for.inc [
i32 78, label %sw.bb
i32 87, label %sw.bb5
i32 83, label %sw.bb7
i32 69, label %sw.bb9
]
sw.bb: ; preds = %for.body
%inc = add nsw i32 %n.045, 1
br label %for.inc
sw.bb5: ; preds = %for.body
%inc6 = add nsw i32 %w.046, 1
br label %for.inc
sw.bb7: ; preds = %for.body
%inc8 = add nsw i32 %s.047, 1
br label %for.inc
sw.bb9: ; preds = %for.body
%inc10 = add nsw i32 %e.048, 1
br label %for.inc
for.inc: ; preds = %sw.bb, %sw.bb5, %sw.bb7, %sw.bb9, %for.body
%n.1 = phi i32 [ %n.045, %for.body ], [ %n.045, %sw.bb9 ], [ %n.045, %sw.bb7 ], [ %n.045, %sw.bb5 ], [ %inc, %sw.bb ]
%w.1 = phi i32 [ %w.046, %for.body ], [ %w.046, %sw.bb9 ], [ %w.046, %sw.bb7 ], [ %inc6, %sw.bb5 ], [ %w.046, %sw.bb ]
%s.1 = phi i32 [ %s.047, %for.body ], [ %s.047, %sw.bb9 ], [ %inc8, %sw.bb7 ], [ %s.047, %sw.bb5 ], [ %s.047, %sw.bb ]
%e.1 = phi i32 [ %e.048, %for.body ], [ %inc10, %sw.bb9 ], [ %e.048, %sw.bb7 ], [ %e.048, %sw.bb5 ], [ %e.048, %sw.bb ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [1010 x i8], ptr %str, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv4.1 = sext i8 %3 to i32
switch i32 %conv4.1, label %for.inc.1 [
i32 78, label %sw.bb.1
i32 87, label %sw.bb5.1
i32 83, label %sw.bb7.1
i32 69, label %sw.bb9.1
]
sw.bb9.1: ; preds = %for.inc
%inc10.1 = add nsw i32 %e.1, 1
br label %for.inc.1
sw.bb7.1: ; preds = %for.inc
%inc8.1 = add nsw i32 %s.1, 1
br label %for.inc.1
sw.bb5.1: ; preds = %for.inc
%inc6.1 = add nsw i32 %w.1, 1
br label %for.inc.1
sw.bb.1: ; preds = %for.inc
%inc.1 = add nsw i32 %n.1, 1
br label %for.inc.1
for.inc.1: ; preds = %sw.bb.1, %sw.bb5.1, %sw.bb7.1, %sw.bb9.1, %for.inc
%n.1.1 = phi i32 [ %n.1, %for.inc ], [ %n.1, %sw.bb9.1 ], [ %n.1, %sw.bb7.1 ], [ %n.1, %sw.bb5.1 ], [ %inc.1, %sw.bb.1 ]
%w.1.1 = phi i32 [ %w.1, %for.inc ], [ %w.1, %sw.bb9.1 ], [ %w.1, %sw.bb7.1 ], [ %inc6.1, %sw.bb5.1 ], [ %w.1, %sw.bb.1 ]
%s.1.1 = phi i32 [ %s.1, %for.inc ], [ %s.1, %sw.bb9.1 ], [ %inc8.1, %sw.bb7.1 ], [ %s.1, %sw.bb5.1 ], [ %s.1, %sw.bb.1 ]
%e.1.1 = phi i32 [ %e.1, %for.inc ], [ %inc10.1, %sw.bb9.1 ], [ %e.1, %sw.bb7.1 ], [ %e.1, %sw.bb5.1 ], [ %e.1, %sw.bb.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.cond.cleanup.unr-lcssa, label %for.body, !llvm.loop !8
lor.lhs.false: ; preds = %for.cond.cleanup
%cmp16 = icmp eq i32 %s.1.lcssa, 0
%cmp19 = icmp ne i32 %n.1.lcssa, 0
%or.cond32 = and i1 %cmp16, %cmp19
br i1 %or.cond32, label %lor.end, label %lor.lhs.false21
lor.lhs.false21: ; preds = %lor.lhs.false
%cmp22 = icmp eq i32 %w.1.lcssa, 0
%cmp25 = icmp ne i32 %e.1.lcssa, 0
%or.cond33 = select i1 %cmp22, i1 %cmp25, i1 false
br i1 %or.cond33, label %lor.end, label %lor.rhs
lor.rhs: ; preds = %entry, %lor.lhs.false21
%e.0.lcssa647280 = phi i32 [ %e.1.lcssa, %lor.lhs.false21 ], [ 0, %entry ]
%w.0.lcssa627379 = phi i32 [ %w.1.lcssa, %lor.lhs.false21 ], [ 0, %entry ]
%cmp27 = icmp eq i32 %e.0.lcssa647280, 0
%cmp29 = icmp ne i32 %w.0.lcssa627379, 0
%4 = select i1 %cmp27, i1 %cmp29, i1 false
%5 = select i1 %4, ptr @.str.1, ptr @.str.2
br label %lor.end
lor.end: ; preds = %lor.lhs.false21, %lor.lhs.false, %for.cond.cleanup, %lor.rhs
%cond = phi ptr [ %5, %lor.rhs ], [ @.str.1, %for.cond.cleanup ], [ @.str.1, %lor.lhs.false ], [ @.str.1, %lor.lhs.false21 ]
%call31 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 1010, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
char input[1001];
int len, i, j, dir[4];
for (i = 0; i < 4; i++) {
dir[i] = 0;
}
scanf("%s", input);
len = strlen(input);
for (i = 0; i < len; i++) {
if (input[i] == 'W') {
dir[0] = 1;
} else if (input[i] == 'N') {
dir[1] = 1;
} else if (input[i] == 'S') {
dir[2] = 1;
} else if (input[i] == 'E') {
dir[3] = 1;
}
}
if (dir[0] == dir[3] && dir[2] == dir[1]) {
puts("Yes");
} else {
puts("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256778/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256778/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%input = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %input) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %input) #5
%conv = trunc i64 %call2 to i32
%cmp464 = icmp sgt i32 %conv, 0
br i1 %cmp464, label %for.body6.lr.ph, label %if.end54
for.body6.lr.ph: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
%xtraiter = and i64 %call2, 1
%0 = icmp eq i64 %wide.trip.count, 1
br i1 %0, label %for.end41.unr-lcssa, label %for.body6.lr.ph.new
for.body6.lr.ph.new: ; preds = %for.body6.lr.ph
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body6
for.body6: ; preds = %for.inc39.1, %for.body6.lr.ph.new
%indvars.iv = phi i64 [ 0, %for.body6.lr.ph.new ], [ %indvars.iv.next.1, %for.inc39.1 ]
%1 = phi i32 [ 0, %for.body6.lr.ph.new ], [ %11, %for.inc39.1 ]
%2 = phi i32 [ 0, %for.body6.lr.ph.new ], [ %12, %for.inc39.1 ]
%3 = phi i32 [ 0, %for.body6.lr.ph.new ], [ %13, %for.inc39.1 ]
%4 = phi i32 [ 0, %for.body6.lr.ph.new ], [ %14, %for.inc39.1 ]
%niter = phi i64 [ 0, %for.body6.lr.ph.new ], [ %niter.next.1, %for.inc39.1 ]
%arrayidx8 = getelementptr inbounds [1001 x i8], ptr %input, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx8, align 2, !tbaa !5
switch i8 %5, label %for.inc39 [
i8 87, label %if.then
i8 78, label %if.then18
i8 83, label %if.then26
i8 69, label %if.then34
]
if.then: ; preds = %for.body6
br label %for.inc39
if.then18: ; preds = %for.body6
br label %for.inc39
if.then26: ; preds = %for.body6
br label %for.inc39
if.then34: ; preds = %for.body6
br label %for.inc39
for.inc39: ; preds = %for.body6, %if.then, %if.then26, %if.then34, %if.then18
%6 = phi i32 [ %1, %for.body6 ], [ %1, %if.then ], [ %1, %if.then26 ], [ %1, %if.then34 ], [ 1, %if.then18 ]
%7 = phi i32 [ %2, %for.body6 ], [ %2, %if.then ], [ 1, %if.then26 ], [ %2, %if.then34 ], [ %2, %if.then18 ]
%8 = phi i32 [ %3, %for.body6 ], [ %3, %if.then ], [ %3, %if.then26 ], [ 1, %if.then34 ], [ %3, %if.then18 ]
%9 = phi i32 [ %4, %for.body6 ], [ 1, %if.then ], [ %4, %if.then26 ], [ %4, %if.then34 ], [ %4, %if.then18 ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx8.1 = getelementptr inbounds [1001 x i8], ptr %input, i64 0, i64 %indvars.iv.next
%10 = load i8, ptr %arrayidx8.1, align 1, !tbaa !5
switch i8 %10, label %for.inc39.1 [
i8 87, label %if.then.1
i8 78, label %if.then18.1
i8 83, label %if.then26.1
i8 69, label %if.then34.1
]
if.then34.1: ; preds = %for.inc39
br label %for.inc39.1
if.then26.1: ; preds = %for.inc39
br label %for.inc39.1
if.then18.1: ; preds = %for.inc39
br label %for.inc39.1
if.then.1: ; preds = %for.inc39
br label %for.inc39.1
for.inc39.1: ; preds = %if.then.1, %if.then18.1, %if.then26.1, %if.then34.1, %for.inc39
%11 = phi i32 [ %6, %for.inc39 ], [ %6, %if.then.1 ], [ %6, %if.then26.1 ], [ %6, %if.then34.1 ], [ 1, %if.then18.1 ]
%12 = phi i32 [ %7, %for.inc39 ], [ %7, %if.then.1 ], [ 1, %if.then26.1 ], [ %7, %if.then34.1 ], [ %7, %if.then18.1 ]
%13 = phi i32 [ %8, %for.inc39 ], [ %8, %if.then.1 ], [ %8, %if.then26.1 ], [ 1, %if.then34.1 ], [ %8, %if.then18.1 ]
%14 = phi i32 [ %9, %for.inc39 ], [ 1, %if.then.1 ], [ %9, %if.then26.1 ], [ %9, %if.then34.1 ], [ %9, %if.then18.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.end41.unr-lcssa, label %for.body6, !llvm.loop !8
for.end41.unr-lcssa: ; preds = %for.inc39.1, %for.body6.lr.ph
%.lcssa96.ph = phi i32 [ undef, %for.body6.lr.ph ], [ %11, %for.inc39.1 ]
%.lcssa95.ph = phi i32 [ undef, %for.body6.lr.ph ], [ %12, %for.inc39.1 ]
%.lcssa94.ph = phi i32 [ undef, %for.body6.lr.ph ], [ %13, %for.inc39.1 ]
%.lcssa.ph = phi i32 [ undef, %for.body6.lr.ph ], [ %14, %for.inc39.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next.1, %for.inc39.1 ]
%.unr = phi i32 [ 0, %for.body6.lr.ph ], [ %11, %for.inc39.1 ]
%.unr97 = phi i32 [ 0, %for.body6.lr.ph ], [ %12, %for.inc39.1 ]
%.unr98 = phi i32 [ 0, %for.body6.lr.ph ], [ %13, %for.inc39.1 ]
%.unr99 = phi i32 [ 0, %for.body6.lr.ph ], [ %14, %for.inc39.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end41, label %for.body6.epil
for.body6.epil: ; preds = %for.end41.unr-lcssa
%arrayidx8.epil = getelementptr inbounds [1001 x i8], ptr %input, i64 0, i64 %indvars.iv.unr
%15 = load i8, ptr %arrayidx8.epil, align 1, !tbaa !5
switch i8 %15, label %for.end41 [
i8 87, label %if.then.epil
i8 78, label %if.then18.epil
i8 83, label %if.then26.epil
i8 69, label %if.then34.epil
]
if.then34.epil: ; preds = %for.body6.epil
br label %for.end41
if.then26.epil: ; preds = %for.body6.epil
br label %for.end41
if.then18.epil: ; preds = %for.body6.epil
br label %for.end41
if.then.epil: ; preds = %for.body6.epil
br label %for.end41
for.end41: ; preds = %for.body6.epil, %if.then34.epil, %if.then26.epil, %if.then18.epil, %if.then.epil, %for.end41.unr-lcssa
%.lcssa96 = phi i32 [ %.lcssa96.ph, %for.end41.unr-lcssa ], [ %.unr, %for.body6.epil ], [ %.unr, %if.then.epil ], [ %.unr, %if.then26.epil ], [ %.unr, %if.then34.epil ], [ 1, %if.then18.epil ]
%.lcssa95 = phi i32 [ %.lcssa95.ph, %for.end41.unr-lcssa ], [ %.unr97, %for.body6.epil ], [ %.unr97, %if.then.epil ], [ 1, %if.then26.epil ], [ %.unr97, %if.then34.epil ], [ %.unr97, %if.then18.epil ]
%.lcssa94 = phi i32 [ %.lcssa94.ph, %for.end41.unr-lcssa ], [ %.unr98, %for.body6.epil ], [ %.unr98, %if.then.epil ], [ %.unr98, %if.then26.epil ], [ 1, %if.then34.epil ], [ %.unr98, %if.then18.epil ]
%.lcssa = phi i32 [ %.lcssa.ph, %for.end41.unr-lcssa ], [ %.unr99, %for.body6.epil ], [ 1, %if.then.epil ], [ %.unr99, %if.then26.epil ], [ %.unr99, %if.then34.epil ], [ %.unr99, %if.then18.epil ]
%cmp44 = icmp eq i32 %.lcssa, %.lcssa94
%cmp48 = icmp eq i32 %.lcssa95, %.lcssa96
%or.cond = select i1 %cmp44, i1 %cmp48, i1 false
%spec.select = select i1 %or.cond, ptr @.str.1, ptr @.str.2
br label %if.end54
if.end54: ; preds = %for.end41, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %for.end41 ]
%call53 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %input) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int m,n1,n2,i,dif,result;
int p[200];
while(1){
scanf("%d %d %d",&m,&n1,&n2);
if(m==0&n1==0&n2==0){
break;
}
for(i=0;i<m;i++){
scanf("%d",&p[i]);
}
dif=0;
for(i=n1;i<=n2;i++){
if(p[i-1]-p[i]>=dif){
dif=p[i-1]-p[i];
result=i;
}
}
printf("%d\n",result);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256835/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256835/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%n1 = alloca i32, align 4
%n2 = alloca i32, align 4
%p = alloca [200 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #4
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %p) #4
%call50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n1, ptr noundef nonnull %n2)
%0 = load i32, ptr %m, align 4, !tbaa !5
%1 = load i32, ptr %n1, align 4, !tbaa !5
%2 = or i32 %1, %0
%3 = load i32, ptr %n2, align 4, !tbaa !5
%4 = or i32 %2, %3
%and54251 = icmp eq i32 %4, 0
br i1 %and54251, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end30
%5 = phi i32 [ %30, %for.end30 ], [ %3, %entry ]
%6 = phi i32 [ %28, %for.end30 ], [ %1, %entry ]
%7 = phi i32 [ %27, %for.end30 ], [ %0, %entry ]
%result.052 = phi i32 [ %result.1.lcssa, %for.end30 ], [ undef, %entry ]
%cmp644 = icmp sgt i32 %7, 0
br i1 %cmp644, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [200 x i32], ptr %p, i64 0, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp6 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp6, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%.pre = load i32, ptr %n1, align 4, !tbaa !5
%.pre58 = load i32, ptr %n2, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %for.cond.preheader
%10 = phi i32 [ %.pre58, %for.end.loopexit ], [ %5, %for.cond.preheader ]
%11 = phi i32 [ %.pre, %for.end.loopexit ], [ %6, %for.cond.preheader ]
%cmp10.not46 = icmp sgt i32 %11, %10
br i1 %cmp10.not46, label %for.end30, label %for.body12.preheader
for.body12.preheader: ; preds = %for.end
%12 = sext i32 %11 to i64
%13 = add i32 %10, 1
%14 = sub i32 %13, %11
%xtraiter = and i32 %14, 1
%15 = icmp eq i32 %10, %11
br i1 %15, label %for.end30.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i32 %14, -2
br label %for.body12
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%indvars.iv54 = phi i64 [ %12, %for.body12.preheader.new ], [ %indvars.iv.next55.1, %for.body12 ]
%result.149 = phi i32 [ %result.052, %for.body12.preheader.new ], [ %spec.select43.1, %for.body12 ]
%dif.048 = phi i32 [ 0, %for.body12.preheader.new ], [ %spec.select.1, %for.body12 ]
%niter = phi i32 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%16 = add nsw i64 %indvars.iv54, -1
%arrayidx14 = getelementptr inbounds [200 x i32], ptr %p, i64 0, i64 %16
%17 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds [200 x i32], ptr %p, i64 0, i64 %indvars.iv54
%18 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%sub17 = sub nsw i32 %17, %18
%cmp18.not = icmp slt i32 %sub17, %dif.048
%spec.select = call i32 @llvm.smax.i32(i32 %sub17, i32 %dif.048)
%19 = trunc i64 %indvars.iv54 to i32
%spec.select43 = select i1 %cmp18.not, i32 %result.149, i32 %19
%indvars.iv.next55 = add nsw i64 %indvars.iv54, 1
%arrayidx14.1 = getelementptr inbounds [200 x i32], ptr %p, i64 0, i64 %indvars.iv54
%20 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5
%arrayidx16.1 = getelementptr inbounds [200 x i32], ptr %p, i64 0, i64 %indvars.iv.next55
%21 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
%sub17.1 = sub nsw i32 %20, %21
%cmp18.not.1 = icmp slt i32 %sub17.1, %spec.select
%spec.select.1 = call i32 @llvm.smax.i32(i32 %sub17.1, i32 %spec.select)
%22 = trunc i64 %indvars.iv.next55 to i32
%spec.select43.1 = select i1 %cmp18.not.1, i32 %spec.select43, i32 %22
%indvars.iv.next55.1 = add nsw i64 %indvars.iv54, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end30.loopexit.unr-lcssa, label %for.body12, !llvm.loop !11
for.end30.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%spec.select43.lcssa.ph = phi i32 [ undef, %for.body12.preheader ], [ %spec.select43.1, %for.body12 ]
%indvars.iv54.unr = phi i64 [ %12, %for.body12.preheader ], [ %indvars.iv.next55.1, %for.body12 ]
%result.149.unr = phi i32 [ %result.052, %for.body12.preheader ], [ %spec.select43.1, %for.body12 ]
%dif.048.unr = phi i32 [ 0, %for.body12.preheader ], [ %spec.select.1, %for.body12 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end30, label %for.body12.epil
for.body12.epil: ; preds = %for.end30.loopexit.unr-lcssa
%23 = add nsw i64 %indvars.iv54.unr, -1
%arrayidx14.epil = getelementptr inbounds [200 x i32], ptr %p, i64 0, i64 %23
%24 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5
%arrayidx16.epil = getelementptr inbounds [200 x i32], ptr %p, i64 0, i64 %indvars.iv54.unr
%25 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
%sub17.epil = sub nsw i32 %24, %25
%cmp18.not.epil = icmp slt i32 %sub17.epil, %dif.048.unr
%26 = trunc i64 %indvars.iv54.unr to i32
%spec.select43.epil = select i1 %cmp18.not.epil, i32 %result.149.unr, i32 %26
br label %for.end30
for.end30: ; preds = %for.body12.epil, %for.end30.loopexit.unr-lcssa, %for.end
%result.1.lcssa = phi i32 [ %result.052, %for.end ], [ %spec.select43.lcssa.ph, %for.end30.loopexit.unr-lcssa ], [ %spec.select43.epil, %for.body12.epil ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %result.1.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n1, ptr noundef nonnull %n2)
%27 = load i32, ptr %m, align 4, !tbaa !5
%28 = load i32, ptr %n1, align 4, !tbaa !5
%29 = or i32 %28, %27
%30 = load i32, ptr %n2, align 4, !tbaa !5
%31 = or i32 %29, %30
%and542 = icmp eq i32 %31, 0
br i1 %and542, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end30, %entry
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n1) #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.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
#define infinity 1000000000
int max(int a,int b){
return a>b?a:b;
}
int main()
{
int n,ans=0;
scanf("%d",&n);
int dp[n][3],a[n][3];
for(int i=0;i<n;i++){
scanf("%d %d %d",&a[i][0],&a[i][1],&a[i][2]);
dp[i][0]=0,dp[i][1]=0,dp[i][2]=0;
}
dp[0][0]=a[0][0],dp[0][1]=a[0][1],dp[0][2]=a[0][2];
for(int i=1;i<n;i++)
{
for(int j=0;j<3;j++)
{
for(int k=0;k<3;k++)
{
if(j!=k)
dp[i][k]=max(dp[i][k],dp[i-1][j]+a[i][k]);
}
}
}
for(int i=0;i<3;i++)
ans=max(ans,dp[n-1][i]);
printf("%d",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256921/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256921/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca [3 x i32], i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca [3 x i32], i64 %4, align 16
%cmp110 = icmp sgt i32 %3, 0
br i1 %cmp110, label %for.body, label %for.cond72.preheader
for.cond.cleanup: ; preds = %for.body
%arrayidx28.phi.trans.insert = getelementptr inbounds [3 x i32], ptr %vla1, i64 0, i64 2
%.pre149 = load i32, ptr %arrayidx28.phi.trans.insert, align 8, !tbaa !5
%5 = load <2 x i32>, ptr %vla1, align 16, !tbaa !5
store <2 x i32> %5, ptr %vla, align 16, !tbaa !5
%arrayidx30 = getelementptr inbounds [3 x i32], ptr %vla, i64 0, i64 2
store i32 %.pre149, ptr %arrayidx30, align 8, !tbaa !5
%cmp33114 = icmp sgt i32 %6, 1
br i1 %cmp33114, label %for.cond36.preheader.preheader, label %for.cond72.preheader
for.cond36.preheader.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %6 to i64
br label %for.inc62.2.2
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [3 x i32], ptr %vla1, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [3 x i32], ptr %vla1, i64 %indvars.iv, i64 1
%arrayidx8 = getelementptr inbounds [3 x i32], ptr %vla1, i64 %indvars.iv, i64 2
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx8)
%arrayidx11 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv
store i32 0, ptr %arrayidx11, align 4, !tbaa !5
%arrayidx15 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv, i64 1
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv, i64 2
store i32 0, ptr %arrayidx18, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond72.preheader: ; preds = %for.inc62.2.2, %entry, %for.cond.cleanup
%.lcssa154 = phi i32 [ %6, %for.cond.cleanup ], [ %3, %entry ], [ %6, %for.inc62.2.2 ]
%sub76 = add nsw i32 %.lcssa154, -1
%idxprom77 = sext i32 %sub76 to i64
%arrayidx80 = getelementptr inbounds [3 x i32], ptr %vla, i64 %idxprom77, i64 0
%8 = load i32, ptr %arrayidx80, align 4, !tbaa !5
%arrayidx80.1 = getelementptr inbounds [3 x i32], ptr %vla, i64 %idxprom77, i64 1
%9 = load i32, ptr %arrayidx80.1, align 4, !tbaa !5
%cond.i109 = call i32 @llvm.smax.i32(i32 %8, i32 %9)
%arrayidx80.2 = getelementptr inbounds [3 x i32], ptr %vla, i64 %idxprom77, i64 2
%10 = load i32, ptr %arrayidx80.2, align 4, !tbaa !5
%cond.i109.1 = call i32 @llvm.smax.i32(i32 %cond.i109, i32 %10)
%cond.i109.2 = call i32 @llvm.smax.i32(i32 %cond.i109.1, i32 0)
%call85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cond.i109.2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
for.inc62.2.2: ; preds = %for.inc62.2.2, %for.cond36.preheader.preheader
%indvars.iv140 = phi i64 [ 1, %for.cond36.preheader.preheader ], [ %indvars.iv.next141, %for.inc62.2.2 ]
%11 = add nsw i64 %indvars.iv140, -1
%arrayidx52 = getelementptr inbounds [3 x i32], ptr %vla, i64 %11, i64 0
%arrayidx48.1 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv140, i64 1
%12 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%arrayidx56.1 = getelementptr inbounds [3 x i32], ptr %vla1, i64 %indvars.iv140, i64 1
%13 = load <2 x i32>, ptr %arrayidx48.1, align 4, !tbaa !5
%14 = load <2 x i32>, ptr %arrayidx56.1, align 4, !tbaa !5
%15 = insertelement <2 x i32> poison, i32 %12, i64 0
%16 = shufflevector <2 x i32> %15, <2 x i32> poison, <2 x i32> zeroinitializer
%17 = add nsw <2 x i32> %14, %16
%18 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %13, <2 x i32> %17)
store <2 x i32> %18, ptr %arrayidx48.1, align 4, !tbaa !5
%arrayidx52.1 = getelementptr inbounds [3 x i32], ptr %vla, i64 %11, i64 1
%arrayidx48.1127 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv140, i64 0
%19 = load i32, ptr %arrayidx48.1127, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx52.1, align 4, !tbaa !5
%arrayidx56.1128 = getelementptr inbounds [3 x i32], ptr %vla1, i64 %indvars.iv140, i64 0
%21 = load i32, ptr %arrayidx56.1128, align 4, !tbaa !5
%add.1129 = add nsw i32 %21, %20
%cond.i.1130 = call i32 @llvm.smax.i32(i32 %19, i32 %add.1129)
store i32 %cond.i.1130, ptr %arrayidx48.1127, align 4, !tbaa !5
%arrayidx48.2.1 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv140, i64 2
%22 = load i32, ptr %arrayidx48.2.1, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx52.1, align 4, !tbaa !5
%arrayidx56.2.1 = getelementptr inbounds [3 x i32], ptr %vla1, i64 %indvars.iv140, i64 2
%24 = load i32, ptr %arrayidx56.2.1, align 4, !tbaa !5
%add.2.1 = add nsw i32 %24, %23
%cond.i.2.1 = call i32 @llvm.smax.i32(i32 %22, i32 %add.2.1)
store i32 %cond.i.2.1, ptr %arrayidx48.2.1, align 4, !tbaa !5
%arrayidx52.2 = getelementptr inbounds [3 x i32], ptr %vla, i64 %11, i64 2
%arrayidx48.2134 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv140, i64 0
%25 = load i32, ptr %arrayidx52.2, align 4, !tbaa !5
%arrayidx56.2135 = getelementptr inbounds [3 x i32], ptr %vla1, i64 %indvars.iv140, i64 0
%26 = load <2 x i32>, ptr %arrayidx48.2134, align 4, !tbaa !5
%27 = load <2 x i32>, ptr %arrayidx56.2135, align 4, !tbaa !5
%28 = insertelement <2 x i32> poison, i32 %25, i64 0
%29 = shufflevector <2 x i32> %28, <2 x i32> poison, <2 x i32> zeroinitializer
%30 = add nsw <2 x i32> %27, %29
%31 = call <2 x i32> @llvm.smax.v2i32(<2 x i32> %26, <2 x i32> %30)
store <2 x i32> %31, ptr %arrayidx48.2134, align 4, !tbaa !5
%indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
%exitcond.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count
br i1 %exitcond.not, label %for.cond72.preheader, label %for.inc62.2.2, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.smax.v2i32(<2 x i32>, <2 x i32>) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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}
|
#include <stdio.h>
int n;
int a[100100][3], dp[100100][3];
int max(int a, int b) {
return (a > b ? a : b);
}
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
for (int j = 0; j < 3; j++) scanf("%d", &a[i][j]);
}
for (int i = 0; i < 3; i++) dp[0][i] = a[0][i];
for (int i = 1; i < n; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 3; k++) {
if (j != k) dp[i][j] = max(dp[i][j], dp[i - 1][k] + a[i][j]);
}
}
}
int ans = 0;
for (int i = 0; i < 3; i++) ans = max(ans, dp[n - 1][i]);
printf("%d\n", ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_256965/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_256965/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@a = dso_local global [100100 x [3 x i32]] zeroinitializer, align 16
@dp = dso_local local_unnamed_addr global [100100 x [3 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp104 = icmp sgt i32 %0, 0
br i1 %cmp104, label %for.cond1.preheader, label %for.cond12.preheader.thread
for.cond12.preheader.thread: ; preds = %entry
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) @dp, ptr noundef nonnull align 16 dereferenceable(12) @a, i64 12, i1 false), !tbaa !5
br label %for.cond65.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [100100 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 0
%call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6)
%arrayidx6.1 = getelementptr inbounds [100100 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 1
%call7.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1)
%arrayidx6.2 = getelementptr inbounds [100100 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 2
%call7.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2)
%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.cond1.preheader, label %for.cond12.preheader, !llvm.loop !9
for.cond12.preheader: ; preds = %for.cond1.preheader
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) @dp, ptr noundef nonnull align 16 dereferenceable(12) @a, i64 12, i1 false), !tbaa !5
%cmp25109 = icmp sgt i32 %1, 1
br i1 %cmp25109, label %for.cond29.preheader.preheader, label %for.cond65.preheader
for.cond29.preheader.preheader: ; preds = %for.cond12.preheader
%wide.trip.count = zext i32 %1 to i64
br label %for.inc55.2.2
for.cond65.preheader: ; preds = %for.inc55.2.2, %for.cond12.preheader.thread, %for.cond12.preheader
%.lcssa147 = phi i32 [ %0, %for.cond12.preheader.thread ], [ %1, %for.cond12.preheader ], [ %1, %for.inc55.2.2 ]
%sub69 = add nsw i32 %.lcssa147, -1
%idxprom70 = sext i32 %sub69 to i64
%arrayidx73 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %idxprom70, i64 0
%3 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%arrayidx73.1 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %idxprom70, i64 1
%4 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5
%cond.i102 = tail call i32 @llvm.smax.i32(i32 %3, i32 %4)
%arrayidx73.2 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %idxprom70, i64 2
%5 = load i32, ptr %arrayidx73.2, align 4, !tbaa !5
%cond.i102.1 = tail call i32 @llvm.smax.i32(i32 %cond.i102, i32 %5)
%cond.i102.2 = tail call i32 @llvm.smax.i32(i32 %cond.i102.1, i32 0)
%call78 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond.i102.2)
ret i32 0
for.inc55.2.2: ; preds = %for.inc55.2.2, %for.cond29.preheader.preheader
%indvars.iv137 = phi i64 [ 1, %for.cond29.preheader.preheader ], [ %indvars.iv.next138, %for.inc55.2.2 ]
%6 = add nsw i64 %indvars.iv137, -1
%arrayidx41 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %indvars.iv137, i64 0
%arrayidx49 = getelementptr inbounds [100100 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv137, i64 0
%7 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%arrayidx45.1 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %6, i64 1
%8 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%add.1 = add nsw i32 %9, %8
%cond.i.1 = tail call i32 @llvm.smax.i32(i32 %7, i32 %add.1)
store i32 %cond.i.1, ptr %arrayidx41, align 4, !tbaa !5
%arrayidx45.2 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %6, i64 2
%10 = load i32, ptr %arrayidx45.2, align 4, !tbaa !5
%add.2 = add nsw i32 %9, %10
%cond.i.2 = tail call i32 @llvm.smax.i32(i32 %cond.i.1, i32 %add.2)
store i32 %cond.i.2, ptr %arrayidx41, align 4, !tbaa !5
%arrayidx41.1 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %indvars.iv137, i64 1
%arrayidx49.1 = getelementptr inbounds [100100 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv137, i64 1
%11 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5
%arrayidx45.1126 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %6, i64 0
%12 = load i32, ptr %arrayidx45.1126, align 4, !tbaa !5
%13 = load i32, ptr %arrayidx49.1, align 4, !tbaa !5
%add.1127 = add nsw i32 %13, %12
%cond.i.1128 = tail call i32 @llvm.smax.i32(i32 %11, i32 %add.1127)
store i32 %cond.i.1128, ptr %arrayidx41.1, align 4, !tbaa !5
%arrayidx45.2.1 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %6, i64 2
%14 = load i32, ptr %arrayidx45.2.1, align 4, !tbaa !5
%add.2.1 = add nsw i32 %13, %14
%cond.i.2.1 = tail call i32 @llvm.smax.i32(i32 %cond.i.1128, i32 %add.2.1)
store i32 %cond.i.2.1, ptr %arrayidx41.1, align 4, !tbaa !5
%arrayidx41.2 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %indvars.iv137, i64 2
%arrayidx49.2 = getelementptr inbounds [100100 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv137, i64 2
%15 = load i32, ptr %arrayidx41.2, align 4, !tbaa !5
%arrayidx45.2132 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %6, i64 0
%16 = load i32, ptr %arrayidx45.2132, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx49.2, align 4, !tbaa !5
%add.2133 = add nsw i32 %17, %16
%cond.i.2134 = tail call i32 @llvm.smax.i32(i32 %15, i32 %add.2133)
store i32 %cond.i.2134, ptr %arrayidx41.2, align 4, !tbaa !5
%arrayidx45.1.2 = getelementptr inbounds [100100 x [3 x i32]], ptr @dp, i64 0, i64 %6, i64 1
%18 = load i32, ptr %arrayidx45.1.2, align 4, !tbaa !5
%add.1.2 = add nsw i32 %17, %18
%cond.i.1.2 = tail call i32 @llvm.smax.i32(i32 %cond.i.2134, i32 %add.1.2)
store i32 %cond.i.1.2, ptr %arrayidx41.2, align 4, !tbaa !5
%indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
%exitcond.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count
br i1 %exitcond.not, label %for.cond65.preheader, label %for.inc55.2.2, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
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 = { nofree nounwind "no-trapping-math"="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 nounwind willreturn memory(argmem: readwrite) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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>
long max(long a,long b){
if(a>b)return a;
else return b;
}
int main(){
int N;
scanf("%d",&N);
long a[100010];
long b[100010];
long c[100010];
int i;
for(i=0;i<N;i++){
scanf("%lu%lu%lu",&a[i],&b[i],&c[i]);
}
long dp[100010][3];
dp[0][0] = 0;
dp[0][1] = 0;
dp[0][2] = 0;
dp[1][0] = max(b[0],c[0]);
dp[1][1] = max(a[0],c[0]);
dp[1][2] = max(b[0],a[0]);
for(i=2;i<=N;i++){
dp[i][0] = max(dp[i-1][1] + b[i-1],dp[i-1][2] + c[i-1] );
dp[i][1] = max(dp[i-1][0] + a[i-1],dp[i-1][2] + c[i-1] );
dp[i][2] = max(dp[i-1][0] + a[i-1],dp[i-1][1] + b[i-1] );
}
printf("%lu\n",max(dp[N][0],max(dp[N][1],dp[N][2])));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257007/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257007/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lu%lu%lu\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lu\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%a = alloca [100010 x i64], align 16
%b = alloca [100010 x i64], align 16
%c = alloca [100010 x i64], align 16
%dp = alloca [100010 x [3 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
call void @llvm.lifetime.start.p0(i64 800080, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 800080, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 800080, ptr nonnull %c) #6
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp131 = icmp sgt i32 %0, 0
br i1 %cmp131, 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 [100010 x i64], ptr %a, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100010 x i64], ptr %b, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [100010 x i64], ptr %c, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%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.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%.pre = load i64, ptr %b, align 16, !tbaa !11
%.pre141 = load i64, ptr %c, align 16, !tbaa !11
%.pre142 = load i64, ptr %a, align 16, !tbaa !11
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%3 = phi i64 [ undef, %entry ], [ %.pre142, %for.end.loopexit ]
%4 = phi i64 [ undef, %entry ], [ %.pre141, %for.end.loopexit ]
%5 = phi i64 [ undef, %entry ], [ %.pre, %for.end.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.end.loopexit ]
call void @llvm.lifetime.start.p0(i64 2400240, ptr nonnull %dp) #6
%a.b.i = call i64 @llvm.smax.i64(i64 %5, i64 %4)
%arrayidx15 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %dp, i8 0, i64 24, i1 false)
store i64 %a.b.i, ptr %arrayidx15, align 8, !tbaa !11
%a.b.i124 = call i64 @llvm.smax.i64(i64 %3, i64 %4)
%arrayidx21 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 1, i64 1
store i64 %a.b.i124, ptr %arrayidx21, align 16, !tbaa !11
%a.b.i125 = call i64 @llvm.smax.i64(i64 %5, i64 %3)
%arrayidx26 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 1, i64 2
store i64 %a.b.i125, ptr %arrayidx26, align 8, !tbaa !11
%cmp28.not133 = icmp slt i32 %.lcssa, 2
br i1 %cmp28.not133, label %for.end90, label %for.body29.preheader
for.body29.preheader: ; preds = %for.end
%6 = add nuw i32 %.lcssa, 1
%wide.trip.count = zext i32 %6 to i64
br label %for.body29
for.body29: ; preds = %for.body29.preheader, %for.body29
%7 = phi i64 [ %a.b.i, %for.body29.preheader ], [ %a.b.i126, %for.body29 ]
%8 = phi i64 [ %a.b.i125, %for.body29.preheader ], [ %a.b.i128, %for.body29 ]
%9 = phi i64 [ %a.b.i124, %for.body29.preheader ], [ %a.b.i127, %for.body29 ]
%indvars.iv137 = phi i64 [ 2, %for.body29.preheader ], [ %indvars.iv.next138, %for.body29 ]
%10 = add nsw i64 %indvars.iv137, -1
%arrayidx35 = getelementptr inbounds [100010 x i64], ptr %b, i64 0, i64 %10
%11 = load i64, ptr %arrayidx35, align 8, !tbaa !11
%add = add nsw i64 %11, %9
%arrayidx42 = getelementptr inbounds [100010 x i64], ptr %c, i64 0, i64 %10
%12 = load i64, ptr %arrayidx42, align 8, !tbaa !11
%add43 = add nsw i64 %12, %8
%a.b.i126 = call i64 @llvm.smax.i64(i64 %add, i64 %add43)
%arrayidx46 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 %indvars.iv137
store i64 %a.b.i126, ptr %arrayidx46, align 8, !tbaa !11
%arrayidx54 = getelementptr inbounds [100010 x i64], ptr %a, i64 0, i64 %10
%13 = load i64, ptr %arrayidx54, align 8, !tbaa !11
%add55 = add nsw i64 %13, %7
%a.b.i127 = call i64 @llvm.smax.i64(i64 %add55, i64 %add43)
%arrayidx67 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 %indvars.iv137, i64 1
store i64 %a.b.i127, ptr %arrayidx67, align 8, !tbaa !11
%a.b.i128 = call i64 @llvm.smax.i64(i64 %add55, i64 %add)
%arrayidx87 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 %indvars.iv137, i64 2
store i64 %a.b.i128, ptr %arrayidx87, align 8, !tbaa !11
%indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
%exitcond.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count
br i1 %exitcond.not, label %for.end90, label %for.body29, !llvm.loop !13
for.end90: ; preds = %for.body29, %for.end
%idxprom91 = sext i32 %.lcssa to i64
%arrayidx92 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 %idxprom91
%14 = load i64, ptr %arrayidx92, align 8, !tbaa !11
%arrayidx96 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 %idxprom91, i64 1
%15 = load i64, ptr %arrayidx96, align 8, !tbaa !11
%arrayidx99 = getelementptr inbounds [100010 x [3 x i64]], ptr %dp, i64 0, i64 %idxprom91, i64 2
%16 = load i64, ptr %arrayidx99, align 8, !tbaa !11
%a.b.i129 = call i64 @llvm.smax.i64(i64 %15, i64 %16)
%a.b.i130 = call i64 @llvm.smax.i64(i64 %14, i64 %a.b.i129)
%call102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %a.b.i130)
call void @llvm.lifetime.end.p0(i64 2400240, ptr nonnull %dp) #6
call void @llvm.lifetime.end.p0(i64 800080, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 800080, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 800080, ptr nonnull %a) #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 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.smax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { 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 = { 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define NOT_ZERO 1
#define MAX(a,b) (a>b?a:b)
#define MAX3(a,b,c) MAX(a,MAX(b,c))
#define MIN(a,b) (a<b?a:b)
#define MIN3(a,b,c) MIN(a, MIN(b,c))
typedef long long ll;
int main()
{
int n, i;
scanf("%d",&n);
int *a = (int*)malloc(sizeof(int)*n);
int *b = (int*)malloc(sizeof(int)*n);
int *c = (int*)malloc(sizeof(int)*n);
int *A = (int*)malloc(sizeof(int)*n);
int *B = (int*)malloc(sizeof(int)*n);
int *C = (int*)malloc(sizeof(int)*n);
for(i=0; i<n; i++) {
scanf("%d %d %d",a+i, b+i, c+i);
}
A[0] = a[0];
B[0] = b[0];
C[0] = c[0];
for(i=1; i<n; i++) {
A[i] = MAX(B[i-1]+a[i], C[i-1]+a[i]);
B[i] = MAX(A[i-1]+b[i], C[i-1]+b[i]);
C[i] = MAX(A[i-1]+c[i], B[i-1]+c[i]);
}
int ans = MAX3(A[n-1], B[n-1], C[n-1]);
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257058/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257058/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %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
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
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #6
%call4 = call noalias ptr @malloc(i64 noundef %mul) #6
%call7 = call noalias ptr @malloc(i64 noundef %mul) #6
%call10 = call noalias ptr @malloc(i64 noundef %mul) #6
%call13 = call noalias ptr @malloc(i64 noundef %mul) #6
%call16 = call noalias ptr @malloc(i64 noundef %mul) #6
%cmp254 = icmp sgt i32 %0, 0
br i1 %cmp254, label %for.body, label %for.end123
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%add.ptr19 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv
%add.ptr21 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %add.ptr, ptr noundef %add.ptr19, ptr noundef %add.ptr21)
%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
%.pre = load i32, ptr %call1, align 4, !tbaa !5
%.pre264 = load i32, ptr %call4, align 4, !tbaa !5
%.pre265 = load i32, ptr %call7, align 4, !tbaa !5
store i32 %.pre, ptr %call10, align 4, !tbaa !5
store i32 %.pre264, ptr %call13, align 4, !tbaa !5
store i32 %.pre265, ptr %call16, align 4, !tbaa !5
%cmp29256 = icmp sgt i32 %1, 1
br i1 %cmp29256, label %for.body31.preheader, label %for.end123
for.body31.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %1 to i64
br label %for.body31
for.body31: ; preds = %for.body31.preheader, %for.body31
%3 = phi i32 [ %.pre, %for.body31.preheader ], [ %cond, %for.body31 ]
%4 = phi i32 [ %.pre265, %for.body31.preheader ], [ %cond118, %for.body31 ]
%5 = phi i32 [ %.pre264, %for.body31.preheader ], [ %cond86, %for.body31 ]
%indvars.iv260 = phi i64 [ 1, %for.body31.preheader ], [ %indvars.iv.next261, %for.body31 ]
%arrayidx34 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv260
%6 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %5, i32 %4)
%cond = add nsw i32 %., %6
%arrayidx56 = getelementptr inbounds i32, ptr %call10, i64 %indvars.iv260
store i32 %cond, ptr %arrayidx56, align 4, !tbaa !5
%arrayidx61 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv260
%7 = load i32, ptr %arrayidx61, align 4, !tbaa !5
%.pn250 = call i32 @llvm.smax.i32(i32 %3, i32 %4)
%cond86 = add nsw i32 %.pn250, %7
%arrayidx88 = getelementptr inbounds i32, ptr %call13, i64 %indvars.iv260
store i32 %cond86, ptr %arrayidx88, align 4, !tbaa !5
%arrayidx93 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv260
%8 = load i32, ptr %arrayidx93, align 4, !tbaa !5
%.pn251 = call i32 @llvm.smax.i32(i32 %3, i32 %5)
%cond118 = add nsw i32 %.pn251, %8
%arrayidx120 = getelementptr inbounds i32, ptr %call16, i64 %indvars.iv260
store i32 %cond118, ptr %arrayidx120, align 4, !tbaa !5
%indvars.iv.next261 = add nuw nsw i64 %indvars.iv260, 1
%exitcond.not = icmp eq i64 %indvars.iv.next261, %wide.trip.count
br i1 %exitcond.not, label %for.end123, label %for.body31, !llvm.loop !11
for.end123: ; preds = %for.body31, %entry, %for.end
%.lcssa268 = phi i32 [ %1, %for.end ], [ %0, %entry ], [ %1, %for.body31 ]
%sub124 = add nsw i32 %.lcssa268, -1
%idxprom125 = sext i32 %sub124 to i64
%arrayidx126 = getelementptr inbounds i32, ptr %call10, i64 %idxprom125
%9 = load i32, ptr %arrayidx126, align 4, !tbaa !5
%arrayidx129 = getelementptr inbounds i32, ptr %call13, i64 %idxprom125
%10 = load i32, ptr %arrayidx129, align 4, !tbaa !5
%arrayidx132 = getelementptr inbounds i32, ptr %call16, i64 %idxprom125
%11 = load i32, ptr %arrayidx132, align 4, !tbaa !5
%.252 = call i32 @llvm.smax.i32(i32 %10, i32 %11)
%spec.select = call i32 @llvm.smax.i32(i32 %9, i32 %.252)
%call172 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select)
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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
int main()
{
char bb[4];
int aa[4], tmp;
for(int ii = 0;ii < 4;ii++)
{
scanf("%1d", &aa[ii]);
}
for(int bit = 0;bit < (1 << 3);bit++)
{
tmp = aa[0];
for(int ii = 0;ii < 3;ii++)
{
if(bit & (1 << ii))
{
tmp -= aa[ii + 1];
bb[ii] = '-';
}
else
{
tmp += aa[ii + 1];
bb[ii] = '+';
}
}
if(tmp == 7)
{
for(int ii = 0;ii < 3;ii++)
{
printf("%d%c", aa[ii], bb[ii]);
}
printf("%d=7\n", aa[3]);
return 0;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257108/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257108/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%1d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d=7\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.inc21.2:
%aa = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %aa) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %aa)
%arrayidx.1 = getelementptr inbounds [4 x i32], ptr %aa, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [4 x i32], ptr %aa, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [4 x i32], ptr %aa, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%0 = load i32, ptr %aa, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add18 = add nsw i32 %1, %0
%2 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%add18.1 = add nsw i32 %2, %add18
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%add18.2 = add nsw i32 %3, %add18.1
%cmp24 = icmp eq i32 %add18.2, 7
br i1 %cmp24, label %for.body30.preheader, label %for.inc21.2.1
for.inc21.2.1: ; preds = %for.inc21.2
%sub.175 = sub nsw i32 %0, %1
%add18.1.1 = add nsw i32 %2, %sub.175
%add18.2.1 = add nsw i32 %3, %add18.1.1
%cmp24.1 = icmp eq i32 %add18.2.1, 7
br i1 %cmp24.1, label %for.body30.preheader, label %for.inc21.2.2
for.inc21.2.2: ; preds = %for.inc21.2.1
%add18.288 = add nsw i32 %1, %0
%sub.1.2 = sub nsw i32 %add18.288, %2
%add18.2.2 = add nsw i32 %3, %sub.1.2
%cmp24.2 = icmp eq i32 %add18.2.2, 7
br i1 %cmp24.2, label %for.body30.preheader, label %for.inc21.2.3
for.inc21.2.3: ; preds = %for.inc21.2.2
%4 = add i32 %1, %2
%sub.1.3 = sub i32 %0, %4
%add18.2.3 = add nsw i32 %3, %sub.1.3
%cmp24.3 = icmp eq i32 %add18.2.3, 7
br i1 %cmp24.3, label %for.body30.preheader, label %for.inc21.2.4
for.inc21.2.4: ; preds = %for.inc21.2.3
%add18.4 = add nsw i32 %1, %0
%add18.1.4 = add nsw i32 %2, %add18.4
%sub.2.4 = sub nsw i32 %add18.1.4, %3
%cmp24.4 = icmp eq i32 %sub.2.4, 7
br i1 %cmp24.4, label %for.body30.preheader, label %for.inc21.2.5
for.inc21.2.5: ; preds = %for.inc21.2.4
%5 = add i32 %0, %2
%6 = add i32 %1, %3
%sub.2.5 = sub i32 %5, %6
%cmp24.5 = icmp eq i32 %sub.2.5, 7
br i1 %cmp24.5, label %for.body30.preheader, label %for.inc21.2.6
for.inc21.2.6: ; preds = %for.inc21.2.5
%add18.6 = add nsw i32 %1, %0
%7 = add i32 %2, %3
%sub.2.6 = sub i32 %add18.6, %7
%cmp24.6 = icmp eq i32 %sub.2.6, 7
br i1 %cmp24.6, label %for.body30.preheader, label %for.inc21.2.7
for.inc21.2.7: ; preds = %for.inc21.2.6
%8 = add i32 %1, %2
%9 = add i32 %8, %3
%sub.2.7 = sub i32 %0, %9
%cmp24.7 = icmp eq i32 %sub.2.7, 7
br i1 %cmp24.7, label %for.body30.preheader, label %cleanup45
for.body30.preheader: ; preds = %for.inc21.2.7, %for.inc21.2.6, %for.inc21.2.5, %for.inc21.2.4, %for.inc21.2.3, %for.inc21.2.2, %for.inc21.2.1, %for.inc21.2
%bb.sroa.36.7 = phi i32 [ 43, %for.inc21.2 ], [ 43, %for.inc21.2.1 ], [ 43, %for.inc21.2.2 ], [ 43, %for.inc21.2.3 ], [ 45, %for.inc21.2.4 ], [ 45, %for.inc21.2.5 ], [ 45, %for.inc21.2.6 ], [ 45, %for.inc21.2.7 ]
%bb.sroa.19.7 = phi i32 [ 43, %for.inc21.2 ], [ 43, %for.inc21.2.1 ], [ 45, %for.inc21.2.2 ], [ 45, %for.inc21.2.3 ], [ 43, %for.inc21.2.4 ], [ 43, %for.inc21.2.5 ], [ 45, %for.inc21.2.6 ], [ 45, %for.inc21.2.7 ]
%bb.sroa.0.7 = phi i32 [ 43, %for.inc21.2 ], [ 45, %for.inc21.2.1 ], [ 43, %for.inc21.2.2 ], [ 45, %for.inc21.2.3 ], [ 43, %for.inc21.2.4 ], [ 45, %for.inc21.2.5 ], [ 43, %for.inc21.2.6 ], [ 45, %for.inc21.2.7 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %bb.sroa.0.7)
%10 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%call35.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10, i32 noundef %bb.sroa.19.7)
%11 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%call35.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11, i32 noundef %bb.sroa.36.7)
%12 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
br label %cleanup45
cleanup45: ; preds = %for.inc21.2.7, %for.body30.preheader
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %aa) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007
int main(int argc, char const *argv[])
{
int a,b,c,d;
scanf("%1d%1d%1d%1d",&a,&b,&c,&d);
if(a + b + c + d == 7) printf("%d+%d+%d+%d=7\n", a,b,c,d);
else if(a + b + c - d == 7) printf("%d+%d+%d-%d=7\n", a,b,c,d);
else if(a + b - c + d == 7) printf("%d+%d-%d+%d=7\n", a,b,c,d);
else if(a + b - c - d == 7) printf("%d+%d-%d-%d=7\n", a,b,c,d);
else if(a - b + c + d == 7) printf("%d-%d+%d+%d=7\n", a,b,c,d);
else if(a - b + c - d == 7) printf("%d-%d+%d-%d=7\n", a,b,c,d);
else if(a - b - c + d == 7) printf("%d-%d-%d+%d=7\n", a,b,c,d);
else if(a - b - c - d == 7) printf("%d-%d-%d-%d=7\n", a,b,c,d);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257159/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257159/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%1d%1d%1d%1d\00", align 1
@.str.1 = private unnamed_addr constant [15 x i8] c"%d+%d+%d+%d=7\0A\00", align 1
@.str.2 = private unnamed_addr constant [15 x i8] c"%d+%d+%d-%d=7\0A\00", align 1
@.str.3 = private unnamed_addr constant [15 x i8] c"%d+%d-%d+%d=7\0A\00", align 1
@.str.4 = private unnamed_addr constant [15 x i8] c"%d+%d-%d-%d=7\0A\00", align 1
@.str.5 = private unnamed_addr constant [15 x i8] c"%d-%d+%d+%d=7\0A\00", align 1
@.str.6 = private unnamed_addr constant [15 x i8] c"%d-%d+%d-%d=7\0A\00", align 1
@.str.7 = private unnamed_addr constant [15 x i8] c"%d-%d-%d+%d=7\0A\00", align 1
@.str.8 = private unnamed_addr constant [15 x i8] c"%d-%d-%d-%d=7\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:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%3 = load i32, ptr %d, align 4, !tbaa !5
%add2 = add nsw i32 %add1, %3
%cmp = icmp eq i32 %add2, 7
br i1 %cmp, label %if.end57.sink.split, label %if.else
if.else: ; preds = %entry
%sub = sub nsw i32 %add1, %3
%cmp6 = icmp eq i32 %sub, 7
br i1 %cmp6, label %if.end57.sink.split, label %if.else9
if.else9: ; preds = %if.else
%sub11 = sub nsw i32 %add, %2
%add12 = add nsw i32 %sub11, %3
%cmp13 = icmp eq i32 %add12, 7
br i1 %cmp13, label %if.end57.sink.split, label %if.else16
if.else16: ; preds = %if.else9
%sub19 = sub nsw i32 %sub11, %3
%cmp20 = icmp eq i32 %sub19, 7
br i1 %cmp20, label %if.end57.sink.split, label %if.else23
if.else23: ; preds = %if.else16
%sub24 = sub nsw i32 %0, %1
%add25 = add nsw i32 %sub24, %2
%add26 = add nsw i32 %add25, %3
%cmp27 = icmp eq i32 %add26, 7
br i1 %cmp27, label %if.end57.sink.split, label %if.else30
if.else30: ; preds = %if.else23
%sub33 = sub nsw i32 %add25, %3
%cmp34 = icmp eq i32 %sub33, 7
br i1 %cmp34, label %if.end57.sink.split, label %if.else37
if.else37: ; preds = %if.else30
%sub39 = sub nsw i32 %sub24, %2
%add40 = add nsw i32 %sub39, %3
%cmp41 = icmp eq i32 %add40, 7
br i1 %cmp41, label %if.end57.sink.split, label %if.else44
if.else44: ; preds = %if.else37
%sub47 = sub nsw i32 %sub39, %3
%cmp48 = icmp eq i32 %sub47, 7
br i1 %cmp48, label %if.end57.sink.split, label %if.end57
if.end57.sink.split: ; preds = %if.else44, %if.else37, %if.else30, %if.else23, %if.else16, %if.else9, %if.else, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.else ], [ @.str.3, %if.else9 ], [ @.str.4, %if.else16 ], [ @.str.5, %if.else23 ], [ @.str.6, %if.else30 ], [ @.str.7, %if.else37 ], [ @.str.8, %if.else44 ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink, i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3)
br label %if.end57
if.end57: ; preds = %if.end57.sink.split, %if.else44
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int n,a,b,c,d;
scanf("%d",&n);
a=n/1000%10;
b=n/100%10;
c=n/10%10;
d=n%10;
if(a+b+c+d==7)printf("%d+%d+%d+%d=7",a,b,c,d);
else if(a-b+c+d==7)printf("%d-%d+%d+%d=7",a,b,c,d);
else if(a+b-c+d==7)printf("%d+%d-%d+%d=7",a,b,c,d);
else if(a+b+c-d==7)printf("%d+%d+%d-%d=7",a,b,c,d);
else if(a-b-c+d==7)printf("%d-%d-%d+%d=7",a,b,c,d);
else if(a-b+c-d==7)printf("%d-%d+%d-%d=7",a,b,c,d);
else if(a+b-c-d==7)printf("%d+%d-%d-%d=7",a,b,c,d);
else printf("%d-%d-%d-%d=7",a,b,c,d);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257209/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257209/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [14 x i8] c"%d+%d+%d+%d=7\00", align 1
@.str.2 = private unnamed_addr constant [14 x i8] c"%d-%d+%d+%d=7\00", align 1
@.str.3 = private unnamed_addr constant [14 x i8] c"%d+%d-%d+%d=7\00", align 1
@.str.4 = private unnamed_addr constant [14 x i8] c"%d+%d+%d-%d=7\00", align 1
@.str.5 = private unnamed_addr constant [14 x i8] c"%d-%d-%d+%d=7\00", align 1
@.str.6 = private unnamed_addr constant [14 x i8] c"%d-%d+%d-%d=7\00", align 1
@.str.7 = private unnamed_addr constant [14 x i8] c"%d+%d-%d-%d=7\00", align 1
@.str.8 = private unnamed_addr constant [14 x i8] c"%d-%d-%d-%d=7\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
%div = sdiv i32 %0, 1000
%rem = srem i32 %div, 10
%div1 = sdiv i32 %0, 100
%rem2 = srem i32 %div1, 10
%div3 = sdiv i32 %0, 10
%rem4 = srem i32 %div3, 10
%rem5 = srem i32 %0, 10
%add = add nsw i32 %rem, %rem2
%add6 = add nsw i32 %add, %rem4
%add7 = add nsw i32 %add6, %rem5
%cmp = icmp eq i32 %add7, 7
br i1 %cmp, label %if.end56, label %if.else
if.else: ; preds = %entry
%sub = sub nsw i32 %rem, %rem2
%add9 = add nsw i32 %sub, %rem4
%add10 = add nsw i32 %add9, %rem5
%cmp11 = icmp eq i32 %add10, 7
br i1 %cmp11, label %if.end56, label %if.else14
if.else14: ; preds = %if.else
%sub16 = sub nsw i32 %add, %rem4
%add17 = add nsw i32 %sub16, %rem5
%cmp18 = icmp eq i32 %add17, 7
br i1 %cmp18, label %if.end56, label %if.else21
if.else21: ; preds = %if.else14
%sub24 = sub nsw i32 %add6, %rem5
%cmp25 = icmp eq i32 %sub24, 7
br i1 %cmp25, label %if.end56, label %if.else28
if.else28: ; preds = %if.else21
%sub30 = sub nsw i32 %rem5, %rem4
%add31 = add nsw i32 %sub30, %sub
%cmp32 = icmp eq i32 %add31, 7
br i1 %cmp32, label %if.end56, label %if.else35
if.else35: ; preds = %if.else28
%sub38 = sub nsw i32 %add9, %rem5
%cmp39 = icmp eq i32 %sub38, 7
br i1 %cmp39, label %if.end56, label %if.else42
if.else42: ; preds = %if.else35
%sub45 = sub nsw i32 %sub16, %rem5
%cmp46 = icmp eq i32 %sub45, 7
%.str.7..str.8 = select i1 %cmp46, ptr @.str.7, ptr @.str.8
br label %if.end56
if.end56: ; preds = %if.else42, %if.else35, %if.else28, %if.else21, %if.else14, %if.else, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.else ], [ @.str.3, %if.else14 ], [ @.str.4, %if.else21 ], [ @.str.5, %if.else28 ], [ @.str.6, %if.else35 ], [ %.str.7..str.8, %if.else42 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink, i32 noundef %rem, i32 noundef %rem2, i32 noundef %rem4, i32 noundef %rem5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main()
{
int a,b,c,d,m;
while(scanf("%d",&m)!=EOF)
{ a=m/1000;
b=(m-1000*a)/100;
c=m%100/10;
d=m%10;
if(a+b+c+d==7)printf("%d+%d+%d+%d=7\n",a,b,c,d);
else if(a+b+c-d==7)printf("%d+%d+%d-%d=7\n",a,b,c,d);
else if(a+b-c+d==7)printf("%d+%d-%d+%d=7\n",a,b,c,d);
else if(a-b+c+d==7)printf("%d-%d+%d+%d=7\n",a,b,c,d);
else if(a+b-c-d==7)printf("%d+%d-%d-%d=7\n",a,b,c,d);
else if(a-b-c+d==7)printf("%d-%d-%d+%d=7\n",a,b,c,d);
else if(a-b+c-d==7)printf("%d-%d+%d-%d=7\n",a,b,c,d);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257252/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257252/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [15 x i8] c"%d+%d+%d+%d=7\0A\00", align 1
@.str.2 = private unnamed_addr constant [15 x i8] c"%d+%d+%d-%d=7\0A\00", align 1
@.str.3 = private unnamed_addr constant [15 x i8] c"%d+%d-%d+%d=7\0A\00", align 1
@.str.4 = private unnamed_addr constant [15 x i8] c"%d-%d+%d+%d=7\0A\00", align 1
@.str.5 = private unnamed_addr constant [15 x i8] c"%d+%d-%d-%d=7\0A\00", align 1
@.str.6 = private unnamed_addr constant [15 x i8] c"%d-%d-%d+%d=7\0A\00", align 1
@.str.7 = private unnamed_addr constant [15 x i8] c"%d-%d+%d-%d=7\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call109 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not110 = icmp eq i32 %call109, -1
br i1 %cmp.not110, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end54
%0 = load i32, ptr %m, align 4, !tbaa !5
%div = sdiv i32 %0, 1000
%mul.neg = mul nsw i32 %div, -1000
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 100
%rem = srem i32 %0, 100
%div2.lhs.trunc = trunc i32 %rem to i8
%div2108 = sdiv i8 %div2.lhs.trunc, 10
%div2.sext = sext i8 %div2108 to i32
%rem3 = srem i32 %0, 10
%add = add nsw i32 %div1, %div
%add4 = add nsw i32 %add, %div2.sext
%add5 = add nsw i32 %add4, %rem3
%cmp6 = icmp eq i32 %add5, 7
br i1 %cmp6, label %if.end54.sink.split, label %if.else
if.else: ; preds = %while.body
%sub10 = sub nsw i32 %add4, %rem3
%cmp11 = icmp eq i32 %sub10, 7
br i1 %cmp11, label %if.end54.sink.split, label %if.else14
if.else14: ; preds = %if.else
%sub16 = sub nsw i32 %add, %div2.sext
%add17 = add nsw i32 %sub16, %rem3
%cmp18 = icmp eq i32 %add17, 7
br i1 %cmp18, label %if.end54.sink.split, label %if.else21
if.else21: ; preds = %if.else14
%sub22 = sub nsw i32 %div, %div1
%add23 = add nsw i32 %sub22, %div2.sext
%add24 = add nsw i32 %add23, %rem3
%cmp25 = icmp eq i32 %add24, 7
br i1 %cmp25, label %if.end54.sink.split, label %if.else28
if.else28: ; preds = %if.else21
%sub31 = sub nsw i32 %sub16, %rem3
%cmp32 = icmp eq i32 %sub31, 7
br i1 %cmp32, label %if.end54.sink.split, label %if.else35
if.else35: ; preds = %if.else28
%sub37 = sub nsw i32 %rem3, %div2.sext
%add38 = add nsw i32 %sub37, %sub22
%cmp39 = icmp eq i32 %add38, 7
br i1 %cmp39, label %if.end54.sink.split, label %if.else42
if.else42: ; preds = %if.else35
%sub45 = sub nsw i32 %add23, %rem3
%cmp46 = icmp eq i32 %sub45, 7
br i1 %cmp46, label %if.end54.sink.split, label %if.end54
if.end54.sink.split: ; preds = %if.else42, %if.else35, %if.else28, %if.else21, %if.else14, %if.else, %while.body
%.str.2.sink = phi ptr [ @.str.1, %while.body ], [ @.str.2, %if.else ], [ @.str.3, %if.else14 ], [ @.str.4, %if.else21 ], [ @.str.5, %if.else28 ], [ @.str.6, %if.else35 ], [ @.str.7, %if.else42 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink, i32 noundef %div, i32 noundef %div1, i32 noundef %div2.sext, i32 noundef %rem3)
br label %if.end54
if.end54: ; preds = %if.end54.sink.split, %if.else42
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end54, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #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 argc,char* argv[]){
char a,b,c,d;
int t[4];
int i,j,k;
int ans=0;
scanf("%c%c%c%c",&a,&b,&c,&d);
t[0]=a-'0';
t[1]=b-'0';
t[2]=c-'0';
t[3]=d-'0';
for(i=0;i<2;i++){
for(j=0;j<2;j++){
for(k=0;k<2;k++){
ans=t[0];
if(i==0)ans+=t[1];
else ans-=t[1];
if(j==0)ans+=t[2];
else ans-=t[2];
if(k==0)ans+=t[3];
else ans-=t[3];
if(ans==7){
printf("%c%c%c%c%c%c%c=7\n",a,(i==0)?'+':'-',b,(j==0)?'+':'-',c,(k==0)?'+':'-',d);
return 0;
}
}
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257302/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257302/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%c%c%c%c\00", align 1
@.str.1 = private unnamed_addr constant [18 x i8] c"%c%c%c%c%c%c%c=7\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:
%a = alloca i8, align 1
%b = alloca i8, align 1
%c = alloca i8, align 1
%d = 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 void @llvm.lifetime.start.p0(i64 1, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !5
%conv1 = sext i8 %1 to i32
%2 = load i8, ptr %c, align 1, !tbaa !5
%conv4 = sext i8 %2 to i32
%sub5 = add nsw i32 %conv4, -48
%3 = load i8, ptr %d, align 1, !tbaa !5
%conv7 = sext i8 %3 to i32
%sub8 = add nsw i32 %conv7, -48
%4 = sub nsw i32 48, %conv4
%5 = sub nsw i32 48, %conv7
%sub2 = add nsw i32 %conv, %conv1
%ans.0 = add nsw i32 %sub2, -96
%ans.1 = add nsw i32 %ans.0, %sub5
%ans.2 = add nsw i32 %ans.1, %sub8
%cmp43 = icmp eq i32 %ans.2, 7
br i1 %cmp43, label %if.then45, label %for.cond15
for.cond15: ; preds = %entry
%ans.2.1 = add nsw i32 %ans.1, %5
%cmp43.1 = icmp eq i32 %ans.2.1, 7
br i1 %cmp43.1, label %if.then45, label %for.cond15.1
for.cond15.1: ; preds = %for.cond15
%ans.1.1 = add nsw i32 %ans.0, %4
%ans.2.198 = add nsw i32 %ans.1.1, %sub8
%cmp43.199 = icmp eq i32 %ans.2.198, 7
br i1 %cmp43.199, label %if.then45, label %for.cond15.1100
for.cond15.1100: ; preds = %for.cond15.1
%ans.2.1.1 = add nsw i32 %ans.1.1, %5
%cmp43.1.1 = icmp eq i32 %ans.2.1.1, 7
br i1 %cmp43.1.1, label %if.then45, label %for.cond15.1.1
for.cond15.1.1: ; preds = %for.cond15.1100
%6 = sub nsw i32 %conv, %conv1
%ans.1.1101 = add nsw i32 %6, %sub5
%ans.2.1102 = add nsw i32 %ans.1.1101, %sub8
%cmp43.1103 = icmp eq i32 %ans.2.1102, 7
br i1 %cmp43.1103, label %if.then45, label %for.cond15.1107
for.cond15.1107: ; preds = %for.cond15.1.1
%ans.2.1.1105 = add nsw i32 %ans.1.1101, %5
%cmp43.1.1106 = icmp eq i32 %ans.2.1.1105, 7
br i1 %cmp43.1.1106, label %if.then45, label %for.cond15.1.1108
for.cond15.1.1108: ; preds = %for.cond15.1107
%ans.1.1.1 = add nsw i32 %6, %4
%ans.2.198.1 = add nsw i32 %ans.1.1.1, %sub8
%cmp43.199.1 = icmp eq i32 %ans.2.198.1, 7
br i1 %cmp43.199.1, label %if.then45, label %for.cond15.1100.1
for.cond15.1100.1: ; preds = %for.cond15.1.1108
%ans.2.1.1.1 = add nsw i32 %ans.1.1.1, %5
%cmp43.1.1.1 = icmp eq i32 %ans.2.1.1.1, 7
br i1 %cmp43.1.1.1, label %if.then45, label %cleanup
if.then45: ; preds = %for.cond15.1100.1, %for.cond15.1.1108, %for.cond15.1107, %for.cond15.1.1, %for.cond15.1100, %for.cond15.1, %for.cond15, %entry
%cmp20.lcssa = phi i32 [ 43, %entry ], [ 43, %for.cond15 ], [ 43, %for.cond15.1 ], [ 43, %for.cond15.1100 ], [ 45, %for.cond15.1.1 ], [ 45, %for.cond15.1107 ], [ 45, %for.cond15.1.1108 ], [ 45, %for.cond15.1100.1 ]
%cmp25.lcssa = phi i32 [ 43, %entry ], [ 43, %for.cond15 ], [ 45, %for.cond15.1 ], [ 45, %for.cond15.1100 ], [ 43, %for.cond15.1.1 ], [ 43, %for.cond15.1107 ], [ 45, %for.cond15.1.1108 ], [ 45, %for.cond15.1100.1 ]
%cmp34.lcssa = phi i32 [ 43, %entry ], [ 45, %for.cond15 ], [ 43, %for.cond15.1 ], [ 45, %for.cond15.1100 ], [ 43, %for.cond15.1.1 ], [ 45, %for.cond15.1107 ], [ 43, %for.cond15.1.1108 ], [ 45, %for.cond15.1100.1 ]
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %cmp20.lcssa, i32 noundef %conv1, i32 noundef %cmp25.lcssa, i32 noundef %conv4, i32 noundef %cmp34.lcssa, i32 noundef %conv7)
br label %cleanup
cleanup: ; preds = %for.cond15.1100.1, %if.then45
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %d) #3
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 max(int a, int b){
if(a > b) return a;
else return b;
}
int main(){
int n;
scanf("%d",&n);
int point = 0;
for(int i = 0; i < n; ++i){
int tmp = 0;
scanf("%d",&tmp);
point += tmp - 1;
}
printf("%d",point);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257346/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257346/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%tmp = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%point.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %point.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%point.06 = phi i32 [ %add, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #5
store i32 0, ptr %tmp, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp)
%1 = load i32, ptr %tmp, align 4, !tbaa !5
%sub = add i32 %point.06, -1
%add = add i32 %sub, %1
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #5
%inc = add nuw nsw i32 %i.07, 1
%2 = load i32, ptr %n, 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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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;
scanf("%d", &n);
if(n>=2){
if(n%2==0) printf("Mahmoud\n");
else printf("Ehab\n");
}
else printf("Ehab\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25739/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25739/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [5 x i8] c"Ehab\00", align 1
@str.4 = private unnamed_addr constant [8 x i8] c"Mahmoud\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 = icmp sgt i32 %0, 1
%rem = and i32 %0, 1
%cmp1 = icmp eq i32 %rem, 0
%str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3
%str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,x,s=0,i;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
scanf("%d",&x);
s=s+(x-1);
}
printf("%d\n",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257432/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257432/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%x = 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 %x) #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
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%s.06 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%sub = add i32 %s.06, -1
%add = add i32 %sub, %1
%inc = add nuw nsw i32 %i.07, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.07, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%s.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 n,x,sum=0;
scanf("%d",&n);
int k=n;
while(k--){
scanf("%d",&x);
sum=sum+x;
}
printf("%d\n",sum-n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257476/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257476/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%x = 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 %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not4 = icmp eq i32 %0, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%k.06 = phi i32 [ %dec, %while.body ], [ %0, %entry ]
%sum.05 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%dec = add nsw i32 %k.06, -1
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.05
%tobool.not = icmp eq i32 %dec, 0
br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !9
while.end.loopexit: ; preds = %while.body
%.pre = load i32, ptr %n, align 4, !tbaa !5
%2 = sub nsw i32 %add, %.pre
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%sub = phi i32 [ 0, %entry ], [ %2, %while.end.loopexit ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 n;
scanf("%d", &n);
int sum = 0;
int temp;
int i;
for(i=0;i<n;i++){
scanf("%d", &temp);
sum += temp;
}
sum -= n;
printf("%d", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257519/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257519/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%temp = 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)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #3
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%sum.07 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp)
%1 = load i32, ptr %temp, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.07
%inc = add nuw nsw i32 %i.08, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ]
%sub = sub nsw i32 %sum.0.lcssa, %.lcssa
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #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 a;
scanf("%d",&a);
if(a%2 == 0)
printf("Mahmoud\n");
else
printf("Ehab\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25757/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25757/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Ehab\00", align 1
@str.3 = private unnamed_addr constant [8 x i8] c"Mahmoud\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int e1, e2, e3, e4;
scanf("%d %d %d %d", &e1, &e2, &e3, &e4);
if ((e1 == e2 && e3 == e4) || (e1 == e3 && e2 == e4) || (e1 == e4 && e2 == e3))
printf("yes\n");
else
printf("no\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257612/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257612/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%e1 = alloca i32, align 4
%e2 = alloca i32, align 4
%e3 = alloca i32, align 4
%e4 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e3) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e4) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e1, ptr noundef nonnull %e2, ptr noundef nonnull %e3, ptr noundef nonnull %e4)
%0 = load i32, ptr %e1, align 4, !tbaa !5
%1 = load i32, ptr %e2, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%.pre = load i32, ptr %e3, align 4, !tbaa !5
%.pre13 = load i32, ptr %e4, align 4
%cmp1 = icmp eq i32 %.pre, %.pre13
%or.cond14 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond14, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%cmp2 = icmp eq i32 %0, %.pre
%cmp4 = icmp eq i32 %1, %.pre13
%or.cond = select i1 %cmp2, i1 %cmp4, i1 false
br i1 %or.cond, label %if.end, label %lor.lhs.false5
lor.lhs.false5: ; preds = %lor.lhs.false
%cmp6 = icmp eq i32 %0, %.pre13
%cmp8 = icmp eq i32 %1, %.pre
%or.cond12 = and i1 %cmp8, %cmp6
%spec.select = select i1 %or.cond12, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false5, %lor.lhs.false, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ @str.3, %lor.lhs.false ], [ %spec.select, %lor.lhs.false5 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e4) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
// AOJ 1622 Go around the Labyrinth
// 2018.2.13 bal4u
#include <stdio.h>
#include <string.h>
typedef struct { char r, c, d, k; } STACK;
STACK sk[3000]; int top;
char map[53][53];
char mk[53][53];
int mv[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int check(int h, int w)
{
int i, r, c, d, k, nr, nc;
memset(mk, 0, sizeof(mk));
sk[0].r = 1, sk[0].c = 1, sk[0].d = 1, sk[0].k = 1, top = 1;
while (top) {
r = sk[--top].r, c = sk[top].c, d = sk[top].d, k = sk[top].k;
if (mk[r][c]) continue;
mk[r][c] = 1;
if ((k & 1) && r == h && c == 1) k |= 2;
else if ((k & 2) && r == h && c == w) k |= 4;
else if ((k & 4) && r == 1 && c == w) k |= 8;
else if ((k & 8) && r == 1 && c == 2) return 1;
d += 2; if (d >= 4) d -= 4;
for (i = 0; i < 4; i++) {
if (++d == 4) d = 0;
nr = r + mv[d][0], nc = c + mv[d][1];
if (map[nr][nc] && !mk[nr][nc]) {
sk[top].r = nr, sk[top].c = nc, sk[top].d = d, sk[top++].k = k;
}
}
}
return 0;
}
int main()
{
int h, w, r, c;
char buf[10], *p;
while (fgets(buf, 10, stdin) && *buf != '0') {
sscanf(buf, "%d%d", &h, &w);
memset(map, 0, sizeof(map));
for (r = 1; r <= h; r++) {
fgets(p=map[r]+1, 52, stdin);
c = w; while (c--) *p = (*p == '.'), p++; *p = 0;
}
puts(check(h, w)? "YES": "NO");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257656/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257656/source.c"
target datalayout = "e-m:e-p270: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.STACK = type { i8, i8, i8, i8 }
@mv = dso_local local_unnamed_addr global [4 x [2 x i32]] [[2 x i32] [i32 -1, i32 0], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 -1]], align 16
@mk = dso_local local_unnamed_addr global [53 x [53 x i8]] zeroinitializer, align 16
@sk = dso_local local_unnamed_addr global [3000 x %struct.STACK] zeroinitializer, align 16
@top = dso_local local_unnamed_addr global i32 0, align 4
@map = dso_local global [53 x [53 x i8]] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @check(i32 noundef %h, i32 noundef %w) local_unnamed_addr #0 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2809) @mk, i8 0, i64 2809, i1 false)
store i32 16843009, ptr @sk, align 16
br label %while.body
while.condthread-pre-split: ; preds = %for.inc.2, %land.lhs.true88.3, %if.then94.3, %while.body
%inc108166 = phi i32 [ %dec, %while.body ], [ %inc108158.2, %for.inc.2 ], [ %inc108158.2, %land.lhs.true88.3 ], [ %inc108.3, %if.then94.3 ]
%tobool.not = icmp eq i32 %inc108166, 0
br i1 %tobool.not, label %cleanup, label %while.body
while.body: ; preds = %entry, %while.condthread-pre-split
%0 = phi i32 [ 1, %entry ], [ %inc108166, %while.condthread-pre-split ]
%dec = add nsw i32 %0, -1
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 4, !tbaa !5
%conv = sext i8 %1 to i32
%c4 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom, i32 1
%2 = load i8, ptr %c4, align 1, !tbaa !9
%conv5 = sext i8 %2 to i32
%d8 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom, i32 2
%3 = load i8, ptr %d8, align 2, !tbaa !10
%conv9 = sext i8 %3 to i32
%k12 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom, i32 3
%4 = load i8, ptr %k12, align 1, !tbaa !11
%conv13168 = zext i8 %4 to i32
%idxprom14 = sext i8 %1 to i64
%idxprom16 = sext i8 %2 to i64
%arrayidx17 = getelementptr inbounds [53 x [53 x i8]], ptr @mk, i64 0, i64 %idxprom14, i64 %idxprom16
%5 = load i8, ptr %arrayidx17, align 1, !tbaa !12
%tobool18.not = icmp eq i8 %5, 0
br i1 %tobool18.not, label %if.end, label %while.condthread-pre-split, !llvm.loop !13
if.end: ; preds = %while.body
store i8 1, ptr %arrayidx17, align 1, !tbaa !12
%and = and i32 %conv13168, 1
%tobool23.not = icmp eq i32 %and, 0
br i1 %tobool23.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %if.end
%cmp = icmp eq i32 %conv, %h
%cmp26 = icmp eq i8 %2, 1
%or.cond = and i1 %cmp, %cmp26
br i1 %or.cond, label %if.then28, label %if.else
if.then28: ; preds = %land.lhs.true
%or = or i8 %4, 2
br label %if.end63
if.else: ; preds = %land.lhs.true, %if.end
%and29 = and i32 %conv13168, 2
%tobool30.not = icmp ne i32 %and29, 0
%cmp32 = icmp eq i32 %conv, %h
%or.cond155 = and i1 %cmp32, %tobool30.not
%cmp35 = icmp eq i32 %conv5, %w
%or.cond156 = and i1 %cmp35, %or.cond155
br i1 %or.cond156, label %if.then37, label %if.else39
if.then37: ; preds = %if.else
%or38 = or i8 %4, 4
br label %if.end63
if.else39: ; preds = %if.else
%and40 = and i32 %conv13168, 4
%tobool41 = icmp ne i32 %and40, 0
%cmp43 = icmp eq i8 %1, 1
%or.cond120 = and i1 %cmp43, %tobool41
%or.cond157 = and i1 %cmp35, %or.cond120
br i1 %or.cond157, label %if.then48, label %if.else50
if.then48: ; preds = %if.else39
%or49 = or i8 %4, 8
br label %if.end63
if.else50: ; preds = %if.else39
%and51 = and i32 %conv13168, 8
%tobool52 = icmp ne i32 %and51, 0
%cmp57 = icmp eq i8 %2, 2
%6 = and i1 %cmp57, %tobool52
%or.cond122 = and i1 %cmp43, %6
br i1 %or.cond122, label %cleanup, label %if.end63
if.end63: ; preds = %if.then37, %if.else50, %if.then48, %if.then28
%k.0 = phi i8 [ %or, %if.then28 ], [ %or38, %if.then37 ], [ %or49, %if.then48 ], [ %4, %if.else50 ]
%cmp64 = icmp sgt i8 %3, 1
%spec.select.v = select i1 %cmp64, i32 -2, i32 2
%spec.select = add nsw i32 %spec.select.v, %conv9
%inc = add nsw i32 %spec.select, 1
%cmp70 = icmp eq i32 %inc, 4
%spec.store.select = select i1 %cmp70, i32 0, i32 %inc
%idxprom74 = sext i32 %spec.store.select to i64
%arrayidx75 = getelementptr inbounds [4 x [2 x i32]], ptr @mv, i64 0, i64 %idxprom74
%7 = load i32, ptr %arrayidx75, align 8, !tbaa !15
%add77 = add nsw i32 %7, %conv
%arrayidx80 = getelementptr inbounds [4 x [2 x i32]], ptr @mv, i64 0, i64 %idxprom74, i64 1
%8 = load i32, ptr %arrayidx80, align 4, !tbaa !15
%add81 = add nsw i32 %8, %conv5
%idxprom82 = sext i32 %add77 to i64
%idxprom84 = sext i32 %add81 to i64
%arrayidx85 = getelementptr inbounds [53 x [53 x i8]], ptr @map, i64 0, i64 %idxprom82, i64 %idxprom84
%9 = load i8, ptr %arrayidx85, align 1, !tbaa !12
%tobool87.not = icmp eq i8 %9, 0
br i1 %tobool87.not, label %for.inc, label %land.lhs.true88
land.lhs.true88: ; preds = %if.end63
%arrayidx92 = getelementptr inbounds [53 x [53 x i8]], ptr @mk, i64 0, i64 %idxprom82, i64 %idxprom84
%10 = load i8, ptr %arrayidx92, align 1, !tbaa !12
%tobool93.not = icmp eq i8 %10, 0
br i1 %tobool93.not, label %if.then94, label %for.inc
if.then94: ; preds = %land.lhs.true88
%conv95 = trunc i32 %add77 to i8
store i8 %conv95, ptr %arrayidx, align 4, !tbaa !5
%conv99 = trunc i32 %add81 to i8
store i8 %conv99, ptr %c4, align 1, !tbaa !9
%conv103 = trunc i32 %spec.store.select to i8
store i8 %conv103, ptr %d8, align 2, !tbaa !10
store i8 %k.0, ptr %k12, align 1, !tbaa !11
br label %for.inc
for.inc: ; preds = %if.end63, %land.lhs.true88, %if.then94
%inc108158 = phi i32 [ %dec, %if.end63 ], [ %dec, %land.lhs.true88 ], [ %0, %if.then94 ]
%inc.1 = add nsw i32 %spec.store.select, 1
%cmp70.1 = icmp eq i32 %inc.1, 4
%spec.store.select.1 = select i1 %cmp70.1, i32 0, i32 %inc.1
%idxprom74.1 = sext i32 %spec.store.select.1 to i64
%arrayidx75.1 = getelementptr inbounds [4 x [2 x i32]], ptr @mv, i64 0, i64 %idxprom74.1
%11 = load i32, ptr %arrayidx75.1, align 8, !tbaa !15
%add77.1 = add nsw i32 %11, %conv
%arrayidx80.1 = getelementptr inbounds [4 x [2 x i32]], ptr @mv, i64 0, i64 %idxprom74.1, i64 1
%12 = load i32, ptr %arrayidx80.1, align 4, !tbaa !15
%add81.1 = add nsw i32 %12, %conv5
%idxprom82.1 = sext i32 %add77.1 to i64
%idxprom84.1 = sext i32 %add81.1 to i64
%arrayidx85.1 = getelementptr inbounds [53 x [53 x i8]], ptr @map, i64 0, i64 %idxprom82.1, i64 %idxprom84.1
%13 = load i8, ptr %arrayidx85.1, align 1, !tbaa !12
%tobool87.not.1 = icmp eq i8 %13, 0
br i1 %tobool87.not.1, label %for.inc.1, label %land.lhs.true88.1
land.lhs.true88.1: ; preds = %for.inc
%arrayidx92.1 = getelementptr inbounds [53 x [53 x i8]], ptr @mk, i64 0, i64 %idxprom82.1, i64 %idxprom84.1
%14 = load i8, ptr %arrayidx92.1, align 1, !tbaa !12
%tobool93.not.1 = icmp eq i8 %14, 0
br i1 %tobool93.not.1, label %if.then94.1, label %for.inc.1
if.then94.1: ; preds = %land.lhs.true88.1
%conv95.1 = trunc i32 %add77.1 to i8
%idxprom96.1 = sext i32 %inc108158 to i64
%arrayidx97.1 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.1
store i8 %conv95.1, ptr %arrayidx97.1, align 4, !tbaa !5
%conv99.1 = trunc i32 %add81.1 to i8
%c102.1 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.1, i32 1
store i8 %conv99.1, ptr %c102.1, align 1, !tbaa !9
%conv103.1 = trunc i32 %spec.store.select.1 to i8
%d106.1 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.1, i32 2
store i8 %conv103.1, ptr %d106.1, align 2, !tbaa !10
%inc108.1 = add nsw i32 %inc108158, 1
%k111.1 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.1, i32 3
store i8 %k.0, ptr %k111.1, align 1, !tbaa !11
br label %for.inc.1
for.inc.1: ; preds = %if.then94.1, %land.lhs.true88.1, %for.inc
%inc108158.1 = phi i32 [ %inc108158, %for.inc ], [ %inc108158, %land.lhs.true88.1 ], [ %inc108.1, %if.then94.1 ]
%inc.2 = add nsw i32 %spec.store.select.1, 1
%cmp70.2 = icmp eq i32 %inc.2, 4
%spec.store.select.2 = select i1 %cmp70.2, i32 0, i32 %inc.2
%idxprom74.2 = sext i32 %spec.store.select.2 to i64
%arrayidx75.2 = getelementptr inbounds [4 x [2 x i32]], ptr @mv, i64 0, i64 %idxprom74.2
%15 = load i32, ptr %arrayidx75.2, align 8, !tbaa !15
%add77.2 = add nsw i32 %15, %conv
%arrayidx80.2 = getelementptr inbounds [4 x [2 x i32]], ptr @mv, i64 0, i64 %idxprom74.2, i64 1
%16 = load i32, ptr %arrayidx80.2, align 4, !tbaa !15
%add81.2 = add nsw i32 %16, %conv5
%idxprom82.2 = sext i32 %add77.2 to i64
%idxprom84.2 = sext i32 %add81.2 to i64
%arrayidx85.2 = getelementptr inbounds [53 x [53 x i8]], ptr @map, i64 0, i64 %idxprom82.2, i64 %idxprom84.2
%17 = load i8, ptr %arrayidx85.2, align 1, !tbaa !12
%tobool87.not.2 = icmp eq i8 %17, 0
br i1 %tobool87.not.2, label %for.inc.2, label %land.lhs.true88.2
land.lhs.true88.2: ; preds = %for.inc.1
%arrayidx92.2 = getelementptr inbounds [53 x [53 x i8]], ptr @mk, i64 0, i64 %idxprom82.2, i64 %idxprom84.2
%18 = load i8, ptr %arrayidx92.2, align 1, !tbaa !12
%tobool93.not.2 = icmp eq i8 %18, 0
br i1 %tobool93.not.2, label %if.then94.2, label %for.inc.2
if.then94.2: ; preds = %land.lhs.true88.2
%conv95.2 = trunc i32 %add77.2 to i8
%idxprom96.2 = sext i32 %inc108158.1 to i64
%arrayidx97.2 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.2
store i8 %conv95.2, ptr %arrayidx97.2, align 4, !tbaa !5
%conv99.2 = trunc i32 %add81.2 to i8
%c102.2 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.2, i32 1
store i8 %conv99.2, ptr %c102.2, align 1, !tbaa !9
%conv103.2 = trunc i32 %spec.store.select.2 to i8
%d106.2 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.2, i32 2
store i8 %conv103.2, ptr %d106.2, align 2, !tbaa !10
%inc108.2 = add nsw i32 %inc108158.1, 1
%k111.2 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.2, i32 3
store i8 %k.0, ptr %k111.2, align 1, !tbaa !11
br label %for.inc.2
for.inc.2: ; preds = %if.then94.2, %land.lhs.true88.2, %for.inc.1
%inc108158.2 = phi i32 [ %inc108158.1, %for.inc.1 ], [ %inc108158.1, %land.lhs.true88.2 ], [ %inc108.2, %if.then94.2 ]
%inc.3 = add nsw i32 %spec.store.select.2, 1
%cmp70.3 = icmp eq i32 %inc.3, 4
%spec.store.select.3 = select i1 %cmp70.3, i32 0, i32 %inc.3
%idxprom74.3 = sext i32 %spec.store.select.3 to i64
%arrayidx75.3 = getelementptr inbounds [4 x [2 x i32]], ptr @mv, i64 0, i64 %idxprom74.3
%19 = load i32, ptr %arrayidx75.3, align 8, !tbaa !15
%add77.3 = add nsw i32 %19, %conv
%arrayidx80.3 = getelementptr inbounds [4 x [2 x i32]], ptr @mv, i64 0, i64 %idxprom74.3, i64 1
%20 = load i32, ptr %arrayidx80.3, align 4, !tbaa !15
%add81.3 = add nsw i32 %20, %conv5
%idxprom82.3 = sext i32 %add77.3 to i64
%idxprom84.3 = sext i32 %add81.3 to i64
%arrayidx85.3 = getelementptr inbounds [53 x [53 x i8]], ptr @map, i64 0, i64 %idxprom82.3, i64 %idxprom84.3
%21 = load i8, ptr %arrayidx85.3, align 1, !tbaa !12
%tobool87.not.3 = icmp eq i8 %21, 0
br i1 %tobool87.not.3, label %while.condthread-pre-split, label %land.lhs.true88.3
land.lhs.true88.3: ; preds = %for.inc.2
%arrayidx92.3 = getelementptr inbounds [53 x [53 x i8]], ptr @mk, i64 0, i64 %idxprom82.3, i64 %idxprom84.3
%22 = load i8, ptr %arrayidx92.3, align 1, !tbaa !12
%tobool93.not.3 = icmp eq i8 %22, 0
br i1 %tobool93.not.3, label %if.then94.3, label %while.condthread-pre-split
if.then94.3: ; preds = %land.lhs.true88.3
%conv95.3 = trunc i32 %add77.3 to i8
%idxprom96.3 = sext i32 %inc108158.2 to i64
%arrayidx97.3 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.3
store i8 %conv95.3, ptr %arrayidx97.3, align 4, !tbaa !5
%conv99.3 = trunc i32 %add81.3 to i8
%c102.3 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.3, i32 1
store i8 %conv99.3, ptr %c102.3, align 1, !tbaa !9
%conv103.3 = trunc i32 %spec.store.select.3 to i8
%d106.3 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.3, i32 2
store i8 %conv103.3, ptr %d106.3, align 2, !tbaa !10
%inc108.3 = add nsw i32 %inc108158.2, 1
%k111.3 = getelementptr inbounds [3000 x %struct.STACK], ptr @sk, i64 0, i64 %idxprom96.3, i32 3
store i8 %k.0, ptr %k111.3, align 1, !tbaa !11
br label %while.condthread-pre-split
cleanup: ; preds = %while.condthread-pre-split, %if.else50
%inc108165 = phi i32 [ %dec, %if.else50 ], [ 0, %while.condthread-pre-split ]
%retval.0 = phi i32 [ 1, %if.else50 ], [ 0, %while.condthread-pre-split ]
store i32 %inc108165, ptr @top, align 4, !tbaa !15
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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%buf = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %buf) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !17
%call31 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 10, ptr noundef %0)
%tobool32 = icmp ne ptr %call31, null
%1 = load i8, ptr %buf, align 1
%cmp33 = icmp ne i8 %1, 48
%2 = select i1 %tobool32, i1 %cmp33, i1 false
br i1 %2, label %while.body, label %while.end19
while.body: ; preds = %entry, %for.end
%call4 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2809) @map, i8 0, i64 2809, i1 false)
%3 = load i32, ptr %h, align 4, !tbaa !15
%cmp5.not28 = icmp slt i32 %3, 1
br i1 %cmp5.not28, label %while.body.for.end_crit_edge, label %for.body
while.body.for.end_crit_edge: ; preds = %while.body
%.pre = load i32, ptr %w, align 4, !tbaa !15
br label %for.end
for.body: ; preds = %while.body, %while.end
%indvars.iv = phi i64 [ %indvars.iv.next, %while.end ], [ 1, %while.body ]
%add.ptr = getelementptr inbounds [53 x [53 x i8]], ptr @map, i64 0, i64 %indvars.iv, i64 1
%4 = load ptr, ptr @stdin, align 8, !tbaa !17
%call8 = call ptr @fgets(ptr noundef nonnull %add.ptr, i32 noundef 52, ptr noundef %4)
%5 = load i32, ptr %w, align 4, !tbaa !15
%tobool10.not25 = icmp eq i32 %5, 0
br i1 %tobool10.not25, label %while.end, label %while.body11.preheader
while.body11.preheader: ; preds = %for.body
%6 = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %5, 32
br i1 %min.iters.check, label %while.body11.preheader44, label %vector.ph
vector.ph: ; preds = %while.body11.preheader
%n.vec = and i64 %6, 4294967264
%ind.end = getelementptr i8, ptr %add.ptr, i64 %n.vec
%.cast = trunc i64 %n.vec to i32
%ind.end40 = sub i32 %5, %.cast
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%next.gep = getelementptr i8, ptr %add.ptr, i64 %index
%wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !12
%7 = getelementptr i8, ptr %next.gep, i64 16
%wide.load43 = load <16 x i8>, ptr %7, align 1, !tbaa !12
%8 = icmp eq <16 x i8> %wide.load, <i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46>
%9 = icmp eq <16 x i8> %wide.load43, <i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46>
%10 = zext <16 x i1> %8 to <16 x i8>
%11 = zext <16 x i1> %9 to <16 x i8>
store <16 x i8> %10, ptr %next.gep, align 1, !tbaa !12
store <16 x i8> %11, ptr %7, align 1, !tbaa !12
%index.next = add nuw i64 %index, 32
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !19
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %6
br i1 %cmp.n, label %while.end, label %while.body11.preheader44
while.body11.preheader44: ; preds = %while.body11.preheader, %middle.block
%p.027.ph = phi ptr [ %add.ptr, %while.body11.preheader ], [ %ind.end, %middle.block ]
%c.026.ph = phi i32 [ %5, %while.body11.preheader ], [ %ind.end40, %middle.block ]
br label %while.body11
while.body11: ; preds = %while.body11.preheader44, %while.body11
%p.027 = phi ptr [ %incdec.ptr, %while.body11 ], [ %p.027.ph, %while.body11.preheader44 ]
%c.026 = phi i32 [ %dec, %while.body11 ], [ %c.026.ph, %while.body11.preheader44 ]
%dec = add nsw i32 %c.026, -1
%13 = load i8, ptr %p.027, align 1, !tbaa !12
%cmp13 = icmp eq i8 %13, 46
%conv15 = zext i1 %cmp13 to i8
store i8 %conv15, ptr %p.027, align 1, !tbaa !12
%incdec.ptr = getelementptr inbounds i8, ptr %p.027, i64 1
%tobool10.not = icmp eq i32 %dec, 0
br i1 %tobool10.not, label %while.end, label %while.body11, !llvm.loop !22
while.end: ; preds = %while.body11, %middle.block, %for.body
%p.0.lcssa = phi ptr [ %add.ptr, %for.body ], [ %ind.end, %middle.block ], [ %incdec.ptr, %while.body11 ]
store i8 0, ptr %p.0.lcssa, align 1, !tbaa !12
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%14 = load i32, ptr %h, align 4, !tbaa !15
%15 = sext i32 %14 to i64
%cmp5.not.not = icmp slt i64 %indvars.iv, %15
br i1 %cmp5.not.not, label %for.body, label %for.end, !llvm.loop !23
for.end: ; preds = %while.end, %while.body.for.end_crit_edge
%16 = phi i32 [ %.pre, %while.body.for.end_crit_edge ], [ %5, %while.end ]
%.lcssa = phi i32 [ %3, %while.body.for.end_crit_edge ], [ %14, %while.end ]
%call16 = call i32 @check(i32 noundef %.lcssa, i32 noundef %16), !range !24
%tobool17.not = icmp eq i32 %call16, 0
%cond = select i1 %tobool17.not, ptr @.str.2, ptr @.str.1
%call18 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
%17 = load ptr, ptr @stdin, align 8, !tbaa !17
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 10, ptr noundef %17)
%tobool = icmp ne ptr %call, null
%18 = load i8, ptr %buf, align 1
%cmp = icmp ne i8 %18, 48
%19 = select i1 %tobool, i1 %cmp, i1 false
br i1 %19, label %while.body, label %while.end19, !llvm.loop !25
while.end19: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %buf) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!6, !7, i64 1}
!10 = !{!6, !7, i64 2}
!11 = !{!6, !7, i64 3}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = distinct !{!19, !14, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !14, !21, !20}
!23 = distinct !{!23, !14}
!24 = !{i32 0, i32 2}
!25 = distinct !{!25, !14}
|
#include<stdio.h>
int main()
{
int n,i,j,k,l,max,temp,temporary;
scanf("%d",&n);
n=2*n;
int array[n][n];
for(i=1;i<n;i++)
{
for(j=0;j<i;j++)
{
scanf("%d",&array[i][j]);
}
}
int result[n];
temporary=n;
while(temporary!=0)
{
max=0;
for(i=1;i<n;i++)
{
for(j=0;j<i;j++)
{
temp=array[i][j];
if(max<temp)
{
max=temp;
k=i;
l=j;
}
}
}
result[l]=k;
result[k]=l;
temporary=temporary-2;
for(i=0;i<n;i++)
{
array[i][l]=0;
}
for(j=0;j<n;j++)
{
array[j][k]=0;
}
for(i=0;i<n;i++)
{
array[l][i]=0;
}
for(j=0;j<n;j++)
{
array[k][j]=0;
}
}
for(i=0;i<n;i++)
{
printf("%d ",result[i]+1);
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2577/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2577/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
store i32 %mul, ptr %n, align 4, !tbaa !5
%1 = zext i32 %mul to i64
%2 = call ptr @llvm.stacksave.p0()
%3 = mul nuw i64 %1, %1
%vla = alloca i32, i64 %3, align 16
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp122 = icmp sgt i32 %4, 1
br i1 %cmp122, label %for.cond1.preheader, label %for.end9
for.cond1.preheader: ; preds = %entry, %for.inc7
%indvars.iv153 = phi i64 [ %indvars.iv.next154, %for.inc7 ], [ 1, %entry ]
%5 = mul nuw nsw i64 %indvars.iv153, %1
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %5
br label %for.body3
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ]
%arrayidx5 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv153
br i1 %exitcond.not, label %for.inc7, label %for.body3, !llvm.loop !9
for.inc7: ; preds = %for.body3
%indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next154, %7
br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !11
for.end9: ; preds = %for.inc7, %entry
%8 = phi i32 [ %4, %entry ], [ %6, %for.inc7 ]
%9 = zext i32 %8 to i64
%vla10 = alloca i32, i64 %9, align 16
%cmp11.not145 = icmp eq i32 %8, 0
br i1 %cmp11.not145, label %for.end81, label %for.cond12.preheader.lr.ph
for.cond12.preheader.lr.ph: ; preds = %for.end9
%cmp13128 = icmp sgt i32 %8, 1
%cmp34135 = icmp sgt i32 %8, 0
%10 = shl nuw nsw i64 %9, 2
%xtraiter188 = and i64 %9, 3
%11 = icmp ult i32 %8, 4
%unroll_iter190 = and i64 %9, 4294967292
%lcmp.mod189.not = icmp eq i64 %xtraiter188, 0
%xtraiter192 = and i64 %9, 3
%12 = icmp ult i32 %8, 4
%unroll_iter195 = and i64 %9, 4294967292
%lcmp.mod194.not = icmp eq i64 %xtraiter192, 0
br label %for.cond12.preheader
while.cond.loopexit: ; preds = %for.end28, %for.cond43.preheader, %for.cond53.preheader, %for.body65.lr.ph
%cmp11.not = icmp eq i32 %sub, 0
br i1 %cmp11.not, label %for.cond73.preheader, label %for.cond12.preheader, !llvm.loop !12
for.cond12.preheader: ; preds = %for.cond12.preheader.lr.ph, %while.cond.loopexit
%k.0148 = phi i32 [ undef, %for.cond12.preheader.lr.ph ], [ %k.1.lcssa, %while.cond.loopexit ]
%temporary.0147 = phi i32 [ %8, %for.cond12.preheader.lr.ph ], [ %sub, %while.cond.loopexit ]
%l.0146 = phi i32 [ undef, %for.cond12.preheader.lr.ph ], [ %l.1.lcssa, %while.cond.loopexit ]
br i1 %cmp13128, label %for.cond15.preheader, label %for.end28
for.cond73.preheader: ; preds = %while.cond.loopexit
%cmp74149 = icmp sgt i32 %8, 0
br i1 %cmp74149, label %for.body75, label %for.end81
for.cond15.preheader: ; preds = %for.cond12.preheader, %for.inc26
%indvar = phi i64 [ %indvar.next, %for.inc26 ], [ 0, %for.cond12.preheader ]
%indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.inc26 ], [ 1, %for.cond12.preheader ]
%k.1131 = phi i32 [ %k.3.lcssa, %for.inc26 ], [ %k.0148, %for.cond12.preheader ]
%l.1130 = phi i32 [ %l.3.lcssa, %for.inc26 ], [ %l.0146, %for.cond12.preheader ]
%max.0129 = phi i32 [ %max.2.lcssa, %for.inc26 ], [ 0, %for.cond12.preheader ]
%13 = mul nuw nsw i64 %indvars.iv160, %1
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %13
%14 = trunc i64 %indvars.iv160 to i32
%xtraiter = and i64 %indvars.iv160, 1
%15 = icmp eq i64 %indvar, 0
br i1 %15, label %for.inc26.unr-lcssa, label %for.cond15.preheader.new
for.cond15.preheader.new: ; preds = %for.cond15.preheader
%unroll_iter = and i64 %indvars.iv160, 9223372036854775806
br label %for.body17
for.body17: ; preds = %for.body17, %for.cond15.preheader.new
%indvars.iv156 = phi i64 [ 0, %for.cond15.preheader.new ], [ %indvars.iv.next157.1, %for.body17 ]
%k.2126 = phi i32 [ %k.1131, %for.cond15.preheader.new ], [ %k.3.1, %for.body17 ]
%l.2125 = phi i32 [ %l.1130, %for.cond15.preheader.new ], [ %l.3.1, %for.body17 ]
%max.1124 = phi i32 [ %max.0129, %for.cond15.preheader.new ], [ %max.2.1, %for.body17 ]
%niter = phi i64 [ 0, %for.cond15.preheader.new ], [ %niter.next.1, %for.body17 ]
%arrayidx21 = getelementptr inbounds i32, ptr %arrayidx19, i64 %indvars.iv156
%16 = load i32, ptr %arrayidx21, align 8, !tbaa !5
%cmp22 = icmp slt i32 %max.1124, %16
%max.2 = call i32 @llvm.smax.i32(i32 %max.1124, i32 %16)
%17 = trunc i64 %indvars.iv156 to i32
%l.3 = select i1 %cmp22, i32 %17, i32 %l.2125
%indvars.iv.next157 = or i64 %indvars.iv156, 1
%arrayidx21.1 = getelementptr inbounds i32, ptr %arrayidx19, i64 %indvars.iv.next157
%18 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
%cmp22.1 = icmp slt i32 %max.2, %18
%max.2.1 = call i32 @llvm.smax.i32(i32 %max.2, i32 %18)
%19 = trunc i64 %indvars.iv.next157 to i32
%l.3.1 = select i1 %cmp22.1, i32 %19, i32 %l.3
%20 = select i1 %cmp22.1, i1 true, i1 %cmp22
%k.3.1 = select i1 %20, i32 %14, i32 %k.2126
%indvars.iv.next157.1 = add nuw nsw i64 %indvars.iv156, 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.inc26.unr-lcssa, label %for.body17, !llvm.loop !13
for.inc26.unr-lcssa: ; preds = %for.body17, %for.cond15.preheader
%max.2.lcssa.ph = phi i32 [ undef, %for.cond15.preheader ], [ %max.2.1, %for.body17 ]
%l.3.lcssa.ph = phi i32 [ undef, %for.cond15.preheader ], [ %l.3.1, %for.body17 ]
%k.3.lcssa.ph = phi i32 [ undef, %for.cond15.preheader ], [ %k.3.1, %for.body17 ]
%indvars.iv156.unr = phi i64 [ 0, %for.cond15.preheader ], [ %indvars.iv.next157.1, %for.body17 ]
%k.2126.unr = phi i32 [ %k.1131, %for.cond15.preheader ], [ %k.3.1, %for.body17 ]
%l.2125.unr = phi i32 [ %l.1130, %for.cond15.preheader ], [ %l.3.1, %for.body17 ]
%max.1124.unr = phi i32 [ %max.0129, %for.cond15.preheader ], [ %max.2.1, %for.body17 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc26, label %for.body17.epil
for.body17.epil: ; preds = %for.inc26.unr-lcssa
%arrayidx21.epil = getelementptr inbounds i32, ptr %arrayidx19, i64 %indvars.iv156.unr
%21 = load i32, ptr %arrayidx21.epil, align 4, !tbaa !5
%cmp22.epil = icmp slt i32 %max.1124.unr, %21
%max.2.epil = call i32 @llvm.smax.i32(i32 %max.1124.unr, i32 %21)
%22 = trunc i64 %indvars.iv156.unr to i32
%l.3.epil = select i1 %cmp22.epil, i32 %22, i32 %l.2125.unr
%k.3.epil = select i1 %cmp22.epil, i32 %14, i32 %k.2126.unr
br label %for.inc26
for.inc26: ; preds = %for.inc26.unr-lcssa, %for.body17.epil
%max.2.lcssa = phi i32 [ %max.2.lcssa.ph, %for.inc26.unr-lcssa ], [ %max.2.epil, %for.body17.epil ]
%l.3.lcssa = phi i32 [ %l.3.lcssa.ph, %for.inc26.unr-lcssa ], [ %l.3.epil, %for.body17.epil ]
%k.3.lcssa = phi i32 [ %k.3.lcssa.ph, %for.inc26.unr-lcssa ], [ %k.3.epil, %for.body17.epil ]
%indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
%exitcond164.not = icmp eq i64 %indvars.iv.next161, %9
%indvar.next = add i64 %indvar, 1
br i1 %exitcond164.not, label %for.end28, label %for.cond15.preheader, !llvm.loop !14
for.end28: ; preds = %for.inc26, %for.cond12.preheader
%l.1.lcssa = phi i32 [ %l.0146, %for.cond12.preheader ], [ %l.3.lcssa, %for.inc26 ]
%k.1.lcssa = phi i32 [ %k.0148, %for.cond12.preheader ], [ %k.3.lcssa, %for.inc26 ]
%idxprom29 = sext i32 %l.1.lcssa to i64
%arrayidx30 = getelementptr inbounds i32, ptr %vla10, i64 %idxprom29
store i32 %k.1.lcssa, ptr %arrayidx30, align 4, !tbaa !5
%idxprom31 = sext i32 %k.1.lcssa to i64
%arrayidx32 = getelementptr inbounds i32, ptr %vla10, i64 %idxprom31
store i32 %l.1.lcssa, ptr %arrayidx32, align 4, !tbaa !5
%sub = add nsw i32 %temporary.0147, -2
%invariant.gep = getelementptr i32, ptr %vla, i64 %idxprom29
br i1 %cmp34135, label %for.body35.preheader, label %while.cond.loopexit
for.body35.preheader: ; preds = %for.end28
br i1 %11, label %for.cond43.preheader.unr-lcssa, label %for.body35
for.cond43.preheader.unr-lcssa: ; preds = %for.body35, %for.body35.preheader
%indvars.iv165.unr = phi i64 [ 0, %for.body35.preheader ], [ %indvars.iv.next166.3, %for.body35 ]
br i1 %lcmp.mod189.not, label %for.cond43.preheader, label %for.body35.epil
for.body35.epil: ; preds = %for.cond43.preheader.unr-lcssa, %for.body35.epil
%indvars.iv165.epil = phi i64 [ %indvars.iv.next166.epil, %for.body35.epil ], [ %indvars.iv165.unr, %for.cond43.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body35.epil ], [ 0, %for.cond43.preheader.unr-lcssa ]
%23 = mul nuw nsw i64 %indvars.iv165.epil, %1
%gep.epil = getelementptr i32, ptr %invariant.gep, i64 %23
store i32 0, ptr %gep.epil, align 4, !tbaa !5
%indvars.iv.next166.epil = add nuw nsw i64 %indvars.iv165.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter188
br i1 %epil.iter.cmp.not, label %for.cond43.preheader, label %for.body35.epil, !llvm.loop !15
for.cond43.preheader: ; preds = %for.body35.epil, %for.cond43.preheader.unr-lcssa
%invariant.gep137 = getelementptr i32, ptr %vla, i64 %idxprom31
br i1 %cmp34135, label %for.body45.preheader, label %while.cond.loopexit
for.body45.preheader: ; preds = %for.cond43.preheader
br i1 %12, label %for.cond53.preheader.unr-lcssa, label %for.body45
for.body35: ; preds = %for.body35.preheader, %for.body35
%indvars.iv165 = phi i64 [ %indvars.iv.next166.3, %for.body35 ], [ 0, %for.body35.preheader ]
%niter191 = phi i64 [ %niter191.next.3, %for.body35 ], [ 0, %for.body35.preheader ]
%24 = mul nuw nsw i64 %indvars.iv165, %1
%gep = getelementptr i32, ptr %invariant.gep, i64 %24
store i32 0, ptr %gep, align 4, !tbaa !5
%indvars.iv.next166 = or i64 %indvars.iv165, 1
%25 = mul nuw nsw i64 %indvars.iv.next166, %1
%gep.1 = getelementptr i32, ptr %invariant.gep, i64 %25
store i32 0, ptr %gep.1, align 4, !tbaa !5
%indvars.iv.next166.1 = or i64 %indvars.iv165, 2
%26 = mul nuw nsw i64 %indvars.iv.next166.1, %1
%gep.2 = getelementptr i32, ptr %invariant.gep, i64 %26
store i32 0, ptr %gep.2, align 4, !tbaa !5
%indvars.iv.next166.2 = or i64 %indvars.iv165, 3
%27 = mul nuw nsw i64 %indvars.iv.next166.2, %1
%gep.3 = getelementptr i32, ptr %invariant.gep, i64 %27
store i32 0, ptr %gep.3, align 4, !tbaa !5
%indvars.iv.next166.3 = add nuw nsw i64 %indvars.iv165, 4
%niter191.next.3 = add i64 %niter191, 4
%niter191.ncmp.3 = icmp eq i64 %niter191.next.3, %unroll_iter190
br i1 %niter191.ncmp.3, label %for.cond43.preheader.unr-lcssa, label %for.body35, !llvm.loop !17
for.cond53.preheader.unr-lcssa: ; preds = %for.body45, %for.body45.preheader
%indvars.iv169.unr = phi i64 [ 0, %for.body45.preheader ], [ %indvars.iv.next170.3, %for.body45 ]
br i1 %lcmp.mod194.not, label %for.cond53.preheader, label %for.body45.epil
for.body45.epil: ; preds = %for.cond53.preheader.unr-lcssa, %for.body45.epil
%indvars.iv169.epil = phi i64 [ %indvars.iv.next170.epil, %for.body45.epil ], [ %indvars.iv169.unr, %for.cond53.preheader.unr-lcssa ]
%epil.iter193 = phi i64 [ %epil.iter193.next, %for.body45.epil ], [ 0, %for.cond53.preheader.unr-lcssa ]
%28 = mul nuw nsw i64 %indvars.iv169.epil, %1
%gep138.epil = getelementptr i32, ptr %invariant.gep137, i64 %28
store i32 0, ptr %gep138.epil, align 4, !tbaa !5
%indvars.iv.next170.epil = add nuw nsw i64 %indvars.iv169.epil, 1
%epil.iter193.next = add i64 %epil.iter193, 1
%epil.iter193.cmp.not = icmp eq i64 %epil.iter193.next, %xtraiter192
br i1 %epil.iter193.cmp.not, label %for.cond53.preheader, label %for.body45.epil, !llvm.loop !18
for.cond53.preheader: ; preds = %for.body45.epil, %for.cond53.preheader.unr-lcssa
br i1 %cmp34135, label %for.body65.lr.ph, label %while.cond.loopexit
for.body45: ; preds = %for.body45.preheader, %for.body45
%indvars.iv169 = phi i64 [ %indvars.iv.next170.3, %for.body45 ], [ 0, %for.body45.preheader ]
%niter196 = phi i64 [ %niter196.next.3, %for.body45 ], [ 0, %for.body45.preheader ]
%29 = mul nuw nsw i64 %indvars.iv169, %1
%gep138 = getelementptr i32, ptr %invariant.gep137, i64 %29
store i32 0, ptr %gep138, align 4, !tbaa !5
%indvars.iv.next170 = or i64 %indvars.iv169, 1
%30 = mul nuw nsw i64 %indvars.iv.next170, %1
%gep138.1 = getelementptr i32, ptr %invariant.gep137, i64 %30
store i32 0, ptr %gep138.1, align 4, !tbaa !5
%indvars.iv.next170.1 = or i64 %indvars.iv169, 2
%31 = mul nuw nsw i64 %indvars.iv.next170.1, %1
%gep138.2 = getelementptr i32, ptr %invariant.gep137, i64 %31
store i32 0, ptr %gep138.2, align 4, !tbaa !5
%indvars.iv.next170.2 = or i64 %indvars.iv169, 3
%32 = mul nuw nsw i64 %indvars.iv.next170.2, %1
%gep138.3 = getelementptr i32, ptr %invariant.gep137, i64 %32
store i32 0, ptr %gep138.3, align 4, !tbaa !5
%indvars.iv.next170.3 = add nuw nsw i64 %indvars.iv169, 4
%niter196.next.3 = add i64 %niter196, 4
%niter196.ncmp.3 = icmp eq i64 %niter196.next.3, %unroll_iter195
br i1 %niter196.ncmp.3, label %for.cond53.preheader.unr-lcssa, label %for.body45, !llvm.loop !19
for.body65.lr.ph: ; preds = %for.cond53.preheader
%33 = mul nsw i64 %idxprom29, %1
%arrayidx57 = getelementptr inbounds i32, ptr %vla, i64 %33
call void @llvm.memset.p0.i64(ptr nonnull align 8 %arrayidx57, i8 0, i64 %10, i1 false), !tbaa !5
%34 = mul nsw i64 %idxprom31, %1
%arrayidx67 = getelementptr inbounds i32, ptr %vla, i64 %34
call void @llvm.memset.p0.i64(ptr nonnull align 8 %arrayidx67, i8 0, i64 %10, i1 false), !tbaa !5
br label %while.cond.loopexit
for.body75: ; preds = %for.cond73.preheader, %for.body75
%indvars.iv180 = phi i64 [ %indvars.iv.next181, %for.body75 ], [ 0, %for.cond73.preheader ]
%arrayidx77 = getelementptr inbounds i32, ptr %vla10, i64 %indvars.iv180
%35 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%add = add nsw i32 %35, 1
%call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
%36 = load i32, ptr %n, align 4, !tbaa !5
%37 = sext i32 %36 to i64
%cmp74 = icmp slt i64 %indvars.iv.next181, %37
br i1 %cmp74, label %for.body75, label %for.end81, !llvm.loop !20
for.end81: ; preds = %for.body75, %for.end9, %for.cond73.preheader
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
int main(void)
{
int a = 0,b = 0,k = 0;
scanf("%d %d %d",&a,&b,&k);
int i;
for(i = 1;i <= k; i++){
if(i %2 == 1){
if(a % 2 == 1)
a--;
a /= 2;
b += a;
}
else{
if(b % 2 == 1)
b--;
b /= 2;
a += b;
}
}
printf("%d %d",a,b);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257786/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257786/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
store i32 0, ptr %b, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
store i32 0, ptr %k, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp.not22 = icmp slt i32 %0, 1
br i1 %cmp.not22, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.025 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%add111624 = phi i32 [ %add1117, %for.inc ], [ %a.promoted, %entry ]
%div101923 = phi i32 [ %div1020, %for.inc ], [ %b.promoted, %entry ]
%rem = and i32 %i.025, 1
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %if.else, label %if.then
if.then: ; preds = %for.body
%1 = and i32 %add111624, -2147483647
%cmp3 = icmp eq i32 %1, 1
%dec = sext i1 %cmp3 to i32
%spec.select = add nsw i32 %add111624, %dec
%div = sdiv i32 %spec.select, 2
store i32 %div, ptr %a, align 4, !tbaa !5
%add = add nsw i32 %div101923, %div
store i32 %add, ptr %b, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %for.body
%2 = and i32 %div101923, -2147483647
%cmp6 = icmp eq i32 %2, 1
%dec8 = sext i1 %cmp6 to i32
%spec.select26 = add nsw i32 %div101923, %dec8
%div10 = sdiv i32 %spec.select26, 2
store i32 %div10, ptr %b, align 4, !tbaa !5
%add11 = add nsw i32 %add111624, %div10
store i32 %add11, ptr %a, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%div1020 = phi i32 [ %add, %if.then ], [ %div10, %if.else ]
%add1117 = phi i32 [ %div, %if.then ], [ %add11, %if.else ]
%inc = add nuw i32 %i.025, 1
%exitcond.not = icmp eq i32 %i.025, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%3 = phi i32 [ %b.promoted, %entry ], [ %div1020, %for.inc ]
%4 = phi i32 [ %a.promoted, %entry ], [ %add1117, %for.inc ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
int main(void){
int K, S;
scanf("%d%d", &K, &S);
int ans = 0;
for(int i = 0; i <= K; i++){
if(i > S){
break;
}
for(int j = 0; j <= K; j++){
if(i + j > S){
break;
}
if(S - i - j >= 0 && S - i - j <= K){
ans++;
}
}
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257829/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257829/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%K = alloca i32, align 4
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %S)
%0 = load i32, ptr %K, align 4, !tbaa !5
%1 = load i32, ptr %S, align 4
%.fr = freeze i32 %1
%invariant.smin = call i32 @llvm.smin.i32(i32 %0, i32 %.fr)
%or.cond3641 = icmp slt i32 %invariant.smin, 0
%cmp3.not37 = icmp slt i32 %0, 0
%or.cond = select i1 %or.cond3641, i1 true, i1 %cmp3.not37
br i1 %or.cond, label %cleanup19, label %for.cond2.preheader
for.cond2.preheader: ; preds = %entry, %cleanup
%i.043 = phi i32 [ %inc18, %cleanup ], [ 0, %entry ]
%ans.042 = phi i32 [ %ans.1.lcssa, %cleanup ], [ 0, %entry ]
br label %for.body5
for.body5: ; preds = %for.cond2.preheader, %if.end8
%j.039 = phi i32 [ 0, %for.cond2.preheader ], [ %inc16, %if.end8 ]
%ans.138 = phi i32 [ %ans.042, %for.cond2.preheader ], [ %ans.2, %if.end8 ]
%add = add nuw nsw i32 %j.039, %i.043
%cmp6 = icmp sgt i32 %add, %.fr
br i1 %cmp6, label %cleanup, label %if.end8
if.end8: ; preds = %for.body5
%sub9 = sub i32 %.fr, %add
%cmp10 = icmp sgt i32 %sub9, -1
%cmp13.not = icmp sle i32 %sub9, %0
%or.cond.not = and i1 %cmp10, %cmp13.not
%inc = zext i1 %or.cond.not to i32
%ans.2 = add nsw i32 %ans.138, %inc
%inc16 = add nuw i32 %j.039, 1
%exitcond.not = icmp eq i32 %j.039, %0
br i1 %exitcond.not, label %cleanup, label %for.body5, !llvm.loop !9
cleanup: ; preds = %if.end8, %for.body5
%ans.1.lcssa = phi i32 [ %ans.138, %for.body5 ], [ %ans.2, %if.end8 ]
%inc18 = add nuw i32 %i.043, 1
%exitcond46.not = icmp eq i32 %i.043, %invariant.smin
br i1 %exitcond46.not, label %cleanup19, label %for.cond2.preheader, !llvm.loop !11
cleanup19: ; preds = %cleanup, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %ans.1.lcssa, %cleanup ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #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.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}
|
#include<stdio.h>
int main(){
int k, s;
int x, y, z;
int cnt=0;
scanf("%d%d", &k, &s);
for( x=0; x<=k; x++){
for( y=0; y<=k; y++){
if(x+y<=s&&s-x-y<=k) cnt++;
}
}
printf("%d", cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257872/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257872/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %s)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not23 = icmp slt i32 %0, 0
br i1 %cmp.not23, label %for.end10, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %s, align 4
%2 = add i32 %0, 1
%min.iters.check = icmp ult i32 %2, 8
%n.vec = and i32 %2, -8
%broadcast.splatinsert30 = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat31 = shufflevector <4 x i32> %broadcast.splatinsert30, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert32 = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat33 = shufflevector <4 x i32> %broadcast.splatinsert32, <4 x i32> poison, <4 x i32> zeroinitializer
%cmp.n = icmp eq i32 %2, %n.vec
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.for.inc8_crit_edge
%cnt.025 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %cnt.2.lcssa, %for.cond1.for.inc8_crit_edge ]
%x.024 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc9, %for.cond1.for.inc8_crit_edge ]
br i1 %min.iters.check, label %for.body3.preheader, label %vector.ph
vector.ph: ; preds = %for.cond1.preheader
%3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.025, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %x.024, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ]
%vec.phi28 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%4 = add nuw nsw <4 x i32> %vec.ind, %broadcast.splat
%5 = add nuw nsw <4 x i32> %step.add, %broadcast.splat
%6 = icmp sle <4 x i32> %4, %broadcast.splat31
%7 = icmp sle <4 x i32> %5, %broadcast.splat31
%8 = sub <4 x i32> %broadcast.splat31, %4
%9 = sub <4 x i32> %broadcast.splat31, %5
%10 = icmp sle <4 x i32> %8, %broadcast.splat33
%11 = icmp sle <4 x i32> %9, %broadcast.splat33
%12 = and <4 x i1> %6, %10
%13 = and <4 x i1> %7, %11
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi28, %15
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%18 = icmp eq i32 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond1.for.inc8_crit_edge, label %for.body3.preheader
for.body3.preheader: ; preds = %for.cond1.preheader, %middle.block
%cnt.122.ph = phi i32 [ %cnt.025, %for.cond1.preheader ], [ %19, %middle.block ]
%y.021.ph = phi i32 [ 0, %for.cond1.preheader ], [ %n.vec, %middle.block ]
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%cnt.122 = phi i32 [ %cnt.2, %for.body3 ], [ %cnt.122.ph, %for.body3.preheader ]
%y.021 = phi i32 [ %inc7, %for.body3 ], [ %y.021.ph, %for.body3.preheader ]
%add = add nuw nsw i32 %y.021, %x.024
%cmp4.not = icmp sle i32 %add, %1
%sub5 = sub i32 %1, %add
%cmp6.not = icmp sle i32 %sub5, %0
%narrow = and i1 %cmp4.not, %cmp6.not
%spec.select = zext i1 %narrow to i32
%cnt.2 = add nsw i32 %cnt.122, %spec.select
%inc7 = add nuw i32 %y.021, 1
%exitcond.not = icmp eq i32 %y.021, %0
br i1 %exitcond.not, label %for.cond1.for.inc8_crit_edge, label %for.body3, !llvm.loop !13
for.cond1.for.inc8_crit_edge: ; preds = %for.body3, %middle.block
%cnt.2.lcssa = phi i32 [ %19, %middle.block ], [ %cnt.2, %for.body3 ]
%inc9 = add nuw i32 %x.024, 1
%exitcond27.not = icmp eq i32 %x.024, %0
br i1 %exitcond27.not, label %for.end10, label %for.cond1.preheader, !llvm.loop !14
for.end10: ; preds = %for.cond1.for.inc8_crit_edge, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.2.lcssa, %for.cond1.for.inc8_crit_edge ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
/* -------- main code -------- */
int main(void)
{
int k, s;
int x, y, z;
int ptn;
int s_ret;
s_ret = scanf("%d %d", &k, &s);
ptn = 0;
for(x = 0; x <= k; x++){
for(y = 0; y <= k; y++){
z = s - (x + y);
if((0 <= z) && (z <= k)){
ptn++;
}
}
}
printf("%d\n", ptn);
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257915/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257915/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%k = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %s)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not20 = icmp slt i32 %0, 0
br i1 %cmp.not20, label %for.end9, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %s, align 4
%2 = add i32 %0, 1
%min.iters.check = icmp ult i32 %2, 8
%n.vec = and i32 %2, -8
%broadcast.splatinsert27 = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat28 = shufflevector <4 x i32> %broadcast.splatinsert27, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert29 = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat30 = shufflevector <4 x i32> %broadcast.splatinsert29, <4 x i32> poison, <4 x i32> zeroinitializer
%cmp.n = icmp eq i32 %2, %n.vec
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.for.inc7_crit_edge
%x.022 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc8, %for.cond1.for.inc7_crit_edge ]
%ptn.021 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %ptn.2.lcssa, %for.cond1.for.inc7_crit_edge ]
br i1 %min.iters.check, label %for.body3.preheader, label %vector.ph
vector.ph: ; preds = %for.cond1.preheader
%3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %ptn.021, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %x.022, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ]
%vec.phi25 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%4 = add nuw <4 x i32> %vec.ind, %broadcast.splat
%5 = add nuw <4 x i32> %step.add, %broadcast.splat
%6 = sub <4 x i32> %broadcast.splat28, %4
%7 = sub <4 x i32> %broadcast.splat28, %5
%8 = icmp sgt <4 x i32> %6, <i32 -1, i32 -1, i32 -1, i32 -1>
%9 = icmp sgt <4 x i32> %7, <i32 -1, i32 -1, i32 -1, i32 -1>
%10 = icmp sle <4 x i32> %6, %broadcast.splat30
%11 = icmp sle <4 x i32> %7, %broadcast.splat30
%12 = and <4 x i1> %8, %10
%13 = and <4 x i1> %9, %11
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi25, %15
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%18 = icmp eq i32 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond1.for.inc7_crit_edge, label %for.body3.preheader
for.body3.preheader: ; preds = %for.cond1.preheader, %middle.block
%ptn.119.ph = phi i32 [ %ptn.021, %for.cond1.preheader ], [ %19, %middle.block ]
%y.018.ph = phi i32 [ 0, %for.cond1.preheader ], [ %n.vec, %middle.block ]
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%ptn.119 = phi i32 [ %ptn.2, %for.body3 ], [ %ptn.119.ph, %for.body3.preheader ]
%y.018 = phi i32 [ %inc6, %for.body3 ], [ %y.018.ph, %for.body3.preheader ]
%20 = add nuw i32 %y.018, %x.022
%sub = sub i32 %1, %20
%cmp4 = icmp sgt i32 %sub, -1
%cmp5.not = icmp sle i32 %sub, %0
%or.cond.not = and i1 %cmp4, %cmp5.not
%inc = zext i1 %or.cond.not to i32
%ptn.2 = add nsw i32 %ptn.119, %inc
%inc6 = add nuw i32 %y.018, 1
%exitcond.not = icmp eq i32 %y.018, %0
br i1 %exitcond.not, label %for.cond1.for.inc7_crit_edge, label %for.body3, !llvm.loop !13
for.cond1.for.inc7_crit_edge: ; preds = %for.body3, %middle.block
%ptn.2.lcssa = phi i32 [ %19, %middle.block ], [ %ptn.2, %for.body3 ]
%inc8 = add nuw i32 %x.022, 1
%exitcond24.not = icmp eq i32 %x.022, %0
br i1 %exitcond24.not, label %for.end9, label %for.cond1.preheader, !llvm.loop !14
for.end9: ; preds = %for.cond1.for.inc7_crit_edge, %entry
%ptn.0.lcssa = phi i32 [ 0, %entry ], [ %ptn.2.lcssa, %for.cond1.for.inc7_crit_edge ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ptn.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
int k,s, count = 0;
scanf("%d%d", &k, &s);
for(int x = 0; x <= k; x++) {
for(int y = 0; y <= k; y++) {
int z = s-x-y;
if(z >= 0 && z <= k) {
count++;
}
}
}
printf("%d\n", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_257959/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_257959/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%k = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %s)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not22 = icmp slt i32 %0, 0
br i1 %cmp.not22, label %for.cond.cleanup, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %s, align 4
%2 = add i32 %0, 1
%min.iters.check = icmp ult i32 %2, 8
%n.vec = and i32 %2, -8
%broadcast.splatinsert29 = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat30 = shufflevector <4 x i32> %broadcast.splatinsert29, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert31 = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat32 = shufflevector <4 x i32> %broadcast.splatinsert31, <4 x i32> poison, <4 x i32> zeroinitializer
%cmp.n = icmp eq i32 %2, %n.vec
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.for.cond.cleanup3_crit_edge
%x.024 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc10, %for.cond1.for.cond.cleanup3_crit_edge ]
%count.023 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %count.2.lcssa, %for.cond1.for.cond.cleanup3_crit_edge ]
br i1 %min.iters.check, label %for.body4.preheader, label %vector.ph
vector.ph: ; preds = %for.cond1.preheader
%3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.023, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %x.024, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ]
%vec.phi28 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%4 = add nuw <4 x i32> %vec.ind, %broadcast.splat
%5 = add nuw <4 x i32> %step.add, %broadcast.splat
%6 = sub <4 x i32> %broadcast.splat30, %4
%7 = sub <4 x i32> %broadcast.splat30, %5
%8 = icmp sgt <4 x i32> %6, <i32 -1, i32 -1, i32 -1, i32 -1>
%9 = icmp sgt <4 x i32> %7, <i32 -1, i32 -1, i32 -1, i32 -1>
%10 = icmp sle <4 x i32> %6, %broadcast.splat32
%11 = icmp sle <4 x i32> %7, %broadcast.splat32
%12 = and <4 x i1> %8, %10
%13 = and <4 x i1> %9, %11
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi28, %15
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%18 = icmp eq i32 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond1.for.cond.cleanup3_crit_edge, label %for.body4.preheader
for.body4.preheader: ; preds = %for.cond1.preheader, %middle.block
%y.021.ph = phi i32 [ 0, %for.cond1.preheader ], [ %n.vec, %middle.block ]
%count.120.ph = phi i32 [ %count.023, %for.cond1.preheader ], [ %19, %middle.block ]
br label %for.body4
for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup3_crit_edge, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %count.2.lcssa, %for.cond1.for.cond.cleanup3_crit_edge ]
%call12 = 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 %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
ret i32 0
for.cond1.for.cond.cleanup3_crit_edge: ; preds = %for.body4, %middle.block
%count.2.lcssa = phi i32 [ %19, %middle.block ], [ %count.2, %for.body4 ]
%inc10 = add nuw i32 %x.024, 1
%exitcond26.not = icmp eq i32 %x.024, %0
br i1 %exitcond26.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader, %for.body4
%y.021 = phi i32 [ %inc8, %for.body4 ], [ %y.021.ph, %for.body4.preheader ]
%count.120 = phi i32 [ %count.2, %for.body4 ], [ %count.120.ph, %for.body4.preheader ]
%20 = add nuw i32 %y.021, %x.024
%sub5 = sub i32 %1, %20
%cmp6 = icmp sgt i32 %sub5, -1
%cmp7.not = icmp sle i32 %sub5, %0
%or.cond.not = and i1 %cmp6, %cmp7.not
%inc = zext i1 %or.cond.not to i32
%count.2 = add nsw i32 %count.120, %inc
%inc8 = add nuw i32 %y.021, 1
%exitcond.not = icmp eq i32 %y.021, %0
br i1 %exitcond.not, label %for.cond1.for.cond.cleanup3_crit_edge, label %for.body4, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(){
int K,S,X,Y,Z,count=0;
scanf("%d%d",&K,&S);
for(Z=0;Z<=K;Z++){
for(Y=0;Y<=K&&Y<=S-Z;Y++){
if(0<=S-Z-Y&&S-Z-Y<=K){
count++;
}
}
}
printf("\n%d\n\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258000/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258000/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"\0A%d\0A\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %S)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp.not29 = icmp slt i32 %0, 0
br i1 %cmp.not29, label %for.end14, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %S, align 4
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc12
%indvars.iv = phi i32 [ %1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next, %for.inc12 ]
%count.031 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %count.1.lcssa, %for.inc12 ]
%Z.030 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc13, %for.inc12 ]
%smax = call i32 @llvm.smax.i32(i32 %indvars.iv, i32 -1)
%2 = add i32 %smax, 1
br label %land.rhs
land.rhs: ; preds = %for.cond1.preheader, %for.body4
%count.127 = phi i32 [ %count.031, %for.cond1.preheader ], [ %count.2, %for.body4 ]
%Y.026 = phi i32 [ 0, %for.cond1.preheader ], [ %inc11, %for.body4 ]
%exitcond = icmp eq i32 %Y.026, %2
br i1 %exitcond, label %for.inc12, label %for.body4
for.body4: ; preds = %land.rhs
%3 = add i32 %Z.030, %Y.026
%sub6 = sub i32 %1, %3
%cmp7 = icmp sgt i32 %sub6, -1
%cmp10.not = icmp sle i32 %sub6, %0
%or.cond.not = and i1 %cmp7, %cmp10.not
%inc = zext i1 %or.cond.not to i32
%count.2 = add nsw i32 %count.127, %inc
%inc11 = add nuw i32 %Y.026, 1
%exitcond33.not = icmp eq i32 %Y.026, %0
br i1 %exitcond33.not, label %for.inc12, label %land.rhs, !llvm.loop !9
for.inc12: ; preds = %for.body4, %land.rhs
%count.1.lcssa = phi i32 [ %count.127, %land.rhs ], [ %count.2, %for.body4 ]
%inc13 = add nuw i32 %Z.030, 1
%indvars.iv.next = add i32 %indvars.iv, -1
%exitcond34.not = icmp eq i32 %Z.030, %0
br i1 %exitcond34.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !11
for.end14: ; preds = %for.inc12, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa, %for.inc12 ]
%call15 = 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 %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int k,s,i,j,l;
scanf("%d %d",&k,&s);
int count = 0;
for(int i = 0;i<=k;i++){
for(int j = 0;j<=k;j++){
// printf("i = %d j = %d\n",i,j);
if(s - i - j <= k && s - i - j >= 0){
count++;
// printf("maru\n");
}
}
}
printf("%d\n",count);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258044/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258044/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%k = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %s)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not27 = icmp slt i32 %0, 0
br i1 %cmp.not27, label %for.cond.cleanup, label %for.cond3.preheader.lr.ph
for.cond3.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %s, align 4
%2 = add i32 %0, 1
%min.iters.check = icmp ult i32 %2, 8
%n.vec = and i32 %2, -8
%broadcast.splatinsert34 = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat35 = shufflevector <4 x i32> %broadcast.splatinsert34, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert36 = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat37 = shufflevector <4 x i32> %broadcast.splatinsert36, <4 x i32> poison, <4 x i32> zeroinitializer
%cmp.n = icmp eq i32 %2, %n.vec
br label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.cond3.for.cond.cleanup5_crit_edge
%i1.029 = phi i32 [ 0, %for.cond3.preheader.lr.ph ], [ %inc14, %for.cond3.for.cond.cleanup5_crit_edge ]
%count.028 = phi i32 [ 0, %for.cond3.preheader.lr.ph ], [ %count.2.lcssa, %for.cond3.for.cond.cleanup5_crit_edge ]
br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph
vector.ph: ; preds = %for.cond3.preheader
%3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.028, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %i1.029, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ]
%vec.phi33 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%4 = add nuw <4 x i32> %vec.ind, %broadcast.splat
%5 = add nuw <4 x i32> %step.add, %broadcast.splat
%6 = sub <4 x i32> %broadcast.splat35, %4
%7 = sub <4 x i32> %broadcast.splat35, %5
%8 = icmp sle <4 x i32> %6, %broadcast.splat37
%9 = icmp sle <4 x i32> %7, %broadcast.splat37
%10 = icmp sgt <4 x i32> %6, <i32 -1, i32 -1, i32 -1, i32 -1>
%11 = icmp sgt <4 x i32> %7, <i32 -1, i32 -1, i32 -1, i32 -1>
%12 = and <4 x i1> %8, %10
%13 = and <4 x i1> %9, %11
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi33, %15
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%18 = icmp eq i32 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond3.for.cond.cleanup5_crit_edge, label %for.body6.preheader
for.body6.preheader: ; preds = %for.cond3.preheader, %middle.block
%j2.026.ph = phi i32 [ 0, %for.cond3.preheader ], [ %n.vec, %middle.block ]
%count.125.ph = phi i32 [ %count.028, %for.cond3.preheader ], [ %19, %middle.block ]
br label %for.body6
for.cond.cleanup: ; preds = %for.cond3.for.cond.cleanup5_crit_edge, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %count.2.lcssa, %for.cond3.for.cond.cleanup5_crit_edge ]
%call16 = 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 %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
ret i32 0
for.cond3.for.cond.cleanup5_crit_edge: ; preds = %for.body6, %middle.block
%count.2.lcssa = phi i32 [ %19, %middle.block ], [ %count.2, %for.body6 ]
%inc14 = add nuw i32 %i1.029, 1
%exitcond31.not = icmp eq i32 %i1.029, %0
br i1 %exitcond31.not, label %for.cond.cleanup, label %for.cond3.preheader, !llvm.loop !13
for.body6: ; preds = %for.body6.preheader, %for.body6
%j2.026 = phi i32 [ %inc12, %for.body6 ], [ %j2.026.ph, %for.body6.preheader ]
%count.125 = phi i32 [ %count.2, %for.body6 ], [ %count.125.ph, %for.body6.preheader ]
%20 = add nuw i32 %j2.026, %i1.029
%sub7 = sub i32 %1, %20
%cmp8.not = icmp sle i32 %sub7, %0
%cmp11 = icmp sgt i32 %sub7, -1
%or.cond = and i1 %cmp8.not, %cmp11
%inc = zext i1 %or.cond to i32
%count.2 = add nsw i32 %count.125, %inc
%inc12 = add nuw i32 %j2.026, 1
%exitcond.not = icmp eq i32 %j2.026, %0
br i1 %exitcond.not, label %for.cond3.for.cond.cleanup5_crit_edge, label %for.body6, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main(void){
int K, S;
int x, y, z;
int n, N=0;
scanf("%d %d",&K,&S);
for(x=0; x<=K; x++){
for(y=0; y<=K; y++){
n=S-x-y;
if(0<=n&&n<=K) N=N+1;
}
}
printf("%d",N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258088/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258088/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %S)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp.not20 = icmp slt i32 %0, 0
br i1 %cmp.not20, label %for.end9, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %S, align 4
%2 = add i32 %0, 1
%min.iters.check = icmp ult i32 %2, 8
%n.vec = and i32 %2, -8
%broadcast.splatinsert27 = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat28 = shufflevector <4 x i32> %broadcast.splatinsert27, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert29 = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat30 = shufflevector <4 x i32> %broadcast.splatinsert29, <4 x i32> poison, <4 x i32> zeroinitializer
%cmp.n = icmp eq i32 %2, %n.vec
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.for.inc7_crit_edge
%N.022 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %N.2.lcssa, %for.cond1.for.inc7_crit_edge ]
%x.021 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc8, %for.cond1.for.inc7_crit_edge ]
br i1 %min.iters.check, label %for.body3.preheader, label %vector.ph
vector.ph: ; preds = %for.cond1.preheader
%3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %N.022, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %x.021, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ]
%vec.phi25 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%4 = add nuw <4 x i32> %vec.ind, %broadcast.splat
%5 = add nuw <4 x i32> %step.add, %broadcast.splat
%6 = sub <4 x i32> %broadcast.splat28, %4
%7 = sub <4 x i32> %broadcast.splat28, %5
%8 = icmp sgt <4 x i32> %6, <i32 -1, i32 -1, i32 -1, i32 -1>
%9 = icmp sgt <4 x i32> %7, <i32 -1, i32 -1, i32 -1, i32 -1>
%10 = icmp sle <4 x i32> %6, %broadcast.splat30
%11 = icmp sle <4 x i32> %7, %broadcast.splat30
%12 = and <4 x i1> %8, %10
%13 = and <4 x i1> %9, %11
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi25, %15
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%18 = icmp eq i32 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond1.for.inc7_crit_edge, label %for.body3.preheader
for.body3.preheader: ; preds = %for.cond1.preheader, %middle.block
%N.119.ph = phi i32 [ %N.022, %for.cond1.preheader ], [ %19, %middle.block ]
%y.018.ph = phi i32 [ 0, %for.cond1.preheader ], [ %n.vec, %middle.block ]
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%N.119 = phi i32 [ %N.2, %for.body3 ], [ %N.119.ph, %for.body3.preheader ]
%y.018 = phi i32 [ %inc, %for.body3 ], [ %y.018.ph, %for.body3.preheader ]
%20 = add nuw i32 %y.018, %x.021
%sub4 = sub i32 %1, %20
%cmp5 = icmp sgt i32 %sub4, -1
%cmp6.not = icmp sle i32 %sub4, %0
%or.cond.not = and i1 %cmp5, %cmp6.not
%add = zext i1 %or.cond.not to i32
%N.2 = add nsw i32 %N.119, %add
%inc = add nuw i32 %y.018, 1
%exitcond.not = icmp eq i32 %y.018, %0
br i1 %exitcond.not, label %for.cond1.for.inc7_crit_edge, label %for.body3, !llvm.loop !13
for.cond1.for.inc7_crit_edge: ; preds = %for.body3, %middle.block
%N.2.lcssa = phi i32 [ %19, %middle.block ], [ %N.2, %for.body3 ]
%inc8 = add nuw i32 %x.021, 1
%exitcond24.not = icmp eq i32 %x.021, %0
br i1 %exitcond24.not, label %for.end9, label %for.cond1.preheader, !llvm.loop !14
for.end9: ; preds = %for.cond1.for.inc7_crit_edge, %entry
%N.0.lcssa = phi i32 [ 0, %entry ], [ %N.2.lcssa, %for.cond1.for.inc7_crit_edge ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %N.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include <string.h>
#include <math.h>
int main(){
int K,S;
int X,Y,Z;
int count=0;
scanf("%d %d",&K,&S);
for(X=0;X<=K;X++){
for(Y=0;Y<=K;Y++){
if(X+Y+K>=S && X+Y<=S){
count++;
}
}
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258138/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258138/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%K = alloca i32, align 4
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %S)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp.not24 = icmp slt i32 %0, 0
br i1 %cmp.not24, label %for.end11, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %S, align 4
%2 = add i32 %0, 1
%min.iters.check = icmp ult i32 %2, 8
%n.vec = and i32 %2, -8
%broadcast.splatinsert31 = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat32 = shufflevector <4 x i32> %broadcast.splatinsert31, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert33 = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat34 = shufflevector <4 x i32> %broadcast.splatinsert33, <4 x i32> poison, <4 x i32> zeroinitializer
%cmp.n = icmp eq i32 %2, %n.vec
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.for.inc9_crit_edge
%count.026 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %count.2.lcssa, %for.cond1.for.inc9_crit_edge ]
%X.025 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc10, %for.cond1.for.inc9_crit_edge ]
br i1 %min.iters.check, label %for.body3.preheader, label %vector.ph
vector.ph: ; preds = %for.cond1.preheader
%3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.026, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %X.025, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ]
%vec.phi29 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%4 = add nuw nsw <4 x i32> %vec.ind, %broadcast.splat
%5 = add nuw nsw <4 x i32> %step.add, %broadcast.splat
%6 = add nsw <4 x i32> %4, %broadcast.splat32
%7 = add nsw <4 x i32> %5, %broadcast.splat32
%8 = icmp sge <4 x i32> %6, %broadcast.splat34
%9 = icmp sge <4 x i32> %7, %broadcast.splat34
%10 = icmp sle <4 x i32> %4, %broadcast.splat34
%11 = icmp sle <4 x i32> %5, %broadcast.splat34
%12 = and <4 x i1> %8, %10
%13 = and <4 x i1> %9, %11
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi29, %15
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%18 = icmp eq i32 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond1.for.inc9_crit_edge, label %for.body3.preheader
for.body3.preheader: ; preds = %for.cond1.preheader, %middle.block
%count.123.ph = phi i32 [ %count.026, %for.cond1.preheader ], [ %19, %middle.block ]
%Y.022.ph = phi i32 [ 0, %for.cond1.preheader ], [ %n.vec, %middle.block ]
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%count.123 = phi i32 [ %count.2, %for.body3 ], [ %count.123.ph, %for.body3.preheader ]
%Y.022 = phi i32 [ %inc8, %for.body3 ], [ %Y.022.ph, %for.body3.preheader ]
%add = add nuw nsw i32 %Y.022, %X.025
%add4 = add nsw i32 %add, %0
%cmp5.not = icmp sge i32 %add4, %1
%cmp7.not = icmp sle i32 %add, %1
%or.cond.not = and i1 %cmp5.not, %cmp7.not
%inc = zext i1 %or.cond.not to i32
%count.2 = add nsw i32 %count.123, %inc
%inc8 = add nuw i32 %Y.022, 1
%exitcond.not = icmp eq i32 %Y.022, %0
br i1 %exitcond.not, label %for.cond1.for.inc9_crit_edge, label %for.body3, !llvm.loop !13
for.cond1.for.inc9_crit_edge: ; preds = %for.body3, %middle.block
%count.2.lcssa = phi i32 [ %19, %middle.block ], [ %count.2, %for.body3 ]
%inc10 = add nuw i32 %X.025, 1
%exitcond28.not = icmp eq i32 %X.025, %0
br i1 %exitcond28.not, label %for.end11, label %for.cond1.preheader, !llvm.loop !14
for.end11: ; preds = %for.cond1.for.inc9_crit_edge, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %count.2.lcssa, %for.cond1.for.inc9_crit_edge ]
%call12 = 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 %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int top=0;
int S[11];
void push(int x){
top++;
S[top]=x;
}
int pop(){
top--;
return S[top+1];
}
int main(){
int y,t;
while (scanf("%d",&y)!=EOF){
if(y!=0){
push(y);
}else {
t=pop();
printf("%d\n",t);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258189/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258189/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@top = dso_local local_unnamed_addr global i32 0, align 4
@S = dso_local local_unnamed_addr global [11 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push(i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @top, align 4, !tbaa !5
%idxprom = sext i32 %inc to i64
%arrayidx = getelementptr inbounds [11 x i32], ptr @S, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @top, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [11 x i32], ptr @S, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
ret i32 %1
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%cmp.not7 = icmp eq i32 %call6, -1
br i1 %cmp.not7, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%0 = load i32, ptr %y, align 4, !tbaa !5
%cmp1.not = icmp eq i32 %0, 0
%1 = load i32, ptr @top, align 4, !tbaa !5
br i1 %cmp1.not, label %if.else, label %if.then
if.then: ; preds = %while.body
%inc.i = add nsw i32 %1, 1
store i32 %inc.i, ptr @top, align 4, !tbaa !5
%idxprom.i = sext i32 %inc.i to i64
%arrayidx.i = getelementptr inbounds [11 x i32], ptr @S, i64 0, i64 %idxprom.i
store i32 %0, ptr %arrayidx.i, align 4, !tbaa !5
br label %if.end
if.else: ; preds = %while.body
%dec.i = add nsw i32 %1, -1
store i32 %dec.i, ptr @top, align 4, !tbaa !5
%idxprom.i4 = sext i32 %1 to i64
%arrayidx.i5 = getelementptr inbounds [11 x i32], ptr @S, i64 0, i64 %idxprom.i4
%2 = load i32, ptr %arrayidx.i5, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
br label %if.end
if.end: ; preds = %if.else, %if.then
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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(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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 num, top;
int train[1024];
int i;
top = 0;
while (scanf("%d", &num) != EOF){
if (num == 0){
printf("%d\n", train[top - 1]);
train[top - 1] = 0;
top--;
}
else {
train[top] = num;
top++;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258239/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258239/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%num = alloca i32, align 4
%train = alloca [1024 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #3
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %train) #3
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%cmp.not13 = icmp eq i32 %call12, -1
br i1 %cmp.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%top.014 = phi i32 [ %top.1, %if.end ], [ 0, %entry ]
%0 = load i32, ptr %num, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 0
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%sub = add nsw i32 %top.014, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [1024 x i32], ptr %train, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
store i32 0, ptr %arrayidx, align 4, !tbaa !5
br label %if.end
if.else: ; preds = %while.body
%idxprom6 = sext i32 %top.014 to i64
%arrayidx7 = getelementptr inbounds [1024 x i32], ptr %train, i64 0, i64 %idxprom6
store i32 %0, ptr %arrayidx7, align 4, !tbaa !5
%inc = add nsw i32 %top.014, 1
br label %if.end
if.end: ; preds = %if.else, %if.then
%top.1 = phi i32 [ %sub, %if.then ], [ %inc, %if.else ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %train) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
int x;
int train[101];
int i = 0;
while (scanf("%d", &x) != EOF){
if (x == 0){
train[i];
i--;
printf("%d\n", train[i]);
}
else {
train[i] = x;
i++;
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258282/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258282/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%train = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %train) #3
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%cmp.not12 = icmp eq i32 %call11, -1
br i1 %cmp.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%i.013 = phi i32 [ %i.1, %if.end ], [ 0, %entry ]
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 0
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%dec = add nsw i32 %i.013, -1
%idxprom2 = sext i32 %dec to i64
%arrayidx3 = getelementptr inbounds [101 x i32], ptr %train, i64 0, i64 %idxprom2
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
br label %if.end
if.else: ; preds = %while.body
%idxprom5 = sext i32 %i.013 to i64
%arrayidx6 = getelementptr inbounds [101 x i32], ptr %train, i64 0, i64 %idxprom5
store i32 %0, ptr %arrayidx6, align 4, !tbaa !5
%inc = add nsw i32 %i.013, 1
br label %if.end
if.end: ; preds = %if.else, %if.then
%i.1 = phi i32 [ %dec, %if.then ], [ %inc, %if.else ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %train) #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 data[100];
int sp =0;
int empty(){
return sp <= 0;
}
int pop(){
sp--;
return data[sp+1];
}
void push(int v){
sp++;
data[sp] = v;
}
int main(){
int a;
while(scanf("%d",&a) != EOF){
if(a != 0){
push(a);
}else{
if(empty()){
break;
}
printf("%d\n",pop());
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258325/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258325/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@sp = dso_local local_unnamed_addr global i32 0, align 4
@data = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @empty() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @sp, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 1
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop() local_unnamed_addr #1 {
entry:
%0 = load i32, ptr @sp, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @sp, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @data, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
ret i32 %1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push(i32 noundef %v) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr @sp, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @sp, align 4, !tbaa !5
%idxprom = sext i32 %inc to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @data, i64 0, i64 %idxprom
store i32 %v, ptr %arrayidx, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not10 = icmp eq i32 %call9, -1
br i1 %cmp.not10, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end6
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp1.not = icmp eq i32 %0, 0
%1 = load i32, ptr @sp, align 4, !tbaa !5
br i1 %cmp1.not, label %if.else, label %if.then
if.then: ; preds = %while.body
%inc.i = add nsw i32 %1, 1
store i32 %inc.i, ptr @sp, align 4, !tbaa !5
%idxprom.i = sext i32 %inc.i to i64
%arrayidx.i = getelementptr inbounds [100 x i32], ptr @data, i64 0, i64 %idxprom.i
store i32 %0, ptr %arrayidx.i, align 4, !tbaa !5
br label %if.end6
if.else: ; preds = %while.body
%cmp.i = icmp sgt i32 %1, 0
br i1 %cmp.i, label %if.end, label %while.end
if.end: ; preds = %if.else
%dec.i = add nsw i32 %1, -1
store i32 %dec.i, ptr @sp, align 4, !tbaa !5
%idxprom.i7 = zext i32 %1 to i64
%arrayidx.i8 = getelementptr inbounds [100 x i32], ptr @data, i64 0, i64 %idxprom.i7
%2 = load i32, ptr %arrayidx.i8, align 4, !tbaa !5
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
br label %if.end6
if.end6: ; preds = %if.end, %if.then
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end6, %if.else, %entry
call void @llvm.lifetime.end.p0(i64 4, 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) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree 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 #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 x,S[1000],top;
void push(int x)
{
S[++top]=x;
}
int pop()
{
int x=S[top--];
return x;
}
int main(){
int i;
while(scanf("%d",&x)!=EOF)
{
if(x==0)
{
printf("%d\n",S[top]);
pop();
}
else
{
push(x);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258376/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258376/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@S = dso_local local_unnamed_addr global [1000 x i32] zeroinitializer, align 16
@top = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@x = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push(i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @top, align 4, !tbaa !5
%idxprom = sext i32 %inc to i64
%arrayidx = getelementptr inbounds [1000 x i32], ptr @S, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @top, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [1000 x i32], ptr @S, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
ret i32 %1
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
%cmp.not7 = icmp eq i32 %call6, -1
br i1 %cmp.not7, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%0 = load i32, ptr @x, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 0
%1 = load i32, ptr @top, align 4, !tbaa !5
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [1000 x i32], ptr @S, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%3 = load i32, ptr @top, align 4, !tbaa !5
%dec.i = add nsw i32 %3, -1
br label %if.end
if.else: ; preds = %while.body
%inc.i = add nsw i32 %1, 1
%idxprom.i4 = sext i32 %inc.i to i64
%arrayidx.i5 = getelementptr inbounds [1000 x i32], ptr @S, i64 0, i64 %idxprom.i4
store i32 %0, ptr %arrayidx.i5, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.else, %if.then
%inc.i.sink = phi i32 [ %dec.i, %if.then ], [ %inc.i, %if.else ]
store i32 %inc.i.sink, ptr @top, align 4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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;
scanf("%d%d",&n,&m);
if(m>n)
printf("-1");
else if(n==m)
printf("%d",n);
else
{
int two;
int one;
int res,i;
two=n/2;
one=n%2;
res = two+one;
for(i=res;i<=n;i++)
if(i%m==0)
{printf("%d",i);
break;}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25847/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25847/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"-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:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end12
if.else: ; preds = %entry
%cmp2 = icmp eq i32 %1, %0
br i1 %cmp2, label %if.then3, label %if.else5
if.then3: ; preds = %if.else
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %0)
br label %if.end12
if.else5: ; preds = %if.else
%div = sdiv i32 %1, 2
%rem = srem i32 %1, 2
%add = add nsw i32 %div, %rem
%cmp6.not18 = icmp sgt i32 %add, %1
br i1 %cmp6.not18, label %if.end12, label %for.body
for.body: ; preds = %if.else5, %for.inc
%i.019 = phi i32 [ %inc, %for.inc ], [ %add, %if.else5 ]
%rem7 = srem i32 %i.019, %0
%cmp8 = icmp eq i32 %rem7, 0
br i1 %cmp8, label %if.then9, label %for.inc
if.then9: ; preds = %for.body
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.019)
br label %if.end12
for.inc: ; preds = %for.body
%inc = add i32 %i.019, 1
%exitcond.not = icmp eq i32 %i.019, %1
br i1 %exitcond.not, label %if.end12, label %for.body, !llvm.loop !9
if.end12: ; preds = %for.inc, %if.else5, %if.then9, %if.then3, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!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 cars[10] = {0};
int order,i=0;
while( scanf("%d", &order) != EOF ) {
if(order == 0) {
printf("%d\n", cars[i-1]);
cars[i--] = 0;
}
else if(1<=order && order<=10) {
cars[i++] = order;
}
else continue;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258527/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258527/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%cars = alloca [10 x i32], align 16
%order = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %cars) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %cars, i8 0, i64 40, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %order) #4
br label %while.cond.outer
while.cond.outer: ; preds = %if.end11, %entry
%i.0.ph = phi i32 [ %i.1, %if.end11 ], [ 0, %entry ]
br label %while.cond
while.cond: ; preds = %while.cond.outer, %if.else
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %order)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body
while.body: ; preds = %while.cond
%0 = load i32, ptr %order, align 4
%cmp1 = icmp eq i32 %0, 0
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%sub = add nsw i32 %i.0.ph, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [10 x i32], ptr %cars, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
br label %if.end11
if.else: ; preds = %while.body
%or.cond = icmp ult i32 %0, 11
br i1 %or.cond, label %if.then7, label %while.cond, !llvm.loop !9
if.then7: ; preds = %if.else
%inc = add nsw i32 %i.0.ph, 1
br label %if.end11
if.end11: ; preds = %if.then7, %if.then
%.lcssa16.sink = phi i32 [ %0, %if.then7 ], [ 0, %if.then ]
%i.1 = phi i32 [ %inc, %if.then7 ], [ %sub, %if.then ]
%idxprom8 = sext i32 %i.0.ph to i64
%arrayidx9 = getelementptr inbounds [10 x i32], ptr %cars, i64 0, i64 %idxprom8
store i32 %.lcssa16.sink, ptr %arrayidx9, align 4, !tbaa !5
br label %while.cond.outer, !llvm.loop !9
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %order) #4
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %cars) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main(){
int h=0,i;
int b=0,e,p,q,r;
char s[1026];
fgets(s,1026,stdin);
s[strlen(s)-1]='\0';
for(;;){
p=(int)strchr(s+b,' ');
q=(int)strchr(s+b,',');
r=(int)strchr(s+b,'.');
if(p==0&&q==0&&r==0)
e=strlen(s);
else if(p<q&&p<r)
e=(char*)p-s;
else if(q<p&&q<r)
e=(char*)q-s;
else if(r<p&&r<q)
e=(char*)r-s;
if(3<=e-b&&e-b<=6){
if(h)
printf(" ");
h=1;
for(i=0;i<e-b;i++)
printf("%c",s[b+i]);
}
if(e==strlen(s))
break;
b=e+1;
}
puts("");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258578/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258578/source.c"
target datalayout = "e-m:e-p270: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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1026 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1026, ptr nonnull %s) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 1026, ptr noundef %0)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%sub = add i64 %call2, -1
%arrayidx = getelementptr inbounds [1026 x i8], ptr %s, i64 0, i64 %sub
store i8 0, ptr %arrayidx, align 1, !tbaa !9
%sub.ptr.rhs.cast50 = ptrtoint ptr %s to i64
br label %for.cond
for.cond: ; preds = %if.end74, %entry
%e.0 = phi i32 [ undef, %entry ], [ %e.1, %if.end74 ]
%b.0 = phi i32 [ 0, %entry ], [ %add82, %if.end74 ]
%h.0 = phi i32 [ 0, %entry ], [ %h.1, %if.end74 ]
%idx.ext = sext i32 %b.0 to i64
%add.ptr = getelementptr inbounds i8, ptr %s, i64 %idx.ext
%call4 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %add.ptr, i32 noundef 32) #6
%1 = ptrtoint ptr %call4 to i64
%2 = trunc i64 %1 to i32
%call8 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %add.ptr, i32 noundef 44) #6
%3 = ptrtoint ptr %call8 to i64
%4 = trunc i64 %3 to i32
%call12 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %add.ptr, i32 noundef 46) #6
%5 = ptrtoint ptr %call12 to i64
%6 = trunc i64 %5 to i32
%cmp = icmp eq i32 %2, 0
%cmp13 = icmp eq i32 %4, 0
%or.cond = select i1 %cmp, i1 %cmp13, i1 false
%cmp15 = icmp eq i32 %6, 0
%or.cond85 = select i1 %or.cond, i1 %cmp15, i1 false
br i1 %or.cond85, label %if.then, label %if.else
if.then: ; preds = %for.cond
%call17 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call17 to i32
br label %if.end55
if.else: ; preds = %for.cond
%cmp18 = icmp slt i32 %2, %4
%cmp21 = icmp slt i32 %2, %6
%or.cond117 = select i1 %cmp18, i1 %cmp21, i1 false
br i1 %or.cond117, label %if.then23, label %if.else27
if.then23: ; preds = %if.else
%sub.ptr.sub = sub i64 %1, %sub.ptr.rhs.cast50
%conv26 = trunc i64 %sub.ptr.sub to i32
br label %if.end55
if.else27: ; preds = %if.else
%cmp28 = icmp slt i32 %4, %2
%cmp31 = icmp slt i32 %4, %6
%or.cond118 = select i1 %cmp28, i1 %cmp31, i1 false
br i1 %or.cond118, label %if.then33, label %if.else40
if.then33: ; preds = %if.else27
%sub.ptr.sub38 = sub i64 %3, %sub.ptr.rhs.cast50
%conv39 = trunc i64 %sub.ptr.sub38 to i32
br label %if.end55
if.else40: ; preds = %if.else27
%cmp41 = icmp slt i32 %6, %2
%cmp44 = icmp slt i32 %6, %4
%or.cond119 = select i1 %cmp41, i1 %cmp44, i1 false
br i1 %or.cond119, label %if.then46, label %if.end55
if.then46: ; preds = %if.else40
%sub.ptr.sub51 = sub i64 %5, %sub.ptr.rhs.cast50
%conv52 = trunc i64 %sub.ptr.sub51 to i32
br label %if.end55
if.end55: ; preds = %if.then23, %if.else40, %if.then46, %if.then33, %if.then
%e.1 = phi i32 [ %conv, %if.then ], [ %conv26, %if.then23 ], [ %conv39, %if.then33 ], [ %conv52, %if.then46 ], [ %e.0, %if.else40 ]
%sub56 = sub nsw i32 %e.1, %b.0
%7 = add i32 %sub56, -3
%or.cond120 = icmp ult i32 %7, 4
br i1 %or.cond120, label %if.then63, label %if.end74
if.then63: ; preds = %if.end55
%tobool.not = icmp eq i32 %h.0, 0
br i1 %tobool.not, label %for.body.preheader, label %if.then64
if.then64: ; preds = %if.then63
%putchar = call i32 @putchar(i32 32)
br label %for.body.preheader
for.body.preheader: ; preds = %if.then63, %if.then64
%wide.trip.count = zext i32 %sub56 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%8 = add nsw i64 %indvars.iv, %idx.ext
%arrayidx71 = getelementptr inbounds [1026 x i8], ptr %s, i64 0, i64 %8
%9 = load i8, ptr %arrayidx71, align 1, !tbaa !9
%conv72 = sext i8 %9 to i32
%putchar116 = call i32 @putchar(i32 %conv72)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %if.end74, label %for.body, !llvm.loop !10
if.end74: ; preds = %for.body, %if.end55
%h.1 = phi i32 [ %h.0, %if.end55 ], [ 1, %for.body ]
%conv75 = sext i32 %e.1 to i64
%call77 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%cmp78 = icmp eq i64 %call77, %conv75
%add82 = add nsw i32 %e.1, 1
br i1 %cmp78, label %for.end83, label %for.cond
for.end83: ; preds = %if.end74
%putchar115 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 1026, 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strchr(ptr noundef, 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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a[5]={1,5,10,25},b,i,c=0;
scanf("%d\n",&b);
for(i=3;i>=0;i--){
c=c+b/a[i];
b=b%a[i];
}
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258620/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258620/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca i32, align 4
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 %b)
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %b.promoted, 25
%rem = srem i32 %b.promoted, 25
%div.1.lhs.trunc = trunc i32 %rem to i8
%div.113 = sdiv i8 %div.1.lhs.trunc, 10
%div.1.sext = sext i8 %div.113 to i32
%add.1 = add nsw i32 %div, %div.1.sext
%rem.1.lhs.trunc = trunc i32 %rem to i8
%rem.114 = srem i8 %rem.1.lhs.trunc, 10
%div.215 = sdiv i8 %rem.114, 5
%div.2.sext = sext i8 %div.215 to i32
%add.2 = add nsw i32 %add.1, %div.2.sext
%rem.216 = srem i8 %rem.114, 5
%rem.2.sext = sext i8 %rem.216 to i32
%add.3 = add nsw i32 %add.2, %rem.2.sext
store i32 0, ptr %b, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!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 k;
scanf("%d",&k);
while(k--) printf("ACL");
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258664/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258664/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ACL\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%dec3 = add nsw i32 %0, -1
store i32 %dec3, ptr %k, align 4, !tbaa !5
%tobool.not4 = icmp eq i32 %0, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%1 = load i32, ptr %k, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %k, align 4, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
typedef long long ll;
int main() {
int k;
scanf("%d", &k);
for (int i = 0; i < k; i++)
{
printf("ACL");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258707/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258707/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ACL\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %0, 0
br i1 %cmp3, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.04 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%inc = add nuw nsw i32 %i.04, 1
%1 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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>
#define rep(i, n) for (int i = 0; i < n; i = i + 1)
#define array(N, t) (t*)calloc(N, sizeof(t))
#define ll long long
#define INF ((1LL << 62) - (1LL << 31))
#define max(p, q)((p) > (q) ? (p) : (q))
#define min(p, q)((p) < (q) ? (p) : (q))
#define swap(type, a, b) { type temp = a; a = b; b = temp; }
int main() {
int K;
scanf("%d", &K);
rep(i, K) {
printf("ACL");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258750/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258750/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ACL\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %0, 0
br i1 %cmp3, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.04 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%add = add nuw nsw i32 %i.04, 1
%1 = load i32, ptr %K, align 4, !tbaa !5
%cmp = icmp slt i32 %add, %1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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()
{
long a[200000];
long i, j, N;
long sum1 = 0, min = 2000000000,sum2=0;
scanf("%ld", &N);
for (i = 0; i < N; i++)
{
scanf("%ld", &a[i]);
sum1 += a[i];
}
for (i = 0; i < N-1; i++)
{
sum2 += a[i];
if (sum1>2 * sum2)
{
j = sum1 - 2 * sum2;
if (min < j)
min = min;
else
min = j;
}
else
{
j = 2 * sum2 - sum1;
if (min < j)
min = min;
else
min = j;
}
}
printf("%ld", min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258815/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258815/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [200000 x i64], align 16
%N = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp44 = icmp sgt i64 %0, 0
br i1 %cmp44, label %for.body, label %for.end23
for.cond3.preheader: ; preds = %for.body
%cmp448 = icmp sgt i64 %4, 1
br i1 %cmp448, label %for.body5.preheader, label %for.end23
for.body5.preheader: ; preds = %for.cond3.preheader
%1 = add i64 %4, -1
%xtraiter = and i64 %1, 1
%2 = icmp eq i64 %4, 2
br i1 %2, label %for.end23.loopexit.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %1, -2
br label %for.body5
for.body: ; preds = %entry, %for.body
%sum1.046 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%i.045 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %i.045
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i64, ptr %arrayidx, align 8, !tbaa !5
%add = add nsw i64 %3, %sum1.046
%inc = add nuw nsw i64 %i.045, 1
%4 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %4
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.body5: ; preds = %for.body5, %for.body5.preheader.new
%sum2.051 = phi i64 [ 0, %for.body5.preheader.new ], [ %add7.1, %for.body5 ]
%min.050 = phi i64 [ 2000000000, %for.body5.preheader.new ], [ %min.0.sub15.1, %for.body5 ]
%i.149 = phi i64 [ 0, %for.body5.preheader.new ], [ %inc22.1, %for.body5 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.body5 ]
%arrayidx6 = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %i.149
%5 = load i64, ptr %arrayidx6, align 16, !tbaa !5
%add7 = add nsw i64 %5, %sum2.051
%mul = shl nsw i64 %add7, 1
%sub10 = sub nsw i64 %add, %mul
%sub15.sink = call i64 @llvm.abs.i64(i64 %sub10, i1 true)
%min.0.sub15 = call i64 @llvm.smin.i64(i64 %min.050, i64 %sub15.sink)
%inc22 = or i64 %i.149, 1
%arrayidx6.1 = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %inc22
%6 = load i64, ptr %arrayidx6.1, align 8, !tbaa !5
%add7.1 = add nsw i64 %6, %add7
%mul.1 = shl nsw i64 %add7.1, 1
%sub10.1 = sub nsw i64 %add, %mul.1
%sub15.sink.1 = call i64 @llvm.abs.i64(i64 %sub10.1, i1 true)
%min.0.sub15.1 = call i64 @llvm.smin.i64(i64 %min.0.sub15, i64 %sub15.sink.1)
%inc22.1 = add nuw nsw i64 %i.149, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end23.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11
for.end23.loopexit.unr-lcssa: ; preds = %for.body5, %for.body5.preheader
%min.0.sub15.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %min.0.sub15.1, %for.body5 ]
%sum2.051.unr = phi i64 [ 0, %for.body5.preheader ], [ %add7.1, %for.body5 ]
%min.050.unr = phi i64 [ 2000000000, %for.body5.preheader ], [ %min.0.sub15.1, %for.body5 ]
%i.149.unr = phi i64 [ 0, %for.body5.preheader ], [ %inc22.1, %for.body5 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end23, label %for.body5.epil
for.body5.epil: ; preds = %for.end23.loopexit.unr-lcssa
%arrayidx6.epil = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %i.149.unr
%7 = load i64, ptr %arrayidx6.epil, align 8, !tbaa !5
%add7.epil = add nsw i64 %7, %sum2.051.unr
%mul.epil = shl nsw i64 %add7.epil, 1
%sub10.epil = sub nsw i64 %add, %mul.epil
%sub15.sink.epil = call i64 @llvm.abs.i64(i64 %sub10.epil, i1 true)
%min.0.sub15.epil = call i64 @llvm.smin.i64(i64 %min.050.unr, i64 %sub15.sink.epil)
br label %for.end23
for.end23: ; preds = %for.body5.epil, %for.end23.loopexit.unr-lcssa, %entry, %for.cond3.preheader
%min.0.lcssa = phi i64 [ 2000000000, %for.cond3.preheader ], [ 2000000000, %entry ], [ %min.0.sub15.lcssa.ph, %for.end23.loopexit.unr-lcssa ], [ %min.0.sub15.epil, %for.body5.epil ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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>
#define ABS(x) (x>0?(x):(x)*-1)
#define MIN(x,y) ((x<y)?(x):(y))
int main(){
int h,m,c;
double dh,dm;
scanf("%d",&h);
while(scanf("%d:%d",&h,&m)!=EOF){
dm=(double)m/60.0;
dh=(dm+(double)h)/12.0;
c=MIN(ABS(dh*360.0-dm*360.0),
360.0-ABS(dh*360.0-dm*360.0));
if(c<30.0){
printf("alert\n");
}else if(c>=90&&c<=180){
printf("safe\n");
}else{
printf("warning\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258859/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258859/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d:%d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"warning\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@str.6 = private unnamed_addr constant [6 x i8] c"alert\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h)
%call1107 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h, ptr noundef nonnull %m)
%cmp.not108 = icmp eq i32 %call1107, -1
br i1 %cmp.not108, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %m, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%div = fdiv double %conv, 6.000000e+01
%1 = load i32, ptr %h, align 4, !tbaa !5
%conv2 = sitofp i32 %1 to double
%add = fadd double %div, %conv2
%div3 = fdiv double %add, 1.200000e+01
%neg = fmul double %div, -3.600000e+02
%2 = call double @llvm.fmuladd.f64(double %div3, double 3.600000e+02, double %neg)
%cmp5 = fcmp ogt double %2, 0.000000e+00
%mul = fneg double %2
%cond = select i1 %cmp5, double %2, double %mul
%sub = fsub double 3.600000e+02, %cond
%cmp27.inv = fcmp olt double %cond, %sub
%cond65 = select i1 %cmp27.inv, double %cond, double %sub
%conv66 = fptosi double %cond65 to i32
%cmp68 = icmp slt i32 %conv66, 30
%3 = add nsw i32 %conv66, -90
%or.cond = icmp ult i32 %3, 91
%str.5.str = select i1 %or.cond, ptr @str.5, ptr @str
%str.5.sink = select i1 %cmp68, ptr @str.6, ptr %str.5.str
%puts105 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h, ptr noundef nonnull %m)
%cmp.not = icmp eq i32 %call1, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h> // printf(), scanf()
#include <stdbool.h>
#define N_ID 1000
#define MAX_N 4000
typedef struct
{
bool done;
long proceeds;
} sales_t;
int
main(int argc, char **argv)
{
sales_t sales[MAX_N + 1];
int id[N_ID];
int n_id;
int e, p, q;
int n, i;
while (true)
{
scanf("%d", &n);
if (n == 0)
break;
for (i = 0; i <= MAX_N; ++i)
{
sales[i].done = false;
sales[i].proceeds = 0;
}
n_id = 0;
for (i = 0; i < n; ++i)
{
scanf("%d %d %d", &e, &p, &q);
id[n_id++] = e;
sales[e].proceeds += p * q;
}
bool b_none = true;
for (i = 0; i < n_id; ++i)
{
if (sales[id[i]].proceeds >= 1000000 && !sales[id[i]].done)
{
printf("%d\n", id[i]);
sales[id[i]].done = true;
b_none = false;
}
}
if (b_none)
printf("NA\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258916/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258916/source.c"
target datalayout = "e-m:e-p270: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.sales_t = type { i8, i64 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NA\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:
%sales = alloca [4001 x %struct.sales_t], align 16
%id = alloca [1000 x i32], align 16
%e = alloca i32, align 4
%p = alloca i32, align 4
%q = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 64016, ptr nonnull %sales) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %id) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call70 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp71 = icmp eq i32 %0, 0
br i1 %cmp71, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end49
%1 = phi i32 [ %11, %if.end49 ], [ %0, %entry ]
br label %for.body
for.cond4.preheader: ; preds = %for.body
%cmp563 = icmp sgt i32 %1, 0
br i1 %cmp563, label %for.body6, label %if.then47
for.body: ; preds = %for.body.1, %for.cond.preheader
%indvars.iv = phi i64 [ 0, %for.cond.preheader ], [ %indvars.iv.next.1, %for.body.1 ]
%arrayidx = getelementptr inbounds [4001 x %struct.sales_t], ptr %sales, i64 0, i64 %indvars.iv
store i8 0, ptr %arrayidx, align 16, !tbaa !9
%proceeds = getelementptr inbounds [4001 x %struct.sales_t], ptr %sales, i64 0, i64 %indvars.iv, i32 1
store i64 0, ptr %proceeds, align 8, !tbaa !13
%indvars.iv.next = or i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4001
br i1 %exitcond.not, label %for.cond4.preheader, label %for.body.1, !llvm.loop !14
for.body.1: ; preds = %for.body
%arrayidx.1 = getelementptr inbounds [4001 x %struct.sales_t], ptr %sales, i64 0, i64 %indvars.iv.next
store i8 0, ptr %arrayidx.1, align 16, !tbaa !9
%proceeds.1 = getelementptr inbounds [4001 x %struct.sales_t], ptr %sales, i64 0, i64 %indvars.iv.next, i32 1
store i64 0, ptr %proceeds.1, align 8, !tbaa !13
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
br label %for.body
for.cond17.preheader: ; preds = %for.body6
%cmp1866.not = icmp eq i32 %indvars, 0
br i1 %cmp1866.not, label %if.then47, label %for.body20.preheader
for.body20.preheader: ; preds = %for.cond17.preheader
%wide.trip.count = and i64 %indvars.iv.next74, 4294967295
br label %for.body20
for.body6: ; preds = %for.cond4.preheader, %for.body6
%indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body6 ], [ 0, %for.cond4.preheader ]
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %e, ptr noundef nonnull %p, ptr noundef nonnull %q)
%2 = load i32, ptr %e, align 4, !tbaa !5
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%indvars = trunc i64 %indvars.iv.next74 to i32
%arrayidx10 = getelementptr inbounds [1000 x i32], ptr %id, i64 0, i64 %indvars.iv73
store i32 %2, ptr %arrayidx10, align 4, !tbaa !5
%3 = load i32, ptr %p, align 4, !tbaa !5
%4 = load i32, ptr %q, align 4, !tbaa !5
%mul = mul nsw i32 %4, %3
%conv = sext i32 %mul to i64
%idxprom11 = sext i32 %2 to i64
%proceeds13 = getelementptr inbounds [4001 x %struct.sales_t], ptr %sales, i64 0, i64 %idxprom11, i32 1
%5 = load i64, ptr %proceeds13, align 8, !tbaa !13
%add = add nsw i64 %5, %conv
store i64 %add, ptr %proceeds13, align 8, !tbaa !13
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %6, %indvars
br i1 %cmp5, label %for.body6, label %for.cond17.preheader, !llvm.loop !16
for.body20: ; preds = %for.body20.preheader, %for.inc43
%indvars.iv78 = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next79, %for.inc43 ]
%b_none.068 = phi i8 [ 1, %for.body20.preheader ], [ %b_none.1, %for.inc43 ]
%arrayidx22 = getelementptr inbounds [1000 x i32], ptr %id, i64 0, i64 %indvars.iv78
%7 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%idxprom23 = sext i32 %7 to i64
%proceeds25 = getelementptr inbounds [4001 x %struct.sales_t], ptr %sales, i64 0, i64 %idxprom23, i32 1
%8 = load i64, ptr %proceeds25, align 8, !tbaa !13
%cmp26 = icmp sgt i64 %8, 999999
br i1 %cmp26, label %land.lhs.true, label %for.inc43
land.lhs.true: ; preds = %for.body20
%arrayidx24 = getelementptr inbounds [4001 x %struct.sales_t], ptr %sales, i64 0, i64 %idxprom23
%9 = load i8, ptr %arrayidx24, align 16, !tbaa !9, !range !17, !noundef !18
%tobool.not = icmp eq i8 %9, 0
br i1 %tobool.not, label %if.then33, label %for.inc43
if.then33: ; preds = %land.lhs.true
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
store i8 1, ptr %arrayidx24, align 16, !tbaa !9
br label %for.inc43
for.inc43: ; preds = %for.body20, %land.lhs.true, %if.then33
%b_none.1 = phi i8 [ %b_none.068, %land.lhs.true ], [ 0, %if.then33 ], [ %b_none.068, %for.body20 ]
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%exitcond80.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count
br i1 %exitcond80.not, label %for.end45, label %for.body20, !llvm.loop !19
for.end45: ; preds = %for.inc43
%10 = and i8 %b_none.1, 1
%tobool46.not = icmp eq i8 %10, 0
br i1 %tobool46.not, label %if.end49, label %if.then47
if.then47: ; preds = %for.cond4.preheader, %for.cond17.preheader, %for.end45
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end49
if.end49: ; preds = %if.then47, %for.end45
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%11 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %11, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end49, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %id) #4
call void @llvm.lifetime.end.p0(i64 64016, ptr nonnull %sales) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 8}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !15}
|
#include <stdio.h>
#define NUM_MEMBER 4000
int main(void) {
long long int sales[NUM_MEMBER] = {0LL};
int members[NUM_MEMBER] = {0};
char exists[NUM_MEMBER] = {0};
long long int price, num;
int n, i, id, reg;
const char *notfound;
while (1) {
scanf("%d", &n);
if (!n)
break;
for (i = 0; i < NUM_MEMBER; i++) {
sales[i] = 0LL;
members[i] = 0;
exists[i] = 0;
}
reg = 0;
for (i = 0; i < n; i++) {
scanf("%d %lld %lld", &id, &price, &num);
id--;
sales[id] += price * num;
if (!exists[id]) {
exists[id] = 1;
members[reg++] = id;
}
}
notfound = "NA";
for (i = 0; i < reg; i++) {
id = members[i];
if (sales[id] >= 1000000LL) {
printf("%d\n", id+1);
notfound = NULL;
}
}
if (notfound != NULL) {
puts(notfound);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258967/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258967/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%d %lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NA\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%sales = alloca [4000 x i64], align 16
%members = alloca [4000 x i32], align 16
%exists = alloca [4000 x i8], align 16
%price = alloca i64, align 8
%num = alloca i64, align 8
%n = alloca i32, align 4
%id = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 32000, ptr nonnull %sales) #4
call void @llvm.lifetime.start.p0(i64 16000, ptr nonnull %members) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %exists) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %price) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %num) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #4
%call62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not63 = icmp eq i32 %0, 0
br i1 %tobool.not63, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end42
%1 = phi i32 [ %10, %if.end42 ], [ %0, %entry ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32000) %sales, i8 0, i64 32000, i1 false), !tbaa !9
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16000) %members, i8 0, i64 16000, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %exists, i8 0, i64 4000, i1 false), !tbaa !11
%cmp655 = icmp sgt i32 %1, 0
br i1 %cmp655, label %for.body7, label %if.then40
for.cond24.preheader: ; preds = %for.inc21
%cmp2558 = icmp sgt i32 %reg.1, 0
br i1 %cmp2558, label %for.body26.preheader, label %if.then40
for.body26.preheader: ; preds = %for.cond24.preheader
%wide.trip.count = zext i32 %reg.1 to i64
br label %for.body26
for.body7: ; preds = %for.cond.preheader, %for.inc21
%reg.057 = phi i32 [ %reg.1, %for.inc21 ], [ 0, %for.cond.preheader ]
%i.156 = phi i32 [ %inc22, %for.inc21 ], [ 0, %for.cond.preheader ]
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %id, ptr noundef nonnull %price, ptr noundef nonnull %num)
%2 = load i32, ptr %id, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %id, align 4, !tbaa !5
%3 = load i64, ptr %price, align 8, !tbaa !9
%4 = load i64, ptr %num, align 8, !tbaa !9
%mul = mul nsw i64 %4, %3
%idxprom9 = sext i32 %dec to i64
%arrayidx10 = getelementptr inbounds [4000 x i64], ptr %sales, i64 0, i64 %idxprom9
%5 = load i64, ptr %arrayidx10, align 8, !tbaa !9
%add = add nsw i64 %5, %mul
store i64 %add, ptr %arrayidx10, align 8, !tbaa !9
%arrayidx12 = getelementptr inbounds [4000 x i8], ptr %exists, i64 0, i64 %idxprom9
%6 = load i8, ptr %arrayidx12, align 1, !tbaa !11
%tobool13.not = icmp eq i8 %6, 0
br i1 %tobool13.not, label %if.then14, label %for.inc21
if.then14: ; preds = %for.body7
store i8 1, ptr %arrayidx12, align 1, !tbaa !11
%inc17 = add nsw i32 %reg.057, 1
%idxprom18 = sext i32 %reg.057 to i64
%arrayidx19 = getelementptr inbounds [4000 x i32], ptr %members, i64 0, i64 %idxprom18
store i32 %dec, ptr %arrayidx19, align 4, !tbaa !5
br label %for.inc21
for.inc21: ; preds = %for.body7, %if.then14
%reg.1 = phi i32 [ %reg.057, %for.body7 ], [ %inc17, %if.then14 ]
%inc22 = add nuw nsw i32 %i.156, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp slt i32 %inc22, %7
br i1 %cmp6, label %for.body7, label %for.cond24.preheader, !llvm.loop !12
for.body26: ; preds = %for.body26.preheader, %for.inc36
%indvars.iv = phi i64 [ 0, %for.body26.preheader ], [ %indvars.iv.next, %for.inc36 ]
%notfound.060 = phi ptr [ @.str.2, %for.body26.preheader ], [ %notfound.1, %for.inc36 ]
%arrayidx28 = getelementptr inbounds [4000 x i32], ptr %members, i64 0, i64 %indvars.iv
%8 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %8, ptr %id, align 4, !tbaa !5
%idxprom29 = sext i32 %8 to i64
%arrayidx30 = getelementptr inbounds [4000 x i64], ptr %sales, i64 0, i64 %idxprom29
%9 = load i64, ptr %arrayidx30, align 8, !tbaa !9
%cmp31 = icmp sgt i64 %9, 999999
br i1 %cmp31, label %if.then32, label %for.inc36
if.then32: ; preds = %for.body26
%add33 = add nsw i32 %8, 1
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add33)
br label %for.inc36
for.inc36: ; preds = %for.body26, %if.then32
%notfound.1 = phi ptr [ null, %if.then32 ], [ %notfound.060, %for.body26 ]
%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.end38, label %for.body26, !llvm.loop !14
for.end38: ; preds = %for.inc36
%cmp39.not = icmp eq ptr %notfound.1, null
br i1 %cmp39.not, label %if.end42, label %if.then40
if.then40: ; preds = %for.cond.preheader, %for.cond24.preheader, %for.end38
%notfound.0.lcssa70 = phi ptr [ %notfound.1, %for.end38 ], [ @.str.2, %for.cond24.preheader ], [ @.str.2, %for.cond.preheader ]
%call41 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %notfound.0.lcssa70)
br label %if.end42
if.end42: ; preds = %if.then40, %for.end38
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%10 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %10, 0
br i1 %tobool.not, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end42, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %price) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %exists) #4
call void @llvm.lifetime.end.p0(i64 16000, ptr nonnull %members) #4
call void @llvm.lifetime.end.p0(i64 32000, ptr nonnull %sales) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
|
#include <stdio.h>
int main(void){
int d,i,sum;
while(scanf("%d",&d)>0){
sum=0;
for(i=d;i<600;i+=d){
sum+=i*i*d;
}
printf("%d\n",sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259016/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259016/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp13 = icmp sgt i32 %call12, 0
br i1 %cmp13, label %while.body, label %while.end
while.body: ; preds = %entry, %for.end
%0 = load i32, ptr %d, align 4, !tbaa !5
%cmp19 = icmp slt i32 %0, 600
br i1 %cmp19, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%1 = shl i32 %0, 1
%smax = call i32 @llvm.smax.i32(i32 %1, i32 600)
%2 = icmp slt i32 %1, 600
%umin.neg = sext i1 %2 to i32
%3 = select i1 %2, i32 2, i32 1
%4 = add i32 %smax, %umin.neg
%5 = sub i32 %4, %1
%6 = udiv i32 %5, %0
%7 = add i32 %3, %6
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body.preheader20, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %7, -8
%8 = or i32 %n.vec, 1
%ind.end = mul i32 %0, %8
%.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%.splatinsert15 = insertelement <4 x i32> poison, i32 %0, i64 0
%.splat16 = shufflevector <4 x i32> %.splatinsert15, <4 x i32> poison, <4 x i32> zeroinitializer
%9 = mul <4 x i32> %.splat16, <i32 0, i32 1, i32 2, i32 3>
%induction = add <4 x i32> %.splat, %9
%10 = shl i32 %0, 2
%.splatinsert17 = insertelement <4 x i32> poison, i32 %10, i64 0
%.splat18 = shufflevector <4 x i32> %.splatinsert17, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi14 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, %.splat18
%11 = mul <4 x i32> %vec.ind, %broadcast.splat
%12 = mul <4 x i32> %step.add, %broadcast.splat
%13 = mul <4 x i32> %11, %vec.ind
%14 = mul <4 x i32> %12, %step.add
%15 = add <4 x i32> %13, %vec.phi
%16 = add <4 x i32> %14, %vec.phi14
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %step.add, %.splat18
%17 = icmp eq i32 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %16, %15
%18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %7, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader20
for.body.preheader20: ; preds = %for.body.preheader, %middle.block
%sum.011.ph = phi i32 [ 0, %for.body.preheader ], [ %18, %middle.block ]
%i.010.ph = phi i32 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader20, %for.body
%sum.011 = phi i32 [ %add, %for.body ], [ %sum.011.ph, %for.body.preheader20 ]
%i.010 = phi i32 [ %add3, %for.body ], [ %i.010.ph, %for.body.preheader20 ]
%mul = mul i32 %i.010, %0
%mul2 = mul i32 %mul, %i.010
%add = add nsw i32 %mul2, %sum.011
%add3 = add nsw i32 %i.010, %0
%cmp1 = icmp slt i32 %add3, 600
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %while.body
%sum.0.lcssa = phi i32 [ 0, %while.body ], [ %18, %middle.block ], [ %add, %for.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp = icmp sgt i32 %call, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !14
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main()
{
int m,k,n,x,y,f=0,p,l=0;
scanf("%d %d",&n,&m);
p=m;
for(k=1;p<=n;k++)
{
for(x=0;x<=p;x++)
{
if(x+2*(p-x) == n)
{ printf("%d\n",m*k);
f=1;
break;
}
}
if(f==1)
break;
l=k+1;
p=m*l;
}
if(p>n)
printf("-1\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25906/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25906/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #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, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not32 = icmp sgt i32 %0, %1
br i1 %cmp.not32, label %for.end14, label %for.cond1.preheader.preheader
for.cond1.preheader.preheader: ; preds = %entry
%2 = shl i32 %0, 1
%3 = sub i32 %2, %1
%4 = shl i32 %0, 1
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %if.end9
%indvar = phi i32 [ 0, %for.cond1.preheader.preheader ], [ %indvar.next, %if.end9 ]
%p.034 = phi i32 [ %0, %for.cond1.preheader.preheader ], [ %mul11, %if.end9 ]
%k.033 = phi i32 [ 1, %for.cond1.preheader.preheader ], [ %add10, %if.end9 ]
%5 = mul i32 %4, %indvar
%6 = add i32 %3, %5
%umin = call i32 @llvm.umin.i32(i32 %p.034, i32 %6)
%7 = add i32 %umin, 1
%cmp2.not.not30 = icmp slt i32 %p.034, 0
br i1 %cmp2.not.not30, label %if.end9, label %for.body3.preheader
for.body3.preheader: ; preds = %for.cond1.preheader
%8 = shl nuw i32 %p.034, 1
%9 = sub i32 %8, %1
%min.iters.check = icmp ult i32 %7, 17
br i1 %min.iters.check, label %for.body3.preheader42, label %vector.ph
vector.ph: ; preds = %for.body3.preheader
%n.mod.vf = and i32 %7, 15
%10 = icmp eq i32 %n.mod.vf, 0
%11 = select i1 %10, i32 16, i32 %n.mod.vf
%n.vec = sub i32 %7, %11
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%index.next = add nuw i32 %index, 16
%12 = icmp eq i32 %index.next, %n.vec
br i1 %12, label %for.body3.preheader42, label %vector.body, !llvm.loop !9
for.body3.preheader42: ; preds = %vector.body, %for.body3.preheader
%x.031.ph = phi i32 [ 0, %for.body3.preheader ], [ %n.vec, %vector.body ]
br label %for.body3
for.cond1: ; preds = %for.body3
%inc = add nuw i32 %x.031, 1
%exitcond37.not = icmp eq i32 %x.031, %p.034
br i1 %exitcond37.not, label %if.end9, label %for.body3, !llvm.loop !13
for.body3: ; preds = %for.body3.preheader42, %for.cond1
%x.031 = phi i32 [ %inc, %for.cond1 ], [ %x.031.ph, %for.body3.preheader42 ]
%exitcond = icmp eq i32 %x.031, %9
br i1 %exitcond, label %if.then, label %for.cond1
if.then: ; preds = %for.body3
%mul5 = mul nsw i32 %0, %k.033
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul5)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end14
if.end9: ; preds = %for.cond1, %for.cond1.preheader
%add10 = add nuw nsw i32 %k.033, 1
%mul11 = mul nsw i32 %0, %add10
%cmp.not = icmp sgt i32 %mul11, %1
%indvar.next = add i32 %indvar, 1
br i1 %cmp.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !14
for.end14: ; preds = %if.end9, %entry, %if.then
%13 = phi i32 [ %.pre, %if.then ], [ %1, %entry ], [ %1, %if.end9 ]
%p.028 = phi i32 [ %p.034, %if.then ], [ %0, %entry ], [ %mul11, %if.end9 ]
%cmp15 = icmp sgt i32 %p.028, %13
br i1 %cmp15, label %if.then16, label %if.end18
if.then16: ; preds = %for.end14
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end18
if.end18: ; preds = %if.then16, %for.end14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
/*
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0016
Integral
*/
#include <stdio.h>
int main(void)
{
int d,x,i,y,sum;
while (scanf("%d", &d) != EOF){
x = 600 / d;
sum = 0;
for (i = 1; i < x; ++i)
{
y = i * d * i * d * d;
sum += y;
}
printf("%d\n", sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259102/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259102/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not14 = icmp eq i32 %call13, -1
br i1 %cmp.not14, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%0 = load i32, ptr %d, align 4, !tbaa !5
%div = sdiv i32 600, %0
%cmp110 = icmp sgt i32 %div, 1
br i1 %cmp110, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%1 = mul i32 %0, %0
%2 = add nsw i32 %div, -2
%3 = zext i32 %2 to i33
%4 = add nsw i32 %div, -3
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = add nsw i32 %div, -4
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = mul i32 %11, 1431655766
%13 = add i32 %12, -7
%14 = lshr i33 %6, 1
%15 = trunc i33 %14 to i32
%16 = mul i32 %15, 5
%17 = add i32 %13, %16
%18 = shl nuw nsw i32 %div, 2
%19 = add i32 %17, %18
%20 = mul i32 %0, %1
%21 = mul i32 %20, %19
br label %for.end
for.end: ; preds = %for.body.preheader, %while.body
%sum.0.lcssa = phi i32 [ 0, %while.body ], [ %21, %for.body.preheader ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main() {
int N;
int ans;
while (1) {
if (scanf("%d", &N) == EOF)break;
ans = 0;
for (int i = 1; i < 600 / N; i++) {
ans += i * N*i*N*N;
}
printf("%d\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259146/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259146/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%cmp14 = icmp eq i32 %call13, -1
br i1 %cmp14, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.cond.cleanup
%0 = load i32, ptr %N, align 4, !tbaa !5
%div = sdiv i32 600, %0
%cmp110 = icmp sgt i32 %div, 1
br i1 %cmp110, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %for.cond.preheader
%1 = mul i32 %0, %0
%2 = add nsw i32 %div, -2
%3 = zext i32 %2 to i33
%4 = add nsw i32 %div, -3
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = add nsw i32 %div, -4
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = mul i32 %11, 1431655766
%13 = add i32 %12, -7
%14 = lshr i33 %6, 1
%15 = trunc i33 %14 to i32
%16 = mul i32 %15, 5
%17 = add i32 %13, %16
%18 = shl nuw nsw i32 %div, 2
%19 = add i32 %17, %18
%20 = mul i32 %0, %1
%21 = mul i32 %20, %19
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %for.cond.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %21, %for.body.preheader ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%cmp = icmp eq i32 %call, -1
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.cond.cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int i,j,num;
int d[10000]={0},sum;
for(i=0;(scanf("%d",&d[i])==1);i++){}
num=i;
for(i=0;i<num;i++){
sum=0;
for(j=0;j<600;j+=d[i]){
sum+=d[i]*(j*j);
}
printf("%d\n",sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259203/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259203/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%d = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %d) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %d, i8 0, i64 40000, i1 false)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv37 = phi i32 [ %indvars.iv.next38, %for.cond ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %d, i64 0, i64 %indvars.iv
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%cmp = icmp eq i32 %call, 1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next38 = add nuw i32 %indvars.iv37, 1
br i1 %cmp, label %for.cond, label %for.cond1.preheader, !llvm.loop !5
for.cond1.preheader: ; preds = %for.cond
%0 = and i64 %indvars.iv, 4294967295
%cmp231.not = icmp eq i64 %0, 0
br i1 %cmp231.not, label %for.end18, label %for.cond4.preheader.preheader
for.cond4.preheader.preheader: ; preds = %for.cond1.preheader
%wide.trip.count = zext i32 %indvars.iv37 to i64
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.cond4.preheader.preheader, %for.end14
%indvars.iv34 = phi i64 [ 0, %for.cond4.preheader.preheader ], [ %indvars.iv.next35, %for.end14 ]
%arrayidx8 = getelementptr inbounds [10000 x i32], ptr %d, i64 0, i64 %indvars.iv34
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !7
%smax = call i32 @llvm.smax.i32(i32 %1, i32 600)
%2 = add nsw i32 %smax, -1
%3 = udiv i32 %2, %1
%4 = add nuw nsw i32 %3, 1
%min.iters.check = icmp ult i32 %3, 7
br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph
vector.ph: ; preds = %for.cond4.preheader
%n.vec = and i32 %4, -8
%ind.end = mul i32 %n.vec, %1
%.splatinsert = insertelement <4 x i32> poison, i32 %1, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%5 = mul <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
%6 = shl i32 %1, 2
%.splatinsert40 = insertelement <4 x i32> poison, i32 %6, i64 0
%.splat41 = shufflevector <4 x i32> %.splatinsert40, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%vec.phi39 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%vec.ind = phi <4 x i32> [ %5, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, %.splat41
%7 = mul nsw <4 x i32> %vec.ind, %vec.ind
%8 = mul nsw <4 x i32> %step.add, %step.add
%9 = mul nsw <4 x i32> %7, %broadcast.splat
%10 = mul nsw <4 x i32> %8, %broadcast.splat
%11 = add <4 x i32> %9, %vec.phi
%12 = add <4 x i32> %10, %vec.phi39
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %step.add, %.splat41
%13 = icmp eq i32 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %12, %11
%14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %4, %n.vec
br i1 %cmp.n, label %for.end14, label %for.body6.preheader
for.body6.preheader: ; preds = %for.cond4.preheader, %middle.block
%sum.030.ph = phi i32 [ 0, %for.cond4.preheader ], [ %14, %middle.block ]
%j.029.ph = phi i32 [ 0, %for.cond4.preheader ], [ %ind.end, %middle.block ]
br label %for.body6
for.body6: ; preds = %for.body6.preheader, %for.body6
%sum.030 = phi i32 [ %add, %for.body6 ], [ %sum.030.ph, %for.body6.preheader ]
%j.029 = phi i32 [ %add13, %for.body6 ], [ %j.029.ph, %for.body6.preheader ]
%mul = mul nsw i32 %j.029, %j.029
%mul9 = mul nsw i32 %mul, %1
%add = add nsw i32 %mul9, %sum.030
%add13 = add nsw i32 %1, %j.029
%cmp5 = icmp slt i32 %add13, 600
br i1 %cmp5, label %for.body6, label %for.end14, !llvm.loop !14
for.end14: ; preds = %for.body6, %middle.block
%add.lcssa = phi i32 [ %14, %middle.block ], [ %add, %for.body6 ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.lcssa)
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%exitcond.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count
br i1 %exitcond.not, label %for.end18, label %for.cond4.preheader, !llvm.loop !15
for.end18: ; preds = %for.end14, %for.cond1.preheader
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %d) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = 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"}
!11 = distinct !{!11, !6, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !6, !13, !12}
!15 = distinct !{!15, !6}
|
#include <stdio.h>
int main(){
int d,f,i;
while(scanf("%d",&d)!=EOF){
f=0;
for(i=d;i<=600-d;i+=d){
f=f+d*(i*i);
}
printf("%d\n",f);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259311/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259311/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not13 = icmp eq i32 %call12, -1
br i1 %cmp.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%0 = load i32, ptr %d, align 4, !tbaa !5
%sub = sub nsw i32 600, %0
%cmp1.not9 = icmp sgt i32 %0, %sub
br i1 %cmp1.not9, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %while.body
%1 = mul i32 %0, %0
%2 = mul i32 %0, %1
%3 = shl i32 %0, 1
%4 = sub i32 601, %0
%smax = call i32 @llvm.smax.i32(i32 %3, i32 %4)
%5 = icmp slt i32 %3, %4
%umin = zext i1 %5 to i32
%not. = xor i1 %5, true
%6 = sext i1 %not. to i32
%7 = or i32 %3, %umin
%8 = sub i32 %smax, %7
%umax = call i32 @llvm.umax.i32(i32 %0, i32 1)
%9 = udiv i32 %8, %umax
%10 = add i32 %9, %6
%11 = select i1 %5, i32 -1, i32 -2
%12 = add i32 %11, %9
%13 = add i32 %9, %umin
%14 = shl i32 %13, 2
%15 = zext i32 %10 to i33
%16 = zext i32 %12 to i33
%17 = mul i33 %15, %16
%18 = zext i32 %13 to i33
%19 = mul i33 %17, %18
%20 = lshr i33 %19, 1
%21 = trunc i33 %20 to i32
%22 = mul i32 %21, 1431655766
%23 = or i32 %22, 1
%24 = mul i33 %15, %18
%25 = lshr i33 %24, 1
%26 = trunc i33 %25 to i32
%27 = mul i32 %26, 5
%28 = add i32 %23, %27
%29 = add i32 %28, %14
%30 = mul i32 %2, %29
br label %for.end
for.end: ; preds = %for.body.preheader, %while.body
%f.0.lcssa = phi i32 [ 0, %while.body ], [ %30, %for.body.preheader ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %f.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; 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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int x=600;
int d,limt,i;
long a=0,b=0;
while(scanf("%d",&d)!=EOF){
limt=600/d;
a=0;
for(i=0;i<limt;i++){
a+=d*d*i*i*d;
}
printf("%ld\n",a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not14 = icmp eq i32 %call13, -1
br i1 %cmp.not14, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%0 = load i32, ptr %d, align 4, !tbaa !5
%div = sdiv i32 600, %0
%cmp110 = icmp sgt i32 %div, 0
br i1 %cmp110, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%wide.trip.count = zext i32 %div to i64
%xtraiter = and i64 %wide.trip.count, 3
%1 = icmp ult i32 %div, 4
br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%a.011 = phi i64 [ 0, %for.body.preheader.new ], [ %add.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%2 = trunc i64 %indvars.iv to i32
%3 = mul i32 %0, %2
%4 = mul i32 %3, %0
%mul4 = mul i32 %4, %3
%conv = sext i32 %mul4 to i64
%add = add nsw i64 %a.011, %conv
%5 = trunc i64 %indvars.iv to i32
%6 = or i32 %5, 1
%7 = mul i32 %0, %6
%8 = mul i32 %7, %0
%mul4.1 = mul i32 %8, %7
%conv.1 = sext i32 %mul4.1 to i64
%add.1 = add nsw i64 %add, %conv.1
%9 = trunc i64 %indvars.iv to i32
%10 = or i32 %9, 2
%11 = mul i32 %0, %10
%12 = mul i32 %11, %0
%mul4.2 = mul i32 %12, %11
%conv.2 = sext i32 %mul4.2 to i64
%add.2 = add nsw i64 %add.1, %conv.2
%13 = trunc i64 %indvars.iv to i32
%14 = or i32 %13, 3
%15 = mul i32 %0, %14
%16 = mul i32 %15, %0
%mul4.3 = mul i32 %16, %15
%conv.3 = sext i32 %mul4.3 to i64
%add.3 = add nsw i64 %add.2, %conv.3
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.3, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%a.011.unr = phi i64 [ 0, %for.body.preheader ], [ %add.3, %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
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%a.011.epil = phi i64 [ %add.epil, %for.body.epil ], [ %a.011.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%17 = trunc i64 %indvars.iv.epil to i32
%18 = mul i32 %0, %17
%19 = mul i32 %18, %0
%mul4.epil = mul i32 %19, %18
%conv.epil = sext i32 %mul4.epil to i64
%add.epil = add nsw i64 %a.011.epil, %conv.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %while.body
%a.0.lcssa = phi i64 [ 0, %while.body ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %a.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#define MOD 1000000007
#define MAX 1000001
long long int fac[MAX], finv[MAX], inv[MAX];
void init(){
fac[0] = 1;
fac[1] = 1;
finv[0] = 1;
finv[1] = 1;
inv[1] = 1;
for(int i=2; i<MAX; i++){
fac[i] = fac[i-1]*i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
finv[i] = finv[i-1] * inv[i] % MOD;
}
}
long long int combination(long long int n,long long int r){
if(r<0||n<0){
return 0;
}
if(n < r){
return 0;
}
return (fac[n] * (finv[r] * finv[n-r] % MOD)) % MOD;
}
int main(){
long long int x, y;
scanf("%lld%lld", &x, &y);
long long int ans = 0;
init();
if((x+y)%3 == 0){
int a=x, b=0;
while(2*a + b != y){
a -= 2;
b += 1;
}
ans = combination(a+b, a);
}
printf("%lld\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259405/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@fac = dso_local local_unnamed_addr global [1000001 x i64] zeroinitializer, align 16
@finv = dso_local local_unnamed_addr global [1000001 x i64] zeroinitializer, align 16
@inv = dso_local local_unnamed_addr global [1000001 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [9 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(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init() local_unnamed_addr #0 {
entry:
store i64 1, ptr @fac, align 16, !tbaa !5
store i64 1, ptr getelementptr inbounds ([1000001 x i64], ptr @fac, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr @finv, align 16, !tbaa !5
store i64 1, ptr getelementptr inbounds ([1000001 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr getelementptr inbounds ([1000001 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5
br label %for.body
for.cond.cleanup: ; preds = %for.body
ret void
for.body: ; preds = %entry, %for.body
%0 = phi i64 [ 1, %entry ], [ %rem18, %for.body ]
%1 = phi i64 [ 1, %entry ], [ %rem, %for.body ]
%indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %for.body ]
%mul = mul nsw i64 %1, %indvars.iv
%rem = srem i64 %mul, 1000000007
%arrayidx2 = getelementptr inbounds [1000001 x i64], ptr @fac, i64 0, i64 %indvars.iv
store i64 %rem, ptr %arrayidx2, align 8, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%rem3 = urem i32 1000000007, %2
%idxprom4 = zext i32 %rem3 to i64
%arrayidx5 = getelementptr inbounds [1000001 x i64], ptr @inv, i64 0, i64 %idxprom4
%3 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%div = udiv i32 1000000007, %2
%conv6 = zext i32 %div to i64
%mul7 = mul nsw i64 %3, %conv6
%rem8 = srem i64 %mul7, 1000000007
%sub9 = sub nsw i64 1000000007, %rem8
%arrayidx11 = getelementptr inbounds [1000001 x i64], ptr @inv, i64 0, i64 %indvars.iv
store i64 %sub9, ptr %arrayidx11, align 8, !tbaa !5
%mul17 = mul nuw nsw i64 %sub9, %0
%rem18 = urem i64 %mul17, 1000000007
%arrayidx20 = getelementptr inbounds [1000001 x i64], ptr @finv, i64 0, i64 %indvars.iv
store i64 %rem18, ptr %arrayidx20, align 8, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 1000001
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @combination(i64 noundef %n, i64 noundef %r) local_unnamed_addr #2 {
entry:
%0 = or i64 %r, %n
%or.cond.not = icmp slt i64 %0, 0
%cmp2 = icmp slt i64 %n, %r
%or.cond = or i1 %cmp2, %or.cond.not
br i1 %or.cond, label %return, label %if.end4
if.end4: ; preds = %entry
%arrayidx = getelementptr inbounds [1000001 x i64], ptr @fac, i64 0, i64 %n
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx5 = getelementptr inbounds [1000001 x i64], ptr @finv, i64 0, i64 %r
%2 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%sub = sub nsw i64 %n, %r
%arrayidx6 = getelementptr inbounds [1000001 x i64], ptr @finv, i64 0, i64 %sub
%3 = load i64, ptr %arrayidx6, align 8, !tbaa !5
%mul = mul nsw i64 %3, %2
%rem = srem i64 %mul, 1000000007
%mul7 = mul nsw i64 %rem, %1
%rem8 = srem i64 %mul7, 1000000007
br label %return
return: ; preds = %entry, %if.end4
%retval.0 = phi i64 [ %rem8, %if.end4 ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
store i64 1, ptr @fac, align 16, !tbaa !5
store i64 1, ptr getelementptr inbounds ([1000001 x i64], ptr @fac, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr @finv, align 16, !tbaa !5
store i64 1, ptr getelementptr inbounds ([1000001 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr getelementptr inbounds ([1000001 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.body.i, %entry
%0 = phi i64 [ 1, %entry ], [ %rem18.i, %for.body.i ]
%1 = phi i64 [ 1, %entry ], [ %rem.i, %for.body.i ]
%indvars.iv.i = phi i64 [ 2, %entry ], [ %indvars.iv.next.i, %for.body.i ]
%mul.i = mul nsw i64 %indvars.iv.i, %1
%rem.i = srem i64 %mul.i, 1000000007
%arrayidx2.i = getelementptr inbounds [1000001 x i64], ptr @fac, i64 0, i64 %indvars.iv.i
store i64 %rem.i, ptr %arrayidx2.i, align 8, !tbaa !5
%2 = trunc i64 %indvars.iv.i to i32
%rem3.i = urem i32 1000000007, %2
%idxprom4.i = zext i32 %rem3.i to i64
%arrayidx5.i = getelementptr inbounds [1000001 x i64], ptr @inv, i64 0, i64 %idxprom4.i
%3 = load i64, ptr %arrayidx5.i, align 8, !tbaa !5
%div.i = udiv i32 1000000007, %2
%conv6.i = zext i32 %div.i to i64
%mul7.i = mul nsw i64 %3, %conv6.i
%rem8.i = srem i64 %mul7.i, 1000000007
%sub9.i = sub nsw i64 1000000007, %rem8.i
%arrayidx11.i = getelementptr inbounds [1000001 x i64], ptr @inv, i64 0, i64 %indvars.iv.i
store i64 %sub9.i, ptr %arrayidx11.i, align 8, !tbaa !5
%mul17.i = mul nuw nsw i64 %sub9.i, %0
%rem18.i = urem i64 %mul17.i, 1000000007
%arrayidx20.i = getelementptr inbounds [1000001 x i64], ptr @finv, i64 0, i64 %indvars.iv.i
store i64 %rem18.i, ptr %arrayidx20.i, align 8, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, 1000001
br i1 %exitcond.not.i, label %init.exit, label %for.body.i, !llvm.loop !9
init.exit: ; preds = %for.body.i
%4 = load i64, ptr %x, align 8, !tbaa !5
%5 = load i64, ptr %y, align 8, !tbaa !5
%add = add nsw i64 %5, %4
%rem = srem i64 %add, 3
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %init.exit
%conv = trunc i64 %4 to i32
%mul21 = shl nsw i32 %conv, 1
%conv222 = sext i32 %mul21 to i64
%cmp3.not23 = icmp eq i64 %5, %conv222
br i1 %cmp3.not23, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %if.then
%6 = and i64 %4, 4294967295
%7 = mul i64 %5, 6148914691236517205
%8 = add i64 %7, -6148914691236517204
%9 = add i32 %mul21, -4
%10 = sext i32 %9 to i64
%.neg = mul i64 %10, -6148914691236517205
%11 = add i64 %.neg, %8
%min.iters.check = icmp ult i64 %11, 32
br i1 %min.iters.check, label %while.body.preheader35, label %vector.scevcheck
vector.scevcheck: ; preds = %while.body.preheader
%12 = add i32 %mul21, -4
%13 = sub i32 3, %mul21
%14 = sext i32 %13 to i64
%15 = add i64 %5, %14
%16 = mul i64 %15, 6148914691236517205
%17 = trunc i64 %16 to i32
%mul.result = shl i32 %17, 2
%18 = sub i32 %12, %mul.result
%19 = icmp sgt i32 %18, %12
%20 = icmp ugt i64 %16, 1073741823
%21 = or i1 %19, %20
br i1 %21, label %while.body.preheader35, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %11, -16
%22 = shl i64 %n.vec, 1
%ind.end = sub i64 %6, %22
%23 = add nsw i64 %6, -30
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%24 = phi i64 [ %23, %vector.ph ], [ %25, %vector.body ]
%index.next = add nuw i64 %index, 16
%25 = add i64 %24, -32
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%27 = trunc i64 %24 to i32
%28 = add i32 %27, -2
%cmp.n = icmp eq i64 %11, %n.vec
br i1 %cmp.n, label %while.end.loopexit, label %while.body.preheader35
while.body.preheader35: ; preds = %vector.scevcheck, %while.body.preheader, %middle.block
%indvars.iv28.ph = phi i64 [ %6, %vector.scevcheck ], [ %6, %while.body.preheader ], [ %ind.end, %middle.block ]
%indvars.iv.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %while.body.preheader ], [ %n.vec, %middle.block ]
br label %while.body
while.body: ; preds = %while.body.preheader35, %while.body
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %while.body ], [ %indvars.iv28.ph, %while.body.preheader35 ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ %indvars.iv.ph, %while.body.preheader35 ]
%indvars.iv.next29 = add i64 %indvars.iv28, -2
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%29 = trunc i64 %indvars.iv.next29 to i32
%mul = shl nsw i32 %29, 1
%30 = sext i32 %mul to i64
%31 = add nsw i64 %indvars.iv.next, %30
%cmp3.not = icmp eq i64 %5, %31
br i1 %cmp3.not, label %while.end.loopexit, label %while.body, !llvm.loop !14
while.end.loopexit: ; preds = %while.body, %middle.block
%indvars.iv.next.lcssa = phi i64 [ %n.vec, %middle.block ], [ %indvars.iv.next, %while.body ]
%.lcssa = phi i32 [ %28, %middle.block ], [ %29, %while.body ]
%32 = trunc i64 %indvars.iv.next.lcssa to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %if.then
%a.0.lcssa = phi i32 [ %conv, %if.then ], [ %.lcssa, %while.end.loopexit ]
%b.0.lcssa = phi i32 [ 0, %if.then ], [ %32, %while.end.loopexit ]
%add6 = add nsw i32 %b.0.lcssa, %a.0.lcssa
%conv7 = sext i32 %add6 to i64
%conv8 = sext i32 %a.0.lcssa to i64
%33 = or i64 %conv7, %conv8
%or.cond.not.i = icmp slt i64 %33, 0
br i1 %or.cond.not.i, label %if.end, label %if.end4.i
if.end4.i: ; preds = %while.end
%arrayidx.i = getelementptr inbounds [1000001 x i64], ptr @fac, i64 0, i64 %conv7
%34 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%arrayidx5.i16 = getelementptr inbounds [1000001 x i64], ptr @finv, i64 0, i64 %conv8
%35 = load i64, ptr %arrayidx5.i16, align 8, !tbaa !5
%sub.i = sub nsw i64 %conv7, %conv8
%arrayidx6.i = getelementptr inbounds [1000001 x i64], ptr @finv, i64 0, i64 %sub.i
%36 = load i64, ptr %arrayidx6.i, align 8, !tbaa !5
%mul.i17 = mul nsw i64 %36, %35
%rem.i18 = srem i64 %mul.i17, 1000000007
%mul7.i19 = mul nsw i64 %rem.i18, %34
%rem8.i20 = srem i64 %mul7.i19, 1000000007
br label %if.end
if.end: ; preds = %if.end4.i, %while.end, %init.exit
%ans.0 = phi i64 [ 0, %init.exit ], [ %rem8.i20, %if.end4.i ], [ 0, %while.end ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12}
|
#include <stdio.h>
int main(void){
long long p=0;
int n,k,i;
scanf("%d%d",&n,&k);
for(i=0;i<n-1;i++){
p++;
p+=(p-1)/(long long)(k-1);
}
printf("%lld\n",p);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259449/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259449/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 1
br i1 %cmp9, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %k, align 4, !tbaa !5
%sub2 = add nsw i32 %1, -1
%conv = sext i32 %sub2 to i64
%2 = add i32 %0, -1
%xtraiter = and i32 %2, 1
%3 = icmp eq i32 %0, 2
br i1 %3, 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 i32 %2, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%p.010 = phi i64 [ 0, %for.body.lr.ph.new ], [ %add.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%inc = add nsw i64 %p.010, 1
%div = sdiv i64 %p.010, %conv
%add = add nsw i64 %inc, %div
%inc.1 = add nsw i64 %add, 1
%div.1 = sdiv i64 %add, %conv
%add.1 = add nsw i64 %inc.1, %div.1
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %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
%add.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %add.1, %for.body ]
%p.010.unr = phi i64 [ 0, %for.body.lr.ph ], [ %add.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%inc.epil = add nsw i64 %p.010.unr, 1
%div.epil = sdiv i64 %p.010.unr, %conv
%add.epil = add nsw i64 %inc.epil, %div.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%p.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %p.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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"}
|
/* ex4_3
sachiyan */
#include <stdio.h>
int snow(int w, int e); //関数preのプロトタイプ宣言
int main(void){
int west, east; //A,Bの定義
scanf("%d %d", &west, &east); //A,Bの読み取り
printf("%d\n", snow(west, east)); //答えを出力
}
int snow(int w, int e){ //関数preの定義 differenceを引数とする
int pre_east; //pre_eastを定義
int diff, answer; //差と答えの定義
int i; //for内の変数定義
pre_east = 0;
diff = e - w; //高さの差を算出
for(i = 1; i <= diff; i++){
pre_east += i; //差と同じ値まで足し続ける
}
answer = pre_east - e; //関数preを呼び出し、積もる前との高さを比較する
return(answer); //東の塔のもとの高さが分かる
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259492/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259492/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%west = alloca i32, align 4
%east = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %west) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %east) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %west, ptr noundef nonnull %east)
%0 = load i32, ptr %west, align 4, !tbaa !5
%1 = load i32, ptr %east, align 4, !tbaa !5
%cmp.not6.not.i = icmp sgt i32 %1, %0
br i1 %cmp.not6.not.i, label %for.body.preheader.i, label %snow.exit
for.body.preheader.i: ; preds = %entry
%2 = shl i32 %1, 1
%3 = xor i32 %0, -1
%4 = add i32 %1, %3
%5 = zext i32 %4 to i33
%reass.sub = sub i32 %1, %0
%6 = add i32 %reass.sub, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = shl i32 %0, 1
%12 = xor i32 %11, -1
%13 = add i32 %2, %12
%14 = add i32 %13, %10
br label %snow.exit
snow.exit: ; preds = %entry, %for.body.preheader.i
%pre_east.0.lcssa.i = phi i32 [ 0, %entry ], [ %14, %for.body.preheader.i ]
%sub1.i = sub nsw i32 %pre_east.0.lcssa.i, %1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %east) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %west) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @snow(i32 noundef %w, i32 noundef %e) local_unnamed_addr #3 {
entry:
%cmp.not6.not = icmp sgt i32 %e, %w
br i1 %cmp.not6.not, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = shl i32 %e, 1
%1 = xor i32 %w, -1
%2 = add i32 %1, %e
%3 = zext i32 %2 to i33
%4 = add i32 %e, -2
%5 = sub i32 %4, %w
%6 = zext i32 %5 to i33
%7 = mul i33 %3, %6
%8 = lshr i33 %7, 1
%9 = trunc i33 %8 to i32
%10 = add i32 %0, %9
%11 = shl i32 %w, 1
%12 = xor i32 %11, -1
%13 = add i32 %10, %12
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%pre_east.0.lcssa = phi i32 [ 0, %entry ], [ %13, %for.body.preheader ]
%sub1 = sub nsw i32 %pre_east.0.lcssa, %e
ret i32 %sub1
}
; 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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* 4_3
Y_Aizaki */
#include <stdio.h>
/* プロトタイプ宣言 */
int snow(int west_over, int east_over);
int main(void){
int west, east;
scanf("%d%d", &west, &east);
// 西側の塔の露出している高さ、東側の塔の露出している高さ
int snowfall = snow(west, east);
// 積雪量
printf("%d\n", snowfall);
return 0;
}
int snow(int west_over, int east_over){
// 露出している高さを引数にとる
int east_index = east_over - west_over;
// 東側の塔のindexを割り出す
int snowfall = (1 + east_index) * east_index / 2 - east_over;
return snowfall;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259535/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259535/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%west = alloca i32, align 4
%east = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %west) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %east) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %west, ptr noundef nonnull %east)
%0 = load i32, ptr %west, align 4, !tbaa !5
%1 = load i32, ptr %east, align 4, !tbaa !5
%sub.i = sub nsw i32 %1, %0
%add.i = add nsw i32 %sub.i, 1
%mul.i = mul nsw i32 %add.i, %sub.i
%div.i = sdiv i32 %mul.i, 2
%sub1.i = sub nsw i32 %div.i, %1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %east) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %west) #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(none) uwtable
define dso_local i32 @snow(i32 noundef %west_over, i32 noundef %east_over) local_unnamed_addr #3 {
entry:
%sub = sub nsw i32 %east_over, %west_over
%add = add nsw i32 %sub, 1
%mul = mul nsw i32 %add, %sub
%div = sdiv i32 %mul, 2
%sub1 = sub nsw i32 %div, %east_over
ret i32 %sub1
}
; 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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/*ex4_3
ryo_1129*/
#include<stdio.h>
//プロトタイプ宣言
int tall(int n);
int main(void){
//変数宣言
int a,b,talla,ans,difference;
//入力
scanf("%d %d",&a,&b);
//木の差
difference = b-a;
//aの高さを出す。
talla = tall(difference-1);
//積雪量はaの高さ-a
ans = talla-a;
//出力
printf("%d\n",ans);
return 0;
}
//n番目の木の高さを出す関数、等差数列の和
int tall(int n){
int hight;
hight = n*(n+1)/2;
return hight;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259579/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259579/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = xor i32 %1, -1
%sub1 = add i32 %0, %2
%add.i = sub i32 %0, %1
%mul.i = mul nsw i32 %add.i, %sub1
%div.i = sdiv i32 %mul.i, 2
%sub3 = sub nsw i32 %div.i, %1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub3)
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 nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @tall(i32 noundef %n) local_unnamed_addr #3 {
entry:
%add = add nsw i32 %n, 1
%mul = mul nsw i32 %add, %n
%div = sdiv i32 %mul, 2
ret i32 %div
}
; 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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int a, b, height = 0, i;
scanf("%d %d", &a, &b);
for( i = 1; i <= b-a; i++ )
{
height += i;
}
printf("%d\n", height - b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259621/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259621/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not6.not = icmp sgt i32 %0, %1
br i1 %cmp.not6.not, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%2 = shl i32 %0, 1
%3 = xor i32 %1, -1
%4 = add i32 %0, %3
%5 = zext i32 %4 to i33
%6 = add i32 %0, -2
%7 = sub i32 %6, %1
%8 = zext i32 %7 to i33
%9 = mul i33 %5, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %2, %11
%13 = shl i32 %1, 1
%14 = xor i32 %13, -1
%15 = add i32 %12, %14
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%height.0.lcssa = phi i32 [ 0, %entry ], [ %15, %for.body.preheader ]
%sub1 = sub nsw i32 %height.0.lcssa, %0
%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 %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a, b;
scanf("%d %d", &a, &b);
printf("%d\n", (b-a) * (b-a+1) / 2 - b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259665/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259665/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%add = add nsw i32 %sub, 1
%mul = mul nsw i32 %add, %sub
%div = sdiv i32 %mul, 2
%sub2 = sub nsw i32 %div, %0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2)
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"}
|
// b - stone monument
#include <stdio.h>
#define SIZE 999
int main(void){
int h[SIZE] = {};
int i, add = 1;
for(i = 0; i < SIZE; i++){
h[i] += add;
add += (i + 2);
//printf("h[%d] = %d, current add = %d\n", i, h[i], add);
}
int a, b;
scanf("%d %d", &a, &b);
for(i = 0; i < SIZE - 1; i++){
if(h[i + 1] - h[i] == b - a){
printf("%d\n", h[i] - a);
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259715/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259715/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%h = alloca [999 x i32], align 16
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 3996, ptr nonnull %h) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3996) %h, i8 0, i64 3996, i1 false)
br label %for.body
for.body: ; preds = %for.body, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.2, %for.body ]
%add.032 = phi i32 [ 1, %entry ], [ %add3.2, %for.body ]
%arrayidx = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add1 = add nsw i32 %0, %add.032
store i32 %add1, ptr %arrayidx, align 4, !tbaa !5
%1 = trunc i64 %indvars.iv to i32
%2 = add nuw nsw i32 %1, 2
%add3 = add nuw nsw i32 %2, %add.032
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv.next
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add1.1 = add nsw i32 %3, %add3
store i32 %add1.1, ptr %arrayidx.1, align 4, !tbaa !5
%4 = trunc i64 %indvars.iv.next to i32
%5 = add nuw nsw i32 %4, 2
%add3.1 = add nuw nsw i32 %5, %add3
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv.next.1
%6 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%add1.2 = add nsw i32 %6, %add3.1
store i32 %add1.2, ptr %arrayidx.2, align 4, !tbaa !5
%7 = trunc i64 %indvars.iv.next.1 to i32
%8 = add nuw nsw i32 %7, 2
%add3.2 = add nuw nsw i32 %8, %add3.1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 999
br i1 %exitcond.not.2, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%9 = load i32, ptr %b, align 4, !tbaa !5
%10 = load i32, ptr %a, align 4, !tbaa !5
%sub12 = sub nsw i32 %9, %10
br label %for.cond4
for.cond4: ; preds = %for.body6.2, %for.end
%indvars.iv35 = phi i64 [ 0, %for.end ], [ %indvars.iv.next36.2, %for.body6.2 ]
%indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
%arrayidx9 = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv.next36
%11 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv35
%12 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%sub = sub nsw i32 %11, %12
%cmp13 = icmp eq i32 %sub, %sub12
br i1 %cmp13, label %if.then, label %for.body6.1, !llvm.loop !11
for.body6.1: ; preds = %for.cond4
%indvars.iv.next36.1 = add nuw nsw i64 %indvars.iv35, 2
%arrayidx9.1 = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv.next36.1
%13 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%arrayidx11.1 = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv.next36
%14 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%sub.1 = sub nsw i32 %13, %14
%cmp13.1 = icmp eq i32 %sub.1, %sub12
br i1 %cmp13.1, label %if.then, label %for.cond4.2, !llvm.loop !11
for.cond4.2: ; preds = %for.body6.1
%exitcond38.not.2 = icmp eq i64 %indvars.iv.next36.1, 998
br i1 %exitcond38.not.2, label %for.end20, label %for.body6.2
for.body6.2: ; preds = %for.cond4.2
%indvars.iv.next36.2 = add nuw nsw i64 %indvars.iv35, 3
%arrayidx9.2 = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv.next36.2
%15 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5
%arrayidx11.2 = getelementptr inbounds [999 x i32], ptr %h, i64 0, i64 %indvars.iv.next36.1
%16 = load i32, ptr %arrayidx11.2, align 4, !tbaa !5
%sub.2 = sub nsw i32 %15, %16
%cmp13.2 = icmp eq i32 %sub.2, %sub12
br i1 %cmp13.2, label %if.then, label %for.cond4, !llvm.loop !11
if.then: ; preds = %for.body6.2, %for.body6.1, %for.cond4
%.lcssa = phi i32 [ %12, %for.cond4 ], [ %14, %for.body6.1 ], [ %16, %for.body6.2 ]
%sub16 = sub nsw i32 %.lcssa, %10
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub16)
br label %for.end20
for.end20: ; preds = %for.cond4.2, %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 3996, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main (){
int a,b,c,d,high;
scanf("%d %d",&a ,&b);
c=b-a;//takasa
high=0;
for (d=1;d<=c;d++){
high+=d;
}
high-=b;
printf("%d",high);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259759/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259759/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not7.not = icmp sgt i32 %0, %1
br i1 %cmp.not7.not, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%2 = shl i32 %0, 1
%3 = xor i32 %1, -1
%4 = add i32 %0, %3
%5 = zext i32 %4 to i33
%6 = add i32 %0, -2
%7 = sub i32 %6, %1
%8 = zext i32 %7 to i33
%9 = mul i33 %5, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %2, %11
%13 = shl i32 %1, 1
%14 = xor i32 %13, -1
%15 = add i32 %12, %14
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%high.0.lcssa = phi i32 [ 0, %entry ], [ %15, %for.body.preheader ]
%sub1 = sub nsw i32 %high.0.lcssa, %0
%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 %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c,i;
int g = 1;
int z = 0;
scanf("%d %d",&a,&b);
c = b - a ;
for(i = 0;i < c;i++){
z = z + g;
g += 1;
}
printf("%d",z - b );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259801/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259801/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, %1
br i1 %cmp7, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%2 = shl i32 %0, 1
%3 = xor i32 %1, -1
%4 = add i32 %0, %3
%5 = zext i32 %4 to i33
%6 = add i32 %0, -2
%7 = sub i32 %6, %1
%8 = zext i32 %7 to i33
%9 = mul i33 %5, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %2, %11
%13 = shl i32 %1, 1
%14 = xor i32 %13, -1
%15 = add i32 %12, %14
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%z.0.lcssa = phi i32 [ 0, %entry ], [ %15, %for.body.preheader ]
%sub2 = sub nsw i32 %z.0.lcssa, %0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2)
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()
{
long long int n, m;
scanf("%lld %lld", &n, &m);
long long int i;
long long int x[100005], y[100005];
for (i = 0; i < n; i++)
scanf("%lld", &x[i]);
for (i = 0; i < m; i++)
scanf("%lld", &y[i]);
long long int p = 1e9 + 7;
long long int X, Y;
X = Y = 0;
for (i = 0; i < n - 1; i++)
X = (X + (x[i + 1] - x[i]) * (i + 1) * (n - i - 1)) % p;
for (i = 0; i < m - 1; i++)
Y = (Y + (y[i + 1] - y[i]) * (i + 1) * (m - i - 1)) % p;
printf("%lld\n", X * Y % p);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259852/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259852/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
%x = alloca [100005 x i64], align 16
%y = alloca [100005 x i64], align 16
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)
call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %y) #3
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp66 = icmp sgt i64 %0, 0
br i1 %cmp66, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%1 = phi i64 [ %0, %entry ], [ %3, %for.body ]
%2 = load i64, ptr %m, align 8, !tbaa !5
%cmp368 = icmp sgt i64 %2, 0
br i1 %cmp368, label %for.body4, label %for.cond10.preheader
for.body: ; preds = %entry, %for.body
%i.067 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100005 x i64], ptr %x, i64 0, i64 %i.067
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.067, 1
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond10.preheader.loopexit: ; preds = %for.body4
%.pre = load i64, ptr %n, align 8, !tbaa !5
br label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.cond10.preheader.loopexit, %for.cond2.preheader
%4 = phi i64 [ %1, %for.cond2.preheader ], [ %.pre, %for.cond10.preheader.loopexit ]
%.lcssa = phi i64 [ %2, %for.cond2.preheader ], [ %7, %for.cond10.preheader.loopexit ]
%cmp1170 = icmp sgt i64 %4, 1
br i1 %cmp1170, label %for.body12.preheader, label %for.cond24.preheader
for.body12.preheader: ; preds = %for.cond10.preheader
%.pre80 = load i64, ptr %x, align 16, !tbaa !5
%5 = add i64 %4, -1
%xtraiter = and i64 %5, 1
%6 = icmp eq i64 %4, 2
br i1 %6, label %for.cond24.preheader.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %5, -2
br label %for.body12
for.body4: ; preds = %for.cond2.preheader, %for.body4
%i.169 = phi i64 [ %inc8, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx5 = getelementptr inbounds [100005 x i64], ptr %y, i64 0, i64 %i.169
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%inc8 = add nuw nsw i64 %i.169, 1
%7 = load i64, ptr %m, align 8, !tbaa !5
%cmp3 = icmp slt i64 %inc8, %7
br i1 %cmp3, label %for.body4, label %for.cond10.preheader.loopexit, !llvm.loop !11
for.cond24.preheader.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body12.preheader ], [ %rem.1, %for.body12 ]
%.unr = phi i64 [ %.pre80, %for.body12.preheader ], [ %15, %for.body12 ]
%X.072.unr = phi i64 [ 0, %for.body12.preheader ], [ %rem.1, %for.body12 ]
%i.271.unr = phi i64 [ 0, %for.body12.preheader ], [ %add.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond24.preheader, label %for.body12.epil
for.body12.epil: ; preds = %for.cond24.preheader.loopexit.unr-lcssa
%add.epil = add nuw nsw i64 %i.271.unr, 1
%arrayidx13.epil = getelementptr inbounds [100005 x i64], ptr %x, i64 0, i64 %add.epil
%8 = load i64, ptr %arrayidx13.epil, align 8, !tbaa !5
%sub15.epil = sub nsw i64 %8, %.unr
%9 = xor i64 %i.271.unr, -1
%sub18.epil = add i64 %4, %9
%mul.epil = mul i64 %sub18.epil, %add.epil
%mul19.epil = mul i64 %mul.epil, %sub15.epil
%add20.epil = add nsw i64 %mul19.epil, %X.072.unr
%rem.epil = srem i64 %add20.epil, 1000000007
br label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.body12.epil, %for.cond24.preheader.loopexit.unr-lcssa, %for.cond10.preheader
%X.0.lcssa = phi i64 [ 0, %for.cond10.preheader ], [ %rem.lcssa.ph, %for.cond24.preheader.loopexit.unr-lcssa ], [ %rem.epil, %for.body12.epil ]
%cmp2674 = icmp sgt i64 %.lcssa, 1
br i1 %cmp2674, label %for.body27.preheader, label %for.end41
for.body27.preheader: ; preds = %for.cond24.preheader
%.pre81 = load i64, ptr %y, align 16, !tbaa !5
%10 = add i64 %.lcssa, -1
%xtraiter89 = and i64 %10, 1
%11 = icmp eq i64 %.lcssa, 2
br i1 %11, label %for.end41.loopexit.unr-lcssa, label %for.body27.preheader.new
for.body27.preheader.new: ; preds = %for.body27.preheader
%unroll_iter93 = and i64 %10, -2
br label %for.body27
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%12 = phi i64 [ %.pre80, %for.body12.preheader.new ], [ %15, %for.body12 ]
%X.072 = phi i64 [ 0, %for.body12.preheader.new ], [ %rem.1, %for.body12 ]
%i.271 = phi i64 [ 0, %for.body12.preheader.new ], [ %add.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%add = or i64 %i.271, 1
%arrayidx13 = getelementptr inbounds [100005 x i64], ptr %x, i64 0, i64 %add
%13 = load i64, ptr %arrayidx13, align 8, !tbaa !5
%sub15 = sub nsw i64 %13, %12
%14 = xor i64 %i.271, -1
%sub18 = add i64 %4, %14
%mul = mul i64 %sub18, %add
%mul19 = mul i64 %mul, %sub15
%add20 = add nsw i64 %mul19, %X.072
%rem = srem i64 %add20, 1000000007
%add.1 = add nuw nsw i64 %i.271, 2
%arrayidx13.1 = getelementptr inbounds [100005 x i64], ptr %x, i64 0, i64 %add.1
%15 = load i64, ptr %arrayidx13.1, align 16, !tbaa !5
%sub15.1 = sub nsw i64 %15, %13
%16 = xor i64 %i.271, -2
%sub18.1 = add i64 %4, %16
%mul.1 = mul i64 %sub18.1, %add.1
%mul19.1 = mul i64 %mul.1, %sub15.1
%add20.1 = add nsw i64 %mul19.1, %rem
%rem.1 = srem i64 %add20.1, 1000000007
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond24.preheader.loopexit.unr-lcssa, label %for.body12, !llvm.loop !12
for.body27: ; preds = %for.body27, %for.body27.preheader.new
%17 = phi i64 [ %.pre81, %for.body27.preheader.new ], [ %20, %for.body27 ]
%Y.076 = phi i64 [ 0, %for.body27.preheader.new ], [ %rem38.1, %for.body27 ]
%i.375 = phi i64 [ 0, %for.body27.preheader.new ], [ %add28.1, %for.body27 ]
%niter94 = phi i64 [ 0, %for.body27.preheader.new ], [ %niter94.next.1, %for.body27 ]
%add28 = or i64 %i.375, 1
%arrayidx29 = getelementptr inbounds [100005 x i64], ptr %y, i64 0, i64 %add28
%18 = load i64, ptr %arrayidx29, align 8, !tbaa !5
%sub31 = sub nsw i64 %18, %17
%19 = xor i64 %i.375, -1
%sub35 = add i64 %.lcssa, %19
%mul33 = mul i64 %sub35, %add28
%mul36 = mul i64 %mul33, %sub31
%add37 = add nsw i64 %mul36, %Y.076
%rem38 = srem i64 %add37, 1000000007
%add28.1 = add nuw nsw i64 %i.375, 2
%arrayidx29.1 = getelementptr inbounds [100005 x i64], ptr %y, i64 0, i64 %add28.1
%20 = load i64, ptr %arrayidx29.1, align 16, !tbaa !5
%sub31.1 = sub nsw i64 %20, %18
%21 = xor i64 %i.375, -2
%sub35.1 = add i64 %.lcssa, %21
%mul33.1 = mul i64 %sub35.1, %add28.1
%mul36.1 = mul i64 %mul33.1, %sub31.1
%add37.1 = add nsw i64 %mul36.1, %rem38
%rem38.1 = srem i64 %add37.1, 1000000007
%niter94.next.1 = add i64 %niter94, 2
%niter94.ncmp.1 = icmp eq i64 %niter94.next.1, %unroll_iter93
br i1 %niter94.ncmp.1, label %for.end41.loopexit.unr-lcssa, label %for.body27, !llvm.loop !13
for.end41.loopexit.unr-lcssa: ; preds = %for.body27, %for.body27.preheader
%rem38.lcssa.ph = phi i64 [ undef, %for.body27.preheader ], [ %rem38.1, %for.body27 ]
%.unr90 = phi i64 [ %.pre81, %for.body27.preheader ], [ %20, %for.body27 ]
%Y.076.unr = phi i64 [ 0, %for.body27.preheader ], [ %rem38.1, %for.body27 ]
%i.375.unr = phi i64 [ 0, %for.body27.preheader ], [ %add28.1, %for.body27 ]
%lcmp.mod91.not = icmp eq i64 %xtraiter89, 0
br i1 %lcmp.mod91.not, label %for.end41, label %for.body27.epil
for.body27.epil: ; preds = %for.end41.loopexit.unr-lcssa
%add28.epil = add nuw nsw i64 %i.375.unr, 1
%arrayidx29.epil = getelementptr inbounds [100005 x i64], ptr %y, i64 0, i64 %add28.epil
%22 = load i64, ptr %arrayidx29.epil, align 8, !tbaa !5
%sub31.epil = sub nsw i64 %22, %.unr90
%23 = xor i64 %i.375.unr, -1
%sub35.epil = add i64 %.lcssa, %23
%mul33.epil = mul i64 %sub35.epil, %add28.epil
%mul36.epil = mul i64 %mul33.epil, %sub31.epil
%add37.epil = add nsw i64 %mul36.epil, %Y.076.unr
%rem38.epil = srem i64 %add37.epil, 1000000007
br label %for.end41
for.end41: ; preds = %for.body27.epil, %for.end41.loopexit.unr-lcssa, %for.cond24.preheader
%Y.0.lcssa = phi i64 [ 0, %for.cond24.preheader ], [ %rem38.lcssa.ph, %for.end41.loopexit.unr-lcssa ], [ %rem38.epil, %for.body27.epil ]
%mul42 = mul nsw i64 %Y.0.lcssa, %X.0.lcssa
%rem43 = srem i64 %mul42, 1000000007
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %rem43)
call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
typedef int32_t i32;
typedef int64_t i64;
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ALLOC(size,type) ((type*)calloc((size),sizeof(type)))
#define SORT(a,num,cmp) qsort((a),(num),sizeof(*(a)),cmp)
int cmp_int (const void *a, const void *b) {
i32 d = *(i32 *)a - *(i32 *)b;
return d == 0 ? 0 : d < 0 ? -1 : 1;
}
void run (void) {
i32 n, a, b;
scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &n, &a, &b);
i32 *x = ALLOC (n, i32);
for (i32 i = 0; i < n; ++i) {
scanf ("%" SCNi32, x + i);
}
i32 *d = ALLOC (n - 1, i32);
for (i32 i = 0; i < n - 1; ++i) {
d[i] = x[i + 1] - x[i];
}
SORT (d, n - 1, cmp_int);
i64 min = (i64) (n - 1) * b;
i64 sum = 0;
for (i32 i = 0; i < n - 1; ++i) {
sum += d[i];
i64 v = sum * a + (i64) (n - 2 - i) * b;
min = MIN (min, v);
}
printf ("%" PRIi64 "\n", min);
}
int main (void) {
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259917/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259917/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%i%i%i\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%i\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%li\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_int(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 eq i32 %0, %1
%cmp1 = icmp slt i32 %0, %1
%cond = select i1 %cmp1, i32 -1, i32 1
%cond2 = select i1 %cmp, i32 0, i32 %cond
ret i32 %cond2
}
; 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 void @run() local_unnamed_addr #2 {
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) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #8
%cmp68 = icmp sgt i32 %0, 0
br i1 %cmp68, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %11, %for.body ]
%sub = add nsw i32 %.lcssa, -1
%conv4 = sext i32 %sub to i64
%call5 = call noalias ptr @calloc(i64 noundef %conv4, i64 noundef 4) #8
%cmp970 = icmp sgt i32 %.lcssa, 1
br i1 %cmp970, label %for.body12.preheader, label %for.cond.cleanup11
for.body12.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %call1, align 4, !tbaa !5
%min.iters.check = icmp ult i32 %.lcssa, 9
br i1 %min.iters.check, label %for.body12.preheader90, label %vector.ph
vector.ph: ; preds = %for.body12.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load89, %vector.body ]
%1 = or i64 %index, 1
%2 = getelementptr inbounds i32, ptr %call1, i64 %1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load89 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%5 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load89, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = sub nsw <4 x i32> %wide.load, %4
%7 = sub nsw <4 x i32> %wide.load89, %5
%8 = getelementptr inbounds i32, ptr %call5, i64 %index
store <4 x i32> %6, ptr %8, align 4, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
store <4 x i32> %7, ptr %9, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load89, i64 3
br i1 %cmp.n, label %for.cond.cleanup11, label %for.body12.preheader90
for.body12.preheader90: ; preds = %for.body12.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body12.preheader ]
%indvars.iv79.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body12.preheader ]
br label %for.body12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup11: ; preds = %for.body12, %middle.block, %for.cond.cleanup
call void @qsort(ptr noundef %call5, i64 noundef %conv4, i64 noundef 4, ptr noundef nonnull @cmp_int) #7
%13 = load i32, ptr %n, align 4, !tbaa !5
%sub23 = add i32 %13, -1
%conv24 = sext i32 %sub23 to i64
%14 = load i32, ptr %b, align 4, !tbaa !5
%conv25 = sext i32 %14 to i64
%mul = mul nsw i64 %conv24, %conv25
%cmp2972 = icmp sgt i32 %13, 1
br i1 %cmp2972, label %for.body32.lr.ph, label %for.cond.cleanup31
for.body32.lr.ph: ; preds = %for.cond.cleanup11
%15 = load i32, ptr %a, align 4, !tbaa !5
%conv37 = sext i32 %15 to i64
%sub39 = add nsw i32 %13, -2
%wide.trip.count85 = zext i32 %sub23 to i64
%xtraiter = and i64 %wide.trip.count85, 1
%16 = icmp eq i32 %sub23, 1
br i1 %16, label %for.cond.cleanup31.loopexit.unr-lcssa, label %for.body32.lr.ph.new
for.body32.lr.ph.new: ; preds = %for.body32.lr.ph
%unroll_iter = and i64 %wide.trip.count85, 4294967294
br label %for.body32
for.body12: ; preds = %for.body12.preheader90, %for.body12
%scalar.recur = phi i32 [ %17, %for.body12 ], [ %scalar.recur.ph, %for.body12.preheader90 ]
%indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body12 ], [ %indvars.iv79.ph, %for.body12.preheader90 ]
%indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next80
%17 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub15 = sub nsw i32 %17, %scalar.recur
%arrayidx17 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv79
store i32 %sub15, ptr %arrayidx17, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup11, label %for.body12, !llvm.loop !14
for.cond.cleanup31.loopexit.unr-lcssa: ; preds = %for.body32, %for.body32.lr.ph
%cond.lcssa.ph = phi i64 [ undef, %for.body32.lr.ph ], [ %cond.1, %for.body32 ]
%indvars.iv82.unr = phi i64 [ 0, %for.body32.lr.ph ], [ %indvars.iv.next83.1, %for.body32 ]
%sum.074.unr = phi i64 [ 0, %for.body32.lr.ph ], [ %add36.1, %for.body32 ]
%min.073.unr = phi i64 [ %mul, %for.body32.lr.ph ], [ %cond.1, %for.body32 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup31, label %for.body32.epil
for.body32.epil: ; preds = %for.cond.cleanup31.loopexit.unr-lcssa
%arrayidx34.epil = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv82.unr
%18 = load i32, ptr %arrayidx34.epil, align 4, !tbaa !5
%conv35.epil = sext i32 %18 to i64
%add36.epil = add nsw i64 %sum.074.unr, %conv35.epil
%mul38.epil = mul nsw i64 %add36.epil, %conv37
%19 = trunc i64 %indvars.iv82.unr to i32
%sub40.epil = sub i32 %sub39, %19
%conv41.epil = sext i32 %sub40.epil to i64
%mul43.epil = mul nsw i64 %conv41.epil, %conv25
%add44.epil = add nsw i64 %mul38.epil, %mul43.epil
%cond.epil = call i64 @llvm.smin.i64(i64 %min.073.unr, i64 %add44.epil)
br label %for.cond.cleanup31
for.cond.cleanup31: ; preds = %for.body32.epil, %for.cond.cleanup31.loopexit.unr-lcssa, %for.cond.cleanup11
%min.0.lcssa = phi i64 [ %mul, %for.cond.cleanup11 ], [ %cond.lcssa.ph, %for.cond.cleanup31.loopexit.unr-lcssa ], [ %cond.epil, %for.body32.epil ]
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret void
for.body32: ; preds = %for.body32, %for.body32.lr.ph.new
%indvars.iv82 = phi i64 [ 0, %for.body32.lr.ph.new ], [ %indvars.iv.next83.1, %for.body32 ]
%sum.074 = phi i64 [ 0, %for.body32.lr.ph.new ], [ %add36.1, %for.body32 ]
%min.073 = phi i64 [ %mul, %for.body32.lr.ph.new ], [ %cond.1, %for.body32 ]
%niter = phi i64 [ 0, %for.body32.lr.ph.new ], [ %niter.next.1, %for.body32 ]
%arrayidx34 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv82
%20 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%conv35 = sext i32 %20 to i64
%add36 = add nsw i64 %sum.074, %conv35
%mul38 = mul nsw i64 %add36, %conv37
%21 = trunc i64 %indvars.iv82 to i32
%sub40 = sub i32 %sub39, %21
%conv41 = sext i32 %sub40 to i64
%mul43 = mul nsw i64 %conv41, %conv25
%add44 = add nsw i64 %mul38, %mul43
%cond = call i64 @llvm.smin.i64(i64 %min.073, i64 %add44)
%indvars.iv.next83 = or i64 %indvars.iv82, 1
%arrayidx34.1 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv.next83
%22 = load i32, ptr %arrayidx34.1, align 4, !tbaa !5
%conv35.1 = sext i32 %22 to i64
%add36.1 = add nsw i64 %add36, %conv35.1
%mul38.1 = mul nsw i64 %add36.1, %conv37
%23 = trunc i64 %indvars.iv.next83 to i32
%sub40.1 = sub i32 %sub39, %23
%conv41.1 = sext i32 %sub40.1 to i64
%mul43.1 = mul nsw i64 %conv41.1, %conv25
%add44.1 = add nsw i64 %mul38.1, %mul43.1
%cond.1 = call i64 @llvm.smin.i64(i64 %cond, i64 %add44.1)
%indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 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.cleanup31.loopexit.unr-lcssa, label %for.body32, !llvm.loop !15
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
tail call void @run()
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main()
{
char a;
scanf("%c",&a);
printf("%c",a+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259960/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%putchar = call i32 @putchar(i32 %add)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
char a;
scanf("%c", &a);
printf("%c", a + 1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260001/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260001/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%putchar = call i32 @putchar(i32 %add)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int i;
while(scanf("%c",&i)!=EOF)
{
if(i>=97&&i<122)
{
printf("%c",i+1);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260045/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260045/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%cmp.not5 = icmp eq i32 %call4, -1
br i1 %cmp.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%0 = load i32, ptr %i, align 4
%1 = add i32 %0, -97
%or.cond = icmp ult i32 %1, 25
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %while.body
%add = add nuw nsw i32 %0, 1
%putchar = call i32 @putchar(i32 %add)
br label %if.end
if.end: ; preds = %if.then, %while.body
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
char c[3];
scanf("%s",c);
c[0]++;
printf("%s",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260089/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260089/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !5
%inc = add i8 %0, 1
store i8 %inc, ptr %c, align 1, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %c)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %c) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
char ch;
scanf("%c",&ch);
if(ch>=97&&ch<=122){
ch=ch+1;
printf("%c",ch);
}
getchar();
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260131/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260131/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%0 = load i8, ptr %ch, align 1
%1 = add i8 %0, -97
%or.cond = icmp ult i8 %1, 26
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %entry
%add = add nuw nsw i8 %0, 1
store i8 %add, ptr %ch, align 1, !tbaa !5
%conv7 = zext i8 %add to i32
%putchar = call i32 @putchar(i32 %conv7)
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = load ptr, ptr @stdin, align 8, !tbaa !8
%call.i = call i32 @getc(ptr noundef %2)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
|
#include<stdio.h>
int main()
{
char a;
scanf("%c",&a);
a++;
printf("%c",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260218/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260218/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%inc = add i8 %0, 1
store i8 %inc, ptr %a, align 1, !tbaa !5
%conv = sext i8 %inc to i32
%putchar = call i32 @putchar(i32 %conv)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
char alpha;
scanf("%c", &alpha);
if (alpha == 'z')
printf("a\n");
else
printf("%c\n", alpha + 1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260261/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260261/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"a\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%alpha = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %alpha) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %alpha)
%0 = load i8, ptr %alpha, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 122
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
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %alpha) #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
//char n[]={'a','b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
char m = 'n';
int ans;
scanf("%c",&m);
/*for (int i = 0; i < 26; i++) {
if (m == n[i]) ans = i;
}*/
m = m + 1;
printf("%c",m);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260304/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260304/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %m) #4
store i8 110, ptr %m, align 1, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i8, ptr %m, align 1, !tbaa !5
%add = add i8 %0, 1
store i8 %add, ptr %m, align 1, !tbaa !5
%conv2 = sext i8 %add to i32
%putchar = call i32 @putchar(i32 %conv2)
call void @llvm.lifetime.end.p0(i64 1, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
char C[1];
scanf("%s", C);
C[0]++;
printf("%s", C);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260348/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260348/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%C = alloca [1 x i8], align 1
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 %C)
%0 = load i8, ptr %C, align 1, !tbaa !5
%inc = add i8 %0, 1
store i8 %inc, ptr %C, align 1, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %C)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %C) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.