Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
int n;
long long a[100000], b[100000];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%lld", a + i);
}
for (int i = 0; i < n; i++) {
printf("%lld ", a[i] + (i + 1 < n ? a[i + 1] : 0));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19066/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19066/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@a = dso_local global [100000 x i64] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1
@b = dso_local local_unnamed_addr global [100000 x i64] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp424 = icmp sgt i32 %1, 0
br i1 %cmp424, label %for.body6, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i64, ptr @a, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %cond.end, %entry, %for.cond3.preheader
ret i32 0
for.body6: ; preds = %for.cond3.preheader, %cond.end
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %cond.end ], [ 0, %for.cond3.preheader ]
%3 = phi i32 [ %7, %cond.end ], [ %1, %for.cond3.preheader ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv27
%4 = load i64, ptr %arrayidx, align 8, !tbaa !11
%indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1
%5 = sext i32 %3 to i64
%cmp7 = icmp slt i64 %indvars.iv.next28, %5
br i1 %cmp7, label %cond.true, label %cond.end
cond.true: ; preds = %for.body6
%arrayidx10 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv.next28
%6 = load i64, ptr %arrayidx10, align 8, !tbaa !11
br label %cond.end
cond.end: ; preds = %for.body6, %cond.true
%cond = phi i64 [ %6, %cond.true ], [ 0, %for.body6 ]
%add11 = add nsw i64 %cond, %4
%call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add11)
%7 = load i32, ptr @n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next28, %8
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !13
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#include<string.h>
#include<string.h>
int main()
{
int n,i;
scanf ("%d",&n);
int a[n],j,b[n];
for (i=0;i<n;i++)
{scanf("%d",&a[i]);}
for (i=0;i<n-1;i++)
{b[i]=a[i]+a[i+1];}
b[n-1]=a[n-1];
for (i=0;i<n;i++)
printf("%d ",b[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19071/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp41 = icmp sgt i32 %3, 0
br i1 %cmp41, label %for.body, label %for.end30
for.cond3.preheader: ; preds = %for.body
%sub = add i32 %15, -1
%cmp443 = icmp sgt i32 %15, 1
br i1 %cmp443, label %for.body5.preheader, label %for.end15
for.body5.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%min.iters.check = icmp ult i32 %15, 9
br i1 %min.iters.check, label %for.body5.preheader65, label %vector.ph
vector.ph: ; preds = %for.body5.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.load64, %vector.body ]
%5 = or i64 %index, 1
%6 = getelementptr inbounds i32, ptr %vla, i64 %5
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load64 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%9 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load64, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = add nsw <4 x i32> %wide.load, %8
%11 = add nsw <4 x i32> %wide.load64, %9
%12 = getelementptr inbounds i32, ptr %vla1, i64 %index
store <4 x i32> %10, ptr %12, align 16, !tbaa !5
%13 = getelementptr inbounds i32, ptr %12, i64 4
store <4 x i32> %11, ptr %13, align 16, !tbaa !5
%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 !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load64, i64 3
br i1 %cmp.n, label %for.end15, label %for.body5.preheader65
for.body5.preheader65: ; preds = %for.body5.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body5.preheader ]
%indvars.iv50.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body5.preheader ]
br label %for.body5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp = icmp slt i64 %indvars.iv.next, %16
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !13
for.body5: ; preds = %for.body5.preheader65, %for.body5
%scalar.recur = phi i32 [ %17, %for.body5 ], [ %scalar.recur.ph, %for.body5.preheader65 ]
%indvars.iv50 = phi i64 [ %indvars.iv.next51, %for.body5 ], [ %indvars.iv50.ph, %for.body5.preheader65 ]
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next51
%17 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%add10 = add nsw i32 %17, %scalar.recur
%arrayidx12 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv50
store i32 %add10, ptr %arrayidx12, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count
br i1 %exitcond.not, label %for.end15, label %for.body5, !llvm.loop !14
for.end15: ; preds = %for.body5, %middle.block, %for.cond3.preheader
%idxprom17 = sext i32 %sub to i64
%arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %idxprom17
%18 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%arrayidx21 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom17
store i32 %18, ptr %arrayidx21, align 4, !tbaa !5
%cmp2346 = icmp sgt i32 %15, 0
br i1 %cmp2346, label %for.body24, label %for.end30
for.body24: ; preds = %for.end15, %for.body24
%indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body24 ], [ 0, %for.end15 ]
%arrayidx26 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv53
%19 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19)
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%20 = load i32, ptr %n, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp23 = icmp slt i64 %indvars.iv.next54, %21
br i1 %cmp23, label %for.body24, label %for.end30, !llvm.loop !15
for.end30: ; preds = %for.body24, %entry, %for.end15
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !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(void)
{
long long int a,b,k;
scanf("%ld",&a);
scanf("%ld",&b);
k = (a*a-b*b)/(2*a-2*b);
if((a*a-b*b)%(2*a-2*b)!=0)
printf("IMPOSSIBLE\n");
else printf("%ld\n",k);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190753/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190753/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%sub14 = sub nsw i64 %0, %1
%sub = mul nsw i64 %add, %sub14
%sub5 = shl nsw i64 %sub14, 1
%rem = srem i64 %sub, %sub5
%div = sdiv i64 %sub, %sub5
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
const int MOD = 1000000007;
int main(void){
int A,B;
scanf("%d%d",&A,&B);
if((A+B)%2 == 0){
printf("%d\n",(A+B)/2);
}else{
printf("IMPOSSIBLE\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190797/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190797/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@MOD = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = and i32 %add, 1
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %add, 2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main (){long long int crow[100000],i,n;scanf("%lld",&n);for(i=0;i<n;i++){scanf("%lld",&crow[i]);if(i!=0)printf("%lld ",crow[i]+crow[i-1]);}printf("%lld\n",crow[n-1]);return 0;}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19084/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19084/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld \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:
%crow = alloca [100000 x i64], align 16
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %crow) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp14 = icmp sgt i64 %0, 0
br i1 %cmp14, label %for.inc.peel, label %for.end
for.inc.peel: ; preds = %entry
%call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %crow)
%.pre = load i64, ptr %n, align 8, !tbaa !5
%cmp.peel = icmp sgt i64 %.pre, 1
br i1 %cmp.peel, label %for.inc, label %for.end
for.inc: ; preds = %for.inc.peel, %for.inc
%i.015 = phi i64 [ %inc, %for.inc ], [ 1, %for.inc.peel ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr %crow, i64 0, i64 %i.015
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%sub = add nsw i64 %i.015, -1
%arrayidx4 = getelementptr inbounds [100000 x i64], ptr %crow, i64 0, i64 %sub
%2 = load i64, ptr %arrayidx4, align 8, !tbaa !5
%add = add nsw i64 %2, %1
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add)
%inc = add nuw nsw i64 %i.015, 1
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.inc, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %for.inc.peel, %entry
%.lcssa = phi i64 [ %0, %entry ], [ %.pre, %for.inc.peel ], [ %3, %for.inc ]
%sub6 = add nsw i64 %.lcssa, -1
%arrayidx7 = getelementptr inbounds [100000 x i64], ptr %crow, i64 0, i64 %sub6
%4 = load i64, ptr %arrayidx7, align 8, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %4)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %crow) #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#include <stdlib.h>
int max(int, int);
int main(void)
{
int a, b;
scanf("%d %d", &a, &b);
if((0 <= a)&&(a <= 1000000000)&&(0 <= b)&&(b <= 1000000000)&&(a != b))
{
int a_k_abs, b_k_abs, k = 0;
for(int i = 1; i <= max(a, b); i++)
{
a_k_abs = abs(a - i);
b_k_abs = abs(b - i);
if(a_k_abs == b_k_abs) k = i;
}
if(k == 0) printf("IMPOSSIBLE");
else printf("%d", k);
}
return 0;
}
int max(int a, int b)
{
if(a > b) return a;
else return b;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190883/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190883/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"IMPOSSIBLE\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4
%or.cond = icmp ugt i32 %0, 1000000000
%1 = load i32, ptr %b, align 4
%cmp3 = icmp slt i32 %1, 0
%or.cond19.not = select i1 %or.cond, i1 true, i1 %cmp3
%cmp5 = icmp sgt i32 %1, 1000000000
%or.cond20 = select i1 %or.cond19.not, i1 true, i1 %cmp5
%cmp7.not = icmp eq i32 %0, %1
%or.cond27 = select i1 %or.cond20, i1 true, i1 %cmp7.not
br i1 %or.cond27, label %if.end18, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%a.b.i = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%cmp9.not28 = icmp eq i32 %a.b.i, 0
br i1 %cmp9.not28, label %if.then14, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%xtraiter = and i32 %a.b.i, 1
%2 = icmp eq i32 %a.b.i, 1
br i1 %2, label %for.cond.cleanup.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %a.b.i, -2
br label %for.body
for.cond.cleanup.unr-lcssa: ; preds = %for.body, %for.body.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.body ]
%i.030.unr = phi i32 [ 1, %for.body.preheader ], [ %inc.1, %for.body ]
%k.029.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.unr-lcssa
%sub.epil = sub nsw i32 %0, %i.030.unr
%3 = call i32 @llvm.abs.i32(i32 %sub.epil, i1 true)
%sub10.epil = sub nsw i32 %1, %i.030.unr
%4 = call i32 @llvm.abs.i32(i32 %sub10.epil, i1 true)
%cmp11.epil = icmp eq i32 %3, %4
%spec.select.epil = select i1 %cmp11.epil, i32 %i.030.unr, i32 %k.029.unr
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.unr-lcssa, %for.body.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%cmp13 = icmp eq i32 %spec.select.lcssa, 0
br i1 %cmp13, label %if.then14, label %if.else
for.body: ; preds = %for.body, %for.body.preheader.new
%i.030 = phi i32 [ 1, %for.body.preheader.new ], [ %inc.1, %for.body ]
%k.029 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%sub = sub nsw i32 %0, %i.030
%5 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%sub10 = sub nsw i32 %1, %i.030
%6 = call i32 @llvm.abs.i32(i32 %sub10, i1 true)
%cmp11 = icmp eq i32 %5, %6
%spec.select = select i1 %cmp11, i32 %i.030, i32 %k.029
%inc = add nuw i32 %i.030, 1
%sub.1 = sub nsw i32 %0, %inc
%7 = call i32 @llvm.abs.i32(i32 %sub.1, i1 true)
%sub10.1 = sub nsw i32 %1, %inc
%8 = call i32 @llvm.abs.i32(i32 %sub10.1, i1 true)
%cmp11.1 = icmp eq i32 %7, %8
%spec.select.1 = select i1 %cmp11.1, i32 %inc, i32 %spec.select
%inc.1 = add nuw i32 %i.030, 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.cond.cleanup.unr-lcssa, label %for.body, !llvm.loop !5
if.then14: ; preds = %for.cond.preheader, %for.cond.cleanup
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end18
if.else: ; preds = %for.cond.cleanup
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select.lcssa)
br label %if.end18
if.end18: ; preds = %if.then14, %if.else, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int
main(){
long int A,B;
scanf("%ld %ld",&A,&B);
if(A==B){
printf("1\n");;
}
else {
if( (A+B)%2 == 0){
printf("%ld\n", (A+B)/2);
}
else printf("IMPOSSIBLE\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190933/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190933/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i64, align 8
%B = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i64, ptr %A, align 8, !tbaa !5
%1 = load i64, ptr %B, align 8, !tbaa !5
%cmp = icmp eq i64 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %if.end8
if.else: ; preds = %entry
%add = add nsw i64 %1, %0
%2 = and i64 %add, 1
%cmp2 = icmp eq i64 %2, 0
br i1 %cmp2, label %if.then3, label %if.else6
if.then3: ; preds = %if.else
%div = sdiv i64 %add, 2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
br label %if.end8
if.else6: ; preds = %if.else
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end8
if.end8: ; preds = %if.then3, %if.else6, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
long long a,b;
scanf("%lld%lld",&a,&b);
if((a+b)%2==0){
printf("%lld\n",(a+b)/2);
return 0;
}
puts("IMPOSSIBLE");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190977/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190977/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%2 = and i64 %add, 1
%cmp = icmp eq i64 %2, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%div = sdiv i64 %add, 2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
br label %cleanup
if.end: ; preds = %entry
%call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
cleanup: ; preds = %if.end, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#define CLEAN 0
#define DIRTY 1
#define SIZE 1401
#define INITIAL_STACK_SIZE 10
int table[SIZE][SIZE] = {};
int board[SIZE][SIZE] = {};
typedef struct Rectangle {
int height;
int pos;
} Rectangle;
typedef struct _stack {
int size;
int max;
Rectangle *stack;
} *Stack;
Stack stack_init() {
Stack stack = (Stack)malloc(sizeof(struct _stack));
stack->size = 0;
stack->max = INITIAL_STACK_SIZE;
stack->stack = (Rectangle *)malloc(sizeof(Rectangle)*INITIAL_STACK_SIZE);
return stack;
}
Rectangle empty_rectangle() {
return (Rectangle) {
.height = 0,
.pos = 0
};
}
Rectangle top(Stack stack) {
if (stack->size <= 0) {
return empty_rectangle();
} else
return stack->stack[stack->size-1];
}
Rectangle pop(Stack stack) {
if (stack->size <= 0) {
return empty_rectangle();
} else
return stack->stack[--(stack->size)];
}
Rectangle push(Rectangle item, Stack stack) {
int i;
if (stack->size < stack->max) {
stack->stack[(stack->size)++] = item;
} else {
Rectangle *newStack = (Rectangle *)malloc(sizeof(int) * stack->max * 2);
if (newStack == NULL) {
perror("malloc failed.\n");
exit(-1);
}
for (i=0; i<stack->size; i++)
newStack[i] = stack->stack[i];
newStack[stack->size++] = item;
stack->max *= 2;
free(stack->stack);
stack->stack = newStack;
}
return item;
}
int empty(Stack stack) {
return !stack->size;
}
void free_stack(Stack stack) {
free(stack);
}
void create_table(int h, int w) {
int i, j;
for (i=0; i<w; i++)
table[0][i] = (board[0][i] ? 0 : 1);
for (i = 1; i < h; i++) {
for (j = 0; j < w; j++) {
if (board[i][j] == CLEAN)
table[i][j] = table[i-1][j] + 1;
else
table[i][j] = 0;
}
}
}
int rectangleAreaMaxRow(int row[],int w) {
Stack s = stack_init();
int i, max = 0;
row[w] = DIRTY;
for (i=0; i<=w; i++) {
Rectangle r;
r.height = row[i];
r.pos = i;
if (empty(s) || top(s).height < r.height) {
push(r, s);
} else {
int target = i;
while (!empty(s) && top(s).height >= r.height) {
Rectangle pre = pop(s);
int area = pre.height * (i-pre.pos);
max = (area > max ? area : max);
target = pre.pos;
}
r.pos = target;
push(r, s);
}
}
free_stack(s);
return max;
}
int rectangleAreaMax(int h, int w)
{
int i, max = 0, temp;
for (i=0; i<h; i++) {
temp = rectangleAreaMaxRow(table[i], w);
max = (temp > max ? temp : max);
}
return max;
}
int main() {
int i, j, h, w;
scanf("%d %d", &h, &w);
for (i=0; i<h; i++)
for (j=0; j<w; j++)
scanf("%d", &board[i][j]);
create_table(h, w);
printf("%d\n", rectangleAreaMax(h, w));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191033/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191033/source.c"
target datalayout = "e-m:e-p270: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 { i32, i32, ptr }
%struct.Rectangle = type { i32, i32 }
@table = dso_local global [1401 x [1401 x i32]] zeroinitializer, align 16
@board = dso_local global [1401 x [1401 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [16 x i8] c"malloc failed.\0A\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @stack_init() local_unnamed_addr #0 {
entry:
%call = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #14
store i32 0, ptr %call, align 8, !tbaa !5
%max = getelementptr inbounds %struct._stack, ptr %call, i64 0, i32 1
store i32 10, ptr %max, align 4, !tbaa !11
%call1 = tail call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #14
%stack2 = getelementptr inbounds %struct._stack, ptr %call, i64 0, i32 2
store ptr %call1, ptr %stack2, align 8, !tbaa !12
ret ptr %call
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @empty_rectangle() local_unnamed_addr #3 {
entry:
ret i64 0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i64 @top(ptr nocapture noundef readonly %stack) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %stack, align 8, !tbaa !5
%cmp = icmp slt i32 %0, 1
br i1 %cmp, label %return, label %if.else
if.else: ; preds = %entry
%stack1 = getelementptr inbounds %struct._stack, ptr %stack, i64 0, i32 2
%1 = load ptr, ptr %stack1, align 8, !tbaa !12
%sub = add nsw i32 %0, -1
%idxprom = zext i32 %sub to i64
%arrayidx = getelementptr inbounds %struct.Rectangle, ptr %1, i64 %idxprom
%retval.sroa.0.0.copyload = load i64, ptr %arrayidx, align 4, !tbaa.struct !13
br label %return
return: ; preds = %entry, %if.else
%retval.sroa.0.0 = phi i64 [ %retval.sroa.0.0.copyload, %if.else ], [ 0, %entry ]
ret i64 %retval.sroa.0.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @pop(ptr nocapture noundef %stack) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %stack, align 8, !tbaa !5
%cmp = icmp slt i32 %0, 1
br i1 %cmp, label %return, label %if.else
if.else: ; preds = %entry
%stack1 = getelementptr inbounds %struct._stack, ptr %stack, i64 0, i32 2
%1 = load ptr, ptr %stack1, align 8, !tbaa !12
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %stack, align 8, !tbaa !5
%idxprom = zext i32 %dec to i64
%arrayidx = getelementptr inbounds %struct.Rectangle, ptr %1, i64 %idxprom
%retval.sroa.0.0.copyload = load i64, ptr %arrayidx, align 4, !tbaa.struct !13
br label %return
return: ; preds = %entry, %if.else
%retval.sroa.0.0 = phi i64 [ %retval.sroa.0.0.copyload, %if.else ], [ 0, %entry ]
ret i64 %retval.sroa.0.0
}
; Function Attrs: nounwind uwtable
define dso_local i64 @push(i64 returned %item.coerce, ptr nocapture noundef %stack) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr %stack, align 8, !tbaa !5
%max = getelementptr inbounds %struct._stack, ptr %stack, i64 0, i32 1
%1 = load i32, ptr %max, align 4, !tbaa !11
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%stack1 = getelementptr inbounds %struct._stack, ptr %stack, i64 0, i32 2
%2 = load ptr, ptr %stack1, align 8, !tbaa !12
%inc = add nsw i32 %0, 1
store i32 %inc, ptr %stack, align 8, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds %struct.Rectangle, ptr %2, i64 %idxprom
store i64 %item.coerce, ptr %arrayidx, align 4, !tbaa.struct !13
br label %if.end25
if.else: ; preds = %entry
%conv = sext i32 %1 to i64
%mul4 = shl nsw i64 %conv, 3
%call = tail call noalias ptr @malloc(i64 noundef %mul4) #14
%call49 = ptrtoint ptr %call to i64
%cmp5 = icmp eq ptr %call, null
br i1 %cmp5, label %if.then7, label %for.cond.preheader
for.cond.preheader: ; preds = %if.else
%cmp946 = icmp sgt i32 %0, 0
%stack13 = getelementptr inbounds %struct._stack, ptr %stack, i64 0, i32 2
%3 = load ptr, ptr %stack13, align 8, !tbaa !12
br i1 %cmp946, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %for.cond.preheader
%4 = ptrtoint ptr %3 to i64
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 6
%5 = sub i64 %call49, %4
%diff.check = icmp ult i64 %5, 32
%or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
br i1 %or.cond, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %for.body.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%6 = getelementptr inbounds %struct.Rectangle, ptr %call, i64 %index
%7 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %index
%wide.load = load <2 x i64>, ptr %7, align 4
%8 = getelementptr inbounds i64, ptr %7, i64 2
%wide.load50 = load <2 x i64>, ptr %8, align 4
store <2 x i64> %wide.load, ptr %6, align 4
%9 = getelementptr inbounds i64, ptr %6, i64 2
store <2 x i64> %wide.load50, ptr %9, align 4
%index.next = add nuw i64 %index, 4
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.body.lr.ph, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.lr.ph ], [ %n.vec, %middle.block ]
%11 = xor i64 %indvars.iv.ph, -1
%12 = add nsw i64 %11, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader ]
%arrayidx12.prol = getelementptr inbounds %struct.Rectangle, ptr %call, i64 %indvars.iv.prol
%arrayidx15.prol = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.prol
%13 = load i64, ptr %arrayidx15.prol, align 4
store i64 %13, ptr %arrayidx12.prol, align 4
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !19
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ]
%14 = icmp ult i64 %12, 3
br i1 %14, label %for.end, label %for.body
if.then7: ; preds = %if.else
tail call void @perror(ptr noundef nonnull @.str) #15
tail call void @exit(i32 noundef -1) #16
unreachable
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx12 = getelementptr inbounds %struct.Rectangle, ptr %call, i64 %indvars.iv
%arrayidx15 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv
%15 = load i64, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx12, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx12.1 = getelementptr inbounds %struct.Rectangle, ptr %call, i64 %indvars.iv.next
%arrayidx15.1 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next
%16 = load i64, ptr %arrayidx15.1, align 4
store i64 %16, ptr %arrayidx12.1, align 4
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx12.2 = getelementptr inbounds %struct.Rectangle, ptr %call, i64 %indvars.iv.next.1
%arrayidx15.2 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next.1
%17 = load i64, ptr %arrayidx15.2, align 4
store i64 %17, ptr %arrayidx12.2, align 4
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx12.3 = getelementptr inbounds %struct.Rectangle, ptr %call, i64 %indvars.iv.next.2
%arrayidx15.3 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next.2
%18 = load i64, ptr %arrayidx15.3, align 4
store i64 %18, ptr %arrayidx12.3, align 4
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.end, label %for.body, !llvm.loop !21
for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %for.cond.preheader
%inc18 = add nsw i32 %0, 1
store i32 %inc18, ptr %stack, align 8, !tbaa !5
%idxprom19 = sext i32 %0 to i64
%arrayidx20 = getelementptr inbounds %struct.Rectangle, ptr %call, i64 %idxprom19
store i64 %item.coerce, ptr %arrayidx20, align 4, !tbaa.struct !13
%mul22 = shl nsw i32 %1, 1
store i32 %mul22, ptr %max, align 4, !tbaa !11
%stack23 = getelementptr inbounds %struct._stack, ptr %stack, i64 0, i32 2
tail call void @free(ptr noundef %3) #17
store ptr %call, ptr %stack23, align 8, !tbaa !12
br label %if.end25
if.end25: ; preds = %for.end, %if.then
ret i64 %item.coerce
}
; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #8
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #9
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @empty(ptr nocapture noundef readonly %stack) local_unnamed_addr #10 {
entry:
%0 = load i32, ptr %stack, align 8, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
%lnot.ext = zext i1 %tobool.not to i32
ret i32 %lnot.ext
}
; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable
define dso_local void @free_stack(ptr nocapture noundef %stack) local_unnamed_addr #11 {
entry:
tail call void @free(ptr noundef %stack) #17
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @create_table(i32 noundef %h, i32 noundef %w) local_unnamed_addr #12 {
entry:
%cmp47 = icmp slt i32 %w, 1
br i1 %cmp47, label %for.end31, label %for.body.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %w to i64
%min.iters.check = icmp ult i32 %w, 8
br i1 %min.iters.check, label %for.body.preheader68, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds [1401 x i32], ptr @board, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %0, align 16, !tbaa !14
%1 = getelementptr inbounds i32, ptr %0, i64 4
%wide.load67 = load <4 x i32>, ptr %1, align 16, !tbaa !14
%2 = icmp eq <4 x i32> %wide.load, zeroinitializer
%3 = icmp eq <4 x i32> %wide.load67, zeroinitializer
%4 = zext <4 x i1> %2 to <4 x i32>
%5 = zext <4 x i1> %3 to <4 x i32>
%6 = getelementptr inbounds [1401 x i32], ptr @table, i64 0, i64 %index
store <4 x i32> %4, ptr %6, align 16, !tbaa !14
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %5, ptr %7, align 16, !tbaa !14
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond3.preheader, label %for.body.preheader68
for.body.preheader68: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond3.preheader: ; preds = %for.body, %middle.block
%cmp451 = icmp slt i32 %h, 2
%brmerge = or i1 %cmp451, %cmp47
br i1 %brmerge, label %for.end31, label %for.cond6.preheader.us.preheader
for.cond6.preheader.us.preheader: ; preds = %for.cond3.preheader
%wide.trip.count64 = zext i32 %h to i64
%xtraiter = and i64 %wide.trip.count, 1
%9 = icmp eq i32 %w, 1
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond6.preheader.us
for.cond6.preheader.us: ; preds = %for.cond6.preheader.us.preheader, %for.cond6.for.inc29_crit_edge.us
%indvars.iv60 = phi i64 [ 1, %for.cond6.preheader.us.preheader ], [ %indvars.iv.next61, %for.cond6.for.inc29_crit_edge.us ]
%10 = add nsw i64 %indvars.iv60, -1
br i1 %9, label %for.cond6.for.inc29_crit_edge.us.unr-lcssa, label %for.body8.us
for.body8.us: ; preds = %for.cond6.preheader.us, %for.inc26.us.1
%indvars.iv55 = phi i64 [ %indvars.iv.next56.1, %for.inc26.us.1 ], [ 0, %for.cond6.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc26.us.1 ], [ 0, %for.cond6.preheader.us ]
%arrayidx12.us = getelementptr inbounds [1401 x [1401 x i32]], ptr @board, i64 0, i64 %indvars.iv60, i64 %indvars.iv55
%11 = load i32, ptr %arrayidx12.us, align 4, !tbaa !14
%cmp13.us = icmp eq i32 %11, 0
br i1 %cmp13.us, label %if.then.us, label %for.inc26.us
if.then.us: ; preds = %for.body8.us
%arrayidx17.us = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %10, i64 %indvars.iv55
%12 = load i32, ptr %arrayidx17.us, align 4, !tbaa !14
%add.us = add nsw i32 %12, 1
br label %for.inc26.us
for.inc26.us: ; preds = %for.body8.us, %if.then.us
%.sink = phi i32 [ %add.us, %if.then.us ], [ 0, %for.body8.us ]
%13 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %indvars.iv60, i64 %indvars.iv55
store i32 %.sink, ptr %13, align 4
%indvars.iv.next56 = or i64 %indvars.iv55, 1
%arrayidx12.us.1 = getelementptr inbounds [1401 x [1401 x i32]], ptr @board, i64 0, i64 %indvars.iv60, i64 %indvars.iv.next56
%14 = load i32, ptr %arrayidx12.us.1, align 4, !tbaa !14
%cmp13.us.1 = icmp eq i32 %14, 0
br i1 %cmp13.us.1, label %if.then.us.1, label %for.inc26.us.1
if.then.us.1: ; preds = %for.inc26.us
%arrayidx17.us.1 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %10, i64 %indvars.iv.next56
%15 = load i32, ptr %arrayidx17.us.1, align 4, !tbaa !14
%add.us.1 = add nsw i32 %15, 1
br label %for.inc26.us.1
for.inc26.us.1: ; preds = %if.then.us.1, %for.inc26.us
%.sink.1 = phi i32 [ %add.us.1, %if.then.us.1 ], [ 0, %for.inc26.us ]
%16 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %indvars.iv60, i64 %indvars.iv.next56
store i32 %.sink.1, ptr %16, align 4
%indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond6.for.inc29_crit_edge.us.unr-lcssa, label %for.body8.us, !llvm.loop !23
for.cond6.for.inc29_crit_edge.us.unr-lcssa: ; preds = %for.inc26.us.1, %for.cond6.preheader.us
%indvars.iv55.unr = phi i64 [ 0, %for.cond6.preheader.us ], [ %indvars.iv.next56.1, %for.inc26.us.1 ]
br i1 %lcmp.mod.not, label %for.cond6.for.inc29_crit_edge.us, label %for.body8.us.epil
for.body8.us.epil: ; preds = %for.cond6.for.inc29_crit_edge.us.unr-lcssa
%arrayidx12.us.epil = getelementptr inbounds [1401 x [1401 x i32]], ptr @board, i64 0, i64 %indvars.iv60, i64 %indvars.iv55.unr
%17 = load i32, ptr %arrayidx12.us.epil, align 4, !tbaa !14
%cmp13.us.epil = icmp eq i32 %17, 0
br i1 %cmp13.us.epil, label %if.then.us.epil, label %for.inc26.us.epil
if.then.us.epil: ; preds = %for.body8.us.epil
%arrayidx17.us.epil = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %10, i64 %indvars.iv55.unr
%18 = load i32, ptr %arrayidx17.us.epil, align 4, !tbaa !14
%add.us.epil = add nsw i32 %18, 1
br label %for.inc26.us.epil
for.inc26.us.epil: ; preds = %if.then.us.epil, %for.body8.us.epil
%.sink.epil = phi i32 [ %add.us.epil, %if.then.us.epil ], [ 0, %for.body8.us.epil ]
%19 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %indvars.iv60, i64 %indvars.iv55.unr
store i32 %.sink.epil, ptr %19, align 4
br label %for.cond6.for.inc29_crit_edge.us
for.cond6.for.inc29_crit_edge.us: ; preds = %for.cond6.for.inc29_crit_edge.us.unr-lcssa, %for.inc26.us.epil
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%exitcond65.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count64
br i1 %exitcond65.not, label %for.end31, label %for.cond6.preheader.us, !llvm.loop !24
for.body: ; preds = %for.body.preheader68, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader68 ]
%arrayidx = getelementptr inbounds [1401 x i32], ptr @board, i64 0, i64 %indvars.iv
%20 = load i32, ptr %arrayidx, align 4, !tbaa !14
%tobool.not = icmp eq i32 %20, 0
%cond = zext i1 %tobool.not to i32
%arrayidx2 = getelementptr inbounds [1401 x i32], ptr @table, i64 0, i64 %indvars.iv
store i32 %cond, ptr %arrayidx2, align 4, !tbaa !14
%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.cond3.preheader, label %for.body, !llvm.loop !25
for.end31: ; preds = %for.cond6.for.inc29_crit_edge.us, %for.cond3.preheader, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @rectangleAreaMaxRow(ptr nocapture noundef %row, i32 noundef %w) local_unnamed_addr #6 {
entry:
%call1.i = tail call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #14
%idxprom = sext i32 %w to i64
%arrayidx = getelementptr inbounds i32, ptr %row, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !14
%cmp.not132 = icmp slt i32 %w, 0
br i1 %cmp.not132, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%0 = add nuw i32 %w, 1
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end
%1 = phi ptr [ %call1.i, %for.body.lr.ph ], [ %36, %if.end ]
%2 = phi i32 [ 10, %for.body.lr.ph ], [ %37, %if.end ]
%3 = phi ptr [ %call1.i, %for.body.lr.ph ], [ %38, %if.end ]
%4 = phi i32 [ 10, %for.body.lr.ph ], [ %39, %if.end ]
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %if.end ]
%dec.i116.lcssa138 = phi i32 [ 0, %for.body.lr.ph ], [ %dec.i116.lcssa139, %if.end ]
%max.0133 = phi i32 [ 0, %for.body.lr.ph ], [ %max.2, %if.end ]
%5 = ptrtoint ptr %3 to i64
%arrayidx2 = getelementptr inbounds i32, ptr %row, i64 %indvars.iv
%6 = load i32, ptr %arrayidx2, align 4, !tbaa !14
%tobool.not.i.not = icmp eq i32 %dec.i116.lcssa138, 0
br i1 %tobool.not.i.not, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body
%cmp.i = icmp slt i32 %dec.i116.lcssa138, 1
br i1 %cmp.i, label %top.exit, label %if.else.i
if.else.i: ; preds = %lor.lhs.false
%sub.i = add nsw i32 %dec.i116.lcssa138, -1
%idxprom.i = zext i32 %sub.i to i64
%arrayidx.i = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %idxprom.i
%retval.sroa.0.0.copyload.i = load i64, ptr %arrayidx.i, align 4, !tbaa.struct !13
br label %top.exit
top.exit: ; preds = %lor.lhs.false, %if.else.i
%retval.sroa.0.0.i = phi i64 [ %retval.sroa.0.0.copyload.i, %if.else.i ], [ 0, %lor.lhs.false ]
%coerce.sroa.0.0.extract.trunc = trunc i64 %retval.sroa.0.0.i to i32
%cmp7 = icmp sgt i32 %6, %coerce.sroa.0.0.extract.trunc
br i1 %cmp7, label %if.then, label %land.rhs.lr.ph
land.rhs.lr.ph: ; preds = %top.exit
%cmp16.not = icmp sgt i32 %6, 0
%7 = trunc i64 %indvars.iv to i32
br label %land.rhs
if.then: ; preds = %top.exit, %for.body
%r.sroa.7.0.insert.shift = shl nuw nsw i64 %indvars.iv, 32
%r.sroa.0.0.insert.ext = zext i32 %6 to i64
%r.sroa.0.0.insert.insert = or i64 %r.sroa.7.0.insert.shift, %r.sroa.0.0.insert.ext
%cmp.i55 = icmp slt i32 %dec.i116.lcssa138, %2
br i1 %cmp.i55, label %if.then.i, label %if.else.i56
if.then.i: ; preds = %if.then
%idxprom.i59 = sext i32 %dec.i116.lcssa138 to i64
%arrayidx.i60 = getelementptr inbounds %struct.Rectangle, ptr %1, i64 %idxprom.i59
store i64 %r.sroa.0.0.insert.insert, ptr %arrayidx.i60, align 4, !tbaa.struct !13
br label %if.end
if.else.i56: ; preds = %if.then
%conv.i = sext i32 %2 to i64
%mul4.i = shl nsw i64 %conv.i, 3
%call.i57 = tail call noalias ptr @malloc(i64 noundef %mul4.i) #14
%call.i57143 = ptrtoint ptr %call.i57 to i64
%cmp5.i = icmp eq ptr %call.i57, null
br i1 %cmp5.i, label %if.then7.i, label %for.cond.preheader.i
for.cond.preheader.i: ; preds = %if.else.i56
%cmp946.i = icmp sgt i32 %dec.i116.lcssa138, 0
br i1 %cmp946.i, label %for.body.lr.ph.i, label %for.end.i
for.body.lr.ph.i: ; preds = %for.cond.preheader.i
%wide.trip.count.i = zext i32 %dec.i116.lcssa138 to i64
%min.iters.check = icmp ult i32 %dec.i116.lcssa138, 6
%8 = sub i64 %call.i57143, %5
%diff.check = icmp ult i64 %8, 32
%or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
br i1 %or.cond, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.lr.ph.i
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%9 = getelementptr inbounds %struct.Rectangle, ptr %call.i57, i64 %index
%10 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %index
%wide.load = load <2 x i64>, ptr %10, align 4
%11 = getelementptr inbounds i64, ptr %10, i64 2
%wide.load144 = load <2 x i64>, ptr %11, align 4
store <2 x i64> %wide.load, ptr %9, align 4
%12 = getelementptr inbounds i64, ptr %9, i64 2
store <2 x i64> %wide.load144, ptr %12, align 4
%index.next = add nuw i64 %index, 4
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !26
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.end.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.lr.ph.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.lr.ph.i ], [ %n.vec, %middle.block ]
%14 = xor i64 %indvars.iv.i.ph, -1
%15 = add nsw i64 %14, %wide.trip.count.i
%xtraiter162 = and i64 %wide.trip.count.i, 3
%lcmp.mod163.not = icmp eq i64 %xtraiter162, 0
br i1 %lcmp.mod163.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter164 = phi i64 [ %prol.iter164.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx12.i.prol = getelementptr inbounds %struct.Rectangle, ptr %call.i57, i64 %indvars.iv.i.prol
%arrayidx15.i.prol = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.i.prol
%16 = load i64, ptr %arrayidx15.i.prol, align 4
store i64 %16, ptr %arrayidx12.i.prol, align 4
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter164.next = add i64 %prol.iter164, 1
%prol.iter164.cmp.not = icmp eq i64 %prol.iter164.next, %xtraiter162
br i1 %prol.iter164.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !27
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%17 = icmp ult i64 %15, 3
br i1 %17, label %for.end.i, label %for.body.i
if.then7.i: ; preds = %if.else.i56
tail call void @perror(ptr noundef nonnull @.str) #15
tail call void @exit(i32 noundef -1) #16
unreachable
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx12.i = getelementptr inbounds %struct.Rectangle, ptr %call.i57, i64 %indvars.iv.i
%arrayidx15.i = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.i
%18 = load i64, ptr %arrayidx15.i, align 4
store i64 %18, ptr %arrayidx12.i, align 4
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx12.i.1 = getelementptr inbounds %struct.Rectangle, ptr %call.i57, i64 %indvars.iv.next.i
%arrayidx15.i.1 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next.i
%19 = load i64, ptr %arrayidx15.i.1, align 4
store i64 %19, ptr %arrayidx12.i.1, align 4
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx12.i.2 = getelementptr inbounds %struct.Rectangle, ptr %call.i57, i64 %indvars.iv.next.i.1
%arrayidx15.i.2 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next.i.1
%20 = load i64, ptr %arrayidx15.i.2, align 4
store i64 %20, ptr %arrayidx12.i.2, align 4
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx12.i.3 = getelementptr inbounds %struct.Rectangle, ptr %call.i57, i64 %indvars.iv.next.i.2
%arrayidx15.i.3 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next.i.2
%21 = load i64, ptr %arrayidx15.i.3, align 4
store i64 %21, ptr %arrayidx12.i.3, align 4
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.end.i, label %for.body.i, !llvm.loop !28
for.end.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %for.cond.preheader.i
%idxprom19.i = sext i32 %dec.i116.lcssa138 to i64
%arrayidx20.i = getelementptr inbounds %struct.Rectangle, ptr %call.i57, i64 %idxprom19.i
store i64 %r.sroa.0.0.insert.insert, ptr %arrayidx20.i, align 4, !tbaa.struct !13
%mul22.i = shl nsw i32 %2, 1
tail call void @free(ptr noundef %3) #17
br label %if.end
land.rhs: ; preds = %land.rhs.lr.ph, %pop.exit
%max.1120 = phi i32 [ %max.0133, %land.rhs.lr.ph ], [ %cond, %pop.exit ]
%target.0119 = phi i32 [ %7, %land.rhs.lr.ph ], [ %pre.sroa.4.0.extract.trunc, %pop.exit ]
%dec.i116118 = phi i32 [ %dec.i116.lcssa138, %land.rhs.lr.ph ], [ %dec.i115, %pop.exit ]
%cmp.i63 = icmp slt i32 %dec.i116118, 1
br i1 %cmp.i63, label %top.exit71, label %top.exit71.thread
top.exit71: ; preds = %land.rhs
br i1 %cmp16.not, label %while.end, label %pop.exit
top.exit71.thread: ; preds = %land.rhs
%sub.i66 = add nsw i32 %dec.i116118, -1
%idxprom.i67 = zext i32 %sub.i66 to i64
%arrayidx.i68 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %idxprom.i67
%retval.sroa.0.0.copyload.i69 = load i64, ptr %arrayidx.i68, align 4, !tbaa.struct !13
%coerce13.sroa.0.0.extract.trunc111 = trunc i64 %retval.sroa.0.0.copyload.i69 to i32
%cmp16.not112 = icmp sgt i32 %6, %coerce13.sroa.0.0.extract.trunc111
br i1 %cmp16.not112, label %while.end, label %if.else.i73
if.else.i73: ; preds = %top.exit71.thread
%arrayidx.i76 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %idxprom.i67
%retval.sroa.0.0.copyload.i77 = load i64, ptr %arrayidx.i76, align 4, !tbaa.struct !13
br label %pop.exit
pop.exit: ; preds = %top.exit71, %if.else.i73
%dec.i115 = phi i32 [ %sub.i66, %if.else.i73 ], [ %dec.i116118, %top.exit71 ]
%retval.sroa.0.0.i78 = phi i64 [ %retval.sroa.0.0.copyload.i77, %if.else.i73 ], [ 0, %top.exit71 ]
%pre.sroa.0.0.extract.trunc = trunc i64 %retval.sroa.0.0.i78 to i32
%pre.sroa.4.0.extract.shift = lshr i64 %retval.sroa.0.0.i78, 32
%pre.sroa.4.0.extract.trunc = trunc i64 %pre.sroa.4.0.extract.shift to i32
%sub = sub nsw i32 %7, %pre.sroa.4.0.extract.trunc
%mul = mul nsw i32 %sub, %pre.sroa.0.0.extract.trunc
%cond = tail call i32 @llvm.smax.i32(i32 %mul, i32 %max.1120)
%tobool.not.i61.not = icmp eq i32 %dec.i115, 0
br i1 %tobool.not.i61.not, label %while.end, label %land.rhs, !llvm.loop !29
while.end: ; preds = %top.exit71, %pop.exit, %top.exit71.thread
%dec.i116.lcssa.ph = phi i32 [ %dec.i116118, %top.exit71 ], [ 0, %pop.exit ], [ %dec.i116118, %top.exit71.thread ]
%target.0.lcssa.ph = phi i32 [ %target.0119, %top.exit71 ], [ %pre.sroa.4.0.extract.trunc, %pop.exit ], [ %target.0119, %top.exit71.thread ]
%max.1.lcssa.ph = phi i32 [ %max.1120, %top.exit71 ], [ %cond, %pop.exit ], [ %max.1120, %top.exit71.thread ]
%r.sroa.7.0.insert.ext34 = zext i32 %target.0.lcssa.ph to i64
%r.sroa.7.0.insert.shift35 = shl nuw i64 %r.sroa.7.0.insert.ext34, 32
%r.sroa.0.0.insert.ext30 = zext i32 %6 to i64
%r.sroa.0.0.insert.insert32 = or i64 %r.sroa.7.0.insert.shift35, %r.sroa.0.0.insert.ext30
%cmp.i80 = icmp slt i32 %dec.i116.lcssa.ph, %4
br i1 %cmp.i80, label %if.then.i104, label %if.else.i81
if.then.i104: ; preds = %while.end
%idxprom.i107 = sext i32 %dec.i116.lcssa.ph to i64
%arrayidx.i108 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %idxprom.i107
store i64 %r.sroa.0.0.insert.insert32, ptr %arrayidx.i108, align 4, !tbaa.struct !13
br label %if.end
if.else.i81: ; preds = %while.end
%conv.i82 = sext i32 %4 to i64
%mul4.i83 = shl nsw i64 %conv.i82, 3
%call.i84 = tail call noalias ptr @malloc(i64 noundef %mul4.i83) #14
%call.i84146 = ptrtoint ptr %call.i84 to i64
%cmp5.i85 = icmp eq ptr %call.i84, null
br i1 %cmp5.i85, label %if.then7.i103, label %for.cond.preheader.i86
for.cond.preheader.i86: ; preds = %if.else.i81
%cmp946.i87 = icmp sgt i32 %dec.i116.lcssa.ph, 0
br i1 %cmp946.i87, label %for.body.lr.ph.i95, label %for.end.i89
for.body.lr.ph.i95: ; preds = %for.cond.preheader.i86
%wide.trip.count.i96 = zext i32 %dec.i116.lcssa.ph to i64
%min.iters.check150 = icmp ult i32 %dec.i116.lcssa.ph, 6
%22 = sub i64 %call.i84146, %5
%diff.check147 = icmp ult i64 %22, 32
%or.cond161 = select i1 %min.iters.check150, i1 true, i1 %diff.check147
br i1 %or.cond161, label %for.body.i97.preheader, label %vector.ph151
vector.ph151: ; preds = %for.body.lr.ph.i95
%n.vec153 = and i64 %wide.trip.count.i96, 4294967292
br label %vector.body156
vector.body156: ; preds = %vector.body156, %vector.ph151
%index157 = phi i64 [ 0, %vector.ph151 ], [ %index.next160, %vector.body156 ]
%23 = getelementptr inbounds %struct.Rectangle, ptr %call.i84, i64 %index157
%24 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %index157
%wide.load158 = load <2 x i64>, ptr %24, align 4
%25 = getelementptr inbounds i64, ptr %24, i64 2
%wide.load159 = load <2 x i64>, ptr %25, align 4
store <2 x i64> %wide.load158, ptr %23, align 4
%26 = getelementptr inbounds i64, ptr %23, i64 2
store <2 x i64> %wide.load159, ptr %26, align 4
%index.next160 = add nuw i64 %index157, 4
%27 = icmp eq i64 %index.next160, %n.vec153
br i1 %27, label %middle.block148, label %vector.body156, !llvm.loop !30
middle.block148: ; preds = %vector.body156
%cmp.n155 = icmp eq i64 %n.vec153, %wide.trip.count.i96
br i1 %cmp.n155, label %for.end.i89, label %for.body.i97.preheader
for.body.i97.preheader: ; preds = %for.body.lr.ph.i95, %middle.block148
%indvars.iv.i98.ph = phi i64 [ 0, %for.body.lr.ph.i95 ], [ %n.vec153, %middle.block148 ]
%28 = xor i64 %indvars.iv.i98.ph, -1
%29 = add nsw i64 %28, %wide.trip.count.i96
%xtraiter = and i64 %wide.trip.count.i96, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i97.prol.loopexit, label %for.body.i97.prol
for.body.i97.prol: ; preds = %for.body.i97.preheader, %for.body.i97.prol
%indvars.iv.i98.prol = phi i64 [ %indvars.iv.next.i101.prol, %for.body.i97.prol ], [ %indvars.iv.i98.ph, %for.body.i97.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i97.prol ], [ 0, %for.body.i97.preheader ]
%arrayidx12.i99.prol = getelementptr inbounds %struct.Rectangle, ptr %call.i84, i64 %indvars.iv.i98.prol
%arrayidx15.i100.prol = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.i98.prol
%30 = load i64, ptr %arrayidx15.i100.prol, align 4
store i64 %30, ptr %arrayidx12.i99.prol, align 4
%indvars.iv.next.i101.prol = add nuw nsw i64 %indvars.iv.i98.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i97.prol.loopexit, label %for.body.i97.prol, !llvm.loop !31
for.body.i97.prol.loopexit: ; preds = %for.body.i97.prol, %for.body.i97.preheader
%indvars.iv.i98.unr = phi i64 [ %indvars.iv.i98.ph, %for.body.i97.preheader ], [ %indvars.iv.next.i101.prol, %for.body.i97.prol ]
%31 = icmp ult i64 %29, 3
br i1 %31, label %for.end.i89, label %for.body.i97
if.then7.i103: ; preds = %if.else.i81
tail call void @perror(ptr noundef nonnull @.str) #15
tail call void @exit(i32 noundef -1) #16
unreachable
for.body.i97: ; preds = %for.body.i97.prol.loopexit, %for.body.i97
%indvars.iv.i98 = phi i64 [ %indvars.iv.next.i101.3, %for.body.i97 ], [ %indvars.iv.i98.unr, %for.body.i97.prol.loopexit ]
%arrayidx12.i99 = getelementptr inbounds %struct.Rectangle, ptr %call.i84, i64 %indvars.iv.i98
%arrayidx15.i100 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.i98
%32 = load i64, ptr %arrayidx15.i100, align 4
store i64 %32, ptr %arrayidx12.i99, align 4
%indvars.iv.next.i101 = add nuw nsw i64 %indvars.iv.i98, 1
%arrayidx12.i99.1 = getelementptr inbounds %struct.Rectangle, ptr %call.i84, i64 %indvars.iv.next.i101
%arrayidx15.i100.1 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next.i101
%33 = load i64, ptr %arrayidx15.i100.1, align 4
store i64 %33, ptr %arrayidx12.i99.1, align 4
%indvars.iv.next.i101.1 = add nuw nsw i64 %indvars.iv.i98, 2
%arrayidx12.i99.2 = getelementptr inbounds %struct.Rectangle, ptr %call.i84, i64 %indvars.iv.next.i101.1
%arrayidx15.i100.2 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next.i101.1
%34 = load i64, ptr %arrayidx15.i100.2, align 4
store i64 %34, ptr %arrayidx12.i99.2, align 4
%indvars.iv.next.i101.2 = add nuw nsw i64 %indvars.iv.i98, 3
%arrayidx12.i99.3 = getelementptr inbounds %struct.Rectangle, ptr %call.i84, i64 %indvars.iv.next.i101.2
%arrayidx15.i100.3 = getelementptr inbounds %struct.Rectangle, ptr %3, i64 %indvars.iv.next.i101.2
%35 = load i64, ptr %arrayidx15.i100.3, align 4
store i64 %35, ptr %arrayidx12.i99.3, align 4
%indvars.iv.next.i101.3 = add nuw nsw i64 %indvars.iv.i98, 4
%exitcond.not.i102.3 = icmp eq i64 %indvars.iv.next.i101.3, %wide.trip.count.i96
br i1 %exitcond.not.i102.3, label %for.end.i89, label %for.body.i97, !llvm.loop !32
for.end.i89: ; preds = %for.body.i97.prol.loopexit, %for.body.i97, %middle.block148, %for.cond.preheader.i86
%idxprom19.i91 = sext i32 %dec.i116.lcssa.ph to i64
%arrayidx20.i92 = getelementptr inbounds %struct.Rectangle, ptr %call.i84, i64 %idxprom19.i91
store i64 %r.sroa.0.0.insert.insert32, ptr %arrayidx20.i92, align 4, !tbaa.struct !13
%mul22.i93 = shl nsw i32 %4, 1
tail call void @free(ptr noundef %3) #17
br label %if.end
if.end: ; preds = %for.end.i89, %if.then.i104, %for.end.i, %if.then.i
%36 = phi ptr [ %1, %if.then.i ], [ %call.i57, %for.end.i ], [ %1, %if.then.i104 ], [ %call.i84, %for.end.i89 ]
%37 = phi i32 [ %2, %if.then.i ], [ %mul22.i, %for.end.i ], [ %2, %if.then.i104 ], [ %mul22.i93, %for.end.i89 ]
%38 = phi ptr [ %1, %if.then.i ], [ %call.i57, %for.end.i ], [ %3, %if.then.i104 ], [ %call.i84, %for.end.i89 ]
%39 = phi i32 [ %2, %if.then.i ], [ %mul22.i, %for.end.i ], [ %4, %if.then.i104 ], [ %mul22.i93, %for.end.i89 ]
%dec.i116.lcssa139.in = phi i32 [ %dec.i116.lcssa138, %if.then.i ], [ %dec.i116.lcssa138, %for.end.i ], [ %dec.i116.lcssa.ph, %if.then.i104 ], [ %dec.i116.lcssa.ph, %for.end.i89 ]
%max.2 = phi i32 [ %max.0133, %if.then.i ], [ %max.0133, %for.end.i ], [ %max.1.lcssa.ph, %if.then.i104 ], [ %max.1.lcssa.ph, %for.end.i89 ]
%dec.i116.lcssa139 = add nsw i32 %dec.i116.lcssa139.in, 1
%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 !33
for.end: ; preds = %if.end, %entry
%max.0.lcssa = phi i32 [ 0, %entry ], [ %max.2, %if.end ]
ret i32 %max.0.lcssa
}
; Function Attrs: nounwind uwtable
define dso_local i32 @rectangleAreaMax(i32 noundef %h, i32 noundef %w) local_unnamed_addr #6 {
entry:
%cmp7 = icmp sgt i32 %h, 0
br i1 %cmp7, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %h 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 ]
%max.08 = phi i32 [ 0, %for.body.preheader ], [ %cond, %for.body ]
%arrayidx = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %indvars.iv
%call = tail call i32 @rectangleAreaMaxRow(ptr noundef nonnull %arrayidx, i32 noundef %w)
%cond = tail call i32 @llvm.smax.i32(i32 %call, i32 %max.08)
%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 !34
for.end: ; preds = %for.body, %entry
%max.0.lcssa = phi i32 [ 0, %entry ], [ %cond, %for.body ]
ret i32 %max.0.lcssa
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #17
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #17
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !14
%cmp26 = icmp sgt i32 %0, 0
%.pre34 = load i32, ptr %w, align 4, !tbaa !14
br i1 %cmp26, label %for.cond1.preheader.lr.ph, label %for.end9
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre34, 0
br i1 %1, label %for.cond1.preheader, label %for.body.preheader.i16
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7
%2 = phi i32 [ %6, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %7, %for.inc7 ], [ %.pre34, %for.cond1.preheader.lr.ph ]
%indvars.iv31 = phi i64 [ %indvars.iv.next32, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp224 = icmp sgt i32 %3, 0
br i1 %cmp224, label %for.body3, label %for.inc7
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [1401 x [1401 x i32]], ptr @board, i64 0, i64 %indvars.iv31, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %w, align 4, !tbaa !14
%5 = sext i32 %4 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !35
for.inc7.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %h, align 4, !tbaa !14
br label %for.inc7
for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader
%6 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ]
%7 = phi i32 [ %4, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1
%8 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next32, %8
br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !36
for.end9: ; preds = %for.inc7, %entry
%9 = phi i32 [ %.pre34, %entry ], [ %7, %for.inc7 ]
%.lcssa = phi i32 [ %0, %entry ], [ %6, %for.inc7 ]
%cmp47.i = icmp slt i32 %9, 1
br i1 %cmp47.i, label %create_table.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.end9
%wide.trip.count.i = zext i32 %9 to i64
%min.iters.check = icmp ult i32 %9, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%10 = getelementptr inbounds [1401 x i32], ptr @board, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %10, align 16, !tbaa !14
%11 = getelementptr inbounds i32, ptr %10, i64 4
%wide.load47 = load <4 x i32>, ptr %11, align 16, !tbaa !14
%12 = icmp eq <4 x i32> %wide.load, zeroinitializer
%13 = icmp eq <4 x i32> %wide.load47, zeroinitializer
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = getelementptr inbounds [1401 x i32], ptr @table, i64 0, i64 %index
store <4 x i32> %14, ptr %16, align 16, !tbaa !14
%17 = getelementptr inbounds i32, ptr %16, i64 4
store <4 x i32> %15, ptr %17, align 16, !tbaa !14
%index.next = add nuw i64 %index, 8
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !38
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond3.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
br label %for.body.i
for.cond3.preheader.i: ; preds = %for.body.i, %middle.block
%cmp451.i = icmp slt i32 %.lcssa, 2
br i1 %cmp451.i, label %create_table.exit, label %for.cond6.preheader.us.preheader.i
for.cond6.preheader.us.preheader.i: ; preds = %for.cond3.preheader.i
%wide.trip.count64.i = zext i32 %.lcssa to i64
%xtraiter = and i64 %wide.trip.count.i, 1
%19 = icmp eq i32 %9, 1
%unroll_iter = and i64 %wide.trip.count.i, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond6.preheader.us.i
for.cond6.preheader.us.i: ; preds = %for.cond6.for.inc29_crit_edge.us.i, %for.cond6.preheader.us.preheader.i
%indvars.iv60.i = phi i64 [ 1, %for.cond6.preheader.us.preheader.i ], [ %indvars.iv.next61.i, %for.cond6.for.inc29_crit_edge.us.i ]
%20 = add nsw i64 %indvars.iv60.i, -1
br i1 %19, label %for.cond6.for.inc29_crit_edge.us.i.unr-lcssa, label %for.body8.us.i
for.body8.us.i: ; preds = %for.cond6.preheader.us.i, %for.inc26.us.i.1
%indvars.iv55.i = phi i64 [ %indvars.iv.next56.i.1, %for.inc26.us.i.1 ], [ 0, %for.cond6.preheader.us.i ]
%niter = phi i64 [ %niter.next.1, %for.inc26.us.i.1 ], [ 0, %for.cond6.preheader.us.i ]
%arrayidx12.us.i = getelementptr inbounds [1401 x [1401 x i32]], ptr @board, i64 0, i64 %indvars.iv60.i, i64 %indvars.iv55.i
%21 = load i32, ptr %arrayidx12.us.i, align 4, !tbaa !14
%cmp13.us.i = icmp eq i32 %21, 0
br i1 %cmp13.us.i, label %if.then.us.i, label %for.inc26.us.i
if.then.us.i: ; preds = %for.body8.us.i
%arrayidx17.us.i = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %20, i64 %indvars.iv55.i
%22 = load i32, ptr %arrayidx17.us.i, align 4, !tbaa !14
%add.us.i = add nsw i32 %22, 1
br label %for.inc26.us.i
for.inc26.us.i: ; preds = %if.then.us.i, %for.body8.us.i
%.sink.i = phi i32 [ %add.us.i, %if.then.us.i ], [ 0, %for.body8.us.i ]
%23 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %indvars.iv60.i, i64 %indvars.iv55.i
store i32 %.sink.i, ptr %23, align 4
%indvars.iv.next56.i = or i64 %indvars.iv55.i, 1
%arrayidx12.us.i.1 = getelementptr inbounds [1401 x [1401 x i32]], ptr @board, i64 0, i64 %indvars.iv60.i, i64 %indvars.iv.next56.i
%24 = load i32, ptr %arrayidx12.us.i.1, align 4, !tbaa !14
%cmp13.us.i.1 = icmp eq i32 %24, 0
br i1 %cmp13.us.i.1, label %if.then.us.i.1, label %for.inc26.us.i.1
if.then.us.i.1: ; preds = %for.inc26.us.i
%arrayidx17.us.i.1 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %20, i64 %indvars.iv.next56.i
%25 = load i32, ptr %arrayidx17.us.i.1, align 4, !tbaa !14
%add.us.i.1 = add nsw i32 %25, 1
br label %for.inc26.us.i.1
for.inc26.us.i.1: ; preds = %if.then.us.i.1, %for.inc26.us.i
%.sink.i.1 = phi i32 [ %add.us.i.1, %if.then.us.i.1 ], [ 0, %for.inc26.us.i ]
%26 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %indvars.iv60.i, i64 %indvars.iv.next56.i
store i32 %.sink.i.1, ptr %26, align 4
%indvars.iv.next56.i.1 = add nuw nsw i64 %indvars.iv55.i, 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.cond6.for.inc29_crit_edge.us.i.unr-lcssa, label %for.body8.us.i, !llvm.loop !23
for.cond6.for.inc29_crit_edge.us.i.unr-lcssa: ; preds = %for.inc26.us.i.1, %for.cond6.preheader.us.i
%indvars.iv55.i.unr = phi i64 [ 0, %for.cond6.preheader.us.i ], [ %indvars.iv.next56.i.1, %for.inc26.us.i.1 ]
br i1 %lcmp.mod.not, label %for.cond6.for.inc29_crit_edge.us.i, label %for.body8.us.i.epil
for.body8.us.i.epil: ; preds = %for.cond6.for.inc29_crit_edge.us.i.unr-lcssa
%arrayidx12.us.i.epil = getelementptr inbounds [1401 x [1401 x i32]], ptr @board, i64 0, i64 %indvars.iv60.i, i64 %indvars.iv55.i.unr
%27 = load i32, ptr %arrayidx12.us.i.epil, align 4, !tbaa !14
%cmp13.us.i.epil = icmp eq i32 %27, 0
br i1 %cmp13.us.i.epil, label %if.then.us.i.epil, label %for.inc26.us.i.epil
if.then.us.i.epil: ; preds = %for.body8.us.i.epil
%arrayidx17.us.i.epil = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %20, i64 %indvars.iv55.i.unr
%28 = load i32, ptr %arrayidx17.us.i.epil, align 4, !tbaa !14
%add.us.i.epil = add nsw i32 %28, 1
br label %for.inc26.us.i.epil
for.inc26.us.i.epil: ; preds = %if.then.us.i.epil, %for.body8.us.i.epil
%.sink.i.epil = phi i32 [ %add.us.i.epil, %if.then.us.i.epil ], [ 0, %for.body8.us.i.epil ]
%29 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %indvars.iv60.i, i64 %indvars.iv55.i.unr
store i32 %.sink.i.epil, ptr %29, align 4
br label %for.cond6.for.inc29_crit_edge.us.i
for.cond6.for.inc29_crit_edge.us.i: ; preds = %for.cond6.for.inc29_crit_edge.us.i.unr-lcssa, %for.inc26.us.i.epil
%indvars.iv.next61.i = add nuw nsw i64 %indvars.iv60.i, 1
%exitcond65.not.i = icmp eq i64 %indvars.iv.next61.i, %wide.trip.count64.i
br i1 %exitcond65.not.i, label %create_table.exit, label %for.cond6.preheader.us.i, !llvm.loop !24
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds [1401 x i32], ptr @board, i64 0, i64 %indvars.iv.i
%30 = load i32, ptr %arrayidx.i, align 4, !tbaa !14
%tobool.not.i = icmp eq i32 %30, 0
%cond.i = zext i1 %tobool.not.i to i32
%arrayidx2.i = getelementptr inbounds [1401 x i32], ptr @table, i64 0, i64 %indvars.iv.i
store i32 %cond.i, ptr %arrayidx2.i, align 4, !tbaa !14
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond3.preheader.i, label %for.body.i, !llvm.loop !39
create_table.exit: ; preds = %for.cond6.for.inc29_crit_edge.us.i, %for.end9, %for.cond3.preheader.i
%cmp7.i = icmp sgt i32 %.lcssa, 0
br i1 %cmp7.i, label %for.body.preheader.i16, label %rectangleAreaMax.exit
for.body.preheader.i16: ; preds = %for.cond1.preheader.lr.ph, %create_table.exit
%31 = phi i32 [ %9, %create_table.exit ], [ %.pre34, %for.cond1.preheader.lr.ph ]
%.lcssa3740 = phi i32 [ %.lcssa, %create_table.exit ], [ %0, %for.cond1.preheader.lr.ph ]
%wide.trip.count.i17 = zext i32 %.lcssa3740 to i64
br label %for.body.i18
for.body.i18: ; preds = %for.body.i18, %for.body.preheader.i16
%indvars.iv.i19 = phi i64 [ 0, %for.body.preheader.i16 ], [ %indvars.iv.next.i22, %for.body.i18 ]
%max.08.i = phi i32 [ 0, %for.body.preheader.i16 ], [ %cond.i21, %for.body.i18 ]
%arrayidx.i20 = getelementptr inbounds [1401 x [1401 x i32]], ptr @table, i64 0, i64 %indvars.iv.i19
%call.i = call i32 @rectangleAreaMaxRow(ptr noundef nonnull %arrayidx.i20, i32 noundef %31)
%cond.i21 = call i32 @llvm.smax.i32(i32 %call.i, i32 %max.08.i)
%indvars.iv.next.i22 = add nuw nsw i64 %indvars.iv.i19, 1
%exitcond.not.i23 = icmp eq i64 %indvars.iv.next.i22, %wide.trip.count.i17
br i1 %exitcond.not.i23, label %rectangleAreaMax.exit, label %for.body.i18, !llvm.loop !34
rectangleAreaMax.exit: ; preds = %for.body.i18, %create_table.exit
%max.0.lcssa.i = phi i32 [ 0, %create_table.exit ], [ %cond.i21, %for.body.i18 ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %max.0.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #17
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #17
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #13
attributes #0 = { mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { 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 #11 = { mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { 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 #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { nounwind allocsize(0) }
attributes #15 = { cold }
attributes #16 = { noreturn nounwind }
attributes #17 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE 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 = !{!"_stack", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 8}
!13 = !{i64 0, i64 4, !14, i64 4, i64 4, !14}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16, !17, !18}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !16, !17}
!22 = distinct !{!22, !16, !17, !18}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !16, !18, !17}
!26 = distinct !{!26, !16, !17, !18}
!27 = distinct !{!27, !20}
!28 = distinct !{!28, !16, !17}
!29 = distinct !{!29, !16}
!30 = distinct !{!30, !16, !17, !18}
!31 = distinct !{!31, !20}
!32 = distinct !{!32, !16, !17}
!33 = distinct !{!33, !16}
!34 = distinct !{!34, !16}
!35 = distinct !{!35, !16}
!36 = distinct !{!36, !16, !37}
!37 = !{!"llvm.loop.unswitch.partial.disable"}
!38 = distinct !{!38, !16, !17, !18}
!39 = distinct !{!39, !16, !18, !17}
|
#include <stdio.h>
int main(void){
char rom[101];
int i , num[101] , sum;
while(scanf("%s" , rom)!=EOF){
for(i=0;;i++){
if(rom[i] == 'I') num[i] = 1;
else if(rom[i] == 'V') num[i] = 5;
else if(rom[i] == 'X') num[i] = 10;
else if(rom[i] == 'L') num[i] = 50;
else if(rom[i] == 'C') num[i] = 100;
else if(rom[i] == 'D') num[i] = 500;
else if(rom[i] == 'M') num[i] = 1000;
if(rom[i] == '\0'){
num[i] = 0;
break;
}
}
sum = 0;
i = 0;
while(1){
if(num[i] == 0 || num[i+1] == 0){
sum += num[i];
break;
}
if(num[i] >= num[i+1]){
sum += num[i];
i++;
}else{
sum += num[i+1] - num[i];
i += 2;
}
}
printf("%d\n" , sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191099/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191099/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%rom = alloca [101 x i8], align 16
%num = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %rom) #3
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %num) #3
%call148 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %rom)
%cmp.not149 = icmp eq i32 %call148, -1
br i1 %cmp.not149, label %while.end110, label %for.cond
for.cond: ; preds = %entry, %for.cond.backedge
%indvars.iv = phi i64 [ %indvars.iv.be, %for.cond.backedge ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %rom, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 73, label %for.inc.sink.split
i8 86, label %if.then10
i8 88, label %if.then19
i8 76, label %if.then28
i8 67, label %if.then37
i8 68, label %if.then46
i8 77, label %if.then55
i8 0, label %if.then69
]
if.then10: ; preds = %for.cond
br label %for.inc.sink.split
if.then19: ; preds = %for.cond
br label %for.inc.sink.split
if.then28: ; preds = %for.cond
br label %for.inc.sink.split
if.then37: ; preds = %for.cond
br label %for.inc.sink.split
if.then46: ; preds = %for.cond
br label %for.inc.sink.split
if.then55: ; preds = %for.cond
br label %for.inc.sink.split
if.then69: ; preds = %for.cond
%arrayidx71 = getelementptr inbounds [101 x i32], ptr %num, i64 0, i64 %indvars.iv
store i32 0, ptr %arrayidx71, align 4, !tbaa !8
%1 = load i32, ptr %num, align 16, !tbaa !8
%cmp77142 = icmp eq i32 %1, 0
br i1 %cmp77142, label %if.then83, label %lor.lhs.false
for.inc.sink.split: ; preds = %for.cond, %if.then10, %if.then28, %if.then46, %if.then55, %if.then37, %if.then19
%.sink = phi i32 [ 10, %if.then19 ], [ 100, %if.then37 ], [ 1000, %if.then55 ], [ 500, %if.then46 ], [ 50, %if.then28 ], [ 5, %if.then10 ], [ 1, %for.cond ]
%arrayidx4 = getelementptr inbounds [101 x i32], ptr %num, i64 0, i64 %indvars.iv
store i32 %.sink, ptr %arrayidx4, align 4, !tbaa !8
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.cond
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond.backedge
for.cond.backedge: ; preds = %for.inc, %if.then83
%indvars.iv.be = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %if.then83 ]
br label %for.cond, !llvm.loop !10
lor.lhs.false: ; preds = %if.then69, %if.end87
%2 = phi i32 [ %5, %if.end87 ], [ %1, %if.then69 ]
%sum.0144 = phi i32 [ %sum.1, %if.end87 ], [ 0, %if.then69 ]
%i.1143 = phi i32 [ %i.2, %if.end87 ], [ 0, %if.then69 ]
%add = add nsw i32 %i.1143, 1
%idxprom79 = sext i32 %add to i64
%arrayidx80 = getelementptr inbounds [101 x i32], ptr %num, i64 0, i64 %idxprom79
%3 = load i32, ptr %arrayidx80, align 4, !tbaa !8
%cmp81 = icmp eq i32 %3, 0
br i1 %cmp81, label %if.then83.loopexit, label %if.end87
if.then83.loopexit: ; preds = %lor.lhs.false, %if.end87
%sum.0.lcssa.ph = phi i32 [ %sum.1, %if.end87 ], [ %sum.0144, %lor.lhs.false ]
%.lcssa.ph = phi i32 [ 0, %if.end87 ], [ %2, %lor.lhs.false ]
%4 = add nsw i32 %.lcssa.ph, %sum.0.lcssa.ph
br label %if.then83
if.then83: ; preds = %if.then83.loopexit, %if.then69
%add86 = phi i32 [ 0, %if.then69 ], [ %4, %if.then83.loopexit ]
%call109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add86)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %rom)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end110, label %for.cond.backedge
if.end87: ; preds = %lor.lhs.false
%cmp93.not = icmp slt i32 %2, %3
%sub = sub nsw i32 %3, %2
%add107 = add nsw i32 %i.1143, 2
%i.2 = select i1 %cmp93.not, i32 %add107, i32 %add
%.pn = select i1 %cmp93.not, i32 %sub, i32 %2
%sum.1 = add nsw i32 %.pn, %sum.0144
%idxprom75 = sext i32 %i.2 to i64
%arrayidx76 = getelementptr inbounds [101 x i32], ptr %num, i64 0, i64 %idxprom75
%5 = load i32, ptr %arrayidx76, align 4, !tbaa !8
%cmp77 = icmp eq i32 %5, 0
br i1 %cmp77, label %if.then83.loopexit, label %lor.lhs.false
while.end110: ; preds = %if.then83, %entry
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %num) #3
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %rom) #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"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main()
{
int i,j,m,sum;
char s[1500];
while(~scanf("%s",s))
{
m=strlen(s);
sum=0;
for(i=m-1,j=0; j<m; j++,i--)
{
if(s[i]=='I'&&s[i+1]!='V'&&s[i+1]!='X')
sum+=1;
if(s[i]=='I'&&(s[i+1]=='V'||s[i+1]=='X'))
sum-=1;
if(s[i]=='V')
sum+=5;
if(s[i]=='X'&&s[i+1]!='L'&&s[i+1]!='C')
sum+=10;
if(s[i]=='X'&&(s[i+1]=='L'||s[i+1]=='C'))
sum-=10;
if(s[i]=='L')
sum+=50;
if(s[i]=='C'&&s[i+1]!='D'&&s[i+1]!='M')
sum+=100;
if(s[i]=='C'&&(s[i+1]=='D'||s[i+1]=='M'))
sum-=100;
if(s[i]=='D')
sum+=500;
if(s[i]=='M')
sum+=1000;
}
printf("%d\n",sum);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191149/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191149/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1500 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1500, ptr nonnull %s) #4
%call230 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%tobool.not231 = icmp eq i32 %call230, -1
br i1 %tobool.not231, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%conv = trunc i64 %call2 to i32
%cmp225 = icmp sgt i32 %conv, 0
br i1 %cmp225, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%sext = shl i64 %call2, 32
%0 = ashr exact i64 %sext, 32
br label %for.body
for.body: ; preds = %for.body.preheader, %if.end144
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %if.end144 ]
%sum.0228 = phi i32 [ 0, %for.body.preheader ], [ %sum.10, %if.end144 ]
%j.0226 = phi i32 [ 0, %for.body.preheader ], [ %inc, %if.end144 ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx = getelementptr inbounds [1500 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp5 = icmp eq i8 %1, 73
br i1 %cmp5, label %land.lhs.true, label %if.end40
land.lhs.true: ; preds = %for.body
%arrayidx8 = getelementptr inbounds [1500 x i8], ptr %s, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx8, align 1, !tbaa !5
switch i8 %2, label %if.then [
i8 86, label %land.lhs.true25
i8 88, label %land.lhs.true25
]
if.then: ; preds = %land.lhs.true
%add19 = add nsw i32 %sum.0228, 1
br label %land.lhs.true25
land.lhs.true25: ; preds = %land.lhs.true, %land.lhs.true, %if.then
%sum.1.ph = phi i32 [ %sum.0228, %land.lhs.true ], [ %sum.0228, %land.lhs.true ], [ %add19, %if.then ]
switch i8 %2, label %if.end144 [
i8 86, label %if.then38
i8 88, label %if.then38
]
if.then38: ; preds = %land.lhs.true25, %land.lhs.true25
%sub39 = add nsw i32 %sum.1.ph, -1
br label %if.end144
if.end40: ; preds = %for.body
%cmp44 = icmp eq i8 %1, 86
%add47 = add nsw i32 %sum.0228, 5
%spec.select = select i1 %cmp44, i32 %add47, i32 %sum.0228
%cmp52 = icmp eq i8 %1, 88
br i1 %cmp52, label %land.lhs.true54, label %if.end92
land.lhs.true54: ; preds = %if.end40
%arrayidx57 = getelementptr inbounds [1500 x i8], ptr %s, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx57, align 1, !tbaa !5
switch i8 %3, label %if.then68 [
i8 76, label %land.lhs.true76
i8 67, label %land.lhs.true76
]
if.then68: ; preds = %land.lhs.true54
%add69 = add nsw i32 %spec.select, 10
br label %land.lhs.true76
land.lhs.true76: ; preds = %if.then68, %land.lhs.true54, %land.lhs.true54
%sum.4.ph = phi i32 [ %spec.select, %land.lhs.true54 ], [ %spec.select, %land.lhs.true54 ], [ %add69, %if.then68 ]
switch i8 %3, label %if.end144 [
i8 76, label %if.then90
i8 67, label %if.then90
]
if.then90: ; preds = %land.lhs.true76, %land.lhs.true76
%sub91 = add nsw i32 %sum.4.ph, -10
br label %if.end144
if.end92: ; preds = %if.end40
%cmp96 = icmp eq i8 %1, 76
%add99 = add nsw i32 %spec.select, 50
%spec.select196 = select i1 %cmp96, i32 %add99, i32 %spec.select
%cmp104 = icmp eq i8 %1, 67
br i1 %cmp104, label %land.lhs.true106, label %if.end144
land.lhs.true106: ; preds = %if.end92
%arrayidx109 = getelementptr inbounds [1500 x i8], ptr %s, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx109, align 1, !tbaa !5
switch i8 %4, label %if.then120 [
i8 68, label %land.lhs.true128
i8 77, label %land.lhs.true128
]
if.then120: ; preds = %land.lhs.true106
%add121 = add nsw i32 %spec.select196, 100
br label %land.lhs.true128
land.lhs.true128: ; preds = %if.then120, %land.lhs.true106, %land.lhs.true106
%sum.7.ph = phi i32 [ %spec.select196, %land.lhs.true106 ], [ %spec.select196, %land.lhs.true106 ], [ %add121, %if.then120 ]
switch i8 %4, label %if.end144 [
i8 68, label %if.then142
i8 77, label %if.then142
]
if.then142: ; preds = %land.lhs.true128, %land.lhs.true128
%sub143 = add nsw i32 %sum.7.ph, -100
br label %if.end144
if.end144: ; preds = %if.then90, %land.lhs.true76, %land.lhs.true25, %if.then38, %if.end92, %land.lhs.true128, %if.then142
%sum.8 = phi i32 [ %sub143, %if.then142 ], [ %sum.7.ph, %land.lhs.true128 ], [ %spec.select196, %if.end92 ], [ %sum.4.ph, %land.lhs.true76 ], [ %sub91, %if.then90 ], [ %sum.1.ph, %land.lhs.true25 ], [ %sub39, %if.then38 ]
%cmp148 = icmp eq i8 %1, 68
%add151 = add nsw i32 %sum.8, 500
%spec.select197 = select i1 %cmp148, i32 %add151, i32 %sum.8
%cmp156 = icmp eq i8 %1, 77
%add159 = add nsw i32 %spec.select197, 1000
%sum.10 = select i1 %cmp156, i32 %add159, i32 %spec.select197
%inc = add nuw nsw i32 %j.0226, 1
%exitcond.not = icmp eq i32 %inc, %conv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %if.end144, %while.body
%sum.0.lcssa = phi i32 [ 0, %while.body ], [ %sum.10, %if.end144 ]
%call161 = 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 %s)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !10
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 1500, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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"}
!10 = distinct !{!10, !9}
|
#include<stdio.h>
int main(void) {
int N,i;
double A[1000],sum=0.0;
scanf("%d\n", &N);
for (i = 0; i < N; i++) {
scanf("%lf", &A[i]);
sum += 1.0/A[i];
}
printf("%f", 1.0 / sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191192/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191192/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%f\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 [1000 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 8000, 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
%cmp10 = icmp sgt i32 %0, 0
br i1 %cmp10, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.012 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
%arrayidx = getelementptr inbounds [1000 x double], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load double, ptr %arrayidx, align 8, !tbaa !9
%div = fdiv double 1.000000e+00, %1
%add = fadd double %sum.012, %div
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ]
%div4 = fdiv double 1.000000e+00, %sum.0.lcssa
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div4)
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n;
double sum = 0;
scanf("%d", &n);
double data[n];
for(int i = 0; i < n; i++){
scanf("%lf", &data[i]);
sum += 1 / data[i];
}
printf("%lf\n", 1 / sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191235/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191235/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca double, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %3, 0
br i1 %cmp10, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%sum.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ]
%div4 = fdiv double 1.000000e+00, %sum.0.lcssa
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div4)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.011 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
%arrayidx = getelementptr inbounds double, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%4 = load double, ptr %arrayidx, align 8, !tbaa !9
%div = fdiv double 1.000000e+00, %4
%add = fadd double %sum.011, %div
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#define REP(i,n) for(i=0;i<n;i++)
#define ll long long
#define PI M_PI
int main(void){
int i;
int N; scanf("%d",&N);
int A[N];
REP(i,N) scanf("%d",&A[i]);
i=0;
double ans = 0;
while(i<N){
ans += (double)1/A[i];
i++;
}
printf("%f",1/ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191279/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191279/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %3, 0
br i1 %cmp14, label %for.body, label %while.end
while.cond.preheader: ; preds = %for.body
%cmp216 = icmp sgt i32 %5, 0
br i1 %cmp216, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %while.cond.preheader
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%4 = icmp ult i32 %5, 4
br i1 %4, label %while.end.loopexit.unr-lcssa, label %while.body.preheader.new
while.body.preheader.new: ; preds = %while.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %while.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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 %while.cond.preheader, !llvm.loop !9
while.body: ; preds = %while.body, %while.body.preheader.new
%indvars.iv22 = phi i64 [ 0, %while.body.preheader.new ], [ %indvars.iv.next23.3, %while.body ]
%ans.018 = phi double [ 0.000000e+00, %while.body.preheader.new ], [ %add.3, %while.body ]
%niter = phi i64 [ 0, %while.body.preheader.new ], [ %niter.next.3, %while.body ]
%arrayidx4 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv22
%7 = load i32, ptr %arrayidx4, align 16, !tbaa !5
%conv = sitofp i32 %7 to double
%div = fdiv double 1.000000e+00, %conv
%add = fadd double %ans.018, %div
%indvars.iv.next23 = or i64 %indvars.iv22, 1
%arrayidx4.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next23
%8 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%conv.1 = sitofp i32 %8 to double
%div.1 = fdiv double 1.000000e+00, %conv.1
%add.1 = fadd double %add, %div.1
%indvars.iv.next23.1 = or i64 %indvars.iv22, 2
%arrayidx4.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next23.1
%9 = load i32, ptr %arrayidx4.2, align 8, !tbaa !5
%conv.2 = sitofp i32 %9 to double
%div.2 = fdiv double 1.000000e+00, %conv.2
%add.2 = fadd double %add.1, %div.2
%indvars.iv.next23.2 = or i64 %indvars.iv22, 3
%arrayidx4.3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next23.2
%10 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%conv.3 = sitofp i32 %10 to double
%div.3 = fdiv double 1.000000e+00, %conv.3
%add.3 = fadd double %add.2, %div.3
%indvars.iv.next23.3 = add nuw nsw i64 %indvars.iv22, 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 %while.end.loopexit.unr-lcssa, label %while.body, !llvm.loop !11
while.end.loopexit.unr-lcssa: ; preds = %while.body, %while.body.preheader
%add.lcssa.ph = phi double [ undef, %while.body.preheader ], [ %add.3, %while.body ]
%indvars.iv22.unr = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next23.3, %while.body ]
%ans.018.unr = phi double [ 0.000000e+00, %while.body.preheader ], [ %add.3, %while.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.end, label %while.body.epil
while.body.epil: ; preds = %while.end.loopexit.unr-lcssa, %while.body.epil
%indvars.iv22.epil = phi i64 [ %indvars.iv.next23.epil, %while.body.epil ], [ %indvars.iv22.unr, %while.end.loopexit.unr-lcssa ]
%ans.018.epil = phi double [ %add.epil, %while.body.epil ], [ %ans.018.unr, %while.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %while.body.epil ], [ 0, %while.end.loopexit.unr-lcssa ]
%arrayidx4.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv22.epil
%11 = load i32, ptr %arrayidx4.epil, align 4, !tbaa !5
%conv.epil = sitofp i32 %11 to double
%div.epil = fdiv double 1.000000e+00, %conv.epil
%add.epil = fadd double %ans.018.epil, %div.epil
%indvars.iv.next23.epil = add nuw nsw i64 %indvars.iv22.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 %while.end, label %while.body.epil, !llvm.loop !12
while.end: ; preds = %while.end.loopexit.unr-lcssa, %while.body.epil, %entry, %while.cond.preheader
%ans.0.lcssa = phi double [ 0.000000e+00, %while.cond.preheader ], [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %while.end.loopexit.unr-lcssa ], [ %add.epil, %while.body.epil ]
%div6 = fdiv double 1.000000e+00, %ans.0.lcssa
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div6)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
|
// AtCoder ABC138: B - Resistors in Parallel
// 2019.8.26 bal4u
#include <stdio.h>
int main()
{
int a, N;
double s;
scanf("%d", &N);
s = 0; while (N--) {
scanf("%d", &a);
s += 1.0/a;
}
printf("%.8lf\n", 1/s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191321/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.8lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%N = 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 %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
%dec5 = add nsw i32 %0, -1
store i32 %dec5, ptr %N, align 4, !tbaa !5
%tobool.not6 = icmp eq i32 %0, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%s.07 = phi double [ %add, %while.body ], [ 0.000000e+00, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%conv = sitofp i32 %1 to double
%div = fdiv double 1.000000e+00, %conv
%add = fadd double %s.07, %div
%2 = load i32, ptr %N, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %N, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%s.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %while.body ]
%div2 = fdiv double 1.000000e+00, %s.0.lcssa
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int N;
scanf("%d",&N);
int A[N];
double ans=0;
for(int i=0;i<N;i++){
scanf("%d",&A[i]);
}
for(int i=0;i<N;i++){
ans+=1/(double)A[i];
}
ans=(double)1/ans;
printf("%lf\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191365/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191365/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %3, 0
br i1 %cmp20, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp422 = icmp sgt i32 %5, 0
br i1 %cmp422, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%4 = icmp ult i32 %5, 4
br i1 %4, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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.cond3.preheader, !llvm.loop !9
for.cond.cleanup5.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader
%add.lcssa.ph = phi double [ undef, %for.body6.preheader ], [ %add.3, %for.body6 ]
%indvars.iv28.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next29.3, %for.body6 ]
%ans.023.unr = phi double [ 0.000000e+00, %for.body6.preheader ], [ %add.3, %for.body6 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup5, label %for.body6.epil
for.body6.epil: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa, %for.body6.epil
%indvars.iv28.epil = phi i64 [ %indvars.iv.next29.epil, %for.body6.epil ], [ %indvars.iv28.unr, %for.cond.cleanup5.loopexit.unr-lcssa ]
%ans.023.epil = phi double [ %add.epil, %for.body6.epil ], [ %ans.023.unr, %for.cond.cleanup5.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body6.epil ], [ 0, %for.cond.cleanup5.loopexit.unr-lcssa ]
%arrayidx8.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv28.epil
%7 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5
%conv.epil = sitofp i32 %7 to double
%div.epil = fdiv double 1.000000e+00, %conv.epil
%add.epil = fadd double %ans.023.epil, %div.epil
%indvars.iv.next29.epil = add nuw nsw i64 %indvars.iv28.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup5, label %for.body6.epil, !llvm.loop !11
for.cond.cleanup5: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa, %for.body6.epil, %entry, %for.cond3.preheader
%ans.0.lcssa = phi double [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.cond.cleanup5.loopexit.unr-lcssa ], [ %add.epil, %for.body6.epil ]
%div12 = fdiv double 1.000000e+00, %ans.0.lcssa
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div12)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
for.body6: ; preds = %for.body6, %for.body6.preheader.new
%indvars.iv28 = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next29.3, %for.body6 ]
%ans.023 = phi double [ 0.000000e+00, %for.body6.preheader.new ], [ %add.3, %for.body6 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.3, %for.body6 ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv28
%8 = load i32, ptr %arrayidx8, align 16, !tbaa !5
%conv = sitofp i32 %8 to double
%div = fdiv double 1.000000e+00, %conv
%add = fadd double %ans.023, %div
%indvars.iv.next29 = or i64 %indvars.iv28, 1
%arrayidx8.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next29
%9 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%conv.1 = sitofp i32 %9 to double
%div.1 = fdiv double 1.000000e+00, %conv.1
%add.1 = fadd double %add, %div.1
%indvars.iv.next29.1 = or i64 %indvars.iv28, 2
%arrayidx8.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next29.1
%10 = load i32, ptr %arrayidx8.2, align 8, !tbaa !5
%conv.2 = sitofp i32 %10 to double
%div.2 = fdiv double 1.000000e+00, %conv.2
%add.2 = fadd double %add.1, %div.2
%indvars.iv.next29.2 = or i64 %indvars.iv28, 3
%arrayidx8.3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next29.2
%11 = load i32, ptr %arrayidx8.3, align 4, !tbaa !5
%conv.3 = sitofp i32 %11 to double
%div.3 = fdiv double 1.000000e+00, %conv.3
%add.3 = fadd double %add.2, %div.3
%indvars.iv.next29.3 = add nuw nsw i64 %indvars.iv28, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main()
{
int a,i;
float j=0.0,sum=0.0;
int c[100];
scanf("%d",&a);
for(i=0;i<a;i++)
{
scanf("%d",&c[i]);
}
for(i=0;i<a;i++)
{
j=j+(1.0/c[i]);
}
sum=1.0/j;
printf("%f",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191408/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191408/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%c = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %0, 0
br i1 %cmp23, label %for.body, label %for.end11
for.cond2.preheader: ; preds = %for.body
%cmp325 = icmp sgt i32 %2, 0
br i1 %cmp325, label %for.body4.preheader, label %for.end11
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %2 to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %2, 1
br i1 %1, label %for.end11.loopexit.unr-lcssa, label %for.body4.preheader.new
for.body4.preheader.new: ; preds = %for.body4.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4, %for.body4.preheader.new
%indvars.iv31 = phi i64 [ 0, %for.body4.preheader.new ], [ %indvars.iv.next32.1, %for.body4 ]
%j.027 = phi float [ 0.000000e+00, %for.body4.preheader.new ], [ %conv8.1, %for.body4 ]
%niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.body4 ]
%conv = fpext float %j.027 to double
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv31
%4 = load i32, ptr %arrayidx6, align 8, !tbaa !5
%conv7 = sitofp i32 %4 to double
%div = fdiv double 1.000000e+00, %conv7
%add = fadd double %div, %conv
%conv8 = fptrunc double %add to float
%indvars.iv.next32 = or i64 %indvars.iv31, 1
%conv.1 = fpext float %conv8 to double
%arrayidx6.1 = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv.next32
%5 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%conv7.1 = sitofp i32 %5 to double
%div.1 = fdiv double 1.000000e+00, %conv7.1
%add.1 = fadd double %div.1, %conv.1
%conv8.1 = fptrunc double %add.1 to float
%indvars.iv.next32.1 = add nuw nsw i64 %indvars.iv31, 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.end11.loopexit.unr-lcssa.loopexit, label %for.body4, !llvm.loop !11
for.end11.loopexit.unr-lcssa.loopexit: ; preds = %for.body4
%6 = fpext float %conv8.1 to double
br label %for.end11.loopexit.unr-lcssa
for.end11.loopexit.unr-lcssa: ; preds = %for.end11.loopexit.unr-lcssa.loopexit, %for.body4.preheader
%conv8.lcssa.ph = phi float [ undef, %for.body4.preheader ], [ %conv8.1, %for.end11.loopexit.unr-lcssa.loopexit ]
%indvars.iv31.unr = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next32.1, %for.end11.loopexit.unr-lcssa.loopexit ]
%j.027.unr = phi double [ 0.000000e+00, %for.body4.preheader ], [ %6, %for.end11.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end11, label %for.body4.epil
for.body4.epil: ; preds = %for.end11.loopexit.unr-lcssa
%arrayidx6.epil = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv31.unr
%7 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5
%conv7.epil = sitofp i32 %7 to double
%div.epil = fdiv double 1.000000e+00, %conv7.epil
%add.epil = fadd double %div.epil, %j.027.unr
%conv8.epil = fptrunc double %add.epil to float
br label %for.end11
for.end11: ; preds = %for.body4.epil, %for.end11.loopexit.unr-lcssa, %entry, %for.cond2.preheader
%j.0.lcssa = phi float [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %conv8.lcssa.ph, %for.end11.loopexit.unr-lcssa ], [ %conv8.epil, %for.body4.epil ]
%conv14 = fdiv float 1.000000e+00, %j.0.lcssa
%conv15 = fpext float %conv14 to double
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv15)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int N = 0;
int i= 0;
double A[1024];
double Abar[1024];
double sum = 0, sumbar = 0;
scanf("%d", &N);
for(i = 0; i < N; i++){
scanf("%lf", &A[i]);
Abar[i] = 1/A[i];
sum += Abar[i];
}
sumbar = 1/sum;
printf("%f", sumbar);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191451/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%f\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 [1024 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
store i32 0, ptr %N, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 8192, 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
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.018 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
%arrayidx = getelementptr inbounds [1024 x double], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load double, ptr %arrayidx, align 8, !tbaa !9
%div = fdiv double 1.000000e+00, %1
%add = fadd double %sum.018, %div
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ]
%div8 = fdiv double 1.000000e+00, %sum.0.lcssa
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div8)
call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int a[1000];
int main(void)
{
int n;
double ans;
scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%d",&(a[i]));
ans = 0;
for(int i=0;i<n;i++) ans += ((double)1/(double)a[i]);
printf("%g\n", (double)1/ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191495/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191495/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@a = dso_local global [1000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%g\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @acs(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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp421 = icmp sgt i32 %2, 0
br i1 %cmp421, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %2 to i64
%xtraiter = and i64 %wide.trip.count, 3
%1 = icmp ult i32 %2, 4
br i1 %1, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond.cleanup5.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader
%add.lcssa.ph = phi double [ undef, %for.body6.preheader ], [ %add.3, %for.body6 ]
%indvars.iv27.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next28.3, %for.body6 ]
%ans.022.unr = phi double [ 0.000000e+00, %for.body6.preheader ], [ %add.3, %for.body6 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup5, label %for.body6.epil
for.body6.epil: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa, %for.body6.epil
%indvars.iv27.epil = phi i64 [ %indvars.iv.next28.epil, %for.body6.epil ], [ %indvars.iv27.unr, %for.cond.cleanup5.loopexit.unr-lcssa ]
%ans.022.epil = phi double [ %add.epil, %for.body6.epil ], [ %ans.022.unr, %for.cond.cleanup5.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body6.epil ], [ 0, %for.cond.cleanup5.loopexit.unr-lcssa ]
%arrayidx8.epil = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %indvars.iv27.epil
%4 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5
%conv.epil = sitofp i32 %4 to double
%div.epil = fdiv double 1.000000e+00, %conv.epil
%add.epil = fadd double %ans.022.epil, %div.epil
%indvars.iv.next28.epil = add nuw nsw i64 %indvars.iv27.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup5, label %for.body6.epil, !llvm.loop !11
for.cond.cleanup5: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa, %for.body6.epil, %entry, %for.cond3.preheader
%ans.0.lcssa = phi double [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.cond.cleanup5.loopexit.unr-lcssa ], [ %add.epil, %for.body6.epil ]
%div12 = fdiv double 1.000000e+00, %ans.0.lcssa
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div12)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body6: ; preds = %for.body6, %for.body6.preheader.new
%indvars.iv27 = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next28.3, %for.body6 ]
%ans.022 = phi double [ 0.000000e+00, %for.body6.preheader.new ], [ %add.3, %for.body6 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.3, %for.body6 ]
%arrayidx8 = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %indvars.iv27
%5 = load i32, ptr %arrayidx8, align 16, !tbaa !5
%conv = sitofp i32 %5 to double
%div = fdiv double 1.000000e+00, %conv
%add = fadd double %ans.022, %div
%indvars.iv.next28 = or i64 %indvars.iv27, 1
%arrayidx8.1 = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %indvars.iv.next28
%6 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%conv.1 = sitofp i32 %6 to double
%div.1 = fdiv double 1.000000e+00, %conv.1
%add.1 = fadd double %add, %div.1
%indvars.iv.next28.1 = or i64 %indvars.iv27, 2
%arrayidx8.2 = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %indvars.iv.next28.1
%7 = load i32, ptr %arrayidx8.2, align 8, !tbaa !5
%conv.2 = sitofp i32 %7 to double
%div.2 = fdiv double 1.000000e+00, %conv.2
%add.2 = fadd double %add.1, %div.2
%indvars.iv.next28.2 = or i64 %indvars.iv27, 3
%arrayidx8.3 = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %indvars.iv.next28.2
%8 = load i32, ptr %arrayidx8.3, align 4, !tbaa !5
%conv.3 = sitofp i32 %8 to double
%div.3 = fdiv double 1.000000e+00, %conv.3
%add.3 = fadd double %add.2, %div.3
%indvars.iv.next28.3 = add nuw nsw i64 %indvars.iv27, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!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 <string.h>
int main(void) {
int i, j;
char t[101], c, st[101];
while (1) {
for (i = 0; ~scanf("%c", &c) && c != '\n'; i++) {
t[i] = c;
}
t[i] = 0;
if (t[0] == '.' && t[1] == 0) {
return 0;
}
memset(st, 0, sizeof st);
for (i = 0, j = 0; i <= strlen(t); i++) {
if (t[i] == '(' || t[i] == '[') {
st[j++] = t[i];
}
if (t[i] == ')') {
if (st[--j] != '(') {
puts("no");
break;
}
}
if (t[i] == ']') {
if (st[--j] != '[') {
puts("no");
break;
}
}
if (t[i] == 0) {
puts(j ? "no" : "yes");
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191545/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"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:
%t = alloca [101 x i8], align 16
%c = alloca i8, align 1
%st = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %st) #5
%arrayidx8 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 1
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call97 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%tobool98 = icmp ne i32 %call97, -1
%0 = load i8, ptr %c, align 1
%cmp99 = icmp ne i8 %0, 10
%1 = select i1 %tobool98, i1 %cmp99, i1 false
br i1 %1, label %for.body, label %for.end
for.body: ; preds = %while.cond, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.cond ]
%2 = phi i8 [ %3, %for.body ], [ %0, %while.cond ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv
store i8 %2, ptr %arrayidx, align 1, !tbaa !5
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%tobool = icmp ne i32 %call, -1
%3 = load i8, ptr %c, align 1
%cmp = icmp ne i8 %3, 10
%4 = select i1 %tobool, i1 %cmp, i1 false
br i1 %4, label %for.body, label %for.end, !llvm.loop !8
for.end: ; preds = %for.body, %while.cond
%i.0.lcssa = phi i64 [ 0, %while.cond ], [ %indvars.iv.next, %for.body ]
%idxprom2 = and i64 %i.0.lcssa, 4294967295
%arrayidx3 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %idxprom2
store i8 0, ptr %arrayidx3, align 1, !tbaa !5
%5 = load i8, ptr %t, align 16, !tbaa !5
%cmp6 = icmp eq i8 %5, 46
%6 = load i8, ptr %arrayidx8, align 1
%cmp10 = icmp eq i8 %6, 0
%or.cond = select i1 %cmp6, i1 %cmp10, i1 false
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %for.end
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %st) #5
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #5
ret i32 0
if.end: ; preds = %for.end
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %st, i8 0, i64 101, i1 false)
%call15 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6
br label %for.body18
for.body18: ; preds = %if.end, %for.inc76
%indvars.iv104 = phi i64 [ 0, %if.end ], [ %indvars.iv.next105, %for.inc76 ]
%j.0102 = phi i32 [ 0, %if.end ], [ %j.396, %for.inc76 ]
%arrayidx20 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv104
%7 = load i8, ptr %arrayidx20, align 1, !tbaa !5
switch i8 %7, label %if.end35 [
i8 40, label %if.then29
i8 91, label %if.then29
]
if.then29: ; preds = %for.body18, %for.body18
%inc32 = add nsw i32 %j.0102, 1
%idxprom33 = sext i32 %j.0102 to i64
%arrayidx34 = getelementptr inbounds [101 x i8], ptr %st, i64 0, i64 %idxprom33
store i8 %7, ptr %arrayidx34, align 1, !tbaa !5
br label %if.end35
if.end35: ; preds = %for.body18, %if.then29
%j.1 = phi i32 [ %inc32, %if.then29 ], [ %j.0102, %for.body18 ]
switch i8 %7, label %for.inc76 [
i8 41, label %if.then41
i8 93, label %if.then56
i8 0, label %if.then72
]
if.then41: ; preds = %if.end35
%dec = add nsw i32 %j.1, -1
%idxprom42 = sext i32 %dec to i64
%arrayidx43 = getelementptr inbounds [101 x i8], ptr %st, i64 0, i64 %idxprom42
%8 = load i8, ptr %arrayidx43, align 1, !tbaa !5
%cmp45.not = icmp eq i8 %8, 40
br i1 %cmp45.not, label %for.inc76, label %for.end78.sink.split
if.then56: ; preds = %if.end35
%dec57 = add nsw i32 %j.1, -1
%idxprom58 = sext i32 %dec57 to i64
%arrayidx59 = getelementptr inbounds [101 x i8], ptr %st, i64 0, i64 %idxprom58
%9 = load i8, ptr %arrayidx59, align 1, !tbaa !5
%cmp61.not = icmp eq i8 %9, 91
br i1 %cmp61.not, label %for.inc76, label %for.end78.sink.split
if.then72: ; preds = %if.end35
%tobool73.not = icmp eq i32 %j.1, 0
%cond = select i1 %tobool73.not, ptr @.str.2, ptr @.str.1
%call74 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
br label %for.inc76
for.inc76: ; preds = %if.end35, %if.then41, %if.then56, %if.then72
%j.396 = phi i32 [ %j.1, %if.then72 ], [ %dec57, %if.then56 ], [ %dec, %if.then41 ], [ %j.1, %if.end35 ]
%indvars.iv.next105 = add nuw i64 %indvars.iv104, 1
%exitcond = icmp eq i64 %indvars.iv104, %call15
br i1 %exitcond, label %while.cond.backedge, label %for.body18, !llvm.loop !10
for.end78.sink.split: ; preds = %if.then56, %if.then41
%call64 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %while.cond.backedge
while.cond.backedge: ; preds = %for.inc76, %for.end78.sink.split
br label %while.cond
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdlib.h>
#include <stdio.h>
long long MIN(long long a, long long b){
return a<b?a:b;
}
int main()
{ int n;
scanf("%d",&n);
long long a[n],full=0;
for(int i=0;i<n;i++){
scanf("%lld",&a[i]);
full+=a[i];
}
long long left=0,point;
for(int i=0;i<n;i++){
left+=a[i];
if(left>=full/2){
point=i;
break;
}
}
long long ans=MIN(llabs(left-(full-left)),llabs((left-a[point])-(full-(left-a[point]))));
printf("%lld",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191602/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191602/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @MIN(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %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) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp48 = icmp sgt i32 %3, 0
br i1 %cmp48, label %for.body, label %for.cond5.preheader.cleanup_crit_edge
for.cond5.preheader: ; preds = %for.body
%cmp653 = icmp sgt i32 %5, 0
br i1 %cmp653, label %for.body8.lr.ph, label %for.cond5.preheader.cleanup_crit_edge
for.cond5.preheader.cleanup_crit_edge: ; preds = %entry, %for.cond5.preheader
%full.0.lcssa4769 = phi i64 [ %add, %for.cond5.preheader ], [ 0, %entry ]
%arrayidx17.phi.trans.insert = getelementptr inbounds i64, ptr %vla, i64 undef
%.pre = load i64, ptr %arrayidx17.phi.trans.insert, align 8, !tbaa !9
br label %cleanup
for.body8.lr.ph: ; preds = %for.cond5.preheader
%div = sdiv i64 %add, 2
%wide.trip.count = zext i32 %5 to i64
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%full.049 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%4 = load i64, ptr %arrayidx, align 8, !tbaa !9
%add = add nsw i64 %4, %full.049
%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.cond5.preheader, !llvm.loop !11
for.body8: ; preds = %for.body8, %for.body8.lr.ph
%indvars.iv62 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next63, %for.body8 ]
%left.054 = phi i64 [ 0, %for.body8.lr.ph ], [ %add11, %for.body8 ]
%arrayidx10 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv62
%7 = load i64, ptr %arrayidx10, align 8, !tbaa !9
%add11 = add nsw i64 %7, %left.054
%cmp12.not = icmp sge i64 %add11, %div
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count
%or.cond = select i1 %cmp12.not, i1 true, i1 %exitcond.not
br i1 %or.cond, label %cleanup, label %for.body8, !llvm.loop !13
cleanup: ; preds = %for.body8, %for.cond5.preheader.cleanup_crit_edge
%full.0.lcssa4768 = phi i64 [ %full.0.lcssa4769, %for.cond5.preheader.cleanup_crit_edge ], [ %add, %for.body8 ]
%8 = phi i64 [ %.pre, %for.cond5.preheader.cleanup_crit_edge ], [ %7, %for.body8 ]
%left.1 = phi i64 [ 0, %for.cond5.preheader.cleanup_crit_edge ], [ %add11, %for.body8 ]
%factor = shl i64 %left.1, 1
%sub16 = sub i64 %factor, %full.0.lcssa4768
%9 = call i64 @llvm.abs.i64(i64 %sub16, i1 true)
%sub18 = sub nsw i64 %left.1, %8
%factor46 = shl i64 %sub18, 1
%sub22 = sub i64 %factor46, %full.0.lcssa4768
%10 = call i64 @llvm.abs.i64(i64 %sub22, i1 true)
%cond.i = call i64 @llvm.smin.i64(i64 %9, i64 %10)
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cond.i)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: 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 speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, 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
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6
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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
int main(){
long long A,B,C,X,Y;
scanf("%ld%ld%ld%ld%ld",&A,&B,&C,&X,&Y);
long long cc=0;
if(X>Y)cc=X;
else cc=Y;
long long money=cc*C*2;
for(;cc>=0;cc--){
long long sub=0;
if(X>cc)sub+=(X-cc)*A;
if(Y>cc)sub+=(Y-cc)*B;
if(money<sub+cc*C*2)break;
money=sub+cc*C*2;
}
printf("%ld\n",money);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191675/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191675/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [16 x i8] c"%ld%ld%ld%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i64, align 8
%B = alloca i64, align 8
%C = alloca i64, align 8
%X = alloca i64, align 8
%Y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %X, ptr noundef nonnull %Y)
%0 = load i64, ptr %X, align 8, !tbaa !5
%1 = load i64, ptr %Y, align 8, !tbaa !5
%. = call i64 @llvm.smax.i64(i64 %0, i64 %1)
%2 = load i64, ptr %C, align 8, !tbaa !5
%mul = shl i64 %2, 1
%mul1 = mul i64 %mul, %.
%cmp240 = icmp sgt i64 %., -1
br i1 %cmp240, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%3 = load i64, ptr %A, align 8
%4 = load i64, ptr %B, align 8
br label %for.body
for.cond: ; preds = %for.body
%dec = add nsw i64 %cc.141, -1
%cmp2 = icmp sgt i64 %cc.141, 0
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9
for.body: ; preds = %for.body.lr.ph, %for.cond
%money.042 = phi i64 [ %mul1, %for.body.lr.ph ], [ %add16, %for.cond ]
%cc.141 = phi i64 [ %., %for.body.lr.ph ], [ %dec, %for.cond ]
%cmp3 = icmp sgt i64 %0, %cc.141
%sub5 = sub nsw i64 %0, %cc.141
%mul6 = mul nsw i64 %3, %sub5
%sub.0 = select i1 %cmp3, i64 %mul6, i64 0
%cmp8 = icmp sgt i64 %1, %cc.141
%sub10 = sub nsw i64 %1, %cc.141
%mul11 = mul nsw i64 %4, %sub10
%add12 = select i1 %cmp8, i64 %mul11, i64 0
%sub.1 = add nsw i64 %sub.0, %add12
%mul15 = mul i64 %mul, %cc.141
%add16 = add nsw i64 %sub.1, %mul15
%cmp17 = icmp slt i64 %money.042, %add16
br i1 %cmp17, label %for.end, label %for.cond
for.end: ; preds = %for.cond, %for.body, %entry
%money.0.lcssa = phi i64 [ %mul1, %entry ], [ %money.042, %for.body ], [ %add16, %for.cond ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %money.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Y) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#define ll long long
#define rep(i,l,r,d) for(ll i=(l);i<(r);i+=(d))
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
int main(void){
ll A, B, C, X, Y, ANS;
scanf("%lld %lld %lld %lld %lld", &A, &B, &C, &X, &Y);
if(A+B < 2*C) ANS = A*min(X,Y) + B*min(X,Y);
else ANS = 2*C*min(X,Y);
if(X>Y){
if(A<2*C) ANS += A*(X-Y);
else ANS += 2*C*(X-Y);
}
else {
if(B<2*C) ANS += B*(Y-X);
else ANS += 2*C*(Y-X);
}
printf("%lld\n", ANS);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191718/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191718/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [25 x i8] c"%lld %lld %lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i64, align 8
%B = alloca i64, align 8
%C = alloca i64, align 8
%X = alloca i64, align 8
%Y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %X, ptr noundef nonnull %Y)
%0 = load i64, ptr %A, align 8, !tbaa !5
%1 = load i64, ptr %B, align 8, !tbaa !5
%2 = load i64, ptr %C, align 8, !tbaa !5
%mul = shl nsw i64 %2, 1
%3 = load i64, ptr %X, align 8
%4 = load i64, ptr %Y, align 8
%cmp17 = icmp sgt i64 %3, %4
br i1 %cmp17, label %if.then18, label %if.else30
if.then18: ; preds = %entry
%cmp20 = icmp slt i64 %0, %mul
%sub = sub nsw i64 %3, %4
br i1 %cmp20, label %if.then21, label %if.else24
if.then21: ; preds = %if.then18
%mul22 = mul nsw i64 %sub, %0
br label %if.end43
if.else24: ; preds = %if.then18
%mul27 = mul nsw i64 %sub, %mul
br label %if.end43
if.else30: ; preds = %entry
%cmp32 = icmp slt i64 %1, %mul
%sub34 = sub nsw i64 %4, %3
br i1 %cmp32, label %if.then33, label %if.else37
if.then33: ; preds = %if.else30
%mul35 = mul nsw i64 %sub34, %1
br label %if.end43
if.else37: ; preds = %if.else30
%mul40 = mul nsw i64 %sub34, %mul
br label %if.end43
if.end43: ; preds = %if.then33, %if.else37, %if.then21, %if.else24
%mul22.pn = phi i64 [ %mul22, %if.then21 ], [ %mul27, %if.else24 ], [ %mul35, %if.then33 ], [ %mul40, %if.else37 ]
%cond = call i64 @llvm.smin.i64(i64 %3, i64 %4)
%add = add nsw i64 %1, %0
%add.mul = call i64 @llvm.smin.i64(i64 %add, i64 %mul)
%mul16 = mul i64 %cond, %add.mul
%ANS.1 = add nsw i64 %mul22.pn, %mul16
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ANS.1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Y) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c,x,y,bill1,bill2,bill3;
scanf("%d %d %d %d %d",&a,&b,&c,&x,&y);
bill1=x*a+y*b;
if(x>y)
{
bill2 =2*y*c+(x-y)*a;
}
else
{
bill2 =2*x*c+(y-x)*b;
}
if(x>y)
{
bill3 =2*c*x;
}
else
{
bill3 =2*c*y;
}
if(bill1<=bill2&&bill1<=bill3)
printf("%d\n",bill1);
else if(bill2<=bill1&&bill2<=bill3)
printf("%d\n",bill2);
else if(bill3<=bill2&&bill3<=bill1)
printf("%d\n",bill3);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191761/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191761/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%x = alloca i32, align 4
%y = 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 %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %y, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%mul1 = mul nsw i32 %3, %2
%add = add nsw i32 %mul1, %mul
%cmp = icmp sgt i32 %0, %2
%4 = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp, label %if.then12, label %if.else15
if.then12: ; preds = %entry
%mul2 = shl nsw i32 %2, 1
%mul3 = mul nsw i32 %mul2, %4
%sub = sub nsw i32 %0, %2
%mul4 = mul nsw i32 %sub, %1
%add5 = add nsw i32 %mul3, %mul4
br label %if.end18
if.else15: ; preds = %entry
%mul6 = shl nsw i32 %0, 1
%mul7 = mul nsw i32 %mul6, %4
%sub8 = sub nsw i32 %2, %0
%mul9 = mul nsw i32 %sub8, %3
%add10 = add nsw i32 %mul7, %mul9
br label %if.end18
if.end18: ; preds = %if.else15, %if.then12
%.sink = phi i32 [ %2, %if.else15 ], [ %0, %if.then12 ]
%bill2.057 = phi i32 [ %add10, %if.else15 ], [ %add5, %if.then12 ]
%mul16 = shl i32 %.sink, 1
%mul17 = mul i32 %mul16, %4
%cmp19.not = icmp sgt i32 %add, %bill2.057
%cmp20.not = icmp sgt i32 %add, %mul17
%or.cond = select i1 %cmp19.not, i1 true, i1 %cmp20.not
br i1 %or.cond, label %if.else23, label %if.end37.sink.split
if.else23: ; preds = %if.end18
%cmp24.not = icmp sgt i32 %bill2.057, %add
%cmp26.not = icmp sgt i32 %bill2.057, %mul17
%or.cond54 = select i1 %cmp24.not, i1 true, i1 %cmp26.not
br i1 %or.cond54, label %if.else29, label %if.end37.sink.split
if.else29: ; preds = %if.else23
%cmp30.not = icmp sgt i32 %mul17, %bill2.057
%cmp32.not = icmp sgt i32 %mul17, %add
%or.cond55 = select i1 %cmp30.not, i1 true, i1 %cmp32.not
br i1 %or.cond55, label %if.end37, label %if.end37.sink.split
if.end37.sink.split: ; preds = %if.else29, %if.else23, %if.end18
%bill2.057.sink = phi i32 [ %add, %if.end18 ], [ %bill2.057, %if.else23 ], [ %mul17, %if.else29 ]
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %bill2.057.sink)
br label %if.end37
if.end37: ; preds = %if.end37.sink.split, %if.else29
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
void swap(int*, int*);
int main() {
int a, b, ab, x, y, out = 0;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &ab);
scanf("%d", &x);
scanf("%d", &y);
if (x > y) {
swap(&a, &b);
swap(&x, &y);
}
out += x * ab * 2;
if (y - x){
out += (ab * 2 < b) ? (y - x) * ab * 2 : (y - x) * b;
}
if (out > a * x + b * y) out = a * x + b * y;
printf("%d\n", out);
}
void swap(int *a, int *b){
int c = *a;
*a = *b;
*b = c;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191811/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191811/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%ab = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ab) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ab)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%.pre.pre = load i32, ptr %b, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%2 = load i32, ptr %a, align 4, !tbaa !5
store i32 %.pre.pre, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%.pre = phi i32 [ %2, %if.then ], [ %.pre.pre, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%5 = load i32, ptr %ab, align 4, !tbaa !5
%mul = shl i32 %4, 1
%mul5 = mul i32 %mul, %5
%tobool.not = icmp eq i32 %3, %4
br i1 %tobool.not, label %if.end15, label %if.then6
if.then6: ; preds = %if.end
%sub = sub nsw i32 %3, %4
%mul7 = shl i32 %5, 1
%cond.v = call i32 @llvm.smin.i32(i32 %mul7, i32 %.pre)
%cond = mul i32 %cond.v, %sub
%add14 = add nsw i32 %cond, %mul5
br label %if.end15
if.end15: ; preds = %if.then6, %if.end
%out.0 = phi i32 [ %add14, %if.then6 ], [ %mul5, %if.end ]
%6 = load i32, ptr %a, align 4, !tbaa !5
%mul16 = mul nsw i32 %6, %4
%mul17 = mul nsw i32 %.pre, %3
%add18 = add nsw i32 %mul17, %mul16
%spec.select = call i32 @llvm.smin.i32(i32 %out.0, i32 %add18)
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ab) #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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
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) #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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n,count=1;
scanf("%d",&n);
while(count*2<=n)
count*=2;
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191855/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191855/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%count.0 = phi i32 [ 1, %entry ], [ %mul, %while.cond ]
%mul = shl nsw i32 %count.0, 1
%cmp.not = icmp sgt i32 %mul, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(int argc, char** argv){
int num;
int cnt = 0;
scanf("%d", &num);
while(num > 1){
num = num / 2;
cnt++;
}
num = 1;
while(cnt > 0) {
num = num * 2;
cnt--;
}
printf("%d\n", num);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191899/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191899/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%.pr = load i32, ptr %num, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %.pr, 1
br i1 %cmp9, label %while.body, label %while.end4
while.body: ; preds = %entry, %while.body
%cnt.010 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%0 = phi i32 [ %div8, %while.body ], [ %.pr, %entry ]
%div8 = lshr i32 %0, 1
%inc = add i32 %cnt.010, 1
%cmp = icmp ugt i32 %0, 3
br i1 %cmp, label %while.body, label %while.body3.preheader, !llvm.loop !9
while.body3.preheader: ; preds = %while.body
%xtraiter = and i32 %inc, 7
%1 = icmp ult i32 %cnt.010, 7
br i1 %1, label %while.end4.loopexit.unr-lcssa, label %while.body3.preheader.new
while.body3.preheader.new: ; preds = %while.body3.preheader
%unroll_iter = and i32 %inc, -8
br label %while.body3
while.body3: ; preds = %while.body3, %while.body3.preheader.new
%mul1113 = phi i32 [ 1, %while.body3.preheader.new ], [ %mul, %while.body3 ]
%niter = phi i32 [ 0, %while.body3.preheader.new ], [ %niter.next.7, %while.body3 ]
%mul = shl i32 %mul1113, 8
%niter.next.7 = add i32 %niter, 8
%niter.ncmp.7.not = icmp eq i32 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7.not, label %while.end4.loopexit.unr-lcssa, label %while.body3, !llvm.loop !11
while.end4.loopexit.unr-lcssa: ; preds = %while.body3, %while.body3.preheader
%mul.lcssa.ph = phi i32 [ undef, %while.body3.preheader ], [ %mul, %while.body3 ]
%mul1113.unr = phi i32 [ 1, %while.body3.preheader ], [ %mul, %while.body3 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.end4, label %while.body3.epil
while.body3.epil: ; preds = %while.end4.loopexit.unr-lcssa, %while.body3.epil
%mul1113.epil = phi i32 [ %mul.epil, %while.body3.epil ], [ %mul1113.unr, %while.end4.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %while.body3.epil ], [ 0, %while.end4.loopexit.unr-lcssa ]
%mul.epil = shl nsw i32 %mul1113.epil, 1
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %while.end4, label %while.body3.epil, !llvm.loop !12
while.end4: ; preds = %while.end4.loopexit.unr-lcssa, %while.body3.epil, %entry
%storemerge = phi i32 [ 1, %entry ], [ %mul.lcssa.ph, %while.end4.loopexit.unr-lcssa ], [ %mul.epil, %while.body3.epil ]
store i32 %storemerge, ptr %num, align 4, !tbaa !5
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %storemerge)
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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
if(n==1)printf("1");
if(n>=2&&n<4)printf("2");
if(n>=4&&n<8)printf("4");
if(n>=8&&n<16)printf("8");
if(n>=16&&n<32)printf("16");
if(n>=32&&n<64)printf("32");
if(n>=64&&n<=100)printf("64");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191941/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191941/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.5 = private unnamed_addr constant [3 x i8] c"16\00", align 1
@.str.6 = private unnamed_addr constant [3 x i8] c"32\00", align 1
@.str.7 = private unnamed_addr constant [3 x i8] c"64\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
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 49)
%.pre = load i32, ptr %n, align 4
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%2 = and i32 %1, -2
%or.cond = icmp eq i32 %2, 2
br i1 %or.cond, label %if.then4, label %if.end6
if.then4: ; preds = %if.end
%putchar42 = call i32 @putchar(i32 50)
%.pre45 = load i32, ptr %n, align 4
br label %if.end6
if.end6: ; preds = %if.then4, %if.end
%3 = phi i32 [ %.pre45, %if.then4 ], [ %1, %if.end ]
%4 = and i32 %3, -4
%or.cond37 = icmp eq i32 %4, 4
br i1 %or.cond37, label %if.then10, label %if.end12
if.then10: ; preds = %if.end6
%putchar43 = call i32 @putchar(i32 52)
%.pre46 = load i32, ptr %n, align 4
br label %if.end12
if.end12: ; preds = %if.then10, %if.end6
%5 = phi i32 [ %.pre46, %if.then10 ], [ %3, %if.end6 ]
%6 = and i32 %5, -8
%or.cond38 = icmp eq i32 %6, 8
br i1 %or.cond38, label %if.then16, label %if.end18
if.then16: ; preds = %if.end12
%putchar44 = call i32 @putchar(i32 56)
%.pre47 = load i32, ptr %n, align 4
br label %if.end18
if.end18: ; preds = %if.then16, %if.end12
%7 = phi i32 [ %.pre47, %if.then16 ], [ %5, %if.end12 ]
%8 = and i32 %7, -16
%or.cond39 = icmp eq i32 %8, 16
br i1 %or.cond39, label %if.then22, label %if.end24
if.then22: ; preds = %if.end18
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
%.pre48 = load i32, ptr %n, align 4
br label %if.end24
if.end24: ; preds = %if.then22, %if.end18
%9 = phi i32 [ %.pre48, %if.then22 ], [ %7, %if.end18 ]
%10 = and i32 %9, -32
%or.cond40 = icmp eq i32 %10, 32
br i1 %or.cond40, label %if.then28, label %if.end30
if.then28: ; preds = %if.end24
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
%.pre49 = load i32, ptr %n, align 4
br label %if.end30
if.end30: ; preds = %if.then28, %if.end24
%11 = phi i32 [ %.pre49, %if.then28 ], [ %9, %if.end24 ]
%12 = add i32 %11, -64
%or.cond41 = icmp ult i32 %12, 37
br i1 %or.cond41, label %if.then34, label %if.end36
if.then34: ; preds = %if.end30
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
br label %if.end36
if.end36: ; preds = %if.then34, %if.end30
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)"}
|
#include <stdio.h>
//#define scanf scanf_s
int main()
{
int n, i, x, qTmp, tmp, qSum = 0;;
scanf("%d", &n);
if (n == 1)
{
printf("1");
return 0;
}
for (i = 1; i <= n; i++)
{
tmp = 0;
x = i;
while (1)
{
if (x % 2 == 0)
{
tmp++;
}
x /= 2;
if (x <= 1)
break;
}
if (tmp > qSum) {
qSum = tmp;
qTmp = i;
}
}
printf("%d", qTmp);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191985/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191985/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp2.not29 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp2.not29)
%xtraiter = and i32 %0, 1
%unroll_iter = and i32 %0, 2147483646
br label %while.cond.preheader
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 49)
br label %cleanup
while.cond.preheader: ; preds = %while.end.1, %for.cond.preheader
%qSum.032 = phi i32 [ 0, %for.cond.preheader ], [ %spec.select28.1, %while.end.1 ]
%qTmp.031 = phi i32 [ undef, %for.cond.preheader ], [ %spec.select27.1, %while.end.1 ]
%i.030 = phi i32 [ 1, %for.cond.preheader ], [ %inc12.1, %while.end.1 ]
%niter = phi i32 [ 0, %for.cond.preheader ], [ %niter.next.1, %while.end.1 ]
br label %while.cond
while.cond: ; preds = %while.cond.preheader, %while.cond
%x.0 = phi i32 [ %div26, %while.cond ], [ %i.030, %while.cond.preheader ]
%tmp.0 = phi i32 [ %spec.select, %while.cond ], [ 0, %while.cond.preheader ]
%rem = and i32 %x.0, 1
%1 = xor i32 %rem, 1
%spec.select = add i32 %1, %tmp.0
%div26 = lshr i32 %x.0, 1
%cmp6 = icmp ult i32 %x.0, 4
br i1 %cmp6, label %while.end, label %while.cond
while.end: ; preds = %while.cond
%cmp9 = icmp sgt i32 %spec.select, %qSum.032
%spec.select27 = select i1 %cmp9, i32 %i.030, i32 %qTmp.031
%spec.select28 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %qSum.032)
%inc12 = add nuw i32 %i.030, 1
br label %while.cond.1
while.cond.1: ; preds = %while.cond.1, %while.end
%x.0.1 = phi i32 [ %div26.1, %while.cond.1 ], [ %inc12, %while.end ]
%tmp.0.1 = phi i32 [ %spec.select.1, %while.cond.1 ], [ 0, %while.end ]
%rem.1 = and i32 %x.0.1, 1
%2 = xor i32 %rem.1, 1
%spec.select.1 = add i32 %2, %tmp.0.1
%div26.1 = lshr i32 %x.0.1, 1
%cmp6.1 = icmp ult i32 %x.0.1, 4
br i1 %cmp6.1, label %while.end.1, label %while.cond.1
while.end.1: ; preds = %while.cond.1
%cmp9.1 = icmp sgt i32 %spec.select.1, %spec.select28
%spec.select27.1 = select i1 %cmp9.1, i32 %inc12, i32 %spec.select27
%spec.select28.1 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %spec.select28)
%inc12.1 = add nuw i32 %i.030, 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.end.unr-lcssa, label %while.cond.preheader, !llvm.loop !9
for.end.unr-lcssa: ; preds = %while.end.1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %while.cond.epil
while.cond.epil: ; preds = %for.end.unr-lcssa, %while.cond.epil
%x.0.epil = phi i32 [ %div26.epil, %while.cond.epil ], [ %inc12.1, %for.end.unr-lcssa ]
%tmp.0.epil = phi i32 [ %spec.select.epil, %while.cond.epil ], [ 0, %for.end.unr-lcssa ]
%rem.epil = and i32 %x.0.epil, 1
%3 = xor i32 %rem.epil, 1
%spec.select.epil = add i32 %3, %tmp.0.epil
%div26.epil = lshr i32 %x.0.epil, 1
%cmp6.epil = icmp ult i32 %x.0.epil, 4
br i1 %cmp6.epil, label %while.end.epil, label %while.cond.epil
while.end.epil: ; preds = %while.cond.epil
%cmp9.epil = icmp sgt i32 %spec.select.epil, %spec.select28.1
%spec.select27.epil = select i1 %cmp9.epil, i32 %inc12.1, i32 %spec.select27.1
br label %for.end
for.end: ; preds = %for.end.unr-lcssa, %while.end.epil
%spec.select27.lcssa = phi i32 [ %spec.select27.1, %for.end.unr-lcssa ], [ %spec.select27.epil, %while.end.epil ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select27.lcssa)
br label %cleanup
cleanup: ; preds = %for.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: 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"}
|
#include<stdio.h>
int main(void)
{
int n;
scanf("%d",&n);
int d=1;
while(d<=n){
d*=2;
}
printf("%d",d/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192034/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192034/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%d.0 = phi i32 [ 1, %entry ], [ %mul, %while.cond ]
%cmp.not = icmp sgt i32 %d.0, %0
%mul = shl nsw i32 %d.0, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%div4 = lshr i32 %d.0, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int n,ans=1 ;
scanf ("%d",&n) ;
while (n/2>=ans) {
ans*=2 ;
}
printf ("%d\n",ans) ;
return 0 ;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192085/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192085/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %0, 2
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%ans.0 = phi i32 [ 1, %entry ], [ %mul, %while.cond ]
%cmp.not = icmp slt i32 %div, %ans.0
%mul = shl nsw i32 %ans.0, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int N;
scanf("%d", &N);
int ans=2;
while(ans <= N)
ans *= 2;
printf("%d\n", ans/2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192135/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192135/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%ans.0 = phi i32 [ 2, %entry ], [ %mul, %while.cond ]
%cmp.not = icmp sgt i32 %ans.0, %0
%mul = shl nsw i32 %ans.0, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%div = lshr exact i32 %ans.0, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int input_num;
int res = 0, i = 0;
scanf("%d\n", &input_num);
for (i = 1; i <= input_num; i *= 2)
res = i;
printf("%d\n", res);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192179/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192179/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%input_num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input_num) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input_num)
%0 = load i32, ptr %input_num, align 4, !tbaa !5
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%res.0 = phi i32 [ 0, %entry ], [ %i.0, %for.cond ]
%i.0 = phi i32 [ 1, %entry ], [ %mul, %for.cond ]
%cmp.not = icmp sgt i32 %i.0, %0
%mul = shl nsw i32 %i.0, 1
br i1 %cmp.not, label %for.end, label %for.cond, !llvm.loop !9
for.end: ; preds = %for.cond
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %res.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input_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 <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MOD 1000000007
#define ll long long
int main(){
int n,i;
scanf("%d",&n);
i=1;
while(2*i<=n){
i*=2;
}
printf("%d\n",i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192221/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192221/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%i.0 = phi i32 [ 1, %entry ], [ %mul, %while.cond ]
%mul = shl nsw i32 %i.0, 1
%cmp.not = icmp sgt i32 %mul, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
long long gcd(long long a,long long b){
if(a%b==0) return b;
return gcd(b,a%b);
}
int main(void){
int n,i;
long long ans,t;
scanf("%d%lld",&n,&ans);
for(i=0;i<n-1;i++){
scanf("%lld",&t);
ans=ans/gcd(ans,t)*t;
}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192272/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192272/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i64 [ %a, %entry ], [ %b.tr, %tailrecurse ]
%b.tr = phi i64 [ %b, %entry ], [ %rem, %tailrecurse ]
%rem = srem i64 %a.tr, %b.tr
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %return, label %tailrecurse
return: ; preds = %tailrecurse
ret i64 %b.tr
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%ans = alloca i64, align 8
%t = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %ans) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %ans)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 1
br i1 %cmp6, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i64, ptr %ans, align 8, !tbaa !9
br label %for.end
for.body: ; preds = %entry, %gcd.exit
%i.07 = phi i32 [ %inc, %gcd.exit ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%1 = load i64, ptr %ans, align 8, !tbaa !9
%2 = load i64, ptr %t, align 8, !tbaa !9
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %for.body
%a.tr.i = phi i64 [ %1, %for.body ], [ %b.tr.i, %tailrecurse.i ]
%b.tr.i = phi i64 [ %2, %for.body ], [ %rem.i, %tailrecurse.i ]
%rem.i = srem i64 %a.tr.i, %b.tr.i
%cmp.i = icmp eq i64 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %tailrecurse.i
gcd.exit: ; preds = %tailrecurse.i
%div = sdiv i64 %1, %b.tr.i
%mul = mul nsw i64 %div, %2
store i64 %mul, ptr %ans, align 8, !tbaa !9
%inc = add nuw nsw i32 %i.07, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%cmp = icmp slt i32 %inc, %sub
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %gcd.exit, %entry.for.end_crit_edge
%4 = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %mul, %gcd.exit ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %4)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %ans) #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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
long long caculate(long long k,long long w);
int main()
{
int n,i;
long long a[105],k,w,s;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%lld",&a[i]);
}
if(n==1) s=a[0];
for(i=0;i<=n-2;i++)
{
if(i==0)
{
k=a[0];
w=a[1];
s=k/caculate(k,w)*w;
}
if(i!=0 && n!=2)
{
k=s;
w=a[i+1];
s=k/caculate(k,w)*w;
}
}
printf("%lld\n",s);
}
long long caculate(long long k,long long w)
{
long long r,t;
if(w>k)
{
t=w;w=k;k=t;
}
while(w)
{
r=k%w;
k=w;
w=r;
}
return k;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192315/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192315/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%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 i32, align 4
%a = alloca [105 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 840, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, 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 [105 x i64], ptr %a, 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
%1 = load i32, ptr %n, align 4
%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 !5
for.end.loopexit: ; preds = %for.body
%.pre = load i64, ptr %a, align 16
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%3 = phi i64 [ undef, %entry ], [ %.pre, %for.end.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.end.loopexit ]
%.lcssa.fr = freeze i32 %.lcssa
%cmp2 = icmp eq i32 %.lcssa.fr, 1
%spec.select = select i1 %cmp2, i64 %3, i64 undef
%cmp5.not52 = icmp slt i32 %.lcssa.fr, 2
br i1 %cmp5.not52, label %for.end24, label %for.body6.lr.ph
for.body6.lr.ph: ; preds = %for.end
%arrayidx10 = getelementptr inbounds [105 x i64], ptr %a, i64 0, i64 1
%4 = load i64, ptr %arrayidx10, align 8
%spec.select.i = call i64 @llvm.smin.i64(i64 %4, i64 %3)
%spec.select.i.fr = freeze i64 %spec.select.i
%spec.select8.i = call i64 @llvm.smax.i64(i64 %4, i64 %3)
%tobool.not9.i = icmp eq i64 %spec.select.i.fr, 0
%cmp14.not = icmp eq i32 %.lcssa.fr, 2
br i1 %cmp14.not, label %for.body6.lr.ph.split.us, label %for.body6.lr.ph.split
for.body6.lr.ph.split.us: ; preds = %for.body6.lr.ph
br i1 %tobool.not9.i, label %for.end24.sink.split, label %while.body.i.us
while.body.i.us: ; preds = %for.body6.lr.ph.split.us, %while.body.i.us
%k.addr.111.i.us = phi i64 [ %w.addr.110.i.us, %while.body.i.us ], [ %spec.select8.i, %for.body6.lr.ph.split.us ]
%w.addr.110.i.us = phi i64 [ %rem.i.us, %while.body.i.us ], [ %spec.select.i.fr, %for.body6.lr.ph.split.us ]
%rem.i.us = srem i64 %k.addr.111.i.us, %w.addr.110.i.us
%tobool.not.i.us = icmp eq i64 %rem.i.us, 0
br i1 %tobool.not.i.us, label %for.end24.sink.split, label %while.body.i.us, !llvm.loop !7
for.body6.lr.ph.split: ; preds = %for.body6.lr.ph
%5 = add nsw i32 %.lcssa.fr, -1
%wide.trip.count88 = zext i32 %5 to i64
br i1 %tobool.not9.i, label %for.body6.us56, label %for.body6
for.body6.us56: ; preds = %for.body6.lr.ph.split, %for.inc22.us67
%indvars.iv84 = phi i64 [ %indvars.iv.next85.pre-phi, %for.inc22.us67 ], [ 0, %for.body6.lr.ph.split ]
%s.154.us57 = phi i64 [ %s.3.us68, %for.inc22.us67 ], [ %spec.select, %for.body6.lr.ph.split ]
%cmp7.us59 = icmp eq i64 %indvars.iv84, 0
br i1 %cmp7.us59, label %if.end12.us65.for.inc22.us67_crit_edge, label %if.then15.us
if.end12.us65.for.inc22.us67_crit_edge: ; preds = %for.body6.us56
%div.us63 = sdiv i64 %3, %spec.select8.i
%mul.us64 = mul nsw i64 %div.us63, %4
br label %for.inc22.us67
if.then15.us: ; preds = %for.body6.us56
%6 = add nuw nsw i64 %indvars.iv84, 1
%arrayidx17.us = getelementptr inbounds [105 x i64], ptr %a, i64 0, i64 %6
%7 = load i64, ptr %arrayidx17.us, align 8, !tbaa !8
%spec.select.i40.us = call i64 @llvm.smin.i64(i64 %7, i64 %s.154.us57)
%spec.select8.i41.us = call i64 @llvm.smax.i64(i64 %7, i64 %s.154.us57)
%tobool.not9.i42.us = icmp eq i64 %spec.select.i40.us, 0
br i1 %tobool.not9.i42.us, label %caculate.exit49.us, label %while.body.i43.us
while.body.i43.us: ; preds = %if.then15.us, %while.body.i43.us
%k.addr.111.i44.us = phi i64 [ %w.addr.110.i45.us, %while.body.i43.us ], [ %spec.select8.i41.us, %if.then15.us ]
%w.addr.110.i45.us = phi i64 [ %rem.i46.us, %while.body.i43.us ], [ %spec.select.i40.us, %if.then15.us ]
%rem.i46.us = srem i64 %k.addr.111.i44.us, %w.addr.110.i45.us
%tobool.not.i47.us = icmp eq i64 %rem.i46.us, 0
br i1 %tobool.not.i47.us, label %caculate.exit49.us, label %while.body.i43.us, !llvm.loop !7
caculate.exit49.us: ; preds = %while.body.i43.us, %if.then15.us
%k.addr.1.lcssa.i48.us = phi i64 [ %spec.select8.i41.us, %if.then15.us ], [ %w.addr.110.i45.us, %while.body.i43.us ]
%div19.us = sdiv i64 %s.154.us57, %k.addr.1.lcssa.i48.us
%mul20.us = mul nsw i64 %div19.us, %7
br label %for.inc22.us67
for.inc22.us67: ; preds = %if.end12.us65.for.inc22.us67_crit_edge, %caculate.exit49.us
%indvars.iv.next85.pre-phi = phi i64 [ 1, %if.end12.us65.for.inc22.us67_crit_edge ], [ %6, %caculate.exit49.us ]
%s.3.us68 = phi i64 [ %mul.us64, %if.end12.us65.for.inc22.us67_crit_edge ], [ %mul20.us, %caculate.exit49.us ]
%exitcond89.not = icmp eq i64 %indvars.iv.next85.pre-phi, %wide.trip.count88
br i1 %exitcond89.not, label %for.end24, label %for.body6.us56, !llvm.loop !12
for.body6: ; preds = %for.body6.lr.ph.split, %for.inc22
%indvars.iv80 = phi i64 [ %indvars.iv.next81.pre-phi, %for.inc22 ], [ 0, %for.body6.lr.ph.split ]
%s.154 = phi i64 [ %s.3, %for.inc22 ], [ %spec.select, %for.body6.lr.ph.split ]
%cmp7 = icmp eq i64 %indvars.iv80, 0
br i1 %cmp7, label %while.body.i, label %if.then15
while.body.i: ; preds = %for.body6, %while.body.i
%k.addr.111.i = phi i64 [ %w.addr.110.i, %while.body.i ], [ %spec.select8.i, %for.body6 ]
%w.addr.110.i = phi i64 [ %rem.i, %while.body.i ], [ %spec.select.i.fr, %for.body6 ]
%rem.i = srem i64 %k.addr.111.i, %w.addr.110.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %if.end12, label %while.body.i, !llvm.loop !7
if.end12: ; preds = %while.body.i
%div = sdiv i64 %3, %w.addr.110.i
%mul = mul nsw i64 %div, %4
br i1 %cmp7, label %for.inc22, label %if.then15
if.then15: ; preds = %for.body6, %if.end12
%s.298 = phi i64 [ %mul, %if.end12 ], [ %s.154, %for.body6 ]
%8 = add nuw nsw i64 %indvars.iv80, 1
%arrayidx17 = getelementptr inbounds [105 x i64], ptr %a, i64 0, i64 %8
%9 = load i64, ptr %arrayidx17, align 8, !tbaa !8
%spec.select.i40 = call i64 @llvm.smin.i64(i64 %9, i64 %s.298)
%spec.select8.i41 = call i64 @llvm.smax.i64(i64 %9, i64 %s.298)
%tobool.not9.i42 = icmp eq i64 %spec.select.i40, 0
br i1 %tobool.not9.i42, label %caculate.exit49, label %while.body.i43
while.body.i43: ; preds = %if.then15, %while.body.i43
%k.addr.111.i44 = phi i64 [ %w.addr.110.i45, %while.body.i43 ], [ %spec.select8.i41, %if.then15 ]
%w.addr.110.i45 = phi i64 [ %rem.i46, %while.body.i43 ], [ %spec.select.i40, %if.then15 ]
%rem.i46 = srem i64 %k.addr.111.i44, %w.addr.110.i45
%tobool.not.i47 = icmp eq i64 %rem.i46, 0
br i1 %tobool.not.i47, label %caculate.exit49, label %while.body.i43, !llvm.loop !7
caculate.exit49: ; preds = %while.body.i43, %if.then15
%k.addr.1.lcssa.i48 = phi i64 [ %spec.select8.i41, %if.then15 ], [ %w.addr.110.i45, %while.body.i43 ]
%div19 = sdiv i64 %s.298, %k.addr.1.lcssa.i48
%mul20 = mul nsw i64 %div19, %9
br label %for.inc22
for.inc22: ; preds = %if.end12, %caculate.exit49
%indvars.iv.next81.pre-phi = phi i64 [ %8, %caculate.exit49 ], [ 1, %if.end12 ]
%s.3 = phi i64 [ %mul20, %caculate.exit49 ], [ %mul, %if.end12 ]
%exitcond.not = icmp eq i64 %indvars.iv.next81.pre-phi, %wide.trip.count88
br i1 %exitcond.not, label %for.end24, label %for.body6, !llvm.loop !12
for.end24.sink.split: ; preds = %while.body.i.us, %for.body6.lr.ph.split.us
%w.addr.110.i.us.lcssa.sink = phi i64 [ %spec.select8.i, %for.body6.lr.ph.split.us ], [ %w.addr.110.i.us, %while.body.i.us ]
%div.us = sdiv i64 %3, %w.addr.110.i.us.lcssa.sink
%mul.us = mul nsw i64 %div.us, %4
br label %for.end24
for.end24: ; preds = %for.inc22, %for.inc22.us67, %for.end24.sink.split, %for.end
%s.1.lcssa = phi i64 [ %spec.select, %for.end ], [ %mul.us, %for.end24.sink.split ], [ %s.3.us68, %for.inc22.us67 ], [ %s.3, %for.inc22 ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %s.1.lcssa)
call void @llvm.lifetime.end.p0(i64 840, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @caculate(i64 noundef %k, i64 noundef %w) local_unnamed_addr #3 {
entry:
%spec.select = tail call i64 @llvm.smin.i64(i64 %w, i64 %k)
%spec.select8 = tail call i64 @llvm.smax.i64(i64 %w, i64 %k)
%tobool.not9 = icmp eq i64 %spec.select, 0
br i1 %tobool.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%k.addr.111 = phi i64 [ %w.addr.110, %while.body ], [ %spec.select8, %entry ]
%w.addr.110 = phi i64 [ %rem, %while.body ], [ %spec.select, %entry ]
%rem = srem i64 %k.addr.111, %w.addr.110
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7
while.end: ; preds = %while.body, %entry
%k.addr.1.lcssa = phi i64 [ %spec.select8, %entry ], [ %w.addr.110, %while.body ]
ret i64 %k.addr.1.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = distinct !{!12, !6}
|
#include<stdio.h>
#include<stdlib.h>
typedef long long int INT;
INT LCM(INT, INT);
int main() {
int N;
INT *T;
int i;
INT ans = 1;
scanf("%d", &N);
T = (INT*)malloc(sizeof(INT)*N);
for (i = 0; i < N; i++) scanf("%lld", &T[i]);
for (i = 0; i < N; i++)ans = LCM(ans, T[i]);
printf("%lld\n", ans);
return 0;
}
INT LCM(INT A, INT B) {
INT a = A, b = B;
INT r;
INT x = a*b;
if (a > b) {
INT tmp;
tmp = a;
a = b;
b = tmp;
}
r = a%b;
while (r != 0) {
a = b;
b = r;
r = a%b;
}
return A / b*B + A%b*B;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192359/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192359/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%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 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
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 3
%call1 = call noalias ptr @malloc(i64 noundef %mul) #7
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.end13
for.cond4.preheader: ; preds = %for.body
%cmp524 = icmp sgt i32 %1, 0
br i1 %cmp524, label %for.body7.preheader, label %for.end13
for.body7.preheader: ; preds = %for.cond4.preheader
%wide.trip.count = zext i32 %1 to i64
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 %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body7: ; preds = %for.body7.preheader, %LCM.exit
%indvars.iv30 = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next31, %LCM.exit ]
%ans.026 = phi i64 [ 1, %for.body7.preheader ], [ %add.i, %LCM.exit ]
%arrayidx9 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv30
%3 = load i64, ptr %arrayidx9, align 8, !tbaa !11
%spec.select.i = call i64 @llvm.smax.i64(i64 %ans.026, i64 %3)
%spec.select23.i = call i64 @llvm.smin.i64(i64 %ans.026, i64 %3)
%rem.i = srem i64 %spec.select23.i, %spec.select.i
%cmp1.not24.i = icmp eq i64 %rem.i, 0
br i1 %cmp1.not24.i, label %LCM.exit, label %while.body.i
while.body.i: ; preds = %for.body7, %while.body.i
%b.126.i = phi i64 [ %r.025.i, %while.body.i ], [ %spec.select.i, %for.body7 ]
%r.025.i = phi i64 [ %rem2.i, %while.body.i ], [ %rem.i, %for.body7 ]
%rem2.i = srem i64 %b.126.i, %r.025.i
%cmp1.not.i = icmp eq i64 %rem2.i, 0
br i1 %cmp1.not.i, label %LCM.exit, label %while.body.i, !llvm.loop !13
LCM.exit: ; preds = %while.body.i, %for.body7
%b.1.lcssa.i = phi i64 [ %spec.select.i, %for.body7 ], [ %r.025.i, %while.body.i ]
%div.i = sdiv i64 %ans.026, %b.1.lcssa.i
%rem4.i = srem i64 %ans.026, %b.1.lcssa.i
%mul322.i = add i64 %rem4.i, %div.i
%add.i = mul i64 %mul322.i, %3
%indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
%exitcond.not = icmp eq i64 %indvars.iv.next31, %wide.trip.count
br i1 %exitcond.not, label %for.end13, label %for.body7, !llvm.loop !14
for.end13: ; preds = %LCM.exit, %entry, %for.cond4.preheader
%ans.0.lcssa = phi i64 [ 1, %for.cond4.preheader ], [ 1, %entry ], [ %add.i, %LCM.exit ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @LCM(i64 noundef %A, i64 noundef %B) local_unnamed_addr #4 {
entry:
%spec.select = tail call i64 @llvm.smax.i64(i64 %A, i64 %B)
%spec.select23 = tail call i64 @llvm.smin.i64(i64 %A, i64 %B)
%rem = srem i64 %spec.select23, %spec.select
%cmp1.not24 = icmp eq i64 %rem, 0
br i1 %cmp1.not24, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%b.126 = phi i64 [ %r.025, %while.body ], [ %spec.select, %entry ]
%r.025 = phi i64 [ %rem2, %while.body ], [ %rem, %entry ]
%rem2 = srem i64 %b.126, %r.025
%cmp1.not = icmp eq i64 %rem2, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %while.body, %entry
%b.1.lcssa = phi i64 [ %spec.select, %entry ], [ %r.025, %while.body ]
%div = sdiv i64 %A, %b.1.lcssa
%rem4 = srem i64 %A, %b.1.lcssa
%mul322 = add i64 %rem4, %div
%add = mul i64 %mul322, %B
ret i64 %add
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(void){
char s[100];
int kokomade,count;
scanf("%s",s);
for(count=0;;){
if(s[count]=='\0'){kokomade=count;break;}
count++;
}
s[kokomade-8]='\0';
printf("%s",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192401/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192401/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp, label %if.then, label %for.cond
if.then: ; preds = %for.cond
%sub = shl i64 %indvars.iv, 32
%sext = add i64 %sub, -34359738368
%idxprom2 = ashr exact i64 %sext, 32
%arrayidx3 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom2
store i8 0, ptr %arrayidx3, align 1, !tbaa !5
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define sl(x) scanf("%ld", &x)
#define ss(x) scanf("%s", x)
#define pl(x) printf("%ld\n", x)
#define pd(x) printf("%lf\n", x)
#define ps(x) printf("%s\n", x)
#define INF 1000000000000000000
#define MOD 1000000007
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
int compare_long(const void *a, const void *b) {
return *(long*)a - *(long*)b;
}
int main() {
long N, C;
long i, j;
long tans = 0;
char buf[201];
long len;
ss(buf);
len = strlen(buf);
for(i=0;i<len-8;i++) {
printf("%c", buf[i]);
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192445/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192445/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_long(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%buf = alloca [201 x i8], align 16
call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %buf) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %buf)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %buf) #7
%cmp8 = icmp sgt i64 %call2, 8
br i1 %cmp8, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = add i64 %call2, -9
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%i.09 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
%arrayidx = getelementptr inbounds [201 x i8], ptr %buf, i64 0, i64 %i.09
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %1 to i32
%putchar7 = call i32 @putchar(i32 %conv)
%inc = add nuw nsw i64 %i.09, 1
%exitcond.not = icmp eq i64 %i.09, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !10
for.end: ; preds = %for.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %buf) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-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 = !{!"long", !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(void)
{
int N,x,y;
scanf("%d",&N);
x=N*800;
y=(N/15)*200;
printf("%d\n",x-y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192496/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192496/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%mul = mul nsw i32 %0, 800
%div = sdiv i32 %0, 15
%mul1.neg = mul i32 %div, -200
%sub = add i32 %mul1.neg, %mul
%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 %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a;
scanf("%d",&a);
printf("%d",800*a-200*(a/15));
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192539/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192539/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, 800
%div = sdiv i32 %0, 15
%mul1.neg = mul i32 %div, -200
%sub = add i32 %mul1.neg, %mul
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
printf("%d\n", n*800 - n/15*200);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192582/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192582/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul = mul nsw i32 %0, 800
%div = sdiv i32 %0, 15
%mul1.neg = mul i32 %div, -200
%sub = add i32 %mul1.neg, %mul
%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 %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a;
scanf("%d",&a);
printf("%d",a*800-a/15*200);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192625/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192625/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, 800
%div = sdiv i32 %0, 15
%mul1.neg = mul i32 %div, -200
%sub = add i32 %mul1.neg, %mul
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
printf("%d\n", 800*n - (n/15)*200);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192669/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192669/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul = mul nsw i32 %0, 800
%div = sdiv i32 %0, 15
%mul1.neg = mul i32 %div, -200
%sub = add i32 %mul1.neg, %mul
%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 %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void) {
int N;
scanf("%d",&N);
printf("%d\n",800*N-N/15*200);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192711/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192711/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%mul = mul nsw i32 %0, 800
%div = sdiv i32 %0, 15
%mul1.neg = mul i32 %div, -200
%sub = add i32 %mul1.neg, %mul
%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 %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>
#define MEALP 800 // meal price in yen
#define PAIDA 200 // amount given back per 15 meals
int main()
{
int N;
long total_given, paid_back;
scanf("%d", &N);
total_given = MEALP * N;
paid_back = N/15 * PAIDA;
total_given -= paid_back;
printf("%ld\n", total_given);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192755/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192755/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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
%mul = mul nsw i32 %0, 800
%conv = sext i32 %mul to i64
%div = sdiv i32 %0, 15
%mul1 = mul nsw i32 %div, 200
%conv2 = sext i32 %mul1 to i64
%sub = sub nsw i64 %conv, %conv2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub)
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 <string.h>
#include <stdio.h>
#define SIZE 1028
char str[SIZE];
void apple(int len);
int main() {
int len,n,i;
fgets(str,sizeof(str),stdin);
sscanf(str,"%d",&n);
for(i=0;i<n;i++){
fgets(str,sizeof(str),stdin);
len = strlen(str)-1;
apple(len);
printf("%s",str);
}
return 0;
}
void apple(int len){
int i;
for(i=0;i<len;i++){
if(strncmp(&str[i],"Hoshino",7)==0)
strncpy(&str[i],"Hoshina",7);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192841/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192841/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@str = dso_local global [1028 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"Hoshino\00", align 1
@.str.3 = private unnamed_addr constant [8 x i8] c"Hoshina\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call ptr @fgets(ptr noundef nonnull @str, i32 noundef 1028, ptr noundef %0)
%call1 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull @str, ptr noundef nonnull @.str, ptr noundef nonnull %n) #6
%1 = load i32, ptr %n, align 4, !tbaa !9
%cmp6 = icmp sgt i32 %1, 0
br i1 %cmp6, label %for.body, label %for.end
for.body: ; preds = %entry, %apple.exit
%i.07 = phi i32 [ %inc, %apple.exit ], [ 0, %entry ]
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call2 = call ptr @fgets(ptr noundef nonnull @str, i32 noundef 1028, ptr noundef %2)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #7
%3 = trunc i64 %call3 to i32
%conv = add i32 %3, -1
%cmp8.i = icmp sgt i32 %conv, 0
br i1 %cmp8.i, label %for.body.preheader.i, label %apple.exit
for.body.preheader.i: ; preds = %for.body
%wide.trip.count.i = zext i32 %conv to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds [1028 x i8], ptr @str, i64 0, i64 %indvars.iv.i
%call.i = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %arrayidx.i, ptr noundef nonnull dereferenceable(8) @.str.2, i64 noundef 7) #7
%cmp1.i = icmp eq i32 %call.i, 0
br i1 %cmp1.i, label %if.then.i, label %for.inc.i
if.then.i: ; preds = %for.body.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %arrayidx.i, ptr noundef nonnull align 1 dereferenceable(8) @.str.3, i64 noundef 7, i1 false) #6
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %apple.exit, label %for.body.i, !llvm.loop !11
apple.exit: ; preds = %for.inc.i, %for.body
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @str)
%inc = add nuw nsw i32 %i.07, 1
%4 = load i32, ptr %n, align 4, !tbaa !9
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %apple.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @apple(i32 noundef %len) local_unnamed_addr #4 {
entry:
%cmp8 = icmp sgt i32 %len, 0
br i1 %cmp8, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %len 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 [1028 x i8], ptr @str, i64 0, i64 %indvars.iv
%call = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(8) @.str.2, i64 noundef 7) #7
%cmp1 = icmp eq i32 %call, 0
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %arrayidx, ptr noundef nonnull align 1 dereferenceable(8) @.str.3, i64 noundef 7, i1 false) #6
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 !11
for.end: ; preds = %for.inc, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #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) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
char str[1002];
char *pp;
int i, n;
scanf("%d ", &n);
for(i = 0;i < n;i++){
fgets(str, sizeof(str), stdin);
pp = str;
while((pp = strstr(pp, "Hoshino")) != NULL){
pp += 6;
*pp ='a';
}
printf("%s", str);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192906/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192906/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [8 x i8] c"Hoshino\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [1002 x i8], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1002, ptr nonnull %str) #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
%cmp13 = icmp sgt i32 %0, 0
br i1 %cmp13, label %for.body, label %for.end
for.body: ; preds = %entry, %while.end
%i.014 = phi i32 [ %inc, %while.end ], [ 0, %entry ]
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call1 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 1002, ptr noundef %1)
%call310 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %str, ptr noundef nonnull dereferenceable(1) @.str.1) #5
%cmp4.not11 = icmp eq ptr %call310, null
br i1 %cmp4.not11, label %while.end, label %while.body
while.body: ; preds = %for.body, %while.body
%call312 = phi ptr [ %call3, %while.body ], [ %call310, %for.body ]
%add.ptr = getelementptr inbounds i8, ptr %call312, i64 6
store i8 97, ptr %add.ptr, align 1, !tbaa !11
%call3 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %add.ptr, ptr noundef nonnull dereferenceable(1) @.str.1) #5
%cmp4.not = icmp eq ptr %call3, null
br i1 %cmp4.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %while.body, %for.body
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %str)
%inc = add nuw nsw i32 %i.014, 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 !14
for.end: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 1002, 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: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
|
#if 0
cat <<EOF >mistaken-paste
#endif
// thanks for @rsk0315_h4x
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 2000000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1000000
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <functional>
#include <array>
using std::queue;
using std::priority_queue;
using std::stack;
using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
using std::string;
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> l, pair<T, U> r) {
return pair<T, U>(l.first + r.first, l.second + r.second);
}
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
ull n, m;
ull h, w;
ull k;
ull q;
sll va, vb, vc, vd, ve, vf;
ull ua, ub, uc, ud, ue, uf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (x < y) {
return gcd(y, x);
} else if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
// double distance (sll x1, sll y1, sll x2, sll y2) {
// double xdist2, ydist2, origindist, dist;
// xdist2 = (x1 - x2) * (x1 - x2);
// ydist2 = (y1 - y2) * (y1 - y2);
// return sqrt(xdist2 + ydist2);
// }
int32_t pullcomp (const void *left, const void *right) {
ull l = *(ull*)left;
ull r = *(ull*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t prevcomp (const void *left, const void *right) {
ull l = *(ull*)left;
ull r = *(ull*)right;
if (l > r) {
return -1;
}
if (l < r) {
return +1;
}
return 0;
}
int32_t psllcomp (const void *left, const void *right) {
sll l = *(sll*)left;
sll r = *(sll*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pcharcomp (const void *left, const void *right) {
char l = *(char*)left;
char r = *(char*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pdoublecomp (const void *left, const void *right) {
double l = *(double*)left;
double r = *(double*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
int32_t phwllABcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
return 0;
}
int32_t phwllREVcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
return 0;
}
int32_t ptriplecomp (const void *left, const void *right) {
hwllc l = *(hwllc*)left;
hwllc r = *(hwllc*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
if (l.c < r.c) {
return -1;
}
if (l.c > r.c) {
return +1;
}
return 0;
}
int32_t ptripleREVcomp (const void *left, const void *right) {
hwllc l = *(hwllc*)left;
hwllc r = *(hwllc*)right;
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.c < r.c) {
return -1;
}
if (l.c > r.c) {
return +1;
}
return 0;
}
int32_t pquadcomp (const void *left, const void *right) {
linell l = *(linell*)left;
linell r = *(linell*)right;
sll ac = phwllABcomp(&(l.a), &(r.a));
if (ac) return ac;
sll bc = phwllABcomp(&(l.b), &(r.b));
if (bc) return bc;
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
sll a[N_MAX];
// ull a[N_MAX];
// sll a[3001][3001];
sll b[N_MAX];
// sll b[3001][3001];
sll c[N_MAX];
sll d[N_MAX];
// sll e[N_MAX];
// char s[N_MAX + 1];
char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
hwll xy[N_MAX];
hwllc tup[N_MAX];
sll table[3000][3000];
// here we go
ull dp[305][305][602], dq[305][305][602];
sll fp (sll i, sll j, sll x) {
if (j >= (sll)w) {
sll d = j - (w - 1);
i -= d;
j -= d;
}
if (i >= (sll)h) {
sll d = i - (h - 1);
i -= d;
j -= d;
}
if (i < 0 || j < 0) return 0;
return dp[i][j][x];
}
sll fq (sll i, sll j, sll x) {
// printf("%lld %lld->\n", i, j);
if (j < 0) {
sll d = -j;
i -= d;
j += d;
}
if (i >= (sll)h) {
sll d = i - (h - 1);
i -= d;
j += d;
}
// printf("%lld %lld\n", i, j);
if (i < 0 || j >= (sll)w) return 0;
return dq[i][j][x];
}
ull f (sll i, sll j) {
sll mov[4][2][2] = {
{{-1, -1}, {-1, +1}},
{{-1, +1}, {+1, +1}},
{{+1, +1}, {+1, -1}},
{{+1, -1}, {-1, -1}}
// ,
// {{-3, -1}, {-1, -3}},
// {{-3, +1}, {-1, +3}},
// {{+3, -1}, {+1, -3}},
// {{+3, +1}, {+1, +3}}
};
ull ra = 0;
for (sll ki = 0; ki < 4; ki++) {
sll x[2][2] = {
{i, j}, {i, j}
};
while (true) {
for (sll xi = 0; xi < 2; xi++) for (sll xj = 0; xj < 2; xj++) {
x[xi][xj] += mov[ki][xi][xj];
}
if (!(
isinrange(0, x[0][0], h - 1)
&& isinrange(0, x[0][1], w - 1)
&& isinrange(0, x[1][0], h - 1)
&& isinrange(0, x[1][1], w - 1))) break;
if (s[x[0][0]][x[0][1]] == '#' && s[x[1][0]][x[1][1]] == '#') {
// printf("%lld:%lld: %lld:%lld,%lld:%lld (%lld)\n", i, j, x[0][0], x[0][1], x[1][0], x[1][1], ki);
ra++;
}
}
}
sll r = 0;
sll ki;
sll maxd = smax(sdiff(i, 0), sdiff(i, h - 1)) + smax(sdiff(j, 0), sdiff(j, w - 1));
maxd = sdiff(i, 0) + sdiff(j, 0);
for (ki = 1; ki <= maxd; ki++) {
r += fq(i, j - ki * 2, ki);
// printf("%lld...\n", r);
r -= fq(i - ki - 1, j - ki + 1, ki);
// printf("%lld...\n", r);
}
maxd = sdiff(i, 0) + sdiff(j, w - 1);
for (ki = 1; ki <= maxd; ki++) {
r += fp(i, j + ki * 2, ki);
// printf("%lld...\n", r);
r -= fp(i - ki - 1, j + ki - 1, ki);
// printf("%lld...\n", r);
}
maxd = sdiff(i, h - 1) + sdiff(j, h - 1);
for (ki = 1; ki <= maxd; ki++) {
r += fp(i + ki * 2, j, ki);
// printf("%lld...\n", r);
r -= fp(i + ki - 1, j - ki - 1, ki);
// printf("%lld...\n", r);
}
maxd = sdiff(i, h - 1) + sdiff(j, w - 1);
for (ki = 1; ki <= maxd; ki++) {
r += fq(i + ki * 2, j, ki);
// printf("%lld...\n", r);
r -= fq(i + ki - 1, j + ki + 1, ki);
// printf("%lld...\n", r);
}
// for (ki = 1; ki <= maxd; ki++)
// // printf("%lld-%lld: %lld(%lld\n", i, j, r, ki);
// }
// printf("\t%lld-%lld: %llu\n", i, j, r);
return r - ra;
}
sll ok (sll x1, sll y1, sll x2, sll y2, sll x3, sll y3) {
sll z1 = sdiff(x1, x2) + sdiff(y1, y2);
sll z2 = sdiff(x2, x3) + sdiff(y2, y3);
sll z3 = sdiff(x3, x1) + sdiff(y3, y1);
if (z1 == z2 && z2 == z3) {
return 1;
}
return 0;
}
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
ull *dpcell;
// sll x1, y1, x2, y2, x3, y3;
// for (x1 = 0; x1 < h; x1++) {
// for (x2 = 0; x2 < h; x2++) {
// for (x3 = 0; x3 < h; x3++) {
// for (y1 = 0; y1 < w; y1++) {
// for (y2 = 0; y2 < w; y2++) {
// for (y3 = 0; y3 < w; y3++) {
// if (s[x1][y1] == '#' && s[x2][y2]== '#' && s[x3][y3] == '#') {
// if (ok(x1, y1, x2, y2, x3, y3)) {
// printf("%lld %lld %lld %lld %lld %lld\n", x1, y1, x2, y2, x3, y3);
// }
// }
// }
// }
// }
// }
// }
// }
for (ki = 1; ki <= h; ki++) {
// printf("\t%lld\n", ki);
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
if (i < ki) {
dp[i][j][ki] = 0;
dq[i][j][ki] = 0;
continue;
}
if (j - ki < 0) {
dp[i][j][ki] = 0;
} else {
dp[i][j][ki] = dp[i - 1][j - 1][ki];
if (s[i][j] == '#' && s[i - ki][j - ki] == '#') {
dp[i][j][ki]++;
}
}
if (j + ki >= (sll)w) {
dq[i][j][ki] = 0;
} else {
dq[i][j][ki] = dq[i - 1][j + 1][ki];
if (s[i][j] == '#' && s[i - ki][j + ki] == '#') {
dq[i][j][ki]++;
}
}
// printf("%lld-%lld ", dp[i][j][ki], dq[i][j][ki]);
}
// puts("");
}
}
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
if (s[i][j] == '#') result += f(i, j);
}
}
// fp(0, -1, 1);
// printf("%lld\n", fp(0, -1, 1));
printf("%lld\n", result);
// printf("%.15lf\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("Yay!");
return 0;
fail:
// puts("NO");
puts("No");
// puts("0");
// puts("-1");
// puts("-1 -1 -1");
// puts("Impossible");
return 1;
}
int32_t main (void) {
int32_t i, j;
int32_t x, y;
scanf("%llu%llu", &h, &w);
// scanf("%llu", &n, &m);
// scanf("%llu", &k, &n, &m);
// scanf("%llu%llu", &h, &w);
// scanf("%llu", &q);
// scanf("%s", s);
// scanf("%lld%lld", &va, &vb, &vc, &vd);
// scanf("%llu%llu", &ua, &ub, &uc, &ud);
// scanf("%s", t);
// for (i = 0; i < n; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// // scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c);
// scanf("%lld", &a[i]);
// // scanf("%lld", &b[i]);
// // scanf("%lld", &c[i]);
// // scanf("%lld", &d[i]);
// // a[i]--;
// // b[i]--;
// // c[i]--;
// // d[i]--;
// // tup[i].a--;
// // tup[i].b--;
// }
// scanf("%llu", &m, &k);
// scanf("%llu", &q);
// scanf("%s", s);
// for (i = 0; i < m; i++) {
// scanf("%lld", &b[i]);
// // b[i]--;
// }
// for (i = 0; i < h; i++) {
// for (j = 0; j < w; j++) {
// scanf("%llu", &table[i][j]);
// }
// }
for (i = 0; i < h; i++) {
scanf("%s", &s[i]);
}
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_192971/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_192971/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.hwll = type { i64, i64 }
%struct.hwllc = type { i64, i64, i64 }
@w = dso_local global i64 0, align 8
@h = dso_local global i64 0, align 8
@dp = dso_local local_unnamed_addr global [305 x [305 x [602 x i64]]] zeroinitializer, align 16
@dq = dso_local local_unnamed_addr global [305 x [305 x [602 x i64]]] zeroinitializer, align 16
@s = dso_local global [3010 x [3010 x i8]] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.3 = private unnamed_addr constant [9 x i8] c"%llu%llu\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@n = dso_local local_unnamed_addr global i64 0, align 8
@m = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@va = dso_local local_unnamed_addr global i64 0, align 8
@vb = dso_local local_unnamed_addr global i64 0, align 8
@vc = dso_local local_unnamed_addr global i64 0, align 8
@vd = dso_local local_unnamed_addr global i64 0, align 8
@ve = dso_local local_unnamed_addr global i64 0, align 8
@vf = dso_local local_unnamed_addr global i64 0, align 8
@ua = dso_local local_unnamed_addr global i64 0, align 8
@ub = dso_local local_unnamed_addr global i64 0, align 8
@uc = dso_local local_unnamed_addr global i64 0, align 8
@ud = dso_local local_unnamed_addr global i64 0, align 8
@ue = dso_local local_unnamed_addr global i64 0, align 8
@uf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@a = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@xy = dso_local local_unnamed_addr global [1000000 x %struct.hwll] zeroinitializer, align 16
@tup = dso_local local_unnamed_addr global [1000000 x %struct.hwllc] zeroinitializer, align 16
@table = dso_local local_unnamed_addr global [3000 x [3000 x i64]] zeroinitializer, align 16
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ]
%y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ]
%cmp = icmp ult i64 %x.tr, %y.tr
br i1 %cmp, label %tailrecurse.backedge, label %if.else
if.else: ; preds = %tailrecurse
%cmp1 = icmp eq i64 %y.tr, 0
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%rem = urem i64 %x.tr, %y.tr
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.else3, %tailrecurse
%y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ]
br label %tailrecurse
return: ; preds = %if.else
ret i64 %x.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%tobool.not12 = icmp eq i64 %x, 0
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.015, %a.addr.014
%rem = urem i64 %mul, %modulo
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ]
%div11 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.014, %a.addr.014
%rem3 = urem i64 %mul2, %modulo
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%sub = add i64 %modulo, -2
%tobool.not12.i = icmp eq i64 %sub, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %entry, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, %modulo
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, %modulo
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5
bitpow.exit: ; preds = %if.end.i, %entry
%result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ]
%mul = mul i64 %result.0.lcssa.i, %a
%rem = urem i64 %mul, %modulo
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not = icmp ult i64 %a, %b
%sub = sub i64 %a, %b
%sub1 = sub i64 %b, %a
%retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %a, %b
%retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 {
entry:
%tobool.not6 = icmp eq i64 %n, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ]
%0 = trunc i64 %n.addr.07 to i32
%1 = and i32 %0, 1
%spec.select = add i32 %1, %result.08
%div5 = lshr i64 %n.addr.07, 1
%tobool.not = icmp ult i64 %n.addr.07, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7
while.end: ; preds = %while.body, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp ult i64 %0, %1
%cmp1 = icmp ugt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp ugt i64 %0, %1
%cmp1 = icmp ult i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %left, align 1, !tbaa !12
%1 = load i8, ptr %right, align 1, !tbaa !12
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp sgt i8 %0, %1
%. = zext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load double, ptr %left, align 8, !tbaa !13
%1 = load double, ptr %right, align 8, !tbaa !13
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp ogt double %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr %left, align 8, !tbaa !15
%1 = load ptr, ptr %right, align 8, !tbaa !15
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !20
%l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19
%l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17
%l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24
%l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !20
%r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19
%r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17
%r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24
%r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18
%cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp.i, label %cleanup10, label %if.end.i
if.end.i: ; preds = %entry
%cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4.i, label %cleanup10, label %if.end6.i
if.end6.i: ; preds = %if.end.i
%cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit
phwllABcomp.exit: ; preds = %if.end6.i
%cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp13.i.not, label %cleanup10, label %if.end
if.end: ; preds = %phwllABcomp.exit
%cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp.i21, label %cleanup10, label %if.end.i22
if.end.i22: ; preds = %if.end
%cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24
if.end6.i24: ; preds = %if.end.i22
%cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26
if.end10.i26: ; preds = %if.end6.i24
%cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
%..i28 = zext i1 %cmp13.i27 to i32
br label %cleanup10
cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit
%retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp.not = icmp sgt i64 %left, %x
%cmp1.not = icmp sgt i64 %x, %right
%or.cond = or i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %lor.rhs, label %lor.end
lor.rhs: ; preds = %entry
%cmp2 = icmp sge i64 %left, %x
%cmp3 = icmp sge i64 %x, %right
%0 = and i1 %cmp2, %cmp3
br label %lor.end
lor.end: ; preds = %entry, %lor.rhs
%1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ]
ret i1 %1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @fp(i64 noundef %i, i64 noundef %j, i64 noundef %x) local_unnamed_addr #6 {
entry:
%0 = load i64, ptr @w, align 8, !tbaa !8
%cmp.not = icmp sgt i64 %0, %j
%sub = add i64 %0, -1
%sub1.neg = sub i64 %sub, %j
%j.addr.0 = select i1 %cmp.not, i64 %j, i64 %sub
%sub2 = select i1 %cmp.not, i64 0, i64 %sub1.neg
%i.addr.0 = add i64 %sub2, %i
%1 = load i64, ptr @h, align 8, !tbaa !8
%cmp4.not = icmp slt i64 %i.addr.0, %1
%sub7 = add i64 %1, -1
%sub8.neg = sub i64 %sub7, %i.addr.0
%sub10 = select i1 %cmp4.not, i64 0, i64 %sub8.neg
%j.addr.1 = add i64 %sub10, %j.addr.0
%i.addr.1 = select i1 %cmp4.not, i64 %i.addr.0, i64 %sub7
%2 = or i64 %j.addr.1, %i.addr.1
%or.cond.not = icmp sgt i64 %2, -1
br i1 %or.cond.not, label %if.end15, label %return
if.end15: ; preds = %entry
%arrayidx17 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.addr.1, i64 %j.addr.1, i64 %x
%3 = load i64, ptr %arrayidx17, align 8, !tbaa !8
br label %return
return: ; preds = %entry, %if.end15
%retval.0 = phi i64 [ %3, %if.end15 ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @fq(i64 noundef %i, i64 noundef %j, i64 noundef %x) local_unnamed_addr #7 {
entry:
%spec.select = tail call i64 @llvm.smax.i64(i64 %j, i64 0)
%sub1 = tail call i64 @llvm.smin.i64(i64 %j, i64 0)
%spec.select28 = add nsw i64 %sub1, %i
%0 = load i64, ptr @h, align 8, !tbaa !8
%cmp2.not = icmp slt i64 %spec.select28, %0
%sub5 = add i64 %0, -1
%sub6 = sub i64 %spec.select28, %sub5
%add8 = select i1 %cmp2.not, i64 0, i64 %sub6
%j.addr.1 = add nsw i64 %add8, %spec.select
%i.addr.1 = select i1 %cmp2.not, i64 %spec.select28, i64 %sub5
%cmp10 = icmp sgt i64 %i.addr.1, -1
%1 = load i64, ptr @w, align 8
%cmp11.not = icmp slt i64 %j.addr.1, %1
%or.cond = select i1 %cmp10, i1 %cmp11.not, i1 false
br i1 %or.cond, label %if.end13, label %return
if.end13: ; preds = %entry
%arrayidx15 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.addr.1, i64 %j.addr.1, i64 %x
%2 = load i64, ptr %arrayidx15, align 8, !tbaa !8
br label %return
return: ; preds = %entry, %if.end13
%retval.0 = phi i64 [ %2, %if.end13 ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @f(i64 noundef %i, i64 noundef %j) local_unnamed_addr #8 {
entry:
%0 = load i64, ptr @h, align 8, !tbaa !8
%sub = add i64 %0, -1
%1 = load i64, ptr @w, align 8
%sub24 = add i64 %1, -1
%add416 = add nsw i64 %i, -1
%cmp.i420 = icmp sgt i64 %i, 0
%cmp1.i421 = icmp sle i64 %add416, %sub
%2 = and i1 %cmp.i420, %cmp1.i421
br i1 %2, label %land.lhs.true, label %while.end
land.lhs.true: ; preds = %entry, %if.end56
%add426 = phi i64 [ %add, %if.end56 ], [ %add416, %entry ]
%ra.1425 = phi i64 [ %ra.2, %if.end56 ], [ 0, %entry ]
%x.sroa.24.0424 = phi i64 [ %add.1427, %if.end56 ], [ %j, %entry ]
%x.sroa.40.0423 = phi i64 [ %add.1381428, %if.end56 ], [ %i, %entry ]
%x.sroa.56.0422 = phi i64 [ %add.1.1429, %if.end56 ], [ %j, %entry ]
%add.1427 = add nsw i64 %x.sroa.24.0424, -1
%add.1381428 = add nsw i64 %x.sroa.40.0423, -1
%add.1.1429 = add nsw i64 %x.sroa.56.0422, 1
%cmp.i239 = icmp sgt i64 %x.sroa.24.0424, 0
%cmp1.i240 = icmp sle i64 %add.1427, %sub24
%3 = and i1 %cmp.i239, %cmp1.i240
br i1 %3, label %land.lhs.true26, label %while.end
land.lhs.true26: ; preds = %land.lhs.true
%cmp.i241 = icmp sgt i64 %x.sroa.40.0423, 0
%cmp1.i242 = icmp sle i64 %add.1381428, %sub
%4 = and i1 %cmp.i241, %cmp1.i242
br i1 %4, label %land.lhs.true31, label %while.end
land.lhs.true31: ; preds = %land.lhs.true26
%cmp.i243 = icmp sgt i64 %x.sroa.56.0422, -2
%cmp1.i244 = icmp slt i64 %x.sroa.56.0422, %sub24
%5 = and i1 %cmp.i243, %cmp1.i244
br i1 %5, label %if.end, label %while.end
if.end: ; preds = %land.lhs.true31
%arrayidx41 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %add426, i64 %add.1427
%6 = load i8, ptr %arrayidx41, align 1, !tbaa !12
%cmp42 = icmp eq i8 %6, 35
br i1 %cmp42, label %land.lhs.true44, label %if.end56
land.lhs.true44: ; preds = %if.end
%arrayidx50 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %add.1381428, i64 %add.1.1429
%7 = load i8, ptr %arrayidx50, align 1, !tbaa !12
%cmp52 = icmp eq i8 %7, 35
%inc55 = zext i1 %cmp52 to i64
%spec.select = add i64 %ra.1425, %inc55
br label %if.end56
if.end56: ; preds = %land.lhs.true44, %if.end
%ra.2 = phi i64 [ %ra.1425, %if.end ], [ %spec.select, %land.lhs.true44 ]
%add = add nsw i64 %add426, -1
%cmp.i = icmp sgt i64 %add426, 0
%cmp1.i = icmp sle i64 %add, %sub
%8 = and i1 %cmp.i, %cmp1.i
br i1 %8, label %land.lhs.true, label %while.end
while.end: ; preds = %land.lhs.true31, %land.lhs.true26, %land.lhs.true, %if.end56, %entry
%ra.1.lcssa = phi i64 [ 0, %entry ], [ %ra.1425, %land.lhs.true31 ], [ %ra.1425, %land.lhs.true26 ], [ %ra.1425, %land.lhs.true ], [ %ra.2, %if.end56 ]
%add.1383433 = add nsw i64 %i, -1
%cmp.i.1437 = icmp sgt i64 %i, 0
%cmp1.i.1438 = icmp sle i64 %add.1383433, %sub
%9 = and i1 %cmp.i.1437, %cmp1.i.1438
br i1 %9, label %land.lhs.true.1, label %while.end.1
land.lhs.true.1: ; preds = %while.end, %if.end56.1
%add.1383443 = phi i64 [ %add.1383, %if.end56.1 ], [ %add.1383433, %while.end ]
%ra.1.1442 = phi i64 [ %ra.2.1, %if.end56.1 ], [ %ra.1.lcssa, %while.end ]
%x.sroa.24.1441 = phi i64 [ %add.1.1386444, %if.end56.1 ], [ %j, %while.end ]
%x.sroa.40.1440 = phi i64 [ %add.1381.1445, %if.end56.1 ], [ %i, %while.end ]
%x.sroa.56.1439 = phi i64 [ %add.1.1.1446, %if.end56.1 ], [ %j, %while.end ]
%add.1.1386444 = add nsw i64 %x.sroa.24.1441, 1
%add.1381.1445 = add nsw i64 %x.sroa.40.1440, 1
%add.1.1.1446 = add nsw i64 %x.sroa.56.1439, 1
%cmp.i239.1 = icmp sgt i64 %x.sroa.24.1441, -2
%cmp1.i240.1 = icmp slt i64 %x.sroa.24.1441, %sub24
%10 = and i1 %cmp.i239.1, %cmp1.i240.1
br i1 %10, label %land.lhs.true26.1, label %while.end.1
land.lhs.true26.1: ; preds = %land.lhs.true.1
%cmp.i241.1 = icmp sgt i64 %x.sroa.40.1440, -2
%cmp1.i242.1 = icmp slt i64 %x.sroa.40.1440, %sub
%11 = and i1 %cmp.i241.1, %cmp1.i242.1
br i1 %11, label %land.lhs.true31.1, label %while.end.1
land.lhs.true31.1: ; preds = %land.lhs.true26.1
%cmp.i243.1 = icmp sgt i64 %x.sroa.56.1439, -2
%cmp1.i244.1 = icmp slt i64 %x.sroa.56.1439, %sub24
%12 = and i1 %cmp.i243.1, %cmp1.i244.1
br i1 %12, label %if.end.1, label %while.end.1
while.end.1: ; preds = %if.end56.1, %land.lhs.true.1, %land.lhs.true26.1, %land.lhs.true31.1, %while.end
%ra.1.1.lcssa = phi i64 [ %ra.1.lcssa, %while.end ], [ %ra.2.1, %if.end56.1 ], [ %ra.1.1442, %land.lhs.true.1 ], [ %ra.1.1442, %land.lhs.true26.1 ], [ %ra.1.1442, %land.lhs.true31.1 ]
%cmp.i.2455 = icmp sgt i64 %i, -2
%cmp1.i.2456 = icmp sgt i64 %sub, %i
%13 = and i1 %cmp.i.2455, %cmp1.i.2456
br i1 %13, label %land.lhs.true.2, label %while.end.2
if.end.1: ; preds = %land.lhs.true31.1
%arrayidx41.1 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %add.1383443, i64 %add.1.1386444
%14 = load i8, ptr %arrayidx41.1, align 1, !tbaa !12
%cmp42.1 = icmp eq i8 %14, 35
br i1 %cmp42.1, label %land.lhs.true44.1, label %if.end56.1
land.lhs.true44.1: ; preds = %if.end.1
%arrayidx50.1 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %add.1381.1445, i64 %add.1.1.1446
%15 = load i8, ptr %arrayidx50.1, align 1, !tbaa !12
%cmp52.1 = icmp eq i8 %15, 35
%inc55.1 = zext i1 %cmp52.1 to i64
%spec.select.1 = add i64 %ra.1.1442, %inc55.1
br label %if.end56.1
if.end56.1: ; preds = %land.lhs.true44.1, %if.end.1
%ra.2.1 = phi i64 [ %ra.1.1442, %if.end.1 ], [ %spec.select.1, %land.lhs.true44.1 ]
%add.1383 = add nsw i64 %add.1383443, -1
%cmp.i.1 = icmp sgt i64 %add.1383443, 0
%cmp1.i.1 = icmp sle i64 %add.1383, %sub
%16 = and i1 %cmp.i.1, %cmp1.i.1
br i1 %16, label %land.lhs.true.1, label %while.end.1
land.lhs.true.2: ; preds = %while.end.1, %if.end56.2
%add.2461.in = phi i64 [ %add.2461, %if.end56.2 ], [ %i, %while.end.1 ]
%ra.1.2460 = phi i64 [ %ra.2.2, %if.end56.2 ], [ %ra.1.1.lcssa, %while.end.1 ]
%x.sroa.24.2459 = phi i64 [ %add.1.2462, %if.end56.2 ], [ %j, %while.end.1 ]
%x.sroa.40.2458 = phi i64 [ %add.1381.2463, %if.end56.2 ], [ %i, %while.end.1 ]
%x.sroa.56.2457 = phi i64 [ %add.1.1.2464, %if.end56.2 ], [ %j, %while.end.1 ]
%add.2461 = add nsw i64 %add.2461.in, 1
%add.1.2462 = add nsw i64 %x.sroa.24.2459, 1
%add.1381.2463 = add nsw i64 %x.sroa.40.2458, 1
%add.1.1.2464 = add nsw i64 %x.sroa.56.2457, -1
%cmp.i239.2 = icmp sgt i64 %x.sroa.24.2459, -2
%cmp1.i240.2 = icmp slt i64 %x.sroa.24.2459, %sub24
%17 = and i1 %cmp.i239.2, %cmp1.i240.2
br i1 %17, label %land.lhs.true26.2, label %while.end.2
land.lhs.true26.2: ; preds = %land.lhs.true.2
%cmp.i241.2 = icmp sgt i64 %x.sroa.40.2458, -2
%cmp1.i242.2 = icmp slt i64 %x.sroa.40.2458, %sub
%18 = and i1 %cmp.i241.2, %cmp1.i242.2
br i1 %18, label %land.lhs.true31.2, label %while.end.2
land.lhs.true31.2: ; preds = %land.lhs.true26.2
%cmp.i243.2 = icmp sgt i64 %x.sroa.56.2457, 0
%cmp1.i244.2 = icmp sle i64 %add.1.1.2464, %sub24
%19 = and i1 %cmp.i243.2, %cmp1.i244.2
br i1 %19, label %if.end.2, label %while.end.2
while.end.2: ; preds = %if.end56.2, %land.lhs.true.2, %land.lhs.true26.2, %land.lhs.true31.2, %while.end.1
%ra.1.2.lcssa = phi i64 [ %ra.1.1.lcssa, %while.end.1 ], [ %ra.2.2, %if.end56.2 ], [ %ra.1.2460, %land.lhs.true.2 ], [ %ra.1.2460, %land.lhs.true26.2 ], [ %ra.1.2460, %land.lhs.true31.2 ]
%cmp.i.3473 = icmp sgt i64 %i, -2
%cmp1.i.3474 = icmp sgt i64 %sub, %i
%20 = and i1 %cmp.i.3473, %cmp1.i.3474
br i1 %20, label %land.lhs.true.3, label %while.end.3
if.end.2: ; preds = %land.lhs.true31.2
%arrayidx41.2 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %add.2461, i64 %add.1.2462
%21 = load i8, ptr %arrayidx41.2, align 1, !tbaa !12
%cmp42.2 = icmp eq i8 %21, 35
br i1 %cmp42.2, label %land.lhs.true44.2, label %if.end56.2
land.lhs.true44.2: ; preds = %if.end.2
%arrayidx50.2 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %add.1381.2463, i64 %add.1.1.2464
%22 = load i8, ptr %arrayidx50.2, align 1, !tbaa !12
%cmp52.2 = icmp eq i8 %22, 35
%inc55.2 = zext i1 %cmp52.2 to i64
%spec.select.2 = add i64 %ra.1.2460, %inc55.2
br label %if.end56.2
if.end56.2: ; preds = %land.lhs.true44.2, %if.end.2
%ra.2.2 = phi i64 [ %ra.1.2460, %if.end.2 ], [ %spec.select.2, %land.lhs.true44.2 ]
%cmp.i.2 = icmp sgt i64 %add.2461.in, -3
%cmp1.i.2 = icmp slt i64 %add.2461, %sub
%23 = and i1 %cmp.i.2, %cmp1.i.2
br i1 %23, label %land.lhs.true.2, label %while.end.2
land.lhs.true.3: ; preds = %while.end.2, %if.end56.3
%add.3479.in = phi i64 [ %add.3479, %if.end56.3 ], [ %i, %while.end.2 ]
%ra.1.3478 = phi i64 [ %ra.2.3, %if.end56.3 ], [ %ra.1.2.lcssa, %while.end.2 ]
%x.sroa.24.3477 = phi i64 [ %add.1.3480, %if.end56.3 ], [ %j, %while.end.2 ]
%x.sroa.40.3476 = phi i64 [ %add.1381.3481, %if.end56.3 ], [ %i, %while.end.2 ]
%x.sroa.56.3475 = phi i64 [ %add.1.1.3482, %if.end56.3 ], [ %j, %while.end.2 ]
%add.3479 = add nsw i64 %add.3479.in, 1
%add.1.3480 = add nsw i64 %x.sroa.24.3477, -1
%add.1381.3481 = add nsw i64 %x.sroa.40.3476, -1
%add.1.1.3482 = add nsw i64 %x.sroa.56.3475, -1
%cmp.i239.3 = icmp sgt i64 %x.sroa.24.3477, 0
%cmp1.i240.3 = icmp sle i64 %add.1.3480, %sub24
%24 = and i1 %cmp.i239.3, %cmp1.i240.3
br i1 %24, label %land.lhs.true26.3, label %while.end.3
land.lhs.true26.3: ; preds = %land.lhs.true.3
%cmp.i241.3 = icmp sgt i64 %x.sroa.40.3476, 0
%cmp1.i242.3 = icmp sle i64 %add.1381.3481, %sub
%25 = and i1 %cmp.i241.3, %cmp1.i242.3
br i1 %25, label %land.lhs.true31.3, label %while.end.3
land.lhs.true31.3: ; preds = %land.lhs.true26.3
%cmp.i243.3 = icmp sgt i64 %x.sroa.56.3475, 0
%cmp1.i244.3 = icmp sle i64 %add.1.1.3482, %sub24
%26 = and i1 %cmp.i243.3, %cmp1.i244.3
br i1 %26, label %if.end.3, label %while.end.3
while.end.3: ; preds = %if.end56.3, %land.lhs.true.3, %land.lhs.true26.3, %land.lhs.true31.3, %while.end.2
%ra.1.3.lcssa = phi i64 [ %ra.1.2.lcssa, %while.end.2 ], [ %ra.2.3, %if.end56.3 ], [ %ra.1.3478, %land.lhs.true.3 ], [ %ra.1.3478, %land.lhs.true26.3 ], [ %ra.1.3478, %land.lhs.true31.3 ]
%retval.0.i = tail call i64 @llvm.abs.i64(i64 %i, i1 true)
%sub.i = sub nsw i64 %i, %sub
%retval.0.i232 = tail call i64 @llvm.abs.i64(i64 %sub.i, i1 true)
%retval.0.i233 = tail call i64 @llvm.abs.i64(i64 %j, i1 true)
%sub.i234 = sub nsw i64 %j, %sub24
%retval.0.i235 = tail call i64 @llvm.abs.i64(i64 %sub.i234, i1 true)
%add72 = add nuw i64 %retval.0.i233, %retval.0.i
%cmp74.not364 = icmp eq i64 %add72, 0
br i1 %cmp74.not364, label %for.end88, label %for.body76
if.end.3: ; preds = %land.lhs.true31.3
%arrayidx41.3 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %add.3479, i64 %add.1.3480
%27 = load i8, ptr %arrayidx41.3, align 1, !tbaa !12
%cmp42.3 = icmp eq i8 %27, 35
br i1 %cmp42.3, label %land.lhs.true44.3, label %if.end56.3
land.lhs.true44.3: ; preds = %if.end.3
%arrayidx50.3 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %add.1381.3481, i64 %add.1.1.3482
%28 = load i8, ptr %arrayidx50.3, align 1, !tbaa !12
%cmp52.3 = icmp eq i8 %28, 35
%inc55.3 = zext i1 %cmp52.3 to i64
%spec.select.3 = add i64 %ra.1.3478, %inc55.3
br label %if.end56.3
if.end56.3: ; preds = %land.lhs.true44.3, %if.end.3
%ra.2.3 = phi i64 [ %ra.1.3478, %if.end.3 ], [ %spec.select.3, %land.lhs.true44.3 ]
%cmp.i.3 = icmp sgt i64 %add.3479.in, -3
%cmp1.i.3 = icmp slt i64 %add.3479, %sub
%29 = and i1 %cmp.i.3, %cmp1.i.3
br i1 %29, label %land.lhs.true.3, label %while.end.3
for.body76: ; preds = %while.end.3, %fq.exit261
%ki60.0366 = phi i64 [ %inc87, %fq.exit261 ], [ 1, %while.end.3 ]
%r.0365 = phi i64 [ %sub85, %fq.exit261 ], [ 0, %while.end.3 ]
%mul = shl nuw nsw i64 %ki60.0366, 1
%sub77 = sub nsw i64 %j, %mul
%spec.select.i = tail call i64 @llvm.smax.i64(i64 %sub77, i64 0)
%sub1.i = tail call i64 @llvm.smin.i64(i64 %sub77, i64 0)
%spec.select28.i = add nsw i64 %sub1.i, %i
%cmp2.not.i = icmp slt i64 %spec.select28.i, %0
%sub6.i = sub i64 %spec.select28.i, %sub
%add8.i = select i1 %cmp2.not.i, i64 0, i64 %sub6.i
%j.addr.1.i = add nsw i64 %add8.i, %spec.select.i
%i.addr.1.i = select i1 %cmp2.not.i, i64 %spec.select28.i, i64 %sub
%cmp10.i = icmp sgt i64 %i.addr.1.i, -1
%cmp11.not.i = icmp slt i64 %j.addr.1.i, %1
%or.cond.i = select i1 %cmp10.i, i1 %cmp11.not.i, i1 false
br i1 %or.cond.i, label %if.end13.i, label %fq.exit
if.end13.i: ; preds = %for.body76
%arrayidx15.i = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.addr.1.i, i64 %j.addr.1.i, i64 %ki60.0366
%30 = load i64, ptr %arrayidx15.i, align 8, !tbaa !8
br label %fq.exit
fq.exit: ; preds = %for.body76, %if.end13.i
%retval.0.i245 = phi i64 [ %30, %if.end13.i ], [ 0, %for.body76 ]
%add79 = add nsw i64 %retval.0.i245, %r.0365
%31 = xor i64 %ki60.0366, -1
%sub81 = add i64 %31, %i
%sub82 = sub nsw i64 %j, %ki60.0366
%add83 = add nsw i64 %sub82, 1
%spec.select.i246 = tail call i64 @llvm.smax.i64(i64 %add83, i64 0)
%sub1.i247 = tail call i64 @llvm.smin.i64(i64 %add83, i64 0)
%spec.select28.i248 = add nsw i64 %sub81, %sub1.i247
%cmp2.not.i249 = icmp slt i64 %spec.select28.i248, %0
%sub6.i251 = sub i64 %spec.select28.i248, %sub
%add8.i252 = select i1 %cmp2.not.i249, i64 0, i64 %sub6.i251
%j.addr.1.i253 = add nsw i64 %add8.i252, %spec.select.i246
%i.addr.1.i254 = select i1 %cmp2.not.i249, i64 %spec.select28.i248, i64 %sub
%cmp10.i255 = icmp sgt i64 %i.addr.1.i254, -1
%cmp11.not.i256 = icmp slt i64 %j.addr.1.i253, %1
%or.cond.i257 = select i1 %cmp10.i255, i1 %cmp11.not.i256, i1 false
br i1 %or.cond.i257, label %if.end13.i259, label %fq.exit261
if.end13.i259: ; preds = %fq.exit
%arrayidx15.i260 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.addr.1.i254, i64 %j.addr.1.i253, i64 %ki60.0366
%32 = load i64, ptr %arrayidx15.i260, align 8, !tbaa !8
br label %fq.exit261
fq.exit261: ; preds = %fq.exit, %if.end13.i259
%retval.0.i258 = phi i64 [ %32, %if.end13.i259 ], [ 0, %fq.exit ]
%sub85 = sub i64 %add79, %retval.0.i258
%inc87 = add nuw i64 %ki60.0366, 1
%exitcond.not = icmp eq i64 %ki60.0366, %add72
br i1 %exitcond.not, label %for.end88, label %for.body76, !llvm.loop !21
for.end88: ; preds = %fq.exit261, %while.end.3
%r.0.lcssa = phi i64 [ 0, %while.end.3 ], [ %sub85, %fq.exit261 ]
%add92 = add nuw nsw i64 %retval.0.i235, %retval.0.i
%cmp94.not367 = icmp eq i64 %add92, 0
br i1 %cmp94.not367, label %for.end109, label %for.body96
for.body96: ; preds = %for.end88, %fp.exit285
%ki60.1369 = phi i64 [ %inc108, %fp.exit285 ], [ 1, %for.end88 ]
%r.1368 = phi i64 [ %sub106, %fp.exit285 ], [ %r.0.lcssa, %for.end88 ]
%mul97 = shl nuw nsw i64 %ki60.1369, 1
%add98 = add nsw i64 %mul97, %j
%cmp.not.i = icmp sgt i64 %1, %add98
%sub1.neg.i = sub i64 %sub24, %add98
%j.addr.0.i = select i1 %cmp.not.i, i64 %add98, i64 %sub24
%sub2.i = select i1 %cmp.not.i, i64 0, i64 %sub1.neg.i
%i.addr.0.i = add i64 %sub2.i, %i
%cmp4.not.i = icmp slt i64 %i.addr.0.i, %0
%sub8.neg.i = sub i64 %sub, %i.addr.0.i
%sub10.i = select i1 %cmp4.not.i, i64 0, i64 %sub8.neg.i
%j.addr.1.i266 = add i64 %sub10.i, %j.addr.0.i
%i.addr.1.i267 = select i1 %cmp4.not.i, i64 %i.addr.0.i, i64 %sub
%33 = or i64 %j.addr.1.i266, %i.addr.1.i267
%or.cond.not.i = icmp sgt i64 %33, -1
br i1 %or.cond.not.i, label %if.end15.i, label %fp.exit
if.end15.i: ; preds = %for.body96
%arrayidx17.i = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.addr.1.i267, i64 %j.addr.1.i266, i64 %ki60.1369
%34 = load i64, ptr %arrayidx17.i, align 8, !tbaa !8
br label %fp.exit
fp.exit: ; preds = %for.body96, %if.end15.i
%retval.0.i268 = phi i64 [ %34, %if.end15.i ], [ 0, %for.body96 ]
%add100 = add nsw i64 %retval.0.i268, %r.1368
%35 = xor i64 %ki60.1369, -1
%sub102 = add i64 %35, %i
%add103 = add nsw i64 %ki60.1369, %j
%sub104 = add nsw i64 %add103, -1
%cmp.not.i269.not = icmp slt i64 %1, %add103
%sub1.neg.i271 = sub i64 %sub24, %sub104
%j.addr.0.i272 = select i1 %cmp.not.i269.not, i64 %sub24, i64 %sub104
%sub2.i273 = select i1 %cmp.not.i269.not, i64 %sub1.neg.i271, i64 0
%i.addr.0.i274 = add i64 %sub102, %sub2.i273
%cmp4.not.i275 = icmp slt i64 %i.addr.0.i274, %0
%sub8.neg.i277 = sub i64 %sub, %i.addr.0.i274
%sub10.i278 = select i1 %cmp4.not.i275, i64 0, i64 %sub8.neg.i277
%j.addr.1.i279 = add i64 %sub10.i278, %j.addr.0.i272
%i.addr.1.i280 = select i1 %cmp4.not.i275, i64 %i.addr.0.i274, i64 %sub
%36 = or i64 %j.addr.1.i279, %i.addr.1.i280
%or.cond.not.i281 = icmp sgt i64 %36, -1
br i1 %or.cond.not.i281, label %if.end15.i283, label %fp.exit285
if.end15.i283: ; preds = %fp.exit
%arrayidx17.i284 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.addr.1.i280, i64 %j.addr.1.i279, i64 %ki60.1369
%37 = load i64, ptr %arrayidx17.i284, align 8, !tbaa !8
br label %fp.exit285
fp.exit285: ; preds = %fp.exit, %if.end15.i283
%retval.0.i282 = phi i64 [ %37, %if.end15.i283 ], [ 0, %fp.exit ]
%sub106 = sub i64 %add100, %retval.0.i282
%inc108 = add nuw nsw i64 %ki60.1369, 1
%cmp94.not.not = icmp ult i64 %ki60.1369, %add92
br i1 %cmp94.not.not, label %for.body96, label %for.end109, !llvm.loop !22
for.end109: ; preds = %fp.exit285, %for.end88
%r.1.lcssa = phi i64 [ %r.0.lcssa, %for.end88 ], [ %sub106, %fp.exit285 ]
%sub.i288 = sub nsw i64 %j, %sub
%retval.0.i289 = tail call i64 @llvm.abs.i64(i64 %sub.i288, i1 true)
%add114 = add nuw nsw i64 %retval.0.i232, %retval.0.i289
%cmp116.not371 = icmp eq i64 %add114, 0
br i1 %cmp116.not371, label %for.end131, label %for.body118.lr.ph
for.body118.lr.ph: ; preds = %for.end109
%cmp.not.i290 = icmp sgt i64 %1, %j
%sub1.neg.i292 = sub i64 %sub24, %j
%j.addr.0.i293 = select i1 %cmp.not.i290, i64 %j, i64 %sub24
%sub2.i294 = select i1 %cmp.not.i290, i64 0, i64 %sub1.neg.i292
%add120 = add i64 %sub2.i294, %i
%add123 = add i64 %i, -1
br label %for.body118
for.body118: ; preds = %for.body118.lr.ph, %fp.exit323
%ki60.2373 = phi i64 [ 1, %for.body118.lr.ph ], [ %inc130, %fp.exit323 ]
%r.2372 = phi i64 [ %r.1.lcssa, %for.body118.lr.ph ], [ %sub128, %fp.exit323 ]
%mul119 = shl nuw nsw i64 %ki60.2373, 1
%i.addr.0.i295 = add i64 %add120, %mul119
%cmp4.not.i296 = icmp slt i64 %i.addr.0.i295, %0
%sub8.neg.i298 = sub i64 %sub, %i.addr.0.i295
%sub10.i299 = select i1 %cmp4.not.i296, i64 0, i64 %sub8.neg.i298
%j.addr.1.i300 = add i64 %sub10.i299, %j.addr.0.i293
%i.addr.1.i301 = select i1 %cmp4.not.i296, i64 %i.addr.0.i295, i64 %sub
%38 = or i64 %j.addr.1.i300, %i.addr.1.i301
%or.cond.not.i302 = icmp sgt i64 %38, -1
br i1 %or.cond.not.i302, label %if.end15.i304, label %fp.exit306
if.end15.i304: ; preds = %for.body118
%arrayidx17.i305 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.addr.1.i301, i64 %j.addr.1.i300, i64 %ki60.2373
%39 = load i64, ptr %arrayidx17.i305, align 8, !tbaa !8
br label %fp.exit306
fp.exit306: ; preds = %for.body118, %if.end15.i304
%retval.0.i303 = phi i64 [ %39, %if.end15.i304 ], [ 0, %for.body118 ]
%add122 = add nsw i64 %retval.0.i303, %r.2372
%40 = xor i64 %ki60.2373, -1
%sub126 = add i64 %40, %j
%cmp.not.i307 = icmp sgt i64 %1, %sub126
%sub1.neg.i309 = sub i64 %sub24, %sub126
%j.addr.0.i310 = select i1 %cmp.not.i307, i64 %sub126, i64 %sub24
%sub2.i311 = select i1 %cmp.not.i307, i64 0, i64 %sub1.neg.i309
%sub124 = add i64 %add123, %ki60.2373
%i.addr.0.i312 = add i64 %sub124, %sub2.i311
%cmp4.not.i313 = icmp slt i64 %i.addr.0.i312, %0
%sub8.neg.i315 = sub i64 %sub, %i.addr.0.i312
%sub10.i316 = select i1 %cmp4.not.i313, i64 0, i64 %sub8.neg.i315
%j.addr.1.i317 = add i64 %sub10.i316, %j.addr.0.i310
%i.addr.1.i318 = select i1 %cmp4.not.i313, i64 %i.addr.0.i312, i64 %sub
%41 = or i64 %j.addr.1.i317, %i.addr.1.i318
%or.cond.not.i319 = icmp sgt i64 %41, -1
br i1 %or.cond.not.i319, label %if.end15.i321, label %fp.exit323
if.end15.i321: ; preds = %fp.exit306
%arrayidx17.i322 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.addr.1.i318, i64 %j.addr.1.i317, i64 %ki60.2373
%42 = load i64, ptr %arrayidx17.i322, align 8, !tbaa !8
br label %fp.exit323
fp.exit323: ; preds = %fp.exit306, %if.end15.i321
%retval.0.i320 = phi i64 [ %42, %if.end15.i321 ], [ 0, %fp.exit306 ]
%sub128 = sub i64 %add122, %retval.0.i320
%inc130 = add nuw nsw i64 %ki60.2373, 1
%cmp116.not.not = icmp ult i64 %ki60.2373, %add114
br i1 %cmp116.not.not, label %for.body118, label %for.end131, !llvm.loop !23
for.end131: ; preds = %fp.exit323, %for.end109
%r.2.lcssa = phi i64 [ %r.1.lcssa, %for.end109 ], [ %sub128, %fp.exit323 ]
%add136 = add nuw nsw i64 %retval.0.i235, %retval.0.i232
%cmp138.not375 = icmp eq i64 %add136, 0
br i1 %cmp138.not375, label %for.end153, label %for.body140.lr.ph
for.body140.lr.ph: ; preds = %for.end131
%spec.select.i328 = tail call i64 @llvm.smax.i64(i64 %j, i64 0)
%sub1.i329 = tail call i64 @llvm.smin.i64(i64 %j, i64 0)
%add142 = add i64 %sub1.i329, %i
%add147 = add i64 %j, 1
%add145 = add i64 %i, -1
br label %for.body140
for.body140: ; preds = %for.body140.lr.ph, %fq.exit359
%ki60.3377 = phi i64 [ 1, %for.body140.lr.ph ], [ %inc152, %fq.exit359 ]
%r.3376 = phi i64 [ %r.2.lcssa, %for.body140.lr.ph ], [ %sub150, %fq.exit359 ]
%mul141 = shl nuw nsw i64 %ki60.3377, 1
%spec.select28.i330 = add i64 %add142, %mul141
%cmp2.not.i331 = icmp slt i64 %spec.select28.i330, %0
%sub6.i333 = sub i64 %spec.select28.i330, %sub
%add8.i334 = select i1 %cmp2.not.i331, i64 0, i64 %sub6.i333
%j.addr.1.i335 = add nsw i64 %add8.i334, %spec.select.i328
%i.addr.1.i336 = select i1 %cmp2.not.i331, i64 %spec.select28.i330, i64 %sub
%cmp10.i337 = icmp sgt i64 %i.addr.1.i336, -1
%cmp11.not.i338 = icmp slt i64 %j.addr.1.i335, %1
%or.cond.i339 = select i1 %cmp10.i337, i1 %cmp11.not.i338, i1 false
br i1 %or.cond.i339, label %if.end13.i341, label %fq.exit343
if.end13.i341: ; preds = %for.body140
%arrayidx15.i342 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.addr.1.i336, i64 %j.addr.1.i335, i64 %ki60.3377
%43 = load i64, ptr %arrayidx15.i342, align 8, !tbaa !8
br label %fq.exit343
fq.exit343: ; preds = %for.body140, %if.end13.i341
%retval.0.i340 = phi i64 [ %43, %if.end13.i341 ], [ 0, %for.body140 ]
%add144 = add nsw i64 %retval.0.i340, %r.3376
%add148 = add i64 %add147, %ki60.3377
%spec.select.i344 = tail call i64 @llvm.smax.i64(i64 %add148, i64 0)
%sub1.i345 = tail call i64 @llvm.smin.i64(i64 %add148, i64 0)
%sub146 = add i64 %add145, %ki60.3377
%spec.select28.i346 = add nsw i64 %sub146, %sub1.i345
%cmp2.not.i347 = icmp slt i64 %spec.select28.i346, %0
%sub6.i349 = sub i64 %spec.select28.i346, %sub
%add8.i350 = select i1 %cmp2.not.i347, i64 0, i64 %sub6.i349
%j.addr.1.i351 = add nsw i64 %add8.i350, %spec.select.i344
%i.addr.1.i352 = select i1 %cmp2.not.i347, i64 %spec.select28.i346, i64 %sub
%cmp10.i353 = icmp sgt i64 %i.addr.1.i352, -1
%cmp11.not.i354 = icmp slt i64 %j.addr.1.i351, %1
%or.cond.i355 = select i1 %cmp10.i353, i1 %cmp11.not.i354, i1 false
br i1 %or.cond.i355, label %if.end13.i357, label %fq.exit359
if.end13.i357: ; preds = %fq.exit343
%arrayidx15.i358 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.addr.1.i352, i64 %j.addr.1.i351, i64 %ki60.3377
%44 = load i64, ptr %arrayidx15.i358, align 8, !tbaa !8
br label %fq.exit359
fq.exit359: ; preds = %fq.exit343, %if.end13.i357
%retval.0.i356 = phi i64 [ %44, %if.end13.i357 ], [ 0, %fq.exit343 ]
%sub150 = sub i64 %add144, %retval.0.i356
%inc152 = add nuw nsw i64 %ki60.3377, 1
%cmp138.not.not = icmp ult i64 %ki60.3377, %add136
br i1 %cmp138.not.not, label %for.body140, label %for.end153, !llvm.loop !24
for.end153: ; preds = %fq.exit359, %for.end131
%r.3.lcssa = phi i64 [ %r.2.lcssa, %for.end131 ], [ %sub150, %fq.exit359 ]
%sub154 = sub i64 %r.3.lcssa, %ra.1.3.lcssa
ret i64 %sub154
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ok(i64 noundef %x1, i64 noundef %y1, i64 noundef %x2, i64 noundef %y2, i64 noundef %x3, i64 noundef %y3) local_unnamed_addr #0 {
entry:
%sub.i = sub nsw i64 %x1, %x2
%retval.0.i = tail call i64 @llvm.abs.i64(i64 %sub.i, i1 true)
%sub.i18 = sub nsw i64 %y1, %y2
%retval.0.i19 = tail call i64 @llvm.abs.i64(i64 %sub.i18, i1 true)
%add = add nuw nsw i64 %retval.0.i19, %retval.0.i
%sub.i20 = sub nsw i64 %x2, %x3
%retval.0.i21 = tail call i64 @llvm.abs.i64(i64 %sub.i20, i1 true)
%sub.i22 = sub nsw i64 %y2, %y3
%retval.0.i23 = tail call i64 @llvm.abs.i64(i64 %sub.i22, i1 true)
%add4 = add nuw nsw i64 %retval.0.i23, %retval.0.i21
%sub.i24 = sub nsw i64 %x3, %x1
%retval.0.i25 = tail call i64 @llvm.abs.i64(i64 %sub.i24, i1 true)
%sub.i26 = sub nsw i64 %y3, %y1
%retval.0.i27 = tail call i64 @llvm.abs.i64(i64 %sub.i26, i1 true)
%cmp = icmp eq i64 %add, %add4
%add7 = add nuw nsw i64 %retval.0.i27, %retval.0.i25
%cmp8 = icmp eq i64 %add4, %add7
%or.cond = select i1 %cmp, i1 %cmp8, i1 false
%retval.0 = zext i1 %or.cond to i64
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #9 {
entry:
%0 = load i64, ptr @h, align 8, !tbaa !8
%cmp.not190 = icmp eq i64 %0, 0
br i1 %cmp.not190, label %for.end106, label %for.cond1.preheader.lr.ph.split.us
for.cond1.preheader.lr.ph.split.us: ; preds = %entry
%1 = load i64, ptr @w, align 8
%cmp5179.not = icmp eq i64 %1, 0
br i1 %cmp5179.not, label %for.end106, label %for.cond1.preheader.us.us.preheader
for.cond1.preheader.us.us.preheader: ; preds = %for.cond1.preheader.lr.ph.split.us
%xtraiter = and i64 %1, 1
%2 = icmp eq i64 %1, 1
%unroll_iter = and i64 %1, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond1.preheader.us.us
for.cond1.preheader.us.us: ; preds = %for.cond1.preheader.us.us.preheader, %for.cond1.for.inc82_crit_edge.split.us.us.us
%ki.0191.us.us = phi i64 [ %inc83.us.us, %for.cond1.for.inc82_crit_edge.split.us.us.us ], [ 1, %for.cond1.preheader.us.us.preheader ]
br label %for.cond4.preheader.us.us.us
for.cond4.preheader.us.us.us: ; preds = %for.cond4.for.inc79_crit_edge.us.us.us, %for.cond1.preheader.us.us
%i.0182.us.us.us = phi i64 [ 0, %for.cond1.preheader.us.us ], [ %inc80.us.us.us, %for.cond4.for.inc79_crit_edge.us.us.us ]
%cmp7.us.us.us = icmp ult i64 %i.0182.us.us.us, %ki.0191.us.us
%sub18.us.us.us = add nsw i64 %i.0182.us.us.us, -1
%sub30.us.us.us = sub nsw i64 %i.0182.us.us.us, %ki.0191.us.us
br i1 %cmp7.us.us.us, label %for.body6.us.us.us.us.preheader, label %for.body6.us184.us.us
for.body6.us.us.us.us.preheader: ; preds = %for.cond4.preheader.us.us.us
br i1 %2, label %for.cond4.for.inc79_crit_edge.us.us.us.loopexit.unr-lcssa, label %for.body6.us.us.us.us
for.body6.us184.us.us: ; preds = %for.cond4.preheader.us.us.us, %for.inc.us.us.us
%j.0180.us185.us.us = phi i64 [ %inc78.us186.us.us.pre-phi, %for.inc.us.us.us ], [ 0, %for.cond4.preheader.us.us.us ]
%sub.us.us.us = sub nsw i64 %j.0180.us185.us.us, %ki.0191.us.us
%cmp13.us.us.us = icmp slt i64 %sub.us.us.us, 0
br i1 %cmp13.us.us.us, label %if.then14.us.us.us, label %if.else.us.us.us
if.else.us.us.us: ; preds = %for.body6.us184.us.us
%sub20.us.us.us = add nsw i64 %j.0180.us185.us.us, -1
%arrayidx22.us.us.us = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %sub18.us.us.us, i64 %sub20.us.us.us, i64 %ki.0191.us.us
%3 = load i64, ptr %arrayidx22.us.us.us, align 8, !tbaa !8
%arrayidx25.us.us.us = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us185.us.us, i64 %ki.0191.us.us
store i64 %3, ptr %arrayidx25.us.us.us, align 8, !tbaa !8
%arrayidx27.us.us.us = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us185.us.us
%4 = load i8, ptr %arrayidx27.us.us.us, align 1, !tbaa !12
%cmp28.us.us.us = icmp eq i8 %4, 35
br i1 %cmp28.us.us.us, label %land.lhs.true.us.us.us, label %if.end42.us.us.us
land.lhs.true.us.us.us: ; preds = %if.else.us.us.us
%arrayidx33.us.us.us = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %sub30.us.us.us, i64 %sub.us.us.us
%5 = load i8, ptr %arrayidx33.us.us.us, align 1, !tbaa !12
%cmp35.us.us.us = icmp eq i8 %5, 35
br i1 %cmp35.us.us.us, label %if.then37.us.us.us, label %if.end42.us.us.us
if.then37.us.us.us: ; preds = %land.lhs.true.us.us.us
%inc.us.us.us = add i64 %3, 1
store i64 %inc.us.us.us, ptr %arrayidx25.us.us.us, align 8, !tbaa !8
br label %if.end42.us.us.us
if.then14.us.us.us: ; preds = %for.body6.us184.us.us
%arrayidx17.us.us.us = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us185.us.us, i64 %ki.0191.us.us
store i64 0, ptr %arrayidx17.us.us.us, align 8, !tbaa !8
br label %if.end42.us.us.us
if.end42.us.us.us: ; preds = %if.then14.us.us.us, %if.then37.us.us.us, %land.lhs.true.us.us.us, %if.else.us.us.us
%add.us.us.us = add nuw nsw i64 %j.0180.us185.us.us, %ki.0191.us.us
%cmp43.not.us.us.us = icmp slt i64 %add.us.us.us, %1
br i1 %cmp43.not.us.us.us, label %if.else49.us.us.us, label %if.then45.us.us.us
if.then45.us.us.us: ; preds = %if.end42.us.us.us
%arrayidx48.us.us.us = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us185.us.us, i64 %ki.0191.us.us
store i64 0, ptr %arrayidx48.us.us.us, align 8, !tbaa !8
%.pre = add nuw nsw i64 %j.0180.us185.us.us, 1
br label %for.inc.us.us.us
if.else49.us.us.us: ; preds = %if.end42.us.us.us
%add52.us.us.us = add nuw nsw i64 %j.0180.us185.us.us, 1
%arrayidx54.us.us.us = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %sub18.us.us.us, i64 %add52.us.us.us, i64 %ki.0191.us.us
%6 = load i64, ptr %arrayidx54.us.us.us, align 8, !tbaa !8
%arrayidx57.us.us.us = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us185.us.us, i64 %ki.0191.us.us
store i64 %6, ptr %arrayidx57.us.us.us, align 8, !tbaa !8
%arrayidx59.us.us.us = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us185.us.us
%7 = load i8, ptr %arrayidx59.us.us.us, align 1, !tbaa !12
%cmp61.us.us.us = icmp eq i8 %7, 35
br i1 %cmp61.us.us.us, label %land.lhs.true63.us.us.us, label %for.inc.us.us.us
land.lhs.true63.us.us.us: ; preds = %if.else49.us.us.us
%arrayidx67.us.us.us = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %sub30.us.us.us, i64 %add.us.us.us
%8 = load i8, ptr %arrayidx67.us.us.us, align 1, !tbaa !12
%cmp69.us.us.us = icmp eq i8 %8, 35
br i1 %cmp69.us.us.us, label %if.then71.us.us.us, label %for.inc.us.us.us
if.then71.us.us.us: ; preds = %land.lhs.true63.us.us.us
%inc75.us.us.us = add i64 %6, 1
store i64 %inc75.us.us.us, ptr %arrayidx57.us.us.us, align 8, !tbaa !8
br label %for.inc.us.us.us
for.inc.us.us.us: ; preds = %if.then71.us.us.us, %land.lhs.true63.us.us.us, %if.else49.us.us.us, %if.then45.us.us.us
%inc78.us186.us.us.pre-phi = phi i64 [ %add52.us.us.us, %if.then71.us.us.us ], [ %add52.us.us.us, %land.lhs.true63.us.us.us ], [ %add52.us.us.us, %if.else49.us.us.us ], [ %.pre, %if.then45.us.us.us ]
%exitcond.not = icmp eq i64 %inc78.us186.us.us.pre-phi, %1
br i1 %exitcond.not, label %for.cond4.for.inc79_crit_edge.us.us.us, label %for.body6.us184.us.us, !llvm.loop !25
for.cond4.for.inc79_crit_edge.us.us.us.loopexit.unr-lcssa: ; preds = %for.body6.us.us.us.us, %for.body6.us.us.us.us.preheader
%j.0180.us.us.us.us.unr = phi i64 [ 0, %for.body6.us.us.us.us.preheader ], [ %inc78.us.us.us.us.1, %for.body6.us.us.us.us ]
br i1 %lcmp.mod.not, label %for.cond4.for.inc79_crit_edge.us.us.us, label %for.body6.us.us.us.us.epil
for.body6.us.us.us.us.epil: ; preds = %for.cond4.for.inc79_crit_edge.us.us.us.loopexit.unr-lcssa
%arrayidx9.us.us.us.us.epil = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us.us.us.us.unr, i64 %ki.0191.us.us
store i64 0, ptr %arrayidx9.us.us.us.us.epil, align 8, !tbaa !8
%arrayidx12.us.us.us.us.epil = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us.us.us.us.unr, i64 %ki.0191.us.us
store i64 0, ptr %arrayidx12.us.us.us.us.epil, align 8, !tbaa !8
br label %for.cond4.for.inc79_crit_edge.us.us.us
for.cond4.for.inc79_crit_edge.us.us.us: ; preds = %for.inc.us.us.us, %for.body6.us.us.us.us.epil, %for.cond4.for.inc79_crit_edge.us.us.us.loopexit.unr-lcssa
%inc80.us.us.us = add nuw nsw i64 %i.0182.us.us.us, 1
%exitcond214.not = icmp eq i64 %inc80.us.us.us, %0
br i1 %exitcond214.not, label %for.cond1.for.inc82_crit_edge.split.us.us.us, label %for.cond4.preheader.us.us.us, !llvm.loop !26
for.body6.us.us.us.us: ; preds = %for.body6.us.us.us.us.preheader, %for.body6.us.us.us.us
%j.0180.us.us.us.us = phi i64 [ %inc78.us.us.us.us.1, %for.body6.us.us.us.us ], [ 0, %for.body6.us.us.us.us.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body6.us.us.us.us ], [ 0, %for.body6.us.us.us.us.preheader ]
%arrayidx9.us.us.us.us = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us.us.us.us, i64 %ki.0191.us.us
store i64 0, ptr %arrayidx9.us.us.us.us, align 8, !tbaa !8
%arrayidx12.us.us.us.us = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.0182.us.us.us, i64 %j.0180.us.us.us.us, i64 %ki.0191.us.us
store i64 0, ptr %arrayidx12.us.us.us.us, align 8, !tbaa !8
%inc78.us.us.us.us = or i64 %j.0180.us.us.us.us, 1
%arrayidx9.us.us.us.us.1 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dp, i64 0, i64 %i.0182.us.us.us, i64 %inc78.us.us.us.us, i64 %ki.0191.us.us
store i64 0, ptr %arrayidx9.us.us.us.us.1, align 8, !tbaa !8
%arrayidx12.us.us.us.us.1 = getelementptr inbounds [305 x [305 x [602 x i64]]], ptr @dq, i64 0, i64 %i.0182.us.us.us, i64 %inc78.us.us.us.us, i64 %ki.0191.us.us
store i64 0, ptr %arrayidx12.us.us.us.us.1, align 8, !tbaa !8
%inc78.us.us.us.us.1 = add nuw nsw i64 %j.0180.us.us.us.us, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond4.for.inc79_crit_edge.us.us.us.loopexit.unr-lcssa, label %for.body6.us.us.us.us, !llvm.loop !25
for.cond1.for.inc82_crit_edge.split.us.us.us: ; preds = %for.cond4.for.inc79_crit_edge.us.us.us
%inc83.us.us = add nuw i64 %ki.0191.us.us, 1
%exitcond215.not = icmp eq i64 %ki.0191.us.us, %0
br i1 %exitcond215.not, label %for.cond85.preheader, label %for.cond1.preheader.us.us, !llvm.loop !27
for.cond85.preheader: ; preds = %for.cond1.for.inc82_crit_edge.split.us.us.us
br i1 %cmp.not190, label %for.end106, label %for.cond89.preheader.lr.ph
for.cond89.preheader.lr.ph: ; preds = %for.cond85.preheader
%.pr = load i64, ptr @w, align 8, !tbaa !8
%cmp90200.not = icmp eq i64 %.pr, 0
br i1 %cmp90200.not, label %for.end106, label %for.cond89.preheader.us
for.cond89.preheader.us: ; preds = %for.cond89.preheader.lr.ph, %for.cond89.for.inc104_crit_edge.us
%i.1206.us = phi i64 [ %inc105.us, %for.cond89.for.inc104_crit_edge.us ], [ 0, %for.cond89.preheader.lr.ph ]
%result.0205.us = phi i64 [ %result.2.us, %for.cond89.for.inc104_crit_edge.us ], [ 0, %for.cond89.preheader.lr.ph ]
br label %for.body92.us
for.body92.us: ; preds = %for.cond89.preheader.us, %for.inc101.us
%j.1202.us = phi i64 [ 0, %for.cond89.preheader.us ], [ %inc102.us, %for.inc101.us ]
%result.1201.us = phi i64 [ %result.0205.us, %for.cond89.preheader.us ], [ %result.2.us, %for.inc101.us ]
%arrayidx94.us = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %i.1206.us, i64 %j.1202.us
%9 = load i8, ptr %arrayidx94.us, align 1, !tbaa !12
%cmp96.us = icmp eq i8 %9, 35
br i1 %cmp96.us, label %if.then98.us, label %for.inc101.us
if.then98.us: ; preds = %for.body92.us
%call.us = tail call i64 @f(i64 noundef %i.1206.us, i64 noundef %j.1202.us)
%add99.us = add i64 %call.us, %result.1201.us
br label %for.inc101.us
for.inc101.us: ; preds = %if.then98.us, %for.body92.us
%result.2.us = phi i64 [ %add99.us, %if.then98.us ], [ %result.1201.us, %for.body92.us ]
%inc102.us = add nuw i64 %j.1202.us, 1
%exitcond216.not = icmp eq i64 %inc102.us, %.pr
br i1 %exitcond216.not, label %for.cond89.for.inc104_crit_edge.us, label %for.body92.us, !llvm.loop !28
for.cond89.for.inc104_crit_edge.us: ; preds = %for.inc101.us
%inc105.us = add nuw i64 %i.1206.us, 1
%exitcond217.not = icmp eq i64 %inc105.us, %0
br i1 %exitcond217.not, label %for.end106, label %for.cond89.preheader.us, !llvm.loop !29
for.end106: ; preds = %for.cond89.for.inc104_crit_edge.us, %for.cond1.preheader.lr.ph.split.us, %entry, %for.cond89.preheader.lr.ph, %for.cond85.preheader
%result.0.lcssa = phi i64 [ 0, %for.cond85.preheader ], [ 0, %for.cond89.preheader.lr.ph ], [ 0, %entry ], [ 0, %for.cond1.preheader.lr.ph.split.us ], [ %result.2.us, %for.cond89.for.inc104_crit_edge.us ]
%call107 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %result.0.lcssa)
ret i64 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #9 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @h, ptr noundef nonnull @w)
%0 = load i64, ptr @h, align 8, !tbaa !8
%cmp6.not = icmp eq i64 %0, 0
br i1 %cmp6.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %indvars.iv
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%1 = load i64, ptr @h, align 8, !tbaa !8
%cmp = icmp ugt i64 %1, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !30
for.end: ; preds = %for.body, %entry
%call3 = tail call i64 @solve()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { mustprogress nofree 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 #8 = { nofree nosync nounwind 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 #9 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8}
!18 = !{i64 0, i64 8, !8}
!19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8}
!20 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !6}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}
!25 = distinct !{!25, !6}
!26 = distinct !{!26, !6}
!27 = distinct !{!27, !6}
!28 = distinct !{!28, !6}
!29 = distinct !{!29, !6}
!30 = distinct !{!30, !6}
|
#include <stdio.h>
int main()
{
long inputN;
int inputK, printOutput = 0;
scanf("%ld %d", &inputN, &inputK);
while(1)
{
inputN /= inputK;
printOutput += 1;
if(inputN == 0)
{
break;
}
}
printf("%d\n", printOutput);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193013/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193013/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld %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:
%inputN = alloca i64, align 8
%inputK = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %inputN) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %inputK) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %inputN, ptr noundef nonnull %inputK)
%0 = load i32, ptr %inputK, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%inputN.promoted = load i64, ptr %inputN, align 8, !tbaa !9
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%div4 = phi i64 [ %inputN.promoted, %entry ], [ %div, %while.cond ]
%printOutput.0 = phi i32 [ 0, %entry ], [ %add, %while.cond ]
%div = sdiv i64 %div4, %conv
%add = add nuw nsw i32 %printOutput.0, 1
%cmp = icmp eq i64 %div, 0
br i1 %cmp, label %while.end, label %while.cond
while.end: ; preds = %while.cond
store i64 0, ptr %inputN, align 8, !tbaa !9
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %inputK) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %inputN) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
|
/* ex3_3: Digits
Jun_JPN */
#include <stdio.h>
int main(void){
int num_10, num_k;
int digit = 1; // 10進数num_10が「num_k進数」で何桁かを数える変数
scanf("%d %d", &num_10, &num_k);
// 「num_k^{N} <= num_10 < num_k^{N+1}」を満たすNをwhile文で求める
int i = 1;
while (!(i <= num_10 && num_10 < i*num_k)){
i = i*num_k;
digit ++;
}
printf("%d\n", digit);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193057/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193057/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%num_10 = alloca i32, align 4
%num_k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num_10) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num_k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num_10, ptr noundef nonnull %num_k)
%0 = load i32, ptr %num_10, align 4, !tbaa !5
%1 = load i32, ptr %num_k, align 4
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%digit.0 = phi i32 [ 1, %entry ], [ %inc, %while.cond ]
%i.0 = phi i32 [ 1, %entry ], [ %mul, %while.cond ]
%cmp.not = icmp sle i32 %i.0, %0
%mul = mul nsw i32 %1, %i.0
%cmp1 = icmp slt i32 %0, %mul
%2 = select i1 %cmp.not, i1 %cmp1, i1 false
%inc = add nuw nsw i32 %digit.0, 1
br i1 %2, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %digit.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num_k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num_10) #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"}
|
/* ex3_2
moka223711 */
#include <stdio.h>
int main(void){
int N, K, i = 1;
scanf("%d %d", &N, &K);
// NがK^i以上のとき、K進法はi桁で表せる
// NをKで割り続けて何回割れるかをiでカウントする
while(N >= K){
N /= K;
i++;
}
printf("%d", i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193107/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193107/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #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 %K, align 4, !tbaa !5
%N.promoted = load i32, ptr %N, align 4, !tbaa !5
%cmp.not5 = icmp slt i32 %N.promoted, %0
br i1 %cmp.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%i.07 = phi i32 [ %inc, %while.body ], [ 1, %entry ]
%div46 = phi i32 [ %div, %while.body ], [ %N.promoted, %entry ]
%div = sdiv i32 %div46, %0
%inc = add nuw nsw i32 %i.07, 1
%cmp.not = icmp slt i32 %div, %0
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %div, ptr %N, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%i.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.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"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
long long disum(long long x,long long a){
long long sum=0;
while(x>0){
sum++;
x/=a;
}
return sum;
}
int main(){
long long n,k;
scanf("%lld %lld",&n,&k);
printf("%lld",disum(n,k));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193158/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193158/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @disum(i64 noundef %x, i64 noundef %a) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i64 %x, 0
br i1 %cmp3, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%sum.05 = phi i64 [ %inc, %while.body ], [ 0, %entry ]
%x.addr.04 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%inc = add nuw nsw i64 %sum.05, 1
%div = sdiv i64 %x.addr.04, %a
%cmp = icmp sgt i64 %div, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %inc, %while.body ]
ret i64 %sum.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i64, ptr %n, align 8, !tbaa !7
%1 = load i64, ptr %k, align 8, !tbaa !7
%cmp3.i = icmp sgt i64 %0, 0
br i1 %cmp3.i, label %while.body.i, label %disum.exit
while.body.i: ; preds = %entry, %while.body.i
%sum.05.i = phi i64 [ %inc.i, %while.body.i ], [ 0, %entry ]
%x.addr.04.i = phi i64 [ %div.i, %while.body.i ], [ %0, %entry ]
%inc.i = add nuw nsw i64 %sum.05.i, 1
%div.i = sdiv i64 %x.addr.04.i, %1
%cmp.i = icmp sgt i64 %div.i, 0
br i1 %cmp.i, label %while.body.i, label %disum.exit, !llvm.loop !5
disum.exit: ; preds = %while.body.i, %entry
%sum.0.lcssa.i = phi i64 [ 0, %entry ], [ %inc.i, %while.body.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
long long n,k,cnt=0;
scanf("%lld%lld",&n,&k);
while(n>0){
n/=k;
cnt++;
}
printf("%lld",cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193200/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193200/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%.pr = load i64, ptr %n, align 8, !tbaa !5
%cmp3 = icmp sgt i64 %.pr, 0
br i1 %cmp3, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%0 = load i64, ptr %k, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%cnt.04 = phi i64 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%1 = phi i64 [ %.pr, %while.body.lr.ph ], [ %div, %while.body ]
%div = sdiv i64 %1, %0
%inc = add nuw nsw i64 %cnt.04, 1
%cmp = icmp sgt i64 %div, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i64 %div, ptr %n, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%cnt.0.lcssa = phi i64 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #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"}
|
#include <stdio.h>
#include <math.h>
int main()
{
long long num; int base, digit;
scanf("%lld %d", &num, &base);
digit=1+floor(log(num)/log(base));
printf("%d", digit);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193244/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193244/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%lld %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:
%num = alloca i64, align 8
%base = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %num) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %base) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %base)
%0 = load i64, ptr %num, align 8, !tbaa !5
%conv = sitofp i64 %0 to double
%call1 = call double @log(double noundef %conv) #5
%1 = load i32, ptr %base, align 4, !tbaa !9
%conv2 = sitofp i32 %1 to double
%call3 = call double @log(double noundef %conv2) #5
%div = fdiv double %call1, %call3
%2 = call double @llvm.floor.f64(double %div)
%add = fadd double %2, 1.000000e+00
%conv4 = fptosi double %add to i32
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %base) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include<stdio.h>
int main()
{
int N, K, num=1, i;
scanf("%d %d", &N, &K);
for ( i = 0; num<=N; i++)
{
num = num * K;
}
printf("%d", i);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193288/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193288/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #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
%cmp.not4 = icmp slt i32 %0, 1
br i1 %cmp.not4, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %K, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%i.06 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%num.05 = phi i32 [ 1, %for.body.lr.ph ], [ %mul, %for.body ]
%mul = mul nsw i32 %1, %num.05
%inc = add nuw nsw i32 %i.06, 1
%cmp.not = icmp sgt i32 %mul, %0
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %for.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.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"}
|
#include <stdio.h>
int main(void)
{
int n,k;
int c = 0;
scanf("%d %d",&n,&k);
while (n >= 1){
n = n/k;
c++;
}
printf("%d",c);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193330/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193330/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %.pr, 0
br i1 %cmp3, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%0 = load i32, ptr %k, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%c.04 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%1 = phi i32 [ %.pr, %while.body.lr.ph ], [ %div, %while.body ]
%div = sdiv i32 %1, %0
%inc = add nuw nsw i32 %c.04, 1
%cmp = icmp sgt i32 %div, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %div, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%c.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
int n,k;
int i;
scanf("%d %d",&n,&k);
for(i=0;n!=0;i++){
n=n/k;
}
printf("%d",i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193374/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193374/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp.not3 = icmp eq i32 %.pr, 0
br i1 %cmp.not3, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%0 = load i32, ptr %k, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%i.04 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%1 = phi i32 [ %.pr, %for.body.lr.ph ], [ %div, %for.body ]
%div = sdiv i32 %1, %0
%inc = add nuw nsw i32 %i.04, 1
%cmp.not = icmp eq i32 %div, 0
br i1 %cmp.not, label %for.cond.for.end_crit_edge, label %for.body, !llvm.loop !9
for.cond.for.end_crit_edge: ; preds = %for.body
store i32 0, ptr %n, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %entry
%i.0.lcssa = phi i32 [ %inc, %for.cond.for.end_crit_edge ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.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"}
|
#include<stdio.h>
int main(){
int N, K;
int count = 0;
scanf("%d %d", &N, &K); //NをK進数で表す
while(N > 0){
N = N/K;
count++;
}
printf("%d\n", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193417/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193417/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #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)
%.pr = load i32, ptr %N, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %.pr, 0
br i1 %cmp3, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%0 = load i32, ptr %K, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%count.04 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%1 = phi i32 [ %.pr, %while.body.lr.ph ], [ %div, %while.body ]
%div = sdiv i32 %1, %0
%inc = add nuw nsw i32 %count.04, 1
%cmp = icmp sgt i32 %div, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %div, ptr %N, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%count.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n, k, digits = 1;
scanf("%d %d", &n, &k);
while (n /= k)
digits++;
printf("%d", digits);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193460/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193460/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 %k, align 4, !tbaa !5
%n.promoted = load i32, ptr %n, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%div3 = phi i32 [ %n.promoted, %entry ], [ %div, %while.cond ]
%digits.0 = phi i32 [ 1, %entry ], [ %inc, %while.cond ]
%div = sdiv i32 %div3, %0
%tobool.not = icmp eq i32 %div, 0
%inc = add nuw nsw i32 %digits.0, 1
br i1 %tobool.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
store i32 0, ptr %n, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %digits.0)
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"}
|
#include<stdio.h>
int main(void){
int h,a,c=0;
scanf("%d %d",&h,&a);
for(int i=0;h>0;i++){
h-=a;
c++;
}
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193510/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193510/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a)
%.pr = load i32, ptr %h, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %.pr, 0
br i1 %cmp4, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%0 = load i32, ptr %a, align 4, !tbaa !5
br label %for.body
for.cond.for.cond.cleanup_crit_edge: ; preds = %for.body
store i32 %sub, ptr %h, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.for.cond.cleanup_crit_edge, %entry
%c.0.lcssa = phi i32 [ %inc, %for.cond.for.cond.cleanup_crit_edge ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
for.body: ; preds = %for.body.lr.ph, %for.body
%c.05 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%1 = phi i32 [ %.pr, %for.body.lr.ph ], [ %sub, %for.body ]
%sub = sub nsw i32 %1, %0
%inc = add nuw nsw i32 %c.05, 1
%cmp = icmp sgt i32 %sub, 0
br i1 %cmp, label %for.body, label %for.cond.for.cond.cleanup_crit_edge, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int h,a;
scanf("%d %d",&h,&a);
if(h%a==0) printf("%d\n",h/a);
else printf("%d\n",h/a+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193561/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193561/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %0, %1
%add = zext i1 %cmp to i32
%add.sink = add nsw i32 %div, %add
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 int a,b;
scanf("%ld %ld",&a,&b);
if(a%b==0) printf("%ld",a/b);
else printf("%ld",a/b+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193604/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193604/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%rem = srem i64 %0, %1
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %0, %1
%add = zext i1 %cmp to i64
%add.sink = add nsw i64 %div, %add
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int h, a;
scanf("%d%d", &h, &a);
printf("%d\n", (h+a-1)/a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193648/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193648/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%h = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%add = add i32 %0, -1
%sub = add i32 %add, %1
%div = sdiv i32 %sub, %1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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,H,f;
scanf("%d %d",&H,&A);
f=H;
for(int i=0;i<H;i++){
f=f-A;
if(f<=0){
printf("%d\n",i+1);
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193691/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193691/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%H = 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 %H) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %A)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, 0
br i1 %cmp10, label %for.body.lr.ph, label %cleanup
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %A, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%i.012 = phi i32 [ 0, %for.body.lr.ph ], [ %add, %for.inc ]
%f.011 = phi i32 [ %0, %for.body.lr.ph ], [ %sub, %for.inc ]
%sub = sub nsw i32 %f.011, %1
%cmp1 = icmp slt i32 %sub, 1
%add = add nuw nsw i32 %i.012, 1
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
br label %cleanup
for.inc: ; preds = %for.body
%exitcond.not = icmp eq i32 %add, %0
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9
cleanup: ; preds = %for.inc, %entry, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int h,a,i=0;
scanf("%d%d",&h,&a);
while(h>0)
{ h=h-a;
i++;
}
if(h<0)printf("%d",i);
else printf("%d",i);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193741/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193741/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%h = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a)
%.pr = load i32, ptr %h, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %.pr, 0
br i1 %cmp6, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%0 = load i32, ptr %a, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%i.07 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%1 = phi i32 [ %.pr, %while.body.lr.ph ], [ %sub, %while.body ]
%sub = sub nsw i32 %1, %0
%inc = add nuw nsw i32 %i.07, 1
%cmp = icmp sgt i32 %sub, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %sub, ptr %h, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%i.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include<math.h>
int main()
{
int h,a,c=0;
scanf("%d %d",&h,&a);
while(h>0)
{
h=h-a;
c++;
}
printf("%d",c);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193785/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193785/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%h = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a)
%.pr = load i32, ptr %h, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %.pr, 0
br i1 %cmp3, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%0 = load i32, ptr %a, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%c.04 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%1 = phi i32 [ %.pr, %while.body.lr.ph ], [ %sub, %while.body ]
%sub = sub nsw i32 %1, %0
%inc = add nuw nsw i32 %c.04, 1
%cmp = icmp sgt i32 %sub, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %sub, ptr %h, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%c.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 HP,AT,n=0;
scanf("%d %d",&HP,&AT);
while(1){
if (HP <= 0) break;
HP = HP - AT;
n++;
}
printf("%d\n",n);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193835/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193835/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%HP = alloca i32, align 4
%AT = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %HP) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %AT) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %HP, ptr noundef nonnull %AT)
%.pr = load i32, ptr %HP, align 4, !tbaa !5
%cmp3 = icmp slt i32 %.pr, 1
br i1 %cmp3, label %while.end, label %if.end.lr.ph
if.end.lr.ph: ; preds = %entry
%0 = load i32, ptr %AT, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.end.lr.ph, %if.end
%n.04 = phi i32 [ 0, %if.end.lr.ph ], [ %inc, %if.end ]
%1 = phi i32 [ %.pr, %if.end.lr.ph ], [ %sub, %if.end ]
%sub = sub nsw i32 %1, %0
%inc = add nuw nsw i32 %n.04, 1
%cmp = icmp slt i32 %sub, 1
br i1 %cmp, label %while.cond.while.end_crit_edge, label %if.end
while.cond.while.end_crit_edge: ; preds = %if.end
store i32 %sub, ptr %HP, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%n.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call1 = 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 %AT) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %HP) #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){
char buf[100];
fgets(buf, sizeof(buf), stdin);
int n, m;
sscanf(buf, "%d %d", &n, &m);
printf("%d", (n + m - 1) / m);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193879/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193879/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [6 x i8] c"%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:
%buf = alloca [100 x i8], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %buf) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 100, ptr noundef %0)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) #3
%1 = load i32, ptr %n, align 4, !tbaa !9
%2 = load i32, ptr %m, align 4, !tbaa !9
%add = add i32 %1, -1
%sub = add i32 %add, %2
%div = sdiv i32 %sub, %2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %buf) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include <stdio.h>
int main(int argc, char const *argv[]) {
int h=0,x=0,ans=0,a=0;
scanf("%d %d",&h,&x);
ans=h/x;
if (h%x!=0) {
ans++;
}
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193929/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193929/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
store i32 0, ptr %h, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
store i32 0, ptr %x, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %x)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%cmp.not = icmp ne i32 %rem, 0
%inc = zext i1 %cmp.not to i32
%spec.select = add nsw i32 %div, %inc
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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, H, ATK;
scanf("%d%d", &H, &A);
if(H % A == 0){
ATK = H / A;
}
else
{
ATK = H / A + 1;
}
printf("%d", ATK);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193972/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193972/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%H = 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 %H) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %A)
%0 = load i32, ptr %H, align 4, !tbaa !5
%1 = load i32, ptr %A, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %0, %1
%add = zext i1 %cmp to i32
%ATK.0 = add nsw i32 %div, %add
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ATK.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
int main(){
int h,a;
int ans=0;
scanf("%d %d",&h,&a);
if(h%a==0)
ans=h/a;
else
ans=h/a+1;
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194014/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194014/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #6
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #6
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @pom(i64 noundef %a, i64 noundef %n, i32 noundef %m) local_unnamed_addr #3 {
entry:
%conv = sext i32 %m to i64
%tobool.not16 = icmp eq i64 %n, 0
br i1 %tobool.not16, label %for.end, label %for.body
for.body: ; preds = %entry, %cond.end
%mul4.pn = phi i64 [ %mul4, %cond.end ], [ %a, %entry ]
%x.018 = phi i64 [ %x.1, %cond.end ], [ 1, %entry ]
%n.addr.017 = phi i64 [ %div, %cond.end ], [ %n, %entry ]
%a.addr.019 = srem i64 %mul4.pn, %conv
%and = and i64 %n.addr.017, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %cond.end, label %cond.true
cond.true: ; preds = %for.body
%mul = mul nsw i64 %a.addr.019, %x.018
%rem3 = srem i64 %mul, %conv
br label %cond.end
cond.end: ; preds = %for.body, %cond.true
%x.1 = phi i64 [ %rem3, %cond.true ], [ %x.018, %for.body ]
%mul4 = mul nsw i64 %a.addr.019, %a.addr.019
%div = sdiv i64 %n.addr.017, 2
%n.addr.017.off = add i64 %n.addr.017, 1
%tobool.not = icmp ult i64 %n.addr.017.off, 3
br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %cond.end, %entry
%x.0.lcssa = phi i64 [ 1, %entry ], [ %x.1, %cond.end ]
ret i64 %x.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%h = alloca i32, align 4
%a = 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 %a) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a)
%0 = load i32, ptr %h, align 4, !tbaa !11
%1 = load i32, ptr %a, align 4, !tbaa !11
%rem = srem i32 %0, %1
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %0, %1
%add = zext i1 %cmp to i32
%ans.0 = add nsw i32 %div, %add
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
int main() {
int a, b, flag = 0;
scanf("%d %d", &a, &b);
flag = a / b;
if(a%b != 0)
flag++;
printf("%d\n", flag);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194058/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194058/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%cmp.not = icmp ne i32 %rem, 0
%inc = zext i1 %cmp.not to i32
%spec.select = add nsw i32 %div, %inc
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
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,K;
scanf("%d%d",&N,&K);
if((N-1)*(N-2)/2 < K){
printf("-1\n");
return 0;
}
int cnt = N-1 + (N-1)*(N-2)/2-K;
printf("%d\n",cnt);
for (int i = 1; i < N; i++) {
printf("%d %d\n",i,N);
}
cnt -= N-1;
int x = 1,y = 2;
for (int i = 0; i < cnt; i++) {
printf("%d %d\n",x,y);
y++;
if(y == N){
x++;
y = x+1;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194100/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194100/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%sub1 = add nsw i32 %0, -2
%mul = mul nsw i32 %sub, %sub1
%div = sdiv i32 %mul, 2
%1 = load i32, ptr %K, align 4, !tbaa !5
%cmp = icmp slt i32 %div, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
if.end: ; preds = %entry
%add = sub i32 %sub, %1
%sub8 = add i32 %add, %div
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub8)
%2 = load i32, ptr %N, align 4, !tbaa !5
%cmp1041 = icmp sgt i32 %2, 1
br i1 %cmp1041, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %if.end
%.lcssa = phi i32 [ %2, %if.end ], [ %4, %for.body ]
%sub12.neg = add i32 %sub8, 1
%sub13 = sub i32 %sub12.neg, %.lcssa
%cmp1643 = icmp sgt i32 %sub13, 0
br i1 %cmp1643, label %for.body18, label %cleanup
for.body: ; preds = %if.end, %for.body
%3 = phi i32 [ %4, %for.body ], [ %2, %if.end ]
%i.042 = phi i32 [ %inc, %for.body ], [ 1, %if.end ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %i.042, i32 noundef %3)
%inc = add nuw nsw i32 %i.042, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc, %4
br i1 %cmp10, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.body18: ; preds = %for.cond.cleanup, %for.body18
%i14.046 = phi i32 [ %inc27, %for.body18 ], [ 0, %for.cond.cleanup ]
%y.045 = phi i32 [ %y.1, %for.body18 ], [ 2, %for.cond.cleanup ]
%x.044 = phi i32 [ %x.1, %for.body18 ], [ 1, %for.cond.cleanup ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %x.044, i32 noundef %y.045)
%inc20 = add nsw i32 %y.045, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%cmp21 = icmp eq i32 %inc20, %5
%add24 = add nuw nsw i32 %x.044, 2
%inc23 = zext i1 %cmp21 to i32
%x.1 = add nuw nsw i32 %x.044, %inc23
%y.1 = select i1 %cmp21, i32 %add24, i32 %inc20
%inc27 = add nuw nsw i32 %i14.046, 1
%cmp16 = icmp slt i32 %inc27, %sub13
br i1 %cmp16, label %for.body18, label %cleanup, !llvm.loop !11
cleanup: ; preds = %for.body18, %for.cond.cleanup, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
int soma(int vetor[],int n, int index){
int s1=0,s2=0;
for(int j=0;j<=index;j++)s1+=vetor[j];
for(int w=index+1;w<n;w++)s2+=vetor[w];
return abs(s1-s2);
}
int main(void){
int n,menor,t;
scanf("%d", &n);
int arr[n];
for(int i=0;i<n;i++)scanf("%d",&arr[i]);
menor = soma(arr,n,0);
for(t=1;t<n;t++){
int comp;
comp = soma(arr,n,t);
if(comp<menor)menor=comp;
}
printf("%d\n", menor);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194151/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194151/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @soma(ptr nocapture noundef readonly %vetor, i32 noundef %n, i32 noundef %index) local_unnamed_addr #0 {
entry:
%cmp.not20 = icmp slt i32 %index, 0
%.pre = add i32 %index, 1
br i1 %cmp.not20, label %for.cond2.preheader, label %for.body.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %.pre to i64
%min.iters.check = icmp ult i32 %.pre, 8
br i1 %min.iters.check, label %for.body.preheader55, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index33 = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ]
%vec.phi34 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i32, ptr %vetor, i64 %index33
%wide.load = load <4 x i32>, ptr %0, align 4, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 4
%wide.load35 = load <4 x i32>, ptr %1, align 4, !tbaa !5
%2 = add <4 x i32> %wide.load, %vec.phi
%3 = add <4 x i32> %wide.load35, %vec.phi34
%index.next = add nuw i64 %index33, 8
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %3, %2
%5 = tail 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.cond2.preheader, label %for.body.preheader55
for.body.preheader55: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%s1.021.ph = phi i32 [ 0, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond2.preheader: ; preds = %for.body, %middle.block, %entry
%s1.0.lcssa = phi i32 [ 0, %entry ], [ %5, %middle.block ], [ %add, %for.body ]
%cmp324 = icmp slt i32 %.pre, %n
br i1 %cmp324, label %for.body5.preheader, label %for.cond.cleanup4
for.body5.preheader: ; preds = %for.cond2.preheader
%6 = sext i32 %.pre to i64
%7 = add i32 %n, -2
%8 = sub i32 %7, %index
%9 = zext i32 %8 to i64
%10 = add nuw nsw i64 %9, 1
%min.iters.check38 = icmp ult i32 %8, 7
br i1 %min.iters.check38, label %for.body5.preheader53, label %vector.ph39
vector.ph39: ; preds = %for.body5.preheader
%n.vec41 = and i64 %10, 8589934584
%ind.end = add nsw i64 %n.vec41, %6
%invariant.gep = getelementptr i32, ptr %vetor, i64 %6
br label %vector.body44
vector.body44: ; preds = %vector.body44, %vector.ph39
%index45 = phi i64 [ 0, %vector.ph39 ], [ %index.next50, %vector.body44 ]
%vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph39 ], [ %12, %vector.body44 ]
%vec.phi47 = phi <4 x i32> [ zeroinitializer, %vector.ph39 ], [ %13, %vector.body44 ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index45
%wide.load48 = load <4 x i32>, ptr %gep, align 4, !tbaa !5
%11 = getelementptr inbounds i32, ptr %gep, i64 4
%wide.load49 = load <4 x i32>, ptr %11, align 4, !tbaa !5
%12 = add <4 x i32> %wide.load48, %vec.phi46
%13 = add <4 x i32> %wide.load49, %vec.phi47
%index.next50 = add nuw i64 %index45, 8
%14 = icmp eq i64 %index.next50, %n.vec41
br i1 %14, label %middle.block36, label %vector.body44, !llvm.loop !13
middle.block36: ; preds = %vector.body44
%bin.rdx51 = add <4 x i32> %13, %12
%15 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx51)
%cmp.n43 = icmp eq i64 %10, %n.vec41
br i1 %cmp.n43, label %for.cond.cleanup4, label %for.body5.preheader53
for.body5.preheader53: ; preds = %for.body5.preheader, %middle.block36
%indvars.iv29.ph = phi i64 [ %6, %for.body5.preheader ], [ %ind.end, %middle.block36 ]
%s2.025.ph = phi i32 [ 0, %for.body5.preheader ], [ %15, %middle.block36 ]
br label %for.body5
for.body: ; preds = %for.body.preheader55, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader55 ]
%s1.021 = phi i32 [ %add, %for.body ], [ %s1.021.ph, %for.body.preheader55 ]
%arrayidx = getelementptr inbounds i32, ptr %vetor, i64 %indvars.iv
%16 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %16, %s1.021
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !14
for.cond.cleanup4: ; preds = %for.body5, %middle.block36, %for.cond2.preheader
%s2.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %15, %middle.block36 ], [ %add8, %for.body5 ]
%sub = sub nsw i32 %s1.0.lcssa, %s2.0.lcssa
%17 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true)
ret i32 %17
for.body5: ; preds = %for.body5.preheader53, %for.body5
%indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.body5 ], [ %indvars.iv29.ph, %for.body5.preheader53 ]
%s2.025 = phi i32 [ %add8, %for.body5 ], [ %s2.025.ph, %for.body5.preheader53 ]
%arrayidx7 = getelementptr inbounds i32, ptr %vetor, i64 %indvars.iv29
%18 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add8 = add nsw i32 %18, %s2.025
%indvars.iv.next30 = add nsw i64 %indvars.iv29, 1
%lftr.wideiv = trunc i64 %indvars.iv.next30 to i32
%exitcond32.not = icmp eq i32 %lftr.wideiv, %n
br i1 %exitcond32.not, label %for.cond.cleanup4, label %for.body5, !llvm.loop !15
}
; 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %3, 0
br i1 %cmp40, label %for.body, label %soma.exit.thread
for.body.i.preheader: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%cmp324.i = icmp sgt i32 %17, 1
br i1 %cmp324.i, label %for.body5.i.preheader, label %soma.exit.thread
for.body5.i.preheader: ; preds = %for.body.i.preheader
%zext = zext i32 %17 to i64
%4 = add nsw i64 %zext, -1
%min.iters.check = icmp ult i32 %17, 9
br i1 %min.iters.check, label %for.body5.i.preheader105, label %vector.ph
vector.ph: ; preds = %for.body5.i.preheader
%n.vec = and i64 %4, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi60 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%offset.idx = or i64 %index, 1
%5 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load61 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = add <4 x i32> %wide.load, %vec.phi
%8 = add <4 x i32> %wide.load61, %vec.phi60
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !16
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %8, %7
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %soma.exit, label %for.body5.i.preheader105
for.body5.i.preheader105: ; preds = %for.body5.i.preheader, %middle.block
%indvars.iv29.i.ph = phi i64 [ 1, %for.body5.i.preheader ], [ %ind.end, %middle.block ]
%s2.025.i.ph = phi i32 [ 0, %for.body5.i.preheader ], [ %10, %middle.block ]
br label %for.body5.i
for.body5.i: ; preds = %for.body5.i.preheader105, %for.body5.i
%indvars.iv29.i = phi i64 [ %indvars.iv.next30.i, %for.body5.i ], [ %indvars.iv29.i.ph, %for.body5.i.preheader105 ]
%s2.025.i = phi i32 [ %add8.i, %for.body5.i ], [ %s2.025.i.ph, %for.body5.i.preheader105 ]
%arrayidx7.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv29.i
%11 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5
%add8.i = add nsw i32 %11, %s2.025.i
%indvars.iv.next30.i = add nuw nsw i64 %indvars.iv29.i, 1
%12 = icmp eq i64 %indvars.iv.next30.i, %zext
br i1 %12, label %soma.exit, label %for.body5.i, !llvm.loop !17
soma.exit.thread: ; preds = %for.body.i.preheader, %entry
%.ph = phi i32 [ %.pre, %for.body.i.preheader ], [ undef, %entry ]
%13 = call i32 @llvm.abs.i32(i32 %.ph, i1 true)
br label %for.end10
soma.exit: ; preds = %for.body5.i, %middle.block
%add8.i.lcssa = phi i32 [ %10, %middle.block ], [ %add8.i, %for.body5.i ]
%sub.i = sub nsw i32 %.pre, %add8.i.lcssa
%14 = call i32 @llvm.abs.i32(i32 %sub.i, i1 true)
br i1 %cmp324.i, label %for.body5.preheader, label %for.end10
for.body5.preheader: ; preds = %soma.exit
%15 = zext i32 %17 to i64
%wide.trip.count = zext i32 %17 to i64
%16 = add i32 %17, -3
br label %for.body5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp = icmp slt i64 %indvars.iv.next, %18
br i1 %cmp, label %for.body, label %for.body.i.preheader, !llvm.loop !18
for.body5: ; preds = %for.body5.preheader, %soma.exit39
%indvar81 = phi i64 [ 0, %for.body5.preheader ], [ %indvar.next82, %soma.exit39 ]
%indvar = phi i32 [ 0, %for.body5.preheader ], [ %indvar.next, %soma.exit39 ]
%indvars.iv48 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next49, %soma.exit39 ]
%menor.044 = phi i32 [ %14, %for.body5.preheader ], [ %spec.select, %soma.exit39 ]
%19 = add i64 %indvar81, 2
%20 = sub i32 %16, %indvar
%21 = zext i32 %20 to i64
%22 = add nuw nsw i64 %21, 1
%indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
%min.iters.check85 = icmp ult i64 %19, 8
br i1 %min.iters.check85, label %for.body.i19.preheader, label %vector.ph86
vector.ph86: ; preds = %for.body5
%n.vec88 = and i64 %19, -8
br label %vector.body91
vector.body91: ; preds = %vector.body91, %vector.ph86
%index92 = phi i64 [ 0, %vector.ph86 ], [ %index.next97, %vector.body91 ]
%vec.phi93 = phi <4 x i32> [ zeroinitializer, %vector.ph86 ], [ %25, %vector.body91 ]
%vec.phi94 = phi <4 x i32> [ zeroinitializer, %vector.ph86 ], [ %26, %vector.body91 ]
%23 = getelementptr inbounds i32, ptr %vla, i64 %index92
%wide.load95 = load <4 x i32>, ptr %23, align 16, !tbaa !5
%24 = getelementptr inbounds i32, ptr %23, i64 4
%wide.load96 = load <4 x i32>, ptr %24, align 16, !tbaa !5
%25 = add <4 x i32> %wide.load95, %vec.phi93
%26 = add <4 x i32> %wide.load96, %vec.phi94
%index.next97 = add nuw i64 %index92, 8
%27 = icmp eq i64 %index.next97, %n.vec88
br i1 %27, label %middle.block83, label %vector.body91, !llvm.loop !19
middle.block83: ; preds = %vector.body91
%bin.rdx98 = add <4 x i32> %26, %25
%28 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx98)
%cmp.n90 = icmp eq i64 %19, %n.vec88
br i1 %cmp.n90, label %for.cond2.preheader.i26, label %for.body.i19.preheader
for.body.i19.preheader: ; preds = %for.body5, %middle.block83
%indvars.iv.i20.ph = phi i64 [ 0, %for.body5 ], [ %n.vec88, %middle.block83 ]
%s1.021.i21.ph = phi i32 [ 0, %for.body5 ], [ %28, %middle.block83 ]
br label %for.body.i19
for.cond2.preheader.i26: ; preds = %for.body.i19, %middle.block83
%add.i23.lcssa = phi i32 [ %28, %middle.block83 ], [ %add.i23, %for.body.i19 ]
%cmp324.i27 = icmp ult i64 %indvars.iv.next49, %15
br i1 %cmp324.i27, label %for.body5.i31.preheader, label %soma.exit39
for.body5.i31.preheader: ; preds = %for.cond2.preheader.i26
%min.iters.check64 = icmp ult i32 %20, 7
br i1 %min.iters.check64, label %for.body5.i31.preheader100, label %vector.ph65
vector.ph65: ; preds = %for.body5.i31.preheader
%n.vec67 = and i64 %22, 8589934584
%ind.end68 = add nuw i64 %indvars.iv.next49, %n.vec67
%29 = getelementptr i32, ptr %vla, i64 %indvars.iv.next49
br label %vector.body71
vector.body71: ; preds = %vector.body71, %vector.ph65
%index72 = phi i64 [ 0, %vector.ph65 ], [ %index.next78, %vector.body71 ]
%vec.phi73 = phi <4 x i32> [ zeroinitializer, %vector.ph65 ], [ %32, %vector.body71 ]
%vec.phi74 = phi <4 x i32> [ zeroinitializer, %vector.ph65 ], [ %33, %vector.body71 ]
%30 = getelementptr i32, ptr %29, i64 %index72
%wide.load76 = load <4 x i32>, ptr %30, align 4, !tbaa !5
%31 = getelementptr inbounds i32, ptr %30, i64 4
%wide.load77 = load <4 x i32>, ptr %31, align 4, !tbaa !5
%32 = add <4 x i32> %wide.load76, %vec.phi73
%33 = add <4 x i32> %wide.load77, %vec.phi74
%index.next78 = add nuw i64 %index72, 8
%34 = icmp eq i64 %index.next78, %n.vec67
br i1 %34, label %middle.block62, label %vector.body71, !llvm.loop !20
middle.block62: ; preds = %vector.body71
%bin.rdx79 = add <4 x i32> %33, %32
%35 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx79)
%cmp.n70 = icmp eq i64 %22, %n.vec67
br i1 %cmp.n70, label %soma.exit39, label %for.body5.i31.preheader100
for.body5.i31.preheader100: ; preds = %for.body5.i31.preheader, %middle.block62
%indvars.iv29.i32.ph = phi i64 [ %indvars.iv.next49, %for.body5.i31.preheader ], [ %ind.end68, %middle.block62 ]
%s2.025.i33.ph = phi i32 [ 0, %for.body5.i31.preheader ], [ %35, %middle.block62 ]
br label %for.body5.i31
for.body.i19: ; preds = %for.body.i19.preheader, %for.body.i19
%indvars.iv.i20 = phi i64 [ %indvars.iv.next.i24, %for.body.i19 ], [ %indvars.iv.i20.ph, %for.body.i19.preheader ]
%s1.021.i21 = phi i32 [ %add.i23, %for.body.i19 ], [ %s1.021.i21.ph, %for.body.i19.preheader ]
%arrayidx.i22 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i20
%36 = load i32, ptr %arrayidx.i22, align 4, !tbaa !5
%add.i23 = add nsw i32 %36, %s1.021.i21
%indvars.iv.next.i24 = add nuw nsw i64 %indvars.iv.i20, 1
%exitcond.not.i25 = icmp eq i64 %indvars.iv.i20, %indvars.iv48
br i1 %exitcond.not.i25, label %for.cond2.preheader.i26, label %for.body.i19, !llvm.loop !21
for.body5.i31: ; preds = %for.body5.i31.preheader100, %for.body5.i31
%indvars.iv29.i32 = phi i64 [ %indvars.iv.next30.i36, %for.body5.i31 ], [ %indvars.iv29.i32.ph, %for.body5.i31.preheader100 ]
%s2.025.i33 = phi i32 [ %add8.i35, %for.body5.i31 ], [ %s2.025.i33.ph, %for.body5.i31.preheader100 ]
%arrayidx7.i34 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv29.i32
%37 = load i32, ptr %arrayidx7.i34, align 4, !tbaa !5
%add8.i35 = add nsw i32 %37, %s2.025.i33
%indvars.iv.next30.i36 = add nuw nsw i64 %indvars.iv29.i32, 1
%lftr.wideiv = trunc i64 %indvars.iv.next30.i36 to i32
%exitcond = icmp eq i32 %17, %lftr.wideiv
br i1 %exitcond, label %soma.exit39, label %for.body5.i31, !llvm.loop !22
soma.exit39: ; preds = %for.body5.i31, %middle.block62, %for.cond2.preheader.i26
%s2.0.lcssa.i28 = phi i32 [ 0, %for.cond2.preheader.i26 ], [ %35, %middle.block62 ], [ %add8.i35, %for.body5.i31 ]
%sub.i29 = sub nsw i32 %add.i23.lcssa, %s2.0.lcssa.i28
%38 = call i32 @llvm.abs.i32(i32 %sub.i29, i1 true)
%spec.select = call i32 @llvm.smin.i32(i32 %38, i32 %menor.044)
%exitcond51.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count
%indvar.next = add i32 %indvar, 1
%indvar.next82 = add i64 %indvar81, 1
br i1 %exitcond51.not, label %for.end10, label %for.body5, !llvm.loop !23
for.end10: ; preds = %soma.exit39, %soma.exit.thread, %soma.exit
%menor.0.lcssa = phi i32 [ %14, %soma.exit ], [ %13, %soma.exit.thread ], [ %spec.select, %soma.exit39 ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %menor.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5
; 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 i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
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, !11, !12}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10, !11, !12}
!17 = distinct !{!17, !10, !12, !11}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !11, !12}
!20 = distinct !{!20, !10, !11, !12}
!21 = distinct !{!21, !10, !12, !11}
!22 = distinct !{!22, !10, !12, !11}
!23 = distinct !{!23, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(void){
int n,i,min=100000,sum1=0,sum2=0;
scanf("%d",&n);
int w[n];
for(i=0;i<n;i++){
scanf("%d",&w[i]);
sum2+=w[i];
}
for(i=0;i<n;i++){
sum1+=w[i];
sum2-=w[i];
if(abs(sum1-sum2)<min){
min = abs(sum1-sum2);
}
}
printf("%d",min);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194209/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194209/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %3, 0
br i1 %cmp32, label %for.body, label %for.end17
for.cond4.preheader: ; preds = %for.body
%cmp536 = icmp sgt i32 %6, 0
br i1 %cmp536, label %for.body6.preheader, label %for.end17
for.body6.preheader: ; preds = %for.cond4.preheader
%wide.trip.count = zext i32 %6 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %6, 1
br i1 %4, label %for.end17.loopexit.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum2.033 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %5, %sum2.033
%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.cond4.preheader, !llvm.loop !9
for.body6: ; preds = %for.body6, %for.body6.preheader.new
%indvars.iv44 = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next45.1, %for.body6 ]
%min.039 = phi i32 [ 100000, %for.body6.preheader.new ], [ %spec.select.1, %for.body6 ]
%sum2.138 = phi i32 [ %add, %for.body6.preheader.new ], [ %sub.1, %for.body6 ]
%sum1.037 = phi i32 [ 0, %for.body6.preheader.new ], [ %add9.1, %for.body6 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.body6 ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv44
%8 = load i32, ptr %arrayidx8, align 8, !tbaa !5
%add9 = add nsw i32 %8, %sum1.037
%sub = sub nsw i32 %sum2.138, %8
%sub12 = sub nsw i32 %add9, %sub
%9 = call i32 @llvm.abs.i32(i32 %sub12, i1 true)
%spec.select = call i32 @llvm.smin.i32(i32 %9, i32 %min.039)
%indvars.iv.next45 = or i64 %indvars.iv44, 1
%arrayidx8.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next45
%10 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%add9.1 = add nsw i32 %10, %add9
%sub.1 = sub nsw i32 %sub, %10
%sub12.1 = sub nsw i32 %add9.1, %sub.1
%11 = call i32 @llvm.abs.i32(i32 %sub12.1, i1 true)
%spec.select.1 = call i32 @llvm.smin.i32(i32 %11, i32 %spec.select)
%indvars.iv.next45.1 = add nuw nsw i64 %indvars.iv44, 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.end17.loopexit.unr-lcssa, label %for.body6, !llvm.loop !11
for.end17.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %spec.select.1, %for.body6 ]
%indvars.iv44.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next45.1, %for.body6 ]
%min.039.unr = phi i32 [ 100000, %for.body6.preheader ], [ %spec.select.1, %for.body6 ]
%sum2.138.unr = phi i32 [ %add, %for.body6.preheader ], [ %sub.1, %for.body6 ]
%sum1.037.unr = phi i32 [ 0, %for.body6.preheader ], [ %add9.1, %for.body6 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end17, label %for.body6.epil
for.body6.epil: ; preds = %for.end17.loopexit.unr-lcssa
%arrayidx8.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv44.unr
%12 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5
%add9.epil = add nsw i32 %12, %sum1.037.unr
%sub.epil.neg = sub i32 %12, %sum2.138.unr
%sub12.epil = add i32 %sub.epil.neg, %add9.epil
%13 = call i32 @llvm.abs.i32(i32 %sub12.epil, i1 true)
%spec.select.epil = call i32 @llvm.smin.i32(i32 %13, i32 %min.039.unr)
br label %for.end17
for.end17: ; preds = %for.body6.epil, %for.end17.loopexit.unr-lcssa, %entry, %for.cond4.preheader
%min.0.lcssa = phi i32 [ 100000, %for.cond4.preheader ], [ 100000, %entry ], [ %spec.select.lcssa.ph, %for.end17.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body6.epil ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %min.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main ( void )
{
int i, n, total = 0, min, sum = 0, tmp;
int w[100];
scanf("%d", &n);
for ( i = 0; i < n; i++ )
{
scanf("%d", &w[i]);
total += w[i];
}
min = total;
for ( i = 0; i < n; i++ )
{
sum += w[i];
tmp = total - 2 * sum;
if ( tmp < min )
{
if ( tmp < 0 )
{
if ( -tmp < min )
printf("%d", -tmp);
else
printf("%d", min);
return 0;
}
min = tmp;
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194252/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194252/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%w = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp46 = icmp sgt i32 %0, 0
br i1 %cmp46, label %for.body, label %cleanup
for.cond4.preheader: ; preds = %for.body
%cmp550 = icmp sgt i32 %2, 0
br i1 %cmp550, label %for.body6.preheader, label %cleanup
for.body6.preheader: ; preds = %for.cond4.preheader
%wide.trip.count = zext i32 %2 to i64
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%total.048 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %w, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %total.048
%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.cond4.preheader, !llvm.loop !9
for.body6: ; preds = %for.body6.preheader, %for.inc21
%indvars.iv58 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next59, %for.inc21 ]
%sum.053 = phi i32 [ 0, %for.body6.preheader ], [ %add9, %for.inc21 ]
%min.052 = phi i32 [ %add, %for.body6.preheader ], [ %min.1, %for.inc21 ]
%arrayidx8 = getelementptr inbounds [100 x i32], ptr %w, i64 0, i64 %indvars.iv58
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%add9 = add nsw i32 %4, %sum.053
%mul = shl nsw i32 %add9, 1
%sub = sub nsw i32 %add, %mul
%cmp10 = icmp slt i32 %sub, %min.052
br i1 %cmp10, label %if.then, label %for.inc21
if.then: ; preds = %for.body6
%cmp11 = icmp slt i32 %sub, 0
br i1 %cmp11, label %if.then12, label %for.inc21
if.then12: ; preds = %if.then
%sub13 = sub nsw i32 0, %sub
%sub13.min.052.lcssa = call i32 @llvm.smin.i32(i32 %min.052, i32 %sub13)
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub13.min.052.lcssa)
br label %cleanup
for.inc21: ; preds = %if.then, %for.body6
%min.1 = phi i32 [ %min.052, %for.body6 ], [ %sub, %if.then ]
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body6, !llvm.loop !11
cleanup: ; preds = %for.inc21, %if.then12, %entry, %for.cond4.preheader
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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>
#include <stdlib.h>
int arrsum(int *arr, int start, int end) {
int sum = 0;
for (int i = start; i <= end; i++) {
sum += arr[i];
}
return sum;
}
int main(int argc, const char *argv[])
{
int n;
int arr[100] = {0};
int min = 2147483647;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
for (int i = 1; i < n ; i++) {
int left = arrsum(arr, 0, i - 1);
int right = arrsum(arr, i, n);
int gap = abs(abs(left) - abs(right));
// printf(" gap = %d\n", gap);
if (min > gap) {
min = gap;
}
}
printf("%d\n", min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194302/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194302/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @arrsum(ptr nocapture noundef readonly %arr, i32 noundef %start, i32 noundef %end) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp sgt i32 %start, %end
br i1 %cmp.not4, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %start to i64
%1 = add i32 %end, 1
%2 = sub i32 %end, %start
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%invariant.gep = getelementptr i32, ptr %arr, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi8 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %gep, i64 4
%wide.load9 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = add <4 x i32> %wide.load, %vec.phi
%7 = add <4 x i32> %wide.load9, %vec.phi8
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%sum.05.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body ]
ret i32 %sum.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader10 ]
%sum.05 = phi i32 [ %add, %for.body ], [ %sum.05.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%10 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %10, %sum.05
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%arr = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %arr) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %arr, i8 0, i64 400, 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
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp437 = icmp sgt i32 %2, 1
br i1 %cmp437, label %for.body.i.preheader.lr.ph, label %for.cond.cleanup5
for.body.i.preheader.lr.ph: ; preds = %for.cond3.preheader
%1 = add nuw i32 %2, 1
%wide.trip.count = zext i32 %2 to i64
br label %for.body.i.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !14
for.body.i.preheader: ; preds = %for.body.i.preheader.lr.ph, %arrsum.exit34.loopexit
%indvar = phi i32 [ 0, %for.body.i.preheader.lr.ph ], [ %indvar.next, %arrsum.exit34.loopexit ]
%indvars.iv43 = phi i64 [ 1, %for.body.i.preheader.lr.ph ], [ %indvars.iv.next44, %arrsum.exit34.loopexit ]
%min.039 = phi i32 [ 2147483647, %for.body.i.preheader.lr.ph ], [ %spec.select, %arrsum.exit34.loopexit ]
%4 = xor i32 %indvar, -1
%5 = add i32 %2, %4
%6 = zext i32 %5 to i64
%7 = add nuw nsw i64 %6, 1
%min.iters.check53 = icmp ult i64 %indvars.iv43, 8
br i1 %min.iters.check53, label %for.body.i.preheader68, label %vector.ph54
vector.ph54: ; preds = %for.body.i.preheader
%n.vec56 = and i64 %indvars.iv43, 9223372036854775800
br label %vector.body59
vector.body59: ; preds = %vector.body59, %vector.ph54
%index60 = phi i64 [ 0, %vector.ph54 ], [ %index.next65, %vector.body59 ]
%vec.phi61 = phi <4 x i32> [ zeroinitializer, %vector.ph54 ], [ %10, %vector.body59 ]
%vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph54 ], [ %11, %vector.body59 ]
%8 = getelementptr inbounds i32, ptr %arr, i64 %index60
%wide.load63 = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load64 = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = add <4 x i32> %wide.load63, %vec.phi61
%11 = add <4 x i32> %wide.load64, %vec.phi62
%index.next65 = add nuw i64 %index60, 8
%12 = icmp eq i64 %index.next65, %n.vec56
br i1 %12, label %middle.block51, label %vector.body59, !llvm.loop !15
middle.block51: ; preds = %vector.body59
%bin.rdx66 = add <4 x i32> %11, %10
%13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx66)
%cmp.n58 = icmp eq i64 %indvars.iv43, %n.vec56
br i1 %cmp.n58, label %arrsum.exit, label %for.body.i.preheader68
for.body.i.preheader68: ; preds = %for.body.i.preheader, %middle.block51
%indvars.iv.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %n.vec56, %middle.block51 ]
%sum.05.i.ph = phi i32 [ 0, %for.body.i.preheader ], [ %13, %middle.block51 ]
br label %for.body.i
for.cond.cleanup5: ; preds = %arrsum.exit34.loopexit, %entry, %for.cond3.preheader
%min.0.lcssa = phi i32 [ 2147483647, %for.cond3.preheader ], [ 2147483647, %entry ], [ %spec.select, %arrsum.exit34.loopexit ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %arr) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
for.body.i: ; preds = %for.body.i.preheader68, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader68 ]
%sum.05.i = phi i32 [ %add.i, %for.body.i ], [ %sum.05.i.ph, %for.body.i.preheader68 ]
%arrayidx.i = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv.i
%14 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%add.i = add nsw i32 %14, %sum.05.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%15 = icmp eq i64 %indvars.iv.next.i, %indvars.iv43
br i1 %15, label %arrsum.exit, label %for.body.i, !llvm.loop !16
arrsum.exit: ; preds = %for.body.i, %middle.block51
%add.i.lcssa = phi i32 [ %13, %middle.block51 ], [ %add.i, %for.body.i ]
%min.iters.check = icmp ult i32 %5, 7
br i1 %min.iters.check, label %for.body.i25.preheader, label %vector.ph
vector.ph: ; preds = %arrsum.exit
%n.vec = and i64 %7, 8589934584
%ind.end = add nuw i64 %indvars.iv43, %n.vec
%16 = getelementptr i32, ptr %arr, i64 %indvars.iv43
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 ], [ %19, %vector.body ]
%vec.phi49 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
%17 = getelementptr i32, ptr %16, i64 %index
%wide.load = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr inbounds i32, ptr %17, i64 4
%wide.load50 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = add <4 x i32> %wide.load, %vec.phi
%20 = add <4 x i32> %wide.load50, %vec.phi49
%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 !17
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %20, %19
%22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %7, %n.vec
br i1 %cmp.n, label %arrsum.exit34.loopexit, label %for.body.i25.preheader
for.body.i25.preheader: ; preds = %arrsum.exit, %middle.block
%indvars.iv.i26.ph = phi i64 [ %indvars.iv43, %arrsum.exit ], [ %ind.end, %middle.block ]
%sum.05.i27.ph = phi i32 [ 0, %arrsum.exit ], [ %22, %middle.block ]
br label %for.body.i25
for.body.i25: ; preds = %for.body.i25.preheader, %for.body.i25
%indvars.iv.i26 = phi i64 [ %indvars.iv.next.i30, %for.body.i25 ], [ %indvars.iv.i26.ph, %for.body.i25.preheader ]
%sum.05.i27 = phi i32 [ %add.i29, %for.body.i25 ], [ %sum.05.i27.ph, %for.body.i25.preheader ]
%arrayidx.i28 = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv.i26
%23 = load i32, ptr %arrayidx.i28, align 4, !tbaa !5
%add.i29 = add nsw i32 %23, %sum.05.i27
%indvars.iv.next.i30 = add nuw nsw i64 %indvars.iv.i26, 1
%lftr.wideiv = trunc i64 %indvars.iv.next.i30 to i32
%exitcond = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond, label %arrsum.exit34.loopexit, label %for.body.i25, !llvm.loop !18
arrsum.exit34.loopexit: ; preds = %for.body.i25, %middle.block
%add.i29.lcssa = phi i32 [ %22, %middle.block ], [ %add.i29, %for.body.i25 ]
%24 = call i32 @llvm.abs.i32(i32 %add.i.lcssa, i1 true)
%25 = call i32 @llvm.abs.i32(i32 %add.i29.lcssa, i1 true)
%sub10 = sub nsw i32 %24, %25
%26 = call i32 @llvm.abs.i32(i32 %sub10, i1 true)
%spec.select = call i32 @llvm.smin.i32(i32 %min.039, i32 %26)
%indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
%exitcond46.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count
%indvar.next = add i32 %indvar, 1
br i1 %exitcond46.not, label %for.cond.cleanup5, label %for.body.i.preheader, !llvm.loop !19
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: 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 #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 i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !10, !12, !11}
!17 = distinct !{!17, !10, !11, !12}
!18 = distinct !{!18, !10, !12, !11}
!19 = distinct !{!19, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define ROOP(i,n) for(i=0;i<n;i++)
//prototype declaration
int getint();
long long getllint();
double getdint();
char getch();
void setstring(char *s);
void showint(int i);
void showllint(long long i);
void showdouble(double i);
void showchar(char c);
void showstring(char *s);
int myPower(int a, int n) { // aのn乗の計算
int x = 1;
while (n > 0) { // 全てのbitが捨てられるまで
if ( n & 1) { // 一番右のbitが1のとき
x *= a;
}
a *= a;
n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
}
return x;
}
int min(int a, int b) {
return a < b ? a : b;
}
int main(void) {
int n, i, j;
n = getint();
int w[n];
ROOP(i, n) {
scanf("%d", &w[i]);
}
if (n == 2) {
if (w[0] < w[1]) {
printf("%d\n", 2);
} else {
printf("%d\n", 1);
}
return 0;
}
int sum1 = 0, sum2 = 0;
int k;
int min = 100000;
ROOP(i, n) {
for (j = 0; j <= i; j++) {
sum1 += w[j];
}
for (k = j; k < n; k++) {
sum2 += w[k];
}
if (min > abs(sum1 - sum2)) {
min = abs(sum1 - sum2);
}
sum1 = 0;
sum2 = 0;
}
printf("%d\n", min);
return 0;
}
int getint() {
int i;
scanf("%d", &i);
return i;
}
long long getllint() {
long long i;
scanf("%lld", &i);
return i;
}
double getdint() {
double i;
scanf("%lf", &i);
return i;
}
char getch() {
char c;
scanf("%c", &c);
return c;
}
void setstring(char *s) {
scanf("%s", s);
}
void showint(int i) {
printf("%d\n", i);
}
void showllint(long long i) {
printf("%lld\n", i);
}
void showdouble(double i) {
printf("%lf\n", i);
}
void showchar(char c) {
printf("%c\n", c);
}
void showstring(char *s) {
printf("%s\n", s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194346/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194346/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.6 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.7 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1
@.str.8 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @myPower(i32 noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%x.010 = phi i32 [ %spec.select, %while.body ], [ 1, %entry ]
%n.addr.09 = phi i32 [ %shr, %while.body ], [ %n, %entry ]
%a.addr.08 = phi i32 [ %mul1, %while.body ], [ %a, %entry ]
%and = and i32 %n.addr.09, 1
%tobool.not = icmp eq i32 %and, 0
%mul = select i1 %tobool.not, i32 1, i32 %a.addr.08
%spec.select = mul nsw i32 %mul, %x.010
%mul1 = mul nsw i32 %a.addr.08, %a.addr.08
%shr = lshr i32 %n.addr.09, 1
%cmp.not = icmp ult i32 %n.addr.09, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%x.0.lcssa = phi i32 [ 1, %entry ], [ %spec.select, %while.body ]
ret i32 %x.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
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 #3 {
entry:
%i.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #8
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i)
%0 = load i32, ptr %i.i, align 4, !tbaa !7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #8
%1 = zext i32 %0 to i64
%vla = alloca i32, i64 %1, align 16
%cmp60 = icmp sgt i32 %0, 0
br i1 %cmp60, label %for.body, label %cleanup
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %1
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body
%cmp2 = icmp eq i32 %0, 2
br i1 %cmp2, label %if.then, label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.end
br i1 %cmp60, label %for.cond13.preheader.preheader, label %cleanup
for.cond13.preheader.preheader: ; preds = %for.cond10.preheader
%sext = zext i32 %0 to i64
%2 = add nuw i32 %0, 1
%wide.trip.count87 = zext i32 %2 to i64
br label %for.cond13.preheader
if.then: ; preds = %for.end
%3 = load i32, ptr %vla, align 16, !tbaa !7
%arrayidx4 = getelementptr inbounds i32, ptr %vla, i64 1
%4 = load i32, ptr %arrayidx4, align 4, !tbaa !7
%cmp5 = icmp slt i32 %3, %4
%. = select i1 %cmp5, i32 2, i32 1
br label %cleanup
for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.end29
%indvar = phi i64 [ 0, %for.cond13.preheader.preheader ], [ %indvar.next, %for.end29 ]
%indvars.iv74 = phi i64 [ 1, %for.cond13.preheader.preheader ], [ %indvars.iv.next75, %for.end29 ]
%min.069 = phi i32 [ 100000, %for.cond13.preheader.preheader ], [ %spec.select, %for.end29 ]
%5 = xor i64 %indvar, -1
%6 = add i64 %5, %1
%min.iters.check94 = icmp ult i64 %indvars.iv74, 8
br i1 %min.iters.check94, label %for.body15.preheader, label %vector.ph95
vector.ph95: ; preds = %for.cond13.preheader
%n.vec97 = and i64 %indvars.iv74, 9223372036854775800
br label %vector.body100
vector.body100: ; preds = %vector.body100, %vector.ph95
%index101 = phi i64 [ 0, %vector.ph95 ], [ %index.next106, %vector.body100 ]
%vec.phi102 = phi <4 x i32> [ zeroinitializer, %vector.ph95 ], [ %9, %vector.body100 ]
%vec.phi103 = phi <4 x i32> [ zeroinitializer, %vector.ph95 ], [ %10, %vector.body100 ]
%7 = getelementptr inbounds i32, ptr %vla, i64 %index101
%wide.load104 = load <4 x i32>, ptr %7, align 16, !tbaa !7
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load105 = load <4 x i32>, ptr %8, align 16, !tbaa !7
%9 = add <4 x i32> %wide.load104, %vec.phi102
%10 = add <4 x i32> %wide.load105, %vec.phi103
%index.next106 = add nuw i64 %index101, 8
%11 = icmp eq i64 %index.next106, %n.vec97
br i1 %11, label %middle.block92, label %vector.body100, !llvm.loop !12
middle.block92: ; preds = %vector.body100
%bin.rdx107 = add <4 x i32> %10, %9
%12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx107)
%cmp.n99 = icmp eq i64 %indvars.iv74, %n.vec97
br i1 %cmp.n99, label %for.cond21.preheader, label %for.body15.preheader
for.body15.preheader: ; preds = %for.cond13.preheader, %middle.block92
%indvars.iv72.ph = phi i64 [ 0, %for.cond13.preheader ], [ %n.vec97, %middle.block92 ]
%sum1.163.ph = phi i32 [ 0, %for.cond13.preheader ], [ %12, %middle.block92 ]
br label %for.body15
for.cond21.preheader: ; preds = %for.body15, %middle.block92
%add.lcssa = phi i32 [ %12, %middle.block92 ], [ %add, %for.body15 ]
%13 = icmp ult i64 %indvars.iv74, %sext
br i1 %13, label %for.body23.preheader, label %for.end29
for.body23.preheader: ; preds = %for.cond21.preheader
%min.iters.check = icmp ult i64 %6, 8
br i1 %min.iters.check, label %for.body23.preheader109, label %vector.ph
vector.ph: ; preds = %for.body23.preheader
%n.vec = and i64 %6, -8
%ind.end = add i64 %indvars.iv74, %n.vec
%14 = getelementptr i32, ptr %vla, i64 %indvars.iv74
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.phi90 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%15 = getelementptr i32, ptr %14, i64 %index
%wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !7
%16 = getelementptr inbounds i32, ptr %15, i64 4
%wide.load91 = load <4 x i32>, ptr %16, align 4, !tbaa !7
%17 = add <4 x i32> %wide.load, %vec.phi
%18 = add <4 x i32> %wide.load91, %vec.phi90
%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 !15
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 %6, %n.vec
br i1 %cmp.n, label %for.end29, label %for.body23.preheader109
for.body23.preheader109: ; preds = %for.body23.preheader, %middle.block
%indvars.iv81.ph = phi i64 [ %indvars.iv74, %for.body23.preheader ], [ %ind.end, %middle.block ]
%sum2.165.ph = phi i32 [ 0, %for.body23.preheader ], [ %20, %middle.block ]
br label %for.body23
for.body15: ; preds = %for.body15.preheader, %for.body15
%indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body15 ], [ %indvars.iv72.ph, %for.body15.preheader ]
%sum1.163 = phi i32 [ %add, %for.body15 ], [ %sum1.163.ph, %for.body15.preheader ]
%arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv72
%21 = load i32, ptr %arrayidx17, align 4, !tbaa !7
%add = add nsw i32 %21, %sum1.163
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%exitcond80.not = icmp eq i64 %indvars.iv.next73, %indvars.iv74
br i1 %exitcond80.not, label %for.cond21.preheader, label %for.body15, !llvm.loop !16
for.body23: ; preds = %for.body23.preheader109, %for.body23
%indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.body23 ], [ %indvars.iv81.ph, %for.body23.preheader109 ]
%sum2.165 = phi i32 [ %add26, %for.body23 ], [ %sum2.165.ph, %for.body23.preheader109 ]
%arrayidx25 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv81
%22 = load i32, ptr %arrayidx25, align 4, !tbaa !7
%add26 = add nsw i32 %22, %sum2.165
%indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
%exitcond85.not = icmp eq i64 %indvars.iv.next82, %1
br i1 %exitcond85.not, label %for.end29, label %for.body23, !llvm.loop !17
for.end29: ; preds = %for.body23, %middle.block, %for.cond21.preheader
%sum2.1.lcssa = phi i32 [ 0, %for.cond21.preheader ], [ %20, %middle.block ], [ %add26, %for.body23 ]
%sub = sub nsw i32 %add.lcssa, %sum2.1.lcssa
%23 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%spec.select = call i32 @llvm.smin.i32(i32 %min.069, i32 %23)
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%exitcond88.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count87
%indvar.next = add i64 %indvar, 1
br i1 %exitcond88.not, label %cleanup, label %for.cond13.preheader, !llvm.loop !18
cleanup: ; preds = %for.end29, %for.cond10.preheader, %entry, %if.then
%.sink = phi i32 [ %., %if.then ], [ 100000, %for.cond10.preheader ], [ 100000, %entry ], [ %spec.select, %for.end29 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @getint() local_unnamed_addr #3 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #8
ret i32 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @getllint() local_unnamed_addr #3 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !19
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #8
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @getdint() local_unnamed_addr #3 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !21
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #8
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local signext i8 @getch() local_unnamed_addr #3 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !23
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #8
ret i8 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @setstring(ptr noundef %s) local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @showint(i32 noundef %i) local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @showllint(i64 noundef %i) local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %i)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @showdouble(double noundef %i) local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %i)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @showchar(i8 noundef signext %c) local_unnamed_addr #3 {
entry:
%conv = sext i8 %c to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %conv)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @showstring(ptr nocapture noundef readonly %s) local_unnamed_addr #3 {
entry:
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %s)
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = 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 = distinct !{!12, !6, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !6, !13, !14}
!16 = distinct !{!16, !6, !14, !13}
!17 = distinct !{!17, !6, !14, !13}
!18 = distinct !{!18, !6}
!19 = !{!20, !20, i64 0}
!20 = !{!"long long", !9, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !9, i64 0}
!23 = !{!9, !9, i64 0}
|
#include<stdio.h>
#include<string.h>
int a[105];
int b[500];
int main()
{
int t,n;
scanf("%d",&t);
while(t--)
{
memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
b[a[i]]++;
}
int ans;
for(int i=1;i<=n;i++)
{
if(b[a[i]]==1)
{
ans=i;
break;
}
}
printf("%d\n",ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19439/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19439/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@a = dso_local global [105 x i32] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [500 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec36 = add nsw i32 %0, -1
store i32 %dec36, ptr %t, align 4, !tbaa !5
%tobool.not37 = icmp eq i32 %0, 0
br i1 %tobool.not37, label %while.end, label %while.body
while.body: ; preds = %entry, %cleanup
%ans.038 = phi i32 [ %ans.1, %cleanup ], [ undef, %entry ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(420) @a, i8 0, i64 420, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000) @b, i8 0, i64 2000, i1 false)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not30 = icmp slt i32 %1, 1
br i1 %cmp.not30, label %cleanup, label %for.body
for.cond9.preheader: ; preds = %for.body
%cmp10.not32 = icmp slt i32 %5, 1
br i1 %cmp10.not32, label %cleanup, label %for.body12.preheader
for.body12.preheader: ; preds = %for.cond9.preheader
%2 = add nuw i32 %5, 1
%wide.trip.count = zext i32 %2 to i64
br label %for.body12
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %while.body ]
%arrayidx = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom5 = sext i32 %3 to i64
%arrayidx6 = getelementptr inbounds [500 x i32], ptr @b, i64 0, i64 %idxprom5
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%inc = add nsw i32 %4, 1
store i32 %inc, ptr %arrayidx6, align 4, !tbaa !5
%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.not.not = icmp slt i64 %indvars.iv, %6
br i1 %cmp.not.not, label %for.body, label %for.cond9.preheader, !llvm.loop !9
for.body12: ; preds = %for.body12.preheader, %for.inc18
%indvars.iv41 = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next42, %for.inc18 ]
%arrayidx14 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv41
%7 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%idxprom15 = sext i32 %7 to i64
%arrayidx16 = getelementptr inbounds [500 x i32], ptr @b, i64 0, i64 %idxprom15
%8 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp eq i32 %8, 1
br i1 %cmp17, label %cleanup.loopexit.split.loop.exit, label %for.inc18
for.inc18: ; preds = %for.body12
%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 %cleanup, label %for.body12, !llvm.loop !11
cleanup.loopexit.split.loop.exit: ; preds = %for.body12
%9 = trunc i64 %indvars.iv41 to i32
br label %cleanup
cleanup: ; preds = %for.inc18, %cleanup.loopexit.split.loop.exit, %while.body, %for.cond9.preheader
%ans.1 = phi i32 [ %ans.038, %for.cond9.preheader ], [ %ans.038, %while.body ], [ %9, %cleanup.loopexit.split.loop.exit ], [ %ans.038, %for.inc18 ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1)
%10 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %10, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %10, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INF 100000000
typedef struct {
char a[24],b[24];
int d,t;
} senro_t;
int n,m;
char s[24],p[24],g[24];
senro_t senro[5000];
const char* ekilist_raw[10000];
int ekinum;
const char* ekilist[500];
int qsort_comp(const void* x,const void* y) {
return strcmp(*((const char**)x),*((const char**)y));
}
int get_ekiid(const char* eki) {
int left,right,mid;
left=0;right=ekinum-1;
while(left<=right) {
mid=(left+right)/2;
int cmp=strcmp(eki,ekilist[mid]);
if(cmp==0)return mid;
else if(cmp<0)right=mid-1; else left=mid+1;
}
return ekinum;
}
int zikan[510][510];
int result[510];
int kakutei[510];
int tansaku(int s,int g) {
int i;
for(i=0;i<n;i++) {
result[i]=INF;
kakutei[i]=0;
}
result[s]=0;
for(i=0;i<n;i++) {
int minst=0,minresult=INF;
int j;
for(j=0;j<n;j++) {
if(!kakutei[j] && result[j]<minresult) {
minst=j;
minresult=result[j];
}
}
kakutei[minst]=1;
for(j=0;j<n;j++) {
if(result[minst]+zikan[minst][j]<result[j]) {
result[j]=result[minst]+zikan[minst][j];
}
}
}
return result[g];
}
int main(void) {
while(scanf("%d%d",&n,&m)==2 && (n|m)!=0) {
int i,j;
int start,chukan,goal;
scanf("%s%s%s",s,p,g);
for(i=0;i<m;i++) {
scanf("%s%s%d%d",senro[i].a,senro[i].b,&senro[i].d,&senro[i].t);
ekilist_raw[i*2]=senro[i].a;
ekilist_raw[i*2+1]=senro[i].b;
}
qsort(ekilist_raw,m*2,sizeof(ekilist_raw[0]),qsort_comp);
ekilist[0]=ekilist_raw[0];
ekinum=1;
for(i=1;i<m*2;i++) {
if(strcmp(ekilist_raw[i],ekilist_raw[i-1])!=0) {
ekilist[ekinum++]=ekilist_raw[i];
}
}
start=get_ekiid(s);
chukan=get_ekiid(p);
goal=get_ekiid(g);
for(i=0;i<n;i++) {
for(j=0;j<n;j++) {
zikan[i][j]=(i==j?0:INF);
}
}
for(i=0;i<m;i++) {
int a=get_ekiid(senro[i].a);
int b=get_ekiid(senro[i].b);
zikan[a][b]=zikan[b][a]=senro[i].d/40+senro[i].t;
}
printf("%d\n",tansaku(start,chukan)+tansaku(chukan,goal));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194432/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194432/source.c"
target datalayout = "e-m:e-p270: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.senro_t = type { [24 x i8], [24 x i8], i32, i32 }
@ekinum = dso_local local_unnamed_addr global i32 0, align 4
@ekilist = dso_local local_unnamed_addr global [500 x ptr] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@result = dso_local local_unnamed_addr global [510 x i32] zeroinitializer, align 16
@kakutei = dso_local local_unnamed_addr global [510 x i32] zeroinitializer, align 16
@zikan = dso_local local_unnamed_addr global [510 x [510 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@m = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [7 x i8] c"%s%s%s\00", align 1
@s = dso_local global [24 x i8] zeroinitializer, align 16
@p = dso_local global [24 x i8] zeroinitializer, align 16
@g = dso_local global [24 x i8] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [9 x i8] c"%s%s%d%d\00", align 1
@senro = dso_local global [5000 x %struct.senro_t] zeroinitializer, align 16
@ekilist_raw = dso_local global [10000 x ptr] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @qsort_comp(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !5
%1 = load ptr, ptr %y, align 8, !tbaa !5
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #9
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @get_ekiid(ptr nocapture noundef readonly %eki) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @ekinum, align 4, !tbaa !9
%cmp.not21 = icmp slt i32 %0, 1
br i1 %cmp.not21, label %cleanup9, label %while.body.preheader
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %0, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %cleanup
%left.023 = phi i32 [ %left.1, %cleanup ], [ 0, %while.body.preheader ]
%right.022 = phi i32 [ %right.1, %cleanup ], [ %sub, %while.body.preheader ]
%add = add nsw i32 %left.023, %right.022
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds [500 x ptr], ptr @ekilist, i64 0, i64 %idxprom
%1 = load ptr, ptr %arrayidx, align 8, !tbaa !5
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %eki, ptr noundef nonnull dereferenceable(1) %1) #9
%cmp2.not = icmp eq i32 %call, 0
br i1 %cmp2.not, label %cleanup9, label %cleanup
cleanup: ; preds = %while.body
%cmp3 = icmp slt i32 %call, 0
%sub5 = add nsw i32 %div, -1
%add7 = add nsw i32 %div, 1
%right.1 = select i1 %cmp3, i32 %sub5, i32 %right.022
%left.1 = select i1 %cmp3, i32 %left.023, i32 %add7
%cmp.not = icmp sgt i32 %left.1, %right.1
br i1 %cmp.not, label %cleanup9, label %while.body, !llvm.loop !11
cleanup9: ; preds = %cleanup, %while.body, %entry
%retval.2 = phi i32 [ %0, %entry ], [ %div, %while.body ], [ %0, %cleanup ]
ret i32 %retval.2
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @tansaku(i32 noundef %s, i32 noundef %g) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !9
%cmp75 = icmp sgt i32 %0, 0
br i1 %cmp75, label %for.body.preheader, label %for.end.thread
for.end.thread: ; preds = %entry
%idxprom3116 = sext i32 %s to i64
%arrayidx4117 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom3116
store i32 0, ptr %arrayidx4117, align 4, !tbaa !9
br label %for.end51
for.body.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @kakutei, i8 0, i64 %2, i1 false), !tbaa !9
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader118, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %1, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%3 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %index
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %3, align 16, !tbaa !9
%4 = getelementptr inbounds i32, ptr %3, i64 4
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %4, align 16, !tbaa !9
%index.next = add nuw i64 %index, 8
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %1
br i1 %cmp.n, label %for.end, label %for.body.preheader118
for.body.preheader118: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader118, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader118 ]
%arrayidx = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv
store i32 100000000, ptr %arrayidx, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %1
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !16
for.end: ; preds = %for.body, %middle.block
%idxprom3 = sext i32 %s to i64
%arrayidx4 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom3
store i32 0, ptr %arrayidx4, align 4, !tbaa !9
br i1 %cmp75, label %for.cond8.preheader.us.us.preheader, label %for.end51
for.cond8.preheader.us.us.preheader: ; preds = %for.end
%wide.trip.count108 = zext i32 %0 to i64
%6 = add nsw i64 %wide.trip.count108, -1
%xtraiter = and i64 %wide.trip.count108, 1
%7 = icmp eq i64 %6, 0
%unroll_iter = and i64 %wide.trip.count108, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%xtraiter120 = and i64 %wide.trip.count108, 1
%8 = icmp eq i64 %6, 0
%unroll_iter122 = and i64 %wide.trip.count108, 4294967294
%lcmp.mod121.not = icmp eq i64 %xtraiter120, 0
br label %for.cond8.preheader.us.us
for.cond8.preheader.us.us: ; preds = %for.cond8.preheader.us.us.preheader, %for.cond23.for.end48_crit_edge.us.us
%i.185.us.us = phi i32 [ %inc50.us.us, %for.cond23.for.end48_crit_edge.us.us ], [ 0, %for.cond8.preheader.us.us.preheader ]
br i1 %7, label %for.cond8.for.end20_crit_edge.us.us.unr-lcssa, label %for.body10.us.us
for.body25.us.us: ; preds = %for.cond8.for.end20_crit_edge.us.us, %for.inc46.us.us.1
%indvars.iv110 = phi i64 [ %indvars.iv.next111.1, %for.inc46.us.us.1 ], [ 0, %for.cond8.for.end20_crit_edge.us.us ]
%niter123 = phi i64 [ %niter123.next.1, %for.inc46.us.us.1 ], [ 0, %for.cond8.for.end20_crit_edge.us.us ]
%9 = load i32, ptr %arrayidx27.us.us, align 4, !tbaa !9
%arrayidx31.us.us = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us, i64 %indvars.iv110
%10 = load i32, ptr %arrayidx31.us.us, align 8, !tbaa !9
%add.us.us = add nsw i32 %10, %9
%arrayidx33.us.us = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv110
%11 = load i32, ptr %arrayidx33.us.us, align 8, !tbaa !9
%cmp34.us.us = icmp slt i32 %add.us.us, %11
br i1 %cmp34.us.us, label %if.then35.us.us, label %for.inc46.us.us
if.then35.us.us: ; preds = %for.body25.us.us
store i32 %add.us.us, ptr %arrayidx33.us.us, align 8, !tbaa !9
br label %for.inc46.us.us
for.inc46.us.us: ; preds = %if.then35.us.us, %for.body25.us.us
%indvars.iv.next111 = or i64 %indvars.iv110, 1
%12 = load i32, ptr %arrayidx27.us.us, align 4, !tbaa !9
%arrayidx31.us.us.1 = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us, i64 %indvars.iv.next111
%13 = load i32, ptr %arrayidx31.us.us.1, align 4, !tbaa !9
%add.us.us.1 = add nsw i32 %13, %12
%arrayidx33.us.us.1 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv.next111
%14 = load i32, ptr %arrayidx33.us.us.1, align 4, !tbaa !9
%cmp34.us.us.1 = icmp slt i32 %add.us.us.1, %14
br i1 %cmp34.us.us.1, label %if.then35.us.us.1, label %for.inc46.us.us.1
if.then35.us.us.1: ; preds = %for.inc46.us.us
store i32 %add.us.us.1, ptr %arrayidx33.us.us.1, align 4, !tbaa !9
br label %for.inc46.us.us.1
for.inc46.us.us.1: ; preds = %if.then35.us.us.1, %for.inc46.us.us
%indvars.iv.next111.1 = add nuw nsw i64 %indvars.iv110, 2
%niter123.next.1 = add i64 %niter123, 2
%niter123.ncmp.1 = icmp eq i64 %niter123.next.1, %unroll_iter122
br i1 %niter123.ncmp.1, label %for.cond23.for.end48_crit_edge.us.us.unr-lcssa, label %for.body25.us.us, !llvm.loop !17
for.body10.us.us: ; preds = %for.cond8.preheader.us.us, %for.inc18.us.us.1
%indvars.iv105 = phi i64 [ %indvars.iv.next106.1, %for.inc18.us.us.1 ], [ 0, %for.cond8.preheader.us.us ]
%minresult.079.us.us = phi i32 [ %minresult.1.us.us.1, %for.inc18.us.us.1 ], [ 100000000, %for.cond8.preheader.us.us ]
%minst.078.us.us = phi i32 [ %minst.1.us.us.1, %for.inc18.us.us.1 ], [ 0, %for.cond8.preheader.us.us ]
%niter = phi i64 [ %niter.next.1, %for.inc18.us.us.1 ], [ 0, %for.cond8.preheader.us.us ]
%arrayidx12.us.us = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv105
%15 = load i32, ptr %arrayidx12.us.us, align 8, !tbaa !9
%tobool.not.us.us = icmp eq i32 %15, 0
br i1 %tobool.not.us.us, label %land.lhs.true.us.us, label %for.inc18.us.us
land.lhs.true.us.us: ; preds = %for.body10.us.us
%arrayidx14.us.us = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv105
%16 = load i32, ptr %arrayidx14.us.us, align 8, !tbaa !9
%cmp15.us.us = icmp slt i32 %16, %minresult.079.us.us
%17 = trunc i64 %indvars.iv105 to i32
%spec.select.us.us = select i1 %cmp15.us.us, i32 %17, i32 %minst.078.us.us
%spec.select74.us.us = tail call i32 @llvm.smin.i32(i32 %16, i32 %minresult.079.us.us)
br label %for.inc18.us.us
for.inc18.us.us: ; preds = %land.lhs.true.us.us, %for.body10.us.us
%minst.1.us.us = phi i32 [ %minst.078.us.us, %for.body10.us.us ], [ %spec.select.us.us, %land.lhs.true.us.us ]
%minresult.1.us.us = phi i32 [ %minresult.079.us.us, %for.body10.us.us ], [ %spec.select74.us.us, %land.lhs.true.us.us ]
%indvars.iv.next106 = or i64 %indvars.iv105, 1
%arrayidx12.us.us.1 = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv.next106
%18 = load i32, ptr %arrayidx12.us.us.1, align 4, !tbaa !9
%tobool.not.us.us.1 = icmp eq i32 %18, 0
br i1 %tobool.not.us.us.1, label %land.lhs.true.us.us.1, label %for.inc18.us.us.1
land.lhs.true.us.us.1: ; preds = %for.inc18.us.us
%arrayidx14.us.us.1 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv.next106
%19 = load i32, ptr %arrayidx14.us.us.1, align 4, !tbaa !9
%cmp15.us.us.1 = icmp slt i32 %19, %minresult.1.us.us
%20 = trunc i64 %indvars.iv.next106 to i32
%spec.select.us.us.1 = select i1 %cmp15.us.us.1, i32 %20, i32 %minst.1.us.us
%spec.select74.us.us.1 = tail call i32 @llvm.smin.i32(i32 %19, i32 %minresult.1.us.us)
br label %for.inc18.us.us.1
for.inc18.us.us.1: ; preds = %land.lhs.true.us.us.1, %for.inc18.us.us
%minst.1.us.us.1 = phi i32 [ %minst.1.us.us, %for.inc18.us.us ], [ %spec.select.us.us.1, %land.lhs.true.us.us.1 ]
%minresult.1.us.us.1 = phi i32 [ %minresult.1.us.us, %for.inc18.us.us ], [ %spec.select74.us.us.1, %land.lhs.true.us.us.1 ]
%indvars.iv.next106.1 = add nuw nsw i64 %indvars.iv105, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond8.for.end20_crit_edge.us.us.unr-lcssa, label %for.body10.us.us, !llvm.loop !18
for.cond8.for.end20_crit_edge.us.us.unr-lcssa: ; preds = %for.inc18.us.us.1, %for.cond8.preheader.us.us
%minst.1.us.us.lcssa.ph = phi i32 [ undef, %for.cond8.preheader.us.us ], [ %minst.1.us.us.1, %for.inc18.us.us.1 ]
%indvars.iv105.unr = phi i64 [ 0, %for.cond8.preheader.us.us ], [ %indvars.iv.next106.1, %for.inc18.us.us.1 ]
%minresult.079.us.us.unr = phi i32 [ 100000000, %for.cond8.preheader.us.us ], [ %minresult.1.us.us.1, %for.inc18.us.us.1 ]
%minst.078.us.us.unr = phi i32 [ 0, %for.cond8.preheader.us.us ], [ %minst.1.us.us.1, %for.inc18.us.us.1 ]
br i1 %lcmp.mod.not, label %for.cond8.for.end20_crit_edge.us.us, label %for.body10.us.us.epil
for.body10.us.us.epil: ; preds = %for.cond8.for.end20_crit_edge.us.us.unr-lcssa
%arrayidx12.us.us.epil = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv105.unr
%21 = load i32, ptr %arrayidx12.us.us.epil, align 4, !tbaa !9
%tobool.not.us.us.epil = icmp eq i32 %21, 0
br i1 %tobool.not.us.us.epil, label %land.lhs.true.us.us.epil, label %for.cond8.for.end20_crit_edge.us.us
land.lhs.true.us.us.epil: ; preds = %for.body10.us.us.epil
%arrayidx14.us.us.epil = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv105.unr
%22 = load i32, ptr %arrayidx14.us.us.epil, align 4, !tbaa !9
%cmp15.us.us.epil = icmp slt i32 %22, %minresult.079.us.us.unr
%23 = trunc i64 %indvars.iv105.unr to i32
%spec.select.us.us.epil = select i1 %cmp15.us.us.epil, i32 %23, i32 %minst.078.us.us.unr
br label %for.cond8.for.end20_crit_edge.us.us
for.cond8.for.end20_crit_edge.us.us: ; preds = %for.body10.us.us.epil, %land.lhs.true.us.us.epil, %for.cond8.for.end20_crit_edge.us.us.unr-lcssa
%minst.1.us.us.lcssa = phi i32 [ %minst.1.us.us.lcssa.ph, %for.cond8.for.end20_crit_edge.us.us.unr-lcssa ], [ %minst.078.us.us.unr, %for.body10.us.us.epil ], [ %spec.select.us.us.epil, %land.lhs.true.us.us.epil ]
%idxprom21.us.us = sext i32 %minst.1.us.us.lcssa to i64
%arrayidx22.us.us = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %idxprom21.us.us
store i32 1, ptr %arrayidx22.us.us, align 4, !tbaa !9
%arrayidx27.us.us = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom21.us.us
br i1 %8, label %for.cond23.for.end48_crit_edge.us.us.unr-lcssa, label %for.body25.us.us
for.cond23.for.end48_crit_edge.us.us.unr-lcssa: ; preds = %for.inc46.us.us.1, %for.cond8.for.end20_crit_edge.us.us
%indvars.iv110.unr = phi i64 [ 0, %for.cond8.for.end20_crit_edge.us.us ], [ %indvars.iv.next111.1, %for.inc46.us.us.1 ]
br i1 %lcmp.mod121.not, label %for.cond23.for.end48_crit_edge.us.us, label %for.body25.us.us.epil
for.body25.us.us.epil: ; preds = %for.cond23.for.end48_crit_edge.us.us.unr-lcssa
%24 = load i32, ptr %arrayidx27.us.us, align 4, !tbaa !9
%arrayidx31.us.us.epil = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us, i64 %indvars.iv110.unr
%25 = load i32, ptr %arrayidx31.us.us.epil, align 4, !tbaa !9
%add.us.us.epil = add nsw i32 %25, %24
%arrayidx33.us.us.epil = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv110.unr
%26 = load i32, ptr %arrayidx33.us.us.epil, align 4, !tbaa !9
%cmp34.us.us.epil = icmp slt i32 %add.us.us.epil, %26
br i1 %cmp34.us.us.epil, label %if.then35.us.us.epil, label %for.cond23.for.end48_crit_edge.us.us
if.then35.us.us.epil: ; preds = %for.body25.us.us.epil
store i32 %add.us.us.epil, ptr %arrayidx33.us.us.epil, align 4, !tbaa !9
br label %for.cond23.for.end48_crit_edge.us.us
for.cond23.for.end48_crit_edge.us.us: ; preds = %for.body25.us.us.epil, %if.then35.us.us.epil, %for.cond23.for.end48_crit_edge.us.us.unr-lcssa
%inc50.us.us = add nuw nsw i32 %i.185.us.us, 1
%exitcond115.not = icmp eq i32 %inc50.us.us, %0
br i1 %exitcond115.not, label %for.end51, label %for.cond8.preheader.us.us, !llvm.loop !19
for.end51: ; preds = %for.cond23.for.end48_crit_edge.us.us, %for.end.thread, %for.end
%idxprom52 = sext i32 %g to i64
%arrayidx53 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom52
%27 = load i32, ptr %arrayidx53, align 4, !tbaa !9
ret i32 %27
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%call304 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
%cmp305 = icmp eq i32 %call304, 2
%0 = load i32, ptr @n, align 4
%1 = load i32, ptr @m, align 4
%or306 = or i32 %1, %0
%cmp1307 = icmp ne i32 %or306, 0
%2 = select i1 %cmp305, i1 %cmp1307, i1 false
br i1 %2, label %while.body, label %while.end
while.body: ; preds = %entry, %tansaku.exit274
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s, ptr noundef nonnull @p, ptr noundef nonnull @g)
%3 = load i32, ptr @m, align 4, !tbaa !9
%cmp3289 = icmp sgt i32 %3, 0
br i1 %cmp3289, label %for.body, label %for.end
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [5000 x %struct.senro_t], ptr @senro, i64 0, i64 %indvars.iv
%b = getelementptr inbounds [5000 x %struct.senro_t], ptr @senro, i64 0, i64 %indvars.iv, i32 1
%d = getelementptr inbounds [5000 x %struct.senro_t], ptr @senro, i64 0, i64 %indvars.iv, i32 2
%t = getelementptr inbounds [5000 x %struct.senro_t], ptr @senro, i64 0, i64 %indvars.iv, i32 3
%call11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx, ptr noundef nonnull %b, ptr noundef nonnull %d, ptr noundef nonnull %t)
%4 = shl nuw nsw i64 %indvars.iv, 1
%arrayidx17 = getelementptr inbounds [10000 x ptr], ptr @ekilist_raw, i64 0, i64 %4
store ptr %arrayidx, ptr %arrayidx17, align 16, !tbaa !5
%5 = or i64 %4, 1
%arrayidx24 = getelementptr inbounds [10000 x ptr], ptr @ekilist_raw, i64 0, i64 %5
store ptr %b, ptr %arrayidx24, align 8, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr @m, align 4, !tbaa !9
%7 = sext i32 %6 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp3, label %for.body, label %for.end, !llvm.loop !20
for.end: ; preds = %for.body, %while.body
%.lcssa = phi i32 [ %3, %while.body ], [ %6, %for.body ]
%mul25 = shl nsw i32 %.lcssa, 1
%conv = sext i32 %mul25 to i64
tail call void @qsort(ptr noundef nonnull @ekilist_raw, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @qsort_comp) #10
%8 = load ptr, ptr @ekilist_raw, align 16, !tbaa !5
store ptr %8, ptr @ekilist, align 16, !tbaa !5
store i32 1, ptr @ekinum, align 4, !tbaa !9
%9 = load i32, ptr @m, align 4, !tbaa !9
%cmp28293 = icmp sgt i32 %9, 0
br i1 %cmp28293, label %for.body30.preheader, label %while.body.preheader.i
for.body30.preheader: ; preds = %for.end
%mul27 = shl nuw i32 %9, 1
%smax = tail call i32 @llvm.smax.i32(i32 %mul27, i32 2)
%wide.trip.count = zext i32 %smax to i64
br label %for.body30
for.body30: ; preds = %for.body30.preheader, %for.inc43
%10 = phi ptr [ %8, %for.body30.preheader ], [ %11, %for.inc43 ]
%indvars.iv312 = phi i64 [ 1, %for.body30.preheader ], [ %indvars.iv.next313, %for.inc43 ]
%inc40292294 = phi i32 [ 1, %for.body30.preheader ], [ %inc40291, %for.inc43 ]
%arrayidx32 = getelementptr inbounds [10000 x ptr], ptr @ekilist_raw, i64 0, i64 %indvars.iv312
%11 = load ptr, ptr %arrayidx32, align 8, !tbaa !5
%call35 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) %10) #9
%cmp36.not = icmp eq i32 %call35, 0
br i1 %cmp36.not, label %for.inc43, label %if.then
if.then: ; preds = %for.body30
%inc40 = add nsw i32 %inc40292294, 1
store i32 %inc40, ptr @ekinum, align 4, !tbaa !9
%idxprom41 = sext i32 %inc40292294 to i64
%arrayidx42 = getelementptr inbounds [500 x ptr], ptr @ekilist, i64 0, i64 %idxprom41
store ptr %11, ptr %arrayidx42, align 8, !tbaa !5
br label %for.inc43
for.inc43: ; preds = %for.body30, %if.then
%inc40291 = phi i32 [ %inc40292294, %for.body30 ], [ %inc40, %if.then ]
%indvars.iv.next313 = add nuw nsw i64 %indvars.iv312, 1
%exitcond.not = icmp eq i64 %indvars.iv.next313, %wide.trip.count
br i1 %exitcond.not, label %for.end45, label %for.body30, !llvm.loop !21
for.end45: ; preds = %for.inc43
%cmp.not21.i = icmp slt i32 %inc40291, 1
br i1 %cmp.not21.i, label %get_ekiid.exit178, label %while.body.preheader.i
while.body.preheader.i: ; preds = %for.end, %for.end45
%12 = phi i32 [ %inc40291, %for.end45 ], [ 1, %for.end ]
%sub.i = add nsw i32 %12, -1
br label %while.body.i
while.body.i: ; preds = %cleanup.i, %while.body.preheader.i
%left.023.i = phi i32 [ %left.1.i, %cleanup.i ], [ 0, %while.body.preheader.i ]
%right.022.i = phi i32 [ %right.1.i, %cleanup.i ], [ %sub.i, %while.body.preheader.i ]
%add.i = add nsw i32 %right.022.i, %left.023.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds [500 x ptr], ptr @ekilist, i64 0, i64 %idxprom.i
%13 = load ptr, ptr %arrayidx.i, align 8, !tbaa !5
%call.i = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @s, ptr noundef nonnull dereferenceable(1) %13) #9
%cmp2.not.i = icmp eq i32 %call.i, 0
br i1 %cmp2.not.i, label %get_ekiid.exit, label %cleanup.i
cleanup.i: ; preds = %while.body.i
%cmp3.i = icmp slt i32 %call.i, 0
%sub5.i = add nsw i32 %div.i, -1
%add7.i = add nsw i32 %div.i, 1
%right.1.i = select i1 %cmp3.i, i32 %sub5.i, i32 %right.022.i
%left.1.i = select i1 %cmp3.i, i32 %left.023.i, i32 %add7.i
%cmp.not.i = icmp sgt i32 %left.1.i, %right.1.i
br i1 %cmp.not.i, label %get_ekiid.exit, label %while.body.i, !llvm.loop !11
get_ekiid.exit: ; preds = %while.body.i, %cleanup.i
%retval.2.i = phi i32 [ %div.i, %while.body.i ], [ %12, %cleanup.i ]
br label %while.body.i140
while.body.i140: ; preds = %cleanup.i149, %get_ekiid.exit
%left.023.i141 = phi i32 [ %left.1.i154, %cleanup.i149 ], [ 0, %get_ekiid.exit ]
%right.022.i142 = phi i32 [ %right.1.i153, %cleanup.i149 ], [ %sub.i, %get_ekiid.exit ]
%add.i143 = add nsw i32 %right.022.i142, %left.023.i141
%div.i144 = sdiv i32 %add.i143, 2
%idxprom.i145 = sext i32 %div.i144 to i64
%arrayidx.i146 = getelementptr inbounds [500 x ptr], ptr @ekilist, i64 0, i64 %idxprom.i145
%14 = load ptr, ptr %arrayidx.i146, align 8, !tbaa !5
%call.i147 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @p, ptr noundef nonnull dereferenceable(1) %14) #9
%cmp2.not.i148 = icmp eq i32 %call.i147, 0
br i1 %cmp2.not.i148, label %get_ekiid.exit157, label %cleanup.i149
cleanup.i149: ; preds = %while.body.i140
%cmp3.i150 = icmp slt i32 %call.i147, 0
%sub5.i151 = add nsw i32 %div.i144, -1
%add7.i152 = add nsw i32 %div.i144, 1
%right.1.i153 = select i1 %cmp3.i150, i32 %sub5.i151, i32 %right.022.i142
%left.1.i154 = select i1 %cmp3.i150, i32 %left.023.i141, i32 %add7.i152
%cmp.not.i155 = icmp sgt i32 %left.1.i154, %right.1.i153
br i1 %cmp.not.i155, label %get_ekiid.exit157, label %while.body.i140, !llvm.loop !11
get_ekiid.exit157: ; preds = %while.body.i140, %cleanup.i149
%retval.2.i156 = phi i32 [ %div.i144, %while.body.i140 ], [ %12, %cleanup.i149 ]
br label %while.body.i161
while.body.i161: ; preds = %cleanup.i170, %get_ekiid.exit157
%left.023.i162 = phi i32 [ %left.1.i175, %cleanup.i170 ], [ 0, %get_ekiid.exit157 ]
%right.022.i163 = phi i32 [ %right.1.i174, %cleanup.i170 ], [ %sub.i, %get_ekiid.exit157 ]
%add.i164 = add nsw i32 %right.022.i163, %left.023.i162
%div.i165 = sdiv i32 %add.i164, 2
%idxprom.i166 = sext i32 %div.i165 to i64
%arrayidx.i167 = getelementptr inbounds [500 x ptr], ptr @ekilist, i64 0, i64 %idxprom.i166
%15 = load ptr, ptr %arrayidx.i167, align 8, !tbaa !5
%call.i168 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @g, ptr noundef nonnull dereferenceable(1) %15) #9
%cmp2.not.i169 = icmp eq i32 %call.i168, 0
br i1 %cmp2.not.i169, label %get_ekiid.exit178, label %cleanup.i170
cleanup.i170: ; preds = %while.body.i161
%cmp3.i171 = icmp slt i32 %call.i168, 0
%sub5.i172 = add nsw i32 %div.i165, -1
%add7.i173 = add nsw i32 %div.i165, 1
%right.1.i174 = select i1 %cmp3.i171, i32 %sub5.i172, i32 %right.022.i163
%left.1.i175 = select i1 %cmp3.i171, i32 %left.023.i162, i32 %add7.i173
%cmp.not.i176 = icmp sgt i32 %left.1.i175, %right.1.i174
br i1 %cmp.not.i176, label %get_ekiid.exit178, label %while.body.i161, !llvm.loop !11
get_ekiid.exit178: ; preds = %while.body.i161, %cleanup.i170, %for.end45
%cmp.not21.i333 = phi i1 [ true, %for.end45 ], [ false, %cleanup.i170 ], [ false, %while.body.i161 ]
%16 = phi i32 [ %inc40291, %for.end45 ], [ %12, %cleanup.i170 ], [ %12, %while.body.i161 ]
%retval.2.i156280 = phi i32 [ %inc40291, %for.end45 ], [ %retval.2.i156, %cleanup.i170 ], [ %retval.2.i156, %while.body.i161 ]
%retval.2.i276279 = phi i32 [ %inc40291, %for.end45 ], [ %retval.2.i, %cleanup.i170 ], [ %retval.2.i, %while.body.i161 ]
%retval.2.i177 = phi i32 [ %inc40291, %for.end45 ], [ %div.i165, %while.body.i161 ], [ %12, %cleanup.i170 ]
%17 = load i32, ptr @n, align 4, !tbaa !9
%cmp50299 = icmp sgt i32 %17, 0
br i1 %cmp50299, label %for.cond53.preheader.us.preheader, label %for.cond69.preheader
for.cond53.preheader.us.preheader: ; preds = %get_ekiid.exit178
%wide.trip.count324 = zext i32 %17 to i64
%min.iters.check349 = icmp ult i32 %17, 8
%n.vec352 = and i64 %wide.trip.count324, 4294967288
%cmp.n354 = icmp eq i64 %n.vec352, %wide.trip.count324
br label %for.cond53.preheader.us
for.cond53.preheader.us: ; preds = %for.cond53.preheader.us.preheader, %for.cond53.for.inc66_crit_edge.us
%indvars.iv321 = phi i64 [ 0, %for.cond53.preheader.us.preheader ], [ %indvars.iv.next322, %for.cond53.for.inc66_crit_edge.us ]
br i1 %min.iters.check349, label %for.body56.us.preheader, label %vector.ph350
vector.ph350: ; preds = %for.cond53.preheader.us
%broadcast.splatinsert = insertelement <4 x i64> poison, i64 %indvars.iv321, i64 0
%broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
br label %vector.body355
vector.body355: ; preds = %vector.body355, %vector.ph350
%index356 = phi i64 [ 0, %vector.ph350 ], [ %index.next358, %vector.body355 ]
%vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph350 ], [ %vec.ind.next, %vector.body355 ]
%step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
%18 = icmp eq <4 x i64> %broadcast.splat, %vec.ind
%19 = icmp eq <4 x i64> %broadcast.splat, %step.add
%20 = select <4 x i1> %18, <4 x i32> zeroinitializer, <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>
%21 = select <4 x i1> %19, <4 x i32> zeroinitializer, <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>
%22 = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %indvars.iv321, i64 %index356
store <4 x i32> %20, ptr %22, align 8, !tbaa !9
%23 = getelementptr inbounds i32, ptr %22, i64 4
store <4 x i32> %21, ptr %23, align 8, !tbaa !9
%index.next358 = add nuw i64 %index356, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%24 = icmp eq i64 %index.next358, %n.vec352
br i1 %24, label %middle.block347, label %vector.body355, !llvm.loop !22
middle.block347: ; preds = %vector.body355
br i1 %cmp.n354, label %for.cond53.for.inc66_crit_edge.us, label %for.body56.us.preheader
for.body56.us.preheader: ; preds = %for.cond53.preheader.us, %middle.block347
%indvars.iv316.ph = phi i64 [ 0, %for.cond53.preheader.us ], [ %n.vec352, %middle.block347 ]
br label %for.body56.us
for.body56.us: ; preds = %for.body56.us.preheader, %for.body56.us
%indvars.iv316 = phi i64 [ %indvars.iv.next317, %for.body56.us ], [ %indvars.iv316.ph, %for.body56.us.preheader ]
%cmp57.us = icmp eq i64 %indvars.iv321, %indvars.iv316
%cond.us = select i1 %cmp57.us, i32 0, i32 100000000
%arrayidx62.us = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %indvars.iv321, i64 %indvars.iv316
store i32 %cond.us, ptr %arrayidx62.us, align 4, !tbaa !9
%indvars.iv.next317 = add nuw nsw i64 %indvars.iv316, 1
%exitcond320.not = icmp eq i64 %indvars.iv.next317, %wide.trip.count324
br i1 %exitcond320.not, label %for.cond53.for.inc66_crit_edge.us, label %for.body56.us, !llvm.loop !23
for.cond53.for.inc66_crit_edge.us: ; preds = %for.body56.us, %middle.block347
%indvars.iv.next322 = add nuw nsw i64 %indvars.iv321, 1
%exitcond325.not = icmp eq i64 %indvars.iv.next322, %wide.trip.count324
br i1 %exitcond325.not, label %for.cond69.preheader, label %for.cond53.preheader.us, !llvm.loop !24
for.cond69.preheader: ; preds = %for.cond53.for.inc66_crit_edge.us, %get_ekiid.exit178
br i1 %cmp28293, label %for.body72.lr.ph, label %for.end102
for.body72.lr.ph: ; preds = %for.cond69.preheader
%sub.i181 = add nsw i32 %16, -1
%wide.trip.count329 = zext i32 %9 to i64
br label %for.body72
for.body72: ; preds = %for.body72.lr.ph, %get_ekiid.exit220
%indvars.iv326 = phi i64 [ 0, %for.body72.lr.ph ], [ %indvars.iv.next327, %get_ekiid.exit220 ]
%arrayidx75 = getelementptr inbounds [5000 x %struct.senro_t], ptr @senro, i64 0, i64 %indvars.iv326
br i1 %cmp.not21.i333, label %get_ekiid.exit220, label %while.body.i182
while.body.i182: ; preds = %for.body72, %cleanup.i191
%left.023.i183 = phi i32 [ %left.1.i196, %cleanup.i191 ], [ 0, %for.body72 ]
%right.022.i184 = phi i32 [ %right.1.i195, %cleanup.i191 ], [ %sub.i181, %for.body72 ]
%add.i185 = add nsw i32 %right.022.i184, %left.023.i183
%div.i186 = sdiv i32 %add.i185, 2
%idxprom.i187 = sext i32 %div.i186 to i64
%arrayidx.i188 = getelementptr inbounds [500 x ptr], ptr @ekilist, i64 0, i64 %idxprom.i187
%25 = load ptr, ptr %arrayidx.i188, align 8, !tbaa !5
%call.i189 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx75, ptr noundef nonnull dereferenceable(1) %25) #9
%cmp2.not.i190 = icmp eq i32 %call.i189, 0
br i1 %cmp2.not.i190, label %get_ekiid.exit199, label %cleanup.i191
cleanup.i191: ; preds = %while.body.i182
%cmp3.i192 = icmp slt i32 %call.i189, 0
%sub5.i193 = add nsw i32 %div.i186, -1
%add7.i194 = add nsw i32 %div.i186, 1
%right.1.i195 = select i1 %cmp3.i192, i32 %sub5.i193, i32 %right.022.i184
%left.1.i196 = select i1 %cmp3.i192, i32 %left.023.i183, i32 %add7.i194
%cmp.not.i197 = icmp sgt i32 %left.1.i196, %right.1.i195
br i1 %cmp.not.i197, label %get_ekiid.exit199, label %while.body.i182, !llvm.loop !11
get_ekiid.exit199: ; preds = %while.body.i182, %cleanup.i191
%retval.2.i198 = phi i32 [ %div.i186, %while.body.i182 ], [ %16, %cleanup.i191 ]
%b82 = getelementptr inbounds [5000 x %struct.senro_t], ptr @senro, i64 0, i64 %indvars.iv326, i32 1
br label %while.body.i203
while.body.i203: ; preds = %cleanup.i212, %get_ekiid.exit199
%left.023.i204 = phi i32 [ %left.1.i217, %cleanup.i212 ], [ 0, %get_ekiid.exit199 ]
%right.022.i205 = phi i32 [ %right.1.i216, %cleanup.i212 ], [ %sub.i181, %get_ekiid.exit199 ]
%add.i206 = add nsw i32 %right.022.i205, %left.023.i204
%div.i207 = sdiv i32 %add.i206, 2
%idxprom.i208 = sext i32 %div.i207 to i64
%arrayidx.i209 = getelementptr inbounds [500 x ptr], ptr @ekilist, i64 0, i64 %idxprom.i208
%26 = load ptr, ptr %arrayidx.i209, align 8, !tbaa !5
%call.i210 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b82, ptr noundef nonnull dereferenceable(1) %26) #9
%cmp2.not.i211 = icmp eq i32 %call.i210, 0
br i1 %cmp2.not.i211, label %get_ekiid.exit220, label %cleanup.i212
cleanup.i212: ; preds = %while.body.i203
%cmp3.i213 = icmp slt i32 %call.i210, 0
%sub5.i214 = add nsw i32 %div.i207, -1
%add7.i215 = add nsw i32 %div.i207, 1
%right.1.i216 = select i1 %cmp3.i213, i32 %sub5.i214, i32 %right.022.i205
%left.1.i217 = select i1 %cmp3.i213, i32 %left.023.i204, i32 %add7.i215
%cmp.not.i218 = icmp sgt i32 %left.1.i217, %right.1.i216
br i1 %cmp.not.i218, label %get_ekiid.exit220, label %while.body.i203, !llvm.loop !11
get_ekiid.exit220: ; preds = %while.body.i203, %cleanup.i212, %for.body72
%retval.2.i198283 = phi i32 [ %16, %for.body72 ], [ %retval.2.i198, %cleanup.i212 ], [ %retval.2.i198, %while.body.i203 ]
%retval.2.i219 = phi i32 [ %16, %for.body72 ], [ %div.i207, %while.body.i203 ], [ %16, %cleanup.i212 ]
%d87 = getelementptr inbounds [5000 x %struct.senro_t], ptr @senro, i64 0, i64 %indvars.iv326, i32 2
%27 = load i32, ptr %d87, align 8, !tbaa !25
%div = sdiv i32 %27, 40
%t90 = getelementptr inbounds [5000 x %struct.senro_t], ptr @senro, i64 0, i64 %indvars.iv326, i32 3
%28 = load i32, ptr %t90, align 4, !tbaa !27
%add91 = add nsw i32 %div, %28
%idxprom92 = sext i32 %retval.2.i219 to i64
%idxprom94 = sext i32 %retval.2.i198283 to i64
%arrayidx95 = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom92, i64 %idxprom94
store i32 %add91, ptr %arrayidx95, align 4, !tbaa !9
%arrayidx99 = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom94, i64 %idxprom92
store i32 %add91, ptr %arrayidx99, align 4, !tbaa !9
%indvars.iv.next327 = add nuw nsw i64 %indvars.iv326, 1
%exitcond330.not = icmp eq i64 %indvars.iv.next327, %wide.trip.count329
br i1 %exitcond330.not, label %for.end102, label %for.body72, !llvm.loop !28
for.end102: ; preds = %get_ekiid.exit220, %for.cond69.preheader
br i1 %cmp50299, label %for.body.preheader.i, label %tansaku.exit.thread
tansaku.exit.thread: ; preds = %for.end102
%idxprom3116.i = sext i32 %retval.2.i276279 to i64
%arrayidx4117.i = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom3116.i
store i32 0, ptr %arrayidx4117.i, align 4, !tbaa !9
%idxprom52.i284 = sext i32 %retval.2.i156280 to i64
%arrayidx53.i285 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom52.i284
%29 = load i32, ptr %arrayidx53.i285, align 4, !tbaa !9
store i32 0, ptr %arrayidx53.i285, align 4, !tbaa !9
br label %tansaku.exit274
for.body.preheader.i: ; preds = %for.end102
%30 = zext i32 %17 to i64
%31 = shl nuw nsw i64 %30, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @kakutei, i8 0, i64 %31, i1 false), !tbaa !9
%min.iters.check338 = icmp ult i32 %17, 8
br i1 %min.iters.check338, label %for.body.i.preheader, label %vector.ph339
vector.ph339: ; preds = %for.body.preheader.i
%n.vec341 = and i64 %30, 4294967288
br label %vector.body344
vector.body344: ; preds = %vector.body344, %vector.ph339
%index345 = phi i64 [ 0, %vector.ph339 ], [ %index.next346, %vector.body344 ]
%32 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %index345
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %32, align 16, !tbaa !9
%33 = getelementptr inbounds i32, ptr %32, i64 4
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %33, align 16, !tbaa !9
%index.next346 = add nuw i64 %index345, 8
%34 = icmp eq i64 %index.next346, %n.vec341
br i1 %34, label %middle.block336, label %vector.body344, !llvm.loop !29
middle.block336: ; preds = %vector.body344
%cmp.n343 = icmp eq i64 %n.vec341, %30
br i1 %cmp.n343, label %for.cond8.preheader.us.us.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block336
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec341, %middle.block336 ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%arrayidx.i221 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv.i
store i32 100000000, ptr %arrayidx.i221, align 4, !tbaa !9
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %30
br i1 %exitcond.not.i, label %for.cond8.preheader.us.us.preheader.i, label %for.body.i, !llvm.loop !30
for.cond8.preheader.us.us.preheader.i: ; preds = %for.body.i, %middle.block336
%idxprom3.i = sext i32 %retval.2.i276279 to i64
%arrayidx4.i = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom3.i
store i32 0, ptr %arrayidx4.i, align 4, !tbaa !9
%35 = add nsw i64 %30, -1
%xtraiter = and i64 %30, 1
%36 = icmp eq i64 %35, 0
%unroll_iter = and i64 %30, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%xtraiter361 = and i64 %30, 1
%37 = icmp eq i64 %35, 0
%unroll_iter363 = and i64 %30, 4294967294
%lcmp.mod362.not = icmp eq i64 %xtraiter361, 0
br label %for.cond8.preheader.us.us.i
for.cond8.preheader.us.us.i: ; preds = %for.cond23.for.end48_crit_edge.us.us.i, %for.cond8.preheader.us.us.preheader.i
%i.185.us.us.i = phi i32 [ %inc50.us.us.i, %for.cond23.for.end48_crit_edge.us.us.i ], [ 0, %for.cond8.preheader.us.us.preheader.i ]
br i1 %36, label %for.cond8.for.end20_crit_edge.us.us.i.unr-lcssa, label %for.body10.us.us.i
for.body25.us.us.i: ; preds = %for.cond8.for.end20_crit_edge.us.us.i, %for.inc46.us.us.i.1
%indvars.iv110.i = phi i64 [ %indvars.iv.next111.i.1, %for.inc46.us.us.i.1 ], [ 0, %for.cond8.for.end20_crit_edge.us.us.i ]
%niter364 = phi i64 [ %niter364.next.1, %for.inc46.us.us.i.1 ], [ 0, %for.cond8.for.end20_crit_edge.us.us.i ]
%38 = load i32, ptr %arrayidx27.us.us.i, align 4, !tbaa !9
%arrayidx31.us.us.i = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us.i, i64 %indvars.iv110.i
%39 = load i32, ptr %arrayidx31.us.us.i, align 8, !tbaa !9
%add.us.us.i = add nsw i32 %39, %38
%arrayidx33.us.us.i = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv110.i
%40 = load i32, ptr %arrayidx33.us.us.i, align 8, !tbaa !9
%cmp34.us.us.i = icmp slt i32 %add.us.us.i, %40
br i1 %cmp34.us.us.i, label %if.then35.us.us.i, label %for.inc46.us.us.i
if.then35.us.us.i: ; preds = %for.body25.us.us.i
store i32 %add.us.us.i, ptr %arrayidx33.us.us.i, align 8, !tbaa !9
br label %for.inc46.us.us.i
for.inc46.us.us.i: ; preds = %if.then35.us.us.i, %for.body25.us.us.i
%indvars.iv.next111.i = or i64 %indvars.iv110.i, 1
%41 = load i32, ptr %arrayidx27.us.us.i, align 4, !tbaa !9
%arrayidx31.us.us.i.1 = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us.i, i64 %indvars.iv.next111.i
%42 = load i32, ptr %arrayidx31.us.us.i.1, align 4, !tbaa !9
%add.us.us.i.1 = add nsw i32 %42, %41
%arrayidx33.us.us.i.1 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv.next111.i
%43 = load i32, ptr %arrayidx33.us.us.i.1, align 4, !tbaa !9
%cmp34.us.us.i.1 = icmp slt i32 %add.us.us.i.1, %43
br i1 %cmp34.us.us.i.1, label %if.then35.us.us.i.1, label %for.inc46.us.us.i.1
if.then35.us.us.i.1: ; preds = %for.inc46.us.us.i
store i32 %add.us.us.i.1, ptr %arrayidx33.us.us.i.1, align 4, !tbaa !9
br label %for.inc46.us.us.i.1
for.inc46.us.us.i.1: ; preds = %if.then35.us.us.i.1, %for.inc46.us.us.i
%indvars.iv.next111.i.1 = add nuw nsw i64 %indvars.iv110.i, 2
%niter364.next.1 = add i64 %niter364, 2
%niter364.ncmp.1 = icmp eq i64 %niter364.next.1, %unroll_iter363
br i1 %niter364.ncmp.1, label %for.cond23.for.end48_crit_edge.us.us.i.unr-lcssa, label %for.body25.us.us.i, !llvm.loop !17
for.body10.us.us.i: ; preds = %for.cond8.preheader.us.us.i, %for.inc18.us.us.i.1
%indvars.iv105.i = phi i64 [ %indvars.iv.next106.i.1, %for.inc18.us.us.i.1 ], [ 0, %for.cond8.preheader.us.us.i ]
%minresult.079.us.us.i = phi i32 [ %minresult.1.us.us.i.1, %for.inc18.us.us.i.1 ], [ 100000000, %for.cond8.preheader.us.us.i ]
%minst.078.us.us.i = phi i32 [ %minst.1.us.us.i.1, %for.inc18.us.us.i.1 ], [ 0, %for.cond8.preheader.us.us.i ]
%niter = phi i64 [ %niter.next.1, %for.inc18.us.us.i.1 ], [ 0, %for.cond8.preheader.us.us.i ]
%arrayidx12.us.us.i = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv105.i
%44 = load i32, ptr %arrayidx12.us.us.i, align 8, !tbaa !9
%tobool.not.us.us.i = icmp eq i32 %44, 0
br i1 %tobool.not.us.us.i, label %land.lhs.true.us.us.i, label %for.inc18.us.us.i
land.lhs.true.us.us.i: ; preds = %for.body10.us.us.i
%arrayidx14.us.us.i = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv105.i
%45 = load i32, ptr %arrayidx14.us.us.i, align 8, !tbaa !9
%cmp15.us.us.i = icmp slt i32 %45, %minresult.079.us.us.i
%46 = trunc i64 %indvars.iv105.i to i32
%spec.select.us.us.i = select i1 %cmp15.us.us.i, i32 %46, i32 %minst.078.us.us.i
%spec.select74.us.us.i = tail call i32 @llvm.smin.i32(i32 %45, i32 %minresult.079.us.us.i)
br label %for.inc18.us.us.i
for.inc18.us.us.i: ; preds = %land.lhs.true.us.us.i, %for.body10.us.us.i
%minst.1.us.us.i = phi i32 [ %minst.078.us.us.i, %for.body10.us.us.i ], [ %spec.select.us.us.i, %land.lhs.true.us.us.i ]
%minresult.1.us.us.i = phi i32 [ %minresult.079.us.us.i, %for.body10.us.us.i ], [ %spec.select74.us.us.i, %land.lhs.true.us.us.i ]
%indvars.iv.next106.i = or i64 %indvars.iv105.i, 1
%arrayidx12.us.us.i.1 = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv.next106.i
%47 = load i32, ptr %arrayidx12.us.us.i.1, align 4, !tbaa !9
%tobool.not.us.us.i.1 = icmp eq i32 %47, 0
br i1 %tobool.not.us.us.i.1, label %land.lhs.true.us.us.i.1, label %for.inc18.us.us.i.1
land.lhs.true.us.us.i.1: ; preds = %for.inc18.us.us.i
%arrayidx14.us.us.i.1 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv.next106.i
%48 = load i32, ptr %arrayidx14.us.us.i.1, align 4, !tbaa !9
%cmp15.us.us.i.1 = icmp slt i32 %48, %minresult.1.us.us.i
%49 = trunc i64 %indvars.iv.next106.i to i32
%spec.select.us.us.i.1 = select i1 %cmp15.us.us.i.1, i32 %49, i32 %minst.1.us.us.i
%spec.select74.us.us.i.1 = tail call i32 @llvm.smin.i32(i32 %48, i32 %minresult.1.us.us.i)
br label %for.inc18.us.us.i.1
for.inc18.us.us.i.1: ; preds = %land.lhs.true.us.us.i.1, %for.inc18.us.us.i
%minst.1.us.us.i.1 = phi i32 [ %minst.1.us.us.i, %for.inc18.us.us.i ], [ %spec.select.us.us.i.1, %land.lhs.true.us.us.i.1 ]
%minresult.1.us.us.i.1 = phi i32 [ %minresult.1.us.us.i, %for.inc18.us.us.i ], [ %spec.select74.us.us.i.1, %land.lhs.true.us.us.i.1 ]
%indvars.iv.next106.i.1 = add nuw nsw i64 %indvars.iv105.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond8.for.end20_crit_edge.us.us.i.unr-lcssa, label %for.body10.us.us.i, !llvm.loop !18
for.cond8.for.end20_crit_edge.us.us.i.unr-lcssa: ; preds = %for.inc18.us.us.i.1, %for.cond8.preheader.us.us.i
%minst.1.us.us.i.lcssa.ph = phi i32 [ undef, %for.cond8.preheader.us.us.i ], [ %minst.1.us.us.i.1, %for.inc18.us.us.i.1 ]
%indvars.iv105.i.unr = phi i64 [ 0, %for.cond8.preheader.us.us.i ], [ %indvars.iv.next106.i.1, %for.inc18.us.us.i.1 ]
%minresult.079.us.us.i.unr = phi i32 [ 100000000, %for.cond8.preheader.us.us.i ], [ %minresult.1.us.us.i.1, %for.inc18.us.us.i.1 ]
%minst.078.us.us.i.unr = phi i32 [ 0, %for.cond8.preheader.us.us.i ], [ %minst.1.us.us.i.1, %for.inc18.us.us.i.1 ]
br i1 %lcmp.mod.not, label %for.cond8.for.end20_crit_edge.us.us.i, label %for.body10.us.us.i.epil
for.body10.us.us.i.epil: ; preds = %for.cond8.for.end20_crit_edge.us.us.i.unr-lcssa
%arrayidx12.us.us.i.epil = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv105.i.unr
%50 = load i32, ptr %arrayidx12.us.us.i.epil, align 4, !tbaa !9
%tobool.not.us.us.i.epil = icmp eq i32 %50, 0
br i1 %tobool.not.us.us.i.epil, label %land.lhs.true.us.us.i.epil, label %for.cond8.for.end20_crit_edge.us.us.i
land.lhs.true.us.us.i.epil: ; preds = %for.body10.us.us.i.epil
%arrayidx14.us.us.i.epil = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv105.i.unr
%51 = load i32, ptr %arrayidx14.us.us.i.epil, align 4, !tbaa !9
%cmp15.us.us.i.epil = icmp slt i32 %51, %minresult.079.us.us.i.unr
%52 = trunc i64 %indvars.iv105.i.unr to i32
%spec.select.us.us.i.epil = select i1 %cmp15.us.us.i.epil, i32 %52, i32 %minst.078.us.us.i.unr
br label %for.cond8.for.end20_crit_edge.us.us.i
for.cond8.for.end20_crit_edge.us.us.i: ; preds = %for.body10.us.us.i.epil, %land.lhs.true.us.us.i.epil, %for.cond8.for.end20_crit_edge.us.us.i.unr-lcssa
%minst.1.us.us.i.lcssa = phi i32 [ %minst.1.us.us.i.lcssa.ph, %for.cond8.for.end20_crit_edge.us.us.i.unr-lcssa ], [ %minst.078.us.us.i.unr, %for.body10.us.us.i.epil ], [ %spec.select.us.us.i.epil, %land.lhs.true.us.us.i.epil ]
%idxprom21.us.us.i = sext i32 %minst.1.us.us.i.lcssa to i64
%arrayidx22.us.us.i = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %idxprom21.us.us.i
store i32 1, ptr %arrayidx22.us.us.i, align 4, !tbaa !9
%arrayidx27.us.us.i = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom21.us.us.i
br i1 %37, label %for.cond23.for.end48_crit_edge.us.us.i.unr-lcssa, label %for.body25.us.us.i
for.cond23.for.end48_crit_edge.us.us.i.unr-lcssa: ; preds = %for.inc46.us.us.i.1, %for.cond8.for.end20_crit_edge.us.us.i
%indvars.iv110.i.unr = phi i64 [ 0, %for.cond8.for.end20_crit_edge.us.us.i ], [ %indvars.iv.next111.i.1, %for.inc46.us.us.i.1 ]
br i1 %lcmp.mod362.not, label %for.cond23.for.end48_crit_edge.us.us.i, label %for.body25.us.us.i.epil
for.body25.us.us.i.epil: ; preds = %for.cond23.for.end48_crit_edge.us.us.i.unr-lcssa
%53 = load i32, ptr %arrayidx27.us.us.i, align 4, !tbaa !9
%arrayidx31.us.us.i.epil = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us.i, i64 %indvars.iv110.i.unr
%54 = load i32, ptr %arrayidx31.us.us.i.epil, align 4, !tbaa !9
%add.us.us.i.epil = add nsw i32 %54, %53
%arrayidx33.us.us.i.epil = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv110.i.unr
%55 = load i32, ptr %arrayidx33.us.us.i.epil, align 4, !tbaa !9
%cmp34.us.us.i.epil = icmp slt i32 %add.us.us.i.epil, %55
br i1 %cmp34.us.us.i.epil, label %if.then35.us.us.i.epil, label %for.cond23.for.end48_crit_edge.us.us.i
if.then35.us.us.i.epil: ; preds = %for.body25.us.us.i.epil
store i32 %add.us.us.i.epil, ptr %arrayidx33.us.us.i.epil, align 4, !tbaa !9
br label %for.cond23.for.end48_crit_edge.us.us.i
for.cond23.for.end48_crit_edge.us.us.i: ; preds = %for.body25.us.us.i.epil, %if.then35.us.us.i.epil, %for.cond23.for.end48_crit_edge.us.us.i.unr-lcssa
%inc50.us.us.i = add nuw nsw i32 %i.185.us.us.i, 1
%exitcond115.not.i = icmp eq i32 %inc50.us.us.i, %17
br i1 %exitcond115.not.i, label %tansaku.exit, label %for.cond8.preheader.us.us.i, !llvm.loop !19
tansaku.exit: ; preds = %for.cond23.for.end48_crit_edge.us.us.i
%idxprom52.i = sext i32 %retval.2.i156280 to i64
%arrayidx53.i = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom52.i
%56 = load i32, ptr %arrayidx53.i, align 4, !tbaa !9
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @kakutei, i8 0, i64 %31, i1 false), !tbaa !9
%min.iters.check = icmp ult i32 %17, 8
br i1 %min.iters.check, label %for.body.i229.preheader, label %vector.ph
vector.ph: ; preds = %tansaku.exit
%n.vec = and i64 %30, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%57 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %index
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %57, align 16, !tbaa !9
%58 = getelementptr inbounds i32, ptr %57, i64 4
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %58, align 16, !tbaa !9
%index.next = add nuw i64 %index, 8
%59 = icmp eq i64 %index.next, %n.vec
br i1 %59, label %middle.block, label %vector.body, !llvm.loop !31
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %30
br i1 %cmp.n, label %for.cond8.preheader.us.us.preheader.i237, label %for.body.i229.preheader
for.body.i229.preheader: ; preds = %tansaku.exit, %middle.block
%indvars.iv.i230.ph = phi i64 [ 0, %tansaku.exit ], [ %n.vec, %middle.block ]
br label %for.body.i229
for.body.i229: ; preds = %for.body.i229.preheader, %for.body.i229
%indvars.iv.i230 = phi i64 [ %indvars.iv.next.i232, %for.body.i229 ], [ %indvars.iv.i230.ph, %for.body.i229.preheader ]
%arrayidx.i231 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv.i230
store i32 100000000, ptr %arrayidx.i231, align 4, !tbaa !9
%indvars.iv.next.i232 = add nuw nsw i64 %indvars.iv.i230, 1
%exitcond.not.i233 = icmp eq i64 %indvars.iv.next.i232, %30
br i1 %exitcond.not.i233, label %for.cond8.preheader.us.us.preheader.i237, label %for.body.i229, !llvm.loop !32
for.cond8.preheader.us.us.preheader.i237: ; preds = %for.body.i229, %middle.block
store i32 0, ptr %arrayidx53.i, align 4, !tbaa !9
%xtraiter365 = and i64 %30, 1
%60 = icmp eq i64 %35, 0
%unroll_iter368 = and i64 %30, 4294967294
%lcmp.mod366.not = icmp eq i64 %xtraiter365, 0
%xtraiter370 = and i64 %30, 1
%61 = icmp eq i64 %35, 0
%unroll_iter372 = and i64 %30, 4294967294
%lcmp.mod371.not = icmp eq i64 %xtraiter370, 0
br label %for.cond8.preheader.us.us.i239
for.cond8.preheader.us.us.i239: ; preds = %for.cond23.for.end48_crit_edge.us.us.i265, %for.cond8.preheader.us.us.preheader.i237
%i.185.us.us.i240 = phi i32 [ %inc50.us.us.i266, %for.cond23.for.end48_crit_edge.us.us.i265 ], [ 0, %for.cond8.preheader.us.us.preheader.i237 ]
br i1 %60, label %for.cond8.for.end20_crit_edge.us.us.i252.unr-lcssa, label %for.body10.us.us.i241
for.body25.us.us.i256: ; preds = %for.cond8.for.end20_crit_edge.us.us.i252, %for.inc46.us.us.i262.1
%indvars.iv110.i257 = phi i64 [ %indvars.iv.next111.i263.1, %for.inc46.us.us.i262.1 ], [ 0, %for.cond8.for.end20_crit_edge.us.us.i252 ]
%niter373 = phi i64 [ %niter373.next.1, %for.inc46.us.us.i262.1 ], [ 0, %for.cond8.for.end20_crit_edge.us.us.i252 ]
%62 = load i32, ptr %arrayidx27.us.us.i255, align 4, !tbaa !9
%arrayidx31.us.us.i258 = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us.i253, i64 %indvars.iv110.i257
%63 = load i32, ptr %arrayidx31.us.us.i258, align 8, !tbaa !9
%add.us.us.i259 = add nsw i32 %63, %62
%arrayidx33.us.us.i260 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv110.i257
%64 = load i32, ptr %arrayidx33.us.us.i260, align 8, !tbaa !9
%cmp34.us.us.i261 = icmp slt i32 %add.us.us.i259, %64
br i1 %cmp34.us.us.i261, label %if.then35.us.us.i268, label %for.inc46.us.us.i262
if.then35.us.us.i268: ; preds = %for.body25.us.us.i256
store i32 %add.us.us.i259, ptr %arrayidx33.us.us.i260, align 8, !tbaa !9
br label %for.inc46.us.us.i262
for.inc46.us.us.i262: ; preds = %if.then35.us.us.i268, %for.body25.us.us.i256
%indvars.iv.next111.i263 = or i64 %indvars.iv110.i257, 1
%65 = load i32, ptr %arrayidx27.us.us.i255, align 4, !tbaa !9
%arrayidx31.us.us.i258.1 = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us.i253, i64 %indvars.iv.next111.i263
%66 = load i32, ptr %arrayidx31.us.us.i258.1, align 4, !tbaa !9
%add.us.us.i259.1 = add nsw i32 %66, %65
%arrayidx33.us.us.i260.1 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv.next111.i263
%67 = load i32, ptr %arrayidx33.us.us.i260.1, align 4, !tbaa !9
%cmp34.us.us.i261.1 = icmp slt i32 %add.us.us.i259.1, %67
br i1 %cmp34.us.us.i261.1, label %if.then35.us.us.i268.1, label %for.inc46.us.us.i262.1
if.then35.us.us.i268.1: ; preds = %for.inc46.us.us.i262
store i32 %add.us.us.i259.1, ptr %arrayidx33.us.us.i260.1, align 4, !tbaa !9
br label %for.inc46.us.us.i262.1
for.inc46.us.us.i262.1: ; preds = %if.then35.us.us.i268.1, %for.inc46.us.us.i262
%indvars.iv.next111.i263.1 = add nuw nsw i64 %indvars.iv110.i257, 2
%niter373.next.1 = add i64 %niter373, 2
%niter373.ncmp.1 = icmp eq i64 %niter373.next.1, %unroll_iter372
br i1 %niter373.ncmp.1, label %for.cond23.for.end48_crit_edge.us.us.i265.unr-lcssa, label %for.body25.us.us.i256, !llvm.loop !17
for.body10.us.us.i241: ; preds = %for.cond8.preheader.us.us.i239, %for.inc18.us.us.i247.1
%indvars.iv105.i242 = phi i64 [ %indvars.iv.next106.i250.1, %for.inc18.us.us.i247.1 ], [ 0, %for.cond8.preheader.us.us.i239 ]
%minresult.079.us.us.i243 = phi i32 [ %minresult.1.us.us.i249.1, %for.inc18.us.us.i247.1 ], [ 100000000, %for.cond8.preheader.us.us.i239 ]
%minst.078.us.us.i244 = phi i32 [ %minst.1.us.us.i248.1, %for.inc18.us.us.i247.1 ], [ 0, %for.cond8.preheader.us.us.i239 ]
%niter369 = phi i64 [ %niter369.next.1, %for.inc18.us.us.i247.1 ], [ 0, %for.cond8.preheader.us.us.i239 ]
%arrayidx12.us.us.i245 = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv105.i242
%68 = load i32, ptr %arrayidx12.us.us.i245, align 8, !tbaa !9
%tobool.not.us.us.i246 = icmp eq i32 %68, 0
br i1 %tobool.not.us.us.i246, label %land.lhs.true.us.us.i269, label %for.inc18.us.us.i247
land.lhs.true.us.us.i269: ; preds = %for.body10.us.us.i241
%arrayidx14.us.us.i270 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv105.i242
%69 = load i32, ptr %arrayidx14.us.us.i270, align 8, !tbaa !9
%cmp15.us.us.i271 = icmp slt i32 %69, %minresult.079.us.us.i243
%70 = trunc i64 %indvars.iv105.i242 to i32
%spec.select.us.us.i272 = select i1 %cmp15.us.us.i271, i32 %70, i32 %minst.078.us.us.i244
%spec.select74.us.us.i273 = tail call i32 @llvm.smin.i32(i32 %69, i32 %minresult.079.us.us.i243)
br label %for.inc18.us.us.i247
for.inc18.us.us.i247: ; preds = %land.lhs.true.us.us.i269, %for.body10.us.us.i241
%minst.1.us.us.i248 = phi i32 [ %minst.078.us.us.i244, %for.body10.us.us.i241 ], [ %spec.select.us.us.i272, %land.lhs.true.us.us.i269 ]
%minresult.1.us.us.i249 = phi i32 [ %minresult.079.us.us.i243, %for.body10.us.us.i241 ], [ %spec.select74.us.us.i273, %land.lhs.true.us.us.i269 ]
%indvars.iv.next106.i250 = or i64 %indvars.iv105.i242, 1
%arrayidx12.us.us.i245.1 = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv.next106.i250
%71 = load i32, ptr %arrayidx12.us.us.i245.1, align 4, !tbaa !9
%tobool.not.us.us.i246.1 = icmp eq i32 %71, 0
br i1 %tobool.not.us.us.i246.1, label %land.lhs.true.us.us.i269.1, label %for.inc18.us.us.i247.1
land.lhs.true.us.us.i269.1: ; preds = %for.inc18.us.us.i247
%arrayidx14.us.us.i270.1 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv.next106.i250
%72 = load i32, ptr %arrayidx14.us.us.i270.1, align 4, !tbaa !9
%cmp15.us.us.i271.1 = icmp slt i32 %72, %minresult.1.us.us.i249
%73 = trunc i64 %indvars.iv.next106.i250 to i32
%spec.select.us.us.i272.1 = select i1 %cmp15.us.us.i271.1, i32 %73, i32 %minst.1.us.us.i248
%spec.select74.us.us.i273.1 = tail call i32 @llvm.smin.i32(i32 %72, i32 %minresult.1.us.us.i249)
br label %for.inc18.us.us.i247.1
for.inc18.us.us.i247.1: ; preds = %land.lhs.true.us.us.i269.1, %for.inc18.us.us.i247
%minst.1.us.us.i248.1 = phi i32 [ %minst.1.us.us.i248, %for.inc18.us.us.i247 ], [ %spec.select.us.us.i272.1, %land.lhs.true.us.us.i269.1 ]
%minresult.1.us.us.i249.1 = phi i32 [ %minresult.1.us.us.i249, %for.inc18.us.us.i247 ], [ %spec.select74.us.us.i273.1, %land.lhs.true.us.us.i269.1 ]
%indvars.iv.next106.i250.1 = add nuw nsw i64 %indvars.iv105.i242, 2
%niter369.next.1 = add i64 %niter369, 2
%niter369.ncmp.1 = icmp eq i64 %niter369.next.1, %unroll_iter368
br i1 %niter369.ncmp.1, label %for.cond8.for.end20_crit_edge.us.us.i252.unr-lcssa, label %for.body10.us.us.i241, !llvm.loop !18
for.cond8.for.end20_crit_edge.us.us.i252.unr-lcssa: ; preds = %for.inc18.us.us.i247.1, %for.cond8.preheader.us.us.i239
%minst.1.us.us.i248.lcssa.ph = phi i32 [ undef, %for.cond8.preheader.us.us.i239 ], [ %minst.1.us.us.i248.1, %for.inc18.us.us.i247.1 ]
%indvars.iv105.i242.unr = phi i64 [ 0, %for.cond8.preheader.us.us.i239 ], [ %indvars.iv.next106.i250.1, %for.inc18.us.us.i247.1 ]
%minresult.079.us.us.i243.unr = phi i32 [ 100000000, %for.cond8.preheader.us.us.i239 ], [ %minresult.1.us.us.i249.1, %for.inc18.us.us.i247.1 ]
%minst.078.us.us.i244.unr = phi i32 [ 0, %for.cond8.preheader.us.us.i239 ], [ %minst.1.us.us.i248.1, %for.inc18.us.us.i247.1 ]
br i1 %lcmp.mod366.not, label %for.cond8.for.end20_crit_edge.us.us.i252, label %for.body10.us.us.i241.epil
for.body10.us.us.i241.epil: ; preds = %for.cond8.for.end20_crit_edge.us.us.i252.unr-lcssa
%arrayidx12.us.us.i245.epil = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %indvars.iv105.i242.unr
%74 = load i32, ptr %arrayidx12.us.us.i245.epil, align 4, !tbaa !9
%tobool.not.us.us.i246.epil = icmp eq i32 %74, 0
br i1 %tobool.not.us.us.i246.epil, label %land.lhs.true.us.us.i269.epil, label %for.cond8.for.end20_crit_edge.us.us.i252
land.lhs.true.us.us.i269.epil: ; preds = %for.body10.us.us.i241.epil
%arrayidx14.us.us.i270.epil = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv105.i242.unr
%75 = load i32, ptr %arrayidx14.us.us.i270.epil, align 4, !tbaa !9
%cmp15.us.us.i271.epil = icmp slt i32 %75, %minresult.079.us.us.i243.unr
%76 = trunc i64 %indvars.iv105.i242.unr to i32
%spec.select.us.us.i272.epil = select i1 %cmp15.us.us.i271.epil, i32 %76, i32 %minst.078.us.us.i244.unr
br label %for.cond8.for.end20_crit_edge.us.us.i252
for.cond8.for.end20_crit_edge.us.us.i252: ; preds = %for.body10.us.us.i241.epil, %land.lhs.true.us.us.i269.epil, %for.cond8.for.end20_crit_edge.us.us.i252.unr-lcssa
%minst.1.us.us.i248.lcssa = phi i32 [ %minst.1.us.us.i248.lcssa.ph, %for.cond8.for.end20_crit_edge.us.us.i252.unr-lcssa ], [ %minst.078.us.us.i244.unr, %for.body10.us.us.i241.epil ], [ %spec.select.us.us.i272.epil, %land.lhs.true.us.us.i269.epil ]
%idxprom21.us.us.i253 = sext i32 %minst.1.us.us.i248.lcssa to i64
%arrayidx22.us.us.i254 = getelementptr inbounds [510 x i32], ptr @kakutei, i64 0, i64 %idxprom21.us.us.i253
store i32 1, ptr %arrayidx22.us.us.i254, align 4, !tbaa !9
%arrayidx27.us.us.i255 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom21.us.us.i253
br i1 %61, label %for.cond23.for.end48_crit_edge.us.us.i265.unr-lcssa, label %for.body25.us.us.i256
for.cond23.for.end48_crit_edge.us.us.i265.unr-lcssa: ; preds = %for.inc46.us.us.i262.1, %for.cond8.for.end20_crit_edge.us.us.i252
%indvars.iv110.i257.unr = phi i64 [ 0, %for.cond8.for.end20_crit_edge.us.us.i252 ], [ %indvars.iv.next111.i263.1, %for.inc46.us.us.i262.1 ]
br i1 %lcmp.mod371.not, label %for.cond23.for.end48_crit_edge.us.us.i265, label %for.body25.us.us.i256.epil
for.body25.us.us.i256.epil: ; preds = %for.cond23.for.end48_crit_edge.us.us.i265.unr-lcssa
%77 = load i32, ptr %arrayidx27.us.us.i255, align 4, !tbaa !9
%arrayidx31.us.us.i258.epil = getelementptr inbounds [510 x [510 x i32]], ptr @zikan, i64 0, i64 %idxprom21.us.us.i253, i64 %indvars.iv110.i257.unr
%78 = load i32, ptr %arrayidx31.us.us.i258.epil, align 4, !tbaa !9
%add.us.us.i259.epil = add nsw i32 %78, %77
%arrayidx33.us.us.i260.epil = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %indvars.iv110.i257.unr
%79 = load i32, ptr %arrayidx33.us.us.i260.epil, align 4, !tbaa !9
%cmp34.us.us.i261.epil = icmp slt i32 %add.us.us.i259.epil, %79
br i1 %cmp34.us.us.i261.epil, label %if.then35.us.us.i268.epil, label %for.cond23.for.end48_crit_edge.us.us.i265
if.then35.us.us.i268.epil: ; preds = %for.body25.us.us.i256.epil
store i32 %add.us.us.i259.epil, ptr %arrayidx33.us.us.i260.epil, align 4, !tbaa !9
br label %for.cond23.for.end48_crit_edge.us.us.i265
for.cond23.for.end48_crit_edge.us.us.i265: ; preds = %for.body25.us.us.i256.epil, %if.then35.us.us.i268.epil, %for.cond23.for.end48_crit_edge.us.us.i265.unr-lcssa
%inc50.us.us.i266 = add nuw nsw i32 %i.185.us.us.i240, 1
%exitcond115.not.i267 = icmp eq i32 %inc50.us.us.i266, %17
br i1 %exitcond115.not.i267, label %tansaku.exit274, label %for.cond8.preheader.us.us.i239, !llvm.loop !19
tansaku.exit274: ; preds = %for.cond23.for.end48_crit_edge.us.us.i265, %tansaku.exit.thread
%80 = phi i32 [ %29, %tansaku.exit.thread ], [ %56, %for.cond23.for.end48_crit_edge.us.us.i265 ]
%idxprom52.i226 = sext i32 %retval.2.i177 to i64
%arrayidx53.i227 = getelementptr inbounds [510 x i32], ptr @result, i64 0, i64 %idxprom52.i226
%81 = load i32, ptr %arrayidx53.i227, align 4, !tbaa !9
%add105 = add nsw i32 %81, %80
%call106 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add105)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
%cmp = icmp eq i32 %call, 2
%82 = load i32, ptr @n, align 4
%83 = load i32, ptr @m, align 4
%or = or i32 %83, %82
%cmp1 = icmp ne i32 %or, 0
%84 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %84, label %while.body, label %while.end, !llvm.loop !33
while.end: ; preds = %tansaku.exit274, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
attributes #0 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12, !14, !15}
!23 = distinct !{!23, !12, !15, !14}
!24 = distinct !{!24, !12}
!25 = !{!26, !10, i64 48}
!26 = !{!"", !7, i64 0, !7, i64 24, !10, i64 48, !10, i64 52}
!27 = !{!26, !10, i64 52}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12, !14, !15}
!30 = distinct !{!30, !12, !15, !14}
!31 = distinct !{!31, !12, !14, !15}
!32 = distinct !{!32, !12, !15, !14}
!33 = distinct !{!33, !12}
|
#include <stdio.h>
int main(void) {
int n,d[11][11],i,j;
while(scanf("%d",&n),n) {
for(i=0;i<n;i++) d[i][n]=0;
for(i=0;i<=n;i++) d[n][i]=0;
for(i=0;i<n;i++) {
for(j=0;j<n;j++) {
scanf("%d",&d[i][j]);
d[i][n]+=d[i][j];
d[n][j]+=d[i][j];
d[n][n]+=d[i][j];
}
}
for(i=0;i<=n;i++) {
for(j=0;j<n;j++) {
printf("%5d",d[i][j]);
}
printf("%5d\n",d[i][n]);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194490/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194490/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%5d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%5d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = alloca [11 x [11 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 484, ptr nonnull %d) #4
%call117 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not118 = icmp eq i32 %0, 0
br i1 %tobool.not118, label %while.end, label %for.cond.preheader
while.cond.loopexit: ; preds = %for.end69, %for.cond3.preheader, %for.cond.preheader, %for.cond56.preheader
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !9
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%2 = phi i32 [ %1, %while.cond.loopexit ], [ %0, %entry ]
%cmp105 = icmp sgt i32 %2, 0
br i1 %cmp105, label %for.body.lr.ph, label %while.cond.loopexit
for.body.lr.ph: ; preds = %for.cond.preheader
%idxprom1 = zext i32 %2 to i64
%wide.trip.count = zext i32 %2 to i64
%xtraiter = and i64 %wide.trip.count, 3
%3 = icmp ult i32 %2, 4
br i1 %3, label %for.cond3.preheader.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body
for.cond3.preheader.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%indvars.iv.unr = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond3.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond3.preheader.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond3.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond3.preheader.unr-lcssa ]
%arrayidx2.epil = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv.epil, i64 %idxprom1
store i32 0, ptr %arrayidx2.epil, align 4, !tbaa !5
%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.cond3.preheader, label %for.body.epil, !llvm.loop !11
for.cond3.preheader: ; preds = %for.body.epil, %for.cond3.preheader.unr-lcssa
%cmp4.not107 = icmp slt i32 %2, 0
br i1 %cmp4.not107, label %while.cond.loopexit, label %for.cond13.preheader
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 0, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%arrayidx2 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv, i64 %idxprom1
store i32 0, ptr %arrayidx2, align 4, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx2.1 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv.next, i64 %idxprom1
store i32 0, ptr %arrayidx2.1, align 4, !tbaa !5
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx2.2 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv.next.1, i64 %idxprom1
store i32 0, ptr %arrayidx2.2, align 4, !tbaa !5
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx2.3 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv.next.2, i64 %idxprom1
store i32 0, ptr %arrayidx2.3, align 4, !tbaa !5
%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.cond3.preheader.unr-lcssa, label %for.body, !llvm.loop !13
for.cond13.preheader: ; preds = %for.cond3.preheader
%idxprom6 = zext i32 %2 to i64
%4 = mul nuw nsw i64 %idxprom6, 44
%scevgep = getelementptr i8, ptr %d, i64 %4
%5 = add nuw i32 %2, 1
%6 = zext i32 %5 to i64
%7 = shl nuw nsw i64 %6, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i8 0, i64 %7, i1 false), !tbaa !5
br i1 %cmp105, label %for.cond16.preheader, label %for.cond59.preheader.preheader
for.cond56.preheader: ; preds = %for.inc53
%cmp57.not115 = icmp slt i32 %16, 0
br i1 %cmp57.not115, label %while.cond.loopexit, label %for.cond59.preheader.preheader
for.cond59.preheader.preheader: ; preds = %for.cond13.preheader, %for.cond56.preheader
%.ph = phi i32 [ 0, %for.cond13.preheader ], [ %16, %for.cond56.preheader ]
br label %for.cond59.preheader
for.cond16.preheader: ; preds = %for.cond13.preheader, %for.inc53
%8 = phi i32 [ %16, %for.inc53 ], [ %2, %for.cond13.preheader ]
%indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.inc53 ], [ 0, %for.cond13.preheader ]
%cmp17109 = icmp sgt i32 %8, 0
br i1 %cmp17109, label %for.body18, label %for.cond16.preheader.for.inc53_crit_edge
for.cond16.preheader.for.inc53_crit_edge: ; preds = %for.cond16.preheader
%.pre = sext i32 %8 to i64
br label %for.inc53
for.body18: ; preds = %for.cond16.preheader, %for.body18
%indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.body18 ], [ 0, %for.cond16.preheader ]
%arrayidx22 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv128, i64 %indvars.iv125
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx22)
%9 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%10 = load i32, ptr %n, align 4, !tbaa !5
%idxprom30 = sext i32 %10 to i64
%arrayidx31 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv128, i64 %idxprom30
%11 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%add = add nsw i32 %11, %9
store i32 %add, ptr %arrayidx31, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%arrayidx39 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %idxprom30, i64 %indvars.iv125
%13 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%add40 = add nsw i32 %13, %12
store i32 %add40, ptr %arrayidx39, align 4, !tbaa !5
%14 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%arrayidx48 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %idxprom30, i64 %idxprom30
%15 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%add49 = add nsw i32 %15, %14
store i32 %add49, ptr %arrayidx48, align 4, !tbaa !5
%indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
%cmp17 = icmp slt i64 %indvars.iv.next126, %idxprom30
br i1 %cmp17, label %for.body18, label %for.inc53, !llvm.loop !14
for.inc53: ; preds = %for.body18, %for.cond16.preheader.for.inc53_crit_edge
%.pre-phi = phi i64 [ %.pre, %for.cond16.preheader.for.inc53_crit_edge ], [ %idxprom30, %for.body18 ]
%16 = phi i32 [ %8, %for.cond16.preheader.for.inc53_crit_edge ], [ %10, %for.body18 ]
%indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
%cmp14 = icmp slt i64 %indvars.iv.next129, %.pre-phi
br i1 %cmp14, label %for.cond16.preheader, label %for.cond56.preheader, !llvm.loop !15
for.cond59.preheader: ; preds = %for.cond59.preheader.preheader, %for.end69
%17 = phi i32 [ %22, %for.end69 ], [ %.ph, %for.cond59.preheader.preheader ]
%indvars.iv134 = phi i64 [ %indvars.iv.next135, %for.end69 ], [ 0, %for.cond59.preheader.preheader ]
%cmp60113 = icmp sgt i32 %17, 0
br i1 %cmp60113, label %for.body61, label %for.cond59.preheader.for.end69_crit_edge
for.cond59.preheader.for.end69_crit_edge: ; preds = %for.cond59.preheader
%.pre137 = sext i32 %17 to i64
br label %for.end69
for.body61: ; preds = %for.cond59.preheader, %for.body61
%indvars.iv131 = phi i64 [ %indvars.iv.next132, %for.body61 ], [ 0, %for.cond59.preheader ]
%arrayidx65 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv134, i64 %indvars.iv131
%18 = load i32, ptr %arrayidx65, align 4, !tbaa !5
%call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18)
%indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
%19 = load i32, ptr %n, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp60 = icmp slt i64 %indvars.iv.next132, %20
br i1 %cmp60, label %for.body61, label %for.end69, !llvm.loop !17
for.end69: ; preds = %for.body61, %for.cond59.preheader.for.end69_crit_edge
%idxprom72.pre-phi = phi i64 [ %.pre137, %for.cond59.preheader.for.end69_crit_edge ], [ %20, %for.body61 ]
%arrayidx73 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv134, i64 %idxprom72.pre-phi
%21 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
%indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
%22 = load i32, ptr %n, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp57.not.not = icmp slt i64 %indvars.iv134, %23
br i1 %cmp57.not.not, label %for.cond59.preheader, label %while.cond.loopexit, !llvm.loop !18
while.end: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 484, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include<stdio.h>
int main(void){
int d[11][11];
//int s[11];
int n,i,j,temp;
while(scanf("%d",&n)){
if(n==0)
break;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
scanf("%d ",&d[i][j]);
}
}
int s[11] = {0};
for(i=0;i<n;i++){
temp = 0;
for(j=0;j<n;j++){
printf("%5d",d[i][j]);
temp+=d[i][j];
s[j]+=d[i][j];
}
printf("%5d\n",temp);
}
temp = 0;
for(i=0;i<n;i++)
{
printf("%5d",s[i]);
temp+=s[i];
}
printf("%5d\n",temp);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194533/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194533/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%5d\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%5d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca [11 x [11 x i32]], align 16
%n = alloca i32, align 4
%s = alloca [11 x i32], align 16
call void @llvm.lifetime.start.p0(i64 484, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call88 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool89 = icmp eq i32 %call88, 0
%0 = load i32, ptr %n, align 4
%cmp90 = icmp eq i32 %0, 0
%or.cond91 = select i1 %tobool89, i1 true, i1 %cmp90
br i1 %or.cond91, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end51
%1 = phi i32 [ %17, %for.end51 ], [ %0, %entry ]
%cmp177 = icmp sgt i32 %1, 0
br i1 %cmp177, label %for.cond2.preheader, label %for.end10.thread
for.end10.thread: ; preds = %for.cond.preheader
call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %s) #4
br label %for.end51
for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc8
%2 = phi i32 [ %5, %for.inc8 ], [ %1, %for.cond.preheader ]
%indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.inc8 ], [ 0, %for.cond.preheader ]
%cmp375 = icmp sgt i32 %2, 0
br i1 %cmp375, label %for.body4, label %for.cond2.preheader.for.inc8_crit_edge
for.cond2.preheader.for.inc8_crit_edge: ; preds = %for.cond2.preheader
%.pre = sext i32 %2 to i64
br label %for.inc8
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv94, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp3, label %for.body4, label %for.inc8, !llvm.loop !9
for.inc8: ; preds = %for.body4, %for.cond2.preheader.for.inc8_crit_edge
%.pre-phi = phi i64 [ %.pre, %for.cond2.preheader.for.inc8_crit_edge ], [ %4, %for.body4 ]
%5 = phi i32 [ %2, %for.cond2.preheader.for.inc8_crit_edge ], [ %3, %for.body4 ]
%indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
%cmp1 = icmp slt i64 %indvars.iv.next95, %.pre-phi
br i1 %cmp1, label %for.cond2.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.inc8
call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %s) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44) %s, i8 0, i64 44, i1 false)
%cmp1282 = icmp sgt i32 %5, 0
br i1 %cmp1282, label %for.cond14.preheader, label %for.end51
for.cond40.preheader: ; preds = %for.end35
%cmp4184 = icmp sgt i32 %12, 0
br i1 %cmp4184, label %for.body42, label %for.end51
for.cond14.preheader: ; preds = %for.end10, %for.end35
%6 = phi i32 [ %12, %for.end35 ], [ %5, %for.end10 ]
%indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.end35 ], [ 0, %for.end10 ]
%cmp1579 = icmp sgt i32 %6, 0
br i1 %cmp1579, label %for.body16, label %for.end35
for.body16: ; preds = %for.cond14.preheader, %for.body16
%indvars.iv97 = phi i64 [ %indvars.iv.next98, %for.body16 ], [ 0, %for.cond14.preheader ]
%temp.081 = phi i32 [ %add, %for.body16 ], [ 0, %for.cond14.preheader ]
%arrayidx20 = getelementptr inbounds [11 x [11 x i32]], ptr %d, i64 0, i64 %indvars.iv100, i64 %indvars.iv97
%7 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%8 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%add = add nsw i32 %8, %temp.081
%arrayidx31 = getelementptr inbounds [11 x i32], ptr %s, i64 0, i64 %indvars.iv97
%9 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%add32 = add nsw i32 %9, %8
store i32 %add32, ptr %arrayidx31, align 4, !tbaa !5
%indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp15 = icmp slt i64 %indvars.iv.next98, %11
br i1 %cmp15, label %for.body16, label %for.end35, !llvm.loop !13
for.end35: ; preds = %for.body16, %for.cond14.preheader
%temp.0.lcssa = phi i32 [ 0, %for.cond14.preheader ], [ %add, %for.body16 ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %temp.0.lcssa)
%indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp12 = icmp slt i64 %indvars.iv.next101, %13
br i1 %cmp12, label %for.cond14.preheader, label %for.cond40.preheader, !llvm.loop !14
for.body42: ; preds = %for.cond40.preheader, %for.body42
%indvars.iv103 = phi i64 [ %indvars.iv.next104, %for.body42 ], [ 0, %for.cond40.preheader ]
%temp.186 = phi i32 [ %add48, %for.body42 ], [ 0, %for.cond40.preheader ]
%arrayidx44 = getelementptr inbounds [11 x i32], ptr %s, i64 0, i64 %indvars.iv103
%14 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%add48 = add nsw i32 %14, %temp.186
%indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp41 = icmp slt i64 %indvars.iv.next104, %16
br i1 %cmp41, label %for.body42, label %for.end51, !llvm.loop !15
for.end51: ; preds = %for.body42, %for.end10.thread, %for.end10, %for.cond40.preheader
%temp.1.lcssa = phi i32 [ 0, %for.cond40.preheader ], [ 0, %for.end10 ], [ 0, %for.end10.thread ], [ %add48, %for.body42 ]
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %temp.1.lcssa)
call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool = icmp eq i32 %call, 0
%17 = load i32, ptr %n, align 4
%cmp = icmp eq i32 %17, 0
%or.cond = select i1 %tobool, i1 true, i1 %cmp
br i1 %or.cond, label %while.end, label %for.cond.preheader, !llvm.loop !16
while.end: ; preds = %for.end51, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 484, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
int main(){
int n,t,i;
while(1){
scanf("%d",&n);
if(n==0)return 0;
int data[n][n];
int tate[n];
int allsum=0;
for(i=0;i<n;i++){
tate[i]=0;
}
for(i=0;i<n;i++){
for(t=0;t<n;t++){
scanf("%d",&data[i][t]);
}
}
for(i=0;i<n;i++){
int sum=0;
for(t=0;t<n;t++){
printf("%5d",data[i][t]);
sum+=data[i][t];
tate[t]+=data[i][t];
}
allsum+=sum;
printf("%5d",sum);
puts("");
}
for(i=0;i<n;i++){
printf("%5d",tate[i]);
}
printf("%5d\n",allsum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194591/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194591/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%5d\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%5d\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) #6
%call100 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp101 = icmp eq i32 %0, 0
br i1 %cmp101, label %if.then, label %if.end
if.then: ; preds = %for.end59, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
if.end: ; preds = %entry, %for.end59
%1 = phi i32 [ %25, %for.end59 ], [ %0, %entry ]
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%4 = mul nuw i64 %2, %2
%vla = alloca i32, i64 %4, align 16
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = zext i32 %5 to i64
%vla1 = alloca i32, i64 %6, align 16
%cmp285 = icmp sgt i32 %5, 0
br i1 %cmp285, label %for.cond6.preheader.preheader, label %for.end59
for.cond6.preheader.preheader: ; preds = %if.end
%7 = shl nuw nsw i64 %6, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla1, i8 0, i64 %7, i1 false), !tbaa !5
br label %for.cond6.preheader
for.cond20.preheader: ; preds = %for.inc17
%cmp2194 = icmp sgt i32 %12, 0
br i1 %cmp2194, label %for.cond23.preheader, label %for.end59
for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc17
%8 = phi i32 [ %5, %for.cond6.preheader.preheader ], [ %12, %for.inc17 ]
%indvars.iv105 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next106, %for.inc17 ]
%cmp787 = icmp sgt i32 %8, 0
br i1 %cmp787, label %for.body8.lr.ph, label %for.cond6.preheader.for.inc17_crit_edge
for.cond6.preheader.for.inc17_crit_edge: ; preds = %for.cond6.preheader
%.pre = sext i32 %8 to i64
br label %for.inc17
for.body8.lr.ph: ; preds = %for.cond6.preheader
%9 = mul nuw nsw i64 %indvars.iv105, %2
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %9
br label %for.body8
for.body8: ; preds = %for.body8.lr.ph, %for.body8
%indvars.iv = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next, %for.body8 ]
%arrayidx12 = getelementptr inbounds i32, ptr %arrayidx10, i64 %indvars.iv
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx12)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp7 = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp7, label %for.body8, label %for.inc17, !llvm.loop !9
for.inc17: ; preds = %for.body8, %for.cond6.preheader.for.inc17_crit_edge
%.pre-phi = phi i64 [ %.pre, %for.cond6.preheader.for.inc17_crit_edge ], [ %11, %for.body8 ]
%12 = phi i32 [ %8, %for.cond6.preheader.for.inc17_crit_edge ], [ %10, %for.body8 ]
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%cmp4 = icmp slt i64 %indvars.iv.next106, %.pre-phi
br i1 %cmp4, label %for.cond6.preheader, label %for.cond20.preheader, !llvm.loop !11
for.cond51.preheader: ; preds = %for.end44
%cmp5298 = icmp sgt i32 %20, 0
br i1 %cmp5298, label %for.body53, label %for.end59
for.cond23.preheader: ; preds = %for.cond20.preheader, %for.end44
%13 = phi i32 [ %20, %for.end44 ], [ %12, %for.cond20.preheader ]
%indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.end44 ], [ 0, %for.cond20.preheader ]
%allsum.096 = phi i32 [ %add45, %for.end44 ], [ 0, %for.cond20.preheader ]
%cmp2491 = icmp sgt i32 %13, 0
br i1 %cmp2491, label %for.body25.lr.ph, label %for.end44
for.body25.lr.ph: ; preds = %for.cond23.preheader
%14 = mul nuw nsw i64 %indvars.iv111, %2
%arrayidx27 = getelementptr inbounds i32, ptr %vla, i64 %14
br label %for.body25
for.body25: ; preds = %for.body25.lr.ph, %for.body25
%indvars.iv108 = phi i64 [ 0, %for.body25.lr.ph ], [ %indvars.iv.next109, %for.body25 ]
%sum.093 = phi i32 [ 0, %for.body25.lr.ph ], [ %add, %for.body25 ]
%arrayidx29 = getelementptr inbounds i32, ptr %arrayidx27, i64 %indvars.iv108
%15 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
%16 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%add = add nsw i32 %16, %sum.093
%arrayidx40 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv108
%17 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%add41 = add nsw i32 %17, %16
store i32 %add41, ptr %arrayidx40, align 4, !tbaa !5
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp24 = icmp slt i64 %indvars.iv.next109, %19
br i1 %cmp24, label %for.body25, label %for.end44, !llvm.loop !13
for.end44: ; preds = %for.body25, %for.cond23.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond23.preheader ], [ %add, %for.body25 ]
%add45 = add nsw i32 %sum.0.lcssa, %allsum.096
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%20 = load i32, ptr %n, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp21 = icmp slt i64 %indvars.iv.next112, %21
br i1 %cmp21, label %for.cond23.preheader, label %for.cond51.preheader, !llvm.loop !14
for.body53: ; preds = %for.cond51.preheader, %for.body53
%indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.body53 ], [ 0, %for.cond51.preheader ]
%arrayidx55 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv114
%22 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %22)
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%23 = load i32, ptr %n, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp52 = icmp slt i64 %indvars.iv.next115, %24
br i1 %cmp52, label %for.body53, label %for.end59, !llvm.loop !15
for.end59: ; preds = %for.body53, %if.end, %for.cond20.preheader, %for.cond51.preheader
%allsum.0.lcssa120 = phi i32 [ %add45, %for.cond51.preheader ], [ 0, %for.cond20.preheader ], [ 0, %if.end ], [ %add45, %for.body53 ]
%call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %allsum.0.lcssa120)
call void @llvm.stackrestore.p0(ptr %3)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%25 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %25, 0
br i1 %cmp, label %if.then, label %if.end
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
// AOJ 2729 Delete Files
// 2018.2.7 bal4u
#include <stdio.h>
#include <string.h>
#define QMAX 1002
typedef struct { int k, t; } QUE;
QUE que[QMAX]; int qsize;
#define PARENT(i) ((i)>>1)
#define LEFT(i) ((i)<<1)
#define RIGHT(i) (((i)<<1)+1)
void min_heapify(int i)
{
int l, r, min;
QUE qt;
l = LEFT(i), r = RIGHT(i);
if (l < qsize && que[l].t < que[i].t) min = l; else min = i;
if (r < qsize && que[r].t < que[min].t) min = r;
if (min != i) {
qt = que[i]; que[i] = que[min]; que[min] = qt;
min_heapify(min);
}
}
void deq()
{
// if (qsize == 0) return 0;
// *a = que[0].a, *b = que[0].b, *c = que[0].c;
que[0] = que[--qsize];
min_heapify(0);
}
void enq(int k, int t)
{
int i, min;
QUE qt;
i = qsize++;
que[i].t = t, que[i].k = k;
while (i > 0 && que[min = PARENT(i)].t > que[i].t) {
qt = que[i]; que[i] = que[min]; que[min] = qt;
i = min;
}
}
char d[1002]; int w[1002];
char mk[1002];
//#define getchar_unlocked() getchar()
int in()
{
int n = 0;
int c = getchar_unlocked();
while (c < '0') c = getchar_unlocked();
do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
while (c >= '0');
return n;
}
int main()
{
int n, i, k, f, len, ans;
n = in();
qsize = 0;
for (i = 0; i < n; i++) {
f = getchar_unlocked() == 'y', getchar_unlocked();
d[i] = f, w[i] = in();
if (f) enq(i, w[i]);
}
ans = 0;
while (qsize) {
k = que[0].k, len = que[0].t, deq();
if (mk[k]) continue;
ans++;
mk[k] = 1;
for (i = k-1; i >= 0; i--) {
if (!d[i] && w[i] >= len) break;
mk[i] = 1;
}
for (i = k+1; i < n; i++) {
if (!d[i] && w[i] >= len) break;
mk[i] = 1;
}
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194641/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194641/source.c"
target datalayout = "e-m:e-p270: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.QUE = type { i32, i32 }
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@qsize = dso_local local_unnamed_addr global i32 0, align 4
@que = dso_local local_unnamed_addr global [1002 x %struct.QUE] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [1002 x i8] zeroinitializer, align 16
@w = dso_local local_unnamed_addr global [1002 x i32] zeroinitializer, align 16
@mk = dso_local local_unnamed_addr global [1002 x i8] 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: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @min_heapify(i32 noundef %i) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
br label %tailrecurse
tailrecurse: ; preds = %if.then18, %entry
%i.tr = phi i32 [ %i, %entry ], [ %min.1, %if.then18 ]
%shl = shl i32 %i.tr, 1
%add = or i32 %shl, 1
%cmp = icmp slt i32 %shl, %0
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %tailrecurse
%idxprom = sext i32 %shl to i64
%t = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1
%1 = load i32, ptr %t, align 4, !tbaa !9
%idxprom2 = sext i32 %i.tr to i64
%t4 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2, i32 1
%2 = load i32, ptr %t4, align 4, !tbaa !9
%cmp5 = icmp slt i32 %1, %2
br i1 %cmp5, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %tailrecurse
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%min.0 = phi i32 [ %i.tr, %if.else ], [ %shl, %land.lhs.true ]
%cmp6 = icmp slt i32 %add, %0
br i1 %cmp6, label %land.lhs.true7, label %if.end16
land.lhs.true7: ; preds = %if.end
%idxprom8 = sext i32 %add to i64
%t10 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8, i32 1
%3 = load i32, ptr %t10, align 4, !tbaa !9
%idxprom11 = sext i32 %min.0 to i64
%t13 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11, i32 1
%4 = load i32, ptr %t13, align 4, !tbaa !9
%cmp14 = icmp slt i32 %3, %4
%spec.select = select i1 %cmp14, i32 %add, i32 %min.0
br label %if.end16
if.end16: ; preds = %land.lhs.true7, %if.end
%min.1 = phi i32 [ %min.0, %if.end ], [ %spec.select, %land.lhs.true7 ]
%cmp17.not = icmp eq i32 %min.1, %i.tr
br i1 %cmp17.not, label %if.end27, label %if.then18
if.then18: ; preds = %if.end16
%idxprom19 = sext i32 %i.tr to i64
%arrayidx20 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19
%5 = load i64, ptr %arrayidx20, align 8
%idxprom23 = sext i32 %min.1 to i64
%arrayidx24 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23
%6 = load i64, ptr %arrayidx24, align 8
store i64 %6, ptr %arrayidx20, align 8
store i64 %5, ptr %arrayidx24, align 8
br label %tailrecurse
if.end27: ; preds = %if.end16
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @deq() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8
store i64 %1, ptr @que, align 16
br label %tailrecurse.i
tailrecurse.i: ; preds = %if.then18.i, %entry
%i.tr.i = phi i32 [ 0, %entry ], [ %min.1.i, %if.then18.i ]
%shl.i = shl i32 %i.tr.i, 1
%add.i = or i32 %shl.i, 1
%cmp.i = icmp slt i32 %shl.i, %dec
br i1 %cmp.i, label %land.lhs.true.i, label %if.else.i
land.lhs.true.i: ; preds = %tailrecurse.i
%idxprom.i = sext i32 %shl.i to i64
%t.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i, i32 1
%2 = load i32, ptr %t.i, align 4, !tbaa !9
%idxprom2.i = sext i32 %i.tr.i to i64
%t4.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2.i, i32 1
%3 = load i32, ptr %t4.i, align 4, !tbaa !9
%cmp5.i = icmp slt i32 %2, %3
br i1 %cmp5.i, label %if.end.i, label %if.else.i
if.else.i: ; preds = %land.lhs.true.i, %tailrecurse.i
br label %if.end.i
if.end.i: ; preds = %if.else.i, %land.lhs.true.i
%min.0.i = phi i32 [ %i.tr.i, %if.else.i ], [ %shl.i, %land.lhs.true.i ]
%cmp6.i = icmp slt i32 %add.i, %dec
br i1 %cmp6.i, label %land.lhs.true7.i, label %if.end16.i
land.lhs.true7.i: ; preds = %if.end.i
%idxprom8.i = sext i32 %add.i to i64
%t10.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i, i32 1
%4 = load i32, ptr %t10.i, align 4, !tbaa !9
%idxprom11.i = sext i32 %min.0.i to i64
%t13.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i, i32 1
%5 = load i32, ptr %t13.i, align 4, !tbaa !9
%cmp14.i = icmp slt i32 %4, %5
%spec.select.i = select i1 %cmp14.i, i32 %add.i, i32 %min.0.i
br label %if.end16.i
if.end16.i: ; preds = %land.lhs.true7.i, %if.end.i
%min.1.i = phi i32 [ %min.0.i, %if.end.i ], [ %spec.select.i, %land.lhs.true7.i ]
%cmp17.not.i = icmp eq i32 %min.1.i, %i.tr.i
br i1 %cmp17.not.i, label %min_heapify.exit, label %if.then18.i
if.then18.i: ; preds = %if.end16.i
%idxprom19.i = sext i32 %i.tr.i to i64
%arrayidx20.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i
%6 = load i64, ptr %arrayidx20.i, align 8
%idxprom23.i = sext i32 %min.1.i to i64
%arrayidx24.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i
%7 = load i64, ptr %arrayidx24.i, align 8
store i64 %7, ptr %arrayidx20.i, align 8
store i64 %6, ptr %arrayidx24.i, align 8
br label %tailrecurse.i
min_heapify.exit: ; preds = %if.end16.i
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @enq(i32 noundef %k, i32 noundef %t) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
%t1 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1
store i32 %t, ptr %t1, align 4, !tbaa !9
store i32 %k, ptr %arrayidx, align 8, !tbaa !11
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %land.rhs, label %while.end
land.rhs: ; preds = %entry, %while.body
%i.029 = phi i32 [ %shr, %while.body ], [ %0, %entry ]
%shr = lshr i32 %i.029, 1
%idxprom5 = zext i32 %shr to i64
%t7 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5, i32 1
%1 = load i32, ptr %t7, align 4, !tbaa !9
%idxprom8 = zext i32 %i.029 to i64
%t10 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8, i32 1
%2 = load i32, ptr %t10, align 4, !tbaa !9
%cmp11 = icmp sgt i32 %1, %2
br i1 %cmp11, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx9 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8
%arrayidx6 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5
%3 = load i64, ptr %arrayidx9, align 8
%4 = load i64, ptr %arrayidx6, align 8
store i64 %4, ptr %arrayidx9, align 8
store i64 %3, ptr %arrayidx6, align 8
%cmp.not = icmp ult i32 %i.029, 2
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !12
while.end: ; preds = %land.rhs, %while.body, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !14
%_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 !16
%_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 !20
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !21
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4
%.pre33.pre.pre = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !16
%3 = load i8, ptr %1, align 1, !tbaa !22
%conv3.i = zext i8 %3 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%.pre33.pre = phi ptr [ %.pre33.pre.pre, %cond.true.i ], [ %0, %cond.false.i ]
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%cmp30 = icmp slt i32 %cond.i, 48
br i1 %cmp30, label %while.body, label %do.body.preheader
while.body: ; preds = %getchar_unlocked.exit, %getchar_unlocked.exit19
%4 = phi ptr [ %8, %getchar_unlocked.exit19 ], [ %.pre33.pre, %getchar_unlocked.exit ]
%_IO_read_ptr.i10 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i10, align 8, !tbaa !16
%_IO_read_end.i11 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i11, align 8, !tbaa !20
%cmp.not.i12 = icmp ult ptr %5, %6
br i1 %cmp.not.i12, label %cond.false.i16, label %cond.true.i13, !prof !21
cond.true.i13: ; preds = %while.body
%call.i14 = tail call i32 @__uflow(ptr noundef nonnull %4) #4
%.pre = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit19
cond.false.i16: ; preds = %while.body
%incdec.ptr.i17 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i17, ptr %_IO_read_ptr.i10, align 8, !tbaa !16
%7 = load i8, ptr %5, align 1, !tbaa !22
%conv3.i18 = zext i8 %7 to i32
br label %getchar_unlocked.exit19
getchar_unlocked.exit19: ; preds = %cond.true.i13, %cond.false.i16
%8 = phi ptr [ %.pre, %cond.true.i13 ], [ %4, %cond.false.i16 ]
%cond.i15 = phi i32 [ %call.i14, %cond.true.i13 ], [ %conv3.i18, %cond.false.i16 ]
%cmp = icmp slt i32 %cond.i15, 48
br i1 %cmp, label %while.body, label %do.body.preheader, !llvm.loop !23
do.body.preheader: ; preds = %getchar_unlocked.exit19, %getchar_unlocked.exit
%.ph = phi ptr [ %.pre33.pre, %getchar_unlocked.exit ], [ %8, %getchar_unlocked.exit19 ]
%c.1.ph = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %cond.i15, %getchar_unlocked.exit19 ]
br label %do.body
do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit29
%9 = phi ptr [ %13, %getchar_unlocked.exit29 ], [ %.ph, %do.body.preheader ]
%n.0 = phi i32 [ %add3, %getchar_unlocked.exit29 ], [ 0, %do.body.preheader ]
%c.1 = phi i32 [ %cond.i25, %getchar_unlocked.exit29 ], [ %c.1.ph, %do.body.preheader ]
%add = mul i32 %n.0, 10
%and = and i32 %c.1, 15
%add3 = add nsw i32 %and, %add
%_IO_read_ptr.i20 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1
%10 = load ptr, ptr %_IO_read_ptr.i20, align 8, !tbaa !16
%_IO_read_end.i21 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2
%11 = load ptr, ptr %_IO_read_end.i21, align 8, !tbaa !20
%cmp.not.i22 = icmp ult ptr %10, %11
br i1 %cmp.not.i22, label %cond.false.i26, label %cond.true.i23, !prof !21
cond.true.i23: ; preds = %do.body
%call.i24 = tail call i32 @__uflow(ptr noundef nonnull %9) #4
%.pre32 = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit29
cond.false.i26: ; preds = %do.body
%incdec.ptr.i27 = getelementptr inbounds i8, ptr %10, i64 1
store ptr %incdec.ptr.i27, ptr %_IO_read_ptr.i20, align 8, !tbaa !16
%12 = load i8, ptr %10, align 1, !tbaa !22
%conv3.i28 = zext i8 %12 to i32
br label %getchar_unlocked.exit29
getchar_unlocked.exit29: ; preds = %cond.true.i23, %cond.false.i26
%13 = phi ptr [ %.pre32, %cond.true.i23 ], [ %9, %cond.false.i26 ]
%cond.i25 = phi i32 [ %call.i24, %cond.true.i23 ], [ %conv3.i28, %cond.false.i26 ]
%cmp5 = icmp sgt i32 %cond.i25, 47
br i1 %cmp5, label %do.body, label %do.end, !llvm.loop !24
do.end: ; preds = %getchar_unlocked.exit29
ret i32 %add3
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !14
%_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 !16
%_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 !20
%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 !21
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4
%.pre33.pre.pre.i = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit.i
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 !16
%3 = load i8, ptr %1, align 1, !tbaa !22
%conv3.i.i = zext i8 %3 to i32
br label %getchar_unlocked.exit.i
getchar_unlocked.exit.i: ; preds = %cond.false.i.i, %cond.true.i.i
%.pre33.pre.i = phi ptr [ %.pre33.pre.pre.i, %cond.true.i.i ], [ %0, %cond.false.i.i ]
%cond.i.i = phi i32 [ %call.i.i, %cond.true.i.i ], [ %conv3.i.i, %cond.false.i.i ]
%cmp30.i = icmp slt i32 %cond.i.i, 48
br i1 %cmp30.i, label %while.body.i, label %do.body.i.preheader
while.body.i: ; preds = %getchar_unlocked.exit.i, %getchar_unlocked.exit19.i
%4 = phi ptr [ %8, %getchar_unlocked.exit19.i ], [ %.pre33.pre.i, %getchar_unlocked.exit.i ]
%_IO_read_ptr.i10.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i10.i, align 8, !tbaa !16
%_IO_read_end.i11.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i11.i, align 8, !tbaa !20
%cmp.not.i12.i = icmp ult ptr %5, %6
br i1 %cmp.not.i12.i, label %cond.false.i16.i, label %cond.true.i13.i, !prof !21
cond.true.i13.i: ; preds = %while.body.i
%call.i14.i = tail call i32 @__uflow(ptr noundef nonnull %4) #4
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit19.i
cond.false.i16.i: ; preds = %while.body.i
%incdec.ptr.i17.i = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i17.i, ptr %_IO_read_ptr.i10.i, align 8, !tbaa !16
%7 = load i8, ptr %5, align 1, !tbaa !22
%conv3.i18.i = zext i8 %7 to i32
br label %getchar_unlocked.exit19.i
getchar_unlocked.exit19.i: ; preds = %cond.false.i16.i, %cond.true.i13.i
%8 = phi ptr [ %.pre.i, %cond.true.i13.i ], [ %4, %cond.false.i16.i ]
%cond.i15.i = phi i32 [ %call.i14.i, %cond.true.i13.i ], [ %conv3.i18.i, %cond.false.i16.i ]
%cmp.i = icmp slt i32 %cond.i15.i, 48
br i1 %cmp.i, label %while.body.i, label %do.body.i.preheader, !llvm.loop !23
do.body.i.preheader: ; preds = %getchar_unlocked.exit19.i, %getchar_unlocked.exit.i
%.ph196 = phi ptr [ %.pre33.pre.i, %getchar_unlocked.exit.i ], [ %8, %getchar_unlocked.exit19.i ]
%c.1.i.ph = phi i32 [ %cond.i.i, %getchar_unlocked.exit.i ], [ %cond.i15.i, %getchar_unlocked.exit19.i ]
br label %do.body.i
do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit29.i
%9 = phi ptr [ %13, %getchar_unlocked.exit29.i ], [ %.ph196, %do.body.i.preheader ]
%n.0.i = phi i32 [ %add3.i, %getchar_unlocked.exit29.i ], [ 0, %do.body.i.preheader ]
%c.1.i = phi i32 [ %cond.i25.i, %getchar_unlocked.exit29.i ], [ %c.1.i.ph, %do.body.i.preheader ]
%add.i = mul i32 %n.0.i, 10
%and.i = and i32 %c.1.i, 15
%add3.i = add nsw i32 %and.i, %add.i
%_IO_read_ptr.i20.i = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1
%10 = load ptr, ptr %_IO_read_ptr.i20.i, align 8, !tbaa !16
%_IO_read_end.i21.i = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2
%11 = load ptr, ptr %_IO_read_end.i21.i, align 8, !tbaa !20
%cmp.not.i22.i = icmp ult ptr %10, %11
br i1 %cmp.not.i22.i, label %cond.false.i26.i, label %cond.true.i23.i, !prof !21
cond.true.i23.i: ; preds = %do.body.i
%call.i24.i = tail call i32 @__uflow(ptr noundef nonnull %9) #4
%.pre32.i = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit29.i
cond.false.i26.i: ; preds = %do.body.i
%incdec.ptr.i27.i = getelementptr inbounds i8, ptr %10, i64 1
store ptr %incdec.ptr.i27.i, ptr %_IO_read_ptr.i20.i, align 8, !tbaa !16
%12 = load i8, ptr %10, align 1, !tbaa !22
%conv3.i28.i = zext i8 %12 to i32
br label %getchar_unlocked.exit29.i
getchar_unlocked.exit29.i: ; preds = %cond.false.i26.i, %cond.true.i23.i
%13 = phi ptr [ %.pre32.i, %cond.true.i23.i ], [ %9, %cond.false.i26.i ]
%cond.i25.i = phi i32 [ %call.i24.i, %cond.true.i23.i ], [ %conv3.i28.i, %cond.false.i26.i ]
%cmp5.i = icmp sgt i32 %cond.i25.i, 47
br i1 %cmp5.i, label %do.body.i, label %in.exit, !llvm.loop !24
in.exit: ; preds = %getchar_unlocked.exit29.i
store i32 0, ptr @qsize, align 4, !tbaa !5
%cmp143 = icmp sgt i32 %add3.i, 0
br i1 %cmp143, label %for.body.preheader, label %while.cond.preheader
for.body.preheader: ; preds = %in.exit
%wide.trip.count = zext i32 %add3.i to i64
br label %for.body
while.cond.preheader.loopexit: ; preds = %for.inc
%qsize.promoted152.pre = load i32, ptr @qsize, align 4, !tbaa !5
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.loopexit, %in.exit
%qsize.promoted152 = phi i32 [ %qsize.promoted152.pre, %while.cond.preheader.loopexit ], [ 0, %in.exit ]
%14 = sext i32 %add3.i to i64
br label %while.cond.outer
for.body: ; preds = %for.body.preheader, %for.inc
%15 = phi ptr [ %13, %for.body.preheader ], [ %42, %for.inc ]
%16 = phi ptr [ %13, %for.body.preheader ], [ %43, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %16, i64 0, i32 1
%17 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !16
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %16, i64 0, i32 2
%18 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !20
%cmp.not.i = icmp ult ptr %17, %18
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !21
cond.true.i: ; preds = %for.body
%call.i = tail call i32 @__uflow(ptr noundef nonnull %16) #4
%.pre = load ptr, ptr @stdin, align 8, !tbaa !14
%_IO_read_ptr.i78.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre, i64 0, i32 1
%.pre168 = load ptr, ptr %_IO_read_ptr.i78.phi.trans.insert, align 8, !tbaa !16
%_IO_read_end.i79.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre, i64 0, i32 2
%.pre169 = load ptr, ptr %_IO_read_end.i79.phi.trans.insert, align 8, !tbaa !20
br label %getchar_unlocked.exit
cond.false.i: ; preds = %for.body
%incdec.ptr.i = getelementptr inbounds i8, ptr %17, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !16
%19 = load i8, ptr %17, align 1, !tbaa !22
%conv3.i = zext i8 %19 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%20 = phi ptr [ %.pre, %cond.true.i ], [ %15, %cond.false.i ]
%21 = phi ptr [ %.pre169, %cond.true.i ], [ %18, %cond.false.i ]
%22 = phi ptr [ %.pre168, %cond.true.i ], [ %incdec.ptr.i, %cond.false.i ]
%23 = phi ptr [ %.pre, %cond.true.i ], [ %16, %cond.false.i ]
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%cmp2 = icmp eq i32 %cond.i, 121
%cmp.not.i80 = icmp ult ptr %22, %21
br i1 %cmp.not.i80, label %cond.false.i84, label %cond.true.i81, !prof !21
cond.true.i81: ; preds = %getchar_unlocked.exit
%call.i82 = tail call i32 @__uflow(ptr noundef nonnull %23) #4
%.pre170 = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit87
cond.false.i84: ; preds = %getchar_unlocked.exit
%_IO_read_ptr.i78 = getelementptr inbounds %struct._IO_FILE, ptr %23, i64 0, i32 1
%incdec.ptr.i85 = getelementptr inbounds i8, ptr %22, i64 1
store ptr %incdec.ptr.i85, ptr %_IO_read_ptr.i78, align 8, !tbaa !16
br label %getchar_unlocked.exit87
getchar_unlocked.exit87: ; preds = %cond.true.i81, %cond.false.i84
%24 = phi ptr [ %.pre170, %cond.true.i81 ], [ %20, %cond.false.i84 ]
%conv4 = zext i1 %cmp2 to i8
%arrayidx = getelementptr inbounds [1002 x i8], ptr @d, i64 0, i64 %indvars.iv
store i8 %conv4, ptr %arrayidx, align 1, !tbaa !22
%_IO_read_ptr.i.i88 = getelementptr inbounds %struct._IO_FILE, ptr %24, i64 0, i32 1
%25 = load ptr, ptr %_IO_read_ptr.i.i88, align 8, !tbaa !16
%_IO_read_end.i.i89 = getelementptr inbounds %struct._IO_FILE, ptr %24, i64 0, i32 2
%26 = load ptr, ptr %_IO_read_end.i.i89, align 8, !tbaa !20
%cmp.not.i.i90 = icmp ult ptr %25, %26
br i1 %cmp.not.i.i90, label %cond.false.i.i132, label %cond.true.i.i91, !prof !21
cond.true.i.i91: ; preds = %getchar_unlocked.exit87
%call.i.i92 = tail call i32 @__uflow(ptr noundef nonnull %24) #4
%.pre33.pre.pre.i93 = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit.i94
cond.false.i.i132: ; preds = %getchar_unlocked.exit87
%incdec.ptr.i.i133 = getelementptr inbounds i8, ptr %25, i64 1
store ptr %incdec.ptr.i.i133, ptr %_IO_read_ptr.i.i88, align 8, !tbaa !16
%27 = load i8, ptr %25, align 1, !tbaa !22
%conv3.i.i134 = zext i8 %27 to i32
br label %getchar_unlocked.exit.i94
getchar_unlocked.exit.i94: ; preds = %cond.false.i.i132, %cond.true.i.i91
%28 = phi ptr [ %.pre33.pre.pre.i93, %cond.true.i.i91 ], [ %24, %cond.false.i.i132 ]
%cond.i.i96 = phi i32 [ %call.i.i92, %cond.true.i.i91 ], [ %conv3.i.i134, %cond.false.i.i132 ]
%cmp30.i97 = icmp slt i32 %cond.i.i96, 48
br i1 %cmp30.i97, label %while.body.i119, label %do.body.i101.preheader
while.body.i119: ; preds = %getchar_unlocked.exit.i94, %getchar_unlocked.exit19.i126
%29 = phi ptr [ %34, %getchar_unlocked.exit19.i126 ], [ %28, %getchar_unlocked.exit.i94 ]
%30 = phi ptr [ %35, %getchar_unlocked.exit19.i126 ], [ %28, %getchar_unlocked.exit.i94 ]
%_IO_read_ptr.i10.i120 = getelementptr inbounds %struct._IO_FILE, ptr %30, i64 0, i32 1
%31 = load ptr, ptr %_IO_read_ptr.i10.i120, align 8, !tbaa !16
%_IO_read_end.i11.i121 = getelementptr inbounds %struct._IO_FILE, ptr %30, i64 0, i32 2
%32 = load ptr, ptr %_IO_read_end.i11.i121, align 8, !tbaa !20
%cmp.not.i12.i122 = icmp ult ptr %31, %32
br i1 %cmp.not.i12.i122, label %cond.false.i16.i129, label %cond.true.i13.i123, !prof !21
cond.true.i13.i123: ; preds = %while.body.i119
%call.i14.i124 = tail call i32 @__uflow(ptr noundef nonnull %30) #4
%.pre.i125 = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit19.i126
cond.false.i16.i129: ; preds = %while.body.i119
%incdec.ptr.i17.i130 = getelementptr inbounds i8, ptr %31, i64 1
store ptr %incdec.ptr.i17.i130, ptr %_IO_read_ptr.i10.i120, align 8, !tbaa !16
%33 = load i8, ptr %31, align 1, !tbaa !22
%conv3.i18.i131 = zext i8 %33 to i32
br label %getchar_unlocked.exit19.i126
getchar_unlocked.exit19.i126: ; preds = %cond.false.i16.i129, %cond.true.i13.i123
%34 = phi ptr [ %.pre.i125, %cond.true.i13.i123 ], [ %29, %cond.false.i16.i129 ]
%35 = phi ptr [ %.pre.i125, %cond.true.i13.i123 ], [ %30, %cond.false.i16.i129 ]
%cond.i15.i127 = phi i32 [ %call.i14.i124, %cond.true.i13.i123 ], [ %conv3.i18.i131, %cond.false.i16.i129 ]
%cmp.i128 = icmp slt i32 %cond.i15.i127, 48
br i1 %cmp.i128, label %while.body.i119, label %do.body.i101.preheader, !llvm.loop !23
do.body.i101.preheader: ; preds = %getchar_unlocked.exit19.i126, %getchar_unlocked.exit.i94
%.ph = phi ptr [ %28, %getchar_unlocked.exit.i94 ], [ %34, %getchar_unlocked.exit19.i126 ]
%.ph191 = phi ptr [ %28, %getchar_unlocked.exit.i94 ], [ %35, %getchar_unlocked.exit19.i126 ]
%c.1.i103.ph = phi i32 [ %cond.i.i96, %getchar_unlocked.exit.i94 ], [ %cond.i15.i127, %getchar_unlocked.exit19.i126 ]
br label %do.body.i101
do.body.i101: ; preds = %do.body.i101.preheader, %getchar_unlocked.exit29.i113
%36 = phi ptr [ %42, %getchar_unlocked.exit29.i113 ], [ %.ph, %do.body.i101.preheader ]
%37 = phi ptr [ %43, %getchar_unlocked.exit29.i113 ], [ %.ph191, %do.body.i101.preheader ]
%38 = phi ptr [ %44, %getchar_unlocked.exit29.i113 ], [ %.ph191, %do.body.i101.preheader ]
%n.0.i102 = phi i32 [ %add3.i106, %getchar_unlocked.exit29.i113 ], [ 0, %do.body.i101.preheader ]
%c.1.i103 = phi i32 [ %cond.i25.i114, %getchar_unlocked.exit29.i113 ], [ %c.1.i103.ph, %do.body.i101.preheader ]
%add.i104 = mul i32 %n.0.i102, 10
%and.i105 = and i32 %c.1.i103, 15
%add3.i106 = add nsw i32 %and.i105, %add.i104
%_IO_read_ptr.i20.i107 = getelementptr inbounds %struct._IO_FILE, ptr %38, i64 0, i32 1
%39 = load ptr, ptr %_IO_read_ptr.i20.i107, align 8, !tbaa !16
%_IO_read_end.i21.i108 = getelementptr inbounds %struct._IO_FILE, ptr %38, i64 0, i32 2
%40 = load ptr, ptr %_IO_read_end.i21.i108, align 8, !tbaa !20
%cmp.not.i22.i109 = icmp ult ptr %39, %40
br i1 %cmp.not.i22.i109, label %cond.false.i26.i116, label %cond.true.i23.i110, !prof !21
cond.true.i23.i110: ; preds = %do.body.i101
%call.i24.i111 = tail call i32 @__uflow(ptr noundef nonnull %38) #4
%.pre32.i112 = load ptr, ptr @stdin, align 8, !tbaa !14
br label %getchar_unlocked.exit29.i113
cond.false.i26.i116: ; preds = %do.body.i101
%incdec.ptr.i27.i117 = getelementptr inbounds i8, ptr %39, i64 1
store ptr %incdec.ptr.i27.i117, ptr %_IO_read_ptr.i20.i107, align 8, !tbaa !16
%41 = load i8, ptr %39, align 1, !tbaa !22
%conv3.i28.i118 = zext i8 %41 to i32
br label %getchar_unlocked.exit29.i113
getchar_unlocked.exit29.i113: ; preds = %cond.false.i26.i116, %cond.true.i23.i110
%42 = phi ptr [ %.pre32.i112, %cond.true.i23.i110 ], [ %36, %cond.false.i26.i116 ]
%43 = phi ptr [ %.pre32.i112, %cond.true.i23.i110 ], [ %37, %cond.false.i26.i116 ]
%44 = phi ptr [ %.pre32.i112, %cond.true.i23.i110 ], [ %38, %cond.false.i26.i116 ]
%cond.i25.i114 = phi i32 [ %call.i24.i111, %cond.true.i23.i110 ], [ %conv3.i28.i118, %cond.false.i26.i116 ]
%cmp5.i115 = icmp sgt i32 %cond.i25.i114, 47
br i1 %cmp5.i115, label %do.body.i101, label %in.exit135, !llvm.loop !24
in.exit135: ; preds = %getchar_unlocked.exit29.i113
%arrayidx7 = getelementptr inbounds [1002 x i32], ptr @w, i64 0, i64 %indvars.iv
store i32 %add3.i106, ptr %arrayidx7, align 4, !tbaa !5
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %in.exit135
%45 = load i32, ptr @qsize, align 4, !tbaa !5
%inc.i = add nsw i32 %45, 1
store i32 %inc.i, ptr @qsize, align 4, !tbaa !5
%idxprom.i = sext i32 %45 to i64
%arrayidx.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i
%t1.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i, i32 1
store i32 %add3.i106, ptr %t1.i, align 4, !tbaa !9
%46 = trunc i64 %indvars.iv to i32
store i32 %46, ptr %arrayidx.i, align 8, !tbaa !11
%cmp28.i = icmp sgt i32 %45, 0
br i1 %cmp28.i, label %land.rhs.i, label %for.inc
land.rhs.i: ; preds = %if.then, %while.body.i136
%i.029.i = phi i32 [ %shr.i, %while.body.i136 ], [ %45, %if.then ]
%shr.i = lshr i32 %i.029.i, 1
%idxprom5.i = zext i32 %shr.i to i64
%t7.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5.i, i32 1
%47 = load i32, ptr %t7.i, align 4, !tbaa !9
%idxprom8.i = zext i32 %i.029.i to i64
%t10.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i, i32 1
%48 = load i32, ptr %t10.i, align 4, !tbaa !9
%cmp11.i = icmp sgt i32 %47, %48
br i1 %cmp11.i, label %while.body.i136, label %for.inc
while.body.i136: ; preds = %land.rhs.i
%arrayidx9.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i
%arrayidx6.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5.i
%49 = load i64, ptr %arrayidx9.i, align 8
%50 = load i64, ptr %arrayidx6.i, align 8
store i64 %50, ptr %arrayidx9.i, align 8
store i64 %49, ptr %arrayidx6.i, align 8
%cmp.not.i137 = icmp ult i32 %i.029.i, 2
br i1 %cmp.not.i137, label %for.inc, label %land.rhs.i, !llvm.loop !12
for.inc: ; preds = %while.body.i136, %land.rhs.i, %if.then, %in.exit135
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %while.cond.preheader.loopexit, label %for.body, !llvm.loop !25
while.cond: ; preds = %while.cond.outer, %deq.exit
%indvars.iv158 = phi i64 [ %71, %while.cond.outer ], [ %indvars.iv.next159, %deq.exit ]
%51 = icmp eq i64 %indvars.iv158, 0
br i1 %51, label %while.end, label %while.body
while.body: ; preds = %while.cond
%52 = load i32, ptr @que, align 16, !tbaa !11
%53 = load i32, ptr getelementptr inbounds ([1002 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !9
%indvars.iv.next159 = add nsw i64 %indvars.iv158, -1
%54 = trunc i64 %indvars.iv.next159 to i32
store i32 %54, ptr @qsize, align 4, !tbaa !5
%arrayidx.i139 = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %indvars.iv.next159
%55 = load i64, ptr %arrayidx.i139, align 8
store i64 %55, ptr @que, align 16
br label %tailrecurse.i.i
tailrecurse.i.i: ; preds = %if.then18.i.i, %while.body
%i.tr.i.i = phi i32 [ 0, %while.body ], [ %min.1.i.i, %if.then18.i.i ]
%shl.i.i = shl i32 %i.tr.i.i, 1
%add.i.i = or i32 %shl.i.i, 1
%56 = sext i32 %shl.i.i to i64
%cmp.i.i = icmp sgt i64 %indvars.iv.next159, %56
br i1 %cmp.i.i, label %land.lhs.true.i.i, label %if.else.i.i
land.lhs.true.i.i: ; preds = %tailrecurse.i.i
%t.i.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %56, i32 1
%57 = load i32, ptr %t.i.i, align 4, !tbaa !9
%idxprom2.i.i = sext i32 %i.tr.i.i to i64
%t4.i.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2.i.i, i32 1
%58 = load i32, ptr %t4.i.i, align 4, !tbaa !9
%cmp5.i.i = icmp slt i32 %57, %58
br i1 %cmp5.i.i, label %if.end.i.i, label %if.else.i.i
if.else.i.i: ; preds = %land.lhs.true.i.i, %tailrecurse.i.i
br label %if.end.i.i
if.end.i.i: ; preds = %if.else.i.i, %land.lhs.true.i.i
%min.0.i.i = phi i32 [ %i.tr.i.i, %if.else.i.i ], [ %shl.i.i, %land.lhs.true.i.i ]
%59 = sext i32 %add.i.i to i64
%cmp6.i.i = icmp sgt i64 %indvars.iv.next159, %59
br i1 %cmp6.i.i, label %land.lhs.true7.i.i, label %if.end16.i.i
land.lhs.true7.i.i: ; preds = %if.end.i.i
%t10.i.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %59, i32 1
%60 = load i32, ptr %t10.i.i, align 4, !tbaa !9
%idxprom11.i.i = sext i32 %min.0.i.i to i64
%t13.i.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i.i, i32 1
%61 = load i32, ptr %t13.i.i, align 4, !tbaa !9
%cmp14.i.i = icmp slt i32 %60, %61
%spec.select.i.i = select i1 %cmp14.i.i, i32 %add.i.i, i32 %min.0.i.i
br label %if.end16.i.i
if.end16.i.i: ; preds = %land.lhs.true7.i.i, %if.end.i.i
%min.1.i.i = phi i32 [ %min.0.i.i, %if.end.i.i ], [ %spec.select.i.i, %land.lhs.true7.i.i ]
%cmp17.not.i.i = icmp eq i32 %min.1.i.i, %i.tr.i.i
br i1 %cmp17.not.i.i, label %deq.exit, label %if.then18.i.i
if.then18.i.i: ; preds = %if.end16.i.i
%idxprom19.i.i = sext i32 %i.tr.i.i to i64
%arrayidx20.i.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i.i
%62 = load i64, ptr %arrayidx20.i.i, align 8
%idxprom23.i.i = sext i32 %min.1.i.i to i64
%arrayidx24.i.i = getelementptr inbounds [1002 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i.i
%63 = load i64, ptr %arrayidx24.i.i, align 8
store i64 %63, ptr %arrayidx20.i.i, align 8
store i64 %62, ptr %arrayidx24.i.i, align 8
br label %tailrecurse.i.i
deq.exit: ; preds = %if.end16.i.i
%idxprom11 = sext i32 %52 to i64
%arrayidx12 = getelementptr inbounds [1002 x i8], ptr @mk, i64 0, i64 %idxprom11
%64 = load i8, ptr %arrayidx12, align 1, !tbaa !22
%tobool13.not = icmp eq i8 %64, 0
br i1 %tobool13.not, label %if.end15, label %while.cond, !llvm.loop !26
if.end15: ; preds = %deq.exit
%arrayidx12.le = getelementptr inbounds [1002 x i8], ptr @mk, i64 0, i64 %idxprom11
%inc16 = add nuw nsw i32 %ans.0.ph, 1
store i8 1, ptr %arrayidx12.le, align 1, !tbaa !22
%cmp20147 = icmp sgt i32 %52, 0
br i1 %cmp20147, label %for.body22.preheader, label %for.end35
for.body22.preheader: ; preds = %if.end15
%65 = zext i32 %52 to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %if.end31
%indvars.iv161 = phi i64 [ %65, %for.body22.preheader ], [ %indvars.iv.next162, %if.end31 ]
%indvars.iv.next162 = add nsw i64 %indvars.iv161, -1
%idxprom23 = and i64 %indvars.iv.next162, 4294967295
%arrayidx24 = getelementptr inbounds [1002 x i8], ptr @d, i64 0, i64 %idxprom23
%66 = load i8, ptr %arrayidx24, align 1, !tbaa !22
%tobool25.not = icmp eq i8 %66, 0
br i1 %tobool25.not, label %land.lhs.true, label %if.end31
land.lhs.true: ; preds = %for.body22
%arrayidx27 = getelementptr inbounds [1002 x i32], ptr @w, i64 0, i64 %idxprom23
%67 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28.not = icmp slt i32 %67, %53
br i1 %cmp28.not, label %if.end31, label %for.end35
if.end31: ; preds = %land.lhs.true, %for.body22
%arrayidx33 = getelementptr inbounds [1002 x i8], ptr @mk, i64 0, i64 %idxprom23
store i8 1, ptr %arrayidx33, align 1, !tbaa !22
%cmp20 = icmp ugt i64 %indvars.iv161, 1
br i1 %cmp20, label %for.body22, label %for.end35, !llvm.loop !27
for.end35: ; preds = %if.end31, %land.lhs.true, %if.end15
%i.2149 = add nsw i32 %52, 1
%cmp37150 = icmp slt i32 %i.2149, %add3.i
br i1 %cmp37150, label %for.body39.preheader, label %for.end54
for.body39.preheader: ; preds = %for.end35
%68 = sext i32 %i.2149 to i64
br label %for.body39
for.body39: ; preds = %for.body39.preheader, %if.end49
%indvars.iv164 = phi i64 [ %68, %for.body39.preheader ], [ %indvars.iv.next165, %if.end49 ]
%arrayidx41 = getelementptr inbounds [1002 x i8], ptr @d, i64 0, i64 %indvars.iv164
%69 = load i8, ptr %arrayidx41, align 1, !tbaa !22
%tobool42.not = icmp eq i8 %69, 0
br i1 %tobool42.not, label %land.lhs.true43, label %if.end49
land.lhs.true43: ; preds = %for.body39
%arrayidx45 = getelementptr inbounds [1002 x i32], ptr @w, i64 0, i64 %indvars.iv164
%70 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%cmp46.not = icmp slt i32 %70, %53
br i1 %cmp46.not, label %if.end49, label %for.end54
if.end49: ; preds = %land.lhs.true43, %for.body39
%arrayidx51 = getelementptr inbounds [1002 x i8], ptr @mk, i64 0, i64 %indvars.iv164
store i8 1, ptr %arrayidx51, align 1, !tbaa !22
%indvars.iv.next165 = add nsw i64 %indvars.iv164, 1
%cmp37 = icmp slt i64 %indvars.iv.next165, %14
br i1 %cmp37, label %for.body39, label %for.end54, !llvm.loop !28
for.end54: ; preds = %if.end49, %land.lhs.true43, %for.end35
br label %while.cond.outer, !llvm.loop !26
while.cond.outer: ; preds = %while.cond.preheader, %for.end54
%qsize.promoted153 = phi i32 [ %qsize.promoted152, %while.cond.preheader ], [ %54, %for.end54 ]
%ans.0.ph = phi i32 [ 0, %while.cond.preheader ], [ %inc16, %for.end54 ]
%71 = sext i32 %qsize.promoted153 to i64
br label %while.cond
while.end: ; preds = %while.cond
%call55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.ph)
ret i32 0
}
; 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 = { 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!17, !15, i64 8}
!17 = !{!"_IO_FILE", !6, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !15, i64 96, !15, i64 104, !6, i64 112, !6, i64 116, !18, i64 120, !19, i64 128, !7, i64 130, !7, i64 131, !15, i64 136, !18, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !18, i64 184, !6, i64 192, !7, i64 196}
!18 = !{!"long", !7, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = !{!17, !15, i64 16}
!21 = !{!"branch_weights", i32 2000, i32 1}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13}
!26 = distinct !{!26, !13}
!27 = distinct !{!27, !13}
!28 = distinct !{!28, !13}
|
#include<stdio.h>
#define MAX 101
#define BLACK 2
#define GLAY 1
#define WHITE 0
int a[MAX][MAX],color[MAX],d[MAX],f[MAX],n,time;
void visit(int u){
int v;
color[u]=GLAY;
d[u]=++time;
for(v=1;v<=n;v++){
if(a[u][v]==0)continue;
if(color[v]==WHITE)visit(v);
}
color[u]=BLACK;
f[u]=++time;
}
void dfs(){
int u;
for(u=1;u<=n;u++)color[u]=WHITE;
time=0;
for(u=1;u<=n;u++){
if(color[u]==WHITE)visit(u);
}
}
int main(){
int i,j,u,k,v;
scanf("%d",&n);
for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
a[i][j]=0;
}}
for(i=1;i<=n;i++){
scanf("%d",&u);
scanf("%d",&k);
for(j=1;j<=k;j++){
scanf("%d",&v);
a[u][v]=1;
}
}
dfs();
for(u=1;u<=n;u++)printf("%d %d %d\n",u,d[u],f[u]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194685/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194685/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@time = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@a = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @time, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @time, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not27 = icmp slt i32 %1, 1
br i1 %cmp.not27, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %3, 0
br i1 %cmp7, label %for.inc, label %if.end
if.end: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 0
br i1 %cmp10, label %if.then11, label %for.inc
if.then11: ; preds = %if.end
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end, %if.then11, %for.body
%6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %7
br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre30 = load i32, ptr @time, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%inc16 = add nsw i32 %8, 1
store i32 %inc16, ptr @time, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @dfs() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not16 = icmp slt i32 %0, 1
br i1 %cmp.not16, label %for.end.thread, label %for.body3.preheader
for.end.thread: ; preds = %entry
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.end9
for.body3.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([101 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.inc7
%3 = phi i32 [ %0, %for.body3.preheader ], [ %6, %for.inc7 ]
%indvars.iv = phi i64 [ 1, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ]
%arrayidx5 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %4, 0
br i1 %cmp6, label %if.then, label %for.inc7
if.then: ; preds = %for.body3
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.body3, %if.then
%6 = phi i32 [ %3, %for.body3 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp2.not.not = icmp slt i64 %indvars.iv, %7
br i1 %cmp2.not.not, label %for.body3, label %for.end9, !llvm.loop !11
for.end9: ; preds = %for.inc7, %for.end.thread
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%u = alloca i32, align 4
%k = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not50 = icmp slt i32 %0, 1
br i1 %cmp.not50, label %dfs.exit.thread, label %for.cond1.preheader.preheader
for.cond1.preheader.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.preheader.new
for.cond1.preheader.preheader.new: ; preds = %for.cond1.preheader.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader, %for.cond1.preheader.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.preheader.new ], [ %indvar.next.7, %for.cond1.preheader ]
%niter = phi i64 [ 0, %for.cond1.preheader.preheader.new ], [ %niter.next.7, %for.cond1.preheader ]
%4 = mul nuw nsw i64 %indvar, 404
%gep = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 %4
tail call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 404
%gep63 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 404), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 4 %gep63, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 404
%gep64 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 808), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 16 %gep64, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 404
%gep65 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 1212), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 4 %gep65, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 404
%gep66 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 1616), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 8 %gep66, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 404
%gep67 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 2020), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 4 %gep67, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 404
%gep68 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 2424), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 16 %gep68, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 404
%gep69 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 2828), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 4 %gep69, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader, !llvm.loop !12
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader, %for.cond1.preheader.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvar.next.7, %for.cond1.preheader ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.epil
for.cond1.preheader.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 404
%gep.epil = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 %12
tail call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.epil, !llvm.loop !13
for.cond9.preheader: ; preds = %for.cond1.preheader.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp.not50, label %dfs.exit.thread, label %for.body11
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%i.155 = phi i32 [ %inc26, %for.inc25 ], [ 1, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %u)
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp15.not52 = icmp slt i32 %13, 1
br i1 %cmp15.not52, label %for.inc25, label %for.body16
for.body16: ; preds = %for.body11, %for.body16
%j.153 = phi i32 [ %inc23, %for.body16 ], [ 1, %for.body11 ]
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%14 = load i32, ptr %u, align 4, !tbaa !5
%idxprom18 = sext i32 %14 to i64
%15 = load i32, ptr %v, align 4, !tbaa !5
%idxprom20 = sext i32 %15 to i64
%arrayidx21 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %idxprom18, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.153, 1
%16 = load i32, ptr %k, align 4, !tbaa !5
%cmp15.not.not = icmp slt i32 %j.153, %16
br i1 %cmp15.not.not, label %for.body16, label %for.inc25, !llvm.loop !15
for.inc25: ; preds = %for.body16, %for.body11
%inc26 = add nuw nsw i32 %i.155, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
%cmp10.not.not = icmp slt i32 %i.155, %.pr
br i1 %cmp10.not.not, label %for.body11, label %for.end27, !llvm.loop !16
for.end27: ; preds = %for.inc25
%cmp.not16.i = icmp slt i32 %.pr, 1
br i1 %cmp.not16.i, label %dfs.exit.thread, label %for.body3.preheader.i
dfs.exit.thread: ; preds = %for.end27, %for.cond9.preheader, %entry
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.end38
for.body3.preheader.i: ; preds = %for.end27
%17 = zext i32 %.pr to i64
%18 = shl nuw nsw i64 %17, 2
call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([101 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %18, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body3.i
for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i
%19 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %22, %for.inc7.i ]
%indvars.iv.i = phi i64 [ 1, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ]
%arrayidx5.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv.i
%20 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %20, 0
br i1 %cmp6.i, label %if.then.i, label %for.inc7.i
if.then.i: ; preds = %for.body3.i
%21 = trunc i64 %indvars.iv.i to i32
call void @visit(i32 noundef %21)
%.pre.i = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7.i
for.inc7.i: ; preds = %if.then.i, %for.body3.i
%22 = phi i32 [ %19, %for.body3.i ], [ %.pre.i, %if.then.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%23 = sext i32 %22 to i64
%cmp2.not.not.i = icmp slt i64 %indvars.iv.i, %23
br i1 %cmp2.not.not.i, label %for.body3.i, label %dfs.exit, !llvm.loop !11
dfs.exit: ; preds = %for.inc7.i
%24 = icmp slt i32 %22, 1
store i32 1, ptr %u, align 4, !tbaa !5
br i1 %24, label %for.end38, label %for.body30
for.body30: ; preds = %dfs.exit, %for.body30
%storemerge58 = phi i32 [ %inc37, %for.body30 ], [ 1, %dfs.exit ]
%idxprom31 = sext i32 %storemerge58 to i64
%arrayidx32 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom31
%25 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%arrayidx34 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom31
%26 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %storemerge58, i32 noundef %25, i32 noundef %26)
%27 = load i32, ptr %u, align 4, !tbaa !5
%inc37 = add nsw i32 %27, 1
store i32 %inc37, ptr %u, align 4, !tbaa !5
%28 = load i32, ptr @n, align 4, !tbaa !5
%cmp29.not.not = icmp slt i32 %27, %28
br i1 %cmp29.not.not, label %for.body30, label %for.end38, !llvm.loop !17
for.end38: ; preds = %for.body30, %dfs.exit.thread, %dfs.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
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 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
typedef struct ver{
int e[101];
int se;
int color;
} ver;
int n,u;
int time;
int a[101];
int b[101];
ver c[101];
void visit(int u){
int v,w;
c[u].color=1;
a[u] = ++time;
for(v=1;v<=c[u].se;v++){
w=c[u].e[v];
if(c[w].color == 0){
visit(w);
}
}
c[u].color = 2;
b[u] = ++time;
}
void dfs(){
int u;
for(u=1;u<=n;u++){
c[u].color = 0;
}
time = 0;
for(u=1;u<=n;u++){
if(c[u].color==0){
visit(u);
}
}
}
int main(){
int i,j,k,v;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&u);
scanf("%d",&k);
c[u].se=k;
for(j=1;j<=k;j++){
scanf("%d",&v);
c[u].e[j]=v;
}
}
dfs();
for(i=1;i<=n;i++){
printf("%d %d %d\n",i,a[i],b[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194742/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194742/source.c"
target datalayout = "e-m:e-p270: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.ver = type { [101 x i32], i32, i32 }
@c = dso_local local_unnamed_addr global [101 x %struct.ver] zeroinitializer, align 16
@time = dso_local local_unnamed_addr global i32 0, align 4
@a = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@u = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %idxprom
%color = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %idxprom, i32 2
store i32 1, ptr %color, align 4, !tbaa !5
%0 = load i32, ptr @time, align 4, !tbaa !10
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @time, align 4, !tbaa !10
%arrayidx2 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !10
%se = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %idxprom, i32 1
%1 = load i32, ptr %se, align 4, !tbaa !11
%cmp.not28 = icmp slt i32 %1, 1
br i1 %cmp.not28, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %5, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%arrayidx8 = getelementptr inbounds [101 x i32], ptr %arrayidx, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !10
%idxprom9 = sext i32 %3 to i64
%color11 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %idxprom9, i32 2
%4 = load i32, ptr %color11, align 4, !tbaa !5
%cmp12 = icmp eq i32 %4, 0
br i1 %cmp12, label %if.then, label %for.inc
if.then: ; preds = %for.body
tail call void @visit(i32 noundef %3)
%.pre = load i32, ptr %se, align 4, !tbaa !11
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%5 = phi i32 [ %2, %for.body ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = sext i32 %5 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %6
br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !12
for.end.loopexit: ; preds = %for.inc
%.pre31 = load i32, ptr @time, align 4, !tbaa !10
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%7 = phi i32 [ %.pre31, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %color, align 4, !tbaa !5
%inc17 = add nsw i32 %7, 1
store i32 %inc17, ptr @time, align 4, !tbaa !10
%arrayidx19 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %idxprom
store i32 %inc17, ptr %arrayidx19, align 4, !tbaa !10
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @dfs() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !10
%cmp.not17 = icmp slt i32 %0, 1
br i1 %cmp.not17, label %for.end.thread, label %for.body.preheader
for.end.thread: ; preds = %entry
store i32 0, ptr @time, align 4, !tbaa !10
br label %for.end10
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%3 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %2, 3
%4 = icmp ult i64 %3, 3
br i1 %4, label %for.end.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %2, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%color = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv, i32 2
store i32 0, ptr %color, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%color.1 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.next, i32 2
store i32 0, ptr %color.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%color.2 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.next.1, i32 2
store i32 0, ptr %color.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%color.3 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.next.2, i32 2
store i32 0, ptr %color.3, align 4, !tbaa !5
%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.unr-lcssa, label %for.body, !llvm.loop !14
for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.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.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.unr-lcssa ]
%color.epil = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.epil, i32 2
store i32 0, ptr %color.epil, align 4, !tbaa !5
%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 !15
for.end: ; preds = %for.body.epil, %for.end.unr-lcssa
store i32 0, ptr @time, align 4, !tbaa !10
br i1 %cmp.not17, label %for.end10, label %for.body3
for.body3: ; preds = %for.end, %for.inc8
%5 = phi i32 [ %8, %for.inc8 ], [ %0, %for.end ]
%indvars.iv22 = phi i64 [ %indvars.iv.next23, %for.inc8 ], [ 1, %for.end ]
%color6 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv22, i32 2
%6 = load i32, ptr %color6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %6, 0
br i1 %cmp7, label %if.then, label %for.inc8
if.then: ; preds = %for.body3
%7 = trunc i64 %indvars.iv22 to i32
tail call void @visit(i32 noundef %7)
%.pre = load i32, ptr @n, align 4, !tbaa !10
br label %for.inc8
for.inc8: ; preds = %for.body3, %if.then
%8 = phi i32 [ %5, %for.body3 ], [ %.pre, %if.then ]
%indvars.iv.next23 = add nuw nsw i64 %indvars.iv22, 1
%9 = sext i32 %8 to i64
%cmp2.not.not = icmp slt i64 %indvars.iv22, %9
br i1 %cmp2.not.not, label %for.body3, label %for.end10, !llvm.loop !17
for.end10: ; preds = %for.inc8, %for.end.thread, %for.end
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%k = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !10
%cmp.not35 = icmp slt i32 %0, 1
br i1 %cmp.not35, label %dfs.exit.thread, label %for.body
for.body: ; preds = %entry, %for.inc11
%i.036 = phi i32 [ %inc12, %for.inc11 ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @u)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%1 = load i32, ptr %k, align 4, !tbaa !10
%2 = load i32, ptr @u, align 4, !tbaa !10
%idxprom = sext i32 %2 to i64
%se = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %idxprom, i32 1
store i32 %1, ptr %se, align 4, !tbaa !11
%cmp4.not33 = icmp slt i32 %1, 1
br i1 %cmp4.not33, label %for.inc11, label %for.body5
for.body5: ; preds = %for.body, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 1, %for.body ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%3 = load i32, ptr %v, align 4, !tbaa !10
%4 = load i32, ptr @u, align 4, !tbaa !10
%idxprom7 = sext i32 %4 to i64
%arrayidx8 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %idxprom7
%arrayidx10 = getelementptr inbounds [101 x i32], ptr %arrayidx8, i64 0, i64 %indvars.iv
store i32 %3, ptr %arrayidx10, align 4, !tbaa !10
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %k, align 4, !tbaa !10
%6 = sext i32 %5 to i64
%cmp4.not.not = icmp slt i64 %indvars.iv, %6
br i1 %cmp4.not.not, label %for.body5, label %for.inc11, !llvm.loop !18
for.inc11: ; preds = %for.body5, %for.body
%inc12 = add nuw nsw i32 %i.036, 1
%7 = load i32, ptr @n, align 4, !tbaa !10
%cmp.not.not = icmp slt i32 %i.036, %7
br i1 %cmp.not.not, label %for.body, label %for.end13, !llvm.loop !19
for.end13: ; preds = %for.inc11
%cmp.not17.i = icmp slt i32 %7, 1
br i1 %cmp.not17.i, label %dfs.exit.thread, label %for.body.preheader.i
dfs.exit.thread: ; preds = %for.end13, %entry
store i32 0, ptr @time, align 4, !tbaa !10
br label %for.end24
for.body.preheader.i: ; preds = %for.end13
%8 = add nuw nsw i32 %7, 1
%wide.trip.count.i = zext i32 %8 to i64
%9 = add nsw i64 %wide.trip.count.i, -1
%10 = add nsw i64 %wide.trip.count.i, -2
%xtraiter = and i64 %9, 3
%11 = icmp ult i64 %10, 3
br i1 %11, label %for.end.i.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i64 %9, -4
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i.new ], [ %indvars.iv.next.i.3, %for.body.i ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.3, %for.body.i ]
%color.i = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.i, i32 2
store i32 0, ptr %color.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%color.i.1 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.next.i, i32 2
store i32 0, ptr %color.i.1, align 4, !tbaa !5
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%color.i.2 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.next.i.1, i32 2
store i32 0, ptr %color.i.2, align 4, !tbaa !5
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%color.i.3 = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.next.i.2, i32 2
store i32 0, ptr %color.i.3, align 4, !tbaa !5
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.i.unr-lcssa, label %for.body.i, !llvm.loop !14
for.end.i.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i.unr = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i.3, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.i, label %for.body.i.epil
for.body.i.epil: ; preds = %for.end.i.unr-lcssa, %for.body.i.epil
%indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %for.body.i.epil ], [ %indvars.iv.i.unr, %for.end.i.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %for.end.i.unr-lcssa ]
%color.i.epil = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv.i.epil, i32 2
store i32 0, ptr %color.i.epil, align 4, !tbaa !5
%indvars.iv.next.i.epil = add nuw nsw i64 %indvars.iv.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end.i, label %for.body.i.epil, !llvm.loop !20
for.end.i: ; preds = %for.body.i.epil, %for.end.i.unr-lcssa
store i32 0, ptr @time, align 4, !tbaa !10
br label %for.body3.i
for.body3.i: ; preds = %for.end.i, %for.inc8.i
%12 = phi i32 [ %15, %for.inc8.i ], [ %7, %for.end.i ]
%indvars.iv22.i = phi i64 [ %indvars.iv.next23.i, %for.inc8.i ], [ 1, %for.end.i ]
%color6.i = getelementptr inbounds [101 x %struct.ver], ptr @c, i64 0, i64 %indvars.iv22.i, i32 2
%13 = load i32, ptr %color6.i, align 4, !tbaa !5
%cmp7.i = icmp eq i32 %13, 0
br i1 %cmp7.i, label %if.then.i, label %for.inc8.i
if.then.i: ; preds = %for.body3.i
%14 = trunc i64 %indvars.iv22.i to i32
call void @visit(i32 noundef %14)
%.pre.i = load i32, ptr @n, align 4, !tbaa !10
br label %for.inc8.i
for.inc8.i: ; preds = %if.then.i, %for.body3.i
%15 = phi i32 [ %12, %for.body3.i ], [ %.pre.i, %if.then.i ]
%indvars.iv.next23.i = add nuw nsw i64 %indvars.iv22.i, 1
%16 = sext i32 %15 to i64
%cmp2.not.not.i = icmp slt i64 %indvars.iv22.i, %16
br i1 %cmp2.not.not.i, label %for.body3.i, label %dfs.exit, !llvm.loop !17
dfs.exit: ; preds = %for.inc8.i
%17 = icmp slt i32 %15, 1
br i1 %17, label %for.end24, label %for.body16
for.body16: ; preds = %dfs.exit, %for.body16
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body16 ], [ 1, %dfs.exit ]
%arrayidx18 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv41
%18 = load i32, ptr %arrayidx18, align 4, !tbaa !10
%arrayidx20 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv41
%19 = load i32, ptr %arrayidx20, align 4, !tbaa !10
%20 = trunc i64 %indvars.iv41 to i32
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %20, i32 noundef %18, i32 noundef %19)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%21 = load i32, ptr @n, align 4, !tbaa !10
%22 = sext i32 %21 to i64
%cmp15.not.not = icmp slt i64 %indvars.iv41, %22
br i1 %cmp15.not.not, label %for.body16, label %for.end24, !llvm.loop !21
for.end24: ; preds = %for.body16, %dfs.exit.thread, %dfs.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !9, i64 408}
!6 = !{!"ver", !7, i64 0, !9, i64 404, !9, i64 408}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!9, !9, i64 0}
!11 = !{!6, !9, i64 404}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !13}
|
#include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, M[N][N];
int color[N],d[N],e[N],t;
void dfs_a( int u ){
int v;
color[u] = GRAY;
d[u] = ++t;
for ( v = 0 ; v < n ; v++ ){
if( M[u][v] == 0)continue;
if( color[v] == WHITE ){
dfs_a( v );
}
}
color[u] = BLACK;
e[u] = ++t;
}
void dfs_b(){
int u;
for ( u = 0 ; u < n; u++ ){
color[u] = WHITE;
}
t = 0;
for( u = 0 ; u < n ; u++ ){
if( color[u] == WHITE )dfs_a(u);
}
for( u = 0 ; u < n ; u++ ){
printf("%d %d %d\n",u+1 ,d[u] ,e[u]);
}
}
int main( void ){
int u,v,k,i,j;
scanf("%d",&n);
for( i = 0 ; i < n ; i++ ){
for( j = 0 ; j < n ; j++ ){
M[i][j] = 0;
}
}
for( i = 0 ; i < n ; i++ ){
scanf("%d %d",&u,&k);
u--;
for( j = 0 ; j < k ; j++ ){
scanf("%d",&v);
v--;
M[u][v] = 1;
}
}
dfs_b();
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194786/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194786/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@e = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs_a(i32 noundef %u) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @t, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @t, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %3, 0
br i1 %cmp7, label %for.inc, label %if.end
if.end: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 0
br i1 %cmp10, label %if.then11, label %for.inc
if.then11: ; preds = %if.end
%5 = trunc i64 %indvars.iv to i32
tail call void @dfs_a(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end, %if.then11, %for.body
%6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre30 = load i32, ptr @t, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%inc16 = add nsw i32 %8, 1
store i32 %inc16, ptr @t, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [100 x i32], ptr @e, i64 0, i64 %idxprom
store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @dfs_b() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread
for.cond10.preheader.thread: ; preds = %entry
store i32 0, ptr @t, align 4, !tbaa !5
br label %for.end19
for.body3.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5
store i32 0, ptr @t, align 4, !tbaa !5
br label %for.body3
for.cond10.preheader: ; preds = %for.inc7
%3 = icmp sgt i32 %7, 0
br i1 %3, label %for.body12, label %for.end19
for.body3: ; preds = %for.body3.preheader, %for.inc7
%4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ]
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ]
%arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %5, 0
br i1 %cmp6, label %if.then, label %for.inc7
if.then: ; preds = %for.body3
%6 = trunc i64 %indvars.iv to i32
tail call void @dfs_a(i32 noundef %6)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.body3, %if.then
%7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = sext i32 %7 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11
for.body12: ; preds = %for.cond10.preheader, %for.body12
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ]
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds [100 x i32], ptr @e, i64 0, i64 %indvars.iv39
%10 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%11 = trunc i64 %indvars.iv.next40 to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10)
%12 = load i32, ptr @n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp11 = icmp slt i64 %indvars.iv.next40, %13
br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12
for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader
ret void
}
; 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:
%u = alloca i32, align 4
%v = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %0, 0
br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %for.cond10.preheader.thread.i
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 400
%scevgep = getelementptr i8, ptr @M, i64 %4
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 400
%gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 400
%gep51 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 400
%gep52 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 400
%gep53 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 400
%gep54 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 400
%gep55 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 400
%gep56 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !13
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 400
%scevgep.epil = getelementptr i8, ptr @M, i64 %12
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !14
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp40, label %for.body11, label %for.cond10.preheader.thread.i
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %u, align 4, !tbaa !5
%dec = add nsw i32 %13, -1
store i32 %dec, ptr %u, align 4, !tbaa !5
%14 = load i32, ptr %k, align 4, !tbaa !5
%cmp1442 = icmp sgt i32 %14, 0
br i1 %cmp1442, label %for.body15, label %for.inc25
for.body15: ; preds = %for.body11, %for.body15
%j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v)
%15 = load i32, ptr %v, align 4, !tbaa !5
%dec17 = add nsw i32 %15, -1
store i32 %dec17, ptr %v, align 4, !tbaa !5
%16 = load i32, ptr %u, align 4, !tbaa !5
%idxprom18 = sext i32 %16 to i64
%idxprom20 = sext i32 %dec17 to i64
%arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.143, 1
%17 = load i32, ptr %k, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc23, %17
br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !16
for.inc25: ; preds = %for.body15, %for.body11
%inc26 = add nuw nsw i32 %i.145, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc26, %.pr
br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !17
for.end27: ; preds = %for.inc25
%cmp31.i = icmp sgt i32 %.pr, 0
br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i
for.cond10.preheader.thread.i: ; preds = %entry, %for.cond9.preheader, %for.end27
store i32 0, ptr @t, align 4, !tbaa !5
br label %dfs_b.exit
for.body3.preheader.i: ; preds = %for.end27
%18 = zext i32 %.pr to i64
%19 = shl nuw nsw i64 %18, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %19, i1 false), !tbaa !5
store i32 0, ptr @t, align 4, !tbaa !5
br label %for.body3.i
for.cond10.preheader.i: ; preds = %for.inc7.i
%20 = icmp sgt i32 %24, 0
br i1 %20, label %for.body12.i, label %dfs_b.exit
for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i
%21 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %24, %for.inc7.i ]
%indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ]
%arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i
%22 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %22, 0
br i1 %cmp6.i, label %if.then.i, label %for.inc7.i
if.then.i: ; preds = %for.body3.i
%23 = trunc i64 %indvars.iv.i to i32
call void @dfs_a(i32 noundef %23)
%.pre.i = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7.i
for.inc7.i: ; preds = %if.then.i, %for.body3.i
%24 = phi i32 [ %21, %for.body3.i ], [ %.pre.i, %if.then.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%25 = sext i32 %24 to i64
%cmp2.i = icmp slt i64 %indvars.iv.next.i, %25
br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11
for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i
%indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ]
%indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1
%arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i
%26 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
%arrayidx16.i = getelementptr inbounds [100 x i32], ptr @e, i64 0, i64 %indvars.iv39.i
%27 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5
%28 = trunc i64 %indvars.iv.next40.i to i32
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28, i32 noundef %26, i32 noundef %27)
%29 = load i32, ptr @n, align 4, !tbaa !5
%30 = sext i32 %29 to i64
%cmp11.i = icmp slt i64 %indvars.iv.next40.i, %30
br i1 %cmp11.i, label %for.body12.i, label %dfs_b.exit, !llvm.loop !12
dfs_b.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
#include<stdlib.h>
#define N 100
int n,time;
int g[N][N],color[N],d[N],f[N];
void visit(int u){
int i;
color[u]=1;
d[u]=++time;
for(i=0;i<n;i++){
if(g[u][i]==0) continue;
if(color[i]==0) visit(i);
}
color[u] = 2;
f[u]= ++time;
}
void dfs(){
int i;
for(i=0;i<n;i++) color[i]=0;
time = 0;
for(i=0;i<n;i++){
if(color[i] == 0) visit(i);
}
}
int main(){
int i,j;
int u,v,k;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
g[i][j]=0;
}
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k;j++){
scanf("%d",&v);
g[u-1][v-1]=1;
}
}
dfs();
for(i=0;i<n;i++) printf("%d %d %d\n",i+1,d[i],f[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194850/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194850/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@time = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@g = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@f = 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 [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @time, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @time, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @g, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %3, 0
br i1 %cmp7, label %for.inc, label %if.end
if.end: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 0
br i1 %cmp10, label %if.then11, label %for.inc
if.then11: ; preds = %if.end
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end, %if.then11, %for.body
%6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre30 = load i32, ptr @time, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%inc16 = add nsw i32 %8, 1
store i32 %inc16, ptr @time, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @dfs() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.body3.preheader, label %for.end
for.end: ; preds = %entry
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.end9
for.body3.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.inc7
%3 = phi i32 [ %0, %for.body3.preheader ], [ %6, %for.inc7 ]
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ]
%arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %4, 0
br i1 %cmp6, label %if.then, label %for.inc7
if.then: ; preds = %for.body3
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.body3, %if.then
%6 = phi i32 [ %3, %for.body3 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp2, label %for.body3, label %for.end9, !llvm.loop !11
for.end9: ; preds = %for.inc7, %for.end
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%u = alloca i32, align 4
%v = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.cond1.preheader.us.preheader, label %dfs.exit.thread
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 400
%scevgep = getelementptr i8, ptr @g, i64 %4
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 400
%gep = getelementptr i8, ptr getelementptr (i8, ptr @g, i64 400), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 400
%gep70 = getelementptr i8, ptr getelementptr (i8, ptr @g, i64 800), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 16 %gep70, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 400
%gep71 = getelementptr i8, ptr getelementptr (i8, ptr @g, i64 1200), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 16 %gep71, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 400
%gep72 = getelementptr i8, ptr getelementptr (i8, ptr @g, i64 1600), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 16 %gep72, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 400
%gep73 = getelementptr i8, ptr getelementptr (i8, ptr @g, i64 2000), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 16 %gep73, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 400
%gep74 = getelementptr i8, ptr getelementptr (i8, ptr @g, i64 2400), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 16 %gep74, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 400
%gep75 = getelementptr i8, ptr getelementptr (i8, ptr @g, i64 2800), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 16 %gep75, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !12
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 400
%scevgep.epil = getelementptr i8, ptr @g, i64 %12
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !13
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp55, label %for.body11, label %dfs.exit.thread
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%i.160 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp1457 = icmp sgt i32 %13, 0
br i1 %cmp1457, label %for.body15, label %for.inc25
for.body15: ; preds = %for.body11, %for.body15
%j.158 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%14 = load i32, ptr %u, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%idxprom17 = sext i32 %sub to i64
%15 = load i32, ptr %v, align 4, !tbaa !5
%sub19 = add nsw i32 %15, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @g, i64 0, i64 %idxprom17, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.158, 1
%16 = load i32, ptr %k, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc23, %16
br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !15
for.inc25: ; preds = %for.body15, %for.body11
%inc26 = add nuw nsw i32 %i.160, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc26, %.pr
br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !16
for.end27: ; preds = %for.inc25
%cmp16.i = icmp sgt i32 %.pr, 0
br i1 %cmp16.i, label %for.body3.preheader.i, label %dfs.exit.thread
dfs.exit.thread: ; preds = %for.end27, %for.cond9.preheader, %entry
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.end38
for.body3.preheader.i: ; preds = %for.end27
%17 = zext i32 %.pr to i64
%18 = shl nuw nsw i64 %17, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %18, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body3.i
for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i
%19 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %22, %for.inc7.i ]
%indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ]
%arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i
%20 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %20, 0
br i1 %cmp6.i, label %if.then.i, label %for.inc7.i
if.then.i: ; preds = %for.body3.i
%21 = trunc i64 %indvars.iv.i to i32
call void @visit(i32 noundef %21)
%.pre.i = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7.i
for.inc7.i: ; preds = %if.then.i, %for.body3.i
%22 = phi i32 [ %19, %for.body3.i ], [ %.pre.i, %if.then.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%23 = sext i32 %22 to i64
%cmp2.i = icmp slt i64 %indvars.iv.next.i, %23
br i1 %cmp2.i, label %for.body3.i, label %dfs.exit, !llvm.loop !11
dfs.exit: ; preds = %for.inc7.i
%24 = icmp sgt i32 %22, 0
br i1 %24, label %for.body30, label %for.end38
for.body30: ; preds = %dfs.exit, %for.body30
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body30 ], [ 0, %dfs.exit ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx32 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv
%25 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%arrayidx34 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv
%26 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%27 = trunc i64 %indvars.iv.next to i32
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27, i32 noundef %25, i32 noundef %26)
%28 = load i32, ptr @n, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp29 = icmp slt i64 %indvars.iv.next, %29
br i1 %cmp29, label %for.body30, label %for.end38, !llvm.loop !17
for.end38: ; preds = %for.body30, %dfs.exit.thread, %dfs.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
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 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
#define N 200
#define WHITE 0
#define BLACK 1
#define GRAY 2
void dfs(void);
void visit(int);
int time=0;
int d[N];
int f[N];
int color[N];
int n;
int array[N][N];
int main(){
int i,j,u,k,vk;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
array[i][j]=0;
}
}
for(i=1;i<=n;i++){
scanf("%d",&u);
scanf("%d",&k);
for(j=1;j<=k;j++){
scanf("%d",&vk);
array[i][vk]=BLACK;
}
}
dfs();
for(i=1;i<=n;i++){
printf("%d %d %d\n",i,d[i],f[i]);
}
return 0;
}
void dfs(void){
int u;
for(u=1;u<=n;u++){
color[u]=WHITE;
}
time=0;
for(u=1;u<=n;u++){
if(color[u]==WHITE){
visit(u);
}
}
}
void visit(int u){
int v;
color[u]=GRAY;
d[u]=++time;
for(v=1;v<=n;v++){
if(color[v]==WHITE && array[u][v]==BLACK){
visit(v);
}
}
color[u]=BLACK;
f[u]=++time;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194894/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194894/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@time = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@array = dso_local local_unnamed_addr global [200 x [200 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@d = dso_local local_unnamed_addr global [200 x i32] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [200 x i32] zeroinitializer, align 16
@color = dso_local local_unnamed_addr global [200 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%u = alloca i32, align 4
%k = alloca i32, align 4
%vk = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %vk) #6
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp56 = icmp sgt i32 %0, 0
br i1 %cmp56, label %for.cond1.preheader.us.preheader, label %dfs.exit.thread
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 800
%scevgep = getelementptr i8, ptr @array, i64 %4
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 800
%gep = getelementptr i8, ptr getelementptr (i8, ptr @array, i64 800), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 800
%gep75 = getelementptr i8, ptr getelementptr (i8, ptr @array, i64 1600), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 16 %gep75, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 800
%gep76 = getelementptr i8, ptr getelementptr (i8, ptr @array, i64 2400), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 16 %gep76, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 800
%gep77 = getelementptr i8, ptr getelementptr (i8, ptr @array, i64 3200), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 16 %gep77, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 800
%gep78 = getelementptr i8, ptr getelementptr (i8, ptr @array, i64 4000), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 16 %gep78, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 800
%gep79 = getelementptr i8, ptr getelementptr (i8, ptr @array, i64 4800), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 16 %gep79, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 800
%gep80 = getelementptr i8, ptr getelementptr (i8, ptr @array, i64 5600), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 16 %gep80, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 800
%scevgep.epil = getelementptr i8, ptr @array, i64 %12
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
%cmp10.not60 = icmp slt i32 %0, 1
br i1 %cmp10.not60, label %dfs.exit.thread, label %for.body11
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc25 ], [ 1, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %u)
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp15.not58 = icmp slt i32 %13, 1
br i1 %cmp15.not58, label %for.inc25, label %for.body16
for.body16: ; preds = %for.body11, %for.body16
%j.159 = phi i32 [ %inc23, %for.body16 ], [ 1, %for.body11 ]
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vk)
%14 = load i32, ptr %vk, align 4, !tbaa !5
%idxprom20 = sext i32 %14 to i64
%arrayidx21 = getelementptr inbounds [200 x [200 x i32]], ptr @array, i64 0, i64 %indvars.iv, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.159, 1
%15 = load i32, ptr %k, align 4, !tbaa !5
%cmp15.not.not = icmp slt i32 %j.159, %15
br i1 %cmp15.not.not, label %for.body16, label %for.inc25, !llvm.loop !13
for.inc25: ; preds = %for.body16, %for.body11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
%16 = sext i32 %.pr to i64
%cmp10.not.not = icmp slt i64 %indvars.iv, %16
br i1 %cmp10.not.not, label %for.body11, label %for.end27, !llvm.loop !14
for.end27: ; preds = %for.inc25
%cmp.not16.i = icmp slt i32 %.pr, 1
br i1 %cmp.not16.i, label %dfs.exit.thread, label %for.body3.preheader.i
dfs.exit.thread: ; preds = %for.end27, %for.cond9.preheader, %entry
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.end38
for.body3.preheader.i: ; preds = %for.end27
%17 = zext i32 %.pr to i64
%18 = shl nuw nsw i64 %17, 2
call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([200 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %18, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body3.i
for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i
%19 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %22, %for.inc7.i ]
%indvars.iv.i = phi i64 [ 1, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ]
%arrayidx5.i = getelementptr inbounds [200 x i32], ptr @color, i64 0, i64 %indvars.iv.i
%20 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %20, 0
br i1 %cmp6.i, label %if.then.i, label %for.inc7.i
if.then.i: ; preds = %for.body3.i
%21 = trunc i64 %indvars.iv.i to i32
call void @visit(i32 noundef %21)
%.pre.i = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7.i
for.inc7.i: ; preds = %if.then.i, %for.body3.i
%22 = phi i32 [ %19, %for.body3.i ], [ %.pre.i, %if.then.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%23 = sext i32 %22 to i64
%cmp2.not.not.i = icmp slt i64 %indvars.iv.i, %23
br i1 %cmp2.not.not.i, label %for.body3.i, label %dfs.exit, !llvm.loop !15
dfs.exit: ; preds = %for.inc7.i
%24 = icmp slt i32 %22, 1
br i1 %24, label %for.end38, label %for.body30
for.body30: ; preds = %dfs.exit, %for.body30
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.body30 ], [ 1, %dfs.exit ]
%arrayidx32 = getelementptr inbounds [200 x i32], ptr @d, i64 0, i64 %indvars.iv68
%25 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%arrayidx34 = getelementptr inbounds [200 x i32], ptr @f, i64 0, i64 %indvars.iv68
%26 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%27 = trunc i64 %indvars.iv68 to i32
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %27, i32 noundef %25, i32 noundef %26)
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%28 = load i32, ptr @n, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp29.not.not = icmp slt i64 %indvars.iv68, %29
br i1 %cmp29.not.not, label %for.body30, label %for.end38, !llvm.loop !16
for.end38: ; preds = %for.body30, %dfs.exit.thread, %dfs.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %vk) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @dfs() local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not16 = icmp slt i32 %0, 1
br i1 %cmp.not16, label %for.end.thread, label %for.body3.preheader
for.end.thread: ; preds = %entry
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.end9
for.body3.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([200 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.inc7
%3 = phi i32 [ %0, %for.body3.preheader ], [ %6, %for.inc7 ]
%indvars.iv = phi i64 [ 1, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ]
%arrayidx5 = getelementptr inbounds [200 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %4, 0
br i1 %cmp6, label %if.then, label %for.inc7
if.then: ; preds = %for.body3
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.body3, %if.then
%6 = phi i32 [ %3, %for.body3 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp2.not.not = icmp slt i64 %indvars.iv, %7
br i1 %cmp2.not.not, label %for.body3, label %for.end9, !llvm.loop !15
for.end9: ; preds = %for.inc7, %for.end.thread
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @visit(i32 noundef %u) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [200 x i32], ptr @color, i64 0, i64 %idxprom
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @time, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @time, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [200 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not25 = icmp slt i32 %1, 1
br i1 %cmp.not25, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%arrayidx4 = getelementptr inbounds [200 x i32], ptr @color, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %3, 0
br i1 %cmp5, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [200 x [200 x i32]], ptr @array, i64 0, i64 %idxprom, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 1
br i1 %cmp10, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %if.then
%6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %7
br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !17
for.end.loopexit: ; preds = %for.inc
%.pre28 = load i32, ptr @time, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre28, %for.end.loopexit ], [ %inc, %entry ]
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%inc14 = add nsw i32 %8, 1
store i32 %inc14, ptr @time, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds [200 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc14, ptr %arrayidx16, align 4, !tbaa !5
ret void
}
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
#define N 100
#define BLACK 1
#define GRAY 2
#define WHITE 3
int G[N][N],d[N],f[N],color[N];
int n,time;
void visit(int r){
int v;
color[r]=GRAY;
time++;
d[r]=time;
for(v=0;v<=n;v++){
if(G[r][v] && color[v]==WHITE){
visit(v);
}
}
color[r]=BLACK;
f[r]=++time;
}
void dfs(int n){
int u;
for(u=0;u<n;u++){
if(color[u]==WHITE){
visit(u);
}
}
}
int main(void){
int i,j,k,m;
scanf("%d",&n);
for(i=0;i<100;i++){
for(j=0;j<100;j++){
G[i][j]=0;
}
color[i] = WHITE;
}
for(i=0;i<n;i++){
scanf("%d%d",&j,&k);
for(j=0;j<k;j++){
scanf("%d",&m);
G[i][m-1]=1;
}
}
dfs(n);
for(i=0;i<n;i++)
printf("%d %d %d\n",i+1,d[i],f[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194937/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194937/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@time = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@G = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@f = 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 [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @visit(i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @time, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @time, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not24 = icmp slt i32 %1, 0
br i1 %cmp.not24, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body
%arrayidx8 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %4, 3
br i1 %cmp9, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %if.then
%6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %7
br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre27 = load i32, ptr @time, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre27, %for.end.loopexit ], [ %inc, %entry ]
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%inc13 = add nsw i32 %8, 1
store i32 %inc13, ptr @time, align 4, !tbaa !5
%arrayidx15 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc13, ptr %arrayidx15, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @dfs(i32 noundef %n) local_unnamed_addr #2 {
entry:
%cmp5 = icmp sgt i32 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n 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 [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 3
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%1 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %1)
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 !11
for.end: ; preds = %for.inc, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%j = alloca i32, align 4
%k = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) @G, i8 0, i64 40000, i1 false), !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr @color, align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 8), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 12), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 16), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 20), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 24), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 28), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 32), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 36), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 40), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 44), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 48), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 52), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 56), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 60), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 64), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 68), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 72), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 76), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 80), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 84), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 88), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 92), align 16, !tbaa !5
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 0, i64 96), align 16, !tbaa !5
store i32 100, ptr %j, align 4, !tbaa !5
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp1257 = icmp sgt i32 %0, 0
br i1 %cmp1257, label %for.body13, label %for.end39
for.body13: ; preds = %entry, %for.inc26
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc26 ], [ 0, %entry ]
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %j, ptr noundef nonnull %k)
store i32 0, ptr %j, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%cmp1656 = icmp sgt i32 %1, 0
br i1 %cmp1656, label %for.body17, label %for.inc26
for.body17: ; preds = %for.body13, %for.body17
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%2 = load i32, ptr %m, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom21 = sext i32 %sub to i64
%arrayidx22 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv, i64 %idxprom21
store i32 1, ptr %arrayidx22, align 4, !tbaa !5
%3 = load i32, ptr %j, align 4, !tbaa !5
%inc24 = add nsw i32 %3, 1
store i32 %inc24, ptr %j, align 4, !tbaa !5
%4 = load i32, ptr %k, align 4, !tbaa !5
%cmp16 = icmp slt i32 %inc24, %4
br i1 %cmp16, label %for.body17, label %for.inc26, !llvm.loop !12
for.inc26: ; preds = %for.body17, %for.body13
%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
%cmp12 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp12, label %for.body13, label %for.end28, !llvm.loop !13
for.end28: ; preds = %for.inc26
%cmp5.i = icmp sgt i32 %5, 0
br i1 %cmp5.i, label %for.body.preheader.i, label %for.end39
for.body.preheader.i: ; preds = %for.end28
%wide.trip.count.i = zext i32 %5 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %7, 3
br i1 %cmp1.i, label %if.then.i, label %for.inc.i
if.then.i: ; preds = %for.body.i
%8 = trunc i64 %indvars.iv.i to i32
call void @visit(i32 noundef %8)
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %dfs.exit, label %for.body.i, !llvm.loop !11
dfs.exit: ; preds = %for.inc.i
%.pre = load i32, ptr @n, align 4, !tbaa !5
%9 = icmp sgt i32 %.pre, 0
br i1 %9, label %for.body31, label %for.end39
for.body31: ; preds = %dfs.exit, %for.body31
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.body31 ], [ 0, %dfs.exit ]
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%arrayidx33 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv65
%10 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%arrayidx35 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv65
%11 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%12 = trunc i64 %indvars.iv.next66 to i32
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12, i32 noundef %10, i32 noundef %11)
%13 = load i32, ptr @n, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp30 = icmp slt i64 %indvars.iv.next66, %14
br i1 %cmp30, label %for.body31, label %for.end39, !llvm.loop !14
for.end39: ; preds = %for.body31, %entry, %for.end28, %dfs.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
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 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#define N 100
int G[N][N],d[N],f[N],color[N];
int n,time;
void visit(int u){
int i;
color[u]=1;
d[u]=++time;
for(i=0;i<n;i++){
if(G[u][i]!=0){
if(color[i]==0)
visit(i);
}
}
color[u]=2;
f[u]=++time;
}
void dfs(){
int i;
for(i=0;i<n;i++)
color[i]=0;
time=0;
for(i=0;i<n;i++)
if(color[i]==0)
visit(i);
for(i=0;i<n;i++)
printf("%d %d %d\n",i+1,d[i],f[i]);
}
int main(){
int i,j,u,k,v;
scanf("%d",&n);
for(i=0;i<n;i++)
for(j=0;j<n;j++)
G[i][j]=0;
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k;j++){
scanf("%d",&v);
G[u-1][v-1]=1;
}
}
dfs();
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194980/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194980/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@time = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@G = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @time, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @time, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7.not = icmp eq i32 %3, 0
br i1 %cmp7.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 0
br i1 %cmp10, label %if.then11, label %for.inc
if.then11: ; preds = %if.then
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then11, %if.then
%6 = phi i32 [ %2, %for.body ], [ %.pre, %if.then11 ], [ %2, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre30 = load i32, ptr @time, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%inc16 = add nsw i32 %8, 1
store i32 %inc16, ptr @time, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @dfs() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread
for.cond10.preheader.thread: ; preds = %entry
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.end19
for.body3.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body3
for.cond10.preheader: ; preds = %for.inc7
%3 = icmp sgt i32 %7, 0
br i1 %3, label %for.body12, label %for.end19
for.body3: ; preds = %for.body3.preheader, %for.inc7
%4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ]
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ]
%arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %5, 0
br i1 %cmp6, label %if.then, label %for.inc7
if.then: ; preds = %for.body3
%6 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %6)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.body3, %if.then
%7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = sext i32 %7 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11
for.body12: ; preds = %for.cond10.preheader, %for.body12
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ]
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39
%10 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%11 = trunc i64 %indvars.iv.next40 to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10)
%12 = load i32, ptr @n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp11 = icmp slt i64 %indvars.iv.next40, %13
br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12
for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader
ret void
}
; 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:
%u = alloca i32, align 4
%k = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %0, 0
br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %for.cond10.preheader.thread.i
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 400
%scevgep = getelementptr i8, ptr @G, i64 %4
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 400
%gep = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 400), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 400
%gep51 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 800), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 400
%gep52 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 1200), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 400
%gep53 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 1600), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 400
%gep54 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2000), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 400
%gep55 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2400), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 400
%gep56 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2800), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !13
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 400
%scevgep.epil = getelementptr i8, ptr @G, i64 %12
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !14
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp40, label %for.body11, label %for.cond10.preheader.thread.i
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp1442 = icmp sgt i32 %13, 0
br i1 %cmp1442, label %for.body15, label %for.inc25
for.body15: ; preds = %for.body11, %for.body15
%j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v)
%14 = load i32, ptr %u, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%idxprom17 = sext i32 %sub to i64
%15 = load i32, ptr %v, align 4, !tbaa !5
%sub19 = add nsw i32 %15, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom17, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.143, 1
%16 = load i32, ptr %k, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc23, %16
br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !16
for.inc25: ; preds = %for.body15, %for.body11
%inc26 = add nuw nsw i32 %i.145, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc26, %.pr
br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !17
for.end27: ; preds = %for.inc25
%cmp31.i = icmp sgt i32 %.pr, 0
br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i
for.cond10.preheader.thread.i: ; preds = %entry, %for.cond9.preheader, %for.end27
store i32 0, ptr @time, align 4, !tbaa !5
br label %dfs.exit
for.body3.preheader.i: ; preds = %for.end27
%17 = zext i32 %.pr to i64
%18 = shl nuw nsw i64 %17, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %18, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body3.i
for.cond10.preheader.i: ; preds = %for.inc7.i
%19 = icmp sgt i32 %23, 0
br i1 %19, label %for.body12.i, label %dfs.exit
for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i
%20 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %23, %for.inc7.i ]
%indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ]
%arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i
%21 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %21, 0
br i1 %cmp6.i, label %if.then.i, label %for.inc7.i
if.then.i: ; preds = %for.body3.i
%22 = trunc i64 %indvars.iv.i to i32
call void @visit(i32 noundef %22)
%.pre.i = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7.i
for.inc7.i: ; preds = %if.then.i, %for.body3.i
%23 = phi i32 [ %20, %for.body3.i ], [ %.pre.i, %if.then.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%24 = sext i32 %23 to i64
%cmp2.i = icmp slt i64 %indvars.iv.next.i, %24
br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11
for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i
%indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ]
%indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1
%arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i
%25 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
%arrayidx16.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39.i
%26 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5
%27 = trunc i64 %indvars.iv.next40.i to i32
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %27, i32 noundef %25, i32 noundef %26)
%28 = load i32, ptr @n, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp11.i = icmp slt i64 %indvars.iv.next40.i, %29
br i1 %cmp11.i, label %for.body12.i, label %dfs.exit, !llvm.loop !12
dfs.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
#define BLACK 2
#define GRAY 1
#define WHITE 0
#define N 101
int color[N];
int n, G[N][N],f[N],d[N],time;
void visit(int u){
int i;
color[u]=GRAY;
d[u]= ++time;
for(i=0; i<n; i++){
if(G[u][i] == 1){
if(color[i] == WHITE)visit(i);
}
}
color[u]= BLACK;
f[u]=++time;
}
int main(){
int i,j,v,vnext,k;
scanf("%d",&n);
for(i=0;i<n;i++){
color[i] = WHITE;
for(j=0;j<n;j++) {
G[i][j] = 0;
}
}
for(i=0; i<n; i++){
scanf("%d %d",&v,&k);
for(j=0; j<k; j++){
scanf("%d",&vnext);
G[v-1][vnext-1] = 1;
}
}
for(i=0; i<n; i++){
if(color[i]==WHITE) visit(i);
}
for(i=0;i<n;i++){
printf("%d %d %d\n",i+1,d[i],f[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195022/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195022/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@time = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@G = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @time, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @time, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr @G, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %3, 1
br i1 %cmp7, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 0
br i1 %cmp10, label %if.then11, label %for.inc
if.then11: ; preds = %if.then
%5 = trunc i64 %indvars.iv to i32
tail call void @visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then11, %if.then
%6 = phi i32 [ %2, %for.body ], [ %.pre, %if.then11 ], [ %2, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre30 = load i32, ptr @time, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%inc16 = add nsw i32 %8, 1
store i32 %inc16, ptr @time, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%v = alloca i32, align 4
%vnext = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %vnext) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp70 = icmp sgt i32 %0, 0
br i1 %cmp70, label %for.body.us.preheader, label %for.end49
for.body.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond11.preheader.unr-lcssa, label %for.body.us.preheader.new
for.body.us.preheader.new: ; preds = %for.body.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.body.us
for.body.us: ; preds = %for.body.us, %for.body.us.preheader.new
%indvar = phi i64 [ 0, %for.body.us.preheader.new ], [ %indvar.next.7, %for.body.us ]
%niter = phi i64 [ 0, %for.body.us.preheader.new ], [ %niter.next.7, %for.body.us ]
%4 = mul nuw nsw i64 %indvar, 404
%scevgep = getelementptr i8, ptr @G, i64 %4
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 404
%gep = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 404), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 404
%gep92 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 808), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 8 %gep92, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 404
%gep93 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 1212), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 4 %gep93, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 404
%gep94 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 1616), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 16 %gep94, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 404
%gep95 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2020), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 4 %gep95, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 404
%gep96 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2424), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 8 %gep96, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 404
%gep97 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2828), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 4 %gep97, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond11.preheader.unr-lcssa, label %for.body.us, !llvm.loop !11
for.cond11.preheader.unr-lcssa: ; preds = %for.body.us, %for.body.us.preheader
%indvar.unr = phi i64 [ 0, %for.body.us.preheader ], [ %indvar.next.7, %for.body.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond11.preheader, label %for.body.us.epil
for.body.us.epil: ; preds = %for.cond11.preheader.unr-lcssa, %for.body.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.body.us.epil ], [ %indvar.unr, %for.cond11.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.us.epil ], [ 0, %for.cond11.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 404
%scevgep.epil = getelementptr i8, ptr @G, i64 %12
tail call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond11.preheader, label %for.body.us.epil, !llvm.loop !12
for.cond11.preheader: ; preds = %for.body.us.epil, %for.cond11.preheader.unr-lcssa
br i1 %cmp70, label %for.body13, label %for.end49
for.cond30.preheader: ; preds = %for.inc27
%cmp3176 = icmp sgt i32 %17, 0
br i1 %cmp3176, label %for.body32, label %for.end49
for.body13: ; preds = %for.cond11.preheader, %for.inc27
%i.175 = phi i32 [ %inc28, %for.inc27 ], [ 0, %for.cond11.preheader ]
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp1672 = icmp sgt i32 %13, 0
br i1 %cmp1672, label %for.body17, label %for.inc27
for.body17: ; preds = %for.body13, %for.body17
%j.173 = phi i32 [ %inc25, %for.body17 ], [ 0, %for.body13 ]
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vnext)
%14 = load i32, ptr %v, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%idxprom19 = sext i32 %sub to i64
%15 = load i32, ptr %vnext, align 4, !tbaa !5
%sub21 = add nsw i32 %15, -1
%idxprom22 = sext i32 %sub21 to i64
%arrayidx23 = getelementptr inbounds [101 x [101 x i32]], ptr @G, i64 0, i64 %idxprom19, i64 %idxprom22
store i32 1, ptr %arrayidx23, align 4, !tbaa !5
%inc25 = add nuw nsw i32 %j.173, 1
%16 = load i32, ptr %k, align 4, !tbaa !5
%cmp16 = icmp slt i32 %inc25, %16
br i1 %cmp16, label %for.body17, label %for.inc27, !llvm.loop !14
for.inc27: ; preds = %for.body17, %for.body13
%inc28 = add nuw nsw i32 %i.175, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%cmp12 = icmp slt i32 %inc28, %17
br i1 %cmp12, label %for.body13, label %for.cond30.preheader, !llvm.loop !15
for.cond39.preheader: ; preds = %for.inc36
%18 = icmp sgt i32 %22, 0
br i1 %18, label %for.body41, label %for.end49
for.body32: ; preds = %for.cond30.preheader, %for.inc36
%19 = phi i32 [ %22, %for.inc36 ], [ %17, %for.cond30.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc36 ], [ 0, %for.cond30.preheader ]
%arrayidx34 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv
%20 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%cmp35 = icmp eq i32 %20, 0
br i1 %cmp35, label %if.then, label %for.inc36
if.then: ; preds = %for.body32
%21 = trunc i64 %indvars.iv to i32
call void @visit(i32 noundef %21)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc36
for.inc36: ; preds = %for.body32, %if.then
%22 = phi i32 [ %19, %for.body32 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%23 = sext i32 %22 to i64
%cmp31 = icmp slt i64 %indvars.iv.next, %23
br i1 %cmp31, label %for.body32, label %for.cond39.preheader, !llvm.loop !16
for.body41: ; preds = %for.cond39.preheader, %for.body41
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body41 ], [ 0, %for.cond39.preheader ]
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%arrayidx43 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv83
%24 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%arrayidx45 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv83
%25 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%26 = trunc i64 %indvars.iv.next84 to i32
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26, i32 noundef %24, i32 noundef %25)
%27 = load i32, ptr @n, align 4, !tbaa !5
%28 = sext i32 %27 to i64
%cmp40 = icmp slt i64 %indvars.iv.next84, %28
br i1 %cmp40, label %for.body41, label %for.end49, !llvm.loop !17
for.end49: ; preds = %for.body41, %entry, %for.cond11.preheader, %for.cond30.preheader, %for.cond39.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %vnext) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,M[N][N];
int color[N],d[N],f[N],tt;
void dfs_visit(int u){
int v;
color[u]=GRAY;
d[u]=++tt;
for(v=0;v<n;v++){
if(M[u][v]==0) continue;
if(color[v]==WHITE) dfs_visit(v);
}
color[u]=BLACK;
f[u]=++tt;
}
void dfs()
{
int u;
for(u=0;u<n;u++) color[u]=WHITE;
tt=0;
for(u=0;u<n;u++){
if(color[u]==WHITE) dfs_visit(u);
}
for(u=0;u<n;u++){
printf("%d %d %d\n",u+1,d[u],f[u]);
}
}
int main()
{
int u,v,k,i,j;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++) M[i][j]=0;
}
for(i=0;i<n;i++){
scanf("%d %d",&u,&k);
u--;
for(j=0;j<k;j++){
scanf("%d",&v);
v--;
M[u][v]=1;
}
}
dfs();
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195066/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195066/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@tt = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs_visit(i32 noundef %u) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @tt, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @tt, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %3, 0
br i1 %cmp7, label %for.inc, label %if.end
if.end: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 0
br i1 %cmp10, label %if.then11, label %for.inc
if.then11: ; preds = %if.end
%5 = trunc i64 %indvars.iv to i32
tail call void @dfs_visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end, %if.then11, %for.body
%6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre30 = load i32, ptr @tt, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%inc16 = add nsw i32 %8, 1
store i32 %inc16, ptr @tt, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @dfs() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread
for.cond10.preheader.thread: ; preds = %entry
store i32 0, ptr @tt, align 4, !tbaa !5
br label %for.end19
for.body3.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5
store i32 0, ptr @tt, align 4, !tbaa !5
br label %for.body3
for.cond10.preheader: ; preds = %for.inc7
%3 = icmp sgt i32 %7, 0
br i1 %3, label %for.body12, label %for.end19
for.body3: ; preds = %for.body3.preheader, %for.inc7
%4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ]
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ]
%arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %5, 0
br i1 %cmp6, label %if.then, label %for.inc7
if.then: ; preds = %for.body3
%6 = trunc i64 %indvars.iv to i32
tail call void @dfs_visit(i32 noundef %6)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.body3, %if.then
%7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = sext i32 %7 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11
for.body12: ; preds = %for.cond10.preheader, %for.body12
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ]
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39
%10 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%11 = trunc i64 %indvars.iv.next40 to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10)
%12 = load i32, ptr @n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp11 = icmp slt i64 %indvars.iv.next40, %13
br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12
for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader
ret void
}
; 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:
%u = alloca i32, align 4
%v = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %0, 0
br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %for.cond10.preheader.thread.i
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 400
%scevgep = getelementptr i8, ptr @M, i64 %4
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 400
%gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 400
%gep51 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 400
%gep52 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 400
%gep53 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 400
%gep54 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 400
%gep55 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 400
%gep56 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !13
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 400
%scevgep.epil = getelementptr i8, ptr @M, i64 %12
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !14
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp40, label %for.body11, label %for.cond10.preheader.thread.i
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %u, align 4, !tbaa !5
%dec = add nsw i32 %13, -1
store i32 %dec, ptr %u, align 4, !tbaa !5
%14 = load i32, ptr %k, align 4, !tbaa !5
%cmp1442 = icmp sgt i32 %14, 0
br i1 %cmp1442, label %for.body15, label %for.inc25
for.body15: ; preds = %for.body11, %for.body15
%j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v)
%15 = load i32, ptr %v, align 4, !tbaa !5
%dec17 = add nsw i32 %15, -1
store i32 %dec17, ptr %v, align 4, !tbaa !5
%16 = load i32, ptr %u, align 4, !tbaa !5
%idxprom18 = sext i32 %16 to i64
%idxprom20 = sext i32 %dec17 to i64
%arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.143, 1
%17 = load i32, ptr %k, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc23, %17
br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !16
for.inc25: ; preds = %for.body15, %for.body11
%inc26 = add nuw nsw i32 %i.145, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc26, %.pr
br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !17
for.end27: ; preds = %for.inc25
%cmp31.i = icmp sgt i32 %.pr, 0
br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i
for.cond10.preheader.thread.i: ; preds = %entry, %for.cond9.preheader, %for.end27
store i32 0, ptr @tt, align 4, !tbaa !5
br label %dfs.exit
for.body3.preheader.i: ; preds = %for.end27
%18 = zext i32 %.pr to i64
%19 = shl nuw nsw i64 %18, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %19, i1 false), !tbaa !5
store i32 0, ptr @tt, align 4, !tbaa !5
br label %for.body3.i
for.cond10.preheader.i: ; preds = %for.inc7.i
%20 = icmp sgt i32 %24, 0
br i1 %20, label %for.body12.i, label %dfs.exit
for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i
%21 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %24, %for.inc7.i ]
%indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ]
%arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i
%22 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %22, 0
br i1 %cmp6.i, label %if.then.i, label %for.inc7.i
if.then.i: ; preds = %for.body3.i
%23 = trunc i64 %indvars.iv.i to i32
call void @dfs_visit(i32 noundef %23)
%.pre.i = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7.i
for.inc7.i: ; preds = %if.then.i, %for.body3.i
%24 = phi i32 [ %21, %for.body3.i ], [ %.pre.i, %if.then.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%25 = sext i32 %24 to i64
%cmp2.i = icmp slt i64 %indvars.iv.next.i, %25
br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11
for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i
%indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ]
%indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1
%arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i
%26 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
%arrayidx16.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39.i
%27 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5
%28 = trunc i64 %indvars.iv.next40.i to i32
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28, i32 noundef %26, i32 noundef %27)
%29 = load i32, ptr @n, align 4, !tbaa !5
%30 = sext i32 %29 to i64
%cmp11.i = icmp slt i64 %indvars.iv.next40.i, %30
br i1 %cmp11.i, label %for.body12.i, label %dfs.exit, !llvm.loop !12
dfs.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
int tm, d[101], f[101], n;
bool a[101][101];
void dfs(int p)
{
d[p] = tm++;
int i;
for(i = 1; i <= n; ++i)
if(d[i] == 0 && a[p][i])
dfs(i);
f[p] = tm++;
}
int main()
{
int u, k, i, j;
while(scanf("%d", &n)!=EOF){
memset(a, false, sizeof(a));
memset(d, 0, sizeof(d));
memset(f, 0, sizeof(f));
for(i = 0; i < n; ++i){
scanf("%d %d", &u, &k);
while(0 < k--){
scanf("%d", &j);
a[u][j] = true;
}
}
for(i = 1; i <= n; ++i)
a[0][i] = true;
tm = 0;
dfs(0);
for(i = 1; i <= n; ++i)
printf("%d %d %d\n", i, d[i], f[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195116/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195116/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@tm = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@a = dso_local local_unnamed_addr global [101 x [101 x i8]] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs(i32 noundef %p) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @tm, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @tm, align 4, !tbaa !5
%idxprom = sext i32 %p to i64
%arrayidx = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %0, ptr %arrayidx, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not18 = icmp slt i32 %1, 1
br i1 %cmp.not18, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%arrayidx2 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3 = icmp eq i32 %3, 0
br i1 %cmp3, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%arrayidx7 = getelementptr inbounds [101 x [101 x i8]], ptr @a, i64 0, i64 %idxprom, i64 %indvars.iv
%4 = load i8, ptr %arrayidx7, align 1, !tbaa !9, !range !11, !noundef !12
%tobool.not = icmp eq i8 %4, 0
br i1 %tobool.not, label %for.inc, label %if.then
if.then: ; preds = %land.lhs.true
%5 = trunc i64 %indvars.iv to i32
tail call void @dfs(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %if.then
%6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %7
br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !13
for.end.loopexit: ; preds = %for.inc
%.pre21 = load i32, ptr @tm, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre21, %for.end.loopexit ], [ %inc, %entry ]
%inc9 = add nsw i32 %8, 1
store i32 %inc9, ptr @tm, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %8, ptr %arrayidx11, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%u = alloca i32, align 4
%k = alloca i32, align 4
%j = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #5
%call46 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%cmp.not47 = icmp eq i32 %call46, -1
br i1 %cmp.not47, label %while.end28, label %while.body
while.cond.loopexit: ; preds = %for.body19, %for.end16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end28, label %while.body, !llvm.loop !15
while.body: ; preds = %entry, %while.cond.loopexit
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10201) @a, i8 0, i64 10201, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) @d, i8 0, i64 404, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) @f, i8 0, i64 404, i1 false)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp140 = icmp sgt i32 %0, 0
br i1 %cmp140, label %for.body, label %for.end16
for.cond9.preheader: ; preds = %for.inc
%cmp10.not42 = icmp slt i32 %6, 1
br i1 %cmp10.not42, label %for.end16, label %for.body11.preheader
for.body11.preheader: ; preds = %for.cond9.preheader
%1 = zext i32 %6 to i64
call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds ([101 x [101 x i8]], ptr @a, i64 0, i64 0, i64 1), i8 1, i64 %1, i1 false), !tbaa !9
br label %for.end16
for.body: ; preds = %while.body, %for.inc
%i.041 = phi i32 [ %inc, %for.inc ], [ 0, %while.body ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k)
%2 = load i32, ptr %k, align 4, !tbaa !5
%dec38 = add nsw i32 %2, -1
store i32 %dec38, ptr %k, align 4, !tbaa !5
%cmp439 = icmp sgt i32 %2, 0
br i1 %cmp439, label %while.body5, label %for.inc
while.body5: ; preds = %for.body, %while.body5
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j)
%3 = load i32, ptr %u, align 4, !tbaa !5
%idxprom = sext i32 %3 to i64
%4 = load i32, ptr %j, align 4, !tbaa !5
%idxprom7 = sext i32 %4 to i64
%arrayidx8 = getelementptr inbounds [101 x [101 x i8]], ptr @a, i64 0, i64 %idxprom, i64 %idxprom7
store i8 1, ptr %arrayidx8, align 1, !tbaa !9
%5 = load i32, ptr %k, align 4, !tbaa !5
%dec = add nsw i32 %5, -1
store i32 %dec, ptr %k, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %5, 0
br i1 %cmp4, label %while.body5, label %for.inc, !llvm.loop !16
for.inc: ; preds = %while.body5, %for.body
%inc = add nuw nsw i32 %i.041, 1
%6 = load i32, ptr @n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %6
br i1 %cmp1, label %for.body, label %for.cond9.preheader, !llvm.loop !17
for.end16: ; preds = %while.body, %for.body11.preheader, %for.cond9.preheader
store i32 0, ptr @tm, align 4, !tbaa !5
call void @dfs(i32 noundef 0)
%7 = load i32, ptr @n, align 4, !tbaa !5
%cmp18.not44 = icmp slt i32 %7, 1
br i1 %cmp18.not44, label %while.cond.loopexit, label %for.body19
for.body19: ; preds = %for.end16, %for.body19
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body19 ], [ 1, %for.end16 ]
%arrayidx21 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv
%8 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%arrayidx23 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv
%9 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%10 = trunc i64 %indvars.iv to i32
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10, i32 noundef %8, i32 noundef %9)
%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
%cmp18.not.not = icmp slt i64 %indvars.iv, %12
br i1 %cmp18.not.not, label %for.body19, label %while.cond.loopexit, !llvm.loop !18
while.end28: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
|
#include<stdio.h>
#include<string.h>
int main()
{
int i,j,v,n,r,x=0,t;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d",&n);
int a[n];
for(j=0;j<n;j++)
{
scanf("%d",&a[j]);
if(a[j]!=a[j-1]&&a[j]!=a[j-2]&&x==0&&j>1)
{
x++;
r=j;
}
}
for(j=0;j<n;j++)
{
for(v=0;v<n;v++)
{
if(a[j]==a[v]&&v!=j)
{
x++;
}
}
if(x==0)
{
printf("%d\n",j+1);
break;
}
x=0;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19516/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19516/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp88 = icmp sgt i32 %0, 0
br i1 %cmp88, label %for.body, label %for.end50
for.body: ; preds = %entry, %for.end47
%i.090 = phi i32 [ %inc49, %for.end47 ], [ 0, %entry ]
%x.089 = phi i32 [ %x.6, %for.end47 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %2, align 16
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp375 = icmp sgt i32 %4, 0
br i1 %cmp375, label %for.body4.preheader, label %for.end47
for.body4.preheader: ; preds = %for.body
%invariant.gep = getelementptr i32, ptr %vla, i64 -1
%invariant.gep108 = getelementptr i32, ptr %vla, i64 -2
br label %for.body4
for.cond22.preheader: ; preds = %for.inc
%cmp2383 = icmp sgt i32 %26, 0
br i1 %cmp2383, label %for.cond25.preheader.us.preheader, label %for.end47
for.cond25.preheader.us.preheader: ; preds = %for.cond22.preheader
%wide.trip.count102 = zext i32 %26 to i64
%min.iters.check = icmp ult i32 %26, 8
%n.vec = and i64 %wide.trip.count102, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count102
br label %for.cond25.preheader.us
for.cond25.preheader.us: ; preds = %for.cond25.preheader.us.preheader, %if.end44.us
%indvars.iv99 = phi i64 [ 0, %for.cond25.preheader.us.preheader ], [ %indvars.iv.next100, %if.end44.us ]
%x.384.us = phi i32 [ %x.2, %for.cond25.preheader.us.preheader ], [ 0, %if.end44.us ]
%arrayidx29.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv99
%5 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5
br i1 %min.iters.check, label %for.body27.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond25.preheader.us
%6 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %x.384.us, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %5, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert114 = insertelement <4 x i64> poison, i64 %indvars.iv99, i64 0
%broadcast.splat115 = shufflevector <4 x i64> %broadcast.splatinsert114, <4 x i64> 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.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %6, %vector.ph ], [ %17, %vector.body ]
%vec.phi112 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
%7 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load113 = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = icmp eq <4 x i32> %broadcast.splat, %wide.load
%10 = icmp eq <4 x i32> %broadcast.splat, %wide.load113
%11 = icmp ne <4 x i64> %vec.ind, %broadcast.splat115
%12 = icmp ne <4 x i64> %step.add, %broadcast.splat115
%13 = and <4 x i1> %11, %9
%14 = and <4 x i1> %12, %10
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = zext <4 x i1> %14 to <4 x i32>
%17 = add <4 x i32> %vec.phi, %15
%18 = add <4 x i32> %vec.phi112, %16
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 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)
br i1 %cmp.n, label %for.cond25.for.end40_crit_edge.us, label %for.body27.us.preheader
for.body27.us.preheader: ; preds = %for.cond25.preheader.us, %middle.block
%indvars.iv96.ph = phi i64 [ 0, %for.cond25.preheader.us ], [ %n.vec, %middle.block ]
%x.481.us.ph = phi i32 [ %x.384.us, %for.cond25.preheader.us ], [ %20, %middle.block ]
br label %for.body27.us
if.end44.us: ; preds = %for.cond25.for.end40_crit_edge.us
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102
br i1 %exitcond103.not, label %for.end47, label %for.cond25.preheader.us, !llvm.loop !13
for.body27.us: ; preds = %for.body27.us.preheader, %for.body27.us
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.body27.us ], [ %indvars.iv96.ph, %for.body27.us.preheader ]
%x.481.us = phi i32 [ %x.5.us, %for.body27.us ], [ %x.481.us.ph, %for.body27.us.preheader ]
%arrayidx31.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv96
%21 = load i32, ptr %arrayidx31.us, align 4, !tbaa !5
%cmp32.us = icmp eq i32 %5, %21
%cmp34.not.us = icmp ne i64 %indvars.iv96, %indvars.iv99
%or.cond72.not.us = and i1 %cmp34.not.us, %cmp32.us
%inc36.us = zext i1 %or.cond72.not.us to i32
%x.5.us = add nsw i32 %x.481.us, %inc36.us
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%exitcond.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count102
br i1 %exitcond.not, label %for.cond25.for.end40_crit_edge.us, label %for.body27.us, !llvm.loop !14
for.cond25.for.end40_crit_edge.us: ; preds = %for.body27.us, %middle.block
%x.5.us.lcssa = phi i32 [ %20, %middle.block ], [ %x.5.us, %for.body27.us ]
%cmp41.us = icmp eq i32 %x.5.us.lcssa, 0
br i1 %cmp41.us, label %if.then42.split.us, label %if.end44.us
if.then42.split.us: ; preds = %for.cond25.for.end40_crit_edge.us
%22 = trunc i64 %indvars.iv99 to i32
%add = add nuw nsw i32 %22, 1
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
br label %for.end47
for.body4: ; preds = %for.body4.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next, %for.inc ]
%x.176 = phi i32 [ %x.089, %for.body4.preheader ], [ %x.2, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%23 = load i32, ptr %arrayidx, align 4, !tbaa !5
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%24 = load i32, ptr %gep, align 4, !tbaa !5
%cmp10.not = icmp eq i32 %23, %24
br i1 %cmp10.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body4
%gep109 = getelementptr i32, ptr %invariant.gep108, i64 %indvars.iv
%25 = load i32, ptr %gep109, align 4, !tbaa !5
%cmp16 = icmp ne i32 %23, %25
%cmp18 = icmp eq i32 %x.176, 0
%or.cond = select i1 %cmp16, i1 %cmp18, i1 false
%cmp20 = icmp ugt i64 %indvars.iv, 1
%or.cond51 = and i1 %cmp20, %or.cond
%spec.select = select i1 %or.cond51, i32 1, i32 %x.176
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body4
%x.2 = phi i32 [ %x.176, %for.body4 ], [ %spec.select, %land.lhs.true ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%26 = load i32, ptr %n, align 4, !tbaa !5
%27 = sext i32 %26 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %27
br i1 %cmp3, label %for.body4, label %for.cond22.preheader, !llvm.loop !15
for.end47: ; preds = %if.end44.us, %for.body, %for.cond22.preheader, %if.then42.split.us
%x.6 = phi i32 [ 0, %if.then42.split.us ], [ %x.2, %for.cond22.preheader ], [ %x.089, %for.body ], [ 0, %if.end44.us ]
call void @llvm.stackrestore.p0(ptr %3)
%inc49 = add nuw nsw i32 %i.090, 1
%28 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc49, %28
br i1 %cmp, label %for.body, label %for.end50, !llvm.loop !16
for.end50: ; preds = %for.end47, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#define NMAX 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,time;
int color[NMAX],d[NMAX],f[NMAX];
int M[NMAX][NMAX];
void rec(int i){
int j;
color[i] = GRAY;
d[i] = ++time;
for(j = 0;j < n;j++){
if(M[i][j] == 0){
continue;
}
if(color[j] == WHITE){
rec(j);
}
}
color[i] = BLACK;
f[i] = ++time;
}
int main(void){
int u,k,v,i,j;
scanf("%d",&n);
for(i = 0;i < n;i++){
for(j = 0;j < n;j++){
M[i][j] = 0;
}
}
for(i = 0;i < n;i++){
scanf("%d%d",&u,&k);
for(j = 0;j < k;j++){
scanf("%d",&v);
M[u - 1][v - 1] = 1;
}
}
for(i = 0;i < n;i++){
color[i] = WHITE;
}
time = 0;
for(i = 0;i < n;i++){
if(color[i] == WHITE){
rec(i);
}
}
for(i = 0;i < n;i++){
printf("%d %d %d\n",i+1,d[i],f[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195202/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195202/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@time = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@M = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @rec(i32 noundef %i) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @time, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @time, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %3, 0
br i1 %cmp7, label %for.inc, label %if.end
if.end: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 0
br i1 %cmp10, label %if.then11, label %for.inc
if.then11: ; preds = %if.end
%5 = trunc i64 %indvars.iv to i32
tail call void @rec(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end, %if.then11, %for.body
%6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre30 = load i32, ptr @time, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%inc16 = add nsw i32 %8, 1
store i32 %inc16, ptr @time, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%u = alloca i32, align 4
%k = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp78 = icmp sgt i32 %0, 0
br i1 %cmp78, label %for.cond1.preheader.us.preheader, label %for.end55.sink.split
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 404
%scevgep = getelementptr i8, ptr @M, i64 %4
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 404
%gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 404), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 404
%gep108 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 808), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 8 %gep108, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 404
%gep109 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1212), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 4 %gep109, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 404
%gep110 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1616), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 16 %gep110, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 404
%gep111 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2020), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 4 %gep111, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 404
%gep112 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2424), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 8 %gep112, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 404
%gep113 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2828), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 4 %gep113, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !11
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 404
%scevgep.epil = getelementptr i8, ptr @M, i64 %12
tail call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !12
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp78, label %for.body11, label %for.end55.sink.split
for.cond28.preheader: ; preds = %for.inc25
%cmp2984 = icmp sgt i32 %17, 0
br i1 %cmp2984, label %for.body38.preheader, label %for.end55.sink.split
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%i.183 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %k, align 4, !tbaa !5
%cmp1480 = icmp sgt i32 %13, 0
br i1 %cmp1480, label %for.body15, label %for.inc25
for.body15: ; preds = %for.body11, %for.body15
%j.181 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%14 = load i32, ptr %u, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%idxprom17 = sext i32 %sub to i64
%15 = load i32, ptr %v, align 4, !tbaa !5
%sub19 = add nsw i32 %15, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [101 x [101 x i32]], ptr @M, i64 0, i64 %idxprom17, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.181, 1
%16 = load i32, ptr %k, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc23, %16
br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !14
for.inc25: ; preds = %for.body15, %for.body11
%inc26 = add nuw nsw i32 %i.183, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc26, %17
br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !15
for.body38.preheader: ; preds = %for.cond28.preheader
%18 = zext i32 %17 to i64
%19 = shl nuw nsw i64 %18, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %19, i1 false), !tbaa !5
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.body38
for.cond45.preheader: ; preds = %for.inc42
%20 = icmp sgt i32 %24, 0
br i1 %20, label %for.body47, label %for.end55
for.body38: ; preds = %for.body38.preheader, %for.inc42
%21 = phi i32 [ %17, %for.body38.preheader ], [ %24, %for.inc42 ]
%indvars.iv = phi i64 [ 0, %for.body38.preheader ], [ %indvars.iv.next, %for.inc42 ]
%arrayidx40 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv
%22 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%cmp41 = icmp eq i32 %22, 0
br i1 %cmp41, label %if.then, label %for.inc42
if.then: ; preds = %for.body38
%23 = trunc i64 %indvars.iv to i32
call void @rec(i32 noundef %23)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc42
for.inc42: ; preds = %for.body38, %if.then
%24 = phi i32 [ %21, %for.body38 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%25 = sext i32 %24 to i64
%cmp37 = icmp slt i64 %indvars.iv.next, %25
br i1 %cmp37, label %for.body38, label %for.cond45.preheader, !llvm.loop !16
for.body47: ; preds = %for.cond45.preheader, %for.body47
%indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.body47 ], [ 0, %for.cond45.preheader ]
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%arrayidx49 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv95
%26 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%arrayidx51 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv95
%27 = load i32, ptr %arrayidx51, align 4, !tbaa !5
%28 = trunc i64 %indvars.iv.next96 to i32
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28, i32 noundef %26, i32 noundef %27)
%29 = load i32, ptr @n, align 4, !tbaa !5
%30 = sext i32 %29 to i64
%cmp46 = icmp slt i64 %indvars.iv.next96, %30
br i1 %cmp46, label %for.body47, label %for.end55, !llvm.loop !17
for.end55.sink.split: ; preds = %for.cond9.preheader, %entry, %for.cond28.preheader
store i32 0, ptr @time, align 4, !tbaa !5
br label %for.end55
for.end55: ; preds = %for.body47, %for.end55.sink.split, %for.cond45.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
#define MAX 100
int matrix[MAX][MAX];//隣接行列
int d[MAX];//発見時刻
int f[MAX];//終了時刻
int flg[MAX];//ノード訪問の情報
int timecnt=0;
void dfs(int u,int n){
flg[u]=1;
d[u]=++timecnt;
for(int i=0;i<n;i++){
if(matrix[u][i] && !flg[i]){/*ノードuから到達可能かつ未訪問*/
dfs(i,n);
}
}
f[u]=++timecnt;
return;
}
int main(){
int n,i,j;
int x,y,z;
scanf("%d",&n);
for(i=0;i<n;i++){
flg[i]=0;
for(j=0;j<n;j++)
matrix[i][j]=0;
}
for(i=0;i<n;i++){
scanf("%d %d",&x,&y);
for(j=0;j<y;j++){
scanf("%d",&z);
matrix[x-1][z-1]=1;
}
}
for(i=0;i<n;i++)
if(!flg[i])
dfs(i,n);
for(i=0;i<n;i++)
printf("%d %d %d\n",i+1,d[i],f[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195246/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195246/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@timecnt = dso_local local_unnamed_addr global i32 0, align 4
@flg = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@matrix = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@f = 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 [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs(i32 noundef %u, i32 noundef %n) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @flg, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @timecnt, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @timecnt, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %n, 0
br i1 %cmp22, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.inc
%.pre = load i32, ptr @timecnt, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%1 = phi i32 [ %.pre, %for.cond.cleanup.loopexit ], [ %inc, %entry ]
%inc11 = add nsw i32 %1, 1
store i32 %inc11, ptr @timecnt, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc11, ptr %arrayidx13, align 4, !tbaa !5
ret void
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @matrix, i64 0, i64 %idxprom, i64 %indvars.iv
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body
%arrayidx8 = getelementptr inbounds [100 x i32], ptr @flg, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%tobool9.not = icmp eq i32 %3, 0
br i1 %tobool9.not, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true
%4 = trunc i64 %indvars.iv to i32
tail call void @dfs(i32 noundef %4, i32 noundef %n)
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %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.cond.cleanup.loopexit, 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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp69 = icmp sgt i32 %0, 0
br i1 %cmp69, label %for.body.us.preheader, label %for.end48
for.body.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @flg, i8 0, i64 %2, i1 false), !tbaa !5
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond11.preheader.unr-lcssa, label %for.body.us.preheader.new
for.body.us.preheader.new: ; preds = %for.body.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.body.us
for.body.us: ; preds = %for.body.us, %for.body.us.preheader.new
%indvar = phi i64 [ 0, %for.body.us.preheader.new ], [ %indvar.next.7, %for.body.us ]
%niter = phi i64 [ 0, %for.body.us.preheader.new ], [ %niter.next.7, %for.body.us ]
%4 = mul nuw nsw i64 %indvar, 400
%scevgep = getelementptr i8, ptr @matrix, i64 %4
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 400
%gep = getelementptr i8, ptr getelementptr (i8, ptr @matrix, i64 400), i64 %5
call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 400
%gep91 = getelementptr i8, ptr getelementptr (i8, ptr @matrix, i64 800), i64 %6
call void @llvm.memset.p0.i64(ptr align 16 %gep91, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 400
%gep92 = getelementptr i8, ptr getelementptr (i8, ptr @matrix, i64 1200), i64 %7
call void @llvm.memset.p0.i64(ptr align 16 %gep92, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 400
%gep93 = getelementptr i8, ptr getelementptr (i8, ptr @matrix, i64 1600), i64 %8
call void @llvm.memset.p0.i64(ptr align 16 %gep93, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 400
%gep94 = getelementptr i8, ptr getelementptr (i8, ptr @matrix, i64 2000), i64 %9
call void @llvm.memset.p0.i64(ptr align 16 %gep94, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 400
%gep95 = getelementptr i8, ptr getelementptr (i8, ptr @matrix, i64 2400), i64 %10
call void @llvm.memset.p0.i64(ptr align 16 %gep95, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 400
%gep96 = getelementptr i8, ptr getelementptr (i8, ptr @matrix, i64 2800), i64 %11
call void @llvm.memset.p0.i64(ptr align 16 %gep96, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond11.preheader.unr-lcssa, label %for.body.us, !llvm.loop !11
for.cond11.preheader.unr-lcssa: ; preds = %for.body.us, %for.body.us.preheader
%indvar.unr = phi i64 [ 0, %for.body.us.preheader ], [ %indvar.next.7, %for.body.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond11.preheader, label %for.body.us.epil
for.body.us.epil: ; preds = %for.cond11.preheader.unr-lcssa, %for.body.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.body.us.epil ], [ %indvar.unr, %for.cond11.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.us.epil ], [ 0, %for.cond11.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 400
%scevgep.epil = getelementptr i8, ptr @matrix, i64 %12
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond11.preheader, label %for.body.us.epil, !llvm.loop !12
for.cond11.preheader: ; preds = %for.body.us.epil, %for.cond11.preheader.unr-lcssa
br i1 %cmp69, label %for.body13, label %for.end48
for.cond30.preheader: ; preds = %for.inc27
%cmp3175 = icmp sgt i32 %17, 0
br i1 %cmp3175, label %for.body32, label %for.end48
for.body13: ; preds = %for.cond11.preheader, %for.inc27
%i.174 = phi i32 [ %inc28, %for.inc27 ], [ 0, %for.cond11.preheader ]
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%13 = load i32, ptr %y, align 4, !tbaa !5
%cmp1671 = icmp sgt i32 %13, 0
br i1 %cmp1671, label %for.body17, label %for.inc27
for.body17: ; preds = %for.body13, %for.body17
%j.172 = phi i32 [ %inc25, %for.body17 ], [ 0, %for.body13 ]
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %z)
%14 = load i32, ptr %x, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%idxprom19 = sext i32 %sub to i64
%15 = load i32, ptr %z, align 4, !tbaa !5
%sub21 = add nsw i32 %15, -1
%idxprom22 = sext i32 %sub21 to i64
%arrayidx23 = getelementptr inbounds [100 x [100 x i32]], ptr @matrix, i64 0, i64 %idxprom19, i64 %idxprom22
store i32 1, ptr %arrayidx23, align 4, !tbaa !5
%inc25 = add nuw nsw i32 %j.172, 1
%16 = load i32, ptr %y, align 4, !tbaa !5
%cmp16 = icmp slt i32 %inc25, %16
br i1 %cmp16, label %for.body17, label %for.inc27, !llvm.loop !14
for.inc27: ; preds = %for.body17, %for.body13
%inc28 = add nuw nsw i32 %i.174, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%cmp12 = icmp slt i32 %inc28, %17
br i1 %cmp12, label %for.body13, label %for.cond30.preheader, !llvm.loop !15
for.cond38.preheader: ; preds = %for.inc35
%18 = icmp sgt i32 %22, 0
br i1 %18, label %for.body40, label %for.end48
for.body32: ; preds = %for.cond30.preheader, %for.inc35
%19 = phi i32 [ %22, %for.inc35 ], [ %17, %for.cond30.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc35 ], [ 0, %for.cond30.preheader ]
%arrayidx34 = getelementptr inbounds [100 x i32], ptr @flg, i64 0, i64 %indvars.iv
%20 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%tobool.not = icmp eq i32 %20, 0
br i1 %tobool.not, label %if.then, label %for.inc35
if.then: ; preds = %for.body32
%21 = trunc i64 %indvars.iv to i32
call void @dfs(i32 noundef %21, i32 noundef %19)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc35
for.inc35: ; preds = %for.body32, %if.then
%22 = phi i32 [ %19, %for.body32 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%23 = sext i32 %22 to i64
%cmp31 = icmp slt i64 %indvars.iv.next, %23
br i1 %cmp31, label %for.body32, label %for.cond38.preheader, !llvm.loop !16
for.body40: ; preds = %for.cond38.preheader, %for.body40
%indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.body40 ], [ 0, %for.cond38.preheader ]
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%arrayidx42 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv82
%24 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%arrayidx44 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv82
%25 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%26 = trunc i64 %indvars.iv.next83 to i32
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26, i32 noundef %24, i32 noundef %25)
%27 = load i32, ptr %n, align 4, !tbaa !5
%28 = sext i32 %27 to i64
%cmp39 = icmp slt i64 %indvars.iv.next83, %28
br i1 %cmp39, label %for.body40, label %for.end48, !llvm.loop !17
for.end48: ; preds = %for.body40, %entry, %for.cond11.preheader, %for.cond30.preheader, %for.cond38.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
#include<string.h>
#include<limits.h>
int main()
{
int p;
scanf("%d",&p);
while(p--)
{
int m;scanf("%d",&m);
int i,j,a[m],m1=INT_MIN,m2=INT_MAX;
for(i=0;i<m;i++)
{
scanf("%d",&a[i]);
if(a[i]>m1) m1=a[i];
if(a[i]<m2) m2=a[i];
}
int c[m1+1];
for(i=0;i<m1+1;i++){c[i]=-1;}
for(i=0;i<m;i++){c[a[i]]++;}
int q;
for(i=0;i<m1+1;i++)
{
if(c[i]==0){q=i;break;}
}
for(i=0;i<m;i++)
{
if(a[i]==q){printf("%d",i+1);break;}
}
printf("\n");
} return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19529/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19529/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%p = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%0 = load i32, ptr %p, align 4, !tbaa !5
%dec102 = add nsw i32 %0, -1
store i32 %dec102, ptr %p, align 4, !tbaa !5
%tobool.not103 = icmp eq i32 %0, 0
br i1 %tobool.not103, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end60
%q.0104 = phi i32 [ %q.1148, %for.end60 ], [ undef, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%1 = load i32, ptr %m, align 4, !tbaa !5
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %2, align 16
%4 = load i32, ptr %m, align 4, !tbaa !5
%cmp87 = icmp sgt i32 %4, 0
br i1 %cmp87, label %for.body, label %for.end60
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%m1.088 = phi i32 [ %spec.select, %for.body ], [ -2147483648, %while.body ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %5, i32 %m1.088)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %m, 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.end, !llvm.loop !9
for.end: ; preds = %for.body
%add = add i32 %spec.select, 1
%8 = zext i32 %add to i64
%vla15 = alloca i32, i64 %8, align 16
%cmp18.not92 = icmp slt i32 %spec.select, 0
br i1 %cmp18.not92, label %for.cond25.preheader, label %for.body19.preheader
for.body19.preheader: ; preds = %for.end
%9 = shl nuw nsw i64 %8, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla15, i8 -1, i64 %9, i1 false), !tbaa !5
br label %for.cond25.preheader
for.cond25.preheader: ; preds = %for.body19.preheader, %for.end
%cmp2694 = icmp sgt i32 %6, 0
br i1 %cmp2694, label %for.body27.preheader, label %for.cond36.preheader
for.body27.preheader: ; preds = %for.cond25.preheader
%wide.trip.count = zext i32 %6 to i64
%xtraiter = and i64 %wide.trip.count, 3
%10 = icmp ult i32 %6, 4
br i1 %10, label %for.cond36.preheader.loopexit.unr-lcssa, label %for.body27.preheader.new
for.body27.preheader.new: ; preds = %for.body27.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body27
for.cond36.preheader.loopexit.unr-lcssa: ; preds = %for.body27, %for.body27.preheader
%indvars.iv111.unr = phi i64 [ 0, %for.body27.preheader ], [ %indvars.iv.next112.3, %for.body27 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond36.preheader, label %for.body27.epil
for.body27.epil: ; preds = %for.cond36.preheader.loopexit.unr-lcssa, %for.body27.epil
%indvars.iv111.epil = phi i64 [ %indvars.iv.next112.epil, %for.body27.epil ], [ %indvars.iv111.unr, %for.cond36.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body27.epil ], [ 0, %for.cond36.preheader.loopexit.unr-lcssa ]
%arrayidx29.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv111.epil
%11 = load i32, ptr %arrayidx29.epil, align 4, !tbaa !5
%idxprom30.epil = sext i32 %11 to i64
%arrayidx31.epil = getelementptr inbounds i32, ptr %vla15, i64 %idxprom30.epil
%12 = load i32, ptr %arrayidx31.epil, align 4, !tbaa !5
%inc32.epil = add nsw i32 %12, 1
store i32 %inc32.epil, ptr %arrayidx31.epil, align 4, !tbaa !5
%indvars.iv.next112.epil = add nuw nsw i64 %indvars.iv111.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.cond36.preheader, label %for.body27.epil, !llvm.loop !11
for.cond36.preheader: ; preds = %for.cond36.preheader.loopexit.unr-lcssa, %for.body27.epil, %for.cond25.preheader
%cmp2694139 = phi i1 [ false, %for.cond25.preheader ], [ %cmp2694, %for.body27.epil ], [ %cmp2694, %for.cond36.preheader.loopexit.unr-lcssa ]
br i1 %cmp18.not92, label %for.end47, label %for.body39
for.body27: ; preds = %for.body27, %for.body27.preheader.new
%indvars.iv111 = phi i64 [ 0, %for.body27.preheader.new ], [ %indvars.iv.next112.3, %for.body27 ]
%niter = phi i64 [ 0, %for.body27.preheader.new ], [ %niter.next.3, %for.body27 ]
%arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv111
%13 = load i32, ptr %arrayidx29, align 16, !tbaa !5
%idxprom30 = sext i32 %13 to i64
%arrayidx31 = getelementptr inbounds i32, ptr %vla15, i64 %idxprom30
%14 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%inc32 = add nsw i32 %14, 1
store i32 %inc32, ptr %arrayidx31, align 4, !tbaa !5
%indvars.iv.next112 = or i64 %indvars.iv111, 1
%arrayidx29.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next112
%15 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5
%idxprom30.1 = sext i32 %15 to i64
%arrayidx31.1 = getelementptr inbounds i32, ptr %vla15, i64 %idxprom30.1
%16 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5
%inc32.1 = add nsw i32 %16, 1
store i32 %inc32.1, ptr %arrayidx31.1, align 4, !tbaa !5
%indvars.iv.next112.1 = or i64 %indvars.iv111, 2
%arrayidx29.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next112.1
%17 = load i32, ptr %arrayidx29.2, align 8, !tbaa !5
%idxprom30.2 = sext i32 %17 to i64
%arrayidx31.2 = getelementptr inbounds i32, ptr %vla15, i64 %idxprom30.2
%18 = load i32, ptr %arrayidx31.2, align 4, !tbaa !5
%inc32.2 = add nsw i32 %18, 1
store i32 %inc32.2, ptr %arrayidx31.2, align 4, !tbaa !5
%indvars.iv.next112.2 = or i64 %indvars.iv111, 3
%arrayidx29.3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next112.2
%19 = load i32, ptr %arrayidx29.3, align 4, !tbaa !5
%idxprom30.3 = sext i32 %19 to i64
%arrayidx31.3 = getelementptr inbounds i32, ptr %vla15, i64 %idxprom30.3
%20 = load i32, ptr %arrayidx31.3, align 4, !tbaa !5
%inc32.3 = add nsw i32 %20, 1
store i32 %inc32.3, ptr %arrayidx31.3, align 4, !tbaa !5
%indvars.iv.next112.3 = add nuw nsw i64 %indvars.iv111, 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.cond36.preheader.loopexit.unr-lcssa, label %for.body27, !llvm.loop !13
for.body39: ; preds = %for.cond36.preheader, %for.inc45
%indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.inc45 ], [ 0, %for.cond36.preheader ]
%arrayidx41 = getelementptr inbounds i32, ptr %vla15, i64 %indvars.iv114
%21 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%cmp42 = icmp eq i32 %21, 0
br i1 %cmp42, label %for.end47.loopexit.split.loop.exit, label %for.inc45
for.inc45: ; preds = %for.body39
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%exitcond118.not = icmp eq i64 %indvars.iv.next115, %8
br i1 %exitcond118.not, label %for.end47, label %for.body39, !llvm.loop !14
for.end47.loopexit.split.loop.exit: ; preds = %for.body39
%22 = trunc i64 %indvars.iv114 to i32
br label %for.end47
for.end47: ; preds = %for.inc45, %for.end47.loopexit.split.loop.exit, %for.cond36.preheader
%q.1 = phi i32 [ %q.0104, %for.cond36.preheader ], [ %22, %for.end47.loopexit.split.loop.exit ], [ %q.0104, %for.inc45 ]
br i1 %cmp2694139, label %for.body50.preheader, label %for.end60
for.body50.preheader: ; preds = %for.end47
%wide.trip.count122 = zext i32 %6 to i64
br label %for.body50
for.body50: ; preds = %for.body50.preheader, %for.inc58
%indvars.iv119 = phi i64 [ 0, %for.body50.preheader ], [ %indvars.iv.next120, %for.inc58 ]
%arrayidx52 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv119
%23 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%cmp53 = icmp eq i32 %23, %q.1
br i1 %cmp53, label %if.then54, label %for.inc58
if.then54: ; preds = %for.body50
%24 = trunc i64 %indvars.iv119 to i32
%add55 = add nuw nsw i32 %24, 1
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add55)
br label %for.end60
for.inc58: ; preds = %for.body50
%indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
%exitcond123.not = icmp eq i64 %indvars.iv.next120, %wide.trip.count122
br i1 %exitcond123.not, label %for.end60, label %for.body50, !llvm.loop !15
for.end60: ; preds = %for.inc58, %while.body, %for.end47, %if.then54
%q.1148 = phi i32 [ %q.1, %for.end47 ], [ %q.1, %if.then54 ], [ %q.0104, %while.body ], [ %q.1, %for.inc58 ]
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7
%25 = load i32, ptr %p, align 4, !tbaa !5
%dec = add nsw i32 %25, -1
store i32 %dec, ptr %p, align 4, !tbaa !5
%tobool.not = icmp eq i32 %25, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %for.end60, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, M[N][N];
int color[N], d[N], f[N], tt;
//再帰関数による深さ優先探索
void dfs_visit(int u){
int v;
color[u] = GRAY;
d[u] = ++tt; //最初の訪問
for(v=0; v<n; v++){
if(M[u][v] == 0)continue;
if(color[v] == WHITE){
dfs_visit(v);
}
}
color[u] = BLACK;
f[u] = ++tt;//訪問の完了
}
void dfs(){
int u;
//初期化
for(u=0; u<n; u++)color[u] = WHITE;
tt = 0;
for(u=0; u<n; u++){
//未訪問のuを始点として深さ優先探索
if(color[u] == WHITE)dfs_visit(u);
}
for(u=0; u<n; u++){
printf("%d %d %d\n", u+1, d[u], f[u]);
}
}
int main(){
int u,v,k,i,j;
scanf("%d", &n);
for(i=0; i<n; i++){
for(j=0; j<n; j++)M[i][j] = 0;
}
for(i=0; i<n; i++){
scanf("%d %d", &u, &k);
u--;
for(j=0; j<k; j++){
scanf("%d",&v);
v--;
M[u][v] = 1;
}
}
dfs();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195332/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195332/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@tt = dso_local local_unnamed_addr global i32 0, align 4
@d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs_visit(i32 noundef %u) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%0 = load i32, ptr @tt, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @tt, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %6, %for.inc ], [ %1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %3, 0
br i1 %cmp7, label %for.inc, label %if.end
if.end: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %4, 0
br i1 %cmp10, label %if.then11, label %for.inc
if.then11: ; preds = %if.end
%5 = trunc i64 %indvars.iv to i32
tail call void @dfs_visit(i32 noundef %5)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end, %if.then11, %for.body
%6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre30 = load i32, ptr @tt, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ]
store i32 2, ptr %arrayidx, align 4, !tbaa !5
%inc16 = add nsw i32 %8, 1
store i32 %inc16, ptr @tt, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom
store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @dfs() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread
for.cond10.preheader.thread: ; preds = %entry
store i32 0, ptr @tt, align 4, !tbaa !5
br label %for.end19
for.body3.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5
store i32 0, ptr @tt, align 4, !tbaa !5
br label %for.body3
for.cond10.preheader: ; preds = %for.inc7
%3 = icmp sgt i32 %7, 0
br i1 %3, label %for.body12, label %for.end19
for.body3: ; preds = %for.body3.preheader, %for.inc7
%4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ]
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ]
%arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %5, 0
br i1 %cmp6, label %if.then, label %for.inc7
if.then: ; preds = %for.body3
%6 = trunc i64 %indvars.iv to i32
tail call void @dfs_visit(i32 noundef %6)
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.body3, %if.then
%7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = sext i32 %7 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11
for.body12: ; preds = %for.cond10.preheader, %for.body12
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ]
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39
%10 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%11 = trunc i64 %indvars.iv.next40 to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10)
%12 = load i32, ptr @n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp11 = icmp slt i64 %indvars.iv.next40, %13
br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12
for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader
ret void
}
; 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:
%u = alloca i32, align 4
%v = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %0, 0
br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %for.cond10.preheader.thread.i
for.cond1.preheader.us.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
%xtraiter = and i64 %1, 7
%3 = icmp ult i32 %0, 8
br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %1, 4294967288
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%4 = mul nuw nsw i64 %indvar, 400
%scevgep = getelementptr i8, ptr @M, i64 %4
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5
%5 = mul nuw i64 %indvar, 400
%gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5
tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5
%6 = mul nuw i64 %indvar, 400
%gep51 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6
tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5
%7 = mul nuw i64 %indvar, 400
%gep52 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7
tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5
%8 = mul nuw i64 %indvar, 400
%gep53 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8
tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 400
%gep54 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9
tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 400
%gep55 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10
tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 400
%gep56 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11
tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !13
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%12 = mul nuw nsw i64 %indvar.epil, 400
%scevgep.epil = getelementptr i8, ptr @M, i64 %12
tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !14
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
br i1 %cmp40, label %for.body11, label %for.cond10.preheader.thread.i
for.body11: ; preds = %for.cond9.preheader, %for.inc25
%i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k)
%13 = load i32, ptr %u, align 4, !tbaa !5
%dec = add nsw i32 %13, -1
store i32 %dec, ptr %u, align 4, !tbaa !5
%14 = load i32, ptr %k, align 4, !tbaa !5
%cmp1442 = icmp sgt i32 %14, 0
br i1 %cmp1442, label %for.body15, label %for.inc25
for.body15: ; preds = %for.body11, %for.body15
%j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v)
%15 = load i32, ptr %v, align 4, !tbaa !5
%dec17 = add nsw i32 %15, -1
store i32 %dec17, ptr %v, align 4, !tbaa !5
%16 = load i32, ptr %u, align 4, !tbaa !5
%idxprom18 = sext i32 %16 to i64
%idxprom20 = sext i32 %dec17 to i64
%arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.143, 1
%17 = load i32, ptr %k, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc23, %17
br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !16
for.inc25: ; preds = %for.body15, %for.body11
%inc26 = add nuw nsw i32 %i.145, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc26, %.pr
br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !17
for.end27: ; preds = %for.inc25
%cmp31.i = icmp sgt i32 %.pr, 0
br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i
for.cond10.preheader.thread.i: ; preds = %entry, %for.cond9.preheader, %for.end27
store i32 0, ptr @tt, align 4, !tbaa !5
br label %dfs.exit
for.body3.preheader.i: ; preds = %for.end27
%18 = zext i32 %.pr to i64
%19 = shl nuw nsw i64 %18, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %19, i1 false), !tbaa !5
store i32 0, ptr @tt, align 4, !tbaa !5
br label %for.body3.i
for.cond10.preheader.i: ; preds = %for.inc7.i
%20 = icmp sgt i32 %24, 0
br i1 %20, label %for.body12.i, label %dfs.exit
for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i
%21 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %24, %for.inc7.i ]
%indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ]
%arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i
%22 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %22, 0
br i1 %cmp6.i, label %if.then.i, label %for.inc7.i
if.then.i: ; preds = %for.body3.i
%23 = trunc i64 %indvars.iv.i to i32
call void @dfs_visit(i32 noundef %23)
%.pre.i = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc7.i
for.inc7.i: ; preds = %if.then.i, %for.body3.i
%24 = phi i32 [ %21, %for.body3.i ], [ %.pre.i, %if.then.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%25 = sext i32 %24 to i64
%cmp2.i = icmp slt i64 %indvars.iv.next.i, %25
br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11
for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i
%indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ]
%indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1
%arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i
%26 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
%arrayidx16.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39.i
%27 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5
%28 = trunc i64 %indvars.iv.next40.i to i32
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28, i32 noundef %26, i32 noundef %27)
%29 = load i32, ptr @n, align 4, !tbaa !5
%30 = sext i32 %29 to i64
%cmp11.i = icmp slt i64 %indvars.iv.next40.i, %30
br i1 %cmp11.i, label %for.body12.i, label %dfs.exit, !llvm.loop !12
dfs.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.