Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
int binary(int );
int S[100000],n;
int main()
{
int i,j,a,goukei =0;
scanf("%d",&n);
for(i=0; i<n; i++)
{
scanf("%d",&S[i]);
}
scanf("%d",&a);
for( i=0; i<a; i++)
{
scanf("%d",&j);
if(binary(j)) goukei++;
}
printf("%d\n",goukei);
return 0;
}
int binary(int x)
{
int le=0,ri=n,mid;
while(le<ri)
{
mid =(le+ri)/2;
if(x==S[mid]) return 1;
if(x>S[mid]) le =mid+1;
if( x<S[mid]) ri= mid;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_185678/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_185678/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@S = dso_local global [100000 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:
%j = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, 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 [100000 x i32], ptr @S, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%3 = load i32, ptr %a, align 4, !tbaa !5
%cmp423 = icmp sgt i32 %3, 0
br i1 %cmp423, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %for.cond3
%goukei.025 = phi i32 [ %7, %for.cond3 ], [ 0, %for.end ]
%i.124 = phi i32 [ %inc10, %for.cond3 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j)
%4 = load i32, ptr %j, align 4, !tbaa !5
%5 = load i32, ptr @n, align 4, !tbaa !5
%cmp23.i = icmp sgt i32 %5, 0
br i1 %cmp23.i, label %while.body.i, label %for.cond3
while.body.i: ; preds = %for.body5, %if.end.i
%ri.025.i = phi i32 [ %ri.1.i, %if.end.i ], [ %5, %for.body5 ]
%le.024.i = phi i32 [ %spec.select.i, %if.end.i ], [ 0, %for.body5 ]
%add.i = add nsw i32 %le.024.i, %ri.025.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @S, i64 0, i64 %idxprom.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %6, %4
br i1 %cmp1.i, label %binary.exit, label %if.end.i
if.end.i: ; preds = %while.body.i
%cmp4.i = icmp slt i32 %6, %4
%add6.i = add nsw i32 %div.i, 1
%spec.select.i = select i1 %cmp4.i, i32 %add6.i, i32 %le.024.i
%cmp10.i = icmp sgt i32 %6, %4
%ri.1.i = select i1 %cmp10.i, i32 %div.i, i32 %ri.025.i
%cmp.i = icmp slt i32 %spec.select.i, %ri.1.i
br i1 %cmp.i, label %while.body.i, label %for.cond3, !llvm.loop !11
binary.exit: ; preds = %while.body.i
%inc8 = add nsw i32 %goukei.025, 1
br label %for.cond3
for.cond3: ; preds = %if.end.i, %for.body5, %binary.exit
%7 = phi i32 [ %inc8, %binary.exit ], [ %goukei.025, %for.body5 ], [ %goukei.025, %if.end.i ]
%inc10 = add nuw nsw i32 %i.124, 1
%8 = load i32, ptr %a, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %for.cond3, %for.end
%goukei.0.lcssa = phi i32 [ 0, %for.end ], [ %7, %for.cond3 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %goukei.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @binary(i32 noundef %x) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %0, 0
br i1 %cmp23, label %while.body, label %cleanup
while.body: ; preds = %entry, %if.end
%ri.025 = phi i32 [ %ri.1, %if.end ], [ %0, %entry ]
%le.024 = phi i32 [ %spec.select, %if.end ], [ 0, %entry ]
%add = add nsw i32 %ri.025, %le.024
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @S, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %1, %x
br i1 %cmp1, label %cleanup, label %if.end
if.end: ; preds = %while.body
%cmp4 = icmp slt i32 %1, %x
%add6 = add nsw i32 %div, 1
%spec.select = select i1 %cmp4, i32 %add6, i32 %le.024
%cmp10 = icmp sgt i32 %1, %x
%ri.1 = select i1 %cmp10, i32 %div, i32 %ri.025
%cmp = icmp slt i32 %spec.select, %ri.1
br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !11
cleanup: ; preds = %while.body, %if.end, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %if.end ], [ 1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(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 #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>
int by(void);
int i,n,q,*s,*t,aaa;
int main(){
int cnt=0;
scanf("%d",&n);
s = malloc(sizeof(int)*(n+1));
for(i=0;i<n;i++)scanf("%d",&s[i]);
scanf("%d",&q);
t = malloc(sizeof(int)*(q+1));
for(i=0;i<q;i++)scanf("%d",&t[i]);
for(i=0;i<q;i++){
aaa=by();
if(aaa!=-1)cnt++;
//printf("linear:%d\n",aaa);
}
printf("%d\n",cnt);
free(s);
free(t);
return 0;
}
int by(void){
int left=0,right=n,mid;
while(left<right){
mid = (left+right)/2;
if(s[mid]==t[i])return mid;
else if(t[i]<s[mid])right = mid;
else left = mid + 1;
}
return -1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_185720/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_185720/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@s = dso_local local_unnamed_addr global ptr null, align 8
@i = dso_local local_unnamed_addr global i32 0, align 4
@q = dso_local global i32 0, align 4
@t = dso_local local_unnamed_addr global ptr null, align 8
@aaa = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: 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
%add = add nsw i32 %0, 1
%conv = sext i32 %add to i64
%mul = shl nsw i64 %conv, 2
%call1 = tail call noalias ptr @malloc(i64 noundef %mul) #5
store ptr %call1, ptr @s, align 8, !tbaa !9
store i32 0, ptr @i, align 4, !tbaa !5
%cmp41 = icmp sgt i32 %0, 0
br i1 %cmp41, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%storemerge42 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%1 = load ptr, ptr @s, align 8, !tbaa !9
%idxprom = sext i32 %storemerge42 to i64
%arrayidx = getelementptr inbounds i32, ptr %1, i64 %idxprom
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%2 = load i32, ptr @i, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr @i, align 4, !tbaa !5
%3 = load i32, ptr @n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @q)
%4 = load i32, ptr @q, align 4, !tbaa !5
%add5 = add nsw i32 %4, 1
%conv6 = sext i32 %add5 to i64
%mul7 = shl nsw i64 %conv6, 2
%call8 = tail call noalias ptr @malloc(i64 noundef %mul7) #5
store ptr %call8, ptr @t, align 8, !tbaa !9
store i32 0, ptr @i, align 4, !tbaa !5
%cmp1043 = icmp sgt i32 %4, 0
br i1 %cmp1043, label %for.body12, label %for.end29
for.cond19.preheader: ; preds = %for.body12
store i32 0, ptr @i, align 4, !tbaa !5
%cmp2045 = icmp sgt i32 %15, 0
br i1 %cmp2045, label %for.body22.lr.ph, label %for.end29
for.body22.lr.ph: ; preds = %for.cond19.preheader
%5 = load i32, ptr @n, align 4, !tbaa !5
%cmp22.i = icmp sgt i32 %5, 0
%6 = load ptr, ptr @s, align 8
%7 = load ptr, ptr @t, align 8
br i1 %cmp22.i, label %for.body22.us.preheader, label %for.body22.lr.ph.split
for.body22.us.preheader: ; preds = %for.body22.lr.ph
%wide.trip.count = zext i32 %15 to i64
br label %for.body22.us
for.body22.us: ; preds = %for.body22.us.preheader, %for.cond19.us
%indvars.iv = phi i64 [ 0, %for.body22.us.preheader ], [ %indvars.iv.next, %for.cond19.us ]
%cnt.049.us = phi i32 [ 0, %for.body22.us.preheader ], [ %11, %for.cond19.us ]
%arrayidx2.i.us = getelementptr inbounds i32, ptr %7, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2.i.us, align 4, !tbaa !5
br label %while.body.i.us
while.body.i.us: ; preds = %if.else.i.us, %for.body22.us
%right.024.i.us = phi i32 [ %5, %for.body22.us ], [ %right.1.i.us, %if.else.i.us ]
%left.023.i.us = phi i32 [ 0, %for.body22.us ], [ %left.1.i.us, %if.else.i.us ]
%add.i.us = add nsw i32 %left.023.i.us, %right.024.i.us
%add.i.fr.us = freeze i32 %add.i.us
%div.i.us = sdiv i32 %add.i.fr.us, 2
%idxprom.i.us = sext i32 %div.i.us to i64
%arrayidx.i.us = getelementptr inbounds i32, ptr %6, i64 %idxprom.i.us
%9 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%cmp3.i.us = icmp eq i32 %9, %8
br i1 %cmp3.i.us, label %by.exit.us, label %if.else.i.us
if.else.i.us: ; preds = %while.body.i.us
%cmp8.i.us = icmp slt i32 %8, %9
%add11.i.us = add nsw i32 %div.i.us, 1
%left.1.i.us = select i1 %cmp8.i.us, i32 %left.023.i.us, i32 %add11.i.us
%right.1.i.us = select i1 %cmp8.i.us, i32 %div.i.us, i32 %right.024.i.us
%cmp.i.us = icmp slt i32 %left.1.i.us, %right.1.i.us
br i1 %cmp.i.us, label %while.body.i.us, label %by.exit.thread.loopexit.us, !llvm.loop !13
by.exit.us: ; preds = %while.body.i.us
store i32 %div.i.us, ptr @aaa, align 4, !tbaa !5
%add.i.off.us = add i32 %add.i.fr.us, 3
%cmp24.not.us = icmp ult i32 %add.i.off.us, 2
%inc26.us = add nsw i32 %cnt.049.us, 1
br i1 %cmp24.not.us, label %10, label %for.cond19.us
10: ; preds = %by.exit.us, %by.exit.thread.loopexit.us
br label %for.cond19.us
for.cond19.us: ; preds = %10, %by.exit.us
%11 = phi i32 [ %cnt.049.us, %10 ], [ %inc26.us, %by.exit.us ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = trunc i64 %indvars.iv.next to i32
store i32 %12, ptr @i, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end29, label %for.body22.us, !llvm.loop !14
by.exit.thread.loopexit.us: ; preds = %if.else.i.us
store i32 -1, ptr @aaa, align 4, !tbaa !5
br label %10
for.body22.lr.ph.split: ; preds = %for.body22.lr.ph
store i32 -1, ptr @aaa, align 4, !tbaa !5
store i32 %15, ptr @i, align 4, !tbaa !5
br label %for.end29
for.body12: ; preds = %for.end, %for.body12
%storemerge3344 = phi i32 [ %inc17, %for.body12 ], [ 0, %for.end ]
%13 = load ptr, ptr @t, align 8, !tbaa !9
%idxprom13 = sext i32 %storemerge3344 to i64
%arrayidx14 = getelementptr inbounds i32, ptr %13, i64 %idxprom13
%call15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx14)
%14 = load i32, ptr @i, align 4, !tbaa !5
%inc17 = add nsw i32 %14, 1
store i32 %inc17, ptr @i, align 4, !tbaa !5
%15 = load i32, ptr @q, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc17, %15
br i1 %cmp10, label %for.body12, label %for.cond19.preheader, !llvm.loop !15
for.end29: ; preds = %for.cond19.us, %for.end, %for.body22.lr.ph.split, %for.cond19.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond19.preheader ], [ 0, %for.body22.lr.ph.split ], [ 0, %for.end ], [ %11, %for.cond19.us ]
%call30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
%16 = load ptr, ptr @s, align 8, !tbaa !9
tail call void @free(ptr noundef %16) #6
%17 = load ptr, ptr @t, align 8, !tbaa !9
tail call void @free(ptr noundef %17) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @by() local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %while.body.lr.ph, label %cleanup
while.body.lr.ph: ; preds = %entry
%1 = load ptr, ptr @s, align 8, !tbaa !9
%2 = load ptr, ptr @t, align 8, !tbaa !9
%3 = load i32, ptr @i, align 4, !tbaa !5
%idxprom1 = sext i32 %3 to i64
%arrayidx2 = getelementptr inbounds i32, ptr %2, i64 %idxprom1
%4 = load i32, ptr %arrayidx2, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.else
%right.024 = phi i32 [ %0, %while.body.lr.ph ], [ %right.1, %if.else ]
%left.023 = phi i32 [ 0, %while.body.lr.ph ], [ %left.1, %if.else ]
%add = add nsw i32 %right.024, %left.023
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %1, i64 %idxprom
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp3 = icmp eq i32 %5, %4
br i1 %cmp3, label %cleanup, label %if.else
if.else: ; preds = %while.body
%cmp8 = icmp slt i32 %4, %5
%add11 = add nsw i32 %div, 1
%left.1 = select i1 %cmp8, i32 %left.023, i32 %add11
%right.1 = select i1 %cmp8, i32 %div, i32 %right.024
%cmp = icmp slt i32 %left.1, %right.1
br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !13
cleanup: ; preds = %while.body, %if.else, %entry
%retval.0 = phi i32 [ -1, %entry ], [ -1, %if.else ], [ %div, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-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 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 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind allocsize(0) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
|
#include <stdio.h>
int binarySearch(int,int *,int);
int main()
{
int n,q,i,j,cnt=0,re;
scanf("%d",&n);
int s[n];
for(i=0;i<n;i++){
scanf("%d",&s[i]);
}
scanf("%d",&q);
int t[q];
for(i=0;i<q;i++){
scanf("%d",&t[i]);
}
for(i=0;i<q;i++){
if(binarySearch(n,s,t[i])==0){
cnt++;
}
}
printf("%d\n",cnt);
return 0;
}
int binarySearch(int n,int *A,int key){
int left,right,mid;
left=0;
right=n;
while(left<right){
mid=(left+right)/2;
if(key==A[mid]){
return 0;
}
else if(key>A[mid]){
left=mid+1;
}
else if(key<A[mid]){
right=mid;
}
}
return 1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_185764/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_185764/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%q = 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 %q) #5
%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
%cmp37 = icmp sgt i32 %3, 0
br i1 %cmp37, 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 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
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%6 = load i32, ptr %q, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca i32, i64 %7, align 16
%cmp539 = icmp sgt i32 %6, 0
br i1 %cmp539, label %for.body6, label %for.end23
for.cond13.preheader: ; preds = %for.body6
%cmp1441 = icmp sgt i32 %13, 0
br i1 %cmp1441, label %for.body15.lr.ph, label %for.end23
for.body15.lr.ph: ; preds = %for.cond13.preheader
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp26.i = icmp sgt i32 %8, 0
br i1 %cmp26.i, label %for.body15.us.preheader, label %for.end23
for.body15.us.preheader: ; preds = %for.body15.lr.ph
%wide.trip.count = zext i32 %13 to i64
br label %for.body15.us
for.body15.us: ; preds = %for.body15.us.preheader, %binarySearch.exit.thread.us
%indvars.iv52 = phi i64 [ 0, %for.body15.us.preheader ], [ %indvars.iv.next53, %binarySearch.exit.thread.us ]
%cnt.042.us = phi i32 [ 0, %for.body15.us.preheader ], [ %12, %binarySearch.exit.thread.us ]
%arrayidx17.us = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv52
%9 = load i32, ptr %arrayidx17.us, align 4, !tbaa !5
br label %while.body.i.us
while.body.i.us: ; preds = %for.body15.us, %if.else.i.us
%right.028.i.us = phi i32 [ %right.1.i.us, %if.else.i.us ], [ %8, %for.body15.us ]
%left.027.i.us = phi i32 [ %left.1.i.us, %if.else.i.us ], [ 0, %for.body15.us ]
%add.i.us = add nsw i32 %left.027.i.us, %right.028.i.us
%div.i.us = sdiv i32 %add.i.us, 2
%idxprom.i.us = sext i32 %div.i.us to i64
%arrayidx.i.us = getelementptr inbounds i32, ptr %vla, i64 %idxprom.i.us
%10 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%cmp1.i.us = icmp eq i32 %10, %9
br i1 %cmp1.i.us, label %11, label %if.else.i.us
if.else.i.us: ; preds = %while.body.i.us
%cmp4.i.us = icmp slt i32 %10, %9
%add6.i.us = add nsw i32 %div.i.us, 1
%cmp10.i.us = icmp sgt i32 %10, %9
%spec.select.i.us = select i1 %cmp10.i.us, i32 %div.i.us, i32 %right.028.i.us
%left.1.i.us = select i1 %cmp4.i.us, i32 %add6.i.us, i32 %left.027.i.us
%right.1.i.us = select i1 %cmp4.i.us, i32 %right.028.i.us, i32 %spec.select.i.us
%cmp.i.us = icmp slt i32 %left.1.i.us, %right.1.i.us
br i1 %cmp.i.us, label %while.body.i.us, label %binarySearch.exit.thread.us, !llvm.loop !11
11: ; preds = %while.body.i.us
%inc20.us = add nsw i32 %cnt.042.us, 1
br label %binarySearch.exit.thread.us
binarySearch.exit.thread.us: ; preds = %if.else.i.us, %11
%12 = phi i32 [ %inc20.us, %11 ], [ %cnt.042.us, %if.else.i.us ]
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%exitcond.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count
br i1 %exitcond.not, label %for.end23, label %for.body15.us, !llvm.loop !12
for.body6: ; preds = %for.end, %for.body6
%indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv49
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
%13 = load i32, ptr %q, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp5 = icmp slt i64 %indvars.iv.next50, %14
br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !13
for.end23: ; preds = %binarySearch.exit.thread.us, %for.end, %for.body15.lr.ph, %for.cond13.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %for.body15.lr.ph ], [ 0, %for.end ], [ %12, %binarySearch.exit.thread.us ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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 norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @binarySearch(i32 noundef %n, ptr nocapture noundef readonly %A, i32 noundef %key) local_unnamed_addr #4 {
entry:
%cmp26 = icmp sgt i32 %n, 0
br i1 %cmp26, label %while.body, label %cleanup
while.body: ; preds = %entry, %if.else
%right.028 = phi i32 [ %right.1, %if.else ], [ %n, %entry ]
%left.027 = phi i32 [ %left.1, %if.else ], [ 0, %entry ]
%add = add nsw i32 %right.028, %left.027
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, %key
br i1 %cmp1, label %cleanup, label %if.else
if.else: ; preds = %while.body
%cmp4 = icmp slt i32 %0, %key
%add6 = add nsw i32 %div, 1
%cmp10 = icmp sgt i32 %0, %key
%spec.select = select i1 %cmp10, i32 %div, i32 %right.028
%left.1 = select i1 %cmp4, i32 %add6, i32 %left.027
%right.1 = select i1 %cmp4, i32 %right.028, i32 %spec.select
%cmp = icmp slt i32 %left.1, %right.1
br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !11
cleanup: ; preds = %while.body, %if.else, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %if.else ], [ 0, %while.body ]
ret i32 %retval.0
}
; 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 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 #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define N 100000
#define Q 50000
int search(int *a,int key,int n);
int main(){
int i,j,n,q,key,con = 0;
int s[N],t[Q];
scanf("%d",&n);
for(i = 0;i < n;i++){
scanf("%d",&s[i]);
}
scanf("%d",&q);
for(i = 0;i < q;i++){
scanf("%d",&t[i]);
key = t[i];
con += search(s,key,n);
}
printf("%d\n",con);
}
int search(int *a,int key,int n){
int mid,left = 0,right = n;
while(left < right){
mid = (left + right) / 2;
if(a[mid] == key) return 1;
else if(key < a[mid]) right = mid;
else left = mid + 1;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_185807/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_185807/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%q = alloca i32, align 4
%s = alloca [100000 x i32], align 16
%t = alloca [50000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 200000, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %0, 0
br i1 %cmp23, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp425 = icmp sgt i32 %3, 0
br i1 %cmp425, label %for.body5, label %for.end14
for.body5: ; preds = %for.end, %search.exit
%indvars.iv29 = phi i64 [ %indvars.iv.next30, %search.exit ], [ 0, %for.end ]
%con.027 = phi i32 [ %add, %search.exit ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [50000 x i32], ptr %t, i64 0, i64 %indvars.iv29
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp18.i = icmp sgt i32 %5, 0
br i1 %cmp18.i, label %while.body.i, label %search.exit
while.body.i: ; preds = %for.body5, %if.else.i
%right.020.i = phi i32 [ %right.1.i, %if.else.i ], [ %5, %for.body5 ]
%left.019.i = phi i32 [ %left.1.i, %if.else.i ], [ 0, %for.body5 ]
%add.i = add nsw i32 %left.019.i, %right.020.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds i32, ptr %s, i64 %idxprom.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %6, %4
br i1 %cmp1.i, label %search.exit, label %if.else.i
if.else.i: ; preds = %while.body.i
%cmp4.i = icmp sgt i32 %6, %4
%add7.i = add nsw i32 %div.i, 1
%left.1.i = select i1 %cmp4.i, i32 %left.019.i, i32 %add7.i
%right.1.i = select i1 %cmp4.i, i32 %div.i, i32 %right.020.i
%cmp.i = icmp slt i32 %left.1.i, %right.1.i
br i1 %cmp.i, label %while.body.i, label %search.exit, !llvm.loop !11
search.exit: ; preds = %while.body.i, %if.else.i, %for.body5
%retval.0.i = phi i32 [ 0, %for.body5 ], [ 1, %while.body.i ], [ 0, %if.else.i ]
%add = add nuw nsw i32 %retval.0.i, %con.027
%indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next30, %8
br i1 %cmp4, label %for.body5, label %for.end14, !llvm.loop !12
for.end14: ; preds = %search.exit, %for.end
%con.0.lcssa = phi i32 [ 0, %for.end ], [ %add, %search.exit ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %con.0.lcssa)
call void @llvm.lifetime.end.p0(i64 200000, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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 norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(ptr nocapture noundef readonly %a, i32 noundef %key, i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp18 = icmp sgt i32 %n, 0
br i1 %cmp18, label %while.body, label %cleanup
while.body: ; preds = %entry, %if.else
%right.020 = phi i32 [ %right.1, %if.else ], [ %n, %entry ]
%left.019 = phi i32 [ %left.1, %if.else ], [ 0, %entry ]
%add = add nsw i32 %right.020, %left.019
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, %key
br i1 %cmp1, label %cleanup, label %if.else
if.else: ; preds = %while.body
%cmp4 = icmp sgt i32 %0, %key
%add7 = add nsw i32 %div, 1
%left.1 = select i1 %cmp4, i32 %left.019, i32 %add7
%right.1 = select i1 %cmp4, i32 %div, i32 %right.020
%cmp = icmp slt i32 %left.1, %right.1
br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !11
cleanup: ; preds = %while.body, %if.else, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %if.else ], [ 1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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>
unsigned long long s[100000];
int binary_search(unsigned long long val_t,unsigned long long min,unsigned long long max)
{
int i = min;
int j = max;
int p;
while(i<=j){
p = (i+j)/2;
if(s[p] > val_t){
j = p - 1;
}
else if(s[p] < val_t){
i = p + 1;
}
else if(s[p] == val_t){
return 1;
}
}
return 0;
}
int main()
{
unsigned long long i;
unsigned long long n;
unsigned long long q;
scanf("%lld",&n);
for(i=0;i<n;i++){
scanf("%lld",&s[i]);
}
scanf("%lld",&q);
unsigned long long t[q];
for(i=0;i<q;i++){
scanf("%lld",&t[i]);
}
unsigned long long cnt=0;
for(i=0;i<q;i++){
if(binary_search(t[i],0,n) == 1){
cnt++;
}
}
printf("%lld\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_185850/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_185850/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@s = dso_local global [100000 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @binary_search(i64 noundef %val_t, i64 noundef %min, i64 noundef %max) local_unnamed_addr #0 {
entry:
%conv = trunc i64 %min to i32
%conv1 = trunc i64 %max to i32
%cmp.not29 = icmp sgt i32 %conv, %conv1
br i1 %cmp.not29, label %cleanup, label %while.body
while.body: ; preds = %entry, %if.end18
%j.031 = phi i32 [ %j.1, %if.end18 ], [ %conv1, %entry ]
%i.030 = phi i32 [ %i.1, %if.end18 ], [ %conv, %entry ]
%add = add nsw i32 %j.031, %i.030
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds [100000 x i64], ptr @s, i64 0, i64 %idxprom
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp3 = icmp ugt i64 %0, %val_t
br i1 %cmp3, label %if.then, label %if.else
if.then: ; preds = %while.body
%sub = add nsw i32 %div, -1
br label %if.end18
if.else: ; preds = %while.body
%cmp7 = icmp ult i64 %0, %val_t
br i1 %cmp7, label %if.then9, label %cleanup
if.then9: ; preds = %if.else
%add10 = add nsw i32 %div, 1
br label %if.end18
if.end18: ; preds = %if.then9, %if.then
%i.1 = phi i32 [ %i.030, %if.then ], [ %add10, %if.then9 ]
%j.1 = phi i32 [ %sub, %if.then ], [ %j.031, %if.then9 ]
%cmp.not = icmp sgt i32 %i.1, %j.1
br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !9
cleanup: ; preds = %if.else, %if.end18, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %if.end18 ], [ 1, %if.else ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
%q = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp34.not = icmp eq i64 %0, 0
br i1 %cmp34.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.035 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr @s, i64 0, i64 %i.035
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw i64 %i.035, 1
%1 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp ult i64 %inc, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%2 = load i64, ptr %q, align 8, !tbaa !5
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %2, align 16
%4 = load i64, ptr %q, align 8, !tbaa !5
%cmp436.not = icmp eq i64 %4, 0
br i1 %cmp436.not, label %for.end20, label %for.body5
for.cond11.preheader: ; preds = %for.body5
%cmp1238.not = icmp eq i64 %6, 0
br i1 %cmp1238.not, label %for.end20, label %for.body13.lr.ph
for.body13.lr.ph: ; preds = %for.cond11.preheader
%5 = load i64, ptr %n, align 8, !tbaa !5
%conv1.i = trunc i64 %5 to i32
%cmp.not29.i = icmp slt i32 %conv1.i, 0
br i1 %cmp.not29.i, label %for.end20, label %for.body13
for.body5: ; preds = %for.end, %for.body5
%i.137 = phi i64 [ %inc9, %for.body5 ], [ 0, %for.end ]
%arrayidx6 = getelementptr inbounds i64, ptr %vla, i64 %i.137
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6)
%inc9 = add nuw i64 %i.137, 1
%6 = load i64, ptr %q, align 8, !tbaa !5
%cmp4 = icmp ult i64 %inc9, %6
br i1 %cmp4, label %for.body5, label %for.cond11.preheader, !llvm.loop !12
for.body13: ; preds = %for.body13.lr.ph, %for.cond11
%cnt.040 = phi i64 [ %9, %for.cond11 ], [ 0, %for.body13.lr.ph ]
%i.239 = phi i64 [ %inc19, %for.cond11 ], [ 0, %for.body13.lr.ph ]
%arrayidx14 = getelementptr inbounds i64, ptr %vla, i64 %i.239
%7 = load i64, ptr %arrayidx14, align 8, !tbaa !5
br label %while.body.i
while.body.i: ; preds = %for.body13, %if.end18.i
%j.031.i = phi i32 [ %j.1.i, %if.end18.i ], [ %conv1.i, %for.body13 ]
%i.030.i = phi i32 [ %i.1.i, %if.end18.i ], [ 0, %for.body13 ]
%add.i = add nsw i32 %i.030.i, %j.031.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds [100000 x i64], ptr @s, i64 0, i64 %idxprom.i
%8 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%cmp3.i = icmp ugt i64 %8, %7
br i1 %cmp3.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %while.body.i
%sub.i = add nsw i32 %div.i, -1
br label %if.end18.i
if.else.i: ; preds = %while.body.i
%cmp7.i = icmp ult i64 %8, %7
br i1 %cmp7.i, label %if.then9.i, label %binary_search.exit
if.then9.i: ; preds = %if.else.i
%add10.i = add nsw i32 %div.i, 1
br label %if.end18.i
if.end18.i: ; preds = %if.then9.i, %if.then.i
%i.1.i = phi i32 [ %i.030.i, %if.then.i ], [ %add10.i, %if.then9.i ]
%j.1.i = phi i32 [ %sub.i, %if.then.i ], [ %j.031.i, %if.then9.i ]
%cmp.not.i = icmp sgt i32 %i.1.i, %j.1.i
br i1 %cmp.not.i, label %for.cond11, label %while.body.i, !llvm.loop !9
binary_search.exit: ; preds = %if.else.i
%inc17 = add i64 %cnt.040, 1
br label %for.cond11
for.cond11: ; preds = %if.end18.i, %binary_search.exit
%9 = phi i64 [ %inc17, %binary_search.exit ], [ %cnt.040, %if.end18.i ]
%inc19 = add nuw i64 %i.239, 1
%exitcond.not = icmp eq i64 %inc19, %6
br i1 %exitcond.not, label %for.end20, label %for.body13, !llvm.loop !13
for.end20: ; preds = %for.cond11, %for.end, %for.body13.lr.ph, %for.cond11.preheader
%cnt.0.lcssa = phi i64 [ 0, %for.cond11.preheader ], [ 0, %for.body13.lr.ph ], [ 0, %for.end ], [ %9, %for.cond11 ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cnt.0.lcssa)
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 8, 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: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
attributes #0 = { nofree norecurse 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(){
int n=0, q=0, C=0;
int S[100000]={0}, T[100000]={0};
int i=0, j=0, k=0;
int key, left, right, mid;
scanf("%d", &n);
for (i=0; i<n; i++){
scanf("%d", &S[i]);
}
scanf("%d", &q);
for (j=0; j<q; j++){
scanf("%d", &T[j]);
}
for (j=0; j<q; j++){
key = T[j];
left = 0;
right = n;
while(left < right){
//printf("%d %d %d \n",left,mid,right);
mid = (left + right) / 2;
if(S[mid] == key) {
C++;
break;
}else if(key < S[mid]){
right = mid;
}else{
left = mid + 1;
}
}
}
printf("%d\n",C);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_185900/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_185900/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%q = alloca i32, align 4
%S = alloca [100000 x i32], align 16
%T = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
store i32 0, ptr %n, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
store i32 0, ptr %q, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %S) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) %S, i8 0, i64 400000, i1 false)
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %T) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) %T, i8 0, i64 400000, 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
%cmp48 = icmp sgt i32 %0, 0
br i1 %cmp48, 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 [100000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp450 = icmp sgt i32 %3, 0
br i1 %cmp450, label %for.body5, label %for.end31
for.cond12.preheader: ; preds = %for.body5
%cmp1355 = icmp sgt i32 %7, 0
br i1 %cmp1355, label %for.body14.lr.ph, label %for.end31
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1752 = icmp sgt i32 %4, 0
br i1 %cmp1752, label %for.body14.us.preheader, label %for.end31
for.body14.us.preheader: ; preds = %for.body14.lr.ph
%wide.trip.count = zext i32 %7 to i64
br label %for.body14.us
for.body14.us: ; preds = %for.body14.us.preheader, %for.inc29.us
%indvars.iv65 = phi i64 [ 0, %for.body14.us.preheader ], [ %indvars.iv.next66, %for.inc29.us ]
%C.057.us = phi i32 [ 0, %for.body14.us.preheader ], [ %C.1.us, %for.inc29.us ]
%arrayidx16.us = getelementptr inbounds [100000 x i32], ptr %T, i64 0, i64 %indvars.iv65
%5 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5
br label %while.body.us
while.body.us: ; preds = %for.body14.us, %if.else.us
%right.054.us = phi i32 [ %4, %for.body14.us ], [ %right.1.us, %if.else.us ]
%left.053.us = phi i32 [ 0, %for.body14.us ], [ %left.1.us, %if.else.us ]
%add.us = add nsw i32 %right.054.us, %left.053.us
%div.us = sdiv i32 %add.us, 2
%idxprom18.us = sext i32 %div.us to i64
%arrayidx19.us = getelementptr inbounds [100000 x i32], ptr %S, i64 0, i64 %idxprom18.us
%6 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
%cmp20.us = icmp eq i32 %6, %5
br i1 %cmp20.us, label %if.then.us, label %if.else.us
if.else.us: ; preds = %while.body.us
%cmp24.us = icmp slt i32 %5, %6
%add27.us = add nsw i32 %div.us, 1
%left.1.us = select i1 %cmp24.us, i32 %left.053.us, i32 %add27.us
%right.1.us = select i1 %cmp24.us, i32 %div.us, i32 %right.054.us
%cmp17.us = icmp slt i32 %left.1.us, %right.1.us
br i1 %cmp17.us, label %while.body.us, label %for.inc29.us, !llvm.loop !11
if.then.us: ; preds = %while.body.us
%inc21.us = add nsw i32 %C.057.us, 1
br label %for.inc29.us
for.inc29.us: ; preds = %if.else.us, %if.then.us
%C.1.us = phi i32 [ %inc21.us, %if.then.us ], [ %C.057.us, %if.else.us ]
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%exitcond.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count
br i1 %exitcond.not, label %for.end31, label %for.body14.us, !llvm.loop !12
for.body5: ; preds = %for.end, %for.body5
%indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [100000 x i32], ptr %T, i64 0, i64 %indvars.iv62
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next63, %8
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end31: ; preds = %for.inc29.us, %for.end, %for.body14.lr.ph, %for.cond12.preheader
%C.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.body14.lr.ph ], [ 0, %for.end ], [ %C.1.us, %for.inc29.us ]
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %C.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int A[1000000], n;
int binarySearch(int key){
int left = 0;
int right = n;
int mid;
while( left < right ){
mid = (left+right)/2;
if( key == A[mid] )return 1;
if( key > A[mid] )left = mid + 1;
else if ( key < A[mid] )right = mid;
}
return 0;
}
int main(){
int i, q, k, sum = 0;
scanf("%d", &n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
scanf("%d", &q);
for(i=0;i<q;i++){
scanf("%d",&k);
if( binarySearch(k)) sum++;
}
printf("%d\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_185944/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_185944/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@n = dso_local global i32 0, align 4
@A = dso_local global [1000000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @binarySearch(i32 noundef %key) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %0, 0
br i1 %cmp23, label %while.body, label %cleanup
while.body: ; preds = %entry, %if.end
%right.025 = phi i32 [ %right.1, %if.end ], [ %0, %entry ]
%left.024 = phi i32 [ %left.1, %if.end ], [ 0, %entry ]
%add = add nsw i32 %right.025, %left.024
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds [1000000 x i32], ptr @A, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %1, %key
br i1 %cmp1, label %cleanup, label %if.end
if.end: ; preds = %while.body
%cmp4 = icmp slt i32 %1, %key
%add6 = add nsw i32 %div, 1
%cmp9 = icmp sgt i32 %1, %key
%spec.select = select i1 %cmp9, i32 %div, i32 %right.025
%left.1 = select i1 %cmp4, i32 %add6, i32 %left.024
%right.1 = select i1 %cmp4, i32 %right.025, i32 %spec.select
%cmp = icmp slt i32 %left.1, %right.1
br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !9
cleanup: ; preds = %while.body, %if.end, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %if.end ], [ 1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%q = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, 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 [1000000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp423 = icmp sgt i32 %3, 0
br i1 %cmp423, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %for.cond3
%sum.025 = phi i32 [ %7, %for.cond3 ], [ 0, %for.end ]
%i.124 = phi i32 [ %inc10, %for.cond3 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%4 = load i32, ptr %k, align 4, !tbaa !5
%5 = load i32, ptr @n, align 4, !tbaa !5
%cmp23.i = icmp sgt i32 %5, 0
br i1 %cmp23.i, label %while.body.i, label %for.cond3
while.body.i: ; preds = %for.body5, %if.end.i
%right.025.i = phi i32 [ %right.1.i, %if.end.i ], [ %5, %for.body5 ]
%left.024.i = phi i32 [ %left.1.i, %if.end.i ], [ 0, %for.body5 ]
%add.i = add nsw i32 %left.024.i, %right.025.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds [1000000 x i32], ptr @A, i64 0, i64 %idxprom.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %6, %4
br i1 %cmp1.i, label %binarySearch.exit, label %if.end.i
if.end.i: ; preds = %while.body.i
%cmp4.i = icmp slt i32 %6, %4
%add6.i = add nsw i32 %div.i, 1
%cmp9.i = icmp sgt i32 %6, %4
%spec.select.i = select i1 %cmp9.i, i32 %div.i, i32 %right.025.i
%left.1.i = select i1 %cmp4.i, i32 %add6.i, i32 %left.024.i
%right.1.i = select i1 %cmp4.i, i32 %right.025.i, i32 %spec.select.i
%cmp.i = icmp slt i32 %left.1.i, %right.1.i
br i1 %cmp.i, label %while.body.i, label %for.cond3, !llvm.loop !9
binarySearch.exit: ; preds = %while.body.i
%inc8 = add nsw i32 %sum.025, 1
br label %for.cond3
for.cond3: ; preds = %if.end.i, %for.body5, %binarySearch.exit
%7 = phi i32 [ %inc8, %binarySearch.exit ], [ %sum.025, %for.body5 ], [ %sum.025, %if.end.i ]
%inc10 = add nuw nsw i32 %i.124, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %for.cond3, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %7, %for.cond3 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int bsearch(int *a,int key,int n){
int left,right,mid;
left=0;
right=n;
while(left<right){
mid=(left+right)/2;
if(a[mid]==key) return 1;
else if(key<a[mid]) right=mid;
else left=mid+1;
}
return 0;
}
int main(){
int i,j,r,key,n,q,S[100000],T[50000],c=0;
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&S[i]);
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&T[i]);
c+=bsearch(S,T[i],n);
}
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_185988/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_185988/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @bsearch(ptr nocapture noundef readonly %a, i32 noundef %key, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp18 = icmp sgt i32 %n, 0
br i1 %cmp18, label %while.body, label %cleanup
while.body: ; preds = %entry, %if.else
%right.020 = phi i32 [ %right.1, %if.else ], [ %n, %entry ]
%left.019 = phi i32 [ %left.1, %if.else ], [ 0, %entry ]
%add = add nsw i32 %right.020, %left.019
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, %key
br i1 %cmp1, label %cleanup, label %if.else
if.else: ; preds = %while.body
%cmp4 = icmp sgt i32 %0, %key
%add7 = add nsw i32 %div, 1
%left.1 = select i1 %cmp4, i32 %left.019, i32 %add7
%right.1 = select i1 %cmp4, i32 %div, i32 %right.020
%cmp = icmp slt i32 %left.1, %right.1
br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !9
cleanup: ; preds = %while.body, %if.else, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %if.else ], [ 1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [100000 x i32], align 16
%T = alloca [50000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 200000, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %0, 0
br i1 %cmp23, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp425 = icmp sgt i32 %3, 0
br i1 %cmp425, label %for.body5, label %for.end14
for.body5: ; preds = %for.end, %bsearch.exit
%indvars.iv29 = phi i64 [ %indvars.iv.next30, %bsearch.exit ], [ 0, %for.end ]
%c.027 = phi i32 [ %add, %bsearch.exit ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [50000 x i32], ptr %T, i64 0, i64 %indvars.iv29
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp18.i = icmp sgt i32 %5, 0
br i1 %cmp18.i, label %while.body.i, label %bsearch.exit
while.body.i: ; preds = %for.body5, %if.else.i
%right.020.i = phi i32 [ %right.1.i, %if.else.i ], [ %5, %for.body5 ]
%left.019.i = phi i32 [ %left.1.i, %if.else.i ], [ 0, %for.body5 ]
%add.i = add nsw i32 %left.019.i, %right.020.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %6, %4
br i1 %cmp1.i, label %bsearch.exit, label %if.else.i
if.else.i: ; preds = %while.body.i
%cmp4.i = icmp sgt i32 %6, %4
%add7.i = add nsw i32 %div.i, 1
%left.1.i = select i1 %cmp4.i, i32 %left.019.i, i32 %add7.i
%right.1.i = select i1 %cmp4.i, i32 %div.i, i32 %right.020.i
%cmp.i = icmp slt i32 %left.1.i, %right.1.i
br i1 %cmp.i, label %while.body.i, label %bsearch.exit, !llvm.loop !9
bsearch.exit: ; preds = %while.body.i, %if.else.i, %for.body5
%retval.0.i = phi i32 [ 0, %for.body5 ], [ 1, %while.body.i ], [ 0, %if.else.i ]
%add = add nuw nsw i32 %retval.0.i, %c.027
%indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next30, %8
br i1 %cmp4, label %for.body5, label %for.end14, !llvm.loop !12
for.end14: ; preds = %bsearch.exit, %for.end
%c.0.lcssa = phi i32 [ 0, %for.end ], [ %add, %bsearch.exit ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 200000, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, 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(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
char a[n];
scanf("%s",a);
int i=1,sum=0;
while(1){
printf("%c",a[sum]);
sum+=i;
if(sum>=n){
break;
}
i++;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18603/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18603/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 1, %entry ]
%sum.0 = phi i32 [ %add, %while.cond ], [ 0, %entry ]
%idxprom = zext i32 %sum.0 to i64
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %idxprom
%3 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %3 to i32
%putchar = call i32 @putchar(i32 %conv)
%4 = trunc i64 %indvars.iv to i32
%add = add nuw nsw i32 %sum.0, %4
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp slt i32 %add, %5
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.cond, label %while.end
while.end: ; preds = %while.cond
call void @llvm.stackrestore.p0(ptr %2)
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: 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include<stdio.h>
int main(){
int n,S[100000],q,T[50000],i,j,count=0;
int left,right,mid;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&T[i]);
}
for(i=0;i<q;i++){
left=0;
right=n;
while(left<right){
mid=(left+right)/2;
if(S[mid]==T[i]){
count++;
break;
}
else if(T[i]<S[mid]){
right=mid;
}
else{
left=mid+1;
}
}
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186073/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186073/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%S = alloca [100000 x i32], align 16
%q = alloca i32, align 4
%T = alloca [50000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.start.p0(i64 200000, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, 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 [100000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp453 = icmp sgt i32 %3, 0
br i1 %cmp453, label %for.body5, label %for.end33
for.cond12.preheader: ; preds = %for.body5
%cmp1358 = icmp sgt i32 %7, 0
br i1 %cmp1358, label %for.body14.lr.ph, label %for.end33
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1555 = icmp sgt i32 %4, 0
br i1 %cmp1555, label %for.body14.us.preheader, label %for.end33
for.body14.us.preheader: ; preds = %for.body14.lr.ph
%wide.trip.count = zext i32 %7 to i64
br label %for.body14.us
for.body14.us: ; preds = %for.body14.us.preheader, %for.inc31.us
%indvars.iv69 = phi i64 [ 0, %for.body14.us.preheader ], [ %indvars.iv.next70, %for.inc31.us ]
%count.059.us = phi i32 [ 0, %for.body14.us.preheader ], [ %count.1.us, %for.inc31.us ]
%arrayidx19.us = getelementptr inbounds [50000 x i32], ptr %T, i64 0, i64 %indvars.iv69
%5 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
br label %while.body.us
while.body.us: ; preds = %for.body14.us, %if.else.us
%right.057.us = phi i32 [ %4, %for.body14.us ], [ %right.1.us, %if.else.us ]
%left.056.us = phi i32 [ 0, %for.body14.us ], [ %left.1.us, %if.else.us ]
%add.us = add nsw i32 %right.057.us, %left.056.us
%div.us = sdiv i32 %add.us, 2
%idxprom16.us = sext i32 %div.us to i64
%arrayidx17.us = getelementptr inbounds [100000 x i32], ptr %S, i64 0, i64 %idxprom16.us
%6 = load i32, ptr %arrayidx17.us, align 4, !tbaa !5
%cmp20.us = icmp eq i32 %6, %5
br i1 %cmp20.us, label %if.then.us, label %if.else.us
if.else.us: ; preds = %while.body.us
%cmp26.us = icmp slt i32 %5, %6
%add29.us = add nsw i32 %div.us, 1
%left.1.us = select i1 %cmp26.us, i32 %left.056.us, i32 %add29.us
%right.1.us = select i1 %cmp26.us, i32 %div.us, i32 %right.057.us
%cmp15.us = icmp slt i32 %left.1.us, %right.1.us
br i1 %cmp15.us, label %while.body.us, label %for.inc31.us, !llvm.loop !11
if.then.us: ; preds = %while.body.us
%inc21.us = add nsw i32 %count.059.us, 1
br label %for.inc31.us
for.inc31.us: ; preds = %if.else.us, %if.then.us
%count.1.us = phi i32 [ %inc21.us, %if.then.us ], [ %count.059.us, %if.else.us ]
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
br i1 %exitcond.not, label %for.end33, label %for.body14.us, !llvm.loop !12
for.body5: ; preds = %for.end, %for.body5
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [50000 x i32], ptr %T, i64 0, i64 %indvars.iv66
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next67, %8
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end33: ; preds = %for.inc31.us, %for.end, %for.body14.lr.ph, %for.cond12.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.body14.lr.ph ], [ 0, %for.end ], [ %count.1.us, %for.inc31.us ]
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 200000, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %S) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#define N 100000
int check(int *,int,int);
int main(){
int i,j,cnt=0,S[N],T,n,q;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&S[i]);
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&T);
cnt+=check(S,T,n);
}
printf("%d\n",cnt);
return 0;
}
int check(int S[],int t,int n){
int l,m,r;
l=0;
r=n;
while(l<r){
m=l+r;
m/=2;
if(S[m]==t){
return 1;
}
else if(S[m]<t)
l=m+1;
else if(S[m]>t)
r=m;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186116/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186116/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%S = alloca [100000 x i32], align 16
%T = alloca i32, align 4
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %S) #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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, 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 [100000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp419 = icmp sgt i32 %3, 0
br i1 %cmp419, label %for.body5, label %for.end10
for.body5: ; preds = %for.end, %check.exit
%cnt.021 = phi i32 [ %add, %check.exit ], [ 0, %for.end ]
%i.120 = phi i32 [ %inc9, %check.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%4 = load i32, ptr %T, align 4, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp27.i = icmp sgt i32 %5, 0
br i1 %cmp27.i, label %while.body.i, label %check.exit
while.body.i: ; preds = %for.body5, %if.else.i
%r.029.i = phi i32 [ %r.1.i, %if.else.i ], [ %5, %for.body5 ]
%l.028.i = phi i32 [ %l.1.i, %if.else.i ], [ 0, %for.body5 ]
%add.i = add nsw i32 %l.028.i, %r.029.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %6, %4
br i1 %cmp1.i, label %check.exit, label %if.else.i
if.else.i: ; preds = %while.body.i
%cmp4.i = icmp slt i32 %6, %4
%add6.i = add nsw i32 %div.i, 1
%cmp10.i = icmp sgt i32 %6, %4
%spec.select.i = select i1 %cmp10.i, i32 %div.i, i32 %r.029.i
%l.1.i = select i1 %cmp4.i, i32 %add6.i, i32 %l.028.i
%r.1.i = select i1 %cmp4.i, i32 %r.029.i, i32 %spec.select.i
%cmp.i = icmp slt i32 %l.1.i, %r.1.i
br i1 %cmp.i, label %while.body.i, label %check.exit, !llvm.loop !11
check.exit: ; preds = %while.body.i, %if.else.i, %for.body5
%retval.0.i = phi i32 [ 0, %for.body5 ], [ 1, %while.body.i ], [ 0, %if.else.i ]
%add = add nuw nsw i32 %retval.0.i, %cnt.021
%inc9 = add nuw nsw i32 %i.120, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc9, %7
br i1 %cmp4, label %for.body5, label %for.end10, !llvm.loop !12
for.end10: ; preds = %check.exit, %for.end
%cnt.0.lcssa = phi i32 [ 0, %for.end ], [ %add, %check.exit ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 400000, 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: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @check(ptr nocapture noundef readonly %S, i32 noundef %t, i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp27 = icmp sgt i32 %n, 0
br i1 %cmp27, label %while.body, label %cleanup
while.body: ; preds = %entry, %if.else
%r.029 = phi i32 [ %r.1, %if.else ], [ %n, %entry ]
%l.028 = phi i32 [ %l.1, %if.else ], [ 0, %entry ]
%add = add nsw i32 %r.029, %l.028
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %S, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, %t
br i1 %cmp1, label %cleanup, label %if.else
if.else: ; preds = %while.body
%cmp4 = icmp slt i32 %0, %t
%add6 = add nsw i32 %div, 1
%cmp10 = icmp sgt i32 %0, %t
%spec.select = select i1 %cmp10, i32 %div, i32 %r.029
%l.1 = select i1 %cmp4, i32 %add6, i32 %l.028
%r.1 = select i1 %cmp4, i32 %r.029, i32 %spec.select
%cmp = icmp slt i32 %l.1, %r.1
br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !11
cleanup: ; preds = %while.body, %if.else, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %if.else ], [ 1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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<string.h>
#include<stdlib.h>
int cmp(const void *a,const void *b){
return *(int*)b-*(int*)a;
}
int main(){
int n;
scanf("%d",&n);
if(n>=2&&n<=100000) {
int num[100005];
for(int i=0;i<n;i++)
scanf("%d",&num[i]);
qsort(num,n,sizeof(num[1]),cmp);
int ans1,ans2;
ans1=num[1]-num[n-1];
ans2=num[0]-num[n-2];
if(ans1<=ans2)
printf("%d",num[1]-num[n-1]);
else printf("%d",ans2);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18616/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18616/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #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
%num = alloca [100005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4
%1 = add i32 %0, -2
%or.cond = icmp ult i32 %1, 99999
br i1 %or.cond, label %for.body.preheader, label %if.end23
for.body.preheader: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %num) #6
br label %for.body
for.cond.cleanup: ; preds = %for.body
call void @qsort(ptr noundef nonnull %num, i64 noundef %8, i64 noundef 4, ptr noundef nonnull @cmp) #6
%arrayidx4 = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 1
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%idxprom5 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 %idxprom5
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub7 = sub nsw i32 %2, %4
%5 = load i32, ptr %num, align 16, !tbaa !5
%sub9 = add nsw i32 %3, -2
%idxprom10 = sext i32 %sub9 to i64
%arrayidx11 = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 %idxprom10
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%sub12 = sub nsw i32 %5, %6
%sub12.sub7 = call i32 @llvm.smin.i32(i32 %sub7, i32 %sub12)
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub12.sub7)
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %num) #6
br label %if.end23
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp2, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.end23: ; preds = %for.cond.cleanup, %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) #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
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(){
int len;
char s[100+1]={0};
scanf("%s", s);
len = strlen(s);
for(int i=0; i<len/2; i++){
if( s[i] != s[len-i-1] ){ printf("No\n"); return 0; }
}
for(int i=0; i<(len/2)/2; i++){
if( s[i] != s[len/2-i-1] ){ printf("No\n"); return 0; }
}
for(int i=0; i<(len/2)/2; i++){
if( s[(len+1)/2+i] != s[len-i-1] ){ printf("No\n"); return 0; }
}
printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186217/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186217/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %s, i8 0, i64 101, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7
%conv = trunc i64 %call2 to i32
%div = sdiv i32 %conv, 2
%cmp.not94 = icmp sgt i32 %conv, 1
br i1 %cmp.not94, label %for.body.preheader, label %cleanup68
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %div to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond13.preheader, label %for.body, !llvm.loop !5
for.cond13.preheader: ; preds = %for.cond
%div15 = sdiv i32 %conv, 4
%cmp16.not96 = icmp sgt i32 %conv, 3
br i1 %cmp16.not96, label %for.body19.preheader, label %cleanup68
for.body19.preheader: ; preds = %for.cond13.preheader
%wide.trip.count105 = zext i32 %div15 to i64
br label %for.body19
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%1 = xor i64 %indvars.iv, -1
%sub5 = add i64 %call2, %1
%sext = shl i64 %sub5, 32
%idxprom6 = ashr exact i64 %sext, 32
%arrayidx7 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %idxprom6
%2 = load i8, ptr %arrayidx7, align 1, !tbaa !7
%cmp9.not = icmp eq i8 %0, %2
br i1 %cmp9.not, label %for.cond, label %cleanup68
for.cond13: ; preds = %for.body19
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%exitcond106.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count105
br i1 %exitcond106.not, label %for.cond40.preheader, label %for.body19, !llvm.loop !10
for.cond40.preheader: ; preds = %for.cond13
br i1 %cmp16.not96, label %for.body46.lr.ph, label %cleanup68
for.body46.lr.ph: ; preds = %for.cond40.preheader
%add = add i64 %call2, 1
%div47120121 = lshr i64 %add, 1
%3 = and i64 %div47120121, 2147483647
%wide.trip.count111 = zext i32 %div15 to i64
br label %for.body46
for.body19: ; preds = %for.body19.preheader, %for.cond13
%indvars.iv102 = phi i64 [ 0, %for.body19.preheader ], [ %indvars.iv.next103, %for.cond13 ]
%arrayidx21 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv102
%4 = load i8, ptr %arrayidx21, align 1, !tbaa !7
%5 = trunc i64 %indvars.iv102 to i32
%6 = xor i32 %5, -1
%sub25 = add i32 %div, %6
%idxprom26 = sext i32 %sub25 to i64
%arrayidx27 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %idxprom26
%7 = load i8, ptr %arrayidx27, align 1, !tbaa !7
%cmp29.not = icmp eq i8 %4, %7
br i1 %cmp29.not, label %for.cond13, label %cleanup68
for.cond40: ; preds = %for.body46
%indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
%exitcond112.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count111
br i1 %exitcond112.not, label %cleanup68, label %for.body46, !llvm.loop !11
for.body46: ; preds = %for.body46.lr.ph, %for.cond40
%indvars.iv107 = phi i64 [ 0, %for.body46.lr.ph ], [ %indvars.iv.next108, %for.cond40 ]
%8 = add nuw nsw i64 %indvars.iv107, %3
%arrayidx50 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %8
%9 = load i8, ptr %arrayidx50, align 1, !tbaa !7
%10 = xor i64 %indvars.iv107, -1
%sub53 = add i64 %call2, %10
%sext113 = shl i64 %sub53, 32
%idxprom54 = ashr exact i64 %sext113, 32
%arrayidx55 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %idxprom54
%11 = load i8, ptr %arrayidx55, align 1, !tbaa !7
%cmp57.not = icmp eq i8 %9, %11
br i1 %cmp57.not, label %for.cond40, label %cleanup68
cleanup68: ; preds = %for.body, %for.body19, %for.cond40, %for.body46, %for.cond40.preheader, %for.cond13.preheader, %entry
%str.4.sink = phi ptr [ @str.5, %entry ], [ @str.5, %for.cond13.preheader ], [ @str.5, %for.cond40.preheader ], [ @str.4, %for.body46 ], [ @str.5, %for.cond40 ], [ @str.4, %for.body19 ], [ @str.4, %for.body ]
%puts90 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !6}
|
#include<stdio.h>
int main(){
char s[100];
scanf("%s",s);
int n=0;
int i,yes=0;
for(i=0;s[i]!='\0';i++)
n++;
for(i=0;i<(n-1)/2;i++){
//printf("%c %c\n",s[i],s[n-1-i]);
if(s[i]!=s[n-1-i])
break;
if(i==((n-1)/2)-1)
yes++;
}
for(i=0;i<(n-1)/2;i++){
//printf("%c %c\n",s[i],s[((n-1)/2)-(1+i)]);
if(s[i]!=s[((n-1)/2)-(1+i)])
break;
if(i==((n-1)/2)-1)
yes++;
}
if(yes==2)
printf("Yes");
else
printf("No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186260/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186260/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [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)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not84 = icmp eq i8 %0, 0
br i1 %cmp.not84, label %if.else, label %for.body
for.cond3.preheader: ; preds = %for.body
%indvars101 = trunc i64 %indvars.iv to i32
%div = sdiv i32 %indvars101, 2
%cmp487 = icmp sgt i32 %indvars101, 1
br i1 %cmp487, label %for.body6.lr.ph, label %if.else
for.body6.lr.ph: ; preds = %for.cond3.preheader
%sub19 = add nsw i32 %div, -1
%1 = and i64 %indvars.iv, 4294967295
%2 = zext i32 %sub19 to i64
%wide.trip.count = zext i32 %div to i64
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %3, 0
br i1 %cmp.not, label %for.cond3.preheader, label %for.body, !llvm.loop !8
for.body6: ; preds = %for.body6.lr.ph, %if.end
%indvars.iv102 = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next103, %if.end ]
%yes.089 = phi i32 [ 0, %for.body6.lr.ph ], [ %spec.select, %if.end ]
%arrayidx8 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv102
%4 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%5 = sub nsw i64 %1, %indvars.iv102
%arrayidx13 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %5
%6 = load i8, ptr %arrayidx13, align 1, !tbaa !5
%cmp15.not = icmp eq i8 %4, %6
br i1 %cmp15.not, label %if.end, label %for.end27
if.end: ; preds = %for.body6
%cmp20 = icmp eq i64 %indvars.iv102, %2
%inc23 = zext i1 %cmp20 to i32
%spec.select = add nuw nsw i32 %yes.089, %inc23
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%exitcond.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count
br i1 %exitcond.not, label %for.end27, label %for.body6, !llvm.loop !10
for.end27: ; preds = %if.end, %for.body6
%yes.0.lcssa = phi i32 [ %spec.select, %if.end ], [ %yes.089, %for.body6 ]
br i1 %cmp487, label %for.body33.lr.ph, label %for.end57
for.body33.lr.ph: ; preds = %for.end27
%sub49 = add nsw i32 %div, -1
%7 = sext i32 %div to i64
%8 = zext i32 %sub49 to i64
%wide.trip.count110 = zext i32 %div to i64
br label %for.body33
for.body33: ; preds = %for.body33.lr.ph, %if.end46
%indvars.iv106 = phi i64 [ 0, %for.body33.lr.ph ], [ %indvars.iv.next107, %if.end46 ]
%yes.296 = phi i32 [ %yes.0.lcssa, %for.body33.lr.ph ], [ %spec.select83, %if.end46 ]
%arrayidx35 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv106
%9 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%10 = sub nsw i64 %7, %indvars.iv.next107
%arrayidx41 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %10
%11 = load i8, ptr %arrayidx41, align 1, !tbaa !5
%cmp43.not = icmp eq i8 %9, %11
br i1 %cmp43.not, label %if.end46, label %for.end57
if.end46: ; preds = %for.body33
%cmp50 = icmp eq i64 %indvars.iv106, %8
%inc53 = zext i1 %cmp50 to i32
%spec.select83 = add nsw i32 %yes.296, %inc53
%exitcond111.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count110
br i1 %exitcond111.not, label %for.end57, label %for.body33, !llvm.loop !11
for.end57: ; preds = %if.end46, %for.body33, %for.end27
%yes.2.lcssa = phi i32 [ %yes.0.lcssa, %for.end27 ], [ %yes.296, %for.body33 ], [ %spec.select83, %if.end46 ]
%cmp58 = icmp eq i32 %yes.2.lcssa, 2
br i1 %cmp58, label %if.end63, label %if.else
if.else: ; preds = %for.cond3.preheader, %entry, %for.end57
br label %if.end63
if.end63: ; preds = %for.end57, %if.else
%.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %for.end57 ]
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
|
#include<stdio.h>
int main(){
char s[99];
scanf("%s",s);
int i;
for(i=0;s[i]!='\0';i++);
int j,x=1;
for(j=0;j<i/2;j++){
if(s[j]!=s[i-j-1]){
x=0;
}
}
for(j=0;j<(i-3)/2;j++){
if(s[j]!=s[(i-3)/2-j]){
x=0;
}
}
for(j=(i+1)/2;j<i-1;j++){
if(s[j]!=s[i-1-j]){
x=0;
}
}
if(x==0){
printf("No");
}else{
printf("Yes");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186303/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186303/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [99 x i8], align 16
call void @llvm.lifetime.start.p0(i64 99, ptr nonnull %s) #4
%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.iv114 = phi i64 [ %indvars.iv.next115, %for.cond ], [ 1, %entry ]
%indvars.iv106 = phi i32 [ %indvars.iv.next107, %for.cond ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next107 = add nuw i32 %indvars.iv106, 1
%indvars.iv.next115 = add i64 %indvars.iv114, 1
br i1 %cmp.not, label %for.cond2.preheader, label %for.cond, !llvm.loop !8
for.cond2.preheader: ; preds = %for.cond
%1 = trunc i64 %indvars.iv to i32
%cmp390.not = icmp ult i32 %1, 2
br i1 %cmp390.not, label %for.end39, label %for.body5.preheader
for.body5.preheader: ; preds = %for.cond2.preheader
%sext = shl i64 %indvars.iv, 32
%2 = ashr exact i64 %sext, 32
%3 = lshr i32 %indvars.iv106, 1
%umax = call i32 @llvm.umax.i32(i32 %3, i32 1)
%wide.trip.count = zext i32 %umax to i64
%min.iters.check = icmp ult i32 %indvars.iv106, 16
br i1 %min.iters.check, label %for.body5.preheader193, label %vector.ph
vector.ph: ; preds = %for.body5.preheader
%n.vec = and i64 %wide.trip.count, 2147483640
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %13, %vector.body ]
%vec.phi121 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %14, %vector.body ]
%4 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %4, align 8, !tbaa !5
%5 = getelementptr inbounds i8, ptr %4, i64 4
%wide.load122 = load <4 x i8>, ptr %5, align 4, !tbaa !5
%6 = xor i64 %index, -1
%7 = add nsw i64 %2, %6
%8 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %7
%9 = getelementptr inbounds i8, ptr %8, i64 -3
%wide.load123 = load <4 x i8>, ptr %9, align 1, !tbaa !5
%reverse = shufflevector <4 x i8> %wide.load123, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%10 = getelementptr inbounds i8, ptr %8, i64 -7
%wide.load124 = load <4 x i8>, ptr %10, align 1, !tbaa !5
%reverse125 = shufflevector <4 x i8> %wide.load124, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%11 = icmp eq <4 x i8> %wide.load, %reverse
%12 = icmp eq <4 x i8> %wide.load122, %reverse125
%13 = select <4 x i1> %11, <4 x i32> %vec.phi, <4 x i32> zeroinitializer
%14 = select <4 x i1> %12, <4 x i32> %vec.phi121, <4 x i32> zeroinitializer
%index.next = add nuw i64 %index, 8
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%rdx.select.cmp.not = icmp ne <4 x i32> %13, <i32 1, i32 1, i32 1, i32 1>
%rdx.select.cmp126185 = icmp ne <4 x i32> %14, <i32 1, i32 1, i32 1, i32 1>
%rdx.select.cmp126 = select <4 x i1> %rdx.select.cmp.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp126185
%16 = bitcast <4 x i1> %rdx.select.cmp126 to i4
%.not = icmp eq i4 %16, 0
%rdx.select127 = zext i1 %.not to i32
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond18.preheader, label %for.body5.preheader193
for.body5.preheader193: ; preds = %for.body5.preheader, %middle.block
%indvars.iv102.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ]
%x.092.ph = phi i32 [ 1, %for.body5.preheader ], [ %rdx.select127, %middle.block ]
br label %for.body5
for.cond18.preheader: ; preds = %for.body5, %middle.block
%spec.select.lcssa = phi i32 [ %rdx.select127, %middle.block ], [ %spec.select, %for.body5 ]
%cmp2193 = icmp ugt i32 %1, 4
br i1 %cmp2193, label %for.body23.preheader, label %for.end39
for.body23.preheader: ; preds = %for.cond18.preheader
%sub19 = add nsw i32 %1, -3
%div20 = sdiv i32 %sub19, 2
%17 = sext i32 %div20 to i64
%smax = call i32 @llvm.smax.i32(i32 %div20, i32 1)
%wide.trip.count112 = zext i32 %smax to i64
%min.iters.check130 = icmp ult i32 %smax, 8
br i1 %min.iters.check130, label %for.body23.preheader190, label %vector.ph131
vector.ph131: ; preds = %for.body23.preheader
%n.vec133 = and i64 %wide.trip.count112, 2147483640
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %spec.select.lcssa, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body136
vector.body136: ; preds = %vector.body136, %vector.ph131
%index137 = phi i64 [ 0, %vector.ph131 ], [ %index.next146, %vector.body136 ]
%vec.phi138 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph131 ], [ %26, %vector.body136 ]
%vec.phi139 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph131 ], [ %27, %vector.body136 ]
%18 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %index137
%wide.load140 = load <4 x i8>, ptr %18, align 8, !tbaa !5
%19 = getelementptr inbounds i8, ptr %18, i64 4
%wide.load141 = load <4 x i8>, ptr %19, align 4, !tbaa !5
%20 = sub nsw i64 %17, %index137
%21 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %20
%22 = getelementptr inbounds i8, ptr %21, i64 -3
%wide.load142 = load <4 x i8>, ptr %22, align 1, !tbaa !5
%reverse143 = shufflevector <4 x i8> %wide.load142, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%23 = getelementptr inbounds i8, ptr %21, i64 -7
%wide.load144 = load <4 x i8>, ptr %23, align 1, !tbaa !5
%reverse145 = shufflevector <4 x i8> %wide.load144, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%24 = icmp eq <4 x i8> %wide.load140, %reverse143
%25 = icmp eq <4 x i8> %wide.load141, %reverse145
%26 = select <4 x i1> %24, <4 x i32> %vec.phi138, <4 x i32> zeroinitializer
%27 = select <4 x i1> %25, <4 x i32> %vec.phi139, <4 x i32> zeroinitializer
%index.next146 = add nuw i64 %index137, 8
%28 = icmp eq i64 %index.next146, %n.vec133
br i1 %28, label %middle.block128, label %vector.body136, !llvm.loop !13
middle.block128: ; preds = %vector.body136
%.splatinsert = insertelement <4 x i32> poison, i32 %spec.select.lcssa, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp147.not = icmp eq <4 x i32> %26, %.splat
%rdx.select148 = select <4 x i1> %rdx.select.cmp147.not, <4 x i32> %27, <4 x i32> %26
%.splatinsert149 = insertelement <4 x i32> poison, i32 %spec.select.lcssa, i64 0
%.splat150 = shufflevector <4 x i32> %.splatinsert149, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp151 = icmp ne <4 x i32> %rdx.select148, %.splat150
%29 = bitcast <4 x i1> %rdx.select.cmp151 to i4
%.not186 = icmp eq i4 %29, 0
%rdx.select152 = select i1 %.not186, i32 %spec.select.lcssa, i32 0
%cmp.n135 = icmp eq i64 %n.vec133, %wide.trip.count112
br i1 %cmp.n135, label %for.end39, label %for.body23.preheader190
for.body23.preheader190: ; preds = %for.body23.preheader, %middle.block128
%indvars.iv108.ph = phi i64 [ 0, %for.body23.preheader ], [ %n.vec133, %middle.block128 ]
%x.295.ph = phi i32 [ %spec.select.lcssa, %for.body23.preheader ], [ %rdx.select152, %middle.block128 ]
br label %for.body23
for.body5: ; preds = %for.body5.preheader193, %for.body5
%indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.body5 ], [ %indvars.iv102.ph, %for.body5.preheader193 ]
%x.092 = phi i32 [ %spec.select, %for.body5 ], [ %x.092.ph, %for.body5.preheader193 ]
%arrayidx7 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %indvars.iv102
%30 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%31 = xor i64 %indvars.iv102, -1
%32 = add nsw i64 %2, %31
%arrayidx11 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %32
%33 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%cmp13.not = icmp eq i8 %30, %33
%spec.select = select i1 %cmp13.not, i32 %x.092, i32 0
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%exitcond.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count
br i1 %exitcond.not, label %for.cond18.preheader, label %for.body5, !llvm.loop !14
for.body23: ; preds = %for.body23.preheader190, %for.body23
%indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.body23 ], [ %indvars.iv108.ph, %for.body23.preheader190 ]
%x.295 = phi i32 [ %spec.select88, %for.body23 ], [ %x.295.ph, %for.body23.preheader190 ]
%arrayidx25 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %indvars.iv108
%34 = load i8, ptr %arrayidx25, align 1, !tbaa !5
%35 = sub nsw i64 %17, %indvars.iv108
%arrayidx31 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %35
%36 = load i8, ptr %arrayidx31, align 1, !tbaa !5
%cmp33.not = icmp eq i8 %34, %36
%spec.select88 = select i1 %cmp33.not, i32 %x.295, i32 0
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond113.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count112
br i1 %exitcond113.not, label %for.end39, label %for.body23, !llvm.loop !15
for.end39: ; preds = %for.body23, %middle.block128, %for.cond2.preheader, %for.cond18.preheader
%x.2.lcssa = phi i32 [ %spec.select.lcssa, %for.cond18.preheader ], [ 1, %for.cond2.preheader ], [ %rdx.select152, %middle.block128 ], [ %spec.select88, %for.body23 ]
%add = add nuw nsw i32 %1, 1
%div4087 = lshr i32 %add, 1
%sub42 = add nsw i32 %1, -1
%cmp4397 = icmp slt i32 %div4087, %sub42
br i1 %cmp4397, label %for.body45.preheader, label %for.end60
for.body45.preheader: ; preds = %for.end39
%37 = lshr i64 %indvars.iv114, 1
%38 = sext i32 %sub42 to i64
%39 = add nuw i64 %37, 1
%smax154 = call i64 @llvm.smax.i64(i64 %39, i64 %38)
%40 = sub i64 %smax154, %37
%min.iters.check157 = icmp ult i64 %40, 8
br i1 %min.iters.check157, label %for.body45.preheader188, label %vector.ph158
vector.ph158: ; preds = %for.body45.preheader
%n.vec160 = and i64 %40, -8
%ind.end = add i64 %37, %n.vec160
%minmax.ident.splatinsert167 = insertelement <4 x i32> poison, i32 %x.2.lcssa, i64 0
%minmax.ident.splat168 = shufflevector <4 x i32> %minmax.ident.splatinsert167, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body163
vector.body163: ; preds = %vector.body163, %vector.ph158
%index164 = phi i64 [ 0, %vector.ph158 ], [ %index.next175, %vector.body163 ]
%vec.phi165 = phi <4 x i32> [ %minmax.ident.splat168, %vector.ph158 ], [ %49, %vector.body163 ]
%vec.phi166 = phi <4 x i32> [ %minmax.ident.splat168, %vector.ph158 ], [ %50, %vector.body163 ]
%offset.idx = add i64 %37, %index164
%41 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %offset.idx
%wide.load169 = load <4 x i8>, ptr %41, align 1, !tbaa !5
%42 = getelementptr inbounds i8, ptr %41, i64 4
%wide.load170 = load <4 x i8>, ptr %42, align 1, !tbaa !5
%43 = sub nsw i64 %38, %offset.idx
%44 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %43
%45 = getelementptr inbounds i8, ptr %44, i64 -3
%wide.load171 = load <4 x i8>, ptr %45, align 1, !tbaa !5
%reverse172 = shufflevector <4 x i8> %wide.load171, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%46 = getelementptr inbounds i8, ptr %44, i64 -7
%wide.load173 = load <4 x i8>, ptr %46, align 1, !tbaa !5
%reverse174 = shufflevector <4 x i8> %wide.load173, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%47 = icmp eq <4 x i8> %wide.load169, %reverse172
%48 = icmp eq <4 x i8> %wide.load170, %reverse174
%49 = select <4 x i1> %47, <4 x i32> %vec.phi165, <4 x i32> zeroinitializer
%50 = select <4 x i1> %48, <4 x i32> %vec.phi166, <4 x i32> zeroinitializer
%index.next175 = add nuw i64 %index164, 8
%51 = icmp eq i64 %index.next175, %n.vec160
br i1 %51, label %middle.block155, label %vector.body163, !llvm.loop !16
middle.block155: ; preds = %vector.body163
%.splatinsert176 = insertelement <4 x i32> poison, i32 %x.2.lcssa, i64 0
%.splat177 = shufflevector <4 x i32> %.splatinsert176, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp178.not = icmp eq <4 x i32> %49, %.splat177
%rdx.select179 = select <4 x i1> %rdx.select.cmp178.not, <4 x i32> %50, <4 x i32> %49
%.splatinsert180 = insertelement <4 x i32> poison, i32 %x.2.lcssa, i64 0
%.splat181 = shufflevector <4 x i32> %.splatinsert180, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp182 = icmp ne <4 x i32> %rdx.select179, %.splat181
%52 = bitcast <4 x i1> %rdx.select.cmp182 to i4
%.not187 = icmp eq i4 %52, 0
%rdx.select183 = select i1 %.not187, i32 %x.2.lcssa, i32 0
%cmp.n162 = icmp eq i64 %40, %n.vec160
br i1 %cmp.n162, label %for.end60, label %for.body45.preheader188
for.body45.preheader188: ; preds = %for.body45.preheader, %middle.block155
%indvars.iv116.ph = phi i64 [ %37, %for.body45.preheader ], [ %ind.end, %middle.block155 ]
%x.499.ph = phi i32 [ %x.2.lcssa, %for.body45.preheader ], [ %rdx.select183, %middle.block155 ]
br label %for.body45
for.body45: ; preds = %for.body45.preheader188, %for.body45
%indvars.iv116 = phi i64 [ %indvars.iv.next117, %for.body45 ], [ %indvars.iv116.ph, %for.body45.preheader188 ]
%x.499 = phi i32 [ %spec.select89, %for.body45 ], [ %x.499.ph, %for.body45.preheader188 ]
%arrayidx47 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %indvars.iv116
%53 = load i8, ptr %arrayidx47, align 1, !tbaa !5
%54 = sub nsw i64 %38, %indvars.iv116
%arrayidx52 = getelementptr inbounds [99 x i8], ptr %s, i64 0, i64 %54
%55 = load i8, ptr %arrayidx52, align 1, !tbaa !5
%cmp54.not = icmp eq i8 %53, %55
%spec.select89 = select i1 %cmp54.not, i32 %x.499, i32 0
%indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
%cmp43 = icmp slt i64 %indvars.iv.next117, %38
br i1 %cmp43, label %for.body45, label %for.end60, !llvm.loop !17
for.end60: ; preds = %for.body45, %middle.block155, %for.end39
%x.4.lcssa = phi i32 [ %x.2.lcssa, %for.end39 ], [ %rdx.select183, %middle.block155 ], [ %spec.select89, %for.body45 ]
%cmp61 = icmp eq i32 %x.4.lcssa, 0
%.str.1..str.2 = select i1 %cmp61, ptr @.str.1, ptr @.str.2
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 99, 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9, !11, !12}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !9, !11, !12}
!14 = distinct !{!14, !9, !12, !11}
!15 = distinct !{!15, !9, !12, !11}
!16 = distinct !{!16, !9, !11, !12}
!17 = distinct !{!17, !9, !12, !11}
|
#include <stdio.h>
#include <string.h>
int main (void)
{
char str[101];
scanf("%s",str);
int len = strlen(str);
int index =0;
while (index < len/2)
{
if(str[index] != str[len-index-1])
{
printf("No");
return (0);
}
index++;
}
if (len ==3)
{
printf("Yes\n");
return (0);
}
index =0;
while (index< (len-1)/4)
{
if(str[index] != str[(len-1)/2 - index -1])
{
printf("No");
return (0);
}
index++;
}
index =0;
while (index< (len-1)/4)
{
if(str[len -index-1] != str[len -((len-1)/2 - index -1)-1])
{
printf("No");
return (0);
}
index++;
}
printf("Yes\n");
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186347/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186347/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #7
%conv = trunc i64 %call2 to i32
%cmp92 = icmp sgt i32 %conv, 1
br i1 %cmp92, label %while.body.preheader, label %while.cond17.preheader.thread
while.cond17.preheader.thread: ; preds = %entry
%sub18111 = add i32 %conv, -1
%div19112 = sdiv i32 %sub18111, 4
br label %while.cond40.preheader
while.body.preheader: ; preds = %entry
%div116118 = lshr i64 %call2, 1
%wide.trip.count = and i64 %div116118, 2147483647
br label %while.body
while.cond: ; preds = %while.body
%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.end, label %while.body, !llvm.loop !5
while.body: ; preds = %while.body.preheader, %while.cond
%indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %while.cond ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%1 = xor i64 %indvars.iv, -1
%sub5 = add i64 %call2, %1
%sext = shl i64 %sub5, 32
%idxprom6 = ashr exact i64 %sext, 32
%arrayidx7 = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %idxprom6
%2 = load i8, ptr %arrayidx7, align 1, !tbaa !7
%cmp9.not = icmp eq i8 %0, %2
br i1 %cmp9.not, label %while.cond, label %if.then
if.then: ; preds = %while.body
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
while.end: ; preds = %while.cond
%cmp12 = icmp eq i32 %conv, 3
br i1 %cmp12, label %if.then14, label %while.cond17.preheader
while.cond17.preheader: ; preds = %while.end
%sub18 = add i32 %conv, -1
%div19 = sdiv i32 %sub18, 4
%cmp2094 = icmp sgt i32 %conv, 4
br i1 %cmp2094, label %while.body22.lr.ph, label %while.cond40.preheader
while.body22.lr.ph: ; preds = %while.cond17.preheader
%div27117119 = lshr i32 %sub18, 1
%smax = call i32 @llvm.smax.i32(i32 %div19, i32 1)
%wide.trip.count101 = zext i32 %smax to i64
br label %while.body22
if.then14: ; preds = %while.end
%puts89 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
br label %cleanup
while.cond17: ; preds = %while.body22
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
br i1 %exitcond102.not, label %while.cond40.preheader, label %while.body22, !llvm.loop !10
while.cond40.preheader: ; preds = %while.cond17, %while.cond17.preheader.thread, %while.cond17.preheader
%div19115 = phi i32 [ %div19112, %while.cond17.preheader.thread ], [ %div19, %while.cond17.preheader ], [ %div19, %while.cond17 ]
%sub18114 = phi i32 [ %sub18111, %while.cond17.preheader.thread ], [ %sub18, %while.cond17.preheader ], [ %sub18, %while.cond17 ]
%div52.neg = sdiv i32 %sub18114, -2
%sub55 = add i32 %sub18114, %div52.neg
%smax106 = call i32 @llvm.smax.i32(i32 %div19115, i32 0)
%wide.trip.count107 = zext i32 %smax106 to i64
br label %while.cond40
while.body22: ; preds = %while.body22.lr.ph, %while.cond17
%indvars.iv98 = phi i64 [ 0, %while.body22.lr.ph ], [ %indvars.iv.next99, %while.cond17 ]
%arrayidx24 = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %indvars.iv98
%3 = load i8, ptr %arrayidx24, align 1, !tbaa !7
%4 = trunc i64 %indvars.iv98 to i32
%5 = xor i32 %4, -1
%sub29 = add i32 %div27117119, %5
%idxprom30 = sext i32 %sub29 to i64
%arrayidx31 = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %idxprom30
%6 = load i8, ptr %arrayidx31, align 1, !tbaa !7
%cmp33.not = icmp eq i8 %3, %6
br i1 %cmp33.not, label %while.cond17, label %if.then35
if.then35: ; preds = %while.body22
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
while.cond40: ; preds = %while.cond40.preheader, %while.body45
%indvars.iv103 = phi i64 [ 0, %while.cond40.preheader ], [ %indvars.iv.next104, %while.body45 ]
%exitcond108.not = icmp eq i64 %indvars.iv103, %wide.trip.count107
br i1 %exitcond108.not, label %while.end66, label %while.body45
while.body45: ; preds = %while.cond40
%7 = xor i64 %indvars.iv103, -1
%sub47 = add i64 %call2, %7
%sext109 = shl i64 %sub47, 32
%idxprom48 = ashr exact i64 %sext109, 32
%arrayidx49 = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %idxprom48
%8 = load i8, ptr %arrayidx49, align 1, !tbaa !7
%indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
%9 = trunc i64 %indvars.iv.next104 to i32
%sub56 = add i32 %sub55, %9
%idxprom57 = sext i32 %sub56 to i64
%arrayidx58 = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %idxprom57
%10 = load i8, ptr %arrayidx58, align 1, !tbaa !7
%cmp60.not = icmp eq i8 %8, %10
br i1 %cmp60.not, label %while.cond40, label %if.then62, !llvm.loop !11
if.then62: ; preds = %while.body45
%call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
while.end66: ; preds = %while.cond40
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
br label %cleanup
cleanup: ; preds = %while.end66, %if.then62, %if.then35, %if.then14, %if.then
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %str) #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 memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !6}
|
#include<stdio.h>
#include<string.h>
// Kaibun -> Yes +1 / No. -1
int kaibun (char *S, int N)
{
for (int i = 0; i < (int)(N/2); i++)
if (S [i] != S [N - 1 - i])
return -1;
return 1;
}
int strongKaibun (char *S, int N)
{
int Nprime = (N - 1) / 2;
if (kaibun (S, N) == 1)
if (kaibun (S, Nprime) == 1)
if (kaibun (S + Nprime + 1, Nprime) == 1)
return 1;
return 0;
}
int main (void)
{
char S [100];
int N;
scanf("%s", S);
N = strlen (S); // N: oddは前提として暗黙に仮定してチェックしない。
if (strongKaibun (S, N) == 1)
printf ("Yes\n");
else
printf ("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186404/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186404/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @kaibun(ptr nocapture noundef readonly %S, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp.not12 = icmp sgt i32 %N, 1
br i1 %cmp.not12, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%div1617 = lshr i32 %N, 1
%wide.trip.count = zext i32 %div1617 to i64
br label %for.body
for.cond: ; preds = %for.body
%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 %cleanup, label %for.body, !llvm.loop !5
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i8, ptr %S, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%1 = trunc i64 %indvars.iv to i32
%2 = xor i32 %1, -1
%sub1 = add i32 %2, %N
%idxprom2 = sext i32 %sub1 to i64
%arrayidx3 = getelementptr inbounds i8, ptr %S, i64 %idxprom2
%3 = load i8, ptr %arrayidx3, align 1, !tbaa !7
%cmp5.not = icmp eq i8 %0, %3
br i1 %cmp5.not, label %for.cond, label %cleanup
cleanup: ; preds = %for.cond, %for.body, %entry
%spec.select = phi i32 [ 1, %entry ], [ -1, %for.body ], [ 1, %for.cond ]
ret i32 %spec.select
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @strongKaibun(ptr nocapture noundef readonly %S, i32 noundef %N) local_unnamed_addr #0 {
entry:
%sub = add nsw i32 %N, -1
%div = sdiv i32 %sub, 2
%cmp.not12.i = icmp sgt i32 %N, 1
br i1 %cmp.not12.i, label %for.body.preheader.i, label %cleanup
for.body.preheader.i: ; preds = %entry
%div1617.i = lshr i32 %N, 1
%wide.trip.count.i = zext i32 %div1617.i to i64
br label %for.body.i
for.cond.i: ; preds = %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 %if.then, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ]
%arrayidx.i = getelementptr inbounds i8, ptr %S, i64 %indvars.iv.i
%0 = load i8, ptr %arrayidx.i, align 1, !tbaa !7
%1 = trunc i64 %indvars.iv.i to i32
%2 = xor i32 %1, -1
%sub1.i = add i32 %2, %N
%idxprom2.i = sext i32 %sub1.i to i64
%arrayidx3.i = getelementptr inbounds i8, ptr %S, i64 %idxprom2.i
%3 = load i8, ptr %arrayidx3.i, align 1, !tbaa !7
%cmp5.not.i = icmp eq i8 %0, %3
br i1 %cmp5.not.i, label %for.cond.i, label %cleanup
if.then: ; preds = %for.cond.i
%cmp.not12.i15 = icmp sgt i32 %N, 4
br i1 %cmp.not12.i15, label %for.body.preheader.i17, label %cleanup
for.body.preheader.i17: ; preds = %if.then
%div1617.i18 = lshr i32 %div, 1
%wide.trip.count.i19 = zext i32 %div1617.i18 to i64
br label %for.body.i20
for.cond.i27: ; preds = %for.body.i20
%indvars.iv.next.i28 = add nuw nsw i64 %indvars.iv.i21, 1
%exitcond.not.i29 = icmp eq i64 %indvars.iv.next.i28, %wide.trip.count.i19
br i1 %exitcond.not.i29, label %if.then3, label %for.body.i20, !llvm.loop !5
for.body.i20: ; preds = %for.cond.i27, %for.body.preheader.i17
%indvars.iv.i21 = phi i64 [ 0, %for.body.preheader.i17 ], [ %indvars.iv.next.i28, %for.cond.i27 ]
%arrayidx.i22 = getelementptr inbounds i8, ptr %S, i64 %indvars.iv.i21
%4 = load i8, ptr %arrayidx.i22, align 1, !tbaa !7
%5 = trunc i64 %indvars.iv.i21 to i32
%6 = xor i32 %5, -1
%sub1.i23 = add i32 %div, %6
%idxprom2.i24 = sext i32 %sub1.i23 to i64
%arrayidx3.i25 = getelementptr inbounds i8, ptr %S, i64 %idxprom2.i24
%7 = load i8, ptr %arrayidx3.i25, align 1, !tbaa !7
%cmp5.not.i26 = icmp eq i8 %4, %7
br i1 %cmp5.not.i26, label %for.cond.i27, label %cleanup
if.then3: ; preds = %for.cond.i27
%idx.ext = sext i32 %div to i64
%add.ptr = getelementptr inbounds i8, ptr %S, i64 %idx.ext
%add.ptr4 = getelementptr inbounds i8, ptr %add.ptr, i64 1
br label %for.body.i36
for.cond.i43: ; preds = %for.body.i36
%indvars.iv.next.i44 = add nuw nsw i64 %indvars.iv.i37, 1
%exitcond.not.i45 = icmp eq i64 %indvars.iv.next.i44, %wide.trip.count.i19
br i1 %exitcond.not.i45, label %cleanup, label %for.body.i36, !llvm.loop !5
for.body.i36: ; preds = %for.cond.i43, %if.then3
%indvars.iv.i37 = phi i64 [ 0, %if.then3 ], [ %indvars.iv.next.i44, %for.cond.i43 ]
%arrayidx.i38 = getelementptr inbounds i8, ptr %add.ptr4, i64 %indvars.iv.i37
%8 = load i8, ptr %arrayidx.i38, align 1, !tbaa !7
%9 = trunc i64 %indvars.iv.i37 to i32
%10 = xor i32 %9, -1
%sub1.i39 = add i32 %div, %10
%idxprom2.i40 = sext i32 %sub1.i39 to i64
%arrayidx3.i41 = getelementptr inbounds i8, ptr %add.ptr4, i64 %idxprom2.i40
%11 = load i8, ptr %arrayidx3.i41, align 1, !tbaa !7
%cmp5.not.i42 = icmp eq i8 %8, %11
br i1 %cmp5.not.i42, label %for.cond.i43, label %cleanup
cleanup: ; preds = %for.body.i, %for.body.i20, %for.cond.i43, %for.body.i36, %entry, %if.then
%retval.0 = phi i32 [ 1, %if.then ], [ 1, %entry ], [ 1, %for.cond.i43 ], [ 0, %for.body.i36 ], [ 0, %for.body.i20 ], [ 0, %for.body.i ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%S = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #7
%conv = trunc i64 %call2 to i32
%sub.i = add nsw i32 %conv, -1
%div.i = sdiv i32 %sub.i, 2
%cmp.not12.i.i = icmp sgt i32 %conv, 1
br i1 %cmp.not12.i.i, label %for.body.preheader.i.i, label %if.end
for.body.preheader.i.i: ; preds = %entry
%div1617.i.i = lshr i64 %call2, 1
%wide.trip.count.i.i = and i64 %div1617.i.i, 2147483647
br label %for.body.i.i
for.cond.i.i: ; preds = %for.body.i.i
%indvars.iv.next.i.i = add nuw nsw i64 %indvars.iv.i.i, 1
%exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.i, label %if.then.i, label %for.body.i.i, !llvm.loop !5
for.body.i.i: ; preds = %for.cond.i.i, %for.body.preheader.i.i
%indvars.iv.i.i = phi i64 [ 0, %for.body.preheader.i.i ], [ %indvars.iv.next.i.i, %for.cond.i.i ]
%arrayidx.i.i = getelementptr inbounds i8, ptr %S, i64 %indvars.iv.i.i
%0 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !7
%1 = xor i64 %indvars.iv.i.i, -1
%sub1.i.i = add i64 %call2, %1
%sext = shl i64 %sub1.i.i, 32
%idxprom2.i.i = ashr exact i64 %sext, 32
%arrayidx3.i.i = getelementptr inbounds i8, ptr %S, i64 %idxprom2.i.i
%2 = load i8, ptr %arrayidx3.i.i, align 1, !tbaa !7
%cmp5.not.i.i = icmp eq i8 %0, %2
br i1 %cmp5.not.i.i, label %for.cond.i.i, label %if.end
if.then.i: ; preds = %for.cond.i.i
%cmp.not12.i15.i = icmp sgt i32 %conv, 4
br i1 %cmp.not12.i15.i, label %for.body.preheader.i17.i, label %if.end
for.body.preheader.i17.i: ; preds = %if.then.i
%div1617.i18.i = lshr i32 %div.i, 1
%wide.trip.count.i19.i = zext i32 %div1617.i18.i to i64
br label %for.body.i20.i
for.cond.i27.i: ; preds = %for.body.i20.i
%indvars.iv.next.i28.i = add nuw nsw i64 %indvars.iv.i21.i, 1
%exitcond.not.i29.i = icmp eq i64 %indvars.iv.next.i28.i, %wide.trip.count.i19.i
br i1 %exitcond.not.i29.i, label %if.then3.i, label %for.body.i20.i, !llvm.loop !5
for.body.i20.i: ; preds = %for.cond.i27.i, %for.body.preheader.i17.i
%indvars.iv.i21.i = phi i64 [ 0, %for.body.preheader.i17.i ], [ %indvars.iv.next.i28.i, %for.cond.i27.i ]
%arrayidx.i22.i = getelementptr inbounds i8, ptr %S, i64 %indvars.iv.i21.i
%3 = load i8, ptr %arrayidx.i22.i, align 1, !tbaa !7
%4 = trunc i64 %indvars.iv.i21.i to i32
%5 = xor i32 %4, -1
%sub1.i23.i = add i32 %div.i, %5
%idxprom2.i24.i = sext i32 %sub1.i23.i to i64
%arrayidx3.i25.i = getelementptr inbounds i8, ptr %S, i64 %idxprom2.i24.i
%6 = load i8, ptr %arrayidx3.i25.i, align 1, !tbaa !7
%cmp5.not.i26.i = icmp eq i8 %3, %6
br i1 %cmp5.not.i26.i, label %for.cond.i27.i, label %if.end
if.then3.i: ; preds = %for.cond.i27.i
%idx.ext.i = sext i32 %div.i to i64
%add.ptr.i = getelementptr inbounds i8, ptr %S, i64 %idx.ext.i
%add.ptr4.i = getelementptr inbounds i8, ptr %add.ptr.i, i64 1
br label %for.body.i36.i
for.cond.i43.i: ; preds = %for.body.i36.i
%indvars.iv.next.i44.i = add nuw nsw i64 %indvars.iv.i37.i, 1
%exitcond.not.i45.i = icmp eq i64 %indvars.iv.next.i44.i, %wide.trip.count.i19.i
br i1 %exitcond.not.i45.i, label %if.end, label %for.body.i36.i, !llvm.loop !5
for.body.i36.i: ; preds = %for.cond.i43.i, %if.then3.i
%indvars.iv.i37.i = phi i64 [ 0, %if.then3.i ], [ %indvars.iv.next.i44.i, %for.cond.i43.i ]
%arrayidx.i38.i = getelementptr inbounds i8, ptr %add.ptr4.i, i64 %indvars.iv.i37.i
%7 = load i8, ptr %arrayidx.i38.i, align 1, !tbaa !7
%8 = trunc i64 %indvars.iv.i37.i to i32
%9 = xor i32 %8, -1
%sub1.i39.i = add i32 %div.i, %9
%idxprom2.i40.i = sext i32 %sub1.i39.i to i64
%arrayidx3.i41.i = getelementptr inbounds i8, ptr %add.ptr4.i, i64 %idxprom2.i40.i
%10 = load i8, ptr %arrayidx3.i41.i, align 1, !tbaa !7
%cmp5.not.i42.i = icmp eq i8 %7, %10
br i1 %cmp5.not.i42.i, label %for.cond.i43.i, label %if.end
if.end: ; preds = %for.body.i.i, %for.body.i20.i, %for.body.i36.i, %for.cond.i43.i, %entry, %if.then.i
%str.sink = phi ptr [ @str.3, %if.then.i ], [ @str.3, %entry ], [ @str.3, %for.cond.i43.i ], [ @str, %for.body.i36.i ], [ @str, %for.body.i20.i ], [ @str, %for.body.i.i ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
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 = { nofree nounwind "no-trapping-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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#define true 0
#define false 1
int kaibun(char str[], int s, int l) {
for (int i = s; i < l/2; i++) {
if (str[i] != str[l-i-1])
return false;
}
return true;
}
int main() {
char str[100];
int len;
scanf("%s\n", str);
len = strlen(str);
if ( kaibun(str, 0, len) == true ) {
if ( kaibun(str, 0, (len-1)/2) == true ) {
if ( kaibun(str, (len+3)/2, len-(len+3)/2) == true ) {
printf("Yes\n");
return 0;
}
}
}
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186448/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186448/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @kaibun(ptr nocapture noundef readonly %str, i32 noundef %s, i32 noundef %l) local_unnamed_addr #0 {
entry:
%div = sdiv i32 %l, 2
%cmp.not12 = icmp sgt i32 %div, %s
br i1 %cmp.not12, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%0 = sext i32 %s to i64
%1 = sext i32 %div to i64
%arrayidx16 = getelementptr inbounds i8, ptr %str, i64 %0
%2 = load i8, ptr %arrayidx16, align 1, !tbaa !5
%3 = xor i32 %s, -1
%sub117 = add i32 %3, %l
%idxprom218 = sext i32 %sub117 to i64
%arrayidx319 = getelementptr inbounds i8, ptr %str, i64 %idxprom218
%4 = load i8, ptr %arrayidx319, align 1, !tbaa !5
%cmp5.not20 = icmp eq i8 %2, %4
br i1 %cmp5.not20, label %for.cond, label %cleanup
for.cond: ; preds = %for.body.preheader, %for.body
%indvars.iv21 = phi i64 [ %indvars.iv.next, %for.body ], [ %0, %for.body.preheader ]
%indvars.iv.next = add nsw i64 %indvars.iv21, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %div, %lftr.wideiv
br i1 %exitcond.not, label %cleanup.loopexit.loopexit, label %for.body, !llvm.loop !8
for.body: ; preds = %for.cond
%arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next
%5 = load i8, ptr %arrayidx, align 1, !tbaa !5
%6 = trunc i64 %indvars.iv.next to i32
%7 = xor i32 %6, -1
%sub1 = add i32 %7, %l
%idxprom2 = sext i32 %sub1 to i64
%arrayidx3 = getelementptr inbounds i8, ptr %str, i64 %idxprom2
%8 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%cmp5.not = icmp eq i8 %5, %8
br i1 %cmp5.not, label %for.cond, label %cleanup.loopexit.loopexit, !llvm.loop !8
cleanup.loopexit.loopexit: ; preds = %for.body, %for.cond
%cmp.not.le = icmp slt i64 %indvars.iv.next, %1
%9 = zext i1 %cmp.not.le to i32
br label %cleanup
cleanup: ; preds = %for.body.preheader, %cleanup.loopexit.loopexit, %entry
%cmp.not.lcssa = phi i32 [ 0, %entry ], [ 1, %for.body.preheader ], [ %9, %cleanup.loopexit.loopexit ]
ret i32 %cmp.not.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:
%str = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #7
%conv = trunc i64 %call2 to i32
%cmp.not12.i = icmp sgt i32 %conv, 1
br i1 %cmp.not12.i, label %for.body.preheader.i, label %if.then10
for.body.preheader.i: ; preds = %entry
%div.i104105 = lshr i64 %call2, 1
%0 = and i64 %div.i104105, 2147483647
%1 = load i8, ptr %str, align 16, !tbaa !5
%sub1.i76 = shl i64 %call2, 32
%sext77 = add i64 %sub1.i76, -4294967296
%idxprom2.i78 = ashr exact i64 %sext77, 32
%arrayidx3.i79 = getelementptr inbounds i8, ptr %str, i64 %idxprom2.i78
%2 = load i8, ptr %arrayidx3.i79, align 1, !tbaa !5
%cmp5.not.i80 = icmp eq i8 %1, %2
br i1 %cmp5.not.i80, label %for.cond.i, label %if.end22
for.cond.i: ; preds = %for.body.preheader.i, %for.body.i
%indvars.iv.i81 = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %for.body.preheader.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i81, 1
%3 = icmp eq i64 %indvars.iv.next.i, %0
br i1 %3, label %kaibun.exit, label %for.body.i, !llvm.loop !8
for.body.i: ; preds = %for.cond.i
%arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i
%4 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%reass.sub = sub i64 %call2, %indvars.iv.i81
%sub1.i = shl i64 %reass.sub, 32
%sext = add i64 %sub1.i, -8589934592
%idxprom2.i = ashr exact i64 %sext, 32
%arrayidx3.i = getelementptr inbounds i8, ptr %str, i64 %idxprom2.i
%5 = load i8, ptr %arrayidx3.i, align 1, !tbaa !5
%cmp5.not.i = icmp eq i8 %4, %5
br i1 %cmp5.not.i, label %for.cond.i, label %kaibun.exit, !llvm.loop !8
kaibun.exit: ; preds = %for.body.i, %for.cond.i
%cmp.not.i.le = icmp ult i64 %indvars.iv.next.i, %0
br i1 %cmp.not.i.le, label %if.end22, label %if.then
if.then: ; preds = %kaibun.exit
%sub = add nsw i32 %conv, -1
%div = sdiv i32 %sub, 2
%div.i30 = sdiv i32 %sub, 4
%cmp.not12.i31 = icmp sgt i32 %conv, 4
br i1 %cmp.not12.i31, label %for.body.preheader.i33, label %if.then10
for.body.preheader.i33: ; preds = %if.then
%6 = zext i32 %div.i30 to i64
%7 = load i8, ptr %str, align 16, !tbaa !5
%sub1.i3883 = add nsw i32 %div, -1
%idxprom2.i3984 = sext i32 %sub1.i3883 to i64
%arrayidx3.i4085 = getelementptr inbounds i8, ptr %str, i64 %idxprom2.i3984
%8 = load i8, ptr %arrayidx3.i4085, align 1, !tbaa !5
%cmp5.not.i4186 = icmp eq i8 %7, %8
br i1 %cmp5.not.i4186, label %for.cond.i44.preheader, label %if.end22
for.cond.i44.preheader: ; preds = %for.body.preheader.i33
%9 = add nsw i32 %div.i30, -1
%wide.trip.count = zext i32 %9 to i64
br label %for.cond.i44
for.cond.i44: ; preds = %for.cond.i44.preheader, %for.body.i34
%indvars.iv.i3587 = phi i64 [ %indvars.iv.next.i45, %for.body.i34 ], [ 0, %for.cond.i44.preheader ]
%indvars.iv.next.i45 = add nuw nsw i64 %indvars.iv.i3587, 1
%exitcond = icmp eq i64 %indvars.iv.i3587, %wide.trip.count
br i1 %exitcond, label %kaibun.exit49, label %for.body.i34, !llvm.loop !8
for.body.i34: ; preds = %for.cond.i44
%arrayidx.i37 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i45
%10 = load i8, ptr %arrayidx.i37, align 1, !tbaa !5
%11 = trunc i64 %indvars.iv.next.i45 to i32
%12 = xor i32 %11, -1
%sub1.i38 = add i32 %div, %12
%idxprom2.i39 = sext i32 %sub1.i38 to i64
%arrayidx3.i40 = getelementptr inbounds i8, ptr %str, i64 %idxprom2.i39
%13 = load i8, ptr %arrayidx3.i40, align 1, !tbaa !5
%cmp5.not.i41 = icmp eq i8 %10, %13
br i1 %cmp5.not.i41, label %for.cond.i44, label %kaibun.exit49, !llvm.loop !8
kaibun.exit49: ; preds = %for.body.i34, %for.cond.i44
%cmp.not.i46.le = icmp ult i64 %indvars.iv.next.i45, %6
br i1 %cmp.not.i46.le, label %if.end22, label %if.then10
if.then10: ; preds = %entry, %if.then, %kaibun.exit49
%add = add nsw i32 %conv, 3
%div12 = sdiv i32 %add, 2
%sub15 = sub nsw i32 %conv, %div12
%div.i50 = sdiv i32 %sub15, 2
%cmp.not12.i51 = icmp sgt i32 %div.i50, %div12
br i1 %cmp.not12.i51, label %for.body.preheader.i53, label %cleanup
for.body.preheader.i53: ; preds = %if.then10
%14 = sext i32 %div12 to i64
%15 = sext i32 %div.i50 to i64
%arrayidx.i5790 = getelementptr inbounds i8, ptr %str, i64 %14
%16 = load i8, ptr %arrayidx.i5790, align 1, !tbaa !5
%17 = xor i32 %div12, -1
%sub1.i5891 = add i32 %sub15, %17
%idxprom2.i5992 = sext i32 %sub1.i5891 to i64
%arrayidx3.i6093 = getelementptr inbounds i8, ptr %str, i64 %idxprom2.i5992
%18 = load i8, ptr %arrayidx3.i6093, align 1, !tbaa !5
%cmp5.not.i6194 = icmp eq i8 %16, %18
br i1 %cmp5.not.i6194, label %for.cond.i64, label %if.end22
for.cond.i64: ; preds = %for.body.preheader.i53, %for.body.i54
%indvars.iv.i5595 = phi i64 [ %indvars.iv.next.i65, %for.body.i54 ], [ %14, %for.body.preheader.i53 ]
%indvars.iv.next.i65 = add nsw i64 %indvars.iv.i5595, 1
%lftr.wideiv.i67 = trunc i64 %indvars.iv.next.i65 to i32
%exitcond.not.i68 = icmp eq i32 %div.i50, %lftr.wideiv.i67
br i1 %exitcond.not.i68, label %kaibun.exit69, label %for.body.i54, !llvm.loop !8
for.body.i54: ; preds = %for.cond.i64
%arrayidx.i57 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i65
%19 = load i8, ptr %arrayidx.i57, align 1, !tbaa !5
%20 = xor i32 %lftr.wideiv.i67, -1
%sub1.i58 = add i32 %sub15, %20
%idxprom2.i59 = sext i32 %sub1.i58 to i64
%arrayidx3.i60 = getelementptr inbounds i8, ptr %str, i64 %idxprom2.i59
%21 = load i8, ptr %arrayidx3.i60, align 1, !tbaa !5
%cmp5.not.i61 = icmp eq i8 %19, %21
br i1 %cmp5.not.i61, label %for.cond.i64, label %kaibun.exit69, !llvm.loop !8
kaibun.exit69: ; preds = %for.body.i54, %for.cond.i64
%cmp.not.i66.le = icmp slt i64 %indvars.iv.next.i65, %15
br i1 %cmp.not.i66.le, label %if.end22, label %cleanup
if.end22: ; preds = %for.body.preheader.i53, %for.body.preheader.i33, %for.body.preheader.i, %kaibun.exit49, %kaibun.exit69, %kaibun.exit
br label %cleanup
cleanup: ; preds = %kaibun.exit69, %if.then10, %if.end22
%str.sink = phi ptr [ @str, %if.end22 ], [ @str.3, %if.then10 ], [ @str.3, %kaibun.exit69 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int x, y;
int t;
while (scanf("%d %d", &x, &y), x != 0 || y != 0){
if (x > y){
t = y;
y = x;
x = t;
}
printf("%d %d\n", x, y);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186491/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186491/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp6 = icmp ne i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp17 = icmp ne i32 %1, 0
%2 = select i1 %cmp6, i1 true, i1 %cmp17
br i1 %2, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%3 = phi i32 [ %8, %if.end ], [ %1, %entry ]
%4 = phi i32 [ %7, %if.end ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %4, %3
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %while.body
store i32 %4, ptr %y, align 4, !tbaa !5
store i32 %3, ptr %x, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%5 = phi i32 [ %4, %if.then ], [ %3, %while.body ]
%6 = phi i32 [ %3, %if.then ], [ %4, %while.body ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6, i32 noundef %5)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%7 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp ne i32 %7, 0
%8 = load i32, ptr %y, align 4
%cmp1 = icmp ne i32 %8, 0
%9 = select i1 %cmp, i1 true, i1 %cmp1
br i1 %9, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int x,y;
while(1){
scanf("%d %d",&x,&y);
if( x == 0 && y == 0) break;
if(x<y){
printf("%d %d\n",x,y);
}
if(x>y){
printf("%d %d\n",y,x);
}
if(x == y){
printf("%d %d\n",x,y);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186541/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186541/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp20 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp121 = icmp eq i32 %1, 0
%or.cond22 = select i1 %cmp20, i1 %cmp121, i1 false
br i1 %or.cond22, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end13
%2 = phi i32 [ %9, %if.end13 ], [ %1, %entry ]
%3 = phi i32 [ %8, %if.end13 ], [ %0, %entry ]
%cmp2 = icmp slt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2)
%.pre = load i32, ptr %x, align 4, !tbaa !5
%.pre23 = load i32, ptr %y, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%4 = phi i32 [ %.pre23, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre, %if.then3 ], [ %3, %if.end ]
%cmp6 = icmp sgt i32 %5, %4
br i1 %cmp6, label %if.then7, label %if.end9
if.then7: ; preds = %if.end5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %5)
%.pre24 = load i32, ptr %x, align 4, !tbaa !5
%.pre25 = load i32, ptr %y, align 4, !tbaa !5
br label %if.end9
if.end9: ; preds = %if.then7, %if.end5
%6 = phi i32 [ %.pre25, %if.then7 ], [ %4, %if.end5 ]
%7 = phi i32 [ %.pre24, %if.then7 ], [ %5, %if.end5 ]
%cmp10 = icmp eq i32 %7, %6
br i1 %cmp10, label %if.then11, label %if.end13
if.then11: ; preds = %if.end9
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6, i32 noundef %6)
br label %if.end13
if.end13: ; preds = %if.then11, %if.end9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%8 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %8, 0
%9 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %9, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end13, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,i=0;
while(1){
i++;
scanf("%d%d",&a,&b);
if(a==0&&b==0){
break;
}
if(a<b){
printf("%d %d\n",a,b);
}
else{
printf("%d %d\n",b,a);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186585/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186585/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca 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
%call9 = 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
%cmp10 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp111 = icmp eq i32 %1, 0
%or.cond12 = select i1 %cmp10, i1 %cmp111, i1 false
br i1 %or.cond12, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end6
%2 = phi i32 [ %5, %if.end6 ], [ %1, %entry ]
%3 = phi i32 [ %4, %if.end6 ], [ %0, %entry ]
%cmp2 = icmp slt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.else
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2)
br label %if.end6
if.else: ; preds = %if.end
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %3)
br label %if.end6
if.end6: ; preds = %if.else, %if.then3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%4 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end6, %entry
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<stdlib.h>
int main()
{
int n,max=0,flag=-1,i;
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(a[i]>i||a[i]>(max+1))
{
flag=i+1;
break;
}
else if(a[i]>max)
max=a[i];
}
printf("%d",flag);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18665/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18665/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #5
%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
%cmp27 = icmp sgt i32 %3, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %if.else
%indvars.iv = phi i64 [ %indvars.iv.next, %if.else ], [ 0, %entry ]
%max.029 = phi i32 [ %spec.select, %if.else ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp4 = icmp slt i64 %indvars.iv, %5
%add = add nuw nsw i32 %max.029, 1
%cmp7 = icmp sgt i32 %4, %add
%or.cond = select i1 %cmp4, i1 true, i1 %cmp7
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %for.body
%6 = trunc i64 %indvars.iv to i32
%add8 = add nuw nsw i32 %6, 1
br label %for.end
if.else: ; preds = %for.body
%spec.select = call i32 @llvm.smax.i32(i32 %4, i32 %max.029)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.else, %entry, %if.then
%flag.0 = phi i32 [ %add8, %if.then ], [ -1, %entry ], [ -1, %if.else ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %flag.0)
call void @llvm.stackrestore.p0(ptr %2)
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.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int x, y, temp;
while(1){
scanf("%d %d", &x, &y);
if(x>y){
temp = x;
x = y;
y = temp;
}
if(x == 0 && y == 0) break;
printf("%d %d\n", x, y);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186693/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186693/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
br label %while.cond
while.cond: ; preds = %if.end4, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %while.cond
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, %while.cond
%2 = phi i32 [ %0, %if.then ], [ %1, %while.cond ]
%3 = phi i32 [ %1, %if.then ], [ %0, %while.cond ]
%4 = or i32 %3, %2
%or.cond = icmp eq i32 %4, 0
br i1 %or.cond, label %while.end, label %if.end4
if.end4: ; preds = %if.end
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2)
br label %while.cond
while.end: ; preds = %if.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int i,x,y;
while(1){
scanf("%d %d",&x,&y);
if(x==0 && y==0)break;
if(x < y){
printf("%d %d\n",x,y);
}
else if(x >= y){
printf("%d %d\n",y,x);
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186750/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186750/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp13 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp114 = icmp eq i32 %1, 0
%or.cond15 = select i1 %cmp13, i1 %cmp114, i1 false
br i1 %or.cond15, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end9
%2 = phi i32 [ %5, %if.end9 ], [ %1, %entry ]
%3 = phi i32 [ %4, %if.end9 ], [ %0, %entry ]
%cmp2 = icmp slt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.then6
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2)
br label %if.end9
if.then6: ; preds = %if.end
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %3)
br label %if.end9
if.end9: ; preds = %if.then6, %if.then3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%4 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end9, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int c, x, y;
while(1) {
scanf("%d %d", &x, &y);
if (x == 0 && y == 0){
break;
}
else if (x > y) {
c = x;
x = y;
y = c;
}
printf("%d %d\n", x, y);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186815/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186815/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp8 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp19 = icmp eq i32 %1, 0
%or.cond10 = select i1 %cmp8, i1 %cmp19, i1 false
br i1 %or.cond10, label %while.end, label %if.else
if.else: ; preds = %entry, %if.end4
%2 = phi i32 [ %7, %if.end4 ], [ %1, %entry ]
%3 = phi i32 [ %6, %if.end4 ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end4
if.then3: ; preds = %if.else
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %3, ptr %y, align 4, !tbaa !5
br label %if.end4
if.end4: ; preds = %if.else, %if.then3
%4 = phi i32 [ %2, %if.else ], [ %3, %if.then3 ]
%5 = phi i32 [ %3, %if.else ], [ %2, %if.then3 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %4)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%6 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.else
while.end: ; preds = %if.end4, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int x, y;
while(1){
scanf("%d %d", &x, &y);
if(x == 0 && y == 0){
break;
}
if(x > y){
printf("%d %d\n", y, x);
}
else{
printf("%d %d\n", x, y);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186866/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186866/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp10 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp111 = icmp eq i32 %1, 0
%or.cond12 = select i1 %cmp10, i1 %cmp111, i1 false
br i1 %or.cond12, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end6
%2 = phi i32 [ %5, %if.end6 ], [ %1, %entry ]
%3 = phi i32 [ %4, %if.end6 ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.else
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %3)
br label %if.end6
if.else: ; preds = %if.end
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2)
br label %if.end6
if.end6: ; preds = %if.else, %if.then3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%4 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end6, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
int main() {
long long int n, p = 1, i;
scanf("%lld", &n);
for (i = 1; i <= n; i++) {
p *= i;
p %= 1000000007;
}
printf("%lld", p);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186916/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186916/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not6 = icmp slt i64 %0, 1
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %0, 3
%1 = icmp ult i64 %0, 4
br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %0, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%i.08 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.3, %for.body ]
%p.07 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %i.08, %p.07
%rem = srem i64 %mul, 1000000007
%inc = add nuw nsw i64 %i.08, 1
%mul.1 = mul nsw i64 %inc, %rem
%rem.1 = srem i64 %mul.1, 1000000007
%inc.1 = add nuw nsw i64 %i.08, 2
%mul.2 = mul nsw i64 %inc.1, %rem.1
%rem.2 = srem i64 %mul.2, 1000000007
%inc.2 = add nuw i64 %i.08, 3
%mul.3 = mul nsw i64 %inc.2, %rem.2
%rem.3 = srem i64 %mul.3, 1000000007
%inc.3 = add nuw i64 %i.08, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%i.08.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.3, %for.body ]
%p.07.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%i.08.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.08.unr, %for.end.loopexit.unr-lcssa ]
%p.07.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %p.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %i.08.epil, %p.07.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%inc.epil = add nuw i64 %i.08.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%p.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %p.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
int main(void){
int ts,tl,x,y,z,t1,t2,t3,xz,xy;
scanf("%d%d%d%d%d%d",&x,&y,&z,&t1,&t2,&t3);
if (x>z) xz=x-z;
else xz=z-x;
if (x>y) xy=x-y;
else xy=y-x;
ts=t1*xy;
tl=3*t3+t2*xz+t2*xy;
if (ts<tl) printf("NO");
else printf("YES");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18696/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18696/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\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:
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
%t1 = alloca i32, align 4
%t2 = alloca i32, align 4
%t3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t3) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z, ptr noundef nonnull %t1, ptr noundef nonnull %t2, ptr noundef nonnull %t3)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %z, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%xz.0 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%2 = load i32, ptr %y, align 4, !tbaa !5
%sub4 = sub nsw i32 %0, %2
%xy.0 = call i32 @llvm.abs.i32(i32 %sub4, i1 true)
%3 = load i32, ptr %t1, align 4, !tbaa !5
%mul = mul nsw i32 %xy.0, %3
%4 = load i32, ptr %t3, align 4, !tbaa !5
%mul8 = mul nsw i32 %4, 3
%5 = load i32, ptr %t2, align 4, !tbaa !5
%reass.add = add nuw i32 %xy.0, %xz.0
%reass.mul = mul i32 %reass.add, %5
%add11 = add i32 %reass.mul, %mul8
%cmp12 = icmp slt i32 %mul, %add11
%.str.1..str.2 = select i1 %cmp12, ptr @.str.1, ptr @.str.2
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF 1 << 29
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
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); }
int main()
{
ll n;
scanf("%lld", &n);
ll ans = 1;
for (int i = 1; i <= n; i++)
{
ans = i * ans % MOD;
}
printf("%lld\n", ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187001/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187001/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\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) #5
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) #5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not7 = icmp slt i64 %0, 1
br i1 %cmp.not7, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %0, 3
%1 = icmp ult i64 %0, 4
br i1 %1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %0, -4
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%ans.08.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%ans.08.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %ans.08.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %indvars.iv.epil, %ans.08.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !9
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%ans.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%ans.08 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %indvars.iv, %ans.08
%rem = srem i64 %mul, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %indvars.iv.next, %rem
%rem.1 = srem i64 %mul.1, 1000000007
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul nsw i64 %indvars.iv.next.1, %rem.1
%rem.2 = srem i64 %mul.2, 1000000007
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul nsw i64 %indvars.iv.next.2, %rem.2
%rem.3 = srem i64 %mul.3, 1000000007
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void) {
long long int i;
long long int n;
long long int power = 1;
scanf("%lld", &n);
for (i = 1; i <= n; i++) {
power = power * i;
power = power % 1000000007;
}
printf("%lld", power);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187045/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187045/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not6 = icmp slt i64 %0, 1
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %0, 3
%1 = icmp ult i64 %0, 4
br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %0, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%power.08 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%i.07 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %power.08, %i.07
%rem = srem i64 %mul, 1000000007
%inc = add nuw nsw i64 %i.07, 1
%mul.1 = mul nsw i64 %rem, %inc
%rem.1 = srem i64 %mul.1, 1000000007
%inc.1 = add nuw nsw i64 %i.07, 2
%mul.2 = mul nsw i64 %rem.1, %inc.1
%rem.2 = srem i64 %mul.2, 1000000007
%inc.2 = add nuw i64 %i.07, 3
%mul.3 = mul nsw i64 %rem.2, %inc.2
%rem.3 = srem i64 %mul.3, 1000000007
%inc.3 = add nuw i64 %i.07, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%power.08.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%power.08.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %power.08.unr, %for.end.loopexit.unr-lcssa ]
%i.07.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %power.08.epil, %i.07.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%inc.epil = add nuw i64 %i.07.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%power.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %power.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
int i=1,n=0;
long long power=1;
int main(void){
scanf("%d",&n);
for(i=1;i<=n;i++){
power=(power*i)%1000000007;
}
printf("%lld\n",power);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187089/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187089/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@i = dso_local local_unnamed_addr global i32 1, align 4
@n = dso_local global i32 0, align 4
@power = dso_local local_unnamed_addr global i64 1, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%power.promoted = load i64, ptr @power, align 8, !tbaa !9
%cmp.not3 = icmp slt i32 %0, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
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.cond.for.end_crit_edge.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 ]
%rem24 = phi i64 [ %power.promoted, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %rem24, %indvars.iv
%rem = srem i64 %mul, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, 1000000007
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul nsw i64 %rem.1, %indvars.iv.next.1
%rem.2 = srem i64 %mul.2, 1000000007
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul nsw i64 %rem.2, %indvars.iv.next.2
%rem.3 = srem i64 %mul.3, 1000000007
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.for.end_crit_edge.unr-lcssa, label %for.body, !llvm.loop !11
for.cond.for.end_crit_edge.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%rem24.unr = phi i64 [ %power.promoted, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.for.end_crit_edge, label %for.body.epil
for.body.epil: ; preds = %for.cond.for.end_crit_edge.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond.for.end_crit_edge.unr-lcssa ]
%rem24.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %rem24.unr, %for.cond.for.end_crit_edge.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.for.end_crit_edge.unr-lcssa ]
%mul.epil = mul nsw i64 %rem24.epil, %indvars.iv.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.for.end_crit_edge, label %for.body.epil, !llvm.loop !13
for.cond.for.end_crit_edge: ; preds = %for.body.epil, %for.cond.for.end_crit_edge.unr-lcssa
%rem.lcssa = phi i64 [ %rem.lcssa.ph, %for.cond.for.end_crit_edge.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%5 = add i32 %0, 1
store i64 %rem.lcssa, ptr @power, align 8, !tbaa !9
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %entry
%6 = phi i64 [ %rem.lcssa, %for.cond.for.end_crit_edge ], [ %power.promoted, %entry ]
%storemerge.lcssa = phi i32 [ %5, %for.cond.for.end_crit_edge ], [ 1, %entry ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %6)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int main(void)
{
long pow = 1;
int n, i;
scanf("%d", &n);
for(i=1; i<=n; i++){
pow = (pow*i)%1000000007;
}
printf("%ld\n", pow);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187131/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187131/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp.not5 = icmp slt i32 %0, 1
br i1 %cmp.not5, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add 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.loopexit.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 ]
%pow.06 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %pow.06, %indvars.iv
%rem = srem i64 %mul, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, 1000000007
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul nsw i64 %rem.1, %indvars.iv.next.1
%rem.2 = srem i64 %mul.2, 1000000007
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul nsw i64 %rem.2, %indvars.iv.next.2
%rem.3 = srem i64 %mul.3, 1000000007
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%pow.06.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%pow.06.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %pow.06.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %pow.06.epil, %indvars.iv.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%pow.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %pow.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
int comp(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return (*(int*)a<*(int*)b)-(*(int*)a>*(int*)b);}
uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint64_t nextplong(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }
inline int max2(const int a, const int b){return a>b?a:b;}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}
inline int abs2(const int a){return a>=0?a:-a;}
int main(void){
int n=nextpint();
int k=nextpint();
int s=nextpint();
if(s==1000000000){
for(int i=0; i<k; i++){
printf("%d ", 1000000000);
}
for(int i=k; i<n; i++){
printf("%d ", 1);
}
putchar(10);
}else{
for(int i=0; i<k; i++){
printf("%d ", s);
}
for(int i=k; i<n; i++){
printf("%d ", 1000000000);
}
putchar(10);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187182/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187182/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comp(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
%cmp = icmp sgt i32 %0, %1
%conv = zext i1 %cmp to i32
%cmp1 = icmp slt i32 %0, %1
%conv2.neg = sext i1 %cmp1 to i32
%sub = add nsw i32 %conv2.neg, %conv
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compr(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
%cmp = icmp slt i32 %0, %1
%conv = zext i1 %cmp to i32
%cmp1 = icmp sgt i32 %0, %1
%conv2.neg = sext i1 %cmp1 to i32
%sub = add nsw i32 %conv2.neg, %conv
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @nextpint() local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i = tail call i32 @getc(ptr noundef %0)
%sext28 = shl i32 %call.i, 24
%1 = add i32 %sext28, -956301313
%2 = icmp ult i32 %1, -150994945
br i1 %2, label %while.body, label %while.body15.preheader
while.body: ; preds = %entry, %while.body
%3 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i26 = tail call i32 @getc(ptr noundef %3)
%sext = shl i32 %call.i26, 24
%4 = add i32 %sext, -956301313
%5 = icmp ult i32 %4, -150994945
br i1 %5, label %while.body, label %while.body15.preheader, !llvm.loop !11
while.body15.preheader: ; preds = %while.body, %entry
%c.1.in30.ph = phi i32 [ %call.i, %entry ], [ %call.i26, %while.body ]
br label %while.body15
while.body15: ; preds = %while.body15.preheader, %while.body15
%x.031 = phi i32 [ %sub, %while.body15 ], [ 0, %while.body15.preheader ]
%c.1.in30 = phi i32 [ %call.i27, %while.body15 ], [ %c.1.in30.ph, %while.body15.preheader ]
%conv9 = and i32 %c.1.in30, 255
%mul = mul i32 %x.031, 10
%add = add nsw i32 %conv9, -48
%sub = add i32 %add, %mul
%6 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i27 = tail call i32 @getc(ptr noundef %6)
%sext25 = shl i32 %call.i27, 24
%7 = add i32 %sext25, -788529153
%8 = icmp ult i32 %7, 184549375
br i1 %8, label %while.body15, label %while.end19, !llvm.loop !13
while.end19: ; preds = %while.body15
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @nextplong() local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i = tail call i32 @getc(ptr noundef %0)
%sext29 = shl i32 %call.i, 24
%1 = add i32 %sext29, -956301313
%2 = icmp ult i32 %1, -150994945
br i1 %2, label %while.body, label %while.body15.preheader
while.body: ; preds = %entry, %while.body
%3 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i27 = tail call i32 @getc(ptr noundef %3)
%sext = shl i32 %call.i27, 24
%4 = add i32 %sext, -956301313
%5 = icmp ult i32 %4, -150994945
br i1 %5, label %while.body, label %while.body15.preheader, !llvm.loop !14
while.body15.preheader: ; preds = %while.body, %entry
%c.1.in31.ph = phi i32 [ %call.i, %entry ], [ %call.i27, %while.body ]
br label %while.body15
while.body15: ; preds = %while.body15.preheader, %while.body15
%x.032 = phi i64 [ %sub, %while.body15 ], [ 0, %while.body15.preheader ]
%c.1.in31 = phi i32 [ %call.i28, %while.body15 ], [ %c.1.in31.ph, %while.body15.preheader ]
%c.1 = zext i32 %c.1.in31 to i64
%mul = mul i64 %x.032, 10
%sext26 = shl i64 %c.1, 56
%conv16 = ashr exact i64 %sext26, 56
%add = add i64 %mul, -48
%sub = add i64 %add, %conv16
%6 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i28 = tail call i32 @getc(ptr noundef %6)
%sext25 = shl i32 %call.i28, 24
%7 = add i32 %sext25, -788529153
%8 = icmp ult i32 %7, 184549375
br i1 %8, label %while.body15, label %while.end19, !llvm.loop !15
while.end19: ; preds = %while.body15
ret i64 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @nextstr(ptr nocapture noundef writeonly %s) local_unnamed_addr #1 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i26 = tail call i32 @getc(ptr noundef %0)
%sext = shl i32 %call.i26, 24
switch i32 %sext, label %while.cond8 [
i32 536870912, label %while.cond.backedge
i32 167772160, label %while.cond.backedge
]
while.cond.backedge: ; preds = %while.cond, %while.cond
br label %while.cond, !llvm.loop !16
while.cond8: ; preds = %while.cond, %while.body15
%s.addr.0 = phi ptr [ %incdec.ptr, %while.body15 ], [ %s, %while.cond ]
%c.1.in = phi i32 [ %call.i27, %while.body15 ], [ %call.i26, %while.cond ]
%len.0 = phi i32 [ %inc, %while.body15 ], [ 0, %while.cond ]
%sext25 = shl i32 %c.1.in, 24
switch i32 %sext25, label %while.body15 [
i32 536870912, label %while.end18
i32 167772160, label %while.end18
]
while.body15: ; preds = %while.cond8
%c.1 = trunc i32 %c.1.in to i8
%incdec.ptr = getelementptr inbounds i8, ptr %s.addr.0, i64 1
store i8 %c.1, ptr %s.addr.0, align 1, !tbaa !17
%inc = add i32 %len.0, 1
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i27 = tail call i32 @getc(ptr noundef %1)
br label %while.cond8, !llvm.loop !18
while.end18: ; preds = %while.cond8, %while.cond8
store i8 0, ptr %s.addr.0, align 1, !tbaa !17
ret i32 %len.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i.i = tail call i32 @getc(ptr noundef %0)
%sext28.i = shl i32 %call.i.i, 24
%1 = add i32 %sext28.i, -956301313
%2 = icmp ult i32 %1, -150994945
br i1 %2, label %while.body.i, label %while.body15.i.preheader
while.body.i: ; preds = %entry, %while.body.i
%3 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i26.i = tail call i32 @getc(ptr noundef %3)
%sext.i = shl i32 %call.i26.i, 24
%4 = add i32 %sext.i, -956301313
%5 = icmp ult i32 %4, -150994945
br i1 %5, label %while.body.i, label %while.body15.i.preheader, !llvm.loop !11
while.body15.i.preheader: ; preds = %while.body.i, %entry
%c.1.in30.i.ph = phi i32 [ %call.i.i, %entry ], [ %call.i26.i, %while.body.i ]
br label %while.body15.i
while.body15.i: ; preds = %while.body15.i.preheader, %while.body15.i
%x.031.i = phi i32 [ %sub.i, %while.body15.i ], [ 0, %while.body15.i.preheader ]
%c.1.in30.i = phi i32 [ %call.i27.i, %while.body15.i ], [ %c.1.in30.i.ph, %while.body15.i.preheader ]
%conv9.i = and i32 %c.1.in30.i, 255
%mul.i = mul i32 %x.031.i, 10
%add.i = add i32 %mul.i, -48
%sub.i = add i32 %add.i, %conv9.i
%6 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i27.i = tail call i32 @getc(ptr noundef %6)
%sext25.i = shl i32 %call.i27.i, 24
%7 = add i32 %sext25.i, -788529153
%8 = icmp ult i32 %7, 184549375
br i1 %8, label %while.body15.i, label %nextpint.exit, !llvm.loop !13
nextpint.exit: ; preds = %while.body15.i
%9 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i.i43 = tail call i32 @getc(ptr noundef %9)
%sext28.i44 = shl i32 %call.i.i43, 24
%10 = add i32 %sext28.i44, -956301313
%11 = icmp ult i32 %10, -150994945
br i1 %11, label %while.body.i56, label %while.body15.i47.preheader
while.body.i56: ; preds = %nextpint.exit, %while.body.i56
%12 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i26.i57 = tail call i32 @getc(ptr noundef %12)
%sext.i58 = shl i32 %call.i26.i57, 24
%13 = add i32 %sext.i58, -956301313
%14 = icmp ult i32 %13, -150994945
br i1 %14, label %while.body.i56, label %while.body15.i47.preheader, !llvm.loop !11
while.body15.i47.preheader: ; preds = %while.body.i56, %nextpint.exit
%c.1.in30.i49.ph = phi i32 [ %call.i.i43, %nextpint.exit ], [ %call.i26.i57, %while.body.i56 ]
br label %while.body15.i47
while.body15.i47: ; preds = %while.body15.i47.preheader, %while.body15.i47
%x.031.i48 = phi i32 [ %sub.i53, %while.body15.i47 ], [ 0, %while.body15.i47.preheader ]
%c.1.in30.i49 = phi i32 [ %call.i27.i54, %while.body15.i47 ], [ %c.1.in30.i49.ph, %while.body15.i47.preheader ]
%conv9.i50 = and i32 %c.1.in30.i49, 255
%mul.i51 = mul i32 %x.031.i48, 10
%add.i52 = add i32 %mul.i51, -48
%sub.i53 = add i32 %add.i52, %conv9.i50
%15 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i27.i54 = tail call i32 @getc(ptr noundef %15)
%sext25.i55 = shl i32 %call.i27.i54, 24
%16 = add i32 %sext25.i55, -788529153
%17 = icmp ult i32 %16, 184549375
br i1 %17, label %while.body15.i47, label %nextpint.exit59, !llvm.loop !13
nextpint.exit59: ; preds = %while.body15.i47
%18 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i.i60 = tail call i32 @getc(ptr noundef %18)
%sext28.i61 = shl i32 %call.i.i60, 24
%19 = add i32 %sext28.i61, -956301313
%20 = icmp ult i32 %19, -150994945
br i1 %20, label %while.body.i73, label %while.body15.i64.preheader
while.body.i73: ; preds = %nextpint.exit59, %while.body.i73
%21 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i26.i74 = tail call i32 @getc(ptr noundef %21)
%sext.i75 = shl i32 %call.i26.i74, 24
%22 = add i32 %sext.i75, -956301313
%23 = icmp ult i32 %22, -150994945
br i1 %23, label %while.body.i73, label %while.body15.i64.preheader, !llvm.loop !11
while.body15.i64.preheader: ; preds = %while.body.i73, %nextpint.exit59
%c.1.in30.i66.ph = phi i32 [ %call.i.i60, %nextpint.exit59 ], [ %call.i26.i74, %while.body.i73 ]
br label %while.body15.i64
while.body15.i64: ; preds = %while.body15.i64.preheader, %while.body15.i64
%x.031.i65 = phi i32 [ %sub.i70, %while.body15.i64 ], [ 0, %while.body15.i64.preheader ]
%c.1.in30.i66 = phi i32 [ %call.i27.i71, %while.body15.i64 ], [ %c.1.in30.i66.ph, %while.body15.i64.preheader ]
%conv9.i67 = and i32 %c.1.in30.i66, 255
%mul.i68 = mul i32 %x.031.i65, 10
%add.i69 = add i32 %mul.i68, -48
%sub.i70 = add i32 %add.i69, %conv9.i67
%24 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i27.i71 = tail call i32 @getc(ptr noundef %24)
%sext25.i72 = shl i32 %call.i27.i71, 24
%25 = add i32 %sext25.i72, -788529153
%26 = icmp ult i32 %25, 184549375
br i1 %26, label %while.body15.i64, label %nextpint.exit76, !llvm.loop !13
nextpint.exit76: ; preds = %while.body15.i64
%cmp = icmp eq i32 %sub.i70, 1000000000
%cmp382 = icmp sgt i32 %sub.i53, 0
br i1 %cmp, label %for.cond.preheader, label %for.cond16.preheader
for.cond16.preheader: ; preds = %nextpint.exit76
br i1 %cmp382, label %for.body19, label %for.cond25.preheader
for.cond.preheader: ; preds = %nextpint.exit76
br i1 %cmp382, label %for.body, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body, %for.cond.preheader
%cmp784 = icmp slt i32 %sub.i53, %sub.i
br i1 %cmp784, label %for.body9, label %if.end
for.body: ; preds = %for.cond.preheader, %for.body
%i.083 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1000000000)
%inc = add nuw nsw i32 %i.083, 1
%exitcond86.not = icmp eq i32 %inc, %sub.i53
br i1 %exitcond86.not, label %for.cond6.preheader, label %for.body, !llvm.loop !19
for.body9: ; preds = %for.cond6.preheader, %for.body9
%i5.085 = phi i32 [ %inc12, %for.body9 ], [ %sub.i53, %for.cond6.preheader ]
%call10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1)
%inc12 = add nsw i32 %i5.085, 1
%cmp7 = icmp slt i32 %inc12, %sub.i
br i1 %cmp7, label %for.body9, label %if.end, !llvm.loop !20
for.cond25.preheader: ; preds = %for.body19, %for.cond16.preheader
%cmp2680 = icmp slt i32 %sub.i53, %sub.i
br i1 %cmp2680, label %for.body28, label %if.end
for.body19: ; preds = %for.cond16.preheader, %for.body19
%i15.079 = phi i32 [ %inc22, %for.body19 ], [ 0, %for.cond16.preheader ]
%call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub.i70)
%inc22 = add nuw nsw i32 %i15.079, 1
%exitcond.not = icmp eq i32 %inc22, %sub.i53
br i1 %exitcond.not, label %for.cond25.preheader, label %for.body19, !llvm.loop !21
for.body28: ; preds = %for.cond25.preheader, %for.body28
%i24.081 = phi i32 [ %inc31, %for.body28 ], [ %sub.i53, %for.cond25.preheader ]
%call29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1000000000)
%inc31 = add nsw i32 %i24.081, 1
%cmp26 = icmp slt i32 %inc31, %sub.i
br i1 %cmp26, label %for.body28, label %if.end, !llvm.loop !22
if.end: ; preds = %for.body28, %for.body9, %for.cond25.preheader, %for.cond6.preheader
%27 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i77 = tail call i32 @putc(i32 noundef 10, ptr noundef %27)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
|
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int T1,T2,x,y,z,t1,t2,t3;
scanf("%d",&x);
scanf("%d",&y);
scanf("%d",&z);
scanf("%d",&t1);
scanf("%d",&t2);
scanf("%d",&t3);
T1=(abs(z-x)*t2)+(abs(x-y)*t2)+(3*t3);
T2=abs(x-y)*t1;
if (T1<=T2)
printf("YES");
else
printf("NO");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18724/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18724/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
%t1 = alloca i32, align 4
%t2 = alloca i32, align 4
%t3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t3) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %z)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t1)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t2)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t3)
%0 = load i32, ptr %z, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%3 = load i32, ptr %t2, align 4, !tbaa !5
%4 = load i32, ptr %y, align 4, !tbaa !5
%sub6 = sub nsw i32 %1, %4
%5 = call i32 @llvm.abs.i32(i32 %sub6, i1 true)
%mul14 = add nuw i32 %5, %2
%add = mul i32 %mul14, %3
%6 = load i32, ptr %t3, align 4, !tbaa !5
%mul8 = mul nsw i32 %6, 3
%add9 = add nsw i32 %add, %mul8
%7 = load i32, ptr %t1, align 4, !tbaa !5
%mul11 = mul nsw i32 %5, %7
%cmp.not = icmp sgt i32 %add9, %mul11
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define PI 3.14159265358979323846264
int main(void) {
double i;
scanf("%lf", &i);
printf("%f %f\n", PI * i * i, PI * (i * 2));
// your code goes here
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187283/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187283/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !5
%mul = fmul double %0, 0x400921FB54442D18
%mul1 = fmul double %0, %mul
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442D18
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define M_PI 3.141592653589
int main(){
double r;
scanf("%lf", &r);
printf("%f %f\n", r * r * M_PI, 2 * r * M_PI);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187326/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187326/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB5444261E
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB5444261E
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main()
{
double r;
scanf("%lf",&r);
printf("%lf %lf\n",r*r*M_PI,2*r*M_PI);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187377/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187377/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB54442D18
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442D18
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main() {
double r;
scanf("%lf", &r);
printf("%.15f %.15f", r * r * M_PI, 2 * M_PI * r);
puts("");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187427/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187427/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"%.15f %.15f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB54442D18
%mul2 = fmul double %0, 0x401921FB54442D18
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define PI 3.141592653589
int main(){
double a;
scanf("%lf",&a);
printf("%f %f\n",a*a*PI,2*PI*a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187470/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187470/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load double, ptr %a, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB5444261E
%mul2 = fmul double %0, 0x401921FB5444261E
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
double r,pi,s,l;
pi=3.14159265359;
scanf("%lf",&r);
//printf("%f\n",r);
s=pi*(double)r*(double)r;
l=2*pi*(double)r;
printf("%f %f\n",s,l);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187520/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187520/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, 0x400921FB54442EEA
%mul1 = fmul double %0, %mul
%mul3 = fmul double %0, 0x401921FB54442EEA
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
#define Pi 3.141592653589
int main(void)
{
double r;
scanf("%lf", &r);
printf("%f %f\n", Pi*pow(r, 2.0), Pi*(2.0*r));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187579/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187579/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%square = fmul double %0, %0
%mul = fmul double %square, 0x400921FB5444261E
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB5444261E
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
double r;
double area, circum;
scanf("%lf", &r);
area = r * r * 3.141592653589;
circum = 2 * r * 3.141592653589;
printf("%f %f\n", area, circum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187629/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187629/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB5444261E
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB5444261E
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
double r;
scanf("%lf", &r);
printf("%f %f\n", r*r*3.14159265359, 2*r*3.14159265359);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187672/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187672/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB54442EEA
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442EEA
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
long long smallnumber(long long a, long long b){
if(a<b){
return(a);
} else {
return(b);
}
}
int main(void){
long long q,h,s,d,n;
scanf("%lld%lld%lld%lld%lld",&q,&h,&s,&d,&n);
long long ans;
if (q*4<s){
s=q*4;
}
if (h*2<s){
s=h*2;
}
ans=smallnumber(n*s,(n/2)*d+(n%2)*s);
printf("%lld\n",ans);
return 0 ;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187715/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187715/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [21 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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smallnumber(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%q = alloca i64, align 8
%h = alloca i64, align 8
%s = alloca i64, align 8
%d = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q, ptr noundef nonnull %h, ptr noundef nonnull %s, ptr noundef nonnull %d, ptr noundef nonnull %n)
%0 = load i64, ptr %q, align 8, !tbaa !5
%mul = shl nsw i64 %0, 2
%1 = load i64, ptr %s, align 8, !tbaa !5
%cmp = icmp slt i64 %mul, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i64 %mul, ptr %s, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i64 [ %mul, %if.then ], [ %1, %entry ]
%3 = load i64, ptr %h, align 8, !tbaa !5
%mul2 = shl nsw i64 %3, 1
%cmp3 = icmp slt i64 %mul2, %2
br i1 %cmp3, label %if.then4, label %if.end6
if.then4: ; preds = %if.end
store i64 %mul2, ptr %s, align 8, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then4, %if.end
%4 = phi i64 [ %mul2, %if.then4 ], [ %2, %if.end ]
%5 = load i64, ptr %n, align 8, !tbaa !5
%mul7 = mul nsw i64 %4, %5
%div = sdiv i64 %5, 2
%6 = load i64, ptr %d, align 8, !tbaa !5
%mul8 = mul nsw i64 %6, %div
%rem = srem i64 %5, 2
%mul9 = mul nsw i64 %rem, %4
%add = add nsw i64 %mul8, %mul9
%a.b.i = call i64 @llvm.smin.i64(i64 %mul7, i64 %add)
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %a.b.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
#define MOD 1000000007
#define END printf("\n");return 0;
#define QS09(how_data,data) qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_09);
#define QS90(how_data,data) qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_90);
#define I(a) long a;scanf("%ld",&a);
void input_array(long how_data,long *data);
void output_array(long how_data,long *data);
void input_array2(long first , long second , long data[][2]);
void format_array(long how_data ,long *data,long what);
long get_random(long min, long max);
long factorial(long n);
long fibonacci(long n);
int qsort_09(const int *sys1 , const int *sys2);
int qsort_90(const int *sys1 , const int *sys2);
long sel_max(long a , long b);
long sel_min(long a , long b);
long array_max(long how_data,long *data);
long array_min(long how_data,long *data);
long can_DP(long how_data,long *data,long how_can,bool *can);
long array_sum(long how_data,long *data);
long Leven_dist(char *now , char *target);
void prime_fact(long target, long *data);
long get_digit(long target);
long ncr(long n , long r);
long npr(long n , long r);
long nhr(long n , long r);
long loop1,loop2,loop3,loop4,loop5,i_temp;
char c_temp;
typedef struct{
long from;
long to;
long omomi;
} wdg; //WeightedDirectedGraph
long BellmanFord(long how_tyouten,long how_hen,long start_ten,long goal_ten,wdg hen_data[]);
int main(void){
I(q);I(h);I(s);I(d);
I(n);
q*=4;
h*=2;
unsigned long ans=0;
long single_cheep=sel_min(sel_min(q,h),s);
if(d<single_cheep*2){
ans+=d*(n/2);
ans+=(n%2==1?single_cheep:0);
}else{
ans+=single_cheep*n;
}
printf("%ld\n",ans);
END;
}
void input_array(long how_data,long *data){
long loop;
for(loop=0;loop<how_data;loop++){
scanf("%ld",&data[loop]);
}
return ;
}
void output_array(long how_data,long *data){
long loop;
for(loop=0;loop<how_data-1;loop++){
printf("%ld ",data[loop]);
}
return ;
}
void input_array2(long first,long second,long data[][2]){
long loopA,loopB;
for(loopA=0;loopA<first;loopA++){
for(loopB=0;loopB<second;loopB++){
scanf("%ld",&data[loopA][loopB]);
}
}
return ;
}
void format_array(long how_data ,long *data,long what){
long loopA;
for(loopA=0;loopA<how_data;loopA++){
data[loopA]=what;
}
return ;
}
long get_random(long min, long max){ //指定の範囲から乱数を1つ返すやつ
//srand((unsigned int)time(0)); //現在時刻で疑似乱数初期化
rand();rand();rand();rand(); //乱数を空打ち
return (rand()%(max+1-min))+min;
}
long factorial(long n){//n!のMOD10^9+7を返すやつ
unsigned long long int ret=1;
for(long i=1;i<=n;i++)ret=(ret*i)%1000000007;
return (long)ret;
}
int qsort_09(const int *sys1 , const int *sys2){ //小さいのが上にくるやつ
//qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_09);
if(*sys1<*sys2){
return -1;
}else if(*sys1==*sys2){
return 0;
}else{
return 1;
}
}
int qsort_90(const int *sys1 , const int *sys2){ //大きいのが上にくるやつ
//qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_90);
if(*sys1<*sys2){
return 1;
}else if(*sys1==*sys2){
return 0;
}else{
return -1;
}
}
long fibonacci(long n){
switch(n){
case 0:return 0;
case 1:return 1;
default :return fibonacci(n-1)+fibonacci(n-2);
}
}
long sel_max(long a,long b){
if(a>b)return a;
return b;
}
long sel_min(long a,long b){
if(a>b)return b;
return a;
}
long can_DP(long how_data,long *data,long how_can,bool *can){//Typical DP Contest A
//data内で組み合わせられる和をcanに0 or 1で入れる
//返り値はパターン数
long loopA,loopB;
long ret=0;
for(loopA=0;loopA<how_can;loopA++){//初期化
can[loopA]=0;
}
can[0]=1;//絶対にありえる
for(loopA=0;loopA<how_data;loopA++){
for(loopB=how_can-1;loopB>=0;loopB--){
if(can[loopB]==1 && loopB+data[loopA]<how_can){
can[loopB+data[loopA]]=1;
}
}
}
for(loopA=0;loopA<how_can;loopA++){
if(can[loopA]==1){
ret++;
}
}
return ret;
}
long array_max(long how_data,long *data){
long loop;
long ret=data[0];
for(loop=0;loop<how_data;loop++){
if(ret<data[loop])ret=data[loop];
}
return ret;
}
long array_min(long how_data,long *data){
long loop;
long ret=data[0];
for(loop=0;loop<how_data;loop++){
if(ret>data[loop])ret=data[loop];
}
return ret;
}
long array_sum(long how_data,long *data){
long ret=0;
long loop;
for(loop=0;loop<how_data;loop++){
ret+=data[loop];
}
return ret;
}
long Leven_dist(char *now , char *target){
long loopA,loopB;
//レーベンシュタイン距離を求める
// 参考文献
// http://nw.tsuda.ac.jp/class/algoB/c13.html (アルゴリズム理解)
// http://d.hatena.ne.jp/ohnishiakira/20090809/1249845529 (実装)
long len_now=strlen(now)+1;
long len_target=strlen(target)+1;
long d[len_now][len_target]; //計算用
for(loopA=0;loopA<len_now;loopA++) d[loopA][0]=loopA;
for(loopA=0;loopA<len_target;loopA++) d[0][loopA]=loopA;
for(loopA=1;loopA<len_now;loopA++){
for(loopB=1;loopB<len_target;loopB++){
long cost=(now[loopA-1]==target[loopB-1] ? 0:1);
d[loopA][loopB]=sel_min(sel_min(d[loopA-1][loopB]+1,d[loopA][loopB-1]+1),d[loopA-1][loopB-1]+cost);
}
}
return d[len_now-1][len_target-1];
}
void prime_fact(long target, long *data){
long loopB=0;
long loopA=2;
long moto_target=target;
while(target!=1){
loopA-=1;
while(1){
loopA++;
if(loopA>=sqrt(moto_target)+100){
data[loopB]=target;
target=1;
break;
}
if(target%loopA==0){
data[loopB]=loopA;
target/=loopA;
loopB++;
break;
}
}
}
return ;
}
long get_digit(long target){
return (long)(log10(target)+1);
}
long ncr(long n , long r){
//パスカルの三角形
long loopA,loopB;
long pascal[100][102]={{0}};
pascal[1][0]=1;
pascal[1][1]=1;
for(loopA=2;loopA<100;loopA++){
pascal[loopA][0]=1;
for(loopB=1;loopB<loopA;loopB++){
pascal[loopA][loopB]=pascal[loopA-1][loopB-1]+pascal[loopA-1][loopB];
}
pascal[loopA][loopA]=1;
}
return pascal[n][r];
}
long npr(long n, long r){
return ncr(n,r)*factorial(r);
}
long nhr(long n , long r){
return ncr(n+r-1,r);
}
long BellmanFord(long how_tyouten,long how_hen,long start_ten,long goal_ten,wdg hen_data[]){
long dist[100000];
format_array(100000,dist,10000000000);
dist[start_ten]=0;
for(int loopA=0;loopA<how_tyouten;loopA++){
for(int loopB=0;loopB<how_hen;loopB++){
if(dist[hen_data[loopB].from]+hen_data[loopB].omomi<dist[hen_data[loopB].to]){
dist[hen_data[loopB].to]=dist[hen_data[loopB].from]+hen_data[loopB].omomi;
}
}
}
return dist[goal_ten];
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187759/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187759/source.c"
target datalayout = "e-m:e-p270: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.wdg = type { i64, i64, i64 }
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%ld \00", align 1
@loop1 = dso_local local_unnamed_addr global i64 0, align 8
@loop2 = dso_local local_unnamed_addr global i64 0, align 8
@loop3 = dso_local local_unnamed_addr global i64 0, align 8
@loop4 = dso_local local_unnamed_addr global i64 0, align 8
@loop5 = dso_local local_unnamed_addr global i64 0, align 8
@i_temp = dso_local local_unnamed_addr global i64 0, align 8
@c_temp = dso_local local_unnamed_addr global i8 0, align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%q = alloca i64, align 8
%h = alloca i64, align 8
%s = alloca i64, align 8
%d = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #21
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #21
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s) #21
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #21
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #21
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %q, align 8, !tbaa !5
%mul = shl nsw i64 %0, 2
store i64 %mul, ptr %q, align 8, !tbaa !5
%1 = load i64, ptr %h, align 8, !tbaa !5
%mul5 = shl nsw i64 %1, 1
store i64 %mul5, ptr %h, align 8, !tbaa !5
%b.a.i = call i64 @llvm.smin.i64(i64 %mul, i64 %mul5)
%2 = load i64, ptr %s, align 8, !tbaa !5
%b.a.i21 = call i64 @llvm.smin.i64(i64 %b.a.i, i64 %2)
%3 = load i64, ptr %d, align 8, !tbaa !5
%mul8 = shl nsw i64 %b.a.i21, 1
%cmp = icmp slt i64 %3, %mul8
%4 = load i64, ptr %n, align 8, !tbaa !5
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i64 %4, 2
%mul9 = mul nsw i64 %div, %3
%5 = and i64 %4, -9223372036854775807
%cmp10 = icmp eq i64 %5, 1
%cond = select i1 %cmp10, i64 %b.a.i21, i64 0
%add11 = add i64 %cond, %mul9
br label %if.end
if.else: ; preds = %entry
%mul12 = mul nsw i64 %4, %b.a.i21
br label %if.end
if.end: ; preds = %if.else, %if.then
%ans.0 = phi i64 [ %add11, %if.then ], [ %mul12, %if.else ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #21
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #21
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s) #21
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #21
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #21
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 i64 @sel_min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%b.a = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %b.a
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @input_array(i64 noundef %how_data, ptr noundef %data) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i64 %how_data, 0
br i1 %cmp3, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%loop.04 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.04
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%inc = add nuw nsw i64 %loop.04, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @output_array(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i64 %how_data, 1
br i1 %cmp3, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = add i64 %how_data, -2
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%loop.04 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.04
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %1)
%inc = add nuw nsw i64 %loop.04, 1
%exitcond.not = icmp eq i64 %loop.04, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @input_array2(i64 noundef %first, i64 noundef %second, ptr noundef %data) local_unnamed_addr #0 {
entry:
%cmp14 = icmp sgt i64 %first, 0
%cmp212 = icmp sgt i64 %second, 0
%or.cond = and i1 %cmp14, %cmp212
br i1 %or.cond, label %for.cond1.preheader.us, label %for.end7
for.cond1.preheader.us: ; preds = %entry, %for.cond1.for.inc5_crit_edge.us
%loopA.015.us = phi i64 [ %inc6.us, %for.cond1.for.inc5_crit_edge.us ], [ 0, %entry ]
br label %for.body3.us
for.body3.us: ; preds = %for.cond1.preheader.us, %for.body3.us
%loopB.013.us = phi i64 [ 0, %for.cond1.preheader.us ], [ %inc.us, %for.body3.us ]
%arrayidx4.us = getelementptr inbounds [2 x i64], ptr %data, i64 %loopA.015.us, i64 %loopB.013.us
%call.us = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx4.us)
%inc.us = add nuw nsw i64 %loopB.013.us, 1
%exitcond.not = icmp eq i64 %inc.us, %second
br i1 %exitcond.not, label %for.cond1.for.inc5_crit_edge.us, label %for.body3.us, !llvm.loop !12
for.cond1.for.inc5_crit_edge.us: ; preds = %for.body3.us
%inc6.us = add nuw nsw i64 %loopA.015.us, 1
%exitcond17.not = icmp eq i64 %inc6.us, %first
br i1 %exitcond17.not, label %for.end7, label %for.cond1.preheader.us, !llvm.loop !13
for.end7: ; preds = %for.cond1.for.inc5_crit_edge.us, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable
define dso_local void @format_array(i64 noundef %how_data, ptr nocapture noundef writeonly %data, i64 noundef %what) local_unnamed_addr #4 {
entry:
%cmp3 = icmp sgt i64 %how_data, 0
br i1 %cmp3, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader5, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %what, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds i64, ptr %data, i64 %index
store <2 x i64> %broadcast.splat, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
store <2 x i64> %broadcast.splat, ptr %1, align 8, !tbaa !5
%index.next = add nuw i64 %index, 4
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader5
for.body.preheader5: ; preds = %for.body.preheader, %middle.block
%loopA.04.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader5, %for.body
%loopA.04 = phi i64 [ %inc, %for.body ], [ %loopA.04.ph, %for.body.preheader5 ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loopA.04
store i64 %what, ptr %arrayidx, align 8, !tbaa !5
%inc = add nuw nsw i64 %loopA.04, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !17
for.end: ; preds = %for.body, %middle.block, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i64 @get_random(i64 noundef %min, i64 noundef %max) local_unnamed_addr #5 {
entry:
%call = tail call i32 @rand() #21
%call1 = tail call i32 @rand() #21
%call2 = tail call i32 @rand() #21
%call3 = tail call i32 @rand() #21
%call4 = tail call i32 @rand() #21
%conv = sext i32 %call4 to i64
%reass.sub = sub i64 %max, %min
%sub = add i64 %reass.sub, 1
%rem = srem i64 %conv, %sub
%add5 = add nsw i64 %rem, %min
ret i64 %add5
}
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #6
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @factorial(i64 noundef %n) local_unnamed_addr #7 {
entry:
%cmp.not4 = icmp slt i64 %n, 1
br i1 %cmp.not4, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %n, 3
%0 = icmp ult i64 %n, 4
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %n, -4
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%i.06.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.3, %for.body ]
%ret.05.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%i.06.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.06.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%ret.05.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %ret.05.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul i64 %i.06.epil, %ret.05.epil
%rem.epil = urem i64 %mul.epil, 1000000007
%inc.epil = add nuw i64 %i.06.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.cleanup, label %for.body.epil, !llvm.loop !18
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%ret.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
ret i64 %ret.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%i.06 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.3, %for.body ]
%ret.05 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul i64 %i.06, %ret.05
%rem = urem i64 %mul, 1000000007
%inc = add nuw nsw i64 %i.06, 1
%mul.1 = mul i64 %inc, %rem
%rem.1 = urem i64 %mul.1, 1000000007
%inc.1 = add nuw nsw i64 %i.06, 2
%mul.2 = mul i64 %inc.1, %rem.1
%rem.2 = urem i64 %mul.2, 1000000007
%inc.2 = add nuw i64 %i.06, 3
%mul.3 = mul i64 %inc.2, %rem.2
%rem.3 = urem i64 %mul.3, 1000000007
%inc.3 = add nuw i64 %i.06, 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.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !20
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @qsort_09(ptr nocapture noundef readonly %sys1, ptr nocapture noundef readonly %sys2) local_unnamed_addr #8 {
entry:
%0 = load i32, ptr %sys1, align 4, !tbaa !21
%1 = load i32, ptr %sys2, align 4, !tbaa !21
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %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 @qsort_90(ptr nocapture noundef readonly %sys1, ptr nocapture noundef readonly %sys2) local_unnamed_addr #8 {
entry:
%0 = load i32, ptr %sys1, align 4, !tbaa !21
%1 = load i32, ptr %sys2, align 4, !tbaa !21
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @fibonacci(i64 noundef %n) local_unnamed_addr #9 {
entry:
%switch13 = icmp ult i64 %n, 2
br i1 %switch13, label %return, label %sw.default
sw.default: ; preds = %entry, %sw.default
%n.tr15 = phi i64 [ %sub2, %sw.default ], [ %n, %entry ]
%accumulator.tr14 = phi i64 [ %add, %sw.default ], [ 0, %entry ]
%sub = add nsw i64 %n.tr15, -1
%call = tail call i64 @fibonacci(i64 noundef %sub)
%sub2 = add nsw i64 %n.tr15, -2
%add = add nsw i64 %call, %accumulator.tr14
%switch = icmp ult i64 %sub2, 2
br i1 %switch, label %return, label %sw.default
return: ; preds = %sw.default, %entry
%accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %sw.default ]
%n.tr.lcssa = phi i64 [ %n, %entry ], [ %sub2, %sw.default ]
%accumulator.ret.tr = add nsw i64 %n.tr.lcssa, %accumulator.tr.lcssa
ret i64 %accumulator.ret.tr
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sel_max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i64 @can_DP(i64 noundef %how_data, ptr nocapture noundef readonly %data, i64 noundef %how_can, ptr nocapture noundef %can) local_unnamed_addr #10 {
entry:
%cmp59 = icmp sgt i64 %how_can, 0
br i1 %cmp59, label %for.end, label %for.end.thread
for.end: ; preds = %entry
tail call void @llvm.memset.p0.i64(ptr align 1 %can, i8 0, i64 %how_can, i1 false), !tbaa !23
store i8 1, ptr %can, align 1, !tbaa !23
%cmp364 = icmp sgt i64 %how_data, 0
br i1 %cmp364, label %for.cond5.preheader.us.preheader, label %for.cond22.preheader
for.cond5.preheader.us.preheader: ; preds = %for.end
%xtraiter = and i64 %how_can, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%loopB.063.us.prol = add nsw i64 %how_can, -1
%arrayidx8.us.prol = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us.prol
%0 = icmp eq i64 %how_can, 1
br label %for.cond5.preheader.us
for.end.thread: ; preds = %entry
store i8 1, ptr %can, align 1, !tbaa !23
br label %for.end36
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc19_crit_edge.us
%loopA.165.us = phi i64 [ %inc20.us, %for.cond5.for.inc19_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ]
%arrayidx11.us = getelementptr inbounds i64, ptr %data, i64 %loopA.165.us
br i1 %lcmp.mod.not, label %for.body7.us.prol.loopexit, label %for.body7.us.prol
for.body7.us.prol: ; preds = %for.cond5.preheader.us
%1 = load i8, ptr %arrayidx8.us.prol, align 1, !tbaa !23, !range !25, !noundef !26
%tobool.not.us.prol = icmp eq i8 %1, 0
br i1 %tobool.not.us.prol, label %for.body7.us.prol.loopexit, label %land.lhs.true.us.prol
land.lhs.true.us.prol: ; preds = %for.body7.us.prol
%2 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5
%add.us.prol = add nsw i64 %2, %loopB.063.us.prol
%cmp12.us.prol = icmp slt i64 %add.us.prol, %how_can
br i1 %cmp12.us.prol, label %if.then.us.prol, label %for.body7.us.prol.loopexit
if.then.us.prol: ; preds = %land.lhs.true.us.prol
%arrayidx16.us.prol = getelementptr inbounds i8, ptr %can, i64 %add.us.prol
store i8 1, ptr %arrayidx16.us.prol, align 1, !tbaa !23
br label %for.body7.us.prol.loopexit
for.body7.us.prol.loopexit: ; preds = %for.body7.us.prol, %land.lhs.true.us.prol, %if.then.us.prol, %for.cond5.preheader.us
%loopB.063.us.in.unr = phi i64 [ %how_can, %for.cond5.preheader.us ], [ %loopB.063.us.prol, %if.then.us.prol ], [ %loopB.063.us.prol, %land.lhs.true.us.prol ], [ %loopB.063.us.prol, %for.body7.us.prol ]
br i1 %0, label %for.cond5.for.inc19_crit_edge.us, label %for.body7.us
for.body7.us: ; preds = %for.body7.us.prol.loopexit, %for.inc17.us.1
%loopB.063.us.in = phi i64 [ %loopB.063.us.1, %for.inc17.us.1 ], [ %loopB.063.us.in.unr, %for.body7.us.prol.loopexit ]
%loopB.063.us = add nsw i64 %loopB.063.us.in, -1
%arrayidx8.us = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us
%3 = load i8, ptr %arrayidx8.us, align 1, !tbaa !23, !range !25, !noundef !26
%tobool.not.us = icmp eq i8 %3, 0
br i1 %tobool.not.us, label %for.inc17.us, label %land.lhs.true.us
land.lhs.true.us: ; preds = %for.body7.us
%4 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5
%add.us = add nsw i64 %4, %loopB.063.us
%cmp12.us = icmp slt i64 %add.us, %how_can
br i1 %cmp12.us, label %if.then.us, label %for.inc17.us
if.then.us: ; preds = %land.lhs.true.us
%arrayidx16.us = getelementptr inbounds i8, ptr %can, i64 %add.us
store i8 1, ptr %arrayidx16.us, align 1, !tbaa !23
br label %for.inc17.us
for.inc17.us: ; preds = %if.then.us, %land.lhs.true.us, %for.body7.us
%loopB.063.us.1 = add nsw i64 %loopB.063.us.in, -2
%arrayidx8.us.1 = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us.1
%5 = load i8, ptr %arrayidx8.us.1, align 1, !tbaa !23, !range !25, !noundef !26
%tobool.not.us.1 = icmp eq i8 %5, 0
br i1 %tobool.not.us.1, label %for.inc17.us.1, label %land.lhs.true.us.1
land.lhs.true.us.1: ; preds = %for.inc17.us
%6 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5
%add.us.1 = add nsw i64 %6, %loopB.063.us.1
%cmp12.us.1 = icmp slt i64 %add.us.1, %how_can
br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc17.us.1
if.then.us.1: ; preds = %land.lhs.true.us.1
%arrayidx16.us.1 = getelementptr inbounds i8, ptr %can, i64 %add.us.1
store i8 1, ptr %arrayidx16.us.1, align 1, !tbaa !23
br label %for.inc17.us.1
for.inc17.us.1: ; preds = %if.then.us.1, %land.lhs.true.us.1, %for.inc17.us
%cmp6.us.1 = icmp sgt i64 %loopB.063.us.in, 2
br i1 %cmp6.us.1, label %for.body7.us, label %for.cond5.for.inc19_crit_edge.us, !llvm.loop !27
for.cond5.for.inc19_crit_edge.us: ; preds = %for.inc17.us.1, %for.body7.us.prol.loopexit
%inc20.us = add nuw nsw i64 %loopA.165.us, 1
%exitcond.not = icmp eq i64 %inc20.us, %how_data
br i1 %exitcond.not, label %for.cond22.preheader, label %for.cond5.preheader.us, !llvm.loop !28
for.cond22.preheader: ; preds = %for.cond5.for.inc19_crit_edge.us, %for.end
br i1 %cmp59, label %for.body25.preheader, label %for.end36
for.body25.preheader: ; preds = %for.cond22.preheader
%xtraiter72 = and i64 %how_can, 7
%7 = icmp ult i64 %how_can, 8
br i1 %7, label %for.end36.loopexit.unr-lcssa, label %for.body25.preheader.new
for.body25.preheader.new: ; preds = %for.body25.preheader
%unroll_iter = and i64 %how_can, -8
br label %for.body25
for.body25: ; preds = %for.body25, %for.body25.preheader.new
%ret.068 = phi i64 [ 0, %for.body25.preheader.new ], [ %spec.select.7, %for.body25 ]
%loopA.267 = phi i64 [ 0, %for.body25.preheader.new ], [ %inc35.7, %for.body25 ]
%niter = phi i64 [ 0, %for.body25.preheader.new ], [ %niter.next.7, %for.body25 ]
%arrayidx26 = getelementptr inbounds i8, ptr %can, i64 %loopA.267
%8 = load i8, ptr %arrayidx26, align 1, !tbaa !23, !range !25, !noundef !26
%inc32 = zext i8 %8 to i64
%spec.select = add nuw nsw i64 %ret.068, %inc32
%inc35 = or i64 %loopA.267, 1
%arrayidx26.1 = getelementptr inbounds i8, ptr %can, i64 %inc35
%9 = load i8, ptr %arrayidx26.1, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.1 = zext i8 %9 to i64
%spec.select.1 = add nuw nsw i64 %spec.select, %inc32.1
%inc35.1 = or i64 %loopA.267, 2
%arrayidx26.2 = getelementptr inbounds i8, ptr %can, i64 %inc35.1
%10 = load i8, ptr %arrayidx26.2, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.2 = zext i8 %10 to i64
%spec.select.2 = add nuw nsw i64 %spec.select.1, %inc32.2
%inc35.2 = or i64 %loopA.267, 3
%arrayidx26.3 = getelementptr inbounds i8, ptr %can, i64 %inc35.2
%11 = load i8, ptr %arrayidx26.3, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.3 = zext i8 %11 to i64
%spec.select.3 = add nuw nsw i64 %spec.select.2, %inc32.3
%inc35.3 = or i64 %loopA.267, 4
%arrayidx26.4 = getelementptr inbounds i8, ptr %can, i64 %inc35.3
%12 = load i8, ptr %arrayidx26.4, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.4 = zext i8 %12 to i64
%spec.select.4 = add nuw nsw i64 %spec.select.3, %inc32.4
%inc35.4 = or i64 %loopA.267, 5
%arrayidx26.5 = getelementptr inbounds i8, ptr %can, i64 %inc35.4
%13 = load i8, ptr %arrayidx26.5, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.5 = zext i8 %13 to i64
%spec.select.5 = add nuw nsw i64 %spec.select.4, %inc32.5
%inc35.5 = or i64 %loopA.267, 6
%arrayidx26.6 = getelementptr inbounds i8, ptr %can, i64 %inc35.5
%14 = load i8, ptr %arrayidx26.6, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.6 = zext i8 %14 to i64
%spec.select.6 = add nuw nsw i64 %spec.select.5, %inc32.6
%inc35.6 = or i64 %loopA.267, 7
%arrayidx26.7 = getelementptr inbounds i8, ptr %can, i64 %inc35.6
%15 = load i8, ptr %arrayidx26.7, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.7 = zext i8 %15 to i64
%spec.select.7 = add nuw nsw i64 %spec.select.6, %inc32.7
%inc35.7 = add nuw nsw i64 %loopA.267, 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.end36.loopexit.unr-lcssa, label %for.body25, !llvm.loop !29
for.end36.loopexit.unr-lcssa: ; preds = %for.body25, %for.body25.preheader
%spec.select.lcssa.ph = phi i64 [ undef, %for.body25.preheader ], [ %spec.select.7, %for.body25 ]
%ret.068.unr = phi i64 [ 0, %for.body25.preheader ], [ %spec.select.7, %for.body25 ]
%loopA.267.unr = phi i64 [ 0, %for.body25.preheader ], [ %inc35.7, %for.body25 ]
%lcmp.mod73.not = icmp eq i64 %xtraiter72, 0
br i1 %lcmp.mod73.not, label %for.end36, label %for.body25.epil
for.body25.epil: ; preds = %for.end36.loopexit.unr-lcssa, %for.body25.epil
%ret.068.epil = phi i64 [ %spec.select.epil, %for.body25.epil ], [ %ret.068.unr, %for.end36.loopexit.unr-lcssa ]
%loopA.267.epil = phi i64 [ %inc35.epil, %for.body25.epil ], [ %loopA.267.unr, %for.end36.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body25.epil ], [ 0, %for.end36.loopexit.unr-lcssa ]
%arrayidx26.epil = getelementptr inbounds i8, ptr %can, i64 %loopA.267.epil
%16 = load i8, ptr %arrayidx26.epil, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.epil = zext i8 %16 to i64
%spec.select.epil = add nuw nsw i64 %ret.068.epil, %inc32.epil
%inc35.epil = add nuw nsw i64 %loopA.267.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter72
br i1 %epil.iter.cmp.not, label %for.end36, label %for.body25.epil, !llvm.loop !30
for.end36: ; preds = %for.end36.loopexit.unr-lcssa, %for.body25.epil, %for.end.thread, %for.cond22.preheader
%ret.0.lcssa = phi i64 [ 0, %for.cond22.preheader ], [ 0, %for.end.thread ], [ %spec.select.lcssa.ph, %for.end36.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body25.epil ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_max(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #11 {
entry:
%0 = load i64, ptr %data, align 8, !tbaa !5
%cmp10 = icmp sgt i64 %how_data, 0
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %0, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ]
%vec.phi13 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load14 = load <2 x i64>, ptr %2, align 8, !tbaa !5
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%4 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi13, <2 x i64> %wide.load14)
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !31
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %3, <2 x i64> %4)
%6 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%ret.012.ph = phi i64 [ %0, %for.body.preheader ], [ %6, %middle.block ]
%loop.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%ret.012 = phi i64 [ %spec.select, %for.body ], [ %ret.012.ph, %for.body.preheader15 ]
%loop.011 = phi i64 [ %inc, %for.body ], [ %loop.011.ph, %for.body.preheader15 ]
%arrayidx1 = getelementptr inbounds i64, ptr %data, i64 %loop.011
%7 = load i64, ptr %arrayidx1, align 8, !tbaa !5
%spec.select = tail call i64 @llvm.smax.i64(i64 %ret.012, i64 %7)
%inc = add nuw nsw i64 %loop.011, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !32
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_min(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #11 {
entry:
%0 = load i64, ptr %data, align 8, !tbaa !5
%cmp10 = icmp sgt i64 %how_data, 0
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %0, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ]
%vec.phi13 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load14 = load <2 x i64>, ptr %2, align 8, !tbaa !5
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%4 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi13, <2 x i64> %wide.load14)
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !33
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %3, <2 x i64> %4)
%6 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%ret.012.ph = phi i64 [ %0, %for.body.preheader ], [ %6, %middle.block ]
%loop.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%ret.012 = phi i64 [ %spec.select, %for.body ], [ %ret.012.ph, %for.body.preheader15 ]
%loop.011 = phi i64 [ %inc, %for.body ], [ %loop.011.ph, %for.body.preheader15 ]
%arrayidx1 = getelementptr inbounds i64, ptr %data, i64 %loop.011
%7 = load i64, ptr %arrayidx1, align 8, !tbaa !5
%spec.select = tail call i64 @llvm.smin.i64(i64 %ret.012, i64 %7)
%inc = add nuw nsw i64 %loop.011, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !34
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_sum(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #12 {
entry:
%cmp4 = icmp sgt i64 %how_data, 0
br i1 %cmp4, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ]
%vec.phi7 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = add <2 x i64> %wide.load, %vec.phi
%3 = add <2 x i64> %wide.load8, %vec.phi7
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !35
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %3, %2
%5 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%loop.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ret.05.ph = phi i64 [ 0, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%loop.06 = phi i64 [ %inc, %for.body ], [ %loop.06.ph, %for.body.preheader9 ]
%ret.05 = phi i64 [ %add, %for.body ], [ %ret.05.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.06
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%add = add nsw i64 %6, %ret.05
%inc = add nuw nsw i64 %loop.06, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !36
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ 0, %entry ], [ %5, %middle.block ], [ %add, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i64 @Leven_dist(ptr nocapture noundef readonly %now, ptr nocapture noundef readonly %target) local_unnamed_addr #13 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %now) #22
%add = add i64 %call, 1
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %target) #22
%add2 = add i64 %call1, 1
%0 = mul nuw i64 %add2, %add
%vla = alloca i64, i64 %0, align 16
%cmp81 = icmp ult i64 %call, 9223372036854775807
br i1 %cmp81, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %add, 3
%1 = icmp ult i64 %call, 3
br i1 %1, label %for.cond4.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %add, -4
br label %for.body
for.cond4.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%loopA.082.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond4.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond4.preheader.loopexit.unr-lcssa, %for.body.epil
%loopA.082.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %loopA.082.unr, %for.cond4.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond4.preheader.loopexit.unr-lcssa ]
%2 = mul nsw i64 %loopA.082.epil, %add2
%arrayidx.epil = getelementptr inbounds i64, ptr %vla, i64 %2
store i64 %loopA.082.epil, ptr %arrayidx.epil, align 8, !tbaa !5
%inc.epil = add nuw nsw i64 %loopA.082.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.cond4.preheader, label %for.body.epil, !llvm.loop !37
for.cond4.preheader: ; preds = %for.cond4.preheader.loopexit.unr-lcssa, %for.body.epil, %entry
%cmp583 = icmp ult i64 %call1, 9223372036854775807
br i1 %cmp583, label %for.body6.preheader, label %for.cond12.preheader
for.body6.preheader: ; preds = %for.cond4.preheader
%min.iters.check = icmp ult i64 %add2, 4
br i1 %min.iters.check, label %for.body6.preheader95, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %add2, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%3 = getelementptr inbounds i64, ptr %vla, i64 %index
store <2 x i64> %vec.ind, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds i64, ptr %3, i64 2
store <2 x i64> %step.add, ptr %4, align 16, !tbaa !5
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !38
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %add2, %n.vec
br i1 %cmp.n, label %for.cond12.preheader, label %for.body6.preheader95
for.body6.preheader95: ; preds = %for.body6.preheader, %middle.block
%loopA.184.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ]
br label %for.body6
for.body: ; preds = %for.body, %for.body.preheader.new
%loopA.082 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%6 = mul nsw i64 %loopA.082, %add2
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %6
store i64 %loopA.082, ptr %arrayidx, align 16, !tbaa !5
%inc = or i64 %loopA.082, 1
%7 = mul nsw i64 %inc, %add2
%arrayidx.1 = getelementptr inbounds i64, ptr %vla, i64 %7
store i64 %inc, ptr %arrayidx.1, align 8, !tbaa !5
%inc.1 = or i64 %loopA.082, 2
%8 = mul nsw i64 %inc.1, %add2
%arrayidx.2 = getelementptr inbounds i64, ptr %vla, i64 %8
store i64 %inc.1, ptr %arrayidx.2, align 16, !tbaa !5
%inc.2 = or i64 %loopA.082, 3
%9 = mul nsw i64 %inc.2, %add2
%arrayidx.3 = getelementptr inbounds i64, ptr %vla, i64 %9
store i64 %inc.2, ptr %arrayidx.3, align 8, !tbaa !5
%inc.3 = add nuw nsw i64 %loopA.082, 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.cond4.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !39
for.cond12.preheader: ; preds = %for.body6, %middle.block, %for.cond4.preheader
%cmp1387 = icmp sgt i64 %add, 1
%cmp1685 = icmp sgt i64 %add2, 1
%or.cond = select i1 %cmp1387, i1 %cmp1685, i1 false
br i1 %or.cond, label %for.cond15.preheader.us, label %for.end47
for.cond15.preheader.us: ; preds = %for.cond12.preheader, %for.cond15.for.inc45_crit_edge.us
%loopA.288.us = phi i64 [ %inc46.us, %for.cond15.for.inc45_crit_edge.us ], [ 1, %for.cond12.preheader ]
%sub.us = add nsw i64 %loopA.288.us, -1
%arrayidx18.us = getelementptr inbounds i8, ptr %now, i64 %sub.us
%10 = load i8, ptr %arrayidx18.us, align 1, !tbaa !40
%11 = mul nsw i64 %sub.us, %add2
%arrayidx26.us = getelementptr inbounds i64, ptr %vla, i64 %11
%12 = mul nsw i64 %loopA.288.us, %add2
%arrayidx29.us = getelementptr inbounds i64, ptr %vla, i64 %12
%.pre = load i64, ptr %arrayidx29.us, align 8, !tbaa !5
br label %for.body17.us
for.body17.us: ; preds = %for.cond15.preheader.us, %for.body17.us
%13 = phi i64 [ %.pre, %for.cond15.preheader.us ], [ %b.a.i80.us, %for.body17.us ]
%loopB.086.us = phi i64 [ 1, %for.cond15.preheader.us ], [ %inc43.us, %for.body17.us ]
%sub19.us = add nsw i64 %loopB.086.us, -1
%arrayidx20.us = getelementptr inbounds i8, ptr %target, i64 %sub19.us
%14 = load i8, ptr %arrayidx20.us, align 1, !tbaa !40
%cmp22.us = icmp ne i8 %10, %14
%conv24.us = zext i1 %cmp22.us to i64
%arrayidx27.us = getelementptr inbounds i64, ptr %arrayidx26.us, i64 %loopB.086.us
%15 = load i64, ptr %arrayidx27.us, align 8, !tbaa !5
%add28.us = add nsw i64 %15, 1
%add32.us = add nsw i64 %13, 1
%b.a.i.us = tail call i64 @llvm.smin.i64(i64 %add28.us, i64 %add32.us)
%arrayidx37.us = getelementptr inbounds i64, ptr %arrayidx26.us, i64 %sub19.us
%16 = load i64, ptr %arrayidx37.us, align 8, !tbaa !5
%add38.us = add nsw i64 %16, %conv24.us
%b.a.i80.us = tail call i64 @llvm.smin.i64(i64 %b.a.i.us, i64 %add38.us)
%arrayidx41.us = getelementptr inbounds i64, ptr %arrayidx29.us, i64 %loopB.086.us
store i64 %b.a.i80.us, ptr %arrayidx41.us, align 8, !tbaa !5
%inc43.us = add nuw nsw i64 %loopB.086.us, 1
%exitcond92.not = icmp eq i64 %loopB.086.us, %call1
br i1 %exitcond92.not, label %for.cond15.for.inc45_crit_edge.us, label %for.body17.us, !llvm.loop !41
for.cond15.for.inc45_crit_edge.us: ; preds = %for.body17.us
%inc46.us = add nuw nsw i64 %loopA.288.us, 1
%exitcond93.not = icmp eq i64 %loopA.288.us, %call
br i1 %exitcond93.not, label %for.end47, label %for.cond15.preheader.us, !llvm.loop !42
for.body6: ; preds = %for.body6.preheader95, %for.body6
%loopA.184 = phi i64 [ %inc10, %for.body6 ], [ %loopA.184.ph, %for.body6.preheader95 ]
%arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %loopA.184
store i64 %loopA.184, ptr %arrayidx8, align 8, !tbaa !5
%inc10 = add nuw nsw i64 %loopA.184, 1
%exitcond91.not = icmp eq i64 %loopA.184, %call1
br i1 %exitcond91.not, label %for.cond12.preheader, label %for.body6, !llvm.loop !43
for.end47: ; preds = %for.cond15.for.inc45_crit_edge.us, %for.cond12.preheader
%17 = mul nsw i64 %add2, %call
%arrayidx49 = getelementptr inbounds i64, ptr %vla, i64 %17
%arrayidx51 = getelementptr inbounds i64, ptr %arrayidx49, i64 %call1
%18 = load i64, ptr %arrayidx51, align 8, !tbaa !5
ret i64 %18
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #14
; Function Attrs: nofree nounwind memory(write) uwtable
define dso_local void @prime_fact(i64 noundef %target, ptr nocapture noundef writeonly %data) local_unnamed_addr #15 {
entry:
%cmp.not28 = icmp eq i64 %target, 1
br i1 %cmp.not28, label %while.end12, label %while.cond1.preheader.lr.ph
while.cond1.preheader.lr.ph: ; preds = %entry
%conv3 = sitofp i64 %target to double
br label %while.cond1.preheader
while.cond1.preheader: ; preds = %while.cond1.preheader.lr.ph, %while.end
%target.addr.031 = phi i64 [ %target, %while.cond1.preheader.lr.ph ], [ %div, %while.end ]
%loopA.030 = phi i64 [ 1, %while.cond1.preheader.lr.ph ], [ %loopA.1, %while.end ]
%loopB.029 = phi i64 [ 0, %while.cond1.preheader.lr.ph ], [ %inc10, %while.end ]
br label %while.cond1
while.cond1: ; preds = %while.cond1.preheader, %if.end
%loopA.1 = phi i64 [ %inc, %if.end ], [ %loopA.030, %while.cond1.preheader ]
%inc = add nsw i64 %loopA.1, 1
%conv = sitofp i64 %inc to double
%call = tail call double @sqrt(double noundef %conv3) #21
%add = fadd double %call, 1.000000e+02
%cmp4 = fcmp ugt double %add, %conv
br i1 %cmp4, label %if.end, label %while.end.thread
while.end.thread: ; preds = %while.cond1
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loopB.029
store i64 %target.addr.031, ptr %arrayidx, align 8, !tbaa !5
br label %while.end12
if.end: ; preds = %while.cond1
%rem = srem i64 %target.addr.031, %inc
%div = sdiv i64 %target.addr.031, %inc
%cmp6 = icmp eq i64 %rem, 0
br i1 %cmp6, label %while.end, label %while.cond1
while.end: ; preds = %if.end
%arrayidx9 = getelementptr inbounds i64, ptr %data, i64 %loopB.029
store i64 %inc, ptr %arrayidx9, align 8, !tbaa !5
%inc10 = add nuw nsw i64 %loopB.029, 1
%cmp.not = icmp eq i64 %div, 1
br i1 %cmp.not, label %while.end12, label %while.cond1.preheader, !llvm.loop !44
while.end12: ; preds = %while.end, %while.end.thread, %entry
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #16
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @get_digit(i64 noundef %target) local_unnamed_addr #17 {
entry:
%conv = sitofp i64 %target to double
%call = tail call double @log10(double noundef %conv) #21
%add = fadd double %call, 1.000000e+00
%conv1 = fptosi double %add to i64
ret i64 %conv1
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log10(double noundef) local_unnamed_addr #16
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @ncr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #9 {
entry:
%pascal = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal) #21
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal, i8 0, i64 81600, i1 false)
%arrayidx = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 1
store i64 1, ptr %arrayidx, align 16, !tbaa !5
%arrayidx3 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3, align 8, !tbaa !5
br label %for.body
for.body: ; preds = %entry, %for.end
%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.end ]
%loopA.037 = phi i64 [ 2, %entry ], [ %inc20, %for.end ]
%0 = add i64 %indvar, 1
%arrayidx4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037
store i64 1, ptr %arrayidx4, align 16, !tbaa !5
%sub = add nsw i64 %loopA.037, -1
%arrayidx11.phi.trans.insert = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 0
%.pre = load i64, ptr %arrayidx11.phi.trans.insert, align 16, !tbaa !5
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !5
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !45
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body ]
%loopB.036.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%scalar.recur = phi i64 [ %6, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader ]
%loopB.036 = phi i64 [ %inc, %for.body8 ], [ %loopB.036.ph, %for.body8.preheader ]
%arrayidx14 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 %loopB.036
%6 = load i64, ptr %arrayidx14, align 8, !tbaa !5
%add = add nsw i64 %6, %scalar.recur
%arrayidx16 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %loopB.036
store i64 %add, ptr %arrayidx16, align 8, !tbaa !5
%inc = add nuw nsw i64 %loopB.036, 1
%exitcond.not = icmp eq i64 %inc, %loopA.037
br i1 %exitcond.not, label %for.end, label %for.body8, !llvm.loop !46
for.end: ; preds = %for.body8, %middle.block
%arrayidx18 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %loopA.037
store i64 1, ptr %arrayidx18, align 8, !tbaa !5
%inc20 = add nuw nsw i64 %loopA.037, 1
%exitcond38.not = icmp eq i64 %inc20, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not, label %for.end21, label %for.body, !llvm.loop !47
for.end21: ; preds = %for.end
%arrayidx23 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %n, i64 %r
%7 = load i64, ptr %arrayidx23, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal) #21
ret i64 %7
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #18
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @npr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #9 {
entry:
%pascal.i = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal.i) #21
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal.i, i8 0, i64 81600, i1 false)
%arrayidx.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1
store i64 1, ptr %arrayidx.i, align 16, !tbaa !5
%arrayidx3.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3.i, align 8, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.end.i, %entry
%indvar = phi i64 [ %indvar.next, %for.end.i ], [ 0, %entry ]
%loopA.037.i = phi i64 [ %inc20.i, %for.end.i ], [ 2, %entry ]
%0 = add i64 %indvar, 1
%arrayidx4.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i
store i64 1, ptr %arrayidx4.i, align 16, !tbaa !5
%sub.i = add nsw i64 %loopA.037.i, -1
%arrayidx11.phi.trans.insert.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 0
%.pre.i = load i64, ptr %arrayidx11.phi.trans.insert.i, align 16, !tbaa !5
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.i
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre.i, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !5
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !48
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %for.body.i, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body.i ]
%loopB.036.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.i ]
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i
%scalar.recur = phi i64 [ %6, %for.body8.i ], [ %scalar.recur.ph, %for.body8.i.preheader ]
%loopB.036.i = phi i64 [ %inc.i, %for.body8.i ], [ %loopB.036.i.ph, %for.body8.i.preheader ]
%arrayidx14.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %loopB.036.i
%6 = load i64, ptr %arrayidx14.i, align 8, !tbaa !5
%add.i = add nsw i64 %6, %scalar.recur
%arrayidx16.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopB.036.i
store i64 %add.i, ptr %arrayidx16.i, align 8, !tbaa !5
%inc.i = add nuw nsw i64 %loopB.036.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %loopA.037.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body8.i, !llvm.loop !49
for.end.i: ; preds = %for.body8.i, %middle.block
%arrayidx18.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopA.037.i
store i64 1, ptr %arrayidx18.i, align 8, !tbaa !5
%inc20.i = add nuw nsw i64 %loopA.037.i, 1
%exitcond38.not.i = icmp eq i64 %inc20.i, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not.i, label %ncr.exit, label %for.body.i, !llvm.loop !47
ncr.exit: ; preds = %for.end.i
%arrayidx23.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %n, i64 %r
%7 = load i64, ptr %arrayidx23.i, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal.i) #21
%cmp.not4.i = icmp slt i64 %r, 1
br i1 %cmp.not4.i, label %factorial.exit, label %for.body.i3.preheader
for.body.i3.preheader: ; preds = %ncr.exit
%xtraiter = and i64 %r, 3
%8 = icmp ult i64 %r, 4
br i1 %8, label %factorial.exit.loopexit.unr-lcssa, label %for.body.i3.preheader.new
for.body.i3.preheader.new: ; preds = %for.body.i3.preheader
%unroll_iter = and i64 %r, -4
br label %for.body.i3
for.body.i3: ; preds = %for.body.i3, %for.body.i3.preheader.new
%i.06.i = phi i64 [ 1, %for.body.i3.preheader.new ], [ %inc.i4.3, %for.body.i3 ]
%ret.05.i = phi i64 [ 1, %for.body.i3.preheader.new ], [ %rem.i.3, %for.body.i3 ]
%niter = phi i64 [ 0, %for.body.i3.preheader.new ], [ %niter.next.3, %for.body.i3 ]
%mul.i = mul i64 %ret.05.i, %i.06.i
%rem.i = urem i64 %mul.i, 1000000007
%inc.i4 = add nuw nsw i64 %i.06.i, 1
%mul.i.1 = mul i64 %rem.i, %inc.i4
%rem.i.1 = urem i64 %mul.i.1, 1000000007
%inc.i4.1 = add nuw nsw i64 %i.06.i, 2
%mul.i.2 = mul i64 %rem.i.1, %inc.i4.1
%rem.i.2 = urem i64 %mul.i.2, 1000000007
%inc.i4.2 = add nuw i64 %i.06.i, 3
%mul.i.3 = mul i64 %rem.i.2, %inc.i4.2
%rem.i.3 = urem i64 %mul.i.3, 1000000007
%inc.i4.3 = add nuw i64 %i.06.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 %factorial.exit.loopexit.unr-lcssa, label %for.body.i3, !llvm.loop !20
factorial.exit.loopexit.unr-lcssa: ; preds = %for.body.i3, %for.body.i3.preheader
%rem.i.lcssa.ph = phi i64 [ undef, %for.body.i3.preheader ], [ %rem.i.3, %for.body.i3 ]
%i.06.i.unr = phi i64 [ 1, %for.body.i3.preheader ], [ %inc.i4.3, %for.body.i3 ]
%ret.05.i.unr = phi i64 [ 1, %for.body.i3.preheader ], [ %rem.i.3, %for.body.i3 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %factorial.exit, label %for.body.i3.epil
for.body.i3.epil: ; preds = %factorial.exit.loopexit.unr-lcssa, %for.body.i3.epil
%i.06.i.epil = phi i64 [ %inc.i4.epil, %for.body.i3.epil ], [ %i.06.i.unr, %factorial.exit.loopexit.unr-lcssa ]
%ret.05.i.epil = phi i64 [ %rem.i.epil, %for.body.i3.epil ], [ %ret.05.i.unr, %factorial.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i3.epil ], [ 0, %factorial.exit.loopexit.unr-lcssa ]
%mul.i.epil = mul i64 %ret.05.i.epil, %i.06.i.epil
%rem.i.epil = urem i64 %mul.i.epil, 1000000007
%inc.i4.epil = add nuw i64 %i.06.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 %factorial.exit, label %for.body.i3.epil, !llvm.loop !50
factorial.exit: ; preds = %factorial.exit.loopexit.unr-lcssa, %for.body.i3.epil, %ncr.exit
%ret.0.lcssa.i = phi i64 [ 1, %ncr.exit ], [ %rem.i.lcssa.ph, %factorial.exit.loopexit.unr-lcssa ], [ %rem.i.epil, %for.body.i3.epil ]
%mul = mul nsw i64 %ret.0.lcssa.i, %7
ret i64 %mul
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @nhr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #9 {
entry:
%pascal.i = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal.i) #21
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal.i, i8 0, i64 81600, i1 false)
%arrayidx.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1
store i64 1, ptr %arrayidx.i, align 16, !tbaa !5
%arrayidx3.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3.i, align 8, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.end.i, %entry
%indvar = phi i64 [ %indvar.next, %for.end.i ], [ 0, %entry ]
%loopA.037.i = phi i64 [ %inc20.i, %for.end.i ], [ 2, %entry ]
%0 = add i64 %indvar, 1
%arrayidx4.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i
store i64 1, ptr %arrayidx4.i, align 16, !tbaa !5
%sub.i = add nsw i64 %loopA.037.i, -1
%arrayidx11.phi.trans.insert.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 0
%.pre.i = load i64, ptr %arrayidx11.phi.trans.insert.i, align 16, !tbaa !5
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.i
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre.i, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !5
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !51
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %for.body.i, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body.i ]
%loopB.036.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.i ]
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i
%scalar.recur = phi i64 [ %6, %for.body8.i ], [ %scalar.recur.ph, %for.body8.i.preheader ]
%loopB.036.i = phi i64 [ %inc.i, %for.body8.i ], [ %loopB.036.i.ph, %for.body8.i.preheader ]
%arrayidx14.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %loopB.036.i
%6 = load i64, ptr %arrayidx14.i, align 8, !tbaa !5
%add.i = add nsw i64 %6, %scalar.recur
%arrayidx16.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopB.036.i
store i64 %add.i, ptr %arrayidx16.i, align 8, !tbaa !5
%inc.i = add nuw nsw i64 %loopB.036.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %loopA.037.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body8.i, !llvm.loop !52
for.end.i: ; preds = %for.body8.i, %middle.block
%arrayidx18.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopA.037.i
store i64 1, ptr %arrayidx18.i, align 8, !tbaa !5
%inc20.i = add nuw nsw i64 %loopA.037.i, 1
%exitcond38.not.i = icmp eq i64 %inc20.i, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not.i, label %ncr.exit, label %for.body.i, !llvm.loop !47
ncr.exit: ; preds = %for.end.i
%add = add i64 %n, -1
%sub = add i64 %add, %r
%arrayidx23.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub, i64 %r
%7 = load i64, ptr %arrayidx23.i, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal.i) #21
ret i64 %7
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @BellmanFord(i64 noundef %how_tyouten, i64 noundef %how_hen, i64 noundef %start_ten, i64 noundef %goal_ten, ptr nocapture noundef readonly %hen_data) local_unnamed_addr #11 {
entry:
%dist = alloca [100000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %dist) #21
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.4, %vector.body ]
%0 = getelementptr inbounds i64, ptr %dist, i64 %index
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %0, align 16, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %1, align 16, !tbaa !5
%2 = getelementptr i64, ptr %dist, i64 %index
%3 = getelementptr i64, ptr %2, i64 4
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %3, align 16, !tbaa !5
%4 = getelementptr i64, ptr %2, i64 6
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %4, align 16, !tbaa !5
%5 = getelementptr i64, ptr %dist, i64 %index
%6 = getelementptr i64, ptr %5, i64 8
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %6, align 16, !tbaa !5
%7 = getelementptr i64, ptr %5, i64 10
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %7, align 16, !tbaa !5
%8 = getelementptr i64, ptr %dist, i64 %index
%9 = getelementptr i64, ptr %8, i64 12
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %9, align 16, !tbaa !5
%10 = getelementptr i64, ptr %8, i64 14
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %10, align 16, !tbaa !5
%11 = getelementptr i64, ptr %dist, i64 %index
%12 = getelementptr i64, ptr %11, i64 16
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %12, align 16, !tbaa !5
%13 = getelementptr i64, ptr %11, i64 18
store <2 x i64> <i64 10000000000, i64 10000000000>, ptr %13, align 16, !tbaa !5
%index.next.4 = add nuw nsw i64 %index, 20
%14 = icmp eq i64 %index.next.4, 100000
br i1 %14, label %format_array.exit, label %vector.body, !llvm.loop !53
format_array.exit: ; preds = %vector.body
%arrayidx = getelementptr inbounds [100000 x i64], ptr %dist, i64 0, i64 %start_ten
store i64 0, ptr %arrayidx, align 8, !tbaa !5
%cmp49 = icmp sgt i64 %how_tyouten, 0
%cmp446 = icmp sgt i64 %how_hen, 0
%or.cond = and i1 %cmp49, %cmp446
br i1 %or.cond, label %for.cond2.preheader.us, label %for.cond.cleanup
for.cond2.preheader.us: ; preds = %format_array.exit, %for.cond2.for.cond.cleanup6_crit_edge.us
%indvars.iv54 = phi i64 [ %indvars.iv.next55, %for.cond2.for.cond.cleanup6_crit_edge.us ], [ 0, %format_array.exit ]
br label %for.body7.us
for.body7.us: ; preds = %for.cond2.preheader.us, %for.body7.us
%indvars.iv = phi i64 [ 0, %for.cond2.preheader.us ], [ %indvars.iv.next, %for.body7.us ]
%arrayidx8.us = getelementptr inbounds %struct.wdg, ptr %hen_data, i64 %indvars.iv
%15 = load i64, ptr %arrayidx8.us, align 8, !tbaa !54
%arrayidx9.us = getelementptr inbounds [100000 x i64], ptr %dist, i64 0, i64 %15
%16 = load i64, ptr %arrayidx9.us, align 8, !tbaa !5
%omomi.us = getelementptr inbounds %struct.wdg, ptr %hen_data, i64 %indvars.iv, i32 2
%17 = load i64, ptr %omomi.us, align 8, !tbaa !56
%add.us = add nsw i64 %17, %16
%to.us = getelementptr inbounds %struct.wdg, ptr %hen_data, i64 %indvars.iv, i32 1
%18 = load i64, ptr %to.us, align 8, !tbaa !57
%arrayidx14.us = getelementptr inbounds [100000 x i64], ptr %dist, i64 0, i64 %18
%19 = load i64, ptr %arrayidx14.us, align 8, !tbaa !5
%spec.store.select.us = tail call i64 @llvm.smin.i64(i64 %add.us, i64 %19)
store i64 %spec.store.select.us, ptr %arrayidx14.us, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %how_hen
br i1 %exitcond.not, label %for.cond2.for.cond.cleanup6_crit_edge.us, label %for.body7.us, !llvm.loop !58
for.cond2.for.cond.cleanup6_crit_edge.us: ; preds = %for.body7.us
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond57.not = icmp eq i64 %indvars.iv.next55, %how_tyouten
br i1 %exitcond57.not, label %for.cond.cleanup, label %for.cond2.preheader.us, !llvm.loop !59
for.cond.cleanup: ; preds = %for.cond2.for.cond.cleanup6_crit_edge.us, %format_array.exit
%arrayidx32 = getelementptr inbounds [100000 x i64], ptr %dist, i64 0, i64 %goal_ten
%20 = load i64, ptr %arrayidx32, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %dist) #21
ret i64 %20
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #19
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #20
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nofree norecurse nosync nounwind memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress 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 #9 = { 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 #10 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { 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 #12 = { 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 #13 = { nofree 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 #14 = { 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 #15 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #16 = { 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 #17 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #18 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #19 = { nofree nounwind }
attributes #20 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #21 = { nounwind }
attributes #22 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10, !16, !15}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !19}
!31 = distinct !{!31, !10, !15, !16}
!32 = distinct !{!32, !10, !16, !15}
!33 = distinct !{!33, !10, !15, !16}
!34 = distinct !{!34, !10, !16, !15}
!35 = distinct !{!35, !10, !15, !16}
!36 = distinct !{!36, !10, !16, !15}
!37 = distinct !{!37, !19}
!38 = distinct !{!38, !10, !15, !16}
!39 = distinct !{!39, !10}
!40 = !{!7, !7, i64 0}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !10}
!43 = distinct !{!43, !10, !16, !15}
!44 = distinct !{!44, !10}
!45 = distinct !{!45, !10, !15, !16}
!46 = distinct !{!46, !10, !16, !15}
!47 = distinct !{!47, !10}
!48 = distinct !{!48, !10, !15, !16}
!49 = distinct !{!49, !10, !16, !15}
!50 = distinct !{!50, !19}
!51 = distinct !{!51, !10, !15, !16}
!52 = distinct !{!52, !10, !16, !15}
!53 = distinct !{!53, !10, !15, !16}
!54 = !{!55, !6, i64 0}
!55 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!56 = !{!55, !6, i64 16}
!57 = !{!55, !6, i64 8}
!58 = distinct !{!58, !10}
!59 = distinct !{!59, !10}
|
#include <stdio.h>
int main(void){
int n;
scanf("%d", &n);
int a[n+1];
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
}
int light = 1;
int check[n+1];
check[1] = 1;
for (int i = 2; i <= n; i++) {
check[i] = 0;
}
int count = 0;
while (count < n) {
count++;
light = a[light];
check[light]++;
if (check[light] > 1) {
printf("-1\n");
break;
}
if (check[2] == 1) {
printf("%d\n", count);
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187801/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187801/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not40 = icmp slt i32 %3, 1
br i1 %cmp.not40, label %for.cond.cleanup.thread, label %for.body
for.cond.cleanup.thread: ; preds = %entry
%add250 = add nsw i32 %3, 1
%4 = zext i32 %add250 to i64
%vla351 = alloca i32, i64 %4, align 16
%arrayidx452 = getelementptr inbounds i32, ptr %vla351, i64 1
store i32 1, ptr %arrayidx452, align 4, !tbaa !5
br label %while.cond.preheader
for.cond.cleanup: ; preds = %for.body
%add2 = add nsw i32 %9, 1
%5 = zext i32 %add2 to i64
%vla3 = alloca i32, i64 %5, align 16
%arrayidx4 = getelementptr inbounds i32, ptr %vla3, i64 1
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
%cmp7.not42 = icmp slt i32 %9, 2
br i1 %cmp7.not42, label %while.cond.preheader, label %for.body9.preheader
for.body9.preheader: ; preds = %for.cond.cleanup
%scevgep = getelementptr i8, ptr %vla3, i64 8
%6 = add nsw i32 %9, -1
%7 = zext i32 %6 to i64
%8 = shl nuw nsw i64 %7, 2
call void @llvm.memset.p0.i64(ptr align 8 %scevgep, i8 0, i64 %8, i1 false), !tbaa !5
br label %while.cond.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %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
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %10
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !9
while.cond.preheader: ; preds = %for.cond.cleanup.thread, %for.body9.preheader, %for.cond.cleanup
%vla355 = phi ptr [ %vla351, %for.cond.cleanup.thread ], [ %vla3, %for.body9.preheader ], [ %vla3, %for.cond.cleanup ]
%.lcssa54 = phi i32 [ %3, %for.cond.cleanup.thread ], [ %9, %for.body9.preheader ], [ %9, %for.cond.cleanup ]
%arrayidx26 = getelementptr inbounds i32, ptr %vla355, i64 2
%smax = call i32 @llvm.smax.i32(i32 %.lcssa54, i32 0)
br label %while.cond
while.cond: ; preds = %while.cond.preheader, %if.end
%light.0 = phi i32 [ %11, %if.end ], [ 1, %while.cond.preheader ]
%count.0 = phi i32 [ %inc16, %if.end ], [ 0, %while.cond.preheader ]
%exitcond.not = icmp eq i32 %count.0, %smax
br i1 %exitcond.not, label %while.end, label %while.body
while.body: ; preds = %while.cond
%idxprom17 = sext i32 %light.0 to i64
%arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %idxprom17
%11 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%idxprom19 = sext i32 %11 to i64
%arrayidx20 = getelementptr inbounds i32, ptr %vla355, i64 %idxprom19
%12 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%inc21 = add nsw i32 %12, 1
store i32 %inc21, ptr %arrayidx20, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %12, 0
br i1 %cmp24, label %if.then, label %if.end
if.then: ; preds = %while.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %while.end
if.end: ; preds = %while.body
%inc16 = add nuw i32 %count.0, 1
%13 = load i32, ptr %arrayidx26, align 8, !tbaa !5
%cmp27 = icmp eq i32 %13, 1
br i1 %cmp27, label %if.then28, label %while.cond, !llvm.loop !11
if.then28: ; preds = %if.end
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %inc16)
br label %while.end
while.end: ; preds = %while.cond, %if.then28, %if.then
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 nounwind willreturn memory(argmem: write) }
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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int n,i,a[100001],t=0;
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(i=0;i<n+1;i++){
t=a[t]-1;
if(t==1){
printf("%d",i+1);
return 0;
}
}
puts("-1");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187845/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187845/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\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 [100001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400004, 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
%cmp24 = icmp sgt i32 %0, 0
br i1 %cmp24, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
%cmp3.not26 = icmp slt i32 %.lcssa, 0
br i1 %cmp3.not26, label %for.end12, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.inc10
%t.028 = phi i32 [ %sub, %for.inc10 ], [ 0, %for.cond2.preheader ]
%i.127 = phi i32 [ %add8, %for.inc10 ], [ 0, %for.cond2.preheader ]
%idxprom5 = sext i32 %t.028 to i64
%arrayidx6 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom5
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%cmp7 = icmp eq i32 %sub, 1
%add8 = add nuw i32 %i.127, 1
br i1 %cmp7, label %if.then, label %for.inc10
if.then: ; preds = %for.body4
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add8)
br label %cleanup
for.inc10: ; preds = %for.body4
%exitcond.not = icmp eq i32 %i.127, %.lcssa
br i1 %exitcond.not, label %for.end12, label %for.body4, !llvm.loop !11
for.end12: ; preds = %for.inc10, %for.cond2.preheader
%call13 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
cleanup: ; preds = %for.end12, %if.then
call void @llvm.lifetime.end.p0(i64 400004, 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: 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 = !{!"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<string.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
char s[51];
scanf("%s",s);
int i;
for(i=0;i<strlen(s);i++)
{
if(i%2==0)
{
if(s[i]=='a') s[i]='b';
else s[i]='a';
}
else
{
if(s[i]=='z') s[i]='y';
else s[i]='z';
}
}
printf("%s\n",s);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18791/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18791/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%s = alloca [51 x i8], align 16
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
%dec43 = add nsw i32 %0, -1
store i32 %dec43, ptr %t, align 4, !tbaa !5
%tobool.not44 = icmp eq i32 %0, 0
br i1 %tobool.not44, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %s) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%char0 = load i8, ptr %s, align 16
%cmp40.not = icmp eq i8 %char0, 0
br i1 %cmp40.not, label %for.end, label %for.body
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%rem46 = and i64 %indvars.iv, 1
%cmp5 = icmp eq i64 %rem46, 0
%arrayidx = getelementptr inbounds [51 x i8], ptr %s, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp8 = icmp eq i8 %1, 97
%. = select i1 %cmp8, i8 98, i8 97
%cmp19 = icmp eq i8 %1, 122
%.47 = select i1 %cmp19, i8 121, i8 122
%.sink = select i1 %cmp5, i8 %., i8 %.47
store i8 %.sink, ptr %arrayidx, align 1, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%cmp = icmp ugt i64 %call3, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %while.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %s) #5
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
int main() {
int n, a[100000], i, btn;
scanf("%d", &n);
for (i=0; i<n; i++) {
scanf("%d", &a[i]);
}
i = 0;
btn = 1;
while (1) {
int tmp;
if (a[btn-1] == -1) {
puts("-1");
return 0;
} else if (btn == 2) {
printf("%d\n", i);
return 0;
}
i++;
tmp = a[btn-1];
a[btn-1] = -1;
btn = tmp;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187960/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %0, 0
br i1 %cmp32, label %for.body, label %if.else.preheader
while.cond.preheader: ; preds = %for.body
%.pre = load i32, ptr %a, align 16, !tbaa !5
%cmp434 = icmp eq i32 %.pre, -1
br i1 %cmp434, label %if.then, label %if.else.preheader
if.else.preheader: ; preds = %entry, %while.cond.preheader
%.ph = phi i32 [ undef, %entry ], [ %.pre, %while.cond.preheader ]
br label %if.else
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9
if.then: ; preds = %cleanup, %while.cond.preheader
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup17
if.else: ; preds = %if.else.preheader, %cleanup
%3 = phi i32 [ %4, %cleanup ], [ %.ph, %if.else.preheader ]
%arrayidx337 = phi ptr [ %arrayidx3, %cleanup ], [ %a, %if.else.preheader ]
%btn.036 = phi i32 [ %3, %cleanup ], [ 1, %if.else.preheader ]
%i.135 = phi i32 [ %inc10, %cleanup ], [ 0, %if.else.preheader ]
%cmp6 = icmp eq i32 %btn.036, 2
br i1 %cmp6, label %if.then7, label %cleanup
if.then7: ; preds = %if.else
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.135)
br label %cleanup17
cleanup: ; preds = %if.else
%inc10 = add nuw nsw i32 %i.135, 1
store i32 -1, ptr %arrayidx337, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%idxprom2 = sext i32 %sub to i64
%arrayidx3 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %idxprom2
%4 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp eq i32 %4, -1
br i1 %cmp4, label %if.then, label %if.else
cleanup17: ; preds = %if.then, %if.then7
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define ARR_MAX 300000
#define BUF_SIZE (ARR_MAX*11+50)
#define DIVISOR 1000000007
int get_int(void) {
int num;
#ifdef BUF_SIZE
char line[BUF_SIZE];
if(!fgets(line, BUF_SIZE, stdin)) return 0;
sscanf(line, "%d", &num);
#else
#error
#endif
return num;
}
// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
#ifdef BUF_SIZE
char line[BUF_SIZE];
char *tmpbuf = line;
int i;
if(!fgets(line, BUF_SIZE, stdin)) return -1;
for(i = 0; i < size; i++) {
char *tmp = strtok(tmpbuf, " ");
arr[i] = strtol(tmp, NULL, 10);
tmpbuf = NULL;
}
#else
#error
#endif
return 0;
}
#define HEAP_MAX (ARR_MAX+50)
int heap[HEAP_MAX];
int hidx = 1;
int cmp(int a1, int a2) {
return a1 < a2;
}
void swap(int *a1, int *a2) {
int tmp = *a1;
*a1 = *a2;
*a2 = tmp;
}
void enqueue(int num) {
int node = hidx;
heap[hidx++] = num;
int parent;
while((parent = node/2)) {
if(cmp(heap[parent], heap[node])) break;
swap(&heap[parent], &heap[node]);
node = parent;
}
return;
}
int dequeue_min(void) {
int node = 1;
int ans = heap[1];
heap[1] = heap[--hidx];
while(1) {
int smallest = node;
int left = node * 2;
int right = node * 2 + 1;
if(left < hidx && !cmp(heap[smallest], heap[left])) {
smallest = left;
}
if(right < hidx && !cmp(heap[smallest], heap[right])) {
smallest = right;
}
if(smallest == node) break;
swap(&heap[smallest], &heap[node]);
node = smallest;
}
return ans;
}
void reset_heap(void) {
hidx = 1;
}
#define ANS_MIN INT64_MIN
void record(int *arr, int64_t *sum, int num) {
reset_heap();
sum[0] = arr[0];
enqueue(arr[0]);
int i;
for(i = 1; i < num*2; i++) {
int diff = arr[i];
enqueue(arr[i]);
if(i >= num) {
int tmp = dequeue_min();
diff -= tmp;
}
sum[i] = sum[i-1] + (int64_t)diff;
}
return;
}
int main(void) {
static int arr[ARR_MAX];
int num = get_int();
int size = num*3;
fget_array(arr, size);
static int rarr[ARR_MAX];
int i;
// for using same priority heap
for(i = 0; i < size; i++) rarr[i] = -arr[size-1-i];
static int64_t sum[ARR_MAX];
static int64_t rsum[ARR_MAX];
record(arr, sum, num);
record(rarr, rsum, num);
int64_t ans = ANS_MIN;
for(i = num-1; i < 2*num; i++) {
#ifdef DEBUG
// sum of [0, .. , i](i) + [i+1, ... size](size-1-(i+1))
printf("%lld %lld\n", sum[i], rsum[size-2-i]);
#endif
ans = max(ans, sum[i] + rsum[size-2-i]);
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188082/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188082/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c" \00", align 1
@hidx = dso_local local_unnamed_addr global i32 1, align 4
@heap = dso_local local_unnamed_addr global [300050 x i32] zeroinitializer, align 16
@main.arr = internal global [300000 x i32] zeroinitializer, align 16
@main.rarr = internal global [300000 x i32] zeroinitializer, align 16
@main.sum = internal global [300000 x i64] zeroinitializer, align 16
@main.rsum = internal global [300000 x i64] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @get_int() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
%line = alloca [3300050 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #10
call void @llvm.lifetime.start.p0(i64 3300050, ptr nonnull %line) #10
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 3300050, ptr noundef %0)
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %cleanup, label %if.end
if.end: ; preds = %entry
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %num) #10
%1 = load i32, ptr %num, align 4, !tbaa !9
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %1, %if.end ], [ 0, %entry ]
call void @llvm.lifetime.end.p0(i64 3300050, ptr nonnull %line) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #10
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef 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 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 @fget_array(ptr nocapture noundef writeonly %arr, i32 noundef %size) local_unnamed_addr #0 {
entry:
%line = alloca [3300050 x i8], align 16
call void @llvm.lifetime.start.p0(i64 3300050, ptr nonnull %line) #10
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 3300050, ptr noundef %0)
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp8 = icmp sgt i32 %size, 0
br i1 %cmp8, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %size to i64
%call2.peel = call ptr @strtok(ptr noundef nonnull %line, ptr noundef nonnull @.str.1) #10
%call3.peel = call i64 @strtol(ptr nocapture noundef %call2.peel, ptr noundef null, i32 noundef 10) #10
%conv.peel = trunc i64 %call3.peel to i32
store i32 %conv.peel, ptr %arr, align 4, !tbaa !9
%exitcond.peel.not = icmp eq i32 %size, 1
br i1 %exitcond.peel.not, label %cleanup, label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %for.body.preheader ]
%call2 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.1) #10
%call3 = call i64 @strtol(ptr nocapture noundef %call2, ptr noundef null, i32 noundef 10) #10
%conv = trunc i64 %call3 to i32
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
store i32 %conv, ptr %arrayidx, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11
cleanup: ; preds = %for.body, %for.body.preheader, %for.cond.preheader, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 0, %for.cond.preheader ], [ 0, %for.body.preheader ], [ 0, %for.body ]
call void @llvm.lifetime.end.p0(i64 3300050, ptr nonnull %line) #10
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @cmp(i32 noundef %a1, i32 noundef %a2) local_unnamed_addr #4 {
entry:
%cmp = icmp slt i32 %a1, %a2
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a1, ptr nocapture noundef %a2) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a1, align 4, !tbaa !9
%1 = load i32, ptr %a2, align 4, !tbaa !9
store i32 %1, ptr %a1, align 4, !tbaa !9
store i32 %0, ptr %a2, align 4, !tbaa !9
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @enqueue(i32 noundef %num) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr @hidx, align 4, !tbaa !9
%inc = add i32 %0, 1
store i32 %inc, ptr @hidx, align 4, !tbaa !9
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom
store i32 %num, ptr %arrayidx, align 4, !tbaa !9
%tobool.not16 = icmp ult i32 %inc, 3
br i1 %tobool.not16, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%node.017 = phi i32 [ %div18, %if.end ], [ %0, %entry ]
%div18 = sdiv i32 %node.017, 2
%idxprom1 = sext i32 %div18 to i64
%arrayidx2 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !9
%idxprom3 = sext i32 %node.017 to i64
%arrayidx4 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom3
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !9
%cmp.i.not = icmp slt i32 %1, %2
br i1 %cmp.i.not, label %while.end, label %if.end
if.end: ; preds = %while.body
store i32 %2, ptr %arrayidx2, align 4, !tbaa !9
store i32 %1, ptr %arrayidx4, align 4, !tbaa !9
%node.0.off = add nsw i32 %div18, 1
%tobool.not = icmp ult i32 %node.0.off, 3
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %if.end, %while.body, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @dequeue_min() local_unnamed_addr #6 {
entry:
%0 = load i32, ptr getelementptr inbounds ([300050 x i32], ptr @heap, i64 0, i64 1), align 4, !tbaa !9
%1 = load i32, ptr @hidx, align 4, !tbaa !9
%dec = add nsw i32 %1, -1
store i32 %dec, ptr @hidx, align 4, !tbaa !9
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !9
store i32 %2, ptr getelementptr inbounds ([300050 x i32], ptr @heap, i64 0, i64 1), align 4, !tbaa !9
br label %while.cond
while.cond: ; preds = %cleanup, %entry
%node.0 = phi i32 [ 1, %entry ], [ %smallest.1, %cleanup ]
%mul = shl nsw i32 %node.0, 1
%add = or i32 %mul, 1
%cmp = icmp slt i32 %mul, %dec
br i1 %cmp, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %while.cond
%idxprom2 = sext i32 %node.0 to i64
%arrayidx3 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom2
%3 = load i32, ptr %arrayidx3, align 4, !tbaa !9
%idxprom4 = sext i32 %mul to i64
%arrayidx5 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom4
%4 = load i32, ptr %arrayidx5, align 8, !tbaa !9
%cmp.i.not = icmp slt i32 %3, %4
%spec.select = select i1 %cmp.i.not, i32 %node.0, i32 %mul
br label %if.end
if.end: ; preds = %land.lhs.true, %while.cond
%smallest.0 = phi i32 [ %node.0, %while.cond ], [ %spec.select, %land.lhs.true ]
%cmp6 = icmp slt i32 %add, %dec
br i1 %cmp6, label %land.lhs.true7, label %if.end15
land.lhs.true7: ; preds = %if.end
%idxprom8 = sext i32 %smallest.0 to i64
%arrayidx9 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !9
%idxprom10 = sext i32 %add to i64
%arrayidx11 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom10
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !9
%cmp.i40.not = icmp slt i32 %5, %6
%spec.select39 = select i1 %cmp.i40.not, i32 %smallest.0, i32 %add
br label %if.end15
if.end15: ; preds = %land.lhs.true7, %if.end
%smallest.1 = phi i32 [ %smallest.0, %if.end ], [ %spec.select39, %land.lhs.true7 ]
%cmp16 = icmp eq i32 %smallest.1, %node.0
br i1 %cmp16, label %while.end, label %cleanup
cleanup: ; preds = %if.end15
%idxprom19 = sext i32 %smallest.1 to i64
%arrayidx20 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom19
%idxprom21 = sext i32 %node.0 to i64
%arrayidx22 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom21
%7 = load i32, ptr %arrayidx20, align 4, !tbaa !9
%8 = load i32, ptr %arrayidx22, align 4, !tbaa !9
store i32 %8, ptr %arrayidx20, align 4, !tbaa !9
store i32 %7, ptr %arrayidx22, align 4, !tbaa !9
br label %while.cond
while.end: ; preds = %if.end15
ret i32 %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @reset_heap() local_unnamed_addr #7 {
entry:
store i32 1, ptr @hidx, align 4, !tbaa !9
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @record(ptr nocapture noundef readonly %arr, ptr nocapture noundef writeonly %sum, i32 noundef %num) local_unnamed_addr #8 {
enqueue.exit:
store i32 1, ptr @hidx, align 4, !tbaa !9
%0 = load i32, ptr %arr, align 4, !tbaa !9
%conv = sext i32 %0 to i64
store i64 %conv, ptr %sum, align 8, !tbaa !15
store i32 2, ptr @hidx, align 4, !tbaa !9
store i32 %0, ptr getelementptr inbounds ([300050 x i32], ptr @heap, i64 0, i64 1), align 4, !tbaa !9
%cmp48 = icmp sgt i32 %num, 0
br i1 %cmp48, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %enqueue.exit
%mul = shl nuw i32 %num, 1
%1 = zext i32 %num to i64
%smax = tail call i32 @llvm.smax.i32(i32 %mul, i32 2)
%wide.trip.count = zext i32 %smax to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %if.end
%2 = phi i64 [ %conv, %for.body.preheader ], [ %add, %if.end ]
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %if.end ]
%3 = phi i32 [ 2, %for.body.preheader ], [ %15, %if.end ]
%arrayidx4 = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%4 = load i32, ptr %arrayidx4, align 4, !tbaa !9
%inc.i28 = add i32 %3, 1
store i32 %inc.i28, ptr @hidx, align 4, !tbaa !9
%idxprom.i29 = sext i32 %3 to i64
%arrayidx.i30 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom.i29
store i32 %4, ptr %arrayidx.i30, align 4, !tbaa !9
%tobool.not16.i31 = icmp ult i32 %inc.i28, 3
br i1 %tobool.not16.i31, label %enqueue.exit43, label %while.body.i32
while.body.i32: ; preds = %for.body, %if.end.i40
%node.017.i33 = phi i32 [ %div18.i34, %if.end.i40 ], [ %3, %for.body ]
%div18.i34 = sdiv i32 %node.017.i33, 2
%idxprom1.i35 = sext i32 %div18.i34 to i64
%arrayidx2.i36 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom1.i35
%5 = load i32, ptr %arrayidx2.i36, align 4, !tbaa !9
%idxprom3.i37 = sext i32 %node.017.i33 to i64
%arrayidx4.i38 = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom3.i37
%6 = load i32, ptr %arrayidx4.i38, align 4, !tbaa !9
%cmp.i.not.i39 = icmp slt i32 %5, %6
br i1 %cmp.i.not.i39, label %enqueue.exit43, label %if.end.i40
if.end.i40: ; preds = %while.body.i32
store i32 %6, ptr %arrayidx2.i36, align 4, !tbaa !9
store i32 %5, ptr %arrayidx4.i38, align 4, !tbaa !9
%node.0.off.i41 = add nsw i32 %div18.i34, 1
%tobool.not.i42 = icmp ult i32 %node.0.off.i41, 3
br i1 %tobool.not.i42, label %enqueue.exit43, label %while.body.i32, !llvm.loop !14
enqueue.exit43: ; preds = %while.body.i32, %if.end.i40, %for.body
%cmp7.not = icmp ult i64 %indvars.iv, %1
br i1 %cmp7.not, label %if.end, label %if.then
if.then: ; preds = %enqueue.exit43
%7 = load i32, ptr getelementptr inbounds ([300050 x i32], ptr @heap, i64 0, i64 1), align 4, !tbaa !9
store i32 %3, ptr @hidx, align 4, !tbaa !9
%8 = load i32, ptr %arrayidx.i30, align 4, !tbaa !9
store i32 %8, ptr getelementptr inbounds ([300050 x i32], ptr @heap, i64 0, i64 1), align 4, !tbaa !9
br label %while.cond.i
while.cond.i: ; preds = %cleanup.i, %if.then
%node.0.i = phi i32 [ 1, %if.then ], [ %smallest.1.i, %cleanup.i ]
%mul.i = shl nsw i32 %node.0.i, 1
%add.i = or i32 %mul.i, 1
%cmp.i = icmp slt i32 %mul.i, %3
br i1 %cmp.i, label %land.lhs.true.i, label %if.end.i46
land.lhs.true.i: ; preds = %while.cond.i
%idxprom2.i = sext i32 %node.0.i to i64
%arrayidx3.i = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom2.i
%9 = load i32, ptr %arrayidx3.i, align 4, !tbaa !9
%idxprom4.i = sext i32 %mul.i to i64
%arrayidx5.i = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom4.i
%10 = load i32, ptr %arrayidx5.i, align 8, !tbaa !9
%cmp.i.not.i47 = icmp slt i32 %9, %10
%spec.select.i = select i1 %cmp.i.not.i47, i32 %node.0.i, i32 %mul.i
br label %if.end.i46
if.end.i46: ; preds = %land.lhs.true.i, %while.cond.i
%smallest.0.i = phi i32 [ %node.0.i, %while.cond.i ], [ %spec.select.i, %land.lhs.true.i ]
%cmp6.i = icmp slt i32 %add.i, %3
br i1 %cmp6.i, label %land.lhs.true7.i, label %if.end15.i
land.lhs.true7.i: ; preds = %if.end.i46
%idxprom8.i = sext i32 %smallest.0.i to i64
%arrayidx9.i = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom8.i
%11 = load i32, ptr %arrayidx9.i, align 4, !tbaa !9
%idxprom10.i = sext i32 %add.i to i64
%arrayidx11.i = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom10.i
%12 = load i32, ptr %arrayidx11.i, align 4, !tbaa !9
%cmp.i40.not.i = icmp slt i32 %11, %12
%spec.select39.i = select i1 %cmp.i40.not.i, i32 %smallest.0.i, i32 %add.i
br label %if.end15.i
if.end15.i: ; preds = %land.lhs.true7.i, %if.end.i46
%smallest.1.i = phi i32 [ %smallest.0.i, %if.end.i46 ], [ %spec.select39.i, %land.lhs.true7.i ]
%cmp16.i = icmp eq i32 %smallest.1.i, %node.0.i
br i1 %cmp16.i, label %dequeue_min.exit, label %cleanup.i
cleanup.i: ; preds = %if.end15.i
%idxprom19.i = sext i32 %smallest.1.i to i64
%arrayidx20.i = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom19.i
%idxprom21.i = sext i32 %node.0.i to i64
%arrayidx22.i = getelementptr inbounds [300050 x i32], ptr @heap, i64 0, i64 %idxprom21.i
%13 = load i32, ptr %arrayidx20.i, align 4, !tbaa !9
%14 = load i32, ptr %arrayidx22.i, align 4, !tbaa !9
store i32 %14, ptr %arrayidx20.i, align 4, !tbaa !9
store i32 %13, ptr %arrayidx22.i, align 4, !tbaa !9
br label %while.cond.i
dequeue_min.exit: ; preds = %if.end15.i
%sub = sub nsw i32 %4, %7
br label %if.end
if.end: ; preds = %dequeue_min.exit, %enqueue.exit43
%15 = phi i32 [ %3, %dequeue_min.exit ], [ %inc.i28, %enqueue.exit43 ]
%diff.0 = phi i32 [ %sub, %dequeue_min.exit ], [ %4, %enqueue.exit43 ]
%conv12 = sext i32 %diff.0 to i64
%add = add nsw i64 %2, %conv12
%arrayidx14 = getelementptr inbounds i64, ptr %sum, i64 %indvars.iv
store i64 %add, ptr %arrayidx14, align 8, !tbaa !15
%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 !17
for.end: ; preds = %if.end, %enqueue.exit
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%line.i48 = alloca [3300050 x i8], align 16
%num.i = alloca i32, align 4
%line.i = alloca [3300050 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i) #10
call void @llvm.lifetime.start.p0(i64 3300050, ptr nonnull %line.i) #10
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call ptr @fgets(ptr noundef nonnull %line.i, i32 noundef 3300050, ptr noundef %0)
%tobool.not.i = icmp eq ptr %call.i, null
br i1 %tobool.not.i, label %get_int.exit, label %if.end.i
if.end.i: ; preds = %entry
%call2.i = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line.i, ptr noundef nonnull @.str, ptr noundef nonnull %num.i) #10
%1 = load i32, ptr %num.i, align 4, !tbaa !9
br label %get_int.exit
get_int.exit: ; preds = %entry, %if.end.i
%retval.0.i = phi i32 [ %1, %if.end.i ], [ 0, %entry ]
call void @llvm.lifetime.end.p0(i64 3300050, ptr nonnull %line.i) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i) #10
%mul = mul i32 %retval.0.i, 3
call void @llvm.lifetime.start.p0(i64 3300050, ptr nonnull %line.i48) #10
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i49 = call ptr @fgets(ptr noundef nonnull %line.i48, i32 noundef 3300050, ptr noundef %2)
%tobool.not.i50 = icmp ne ptr %call.i49, null
%cmp8.i = icmp sgt i32 %retval.0.i, 0
%or.cond = select i1 %tobool.not.i50, i1 %cmp8.i, i1 false
br i1 %or.cond, label %for.body.preheader.i, label %fget_array.exit
for.body.preheader.i: ; preds = %get_int.exit
%wide.trip.count.i = zext i32 %mul to i64
%call2.peel.i = call ptr @strtok(ptr noundef nonnull %line.i48, ptr noundef nonnull @.str.1) #10
%call3.peel.i = call i64 @strtol(ptr nocapture noundef %call2.peel.i, ptr noundef null, i32 noundef 10) #10
%conv.peel.i = trunc i64 %call3.peel.i to i32
store i32 %conv.peel.i, ptr @main.arr, align 16, !tbaa !9
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 1, %for.body.preheader.i ]
%call2.i52 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.1) #10
%call3.i = call i64 @strtol(ptr nocapture noundef %call2.i52, ptr noundef null, i32 noundef 10) #10
%conv.i = trunc i64 %call3.i to i32
%arrayidx.i = getelementptr inbounds i32, ptr @main.arr, i64 %indvars.iv.i
store i32 %conv.i, ptr %arrayidx.i, 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, %wide.trip.count.i
br i1 %exitcond.not.i, label %fget_array.exit, label %for.body.i, !llvm.loop !11
fget_array.exit: ; preds = %for.body.i, %get_int.exit
call void @llvm.lifetime.end.p0(i64 3300050, ptr nonnull %line.i48) #10
br i1 %cmp8.i, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %fget_array.exit
%smax = call i32 @llvm.smax.i32(i32 %mul, i32 1)
%wide.trip.count = zext i32 %smax to i64
%min.iters.check = icmp ult i32 %smax, 12
br i1 %min.iters.check, label %for.body.preheader90, label %vector.scevcheck
vector.scevcheck: ; preds = %for.body.preheader
%3 = add nsw i64 %wide.trip.count, -1
%4 = add i32 %mul, -1
%5 = trunc i64 %3 to i32
%6 = sub i32 %4, %5
%7 = icmp sgt i32 %6, %4
%8 = icmp ugt i64 %3, 4294967295
%9 = or i1 %7, %8
br i1 %9, label %for.body.preheader90, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %wide.trip.count, 2147483640
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%offset.idx = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%10 = trunc i64 %offset.idx to i32
%11 = xor i32 %10, -1
%12 = add i32 %mul, %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [300000 x i32], ptr @main.arr, i64 0, i64 %13
%15 = getelementptr inbounds i32, ptr %14, i64 -3
%wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !9
%16 = getelementptr inbounds i32, ptr %14, i64 -7
%wide.load64 = load <4 x i32>, ptr %16, align 4, !tbaa !9
%17 = sub nsw <4 x i32> zeroinitializer, %wide.load
%18 = shufflevector <4 x i32> %17, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%19 = sub nsw <4 x i32> zeroinitializer, %wide.load64
%20 = shufflevector <4 x i32> %19, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%21 = getelementptr inbounds [300000 x i32], ptr @main.rarr, i64 0, i64 %offset.idx
store <4 x i32> %18, ptr %21, align 16, !tbaa !9
%22 = getelementptr inbounds i32, ptr %21, i64 4
store <4 x i32> %20, ptr %22, align 16, !tbaa !9
%index.next = add nuw i64 %offset.idx, 8
%23 = icmp eq i64 %index.next, %n.vec
br i1 %23, label %middle.block, label %vector.body, !llvm.loop !18
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.preheader90
for.body.preheader90: ; preds = %vector.scevcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%xtraiter = and i64 %wide.trip.count, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader90
%24 = trunc i64 %indvars.iv.ph to i32
%25 = xor i32 %24, -1
%sub2.prol = add i32 %mul, %25
%idxprom.prol = sext i32 %sub2.prol to i64
%arrayidx.prol = getelementptr inbounds [300000 x i32], ptr @main.arr, i64 0, i64 %idxprom.prol
%26 = load i32, ptr %arrayidx.prol, align 4, !tbaa !9
%sub3.prol = sub nsw i32 0, %26
%arrayidx5.prol = getelementptr inbounds [300000 x i32], ptr @main.rarr, i64 0, i64 %indvars.iv.ph
store i32 %sub3.prol, ptr %arrayidx5.prol, align 16, !tbaa !9
%indvars.iv.next.prol = or i64 %indvars.iv.ph, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader90
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader90 ], [ %indvars.iv.next.prol, %for.body.prol ]
%27 = sub nsw i64 0, %wide.trip.count
%28 = xor i64 %indvars.iv.ph, %27
%29 = icmp eq i64 %28, -1
br i1 %29, label %for.end, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%30 = trunc i64 %indvars.iv to i32
%31 = xor i32 %30, -1
%sub2 = add i32 %mul, %31
%idxprom = sext i32 %sub2 to i64
%arrayidx = getelementptr inbounds [300000 x i32], ptr @main.arr, i64 0, i64 %idxprom
%32 = load i32, ptr %arrayidx, align 4, !tbaa !9
%sub3 = sub nsw i32 0, %32
%arrayidx5 = getelementptr inbounds [300000 x i32], ptr @main.rarr, i64 0, i64 %indvars.iv
store i32 %sub3, ptr %arrayidx5, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%33 = trunc i64 %indvars.iv.next to i32
%34 = xor i32 %33, -1
%sub2.1 = add i32 %mul, %34
%idxprom.1 = sext i32 %sub2.1 to i64
%arrayidx.1 = getelementptr inbounds [300000 x i32], ptr @main.arr, i64 0, i64 %idxprom.1
%35 = load i32, ptr %arrayidx.1, align 4, !tbaa !9
%sub3.1 = sub nsw i32 0, %35
%arrayidx5.1 = getelementptr inbounds [300000 x i32], ptr @main.rarr, i64 0, i64 %indvars.iv.next
store i32 %sub3.1, ptr %arrayidx5.1, align 4, !tbaa !9
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !21
for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %fget_array.exit
call void @record(ptr noundef nonnull @main.arr, ptr noundef nonnull @main.sum, i32 noundef %retval.0.i)
call void @record(ptr noundef nonnull @main.rarr, ptr noundef nonnull @main.rsum, i32 noundef %retval.0.i)
%mul8 = shl nsw i32 %retval.0.i, 1
%cmp955.not = icmp sgt i32 %retval.0.i, %mul8
br i1 %cmp955.not, label %for.end27, label %for.body10.lr.ph
for.body10.lr.ph: ; preds = %for.end
%sub6 = add i32 %retval.0.i, -1
%sub13 = add nsw i32 %mul, -2
%36 = sext i32 %sub6 to i64
%37 = zext i32 %retval.0.i to i64
%38 = add nuw nsw i64 %37, 1
%min.iters.check72 = icmp ult i32 %retval.0.i, 7
br i1 %min.iters.check72, label %for.body10.preheader, label %vector.scevcheck66
vector.scevcheck66: ; preds = %for.body10.lr.ph
%39 = add i32 %mul8, -1
%40 = sub i32 %39, %retval.0.i
%41 = icmp sgt i32 %40, %39
br i1 %41, label %for.body10.preheader, label %vector.ph73
vector.ph73: ; preds = %vector.scevcheck66
%n.vec75 = and i64 %38, 8589934588
%ind.end = add nsw i64 %n.vec75, %36
br label %vector.body78
vector.body78: ; preds = %vector.body78, %vector.ph73
%index = phi i64 [ 0, %vector.ph73 ], [ %index.next88, %vector.body78 ]
%vec.phi = phi <2 x i64> [ <i64 -9223372036854775808, i64 -9223372036854775808>, %vector.ph73 ], [ %53, %vector.body78 ]
%vec.phi79 = phi <2 x i64> [ <i64 -9223372036854775808, i64 -9223372036854775808>, %vector.ph73 ], [ %54, %vector.body78 ]
%42 = trunc i64 %index to i32
%43 = add i32 %sub6, %42
%offset.idx81 = add i64 %index, %36
%44 = getelementptr inbounds [300000 x i64], ptr @main.sum, i64 0, i64 %offset.idx81
%wide.load82 = load <2 x i64>, ptr %44, align 8, !tbaa !15
%45 = getelementptr inbounds i64, ptr %44, i64 2
%wide.load83 = load <2 x i64>, ptr %45, align 8, !tbaa !15
%46 = sub i32 %sub13, %43
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [300000 x i64], ptr @main.rsum, i64 0, i64 %47
%49 = getelementptr inbounds i64, ptr %48, i64 -1
%wide.load84 = load <2 x i64>, ptr %49, align 8, !tbaa !15
%reverse85 = shufflevector <2 x i64> %wide.load84, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
%50 = getelementptr inbounds i64, ptr %48, i64 -3
%wide.load86 = load <2 x i64>, ptr %50, align 8, !tbaa !15
%reverse87 = shufflevector <2 x i64> %wide.load86, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
%51 = add nsw <2 x i64> %reverse85, %wide.load82
%52 = add nsw <2 x i64> %reverse87, %wide.load83
%53 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %51)
%54 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi79, <2 x i64> %52)
%index.next88 = add nuw i64 %index, 4
%55 = icmp eq i64 %index.next88, %n.vec75
br i1 %55, label %middle.block70, label %vector.body78, !llvm.loop !22
middle.block70: ; preds = %vector.body78
%rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %53, <2 x i64> %54)
%56 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n77 = icmp eq i64 %38, %n.vec75
br i1 %cmp.n77, label %for.end27, label %for.body10.preheader
for.body10.preheader: ; preds = %vector.scevcheck66, %for.body10.lr.ph, %middle.block70
%indvars.iv59.ph = phi i64 [ %36, %vector.scevcheck66 ], [ %36, %for.body10.lr.ph ], [ %ind.end, %middle.block70 ]
%ans.057.ph = phi i64 [ -9223372036854775808, %vector.scevcheck66 ], [ -9223372036854775808, %for.body10.lr.ph ], [ %56, %middle.block70 ]
%57 = trunc i64 %indvars.iv59.ph to i32
%.neg = add i32 %57, 1
%xtraiter91 = and i32 %57, 1
%lcmp.mod92.not = icmp eq i32 %xtraiter91, 0
br i1 %lcmp.mod92.not, label %for.body10.prol.loopexit, label %for.body10.prol
for.body10.prol: ; preds = %for.body10.preheader
%arrayidx12.prol = getelementptr inbounds [300000 x i64], ptr @main.sum, i64 0, i64 %indvars.iv59.ph
%58 = load i64, ptr %arrayidx12.prol, align 8, !tbaa !15
%59 = trunc i64 %indvars.iv59.ph to i32
%sub14.prol = sub i32 %sub13, %59
%idxprom15.prol = sext i32 %sub14.prol to i64
%arrayidx16.prol = getelementptr inbounds [300000 x i64], ptr @main.rsum, i64 0, i64 %idxprom15.prol
%60 = load i64, ptr %arrayidx16.prol, align 8, !tbaa !15
%add.prol = add nsw i64 %60, %58
%ans.0.add.prol = call i64 @llvm.smax.i64(i64 %ans.057.ph, i64 %add.prol)
%indvars.iv.next60.prol = add nsw i64 %indvars.iv59.ph, 1
br label %for.body10.prol.loopexit
for.body10.prol.loopexit: ; preds = %for.body10.prol, %for.body10.preheader
%ans.0.add.lcssa.unr = phi i64 [ undef, %for.body10.preheader ], [ %ans.0.add.prol, %for.body10.prol ]
%indvars.iv59.unr = phi i64 [ %indvars.iv59.ph, %for.body10.preheader ], [ %indvars.iv.next60.prol, %for.body10.prol ]
%ans.057.unr = phi i64 [ %ans.057.ph, %for.body10.preheader ], [ %ans.0.add.prol, %for.body10.prol ]
%61 = icmp eq i32 %mul8, %.neg
br i1 %61, label %for.end27, label %for.body10
for.body10: ; preds = %for.body10.prol.loopexit, %for.body10
%indvars.iv59 = phi i64 [ %indvars.iv.next60.1, %for.body10 ], [ %indvars.iv59.unr, %for.body10.prol.loopexit ]
%ans.057 = phi i64 [ %ans.0.add.1, %for.body10 ], [ %ans.057.unr, %for.body10.prol.loopexit ]
%arrayidx12 = getelementptr inbounds [300000 x i64], ptr @main.sum, i64 0, i64 %indvars.iv59
%62 = load i64, ptr %arrayidx12, align 8, !tbaa !15
%63 = trunc i64 %indvars.iv59 to i32
%sub14 = sub i32 %sub13, %63
%idxprom15 = sext i32 %sub14 to i64
%arrayidx16 = getelementptr inbounds [300000 x i64], ptr @main.rsum, i64 0, i64 %idxprom15
%64 = load i64, ptr %arrayidx16, align 8, !tbaa !15
%add = add nsw i64 %64, %62
%ans.0.add = call i64 @llvm.smax.i64(i64 %ans.057, i64 %add)
%indvars.iv.next60 = add nsw i64 %indvars.iv59, 1
%arrayidx12.1 = getelementptr inbounds [300000 x i64], ptr @main.sum, i64 0, i64 %indvars.iv.next60
%65 = load i64, ptr %arrayidx12.1, align 8, !tbaa !15
%66 = trunc i64 %indvars.iv.next60 to i32
%sub14.1 = sub i32 %sub13, %66
%idxprom15.1 = sext i32 %sub14.1 to i64
%arrayidx16.1 = getelementptr inbounds [300000 x i64], ptr @main.rsum, i64 0, i64 %idxprom15.1
%67 = load i64, ptr %arrayidx16.1, align 8, !tbaa !15
%add.1 = add nsw i64 %67, %65
%ans.0.add.1 = call i64 @llvm.smax.i64(i64 %ans.0.add, i64 %add.1)
%indvars.iv.next60.1 = add nsw i64 %indvars.iv59, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next60.1 to i32
%exitcond62.not.1 = icmp eq i32 %mul8, %lftr.wideiv.1
br i1 %exitcond62.not.1, label %for.end27, label %for.body10, !llvm.loop !23
for.end27: ; preds = %for.body10.prol.loopexit, %for.body10, %middle.block70, %for.end
%ans.0.lcssa = phi i64 [ -9223372036854775808, %for.end ], [ %56, %middle.block70 ], [ %ans.0.add.lcssa.unr, %for.body10.prol.loopexit ], [ %ans.0.add.1, %for.body10 ]
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
ret i32 0
}
; 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) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #9
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: 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 #6 = { 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 #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !12, !19}
!22 = distinct !{!22, !12, !19, !20}
!23 = distinct !{!23, !12, !19}
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main()
{
unsigned long long N;
char animalans[200000];
char animal[4][200002];
int A=0;
unsigned long long i;
unsigned long long j;
scanf("%llu",&N);
scanf("%s",animalans);
if(animalans[0]=='x')
{
animal[0][N+1]='S';
animal[0][0]='W';
animal[0][1]='S';
animal[1][N+1]='W';
animal[1][0]='W';
animal[1][1]='W';
animal[2][N+1]='W';
animal[2][0]='S';
animal[2][1]='S';
animal[3][N+1]='S';
animal[3][0]='S';
animal[3][1]='W';
}else{
animal[0][N+1]='W';
animal[0][0]='W';
animal[0][1]='S';
animal[1][N+1]='S';
animal[1][0]='W';
animal[1][1]='W';
animal[2][N+1]='S';
animal[2][0]='S';
animal[2][1]='S';
animal[3][N+1]='W';
animal[3][0]='S';
animal[3][1]='W';
}
for( i=1; i<N; i++)
{
if(animalans[i]=='x')
{
for( j=0; j<4; j++)
{
if((animal[j][i-1]=='W')&(animal[j][i]=='S')) animal[j][i+1]='S';
if((animal[j][i-1]=='W')&(animal[j][i]=='W')) animal[j][i+1]='W';
if((animal[j][i-1]=='S')&(animal[j][i]=='S')) animal[j][i+1]='W';
if((animal[j][i-1]=='S')&(animal[j][i]=='W')) animal[j][i+1]='S';
}
}else{
for( j=0; j<4; j++)
{
if((animal[j][i-1]=='W')&(animal[j][i]=='S')) animal[j][i+1]='W';
if((animal[j][i-1]=='W')&(animal[j][i]=='W')) animal[j][i+1]='S';
if((animal[j][i-1]=='S')&(animal[j][i]=='S')) animal[j][i+1]='S';
if((animal[j][i-1]=='S')&(animal[j][i]=='W')) animal[j][i+1]='W';
}
}
}
A=-1;
for(j=0; j<4; j++)
{
if((animal[j][N+1]==animal[j][N-1])&(animal[j][N]==animal[j][0]))
{
if((animalans[0]=='o')&(animal[j][0]=='S')&(animal[j][N-1]==animal[j][1])) A=j;
if((animalans[0]=='o')&(animal[j][0]=='W')&(animal[j][N-1]!=animal[j][1])) A=j;
if((animalans[0]=='x')&(animal[j][0]=='S')&(animal[j][N-1]!=animal[j][1])) A=j;
if((animalans[0]=='x')&(animal[j][0]=='W')&(animal[j][N-1]==animal[j][1])) A=j;
}
}
if(A==-1)
{
printf("%d",A);
}else{
for(i=0; i<N; i++) printf("%c",animal[A][i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188125/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188125/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%llu\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%animalans = alloca [200000 x i8], align 16
%animal = alloca [4 x [200002 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 200000, ptr nonnull %animalans) #4
call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %animal) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %animalans)
%0 = load i8, ptr %animalans, align 16, !tbaa !5
%cmp = icmp eq i8 %0, 120
%1 = load i64, ptr %N, align 8, !tbaa !8
%add = add i64 %1, 1
%arrayidx4 = getelementptr inbounds [200002 x i8], ptr %animal, i64 0, i64 %add
%arrayidx8 = getelementptr inbounds [200002 x i8], ptr %animal, i64 0, i64 1
%arrayidx9 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1
%arrayidx11 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %add
%arrayidx15 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 1
%arrayidx16 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2
%arrayidx18 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %add
%arrayidx22 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 1
%arrayidx25 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %add
%. = select i1 %cmp, i8 87, i8 83
%.551 = select i1 %cmp, i8 83, i8 87
store i8 %.551, ptr %arrayidx4, align 1, !tbaa !5
store i8 87, ptr %animal, align 16, !tbaa !5
store i8 83, ptr %arrayidx8, align 1, !tbaa !5
store i8 %., ptr %arrayidx11, align 1, !tbaa !5
store i8 87, ptr %arrayidx9, align 2, !tbaa !5
store i8 87, ptr %arrayidx15, align 1, !tbaa !5
store i8 %., ptr %arrayidx18, align 1, !tbaa !5
store i8 83, ptr %arrayidx16, align 4, !tbaa !5
store i8 83, ptr %arrayidx22, align 1, !tbaa !5
store i8 %.551, ptr %arrayidx25, align 1, !tbaa !5
%2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3
store i8 83, ptr %2, align 2
%3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 1
store i8 87, ptr %3, align 1
%cmp58465 = icmp ugt i64 %1, 1
br i1 %cmp58465, label %for.body, label %for.cond222.preheader
for.cond222.preheader: ; preds = %for.inc219, %entry
%add227 = add i64 %1, 1
%sub231 = add i64 %1, -1
%cmp249 = icmp eq i8 %0, 111
%arrayidx228 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %add227
%4 = load i8, ptr %arrayidx228, align 1, !tbaa !5
%arrayidx232 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %sub231
%5 = load i8, ptr %arrayidx232, align 1, !tbaa !5
%cmp234 = icmp eq i8 %4, %5
%arrayidx237 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %1
%6 = load i8, ptr %arrayidx237, align 1, !tbaa !5
%7 = load i8, ptr %animal, align 16, !tbaa !5
%cmp242 = icmp eq i8 %6, %7
%and244444 = and i1 %cmp234, %cmp242
br i1 %and244444, label %if.then246, label %for.inc344
for.body: ; preds = %entry, %for.inc219
%i.0466 = phi i64 [ %add81, %for.inc219 ], [ 1, %entry ]
%arrayidx60 = getelementptr inbounds [200000 x i8], ptr %animalans, i64 0, i64 %i.0466
%8 = load i8, ptr %arrayidx60, align 1, !tbaa !5
%cmp62 = icmp eq i8 %8, 120
%sub = add i64 %i.0466, -1
%add81 = add nuw i64 %i.0466, 1
%arrayidx70 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %sub
%9 = load i8, ptr %arrayidx70, align 1, !tbaa !5
%cmp72 = icmp eq i8 %9, 87
%arrayidx75 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %i.0466
%10 = load i8, ptr %arrayidx75, align 1, !tbaa !5
%cmp77 = icmp eq i8 %10, 83
%and457 = and i1 %cmp72, %cmp77
br i1 %cmp62, label %for.cond65.preheader, label %for.cond139.preheader
for.cond139.preheader: ; preds = %for.body
br i1 %and457, label %if.end196.sink.split, label %if.end160
for.cond65.preheader: ; preds = %for.body
br i1 %and457, label %if.end119.sink.split, label %if.end83
if.end83: ; preds = %for.cond65.preheader
%cmp93 = icmp eq i8 %10, 87
%and95458 = and i1 %cmp72, %cmp93
br i1 %and95458, label %if.end119.sink.split, label %if.end101
if.end101: ; preds = %if.end83
%cmp106 = icmp eq i8 %9, 83
%and113459 = and i1 %cmp106, %cmp77
br i1 %and113459, label %if.end119.sink.split, label %if.end119
if.end119.sink.split: ; preds = %if.end101, %for.cond65.preheader, %if.end83
%.sink542.sink = phi i8 [ 83, %for.cond65.preheader ], [ 87, %if.end83 ], [ 87, %if.end101 ]
%cmp106480.ph = phi i1 [ false, %for.cond65.preheader ], [ false, %if.end83 ], [ %cmp106, %if.end101 ]
%cmp93475479.ph = phi i1 [ false, %for.cond65.preheader ], [ %cmp93, %if.end83 ], [ %cmp93, %if.end101 ]
%arrayidx82 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %add81
store i8 %.sink542.sink, ptr %arrayidx82, align 1, !tbaa !5
br label %if.end119
if.end119: ; preds = %if.end119.sink.split, %if.end101
%cmp106480 = phi i1 [ %cmp106, %if.end101 ], [ %cmp106480.ph, %if.end119.sink.split ]
%cmp93475479 = phi i1 [ %cmp93, %if.end101 ], [ %cmp93475479.ph, %if.end119.sink.split ]
%and131460 = and i1 %cmp106480, %cmp93475479
br i1 %and131460, label %if.then133, label %for.inc
if.then133: ; preds = %if.end119
%arrayidx136 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %add81
store i8 83, ptr %arrayidx136, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end119, %if.then133
%arrayidx70.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %sub
%11 = load i8, ptr %arrayidx70.1, align 1, !tbaa !5
%cmp72.1 = icmp eq i8 %11, 87
%arrayidx75.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %i.0466
%12 = load i8, ptr %arrayidx75.1, align 1, !tbaa !5
%cmp77.1 = icmp eq i8 %12, 83
%and457.1 = and i1 %cmp72.1, %cmp77.1
br i1 %and457.1, label %if.end119.1.sink.split, label %if.end83.1
if.end83.1: ; preds = %for.inc
%cmp93.1 = icmp eq i8 %12, 87
%and95458.1 = and i1 %cmp72.1, %cmp93.1
br i1 %and95458.1, label %if.end119.1.sink.split, label %if.end101.1
if.end101.1: ; preds = %if.end83.1
%cmp106.1 = icmp eq i8 %11, 83
%and113459.1 = and i1 %cmp106.1, %cmp77.1
br i1 %and113459.1, label %if.end119.1.sink.split, label %if.end119.1
if.end119.1.sink.split: ; preds = %if.end101.1, %for.inc, %if.end83.1
%.sink543.sink = phi i8 [ 83, %for.inc ], [ 87, %if.end83.1 ], [ 87, %if.end101.1 ]
%cmp106.1488.ph = phi i1 [ false, %for.inc ], [ false, %if.end83.1 ], [ %cmp106.1, %if.end101.1 ]
%cmp93.1483487.ph = phi i1 [ false, %for.inc ], [ %cmp93.1, %if.end83.1 ], [ %cmp93.1, %if.end101.1 ]
%arrayidx82.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %add81
store i8 %.sink543.sink, ptr %arrayidx82.1, align 1, !tbaa !5
br label %if.end119.1
if.end119.1: ; preds = %if.end119.1.sink.split, %if.end101.1
%cmp106.1488 = phi i1 [ %cmp106.1, %if.end101.1 ], [ %cmp106.1488.ph, %if.end119.1.sink.split ]
%cmp93.1483487 = phi i1 [ %cmp93.1, %if.end101.1 ], [ %cmp93.1483487.ph, %if.end119.1.sink.split ]
%and131460.1 = and i1 %cmp106.1488, %cmp93.1483487
br i1 %and131460.1, label %if.then133.1, label %for.inc.1
if.then133.1: ; preds = %if.end119.1
%arrayidx136.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %add81
store i8 83, ptr %arrayidx136.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then133.1, %if.end119.1
%arrayidx70.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %sub
%13 = load i8, ptr %arrayidx70.2, align 1, !tbaa !5
%cmp72.2 = icmp eq i8 %13, 87
%arrayidx75.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %i.0466
%14 = load i8, ptr %arrayidx75.2, align 1, !tbaa !5
%cmp77.2 = icmp eq i8 %14, 83
%and457.2 = and i1 %cmp72.2, %cmp77.2
br i1 %and457.2, label %if.end119.2.sink.split, label %if.end83.2
if.end83.2: ; preds = %for.inc.1
%cmp93.2 = icmp eq i8 %14, 87
%and95458.2 = and i1 %cmp72.2, %cmp93.2
br i1 %and95458.2, label %if.end119.2.sink.split, label %if.end101.2
if.end101.2: ; preds = %if.end83.2
%cmp106.2 = icmp eq i8 %13, 83
%and113459.2 = and i1 %cmp106.2, %cmp77.2
br i1 %and113459.2, label %if.end119.2.sink.split, label %if.end119.2
if.end119.2.sink.split: ; preds = %if.end101.2, %for.inc.1, %if.end83.2
%.sink544.sink = phi i8 [ 83, %for.inc.1 ], [ 87, %if.end83.2 ], [ 87, %if.end101.2 ]
%cmp106.2496.ph = phi i1 [ false, %for.inc.1 ], [ false, %if.end83.2 ], [ %cmp106.2, %if.end101.2 ]
%cmp93.2491495.ph = phi i1 [ false, %for.inc.1 ], [ %cmp93.2, %if.end83.2 ], [ %cmp93.2, %if.end101.2 ]
%arrayidx82.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %add81
store i8 %.sink544.sink, ptr %arrayidx82.2, align 1, !tbaa !5
br label %if.end119.2
if.end119.2: ; preds = %if.end119.2.sink.split, %if.end101.2
%cmp106.2496 = phi i1 [ %cmp106.2, %if.end101.2 ], [ %cmp106.2496.ph, %if.end119.2.sink.split ]
%cmp93.2491495 = phi i1 [ %cmp93.2, %if.end101.2 ], [ %cmp93.2491495.ph, %if.end119.2.sink.split ]
%and131460.2 = and i1 %cmp106.2496, %cmp93.2491495
br i1 %and131460.2, label %if.then133.2, label %for.inc.2
if.then133.2: ; preds = %if.end119.2
%arrayidx136.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %add81
store i8 83, ptr %arrayidx136.2, align 1, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then133.2, %if.end119.2
%arrayidx70.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %sub
%15 = load i8, ptr %arrayidx70.3, align 1, !tbaa !5
%cmp72.3 = icmp eq i8 %15, 87
%arrayidx75.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %i.0466
%16 = load i8, ptr %arrayidx75.3, align 1, !tbaa !5
%cmp77.3 = icmp eq i8 %16, 83
%and457.3 = and i1 %cmp72.3, %cmp77.3
br i1 %and457.3, label %if.end119.3.sink.split, label %if.end83.3
if.end83.3: ; preds = %for.inc.2
%cmp93.3 = icmp eq i8 %16, 87
%and95458.3 = and i1 %cmp72.3, %cmp93.3
br i1 %and95458.3, label %if.end119.3.sink.split, label %if.end101.3
if.end101.3: ; preds = %if.end83.3
%cmp106.3 = icmp eq i8 %15, 83
%and113459.3 = and i1 %cmp106.3, %cmp77.3
br i1 %and113459.3, label %if.end119.3.sink.split, label %if.end119.3
if.end119.3.sink.split: ; preds = %if.end101.3, %for.inc.2, %if.end83.3
%.sink545.sink = phi i8 [ 83, %for.inc.2 ], [ 87, %if.end83.3 ], [ 87, %if.end101.3 ]
%cmp106.3504.ph = phi i1 [ false, %for.inc.2 ], [ false, %if.end83.3 ], [ %cmp106.3, %if.end101.3 ]
%cmp93.3499503.ph = phi i1 [ false, %for.inc.2 ], [ %cmp93.3, %if.end83.3 ], [ %cmp93.3, %if.end101.3 ]
%arrayidx82.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %add81
store i8 %.sink545.sink, ptr %arrayidx82.3, align 1, !tbaa !5
br label %if.end119.3
if.end119.3: ; preds = %if.end119.3.sink.split, %if.end101.3
%cmp106.3504 = phi i1 [ %cmp106.3, %if.end101.3 ], [ %cmp106.3504.ph, %if.end119.3.sink.split ]
%cmp93.3499503 = phi i1 [ %cmp93.3, %if.end101.3 ], [ %cmp93.3499503.ph, %if.end119.3.sink.split ]
%and131460.3 = and i1 %cmp106.3504, %cmp93.3499503
br i1 %and131460.3, label %for.inc219.sink.split, label %for.inc219
if.end160: ; preds = %for.cond139.preheader
%cmp170 = icmp eq i8 %10, 87
%and172454 = and i1 %cmp72, %cmp170
br i1 %and172454, label %if.end196.sink.split, label %if.end178
if.end178: ; preds = %if.end160
%cmp183 = icmp eq i8 %9, 83
%and190455 = and i1 %cmp183, %cmp77
br i1 %and190455, label %if.end196.sink.split, label %if.end196
if.end196.sink.split: ; preds = %if.end178, %for.cond139.preheader, %if.end160
%.sink546.sink = phi i8 [ 87, %for.cond139.preheader ], [ 83, %if.end160 ], [ 83, %if.end178 ]
%cmp183512.ph = phi i1 [ false, %for.cond139.preheader ], [ false, %if.end160 ], [ %cmp183, %if.end178 ]
%cmp170507511.ph = phi i1 [ false, %for.cond139.preheader ], [ %cmp170, %if.end160 ], [ %cmp170, %if.end178 ]
%arrayidx159 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %add81
store i8 %.sink546.sink, ptr %arrayidx159, align 1, !tbaa !5
br label %if.end196
if.end196: ; preds = %if.end196.sink.split, %if.end178
%cmp183512 = phi i1 [ %cmp183, %if.end178 ], [ %cmp183512.ph, %if.end196.sink.split ]
%cmp170507511 = phi i1 [ %cmp170, %if.end178 ], [ %cmp170507511.ph, %if.end196.sink.split ]
%and208456 = and i1 %cmp183512, %cmp170507511
br i1 %and208456, label %if.then210, label %for.inc215
if.then210: ; preds = %if.end196
%arrayidx213 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 %add81
store i8 87, ptr %arrayidx213, align 1, !tbaa !5
br label %for.inc215
for.inc215: ; preds = %if.end196, %if.then210
%arrayidx145.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %sub
%17 = load i8, ptr %arrayidx145.1, align 1, !tbaa !5
%cmp147.1 = icmp eq i8 %17, 87
%arrayidx150.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %i.0466
%18 = load i8, ptr %arrayidx150.1, align 1, !tbaa !5
%cmp152.1 = icmp eq i8 %18, 83
%and154453.1 = and i1 %cmp147.1, %cmp152.1
br i1 %and154453.1, label %if.end196.1.sink.split, label %if.end160.1
if.end160.1: ; preds = %for.inc215
%cmp170.1 = icmp eq i8 %18, 87
%and172454.1 = and i1 %cmp147.1, %cmp170.1
br i1 %and172454.1, label %if.end196.1.sink.split, label %if.end178.1
if.end178.1: ; preds = %if.end160.1
%cmp183.1 = icmp eq i8 %17, 83
%and190455.1 = and i1 %cmp183.1, %cmp152.1
br i1 %and190455.1, label %if.end196.1.sink.split, label %if.end196.1
if.end196.1.sink.split: ; preds = %if.end178.1, %for.inc215, %if.end160.1
%.sink547.sink = phi i8 [ 87, %for.inc215 ], [ 83, %if.end160.1 ], [ 83, %if.end178.1 ]
%cmp183.1520.ph = phi i1 [ false, %for.inc215 ], [ false, %if.end160.1 ], [ %cmp183.1, %if.end178.1 ]
%cmp170.1515519.ph = phi i1 [ false, %for.inc215 ], [ %cmp170.1, %if.end160.1 ], [ %cmp170.1, %if.end178.1 ]
%arrayidx159.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %add81
store i8 %.sink547.sink, ptr %arrayidx159.1, align 1, !tbaa !5
br label %if.end196.1
if.end196.1: ; preds = %if.end196.1.sink.split, %if.end178.1
%cmp183.1520 = phi i1 [ %cmp183.1, %if.end178.1 ], [ %cmp183.1520.ph, %if.end196.1.sink.split ]
%cmp170.1515519 = phi i1 [ %cmp170.1, %if.end178.1 ], [ %cmp170.1515519.ph, %if.end196.1.sink.split ]
%and208456.1 = and i1 %cmp183.1520, %cmp170.1515519
br i1 %and208456.1, label %if.then210.1, label %for.inc215.1
if.then210.1: ; preds = %if.end196.1
%arrayidx213.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %add81
store i8 87, ptr %arrayidx213.1, align 1, !tbaa !5
br label %for.inc215.1
for.inc215.1: ; preds = %if.then210.1, %if.end196.1
%arrayidx145.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %sub
%19 = load i8, ptr %arrayidx145.2, align 1, !tbaa !5
%cmp147.2 = icmp eq i8 %19, 87
%arrayidx150.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %i.0466
%20 = load i8, ptr %arrayidx150.2, align 1, !tbaa !5
%cmp152.2 = icmp eq i8 %20, 83
%and154453.2 = and i1 %cmp147.2, %cmp152.2
br i1 %and154453.2, label %if.end196.2.sink.split, label %if.end160.2
if.end160.2: ; preds = %for.inc215.1
%cmp170.2 = icmp eq i8 %20, 87
%and172454.2 = and i1 %cmp147.2, %cmp170.2
br i1 %and172454.2, label %if.end196.2.sink.split, label %if.end178.2
if.end178.2: ; preds = %if.end160.2
%cmp183.2 = icmp eq i8 %19, 83
%and190455.2 = and i1 %cmp183.2, %cmp152.2
br i1 %and190455.2, label %if.end196.2.sink.split, label %if.end196.2
if.end196.2.sink.split: ; preds = %if.end178.2, %for.inc215.1, %if.end160.2
%.sink548.sink = phi i8 [ 87, %for.inc215.1 ], [ 83, %if.end160.2 ], [ 83, %if.end178.2 ]
%cmp183.2528.ph = phi i1 [ false, %for.inc215.1 ], [ false, %if.end160.2 ], [ %cmp183.2, %if.end178.2 ]
%cmp170.2523527.ph = phi i1 [ false, %for.inc215.1 ], [ %cmp170.2, %if.end160.2 ], [ %cmp170.2, %if.end178.2 ]
%arrayidx159.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %add81
store i8 %.sink548.sink, ptr %arrayidx159.2, align 1, !tbaa !5
br label %if.end196.2
if.end196.2: ; preds = %if.end196.2.sink.split, %if.end178.2
%cmp183.2528 = phi i1 [ %cmp183.2, %if.end178.2 ], [ %cmp183.2528.ph, %if.end196.2.sink.split ]
%cmp170.2523527 = phi i1 [ %cmp170.2, %if.end178.2 ], [ %cmp170.2523527.ph, %if.end196.2.sink.split ]
%and208456.2 = and i1 %cmp183.2528, %cmp170.2523527
br i1 %and208456.2, label %if.then210.2, label %for.inc215.2
if.then210.2: ; preds = %if.end196.2
%arrayidx213.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %add81
store i8 87, ptr %arrayidx213.2, align 1, !tbaa !5
br label %for.inc215.2
for.inc215.2: ; preds = %if.then210.2, %if.end196.2
%arrayidx145.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %sub
%21 = load i8, ptr %arrayidx145.3, align 1, !tbaa !5
%cmp147.3 = icmp eq i8 %21, 87
%arrayidx150.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %i.0466
%22 = load i8, ptr %arrayidx150.3, align 1, !tbaa !5
%cmp152.3 = icmp eq i8 %22, 83
%and154453.3 = and i1 %cmp147.3, %cmp152.3
br i1 %and154453.3, label %if.end196.3.sink.split, label %if.end160.3
if.end160.3: ; preds = %for.inc215.2
%cmp170.3 = icmp eq i8 %22, 87
%and172454.3 = and i1 %cmp147.3, %cmp170.3
br i1 %and172454.3, label %if.end196.3.sink.split, label %if.end178.3
if.end178.3: ; preds = %if.end160.3
%cmp183.3 = icmp eq i8 %21, 83
%and190455.3 = and i1 %cmp183.3, %cmp152.3
br i1 %and190455.3, label %if.end196.3.sink.split, label %if.end196.3
if.end196.3.sink.split: ; preds = %if.end178.3, %for.inc215.2, %if.end160.3
%.sink549.sink = phi i8 [ 87, %for.inc215.2 ], [ 83, %if.end160.3 ], [ 83, %if.end178.3 ]
%cmp183.3536.ph = phi i1 [ false, %for.inc215.2 ], [ false, %if.end160.3 ], [ %cmp183.3, %if.end178.3 ]
%cmp170.3531535.ph = phi i1 [ false, %for.inc215.2 ], [ %cmp170.3, %if.end160.3 ], [ %cmp170.3, %if.end178.3 ]
%arrayidx159.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %add81
store i8 %.sink549.sink, ptr %arrayidx159.3, align 1, !tbaa !5
br label %if.end196.3
if.end196.3: ; preds = %if.end196.3.sink.split, %if.end178.3
%cmp183.3536 = phi i1 [ %cmp183.3, %if.end178.3 ], [ %cmp183.3536.ph, %if.end196.3.sink.split ]
%cmp170.3531535 = phi i1 [ %cmp170.3, %if.end178.3 ], [ %cmp170.3531535.ph, %if.end196.3.sink.split ]
%and208456.3 = and i1 %cmp183.3536, %cmp170.3531535
br i1 %and208456.3, label %for.inc219.sink.split, label %for.inc219
for.inc219.sink.split: ; preds = %if.end196.3, %if.end119.3
%.sink550 = phi i8 [ 83, %if.end119.3 ], [ 87, %if.end196.3 ]
%arrayidx213.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %add81
store i8 %.sink550, ptr %arrayidx213.3, align 1, !tbaa !5
br label %for.inc219
for.inc219: ; preds = %for.inc219.sink.split, %if.end196.3, %if.end119.3
%exitcond.not = icmp eq i64 %add81, %1
br i1 %exitcond.not, label %for.cond222.preheader, label %for.body, !llvm.loop !10
if.then246: ; preds = %for.cond222.preheader
%cmp254 = icmp eq i8 %6, 83
%and256445 = and i1 %cmp249, %cmp254
%arrayidx262 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 0, i64 1
%23 = load i8, ptr %arrayidx262, align 1, !tbaa !5
%cmp264 = icmp eq i8 %4, %23
%and266446 = and i1 %and256445, %cmp264
%cmp278 = icmp eq i8 %6, 87
%and280447 = and i1 %cmp249, %cmp278
%cmp288 = icmp ne i8 %4, %23
%and290448 = and i1 %and280447, %cmp288
%24 = or i1 %and290448, %and266446
%and304449 = and i1 %cmp, %cmp254
%and314450 = and i1 %and304449, %cmp288
%and328451 = and i1 %cmp, %cmp278
%and338452 = and i1 %and328451, %cmp264
%25 = or i1 %and338452, %and314450
%26 = or i1 %25, %24
%not. = xor i1 %26, true
%spec.select461 = sext i1 %not. to i32
br label %for.inc344
for.inc344: ; preds = %if.then246, %for.cond222.preheader
%A.4 = phi i32 [ -1, %for.cond222.preheader ], [ %spec.select461, %if.then246 ]
%arrayidx226.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1
%arrayidx228.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %add227
%27 = load i8, ptr %arrayidx228.1, align 1, !tbaa !5
%arrayidx232.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %sub231
%28 = load i8, ptr %arrayidx232.1, align 1, !tbaa !5
%cmp234.1 = icmp eq i8 %27, %28
%arrayidx237.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 %1
%29 = load i8, ptr %arrayidx237.1, align 1, !tbaa !5
%30 = load i8, ptr %arrayidx226.1, align 2, !tbaa !5
%cmp242.1 = icmp eq i8 %29, %30
%and244444.1 = and i1 %cmp234.1, %cmp242.1
br i1 %and244444.1, label %if.then246.1, label %for.inc344.1
if.then246.1: ; preds = %for.inc344
%cmp254.1 = icmp eq i8 %29, 83
%and256445.1 = and i1 %cmp249, %cmp254.1
%arrayidx262.1 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 1, i64 1
%31 = load i8, ptr %arrayidx262.1, align 1, !tbaa !5
%cmp264.1 = icmp eq i8 %27, %31
%and266446.1 = and i1 %and256445.1, %cmp264.1
%cmp278.1 = icmp eq i8 %29, 87
%and280447.1 = and i1 %cmp249, %cmp278.1
%cmp288.1 = icmp ne i8 %27, %31
%and290448.1 = and i1 %and280447.1, %cmp288.1
%32 = or i1 %and290448.1, %and266446.1
%and304449.1 = and i1 %cmp, %cmp254.1
%and314450.1 = and i1 %and304449.1, %cmp288.1
%and328451.1 = and i1 %cmp, %cmp278.1
%and338452.1 = and i1 %and328451.1, %cmp264.1
%33 = or i1 %and338452.1, %and314450.1
%34 = or i1 %33, %32
%spec.select461.1 = select i1 %34, i32 1, i32 %A.4
br label %for.inc344.1
for.inc344.1: ; preds = %if.then246.1, %for.inc344
%A.4.1 = phi i32 [ %A.4, %for.inc344 ], [ %spec.select461.1, %if.then246.1 ]
%arrayidx226.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2
%arrayidx228.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %add227
%35 = load i8, ptr %arrayidx228.2, align 1, !tbaa !5
%arrayidx232.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %sub231
%36 = load i8, ptr %arrayidx232.2, align 1, !tbaa !5
%cmp234.2 = icmp eq i8 %35, %36
%arrayidx237.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 %1
%37 = load i8, ptr %arrayidx237.2, align 1, !tbaa !5
%38 = load i8, ptr %arrayidx226.2, align 4, !tbaa !5
%cmp242.2 = icmp eq i8 %37, %38
%and244444.2 = and i1 %cmp234.2, %cmp242.2
br i1 %and244444.2, label %if.then246.2, label %for.inc344.2
if.then246.2: ; preds = %for.inc344.1
%cmp254.2 = icmp eq i8 %37, 83
%and256445.2 = and i1 %cmp249, %cmp254.2
%arrayidx262.2 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 2, i64 1
%39 = load i8, ptr %arrayidx262.2, align 1, !tbaa !5
%cmp264.2 = icmp eq i8 %35, %39
%and266446.2 = and i1 %and256445.2, %cmp264.2
%cmp278.2 = icmp eq i8 %37, 87
%and280447.2 = and i1 %cmp249, %cmp278.2
%cmp288.2 = icmp ne i8 %35, %39
%and290448.2 = and i1 %and280447.2, %cmp288.2
%40 = or i1 %and290448.2, %and266446.2
%and304449.2 = and i1 %cmp, %cmp254.2
%and314450.2 = and i1 %and304449.2, %cmp288.2
%and328451.2 = and i1 %cmp, %cmp278.2
%and338452.2 = and i1 %and328451.2, %cmp264.2
%41 = or i1 %and338452.2, %and314450.2
%42 = or i1 %41, %40
%spec.select461.2 = select i1 %42, i32 2, i32 %A.4.1
br label %for.inc344.2
for.inc344.2: ; preds = %if.then246.2, %for.inc344.1
%A.4.2 = phi i32 [ %A.4.1, %for.inc344.1 ], [ %spec.select461.2, %if.then246.2 ]
%arrayidx228.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %add227
%43 = load i8, ptr %arrayidx228.3, align 1, !tbaa !5
%arrayidx232.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %sub231
%44 = load i8, ptr %arrayidx232.3, align 1, !tbaa !5
%cmp234.3 = icmp eq i8 %43, %44
%arrayidx237.3 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 3, i64 %1
%45 = load i8, ptr %arrayidx237.3, align 1, !tbaa !5
%46 = load i8, ptr %2, align 2, !tbaa !5
%cmp242.3 = icmp eq i8 %45, %46
%and244444.3 = and i1 %cmp234.3, %cmp242.3
br i1 %and244444.3, label %if.then246.3, label %for.inc344.3
if.then246.3: ; preds = %for.inc344.2
%cmp254.3 = icmp eq i8 %45, 83
%and256445.3 = and i1 %cmp249, %cmp254.3
%47 = load i8, ptr %3, align 1, !tbaa !5
%cmp264.3 = icmp eq i8 %43, %47
%and266446.3 = and i1 %and256445.3, %cmp264.3
%cmp278.3 = icmp eq i8 %45, 87
%and280447.3 = and i1 %cmp249, %cmp278.3
%cmp288.3 = icmp ne i8 %43, %47
%and290448.3 = and i1 %and280447.3, %cmp288.3
%48 = or i1 %and290448.3, %and266446.3
%and304449.3 = and i1 %cmp, %cmp254.3
%and314450.3 = and i1 %and304449.3, %cmp288.3
%and328451.3 = and i1 %cmp, %cmp278.3
%and338452.3 = and i1 %and328451.3, %cmp264.3
%49 = or i1 %and338452.3, %and314450.3
%50 = or i1 %49, %48
br i1 %50, label %for.cond352.preheader, label %for.inc344.3
for.inc344.3: ; preds = %if.then246.3, %for.inc344.2
%cmp347 = icmp eq i32 %A.4.2, -1
br i1 %cmp347, label %if.then349, label %for.cond352.preheader
for.cond352.preheader: ; preds = %if.then246.3, %for.inc344.3
%A.4.3539 = phi i32 [ %A.4.2, %for.inc344.3 ], [ 3, %if.then246.3 ]
%cmp353469.not = icmp eq i64 %1, 0
br i1 %cmp353469.not, label %if.end363, label %for.body355.lr.ph
for.body355.lr.ph: ; preds = %for.cond352.preheader
%idxprom = zext i32 %A.4.3539 to i64
br label %for.body355
if.then349: ; preds = %for.inc344.3
%call350 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef -1)
br label %if.end363
for.body355: ; preds = %for.body355.lr.ph, %for.body355
%i.1470 = phi i64 [ 0, %for.body355.lr.ph ], [ %inc361, %for.body355 ]
%arrayidx357 = getelementptr inbounds [4 x [200002 x i8]], ptr %animal, i64 0, i64 %idxprom, i64 %i.1470
%51 = load i8, ptr %arrayidx357, align 1, !tbaa !5
%conv358 = sext i8 %51 to i32
%putchar = call i32 @putchar(i32 %conv358)
%inc361 = add nuw i64 %i.1470, 1
%52 = load i64, ptr %N, align 8, !tbaa !8
%cmp353 = icmp ult i64 %inc361, %52
br i1 %cmp353, label %for.body355, label %if.end363, !llvm.loop !12
if.end363: ; preds = %for.body355, %for.cond352.preheader, %if.then349
call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %animal) #4
call void @llvm.lifetime.end.p0(i64 200000, ptr nonnull %animalans) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main(void)
{
int n,i,t,c1,t1,min=1001;
scanf("%d%d",&n,&t);
for(i+0;i<n;i++){
scanf("%d%d",&c1,&t1);
if(t1<=t && c1<min)
min=c1;
}
if(min==1001)
printf("TLE");
else
printf("%d",min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188169/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188169/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"TLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
if.end8:
%n = alloca i32, align 4
%t = 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 %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t)
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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)"}
|
#include<stdio.h>
int main()
{
int n, t; scanf("%d%d", &n, &t);
int C[n], T[n];
int i;
int bkt[1001];
int check = 0;
for(i = 1; i < 1001; i++){
bkt[i] = 1000;
}
for(i = 0; i < n; i++){
scanf("%d", &C[i]);
scanf("%d", &T[i]);
bkt[C[i]] = T[i];
}
for(i = 1; i < 1001; i++){
if(bkt[i] <= t){
check = 1;
printf("%d\n", i);
break;
}
}
if(check == 0){
puts("TLE");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188211/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188211/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"TLE\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
%bkt = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t)
%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
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %bkt) #4
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.4, %vector.body ]
%offset.idx = or i64 %index, 1
%5 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %offset.idx
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %6, align 4, !tbaa !5
%offset.idx.1 = add nuw i64 %index, 9
%7 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %offset.idx.1
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %8, align 4, !tbaa !5
%offset.idx.2 = add nuw i64 %index, 17
%9 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %offset.idx.2
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %9, align 4, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %10, align 4, !tbaa !5
%offset.idx.3 = add nuw i64 %index, 25
%11 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %offset.idx.3
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %11, align 4, !tbaa !5
%12 = getelementptr inbounds i32, ptr %11, i64 4
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %12, align 4, !tbaa !5
%offset.idx.4 = add nuw i64 %index, 33
%13 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %offset.idx.4
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %13, align 4, !tbaa !5
%14 = getelementptr inbounds i32, ptr %13, i64 4
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %14, align 4, !tbaa !5
%index.next.4 = add nuw nsw i64 %index, 40
%15 = icmp eq i64 %index.next.4, 1000
br i1 %15, label %for.cond2.preheader, label %vector.body, !llvm.loop !9
for.cond2.preheader: ; preds = %vector.body
%cmp348 = icmp sgt i32 %3, 0
br i1 %cmp348, label %for.body4, label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.body4, %for.cond2.preheader
%16 = load i32, ptr %t, align 4, !tbaa !5
br label %for.body22
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv53
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%arrayidx9 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv53
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9)
%17 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%18 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%idxprom15 = sext i32 %18 to i64
%arrayidx16 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %idxprom15
store i32 %17, ptr %arrayidx16, align 4, !tbaa !5
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%19 = load i32, ptr %n, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp3 = icmp slt i64 %indvars.iv.next54, %20
br i1 %cmp3, label %for.body4, label %for.cond20.preheader, !llvm.loop !13
for.body22: ; preds = %for.inc27.4, %for.cond20.preheader
%indvars.iv56 = phi i64 [ 1, %for.cond20.preheader ], [ %indvars.iv.next57.4, %for.inc27.4 ]
%arrayidx24 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %indvars.iv56
%21 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%cmp25.not = icmp sgt i32 %21, %16
br i1 %cmp25.not, label %for.inc27, label %if.then
if.then: ; preds = %for.inc27.3, %for.inc27.2, %for.inc27.1, %for.inc27, %for.body22
%indvars.iv56.lcssa = phi i64 [ %indvars.iv56, %for.body22 ], [ %indvars.iv.next57, %for.inc27 ], [ %indvars.iv.next57.1, %for.inc27.1 ], [ %indvars.iv.next57.2, %for.inc27.2 ], [ %indvars.iv.next57.3, %for.inc27.3 ]
%22 = trunc i64 %indvars.iv56.lcssa to i32
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
br label %if.end33
for.inc27: ; preds = %for.body22
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%arrayidx24.1 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %indvars.iv.next57
%23 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5
%cmp25.not.1 = icmp sgt i32 %23, %16
br i1 %cmp25.not.1, label %for.inc27.1, label %if.then
for.inc27.1: ; preds = %for.inc27
%indvars.iv.next57.1 = add nuw nsw i64 %indvars.iv56, 2
%arrayidx24.2 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %indvars.iv.next57.1
%24 = load i32, ptr %arrayidx24.2, align 4, !tbaa !5
%cmp25.not.2 = icmp sgt i32 %24, %16
br i1 %cmp25.not.2, label %for.inc27.2, label %if.then
for.inc27.2: ; preds = %for.inc27.1
%indvars.iv.next57.2 = add nuw nsw i64 %indvars.iv56, 3
%arrayidx24.3 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %indvars.iv.next57.2
%25 = load i32, ptr %arrayidx24.3, align 4, !tbaa !5
%cmp25.not.3 = icmp sgt i32 %25, %16
br i1 %cmp25.not.3, label %for.inc27.3, label %if.then
for.inc27.3: ; preds = %for.inc27.2
%indvars.iv.next57.3 = add nuw nsw i64 %indvars.iv56, 4
%arrayidx24.4 = getelementptr inbounds [1001 x i32], ptr %bkt, i64 0, i64 %indvars.iv.next57.3
%26 = load i32, ptr %arrayidx24.4, align 4, !tbaa !5
%cmp25.not.4 = icmp sgt i32 %26, %16
br i1 %cmp25.not.4, label %for.inc27.4, label %if.then
for.inc27.4: ; preds = %for.inc27.3
%indvars.iv.next57.4 = add nuw nsw i64 %indvars.iv56, 5
%exitcond59.4 = icmp eq i64 %indvars.iv.next57.4, 1001
br i1 %exitcond59.4, label %if.then31, label %for.body22, !llvm.loop !14
if.then31: ; preds = %for.inc27.4
%call32 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end33
if.end33: ; preds = %if.then, %if.then31
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %bkt) #4
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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}
|
#include <stdio.h>
int main()
{
int N, T;
int c[101];
int t[101];
int min = 100;
c[min] = 100000000;
scanf("%d %d", &N, &T);
for (int i = 0; i < N; i++) {
scanf("%d %d", &c[i], &t[i]);
if (t[i] <= T && c[i] < c[min])
min = i;
}
if (min == 100)
puts("TLE");
else
printf("%d\n", c[min]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188255/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188255/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"TLE\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%T = alloca i32, align 4
%c = alloca [101 x i32], align 16
%t = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %t) #3
%arrayidx = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 100
store i32 100000000, ptr %arrayidx, align 16, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %T)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %0, 0
br i1 %cmp30, label %for.body, label %if.then15
for.cond.cleanup: ; preds = %for.inc
%cmp14 = icmp eq i32 %min.1, 100
br i1 %cmp14, label %if.then15, label %if.else
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%min.031 = phi i32 [ %min.1, %for.inc ], [ 100, %entry ]
%arrayidx2 = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [101 x i32], ptr %t, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%2 = load i32, ptr %T, align 4, !tbaa !5
%cmp8.not = icmp sgt i32 %1, %2
br i1 %cmp8.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%idxprom11 = sext i32 %min.031 to i64
%arrayidx12 = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %idxprom11
%4 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp slt i32 %3, %4
%5 = trunc i64 %indvars.iv to i32
%spec.select = select i1 %cmp13, i32 %5, i32 %min.031
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body
%min.1 = phi i32 [ %min.031, %for.body ], [ %spec.select, %land.lhs.true ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then15: ; preds = %entry, %for.cond.cleanup
%call16 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end20
if.else: ; preds = %for.cond.cleanup
%idxprom17 = sext i32 %min.1 to i64
%arrayidx18 = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %idxprom17
%8 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
br label %if.end20
if.end20: ; preds = %if.else, %if.then15
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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,T;
scanf("%d %d",&N,&T);
/* N,Tで最初の時間とコストを入力*/
int cost[N],time[N],i;
for(i=0;i<N;i++){
scanf("%d %d",&cost[i],&time[i]);
//cost,timeのリストを入力
}
int k,mincost = cost[0],flag=0;
for(k=0;k<N;k++){
if(time[k] <= T){
//timeがTより小さい場合、次の処理を実行する
if(cost[k] <= mincost){
//costがmincostより小さいならば、mincostが更新される
mincost = cost[k];
}
flag++;
}
}
if(flag == 0){
printf("TLE");
}else{
printf("%d",mincost);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188305/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188305/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"TLE\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%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 %N, ptr noundef nonnull %T)
%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
%cmp37 = icmp sgt i32 %3, 0
br i1 %cmp37, label %for.body, label %if.then24
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
%arrayidx3 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%cmp739 = icmp sgt i32 %5, 0
br i1 %cmp739, label %for.body8.lr.ph, label %if.then24
for.body8.lr.ph: ; preds = %for.end
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%7 = load i32, ptr %T, align 4, !tbaa !5
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 1
%8 = icmp eq i32 %5, 1
br i1 %8, label %for.end22.unr-lcssa, label %for.body8.lr.ph.new
for.body8.lr.ph.new: ; preds = %for.body8.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body8
for.body8: ; preds = %for.inc20.1, %for.body8.lr.ph.new
%indvars.iv47 = phi i64 [ 0, %for.body8.lr.ph.new ], [ %indvars.iv.next48.1, %for.inc20.1 ]
%flag.042 = phi i32 [ 0, %for.body8.lr.ph.new ], [ %flag.1.1, %for.inc20.1 ]
%mincost.041 = phi i32 [ %.pre, %for.body8.lr.ph.new ], [ %mincost.2.1, %for.inc20.1 ]
%niter = phi i64 [ 0, %for.body8.lr.ph.new ], [ %niter.next.1, %for.inc20.1 ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv47
%9 = load i32, ptr %arrayidx10, align 8, !tbaa !5
%cmp11.not = icmp sgt i32 %9, %7
br i1 %cmp11.not, label %for.inc20, label %if.then
if.then: ; preds = %for.body8
%arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv47
%10 = load i32, ptr %arrayidx13, align 8, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %10, i32 %mincost.041)
%inc18 = add nsw i32 %flag.042, 1
br label %for.inc20
for.inc20: ; preds = %for.body8, %if.then
%mincost.2 = phi i32 [ %spec.select, %if.then ], [ %mincost.041, %for.body8 ]
%flag.1 = phi i32 [ %inc18, %if.then ], [ %flag.042, %for.body8 ]
%indvars.iv.next48 = or i64 %indvars.iv47, 1
%arrayidx10.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next48
%11 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.not.1 = icmp sgt i32 %11, %7
br i1 %cmp11.not.1, label %for.inc20.1, label %if.then.1
if.then.1: ; preds = %for.inc20
%arrayidx13.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next48
%12 = load i32, ptr %arrayidx13.1, align 4, !tbaa !5
%spec.select.1 = call i32 @llvm.smin.i32(i32 %12, i32 %mincost.2)
%inc18.1 = add nsw i32 %flag.1, 1
br label %for.inc20.1
for.inc20.1: ; preds = %if.then.1, %for.inc20
%mincost.2.1 = phi i32 [ %spec.select.1, %if.then.1 ], [ %mincost.2, %for.inc20 ]
%flag.1.1 = phi i32 [ %inc18.1, %if.then.1 ], [ %flag.1, %for.inc20 ]
%indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 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.end22.unr-lcssa, label %for.body8, !llvm.loop !11
for.end22.unr-lcssa: ; preds = %for.inc20.1, %for.body8.lr.ph
%mincost.2.lcssa.ph = phi i32 [ undef, %for.body8.lr.ph ], [ %mincost.2.1, %for.inc20.1 ]
%flag.1.lcssa.ph = phi i32 [ undef, %for.body8.lr.ph ], [ %flag.1.1, %for.inc20.1 ]
%indvars.iv47.unr = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next48.1, %for.inc20.1 ]
%flag.042.unr = phi i32 [ 0, %for.body8.lr.ph ], [ %flag.1.1, %for.inc20.1 ]
%mincost.041.unr = phi i32 [ %.pre, %for.body8.lr.ph ], [ %mincost.2.1, %for.inc20.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end22, label %for.body8.epil
for.body8.epil: ; preds = %for.end22.unr-lcssa
%arrayidx10.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv47.unr
%13 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5
%cmp11.not.epil = icmp sgt i32 %13, %7
br i1 %cmp11.not.epil, label %for.end22, label %if.then.epil
if.then.epil: ; preds = %for.body8.epil
%arrayidx13.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv47.unr
%14 = load i32, ptr %arrayidx13.epil, align 4, !tbaa !5
%spec.select.epil = call i32 @llvm.smin.i32(i32 %14, i32 %mincost.041.unr)
%inc18.epil = add nsw i32 %flag.042.unr, 1
br label %for.end22
for.end22: ; preds = %for.body8.epil, %if.then.epil, %for.end22.unr-lcssa
%mincost.2.lcssa = phi i32 [ %mincost.2.lcssa.ph, %for.end22.unr-lcssa ], [ %spec.select.epil, %if.then.epil ], [ %mincost.041.unr, %for.body8.epil ]
%flag.1.lcssa = phi i32 [ %flag.1.lcssa.ph, %for.end22.unr-lcssa ], [ %inc18.epil, %if.then.epil ], [ %flag.042.unr, %for.body8.epil ]
%15 = icmp eq i32 %flag.1.lcssa, 0
br i1 %15, label %if.then24, label %if.else
if.then24: ; preds = %entry, %for.end, %for.end22
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end27
if.else: ; preds = %for.end22
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mincost.2.lcssa)
br label %if.end27
if.end27: ; preds = %if.else, %if.then24
call void @llvm.stackrestore.p0(ptr %2)
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 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: 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 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int N,T;
int c[100],t[100];
int main(void)
{
int i;
int ans=1001;
scanf("%d %d",&N,&T);
for(i=0;i<N;i++){
scanf("%d %d",&c[i],&t[i]);
}
for(i=0;i<N;i++){
if(t[i]<=T){
if(c[i]<ans){
ans=c[i];
}
}
//printf("%d\n",ans);
//printf("%d\n",t[i]);
}
if(ans>1000){
printf("TLE\n");
}
if(ans<=1000){
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188356/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188356/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@N = dso_local global i32 0, align 4
@T = dso_local global i32 0, align 4
@c = dso_local global [100 x i32] zeroinitializer, align 16
@t = dso_local global [100 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [4 x i8] c"TLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @T)
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %0, 0
br i1 %cmp40, label %for.body, label %if.end23
for.cond4.preheader: ; preds = %for.body
%cmp542 = icmp sgt i32 %3, 0
br i1 %cmp542, label %for.body6.lr.ph, label %if.end23
for.body6.lr.ph: ; preds = %for.cond4.preheader
%1 = load i32, ptr @T, align 4, !tbaa !5
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 1
%2 = icmp eq i32 %3, 1
br i1 %2, label %for.end19.unr-lcssa, label %for.body6.lr.ph.new
for.body6.lr.ph.new: ; preds = %for.body6.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100 x i32], ptr @t, i64 0, i64 %indvars.iv
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body6: ; preds = %for.inc17.1, %for.body6.lr.ph.new
%indvars.iv48 = phi i64 [ 0, %for.body6.lr.ph.new ], [ %indvars.iv.next49.1, %for.inc17.1 ]
%ans.044 = phi i32 [ 1001, %for.body6.lr.ph.new ], [ %ans.1.1, %for.inc17.1 ]
%niter = phi i64 [ 0, %for.body6.lr.ph.new ], [ %niter.next.1, %for.inc17.1 ]
%arrayidx8 = getelementptr inbounds [100 x i32], ptr @t, i64 0, i64 %indvars.iv48
%5 = load i32, ptr %arrayidx8, align 8, !tbaa !5
%cmp9.not = icmp sgt i32 %5, %1
br i1 %cmp9.not, label %for.inc17, label %if.then
if.then: ; preds = %for.body6
%arrayidx11 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv48
%6 = load i32, ptr %arrayidx11, align 8, !tbaa !5
%spec.select = tail call i32 @llvm.smin.i32(i32 %6, i32 %ans.044)
br label %for.inc17
for.inc17: ; preds = %if.then, %for.body6
%ans.1 = phi i32 [ %ans.044, %for.body6 ], [ %spec.select, %if.then ]
%indvars.iv.next49 = or i64 %indvars.iv48, 1
%arrayidx8.1 = getelementptr inbounds [100 x i32], ptr @t, i64 0, i64 %indvars.iv.next49
%7 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%cmp9.not.1 = icmp sgt i32 %7, %1
br i1 %cmp9.not.1, label %for.inc17.1, label %if.then.1
if.then.1: ; preds = %for.inc17
%arrayidx11.1 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv.next49
%8 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%spec.select.1 = tail call i32 @llvm.smin.i32(i32 %8, i32 %ans.1)
br label %for.inc17.1
for.inc17.1: ; preds = %if.then.1, %for.inc17
%ans.1.1 = phi i32 [ %ans.1, %for.inc17 ], [ %spec.select.1, %if.then.1 ]
%indvars.iv.next49.1 = add nuw nsw i64 %indvars.iv48, 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.end19.unr-lcssa, label %for.body6, !llvm.loop !11
for.end19.unr-lcssa: ; preds = %for.inc17.1, %for.body6.lr.ph
%ans.1.lcssa.ph = phi i32 [ undef, %for.body6.lr.ph ], [ %ans.1.1, %for.inc17.1 ]
%indvars.iv48.unr = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next49.1, %for.inc17.1 ]
%ans.044.unr = phi i32 [ 1001, %for.body6.lr.ph ], [ %ans.1.1, %for.inc17.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end19, label %for.body6.epil
for.body6.epil: ; preds = %for.end19.unr-lcssa
%arrayidx8.epil = getelementptr inbounds [100 x i32], ptr @t, i64 0, i64 %indvars.iv48.unr
%9 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5
%cmp9.not.epil = icmp sgt i32 %9, %1
br i1 %cmp9.not.epil, label %for.end19, label %if.then.epil
if.then.epil: ; preds = %for.body6.epil
%arrayidx11.epil = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv48.unr
%10 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%spec.select.epil = tail call i32 @llvm.smin.i32(i32 %10, i32 %ans.044.unr)
br label %for.end19
for.end19: ; preds = %for.body6.epil, %if.then.epil, %for.end19.unr-lcssa
%ans.1.lcssa = phi i32 [ %ans.1.lcssa.ph, %for.end19.unr-lcssa ], [ %ans.044.unr, %for.body6.epil ], [ %spec.select.epil, %if.then.epil ]
%cmp20 = icmp sgt i32 %ans.1.lcssa, 1000
br i1 %cmp20, label %if.end23, label %if.then25
if.end23: ; preds = %entry, %for.cond4.preheader, %for.end19
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end27
if.then25: ; preds = %for.end19
%call26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.1.lcssa)
br label %if.end27
if.end27: ; preds = %if.end23, %if.then25
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-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 }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int s=0,a,b,c,d,e,f;
scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
while(a>=1 && b>=1 && c>=2 && d>=7 && e>=4){
s++;
a-=1,b-=1,c-=2,d-=7,e-=4;
}
printf("%d",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1884/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1884/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %d, ptr noundef nonnull %e)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4
%b.promoted.fr = freeze i32 %b.promoted
%c.promoted = load i32, ptr %c, align 4
%d.promoted = load i32, ptr %d, align 4
%e.promoted = load i32, ptr %e, align 4
%cmp17 = icmp sgt i32 %a.promoted, 0
%cmp118 = icmp sgt i32 %b.promoted.fr, 0
%or.cond19 = and i1 %cmp17, %cmp118
%cmp320 = icmp sgt i32 %c.promoted, 1
%or.cond1221 = select i1 %or.cond19, i1 %cmp320, i1 false
%cmp522 = icmp sgt i32 %d.promoted, 6
%or.cond1323 = select i1 %or.cond1221, i1 %cmp522, i1 false
%cmp624 = icmp sgt i32 %e.promoted, 3
%or.cond1425 = select i1 %or.cond1323, i1 %cmp624, i1 false
br i1 %or.cond1425, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %entry
%0 = add nuw i32 %e.promoted, 3
%smin = call i32 @llvm.smin.i32(i32 %e.promoted, i32 7)
%1 = sub nuw i32 %0, %smin
%.fr = freeze i32 %1
%2 = lshr i32 %.fr, 2
%3 = add nuw i32 %d.promoted, 6
%smin28 = call i32 @llvm.smin.i32(i32 %d.promoted, i32 13)
%4 = sub nuw i32 %3, %smin28
%.fr33 = freeze i32 %4
%5 = udiv i32 %.fr33, 7
%umin = call i32 @llvm.umin.i32(i32 %2, i32 %5)
%6 = add nuw i32 %c.promoted, 1
%smin29 = call i32 @llvm.smin.i32(i32 %c.promoted, i32 3)
%7 = sub nuw i32 %6, %smin29
%.fr34 = freeze i32 %7
%8 = lshr i32 %.fr34, 1
%umin30 = call i32 @llvm.umin.i32(i32 %umin, i32 %8)
%9 = add nsw i32 %b.promoted.fr, -1
%umin31 = call i32 @llvm.umin.i32(i32 %umin30, i32 %9)
%10 = add nsw i32 %a.promoted, -1
%umin32 = call i32 @llvm.umin.i32(i32 %umin31, i32 %10)
%11 = add nuw nsw i32 %umin32, 1
%12 = sub nsw i32 %9, %umin32
%13 = shl nuw nsw i32 %umin32, 1
%14 = add nsw i32 %d.promoted, -7
%.neg = mul i32 %umin32, -7
%15 = add i32 %.neg, %14
%16 = shl nuw i32 %umin32, 2
%17 = sub nsw i32 %10, %umin32
%18 = add nsw i32 %c.promoted, -2
%19 = sub nsw i32 %18, %13
%20 = add nsw i32 %e.promoted, -4
%21 = sub i32 %20, %16
store i32 %17, ptr %a, align 4, !tbaa !5
store i32 %12, ptr %b, align 4, !tbaa !5
store i32 %19, ptr %c, align 4, !tbaa !5
store i32 %15, ptr %d, align 4, !tbaa !5
store i32 %21, ptr %e, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.body.preheader, %entry
%s.0.lcssa = phi i32 [ %11, %while.body.preheader ], [ 0, %entry ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int min=100000;
int N,T;
scanf("%d%d",&N,&T);
for(int i=0;i<N;i++){
int c,t;
scanf("%d%d",&c,&t);
if(t<=T && c<min)min=c;
}
if(min==100000)printf("TLE\n");
else printf("%d\n",min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188442/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188442/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [4 x i8] c"TLE\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
%c = 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 %N, ptr noundef nonnull %T)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %if.then5
for.cond.cleanup: ; preds = %for.body
%cmp4 = icmp eq i32 %min.1, 100000
br i1 %cmp4, label %if.then5, label %if.else
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%min.013 = phi i32 [ %min.1, %for.body ], [ 100000, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %t)
%1 = load i32, ptr %t, align 4, !tbaa !5
%2 = load i32, ptr %T, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %1, %2
%3 = load i32, ptr %c, align 4
%spec.select = call i32 @llvm.smin.i32(i32 %3, i32 %min.013)
%min.1 = select i1 %cmp2.not, i32 %min.013, i32 %spec.select
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
%inc = add nuw nsw i32 %i.014, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then5: ; preds = %entry, %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end8
if.else: ; preds = %for.cond.cleanup
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.1)
br label %if.end8
if.end8: ; preds = %if.else, %if.then5
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 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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
#include<string.h>
#define xam(x,y) (x>y?x:y)
int turaras[100000],times[100000],n,l;
int solve(int i){
if(times[i]!=-1)return times[i];
int time=0;
if(turaras[i]<turaras[i-1]&&i>0){
time=solve(i-1);
}
if(turaras[i]<turaras[i+1]&&i<n-1){
time=xam(time,solve(i+1));
}
return times[i]=time+l-turaras[i];
}
int main(){
int i;
scanf("%d%d",&n,&l);
memset(times,-1,sizeof(times));
for(i=0;i<n;i++){
scanf("%d",turaras+i);
}
int max=0;
for(i=0;i<n;i++){
max=xam(max,solve(i));
}
printf("%d\n",max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188543/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188543/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@times = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@turaras = dso_local global [100000 x i32] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@l = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @solve(i32 noundef %i) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @times, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, -1
br i1 %cmp.not, label %if.end, label %return
if.end: ; preds = %entry
%arrayidx4 = getelementptr inbounds [100000 x i32], ptr @turaras, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%sub = add nsw i32 %i, -1
%idxprom5 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds [100000 x i32], ptr @turaras, i64 0, i64 %idxprom5
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp slt i32 %1, %2
%cmp8 = icmp sgt i32 %i, 0
%or.cond = and i1 %cmp8, %cmp7
br i1 %or.cond, label %if.then9, label %if.end11
if.then9: ; preds = %if.end
%call = tail call i32 @solve(i32 noundef %sub)
%.pre = load i32, ptr %arrayidx4, align 4, !tbaa !5
br label %if.end11
if.end11: ; preds = %if.then9, %if.end
%3 = phi i32 [ %.pre, %if.then9 ], [ %1, %if.end ]
%time.0 = phi i32 [ %call, %if.then9 ], [ 0, %if.end ]
%add = add nsw i32 %i, 1
%idxprom14 = sext i32 %add to i64
%arrayidx15 = getelementptr inbounds [100000 x i32], ptr @turaras, i64 0, i64 %idxprom14
%4 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp slt i32 %3, %4
br i1 %cmp16, label %land.lhs.true17, label %if.end26
land.lhs.true17: ; preds = %if.end11
%5 = load i32, ptr @n, align 4, !tbaa !5
%sub18 = add nsw i32 %5, -1
%cmp19 = icmp sgt i32 %sub18, %i
br i1 %cmp19, label %if.then20, label %if.end26
if.then20: ; preds = %land.lhs.true17
%call22 = tail call i32 @solve(i32 noundef %add)
%cmp23 = icmp sgt i32 %time.0, %call22
br i1 %cmp23, label %if.end26, label %cond.false
cond.false: ; preds = %if.then20
%call25 = tail call i32 @solve(i32 noundef %add)
br label %if.end26
if.end26: ; preds = %cond.false, %if.then20, %land.lhs.true17, %if.end11
%time.1 = phi i32 [ %time.0, %land.lhs.true17 ], [ %time.0, %if.end11 ], [ %call25, %cond.false ], [ %time.0, %if.then20 ]
%6 = load i32, ptr @l, align 4, !tbaa !5
%add27 = add nsw i32 %6, %time.1
%7 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%sub30 = sub i32 %add27, %7
store i32 %sub30, ptr %arrayidx, align 4, !tbaa !5
br label %return
return: ; preds = %entry, %if.end26
%retval.0 = phi i32 [ %sub30, %if.end26 ], [ %0, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @l)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) @times, i8 -1, i64 400000, i1 false)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.end10
for.cond2.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.body4, label %for.end10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr @turaras, 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
%2 = load i32, ptr @n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %cond.end
%max.024 = phi i32 [ %cond, %cond.end ], [ 0, %for.cond2.preheader ]
%i.123 = phi i32 [ %inc9, %cond.end ], [ 0, %for.cond2.preheader ]
%call5 = tail call i32 @solve(i32 noundef %i.123)
%cmp6 = icmp sgt i32 %max.024, %call5
br i1 %cmp6, label %cond.end, label %cond.false
cond.false: ; preds = %for.body4
%call7 = tail call i32 @solve(i32 noundef %i.123)
br label %cond.end
cond.end: ; preds = %for.body4, %cond.false
%cond = phi i32 [ %call7, %cond.false ], [ %max.024, %for.body4 ]
%inc9 = add nuw nsw i32 %i.123, 1
%4 = load i32, ptr @n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc9, %4
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !11
for.end10: ; preds = %cond.end, %entry, %for.cond2.preheader
%max.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %cond, %cond.end ]
%call11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa)
ret i32 0
}
; 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
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="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) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 main(){
int a, b, h;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &h);
printf("%d", (a+b)*h / 2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188594/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188594/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%b = 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 %b) #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 %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 %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b,h;
scanf("%d%d%d",&a,&b,&h);
printf("%d\n",(int)(0.5*(a+b)*h));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%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 %b) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%conv = sitofp i32 %add to double
%mul = fmul double %conv, 5.000000e-01
%2 = load i32, ptr %h, align 4, !tbaa !5
%conv1 = sitofp i32 %2 to double
%mul2 = fmul double %mul, %conv1
%conv3 = fptosi double %mul2 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b,h;
scanf("%d %d %d",&a,&b,&h);
printf("%d",(a+b)*h/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188680/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188680/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%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 %b) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a, b, h;
scanf("%d%d%d",&a, &b ,&h);
printf("%d\n", (a+b)*h/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188723/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188723/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%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 %b) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
// Your code here!
int a,b,h;
scanf("%d%d%d",&a,&b,&h);
printf("%d\n",(a+b)*h/2);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188774/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188774/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%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 %b) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
int main(){
ll a,b,h;
scanf("%lld%lld%lld",&a,&b,&h);
printf("%lld",(a+b)*h/2);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188824/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188824/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%h = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%2 = load i64, ptr %h, align 8, !tbaa !5
%mul = mul nsw i64 %add, %2
%div = sdiv i64 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a, b, h;
scanf("%d %d %d", &a, &b, &h);
printf("%d\n", (a + b) * h/2);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188868/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188868/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%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 %b) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,h;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&h);
printf("%d\n",(a+b)*h/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188918/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188918/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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 %b) #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 %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 %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 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 %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int a, b, h;
scanf("%d%d%d", &a, &b, &h);
printf("%d\n", (a + b) * h / 2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188969/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188969/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%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 %b) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (void){
int a, b, h;
int ans;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &h);
ans = (a+b)*h/2;
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189018/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189018/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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 %b) #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 %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 %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 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 %h) #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>
#define N 3
int search(int board[N][N], int min, int limit, int r_0, int c_0);
int search(int board[N][N], int min, int limit, int r_0, int c_0){
int md_c;
int num;
int res[4];
if (min == 0){
return 0;
}
if (r_0 != 0) {
md_c = min;
num = board[r_0-1][c_0];
md_c -= (int)fabs((num-1)/N - (r_0-1)) + (int)fabs((num-1)%N - c_0);
md_c += (int)fabs((num-1)/N - r_0) + (int)fabs((num-1)%N - c_0);
if (md_c <= limit - 1) {
board[r_0-1][c_0] = 0;
board[r_0][c_0] = num;
res[0] = search(board, md_c, limit-1, r_0-1, c_0);
if (res[0] == -1) {
board[r_0-1][c_0] = num;
board[r_0][c_0] = 0;
}
else {
res[0]++;
}
}
else{
res[0] = -1;
}
}
else{
res[0] = -1;
}
if (r_0 != N-1) {
md_c = min;
num = board[r_0+1][c_0];
md_c -= (int)fabs((num-1)/N - (r_0+1)) + (int)fabs((num-1)%N - c_0);
md_c += (int)fabs((num-1)/N - r_0) + (int)fabs((num-1)%N - c_0);
if (md_c <= limit - 1) {
board[r_0+1][c_0] = 0;
board[r_0][c_0] =num;
res[1] = search(board, md_c, limit-1, r_0+1, c_0);
if (res[1] == -1) {
board[r_0+1][c_0] = num;
board[r_0][c_0] = 0;
}
else{
res[1]++;
}
}
else{
res[1] = -1;
}
}
else{
res[1] = -1;
}
if (c_0 != 0) {
md_c = min;
num = board[r_0][c_0-1];
md_c -= (int)fabs((num-1)/N - r_0) + (int)fabs((num-1)%N - (c_0-1));
md_c += (int)fabs((num-1)/N - r_0) + (int)fabs((num-1)%N - c_0);
if (md_c <= limit - 1) {
board[r_0][c_0-1] = 0;
board[r_0][c_0] = num;
res[2] = search(board, md_c, limit-1, r_0, c_0-1);
if (res[2] == -1) {
board[r_0][c_0-1] = num;
board[r_0][c_0] = 0;
}
else{
res[2]++;
}
}
else{
res[2] = -1;
}
}
else{
res[2] = -1;
}
if (c_0 != N-1) {
md_c = min;
num = board[r_0][c_0+1];
md_c -= (int)fabs((num-1)/N - r_0) + (int)fabs((num-1)%N - (c_0+1));
md_c += (int)fabs((num-1)/N - r_0) + (int)fabs((num-1)%N - c_0);
if (md_c <= limit - 1) {
board[r_0][c_0+1] = 0;
board[r_0][c_0] = num;
res[3] = search(board, md_c, limit-1, r_0, c_0+1);
if (res[3] == -1) {
board[r_0][c_0+1] = num;
board[r_0][c_0] = 0;
}
else{
res[3]++;
}
}
else{
res[3] = -1;
}
}
else{
res[3] = -1;
}
if (res[0] == -1 && res[1] == -1 && res[2] == -1 && res[3] == -1){
return -1;
}
else if (res[0] != -1){
return res[0];
}
else if (res[1] != -1){
return res[1];
}
else if (res[2] != -1){
return res[2];
}
else {
return res[3];
}
}
int main(int argc, char *argv[]){
int board[N][N],md,i,j,r,c,r_0,c_0,found,res;
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++){
scanf("%d", &board[i][j]);
}
}
md = 0;
for (i = 0; i < N * N; i++) {
found = 0;
for (r = 0; r < N; r++) {
for (c = 0; c < N; c++) {
if (board[r][c] == i) {
if (i == 0) {
r_0 = r;
c_0 = c;
}
else{
md += (int)fabs((i-1)/N - r) + (int)fabs((i-1)%N - c);
}
found = 1;
break;
}
}
if (found == 1){
break;
}
}
}
for (i = 0; ; i += 2) {
if ((r_0 + c_0) % 2 == 0) {
if (md % 2 == 0){
res = search(board, md, md+i, r_0, c_0);
}
else{
res = search(board, md, md+i+1, r_0, c_0);
}
}
else {
if (md % 2 == 0){
res = search(board, md, md+i+1, r_0, c_0);
}
else{
res = search(board, md, md+i, r_0, c_0);
}
}
if (res != -1) break;
}
printf("%d\n", res);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189061/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189061/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: readwrite) uwtable
define dso_local i32 @search(ptr noundef %board, i32 noundef %min, i32 noundef %limit, i32 noundef %r_0, i32 noundef %c_0) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %min, 0
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp1.not = icmp eq i32 %r_0, 0
br i1 %cmp1.not, label %if.end.if.then65_crit_edge, label %if.then2
if.end.if.then65_crit_edge: ; preds = %if.end
%.pre = sext i32 %c_0 to i64
br label %if.then65
if.then2: ; preds = %if.end
%sub = add nsw i32 %r_0, -1
%idxprom = sext i32 %sub to i64
%idxprom3 = sext i32 %c_0 to i64
%arrayidx4 = getelementptr inbounds [3 x i32], ptr %board, i64 %idxprom, i64 %idxprom3
%0 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%sub5 = add nsw i32 %0, -1
%div = sdiv i32 %sub5, 3
%sub7 = sub nsw i32 %div, %sub
%conv = sitofp i32 %sub7 to double
%1 = tail call double @llvm.fabs.f64(double %conv)
%conv8 = fptosi double %1 to i32
%sub16 = sub nsw i32 %div, %r_0
%conv17 = sitofp i32 %sub16 to double
%2 = tail call double @llvm.fabs.f64(double %conv17)
%conv18 = fptosi double %2 to i32
%add24 = add i32 %conv18, %min
%add25 = sub i32 %add24, %conv8
%cmp27.not.not = icmp slt i32 %add25, %limit
br i1 %cmp27.not.not, label %if.then29, label %if.end62
if.then29: ; preds = %if.then2
%sub26 = add nsw i32 %limit, -1
store i32 0, ptr %arrayidx4, align 4, !tbaa !5
%idxprom35 = sext i32 %r_0 to i64
%arrayidx38 = getelementptr inbounds [3 x i32], ptr %board, i64 %idxprom35, i64 %idxprom3
store i32 %0, ptr %arrayidx38, align 4, !tbaa !5
%call = tail call i32 @search(ptr noundef nonnull %board, i32 noundef %add25, i32 noundef %sub26, i32 noundef %sub, i32 noundef %c_0)
%cmp43 = icmp eq i32 %call, -1
br i1 %cmp43, label %if.then45, label %if.else
if.then45: ; preds = %if.then29
store i32 %0, ptr %arrayidx4, align 4, !tbaa !5
store i32 0, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end62
if.else: ; preds = %if.then29
%inc = add nuw nsw i32 %call, 1
br label %if.end62
if.end62: ; preds = %if.then2, %if.else, %if.then45
%res.sroa.0.0 = phi i32 [ -1, %if.then45 ], [ %inc, %if.else ], [ -1, %if.then2 ]
%cmp63.not = icmp eq i32 %r_0, 2
br i1 %cmp63.not, label %if.end135, label %if.then65
if.then65: ; preds = %if.end.if.then65_crit_edge, %if.end62
%idxprom69.pre-phi = phi i64 [ %.pre, %if.end.if.then65_crit_edge ], [ %idxprom3, %if.end62 ]
%res.sroa.0.0476 = phi i32 [ -1, %if.end.if.then65_crit_edge ], [ %res.sroa.0.0, %if.end62 ]
%add66 = add nsw i32 %r_0, 1
%idxprom67 = sext i32 %add66 to i64
%arrayidx70 = getelementptr inbounds [3 x i32], ptr %board, i64 %idxprom67, i64 %idxprom69.pre-phi
%3 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%sub71 = add nsw i32 %3, -1
%div72 = sdiv i32 %sub71, 3
%sub74 = sub nsw i32 %div72, %add66
%conv75 = sitofp i32 %sub74 to double
%4 = tail call double @llvm.fabs.f64(double %conv75)
%conv76 = fptosi double %4 to i32
%sub86 = sub nsw i32 %div72, %r_0
%conv87 = sitofp i32 %sub86 to double
%5 = tail call double @llvm.fabs.f64(double %conv87)
%conv88 = fptosi double %5 to i32
%add94 = add i32 %conv88, %min
%add95 = sub i32 %add94, %conv76
%cmp97.not.not = icmp slt i32 %add95, %limit
br i1 %cmp97.not.not, label %if.then99, label %if.end135
if.then99: ; preds = %if.then65
%sub96 = add nsw i32 %limit, -1
store i32 0, ptr %arrayidx70, align 4, !tbaa !5
%idxprom105 = sext i32 %r_0 to i64
%arrayidx108 = getelementptr inbounds [3 x i32], ptr %board, i64 %idxprom105, i64 %idxprom69.pre-phi
store i32 %3, ptr %arrayidx108, align 4, !tbaa !5
%call111 = tail call i32 @search(ptr noundef nonnull %board, i32 noundef %add95, i32 noundef %sub96, i32 noundef %add66, i32 noundef %c_0)
%cmp114 = icmp eq i32 %call111, -1
br i1 %cmp114, label %if.then116, label %if.else126
if.then116: ; preds = %if.then99
store i32 %3, ptr %arrayidx70, align 4, !tbaa !5
store i32 0, ptr %arrayidx108, align 4, !tbaa !5
br label %if.end135
if.else126: ; preds = %if.then99
%inc128 = add nuw nsw i32 %call111, 1
br label %if.end135
if.end135: ; preds = %if.end62, %if.then65, %if.else126, %if.then116
%res.sroa.0.0477 = phi i32 [ %res.sroa.0.0476, %if.then116 ], [ %res.sroa.0.0476, %if.else126 ], [ %res.sroa.0.0476, %if.then65 ], [ %res.sroa.0.0, %if.end62 ]
%res.sroa.11.0 = phi i32 [ -1, %if.then116 ], [ %inc128, %if.else126 ], [ -1, %if.then65 ], [ -1, %if.end62 ]
%cmp136.not = icmp eq i32 %c_0, 0
%.pre482 = sext i32 %r_0 to i64
br i1 %cmp136.not, label %if.then211, label %if.then138
if.then138: ; preds = %if.end135
%sub141 = add nsw i32 %c_0, -1
%idxprom142 = sext i32 %sub141 to i64
%arrayidx143 = getelementptr inbounds [3 x i32], ptr %board, i64 %.pre482, i64 %idxprom142
%6 = load i32, ptr %arrayidx143, align 4, !tbaa !5
%sub144 = add nsw i32 %6, -1
%rem150 = srem i32 %sub144, 3
%sub152 = sub nsw i32 %rem150, %sub141
%conv153 = sitofp i32 %sub152 to double
%7 = tail call double @llvm.fabs.f64(double %conv153)
%conv154 = fptosi double %7 to i32
%sub164 = sub nsw i32 %rem150, %c_0
%conv165 = sitofp i32 %sub164 to double
%8 = tail call double @llvm.fabs.f64(double %conv165)
%conv166 = fptosi double %8 to i32
%add167 = add i32 %conv166, %min
%add168 = sub i32 %add167, %conv154
%cmp170.not.not = icmp slt i32 %add168, %limit
br i1 %cmp170.not.not, label %if.then172, label %if.end208
if.then172: ; preds = %if.then138
%sub169 = add nsw i32 %limit, -1
store i32 0, ptr %arrayidx143, align 4, !tbaa !5
%idxprom180 = sext i32 %c_0 to i64
%arrayidx181 = getelementptr inbounds [3 x i32], ptr %board, i64 %.pre482, i64 %idxprom180
store i32 %6, ptr %arrayidx181, align 4, !tbaa !5
%call184 = tail call i32 @search(ptr noundef nonnull %board, i32 noundef %add168, i32 noundef %sub169, i32 noundef %r_0, i32 noundef %sub141)
%cmp187 = icmp eq i32 %call184, -1
br i1 %cmp187, label %if.then189, label %if.else199
if.then189: ; preds = %if.then172
store i32 %6, ptr %arrayidx143, align 4, !tbaa !5
store i32 0, ptr %arrayidx181, align 4, !tbaa !5
br label %if.end208
if.else199: ; preds = %if.then172
%inc201 = add nuw nsw i32 %call184, 1
br label %if.end208
if.end208: ; preds = %if.then138, %if.else199, %if.then189
%res.sroa.20.0 = phi i32 [ -1, %if.then189 ], [ %inc201, %if.else199 ], [ -1, %if.then138 ]
%cmp209.not = icmp eq i32 %c_0, 2
br i1 %cmp209.not, label %if.end281, label %if.then211
if.then211: ; preds = %if.end135, %if.end208
%res.sroa.20.0480 = phi i32 [ %res.sroa.20.0, %if.end208 ], [ -1, %if.end135 ]
%add214 = add nsw i32 %c_0, 1
%idxprom215 = sext i32 %add214 to i64
%arrayidx216 = getelementptr inbounds [3 x i32], ptr %board, i64 %.pre482, i64 %idxprom215
%9 = load i32, ptr %arrayidx216, align 4, !tbaa !5
%sub217 = add nsw i32 %9, -1
%rem223 = srem i32 %sub217, 3
%sub225 = sub nsw i32 %rem223, %add214
%conv226 = sitofp i32 %sub225 to double
%10 = tail call double @llvm.fabs.f64(double %conv226)
%conv227 = fptosi double %10 to i32
%sub237 = sub nsw i32 %rem223, %c_0
%conv238 = sitofp i32 %sub237 to double
%11 = tail call double @llvm.fabs.f64(double %conv238)
%conv239 = fptosi double %11 to i32
%add240 = add i32 %conv239, %min
%add241 = sub i32 %add240, %conv227
%cmp243.not.not = icmp slt i32 %add241, %limit
br i1 %cmp243.not.not, label %if.then245, label %if.end281
if.then245: ; preds = %if.then211
%sub242 = add nsw i32 %limit, -1
store i32 0, ptr %arrayidx216, align 4, !tbaa !5
%idxprom253 = sext i32 %c_0 to i64
%arrayidx254 = getelementptr inbounds [3 x i32], ptr %board, i64 %.pre482, i64 %idxprom253
store i32 %9, ptr %arrayidx254, align 4, !tbaa !5
%call257 = tail call i32 @search(ptr noundef nonnull %board, i32 noundef %add241, i32 noundef %sub242, i32 noundef %r_0, i32 noundef %add214)
%cmp260 = icmp eq i32 %call257, -1
br i1 %cmp260, label %if.then262, label %if.else272
if.then262: ; preds = %if.then245
store i32 %9, ptr %arrayidx216, align 4, !tbaa !5
store i32 0, ptr %arrayidx254, align 4, !tbaa !5
br label %if.end281
if.else272: ; preds = %if.then245
%inc274 = add nuw nsw i32 %call257, 1
br label %if.end281
if.end281: ; preds = %if.end208, %if.then211, %if.else272, %if.then262
%res.sroa.20.0481 = phi i32 [ %res.sroa.20.0480, %if.then262 ], [ %res.sroa.20.0480, %if.else272 ], [ %res.sroa.20.0480, %if.then211 ], [ %res.sroa.20.0, %if.end208 ]
%res.sroa.29.0 = phi i32 [ -1, %if.then262 ], [ %inc274, %if.else272 ], [ -1, %if.then211 ], [ -1, %if.end208 ]
%cmp283 = icmp eq i32 %res.sroa.0.0477, -1
%cmp286 = icmp eq i32 %res.sroa.11.0, -1
%or.cond = select i1 %cmp283, i1 %cmp286, i1 false
%cmp290 = icmp eq i32 %res.sroa.20.0481, -1
%or.cond319 = select i1 %or.cond, i1 %cmp290, i1 false
%cmp294 = icmp eq i32 %res.sroa.29.0, -1
%or.cond320 = select i1 %or.cond319, i1 %cmp294, i1 false
%cmp283.not = xor i1 %cmp283, true
%brmerge = or i1 %or.cond320, %cmp283.not
%.mux = select i1 %or.cond320, i32 -1, i32 %res.sroa.0.0477
br i1 %brmerge, label %cleanup, label %if.else303
if.else303: ; preds = %if.end281
%res.sroa.29.0.res.sroa.20.0 = select i1 %cmp290, i32 %res.sroa.29.0, i32 %res.sroa.20.0481
%spec.select = select i1 %cmp286, i32 %res.sroa.29.0.res.sroa.20.0, i32 %res.sroa.11.0
br label %cleanup
cleanup: ; preds = %if.else303, %if.end281, %entry
%retval.0 = phi i32 [ 0, %entry ], [ %.mux, %if.end281 ], [ %spec.select, %if.else303 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #3 {
entry:
%board = alloca [3 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %board) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %board)
%arrayidx5.1 = getelementptr inbounds [3 x [3 x i32]], ptr %board, i64 0, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [3 x [3 x i32]], ptr %board, i64 0, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.1159 = getelementptr inbounds [3 x [3 x i32]], ptr %board, i64 0, i64 1, i64 0
%call.1160 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1159)
%arrayidx5.1.1 = getelementptr inbounds [3 x [3 x i32]], ptr %board, i64 0, i64 1, i64 1
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.1)
%arrayidx5.2.1 = getelementptr inbounds [3 x [3 x i32]], ptr %board, i64 0, i64 1, i64 2
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.1)
%arrayidx5.2161 = getelementptr inbounds [3 x [3 x i32]], ptr %board, i64 0, i64 2, i64 0
%call.2162 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2161)
%arrayidx5.1.2 = getelementptr inbounds [3 x [3 x i32]], ptr %board, i64 0, i64 2, i64 1
%call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.2)
%arrayidx5.2.2 = getelementptr inbounds [3 x [3 x i32]], ptr %board, i64 0, i64 2, i64 2
%call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.2)
%0 = load i32, ptr %board, align 16, !tbaa !5
%cmp22.peel = icmp eq i32 %0, 0
br i1 %cmp22.peel, label %for.cond12.preheader.peel.next, label %for.inc33.peel
for.inc33.peel: ; preds = %entry
%1 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp22.1.peel = icmp eq i32 %1, 0
br i1 %cmp22.1.peel, label %for.cond12.preheader.peel.next, label %for.inc33.1.peel
for.inc33.1.peel: ; preds = %for.inc33.peel
%2 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%cmp22.2.peel = icmp eq i32 %2, 0
br i1 %cmp22.2.peel, label %for.cond12.preheader.peel.next, label %for.inc33.2.peel
for.inc33.2.peel: ; preds = %for.inc33.1.peel
%3 = load i32, ptr %arrayidx5.1159, align 4, !tbaa !5
%cmp22.1166.peel = icmp eq i32 %3, 0
br i1 %cmp22.1166.peel, label %for.cond12.preheader.peel.next, label %for.inc33.1167.peel
for.inc33.1167.peel: ; preds = %for.inc33.2.peel
%4 = load i32, ptr %arrayidx5.1.1, align 16, !tbaa !5
%cmp22.1.1.peel = icmp eq i32 %4, 0
br i1 %cmp22.1.1.peel, label %for.cond12.preheader.peel.next, label %for.inc33.1.1.peel
for.inc33.1.1.peel: ; preds = %for.inc33.1167.peel
%5 = load i32, ptr %arrayidx5.2.1, align 4, !tbaa !5
%cmp22.2.1.peel = icmp eq i32 %5, 0
br i1 %cmp22.2.1.peel, label %for.cond12.preheader.peel.next, label %for.inc33.2.1.peel
for.inc33.2.1.peel: ; preds = %for.inc33.1.1.peel
%6 = load i32, ptr %arrayidx5.2161, align 8, !tbaa !5
%cmp22.2169.peel = icmp eq i32 %6, 0
br i1 %cmp22.2169.peel, label %for.cond12.preheader.peel.next, label %for.inc33.2170.peel
for.inc33.2170.peel: ; preds = %for.inc33.2.1.peel
%7 = load i32, ptr %arrayidx5.1.2, align 4, !tbaa !5
%cmp22.1.2.peel = icmp eq i32 %7, 0
%spec.select = select i1 %cmp22.1.2.peel, i32 1, i32 2
br label %for.cond12.preheader.peel.next
for.cond12.preheader.peel.next: ; preds = %for.inc33.2170.peel, %for.inc33.2.1.peel, %for.inc33.1.1.peel, %for.inc33.1167.peel, %for.inc33.2.peel, %for.inc33.1.peel, %for.inc33.peel, %entry
%r_0.4.peel = phi i32 [ 0, %entry ], [ 0, %for.inc33.peel ], [ 0, %for.inc33.1.peel ], [ 1, %for.inc33.2.peel ], [ 1, %for.inc33.1167.peel ], [ 1, %for.inc33.1.1.peel ], [ 2, %for.inc33.2.1.peel ], [ 2, %for.inc33.2170.peel ]
%c_0.4.peel = phi i32 [ 0, %entry ], [ 1, %for.inc33.peel ], [ 2, %for.inc33.1.peel ], [ 0, %for.inc33.2.peel ], [ 1, %for.inc33.1167.peel ], [ 2, %for.inc33.1.1.peel ], [ 0, %for.inc33.2.1.peel ], [ %spec.select, %for.inc33.2170.peel ]
%8 = load i32, ptr %arrayidx5.1, align 4
%9 = load i32, ptr %arrayidx5.2, align 8
%10 = load i32, ptr %arrayidx5.1159, align 4
%11 = load i32, ptr %arrayidx5.1.1, align 16
%12 = load i32, ptr %arrayidx5.2.1, align 4
%13 = load i32, ptr %arrayidx5.2161, align 8
%14 = load i32, ptr %arrayidx5.1.2, align 4
%15 = load i32, ptr %arrayidx5.2.2, align 16
%cmp22 = icmp eq i32 %0, 1
br i1 %cmp22, label %if.else, label %for.inc33
for.cond46.preheader.split.us: ; preds = %for.inc43.7
br i1 %cmp53, label %for.cond46.us.us, label %for.cond46.us
for.cond46.us.us: ; preds = %for.cond46.preheader.split.us, %for.cond46.us.us
%i.2.us.us = phi i32 [ %add84.us.us, %for.cond46.us.us ], [ 0, %for.cond46.preheader.split.us ]
%add56.us.us = add nsw i32 %i.2.us.us, %md.4.7
%call57.us.us = call i32 @search(ptr noundef nonnull %board, i32 noundef %md.4.7, i32 noundef %add56.us.us, i32 noundef %r_0.4.peel, i32 noundef %c_0.4.peel)
%cmp79.not.us.us = icmp eq i32 %call57.us.us, -1
%add84.us.us = add nuw nsw i32 %i.2.us.us, 2
br i1 %cmp79.not.us.us, label %for.cond46.us.us, label %for.end85
for.cond46.us: ; preds = %for.cond46.preheader.split.us, %for.cond46.us
%i.2.us = phi i32 [ %add84.us, %for.cond46.us ], [ 0, %for.cond46.preheader.split.us ]
%add61.us = add i32 %add70, %i.2.us
%call62.us = call i32 @search(ptr noundef nonnull %board, i32 noundef %md.4.7, i32 noundef %add61.us, i32 noundef %r_0.4.peel, i32 noundef %c_0.4.peel)
%cmp79.not.us = icmp eq i32 %call62.us, -1
%add84.us = add nuw nsw i32 %i.2.us, 2
br i1 %cmp79.not.us, label %for.cond46.us, label %for.end85
for.cond46.preheader.split: ; preds = %for.inc43.7
br i1 %cmp53, label %for.cond46.us142, label %for.cond46
for.cond46.us142: ; preds = %for.cond46.preheader.split, %for.cond46.us142
%i.2.us143 = phi i32 [ %add84.us147, %for.cond46.us142 ], [ 0, %for.cond46.preheader.split ]
%add71.us = add i32 %add70, %i.2.us143
%call72.us = call i32 @search(ptr noundef nonnull %board, i32 noundef %md.4.7, i32 noundef %add71.us, i32 noundef %r_0.4.peel, i32 noundef %c_0.4.peel)
%cmp79.not.us146 = icmp eq i32 %call72.us, -1
%add84.us147 = add nuw nsw i32 %i.2.us143, 2
br i1 %cmp79.not.us146, label %for.cond46.us142, label %for.end85
if.else: ; preds = %for.cond12.preheader.peel.next, %for.inc33, %for.inc33.1, %for.inc33.2, %for.inc33.1167, %for.inc33.1.1, %for.inc33.2.1, %for.inc33.2170, %for.inc33.1.2
%r.0137.lcssa.neg = phi double [ 0.000000e+00, %for.cond12.preheader.peel.next ], [ 0.000000e+00, %for.inc33 ], [ 0.000000e+00, %for.inc33.1 ], [ -1.000000e+00, %for.inc33.2 ], [ -1.000000e+00, %for.inc33.1167 ], [ -1.000000e+00, %for.inc33.1.1 ], [ -2.000000e+00, %for.inc33.2.1 ], [ -2.000000e+00, %for.inc33.2170 ], [ -2.000000e+00, %for.inc33.1.2 ]
%c.0136.lcssa.wide.neg = phi double [ 0.000000e+00, %for.cond12.preheader.peel.next ], [ -1.000000e+00, %for.inc33 ], [ -2.000000e+00, %for.inc33.1 ], [ 0.000000e+00, %for.inc33.2 ], [ -1.000000e+00, %for.inc33.1167 ], [ -2.000000e+00, %for.inc33.1.1 ], [ 0.000000e+00, %for.inc33.2.1 ], [ -1.000000e+00, %for.inc33.2170 ], [ -2.000000e+00, %for.inc33.1.2 ]
%16 = call double @llvm.fabs.f64(double %r.0137.lcssa.neg)
%conv26 = fptosi double %16 to i32
%17 = call double @llvm.fabs.f64(double %c.0136.lcssa.wide.neg)
%conv30 = fptosi double %17 to i32
%add31 = add i32 %conv26, %conv30
br label %for.inc43
for.inc33: ; preds = %for.cond12.preheader.peel.next
%cmp22.1 = icmp eq i32 %8, 1
br i1 %cmp22.1, label %if.else, label %for.inc33.1
for.inc33.1: ; preds = %for.inc33
%cmp22.2 = icmp eq i32 %9, 1
br i1 %cmp22.2, label %if.else, label %for.inc33.2
for.inc33.2: ; preds = %for.inc33.1
%cmp22.1166 = icmp eq i32 %10, 1
br i1 %cmp22.1166, label %if.else, label %for.inc33.1167
for.inc33.1167: ; preds = %for.inc33.2
%cmp22.1.1 = icmp eq i32 %11, 1
br i1 %cmp22.1.1, label %if.else, label %for.inc33.1.1
for.inc33.1.1: ; preds = %for.inc33.1167
%cmp22.2.1 = icmp eq i32 %12, 1
br i1 %cmp22.2.1, label %if.else, label %for.inc33.2.1
for.inc33.2.1: ; preds = %for.inc33.1.1
%cmp22.2169 = icmp eq i32 %13, 1
br i1 %cmp22.2169, label %if.else, label %for.inc33.2170
for.inc33.2170: ; preds = %for.inc33.2.1
%cmp22.1.2 = icmp eq i32 %14, 1
br i1 %cmp22.1.2, label %if.else, label %for.inc33.1.2
for.inc33.1.2: ; preds = %for.inc33.2170
%cmp22.2.2 = icmp eq i32 %15, 1
br i1 %cmp22.2.2, label %if.else, label %for.inc43
for.inc43: ; preds = %for.inc33.1.2, %if.else
%md.4 = phi i32 [ %add31, %if.else ], [ 0, %for.inc33.1.2 ]
%cmp22.1183 = icmp eq i32 %0, 2
br i1 %cmp22.1183, label %if.else.1, label %for.inc33.1185
for.inc33.1185: ; preds = %for.inc43
%cmp22.1.1184 = icmp eq i32 %8, 2
br i1 %cmp22.1.1184, label %if.else.1, label %for.inc33.1.1187
for.inc33.1.1187: ; preds = %for.inc33.1185
%cmp22.2.1186 = icmp eq i32 %9, 2
br i1 %cmp22.2.1186, label %if.else.1, label %for.inc33.2.1188
for.inc33.2.1188: ; preds = %for.inc33.1.1187
%cmp22.1166.1 = icmp eq i32 %10, 2
br i1 %cmp22.1166.1, label %if.else.1, label %for.inc33.1167.1
for.inc33.1167.1: ; preds = %for.inc33.2.1188
%cmp22.1.1.1 = icmp eq i32 %11, 2
br i1 %cmp22.1.1.1, label %if.else.1, label %for.inc33.1.1.1
for.inc33.1.1.1: ; preds = %for.inc33.1167.1
%cmp22.2.1.1 = icmp eq i32 %12, 2
br i1 %cmp22.2.1.1, label %if.else.1, label %for.inc33.2.1.1
for.inc33.2.1.1: ; preds = %for.inc33.1.1.1
%cmp22.2169.1 = icmp eq i32 %13, 2
br i1 %cmp22.2169.1, label %if.else.1, label %for.inc33.2170.1
for.inc33.2170.1: ; preds = %for.inc33.2.1.1
%cmp22.1.2.1 = icmp eq i32 %14, 2
br i1 %cmp22.1.2.1, label %if.else.1, label %for.inc33.1.2.1
for.inc33.1.2.1: ; preds = %for.inc33.2170.1
%cmp22.2.2.1 = icmp eq i32 %15, 2
br i1 %cmp22.2.2.1, label %if.else.1, label %for.inc43.1
if.else.1: ; preds = %for.inc33.1.2.1, %for.inc33.2170.1, %for.inc33.2.1.1, %for.inc33.1.1.1, %for.inc33.1167.1, %for.inc33.2.1188, %for.inc33.1.1187, %for.inc33.1185, %for.inc43
%r.0137.lcssa.neg.1 = phi double [ 0.000000e+00, %for.inc43 ], [ 0.000000e+00, %for.inc33.1185 ], [ 0.000000e+00, %for.inc33.1.1187 ], [ -1.000000e+00, %for.inc33.2.1188 ], [ -1.000000e+00, %for.inc33.1167.1 ], [ -1.000000e+00, %for.inc33.1.1.1 ], [ -2.000000e+00, %for.inc33.2.1.1 ], [ -2.000000e+00, %for.inc33.2170.1 ], [ -2.000000e+00, %for.inc33.1.2.1 ]
%c.0136.lcssa.wide.neg.1 = phi double [ 1.000000e+00, %for.inc43 ], [ 0.000000e+00, %for.inc33.1185 ], [ -1.000000e+00, %for.inc33.1.1187 ], [ 1.000000e+00, %for.inc33.2.1188 ], [ 0.000000e+00, %for.inc33.1167.1 ], [ -1.000000e+00, %for.inc33.1.1.1 ], [ 1.000000e+00, %for.inc33.2.1.1 ], [ 0.000000e+00, %for.inc33.2170.1 ], [ -1.000000e+00, %for.inc33.1.2.1 ]
%18 = call double @llvm.fabs.f64(double %r.0137.lcssa.neg.1)
%conv26.1 = fptosi double %18 to i32
%19 = call double @llvm.fabs.f64(double %c.0136.lcssa.wide.neg.1)
%conv30.1 = fptosi double %19 to i32
%add.1 = add i32 %md.4, %conv26.1
%add31.1 = add i32 %add.1, %conv30.1
br label %for.inc43.1
for.inc43.1: ; preds = %if.else.1, %for.inc33.1.2.1
%md.4.1 = phi i32 [ %add31.1, %if.else.1 ], [ %md.4, %for.inc33.1.2.1 ]
%cmp22.2189 = icmp eq i32 %0, 3
br i1 %cmp22.2189, label %if.else.2, label %for.inc33.2191
for.inc33.2191: ; preds = %for.inc43.1
%cmp22.1.2190 = icmp eq i32 %8, 3
br i1 %cmp22.1.2190, label %if.else.2, label %for.inc33.1.2193
for.inc33.1.2193: ; preds = %for.inc33.2191
%cmp22.2.2192 = icmp eq i32 %9, 3
br i1 %cmp22.2.2192, label %if.else.2, label %for.inc33.2.2
for.inc33.2.2: ; preds = %for.inc33.1.2193
%cmp22.1166.2 = icmp eq i32 %10, 3
br i1 %cmp22.1166.2, label %if.else.2, label %for.inc33.1167.2
for.inc33.1167.2: ; preds = %for.inc33.2.2
%cmp22.1.1.2 = icmp eq i32 %11, 3
br i1 %cmp22.1.1.2, label %if.else.2, label %for.inc33.1.1.2
for.inc33.1.1.2: ; preds = %for.inc33.1167.2
%cmp22.2.1.2 = icmp eq i32 %12, 3
br i1 %cmp22.2.1.2, label %if.else.2, label %for.inc33.2.1.2
for.inc33.2.1.2: ; preds = %for.inc33.1.1.2
%cmp22.2169.2 = icmp eq i32 %13, 3
br i1 %cmp22.2169.2, label %if.else.2, label %for.inc33.2170.2
for.inc33.2170.2: ; preds = %for.inc33.2.1.2
%cmp22.1.2.2 = icmp eq i32 %14, 3
br i1 %cmp22.1.2.2, label %if.else.2, label %for.inc33.1.2.2
for.inc33.1.2.2: ; preds = %for.inc33.2170.2
%cmp22.2.2.2 = icmp eq i32 %15, 3
br i1 %cmp22.2.2.2, label %if.else.2, label %for.inc43.2
if.else.2: ; preds = %for.inc33.1.2.2, %for.inc33.2170.2, %for.inc33.2.1.2, %for.inc33.1.1.2, %for.inc33.1167.2, %for.inc33.2.2, %for.inc33.1.2193, %for.inc33.2191, %for.inc43.1
%r.0137.lcssa.neg.2 = phi double [ 0.000000e+00, %for.inc43.1 ], [ 0.000000e+00, %for.inc33.2191 ], [ 0.000000e+00, %for.inc33.1.2193 ], [ -1.000000e+00, %for.inc33.2.2 ], [ -1.000000e+00, %for.inc33.1167.2 ], [ -1.000000e+00, %for.inc33.1.1.2 ], [ -2.000000e+00, %for.inc33.2.1.2 ], [ -2.000000e+00, %for.inc33.2170.2 ], [ -2.000000e+00, %for.inc33.1.2.2 ]
%c.0136.lcssa.wide.neg.2 = phi double [ 2.000000e+00, %for.inc43.1 ], [ 1.000000e+00, %for.inc33.2191 ], [ 0.000000e+00, %for.inc33.1.2193 ], [ 2.000000e+00, %for.inc33.2.2 ], [ 1.000000e+00, %for.inc33.1167.2 ], [ 0.000000e+00, %for.inc33.1.1.2 ], [ 2.000000e+00, %for.inc33.2.1.2 ], [ 1.000000e+00, %for.inc33.2170.2 ], [ 0.000000e+00, %for.inc33.1.2.2 ]
%20 = call double @llvm.fabs.f64(double %r.0137.lcssa.neg.2)
%conv26.2 = fptosi double %20 to i32
%21 = call double @llvm.fabs.f64(double %c.0136.lcssa.wide.neg.2)
%conv30.2 = fptosi double %21 to i32
%add.2 = add i32 %md.4.1, %conv26.2
%add31.2 = add i32 %add.2, %conv30.2
br label %for.inc43.2
for.inc43.2: ; preds = %if.else.2, %for.inc33.1.2.2
%md.4.2 = phi i32 [ %add31.2, %if.else.2 ], [ %md.4.1, %for.inc33.1.2.2 ]
%cmp22.3 = icmp eq i32 %0, 4
br i1 %cmp22.3, label %if.else.3, label %for.inc33.3
for.inc33.3: ; preds = %for.inc43.2
%cmp22.1.3 = icmp eq i32 %8, 4
br i1 %cmp22.1.3, label %if.else.3, label %for.inc33.1.3
for.inc33.1.3: ; preds = %for.inc33.3
%cmp22.2.3 = icmp eq i32 %9, 4
br i1 %cmp22.2.3, label %if.else.3, label %for.inc33.2.3
for.inc33.2.3: ; preds = %for.inc33.1.3
%cmp22.1166.3 = icmp eq i32 %10, 4
br i1 %cmp22.1166.3, label %if.else.3, label %for.inc33.1167.3
for.inc33.1167.3: ; preds = %for.inc33.2.3
%cmp22.1.1.3 = icmp eq i32 %11, 4
br i1 %cmp22.1.1.3, label %if.else.3, label %for.inc33.1.1.3
for.inc33.1.1.3: ; preds = %for.inc33.1167.3
%cmp22.2.1.3 = icmp eq i32 %12, 4
br i1 %cmp22.2.1.3, label %if.else.3, label %for.inc33.2.1.3
for.inc33.2.1.3: ; preds = %for.inc33.1.1.3
%cmp22.2169.3 = icmp eq i32 %13, 4
br i1 %cmp22.2169.3, label %if.else.3, label %for.inc33.2170.3
for.inc33.2170.3: ; preds = %for.inc33.2.1.3
%cmp22.1.2.3 = icmp eq i32 %14, 4
br i1 %cmp22.1.2.3, label %if.else.3, label %for.inc33.1.2.3
for.inc33.1.2.3: ; preds = %for.inc33.2170.3
%cmp22.2.2.3 = icmp eq i32 %15, 4
br i1 %cmp22.2.2.3, label %if.else.3, label %for.inc43.3
if.else.3: ; preds = %for.inc33.1.2.3, %for.inc33.2170.3, %for.inc33.2.1.3, %for.inc33.1.1.3, %for.inc33.1167.3, %for.inc33.2.3, %for.inc33.1.3, %for.inc33.3, %for.inc43.2
%r.0137.lcssa.neg.3 = phi double [ 1.000000e+00, %for.inc43.2 ], [ 1.000000e+00, %for.inc33.3 ], [ 1.000000e+00, %for.inc33.1.3 ], [ 0.000000e+00, %for.inc33.2.3 ], [ 0.000000e+00, %for.inc33.1167.3 ], [ 0.000000e+00, %for.inc33.1.1.3 ], [ -1.000000e+00, %for.inc33.2.1.3 ], [ -1.000000e+00, %for.inc33.2170.3 ], [ -1.000000e+00, %for.inc33.1.2.3 ]
%c.0136.lcssa.wide.neg.3 = phi double [ 0.000000e+00, %for.inc43.2 ], [ -1.000000e+00, %for.inc33.3 ], [ -2.000000e+00, %for.inc33.1.3 ], [ 0.000000e+00, %for.inc33.2.3 ], [ -1.000000e+00, %for.inc33.1167.3 ], [ -2.000000e+00, %for.inc33.1.1.3 ], [ 0.000000e+00, %for.inc33.2.1.3 ], [ -1.000000e+00, %for.inc33.2170.3 ], [ -2.000000e+00, %for.inc33.1.2.3 ]
%22 = call double @llvm.fabs.f64(double %r.0137.lcssa.neg.3)
%conv26.3 = fptosi double %22 to i32
%23 = call double @llvm.fabs.f64(double %c.0136.lcssa.wide.neg.3)
%conv30.3 = fptosi double %23 to i32
%add.3 = add i32 %md.4.2, %conv26.3
%add31.3 = add i32 %add.3, %conv30.3
br label %for.inc43.3
for.inc43.3: ; preds = %if.else.3, %for.inc33.1.2.3
%md.4.3 = phi i32 [ %add31.3, %if.else.3 ], [ %md.4.2, %for.inc33.1.2.3 ]
%cmp22.4 = icmp eq i32 %0, 5
br i1 %cmp22.4, label %if.else.4, label %for.inc33.4
for.inc33.4: ; preds = %for.inc43.3
%cmp22.1.4 = icmp eq i32 %8, 5
br i1 %cmp22.1.4, label %if.else.4, label %for.inc33.1.4
for.inc33.1.4: ; preds = %for.inc33.4
%cmp22.2.4 = icmp eq i32 %9, 5
br i1 %cmp22.2.4, label %if.else.4, label %for.inc33.2.4
for.inc33.2.4: ; preds = %for.inc33.1.4
%cmp22.1166.4 = icmp eq i32 %10, 5
br i1 %cmp22.1166.4, label %if.else.4, label %for.inc33.1167.4
for.inc33.1167.4: ; preds = %for.inc33.2.4
%cmp22.1.1.4 = icmp eq i32 %11, 5
br i1 %cmp22.1.1.4, label %if.else.4, label %for.inc33.1.1.4
for.inc33.1.1.4: ; preds = %for.inc33.1167.4
%cmp22.2.1.4 = icmp eq i32 %12, 5
br i1 %cmp22.2.1.4, label %if.else.4, label %for.inc33.2.1.4
for.inc33.2.1.4: ; preds = %for.inc33.1.1.4
%cmp22.2169.4 = icmp eq i32 %13, 5
br i1 %cmp22.2169.4, label %if.else.4, label %for.inc33.2170.4
for.inc33.2170.4: ; preds = %for.inc33.2.1.4
%cmp22.1.2.4 = icmp eq i32 %14, 5
br i1 %cmp22.1.2.4, label %if.else.4, label %for.inc33.1.2.4
for.inc33.1.2.4: ; preds = %for.inc33.2170.4
%cmp22.2.2.4 = icmp eq i32 %15, 5
br i1 %cmp22.2.2.4, label %if.else.4, label %for.inc43.4
if.else.4: ; preds = %for.inc33.1.2.4, %for.inc33.2170.4, %for.inc33.2.1.4, %for.inc33.1.1.4, %for.inc33.1167.4, %for.inc33.2.4, %for.inc33.1.4, %for.inc33.4, %for.inc43.3
%r.0137.lcssa.neg.4 = phi double [ 1.000000e+00, %for.inc43.3 ], [ 1.000000e+00, %for.inc33.4 ], [ 1.000000e+00, %for.inc33.1.4 ], [ 0.000000e+00, %for.inc33.2.4 ], [ 0.000000e+00, %for.inc33.1167.4 ], [ 0.000000e+00, %for.inc33.1.1.4 ], [ -1.000000e+00, %for.inc33.2.1.4 ], [ -1.000000e+00, %for.inc33.2170.4 ], [ -1.000000e+00, %for.inc33.1.2.4 ]
%c.0136.lcssa.wide.neg.4 = phi double [ 1.000000e+00, %for.inc43.3 ], [ 0.000000e+00, %for.inc33.4 ], [ -1.000000e+00, %for.inc33.1.4 ], [ 1.000000e+00, %for.inc33.2.4 ], [ 0.000000e+00, %for.inc33.1167.4 ], [ -1.000000e+00, %for.inc33.1.1.4 ], [ 1.000000e+00, %for.inc33.2.1.4 ], [ 0.000000e+00, %for.inc33.2170.4 ], [ -1.000000e+00, %for.inc33.1.2.4 ]
%24 = call double @llvm.fabs.f64(double %r.0137.lcssa.neg.4)
%conv26.4 = fptosi double %24 to i32
%25 = call double @llvm.fabs.f64(double %c.0136.lcssa.wide.neg.4)
%conv30.4 = fptosi double %25 to i32
%add.4 = add i32 %md.4.3, %conv26.4
%add31.4 = add i32 %add.4, %conv30.4
br label %for.inc43.4
for.inc43.4: ; preds = %if.else.4, %for.inc33.1.2.4
%md.4.4 = phi i32 [ %add31.4, %if.else.4 ], [ %md.4.3, %for.inc33.1.2.4 ]
%cmp22.5 = icmp eq i32 %0, 6
br i1 %cmp22.5, label %if.else.5, label %for.inc33.5
for.inc33.5: ; preds = %for.inc43.4
%cmp22.1.5 = icmp eq i32 %8, 6
br i1 %cmp22.1.5, label %if.else.5, label %for.inc33.1.5
for.inc33.1.5: ; preds = %for.inc33.5
%cmp22.2.5 = icmp eq i32 %9, 6
br i1 %cmp22.2.5, label %if.else.5, label %for.inc33.2.5
for.inc33.2.5: ; preds = %for.inc33.1.5
%cmp22.1166.5 = icmp eq i32 %10, 6
br i1 %cmp22.1166.5, label %if.else.5, label %for.inc33.1167.5
for.inc33.1167.5: ; preds = %for.inc33.2.5
%cmp22.1.1.5 = icmp eq i32 %11, 6
br i1 %cmp22.1.1.5, label %if.else.5, label %for.inc33.1.1.5
for.inc33.1.1.5: ; preds = %for.inc33.1167.5
%cmp22.2.1.5 = icmp eq i32 %12, 6
br i1 %cmp22.2.1.5, label %if.else.5, label %for.inc33.2.1.5
for.inc33.2.1.5: ; preds = %for.inc33.1.1.5
%cmp22.2169.5 = icmp eq i32 %13, 6
br i1 %cmp22.2169.5, label %if.else.5, label %for.inc33.2170.5
for.inc33.2170.5: ; preds = %for.inc33.2.1.5
%cmp22.1.2.5 = icmp eq i32 %14, 6
br i1 %cmp22.1.2.5, label %if.else.5, label %for.inc33.1.2.5
for.inc33.1.2.5: ; preds = %for.inc33.2170.5
%cmp22.2.2.5 = icmp eq i32 %15, 6
br i1 %cmp22.2.2.5, label %if.else.5, label %for.inc43.5
if.else.5: ; preds = %for.inc33.1.2.5, %for.inc33.2170.5, %for.inc33.2.1.5, %for.inc33.1.1.5, %for.inc33.1167.5, %for.inc33.2.5, %for.inc33.1.5, %for.inc33.5, %for.inc43.4
%r.0137.lcssa.neg.5 = phi double [ 1.000000e+00, %for.inc43.4 ], [ 1.000000e+00, %for.inc33.5 ], [ 1.000000e+00, %for.inc33.1.5 ], [ 0.000000e+00, %for.inc33.2.5 ], [ 0.000000e+00, %for.inc33.1167.5 ], [ 0.000000e+00, %for.inc33.1.1.5 ], [ -1.000000e+00, %for.inc33.2.1.5 ], [ -1.000000e+00, %for.inc33.2170.5 ], [ -1.000000e+00, %for.inc33.1.2.5 ]
%c.0136.lcssa.wide.neg.5 = phi double [ 2.000000e+00, %for.inc43.4 ], [ 1.000000e+00, %for.inc33.5 ], [ 0.000000e+00, %for.inc33.1.5 ], [ 2.000000e+00, %for.inc33.2.5 ], [ 1.000000e+00, %for.inc33.1167.5 ], [ 0.000000e+00, %for.inc33.1.1.5 ], [ 2.000000e+00, %for.inc33.2.1.5 ], [ 1.000000e+00, %for.inc33.2170.5 ], [ 0.000000e+00, %for.inc33.1.2.5 ]
%26 = call double @llvm.fabs.f64(double %r.0137.lcssa.neg.5)
%conv26.5 = fptosi double %26 to i32
%27 = call double @llvm.fabs.f64(double %c.0136.lcssa.wide.neg.5)
%conv30.5 = fptosi double %27 to i32
%add.5 = add i32 %md.4.4, %conv26.5
%add31.5 = add i32 %add.5, %conv30.5
br label %for.inc43.5
for.inc43.5: ; preds = %if.else.5, %for.inc33.1.2.5
%md.4.5 = phi i32 [ %add31.5, %if.else.5 ], [ %md.4.4, %for.inc33.1.2.5 ]
%cmp22.6 = icmp eq i32 %0, 7
br i1 %cmp22.6, label %if.else.6, label %for.inc33.6
for.inc33.6: ; preds = %for.inc43.5
%cmp22.1.6 = icmp eq i32 %8, 7
br i1 %cmp22.1.6, label %if.else.6, label %for.inc33.1.6
for.inc33.1.6: ; preds = %for.inc33.6
%cmp22.2.6 = icmp eq i32 %9, 7
br i1 %cmp22.2.6, label %if.else.6, label %for.inc33.2.6
for.inc33.2.6: ; preds = %for.inc33.1.6
%cmp22.1166.6 = icmp eq i32 %10, 7
br i1 %cmp22.1166.6, label %if.else.6, label %for.inc33.1167.6
for.inc33.1167.6: ; preds = %for.inc33.2.6
%cmp22.1.1.6 = icmp eq i32 %11, 7
br i1 %cmp22.1.1.6, label %if.else.6, label %for.inc33.1.1.6
for.inc33.1.1.6: ; preds = %for.inc33.1167.6
%cmp22.2.1.6 = icmp eq i32 %12, 7
br i1 %cmp22.2.1.6, label %if.else.6, label %for.inc33.2.1.6
for.inc33.2.1.6: ; preds = %for.inc33.1.1.6
%cmp22.2169.6 = icmp eq i32 %13, 7
br i1 %cmp22.2169.6, label %if.else.6, label %for.inc33.2170.6
for.inc33.2170.6: ; preds = %for.inc33.2.1.6
%cmp22.1.2.6 = icmp eq i32 %14, 7
br i1 %cmp22.1.2.6, label %if.else.6, label %for.inc33.1.2.6
for.inc33.1.2.6: ; preds = %for.inc33.2170.6
%cmp22.2.2.6 = icmp eq i32 %15, 7
br i1 %cmp22.2.2.6, label %if.else.6, label %for.inc43.6
if.else.6: ; preds = %for.inc33.1.2.6, %for.inc33.2170.6, %for.inc33.2.1.6, %for.inc33.1.1.6, %for.inc33.1167.6, %for.inc33.2.6, %for.inc33.1.6, %for.inc33.6, %for.inc43.5
%r.0137.lcssa.neg.6 = phi double [ 2.000000e+00, %for.inc43.5 ], [ 2.000000e+00, %for.inc33.6 ], [ 2.000000e+00, %for.inc33.1.6 ], [ 1.000000e+00, %for.inc33.2.6 ], [ 1.000000e+00, %for.inc33.1167.6 ], [ 1.000000e+00, %for.inc33.1.1.6 ], [ 0.000000e+00, %for.inc33.2.1.6 ], [ 0.000000e+00, %for.inc33.2170.6 ], [ 0.000000e+00, %for.inc33.1.2.6 ]
%c.0136.lcssa.wide.neg.6 = phi double [ 0.000000e+00, %for.inc43.5 ], [ -1.000000e+00, %for.inc33.6 ], [ -2.000000e+00, %for.inc33.1.6 ], [ 0.000000e+00, %for.inc33.2.6 ], [ -1.000000e+00, %for.inc33.1167.6 ], [ -2.000000e+00, %for.inc33.1.1.6 ], [ 0.000000e+00, %for.inc33.2.1.6 ], [ -1.000000e+00, %for.inc33.2170.6 ], [ -2.000000e+00, %for.inc33.1.2.6 ]
%28 = call double @llvm.fabs.f64(double %r.0137.lcssa.neg.6)
%conv26.6 = fptosi double %28 to i32
%29 = call double @llvm.fabs.f64(double %c.0136.lcssa.wide.neg.6)
%conv30.6 = fptosi double %29 to i32
%add.6 = add i32 %md.4.5, %conv26.6
%add31.6 = add i32 %add.6, %conv30.6
br label %for.inc43.6
for.inc43.6: ; preds = %if.else.6, %for.inc33.1.2.6
%md.4.6 = phi i32 [ %add31.6, %if.else.6 ], [ %md.4.5, %for.inc33.1.2.6 ]
%cmp22.7 = icmp eq i32 %0, 8
br i1 %cmp22.7, label %if.else.7, label %for.inc33.7
for.inc33.7: ; preds = %for.inc43.6
%cmp22.1.7 = icmp eq i32 %8, 8
br i1 %cmp22.1.7, label %if.else.7, label %for.inc33.1.7
for.inc33.1.7: ; preds = %for.inc33.7
%cmp22.2.7 = icmp eq i32 %9, 8
br i1 %cmp22.2.7, label %if.else.7, label %for.inc33.2.7
for.inc33.2.7: ; preds = %for.inc33.1.7
%cmp22.1166.7 = icmp eq i32 %10, 8
br i1 %cmp22.1166.7, label %if.else.7, label %for.inc33.1167.7
for.inc33.1167.7: ; preds = %for.inc33.2.7
%cmp22.1.1.7 = icmp eq i32 %11, 8
br i1 %cmp22.1.1.7, label %if.else.7, label %for.inc33.1.1.7
for.inc33.1.1.7: ; preds = %for.inc33.1167.7
%cmp22.2.1.7 = icmp eq i32 %12, 8
br i1 %cmp22.2.1.7, label %if.else.7, label %for.inc33.2.1.7
for.inc33.2.1.7: ; preds = %for.inc33.1.1.7
%cmp22.2169.7 = icmp eq i32 %13, 8
br i1 %cmp22.2169.7, label %if.else.7, label %for.inc33.2170.7
for.inc33.2170.7: ; preds = %for.inc33.2.1.7
%cmp22.1.2.7 = icmp eq i32 %14, 8
br i1 %cmp22.1.2.7, label %if.else.7, label %for.inc33.1.2.7
for.inc33.1.2.7: ; preds = %for.inc33.2170.7
%cmp22.2.2.7 = icmp eq i32 %15, 8
br i1 %cmp22.2.2.7, label %if.else.7, label %for.inc43.7
if.else.7: ; preds = %for.inc33.1.2.7, %for.inc33.2170.7, %for.inc33.2.1.7, %for.inc33.1.1.7, %for.inc33.1167.7, %for.inc33.2.7, %for.inc33.1.7, %for.inc33.7, %for.inc43.6
%r.0137.lcssa.neg.7 = phi double [ 2.000000e+00, %for.inc43.6 ], [ 2.000000e+00, %for.inc33.7 ], [ 2.000000e+00, %for.inc33.1.7 ], [ 1.000000e+00, %for.inc33.2.7 ], [ 1.000000e+00, %for.inc33.1167.7 ], [ 1.000000e+00, %for.inc33.1.1.7 ], [ 0.000000e+00, %for.inc33.2.1.7 ], [ 0.000000e+00, %for.inc33.2170.7 ], [ 0.000000e+00, %for.inc33.1.2.7 ]
%c.0136.lcssa.wide.neg.7 = phi double [ 1.000000e+00, %for.inc43.6 ], [ 0.000000e+00, %for.inc33.7 ], [ -1.000000e+00, %for.inc33.1.7 ], [ 1.000000e+00, %for.inc33.2.7 ], [ 0.000000e+00, %for.inc33.1167.7 ], [ -1.000000e+00, %for.inc33.1.1.7 ], [ 1.000000e+00, %for.inc33.2.1.7 ], [ 0.000000e+00, %for.inc33.2170.7 ], [ -1.000000e+00, %for.inc33.1.2.7 ]
%30 = call double @llvm.fabs.f64(double %r.0137.lcssa.neg.7)
%conv26.7 = fptosi double %30 to i32
%31 = call double @llvm.fabs.f64(double %c.0136.lcssa.wide.neg.7)
%conv30.7 = fptosi double %31 to i32
%add.7 = add i32 %md.4.6, %conv26.7
%add31.7 = add i32 %add.7, %conv30.7
br label %for.inc43.7
for.inc43.7: ; preds = %if.else.7, %for.inc33.1.2.7
%md.4.7 = phi i32 [ %add31.7, %if.else.7 ], [ %md.4.6, %for.inc33.1.2.7 ]
%add47 = add nuw nsw i32 %c_0.4.peel, %r_0.4.peel
%32 = and i32 %add47, 1
%cmp49 = icmp eq i32 %32, 0
%add70 = add i32 %md.4.7, 1
%33 = and i32 %md.4.7, 1
%cmp53 = icmp eq i32 %33, 0
br i1 %cmp49, label %for.cond46.preheader.split.us, label %for.cond46.preheader.split
for.cond46: ; preds = %for.cond46.preheader.split, %for.cond46
%i.2 = phi i32 [ %add84, %for.cond46 ], [ 0, %for.cond46.preheader.split ]
%add75 = add nsw i32 %i.2, %md.4.7
%call76 = call i32 @search(ptr noundef nonnull %board, i32 noundef %md.4.7, i32 noundef %add75, i32 noundef %r_0.4.peel, i32 noundef %c_0.4.peel)
%cmp79.not = icmp eq i32 %call76, -1
%add84 = add nuw nsw i32 %i.2, 2
br i1 %cmp79.not, label %for.cond46, label %for.end85
for.end85: ; preds = %for.cond46, %for.cond46.us142, %for.cond46.us, %for.cond46.us.us
%.us-phi = phi i32 [ %call57.us.us, %for.cond46.us.us ], [ %call62.us, %for.cond46.us ], [ %call72.us, %for.cond46.us142 ], [ %call76, %for.cond46 ]
%call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi)
call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %board) #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(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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>
#define n 3
typedef struct{
int A[n][n];
}puzzle;
int X[4]={0,1,0,-1};
int Y[4]={1,0,-1.0};
puzzle p;
int huri();
int dfs(int, int, int, int, int);
void target(puzzle);
int main(){
int i,j,k,x,y,t;
puzzle T;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
scanf("%d",&p.A[i][j]);
if(p.A[i][j]==0){
x=j;
y=i;
}
}
}
T=p;
for(i=1;i<46;i++){
p=T;
t=dfs(x,y,i,0,-1);
if(t!=-1){
printf("%d\n",t);
break;
}
}
return 0;
}
int huri(){
int i,j,sum=0,s,t;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(p.A[i][j]==0)continue;
t=(p.A[i][j]-1)/n-i;
s=(p.A[i][j]-1)%n-j;
if(s<0)sum=sum-s;
else sum=sum+s;
if(t<0)sum=sum-t;
else sum=sum+t;
}
}
return sum;
}
int dfs(int s, int t, int max, int count, int r){
int i,tmp,x,y,time,l;
l=huri();
if(l==0)return count;
else if(count+l>max)return -1;
for(i=0;i<4;i++){
x=s+X[i];
y=t+Y[i];
if((x<0||n<=x||y<0||3<=y)||(i==(r+2)%4 && r!=-1))continue;
tmp=p.A[t][s];
p.A[t][s]=p.A[y][x];
p.A[y][x]=tmp;
time=dfs(x,y,max,count+1,i);
if(time != -1)return time;
tmp=p.A[t][s];
p.A[t][s]=p.A[y][x];
p.A[y][x]=tmp;
}
return -1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189104/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189104/source.c"
target datalayout = "e-m:e-p270: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.puzzle = type { [3 x [3 x i32]] }
@X = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@Y = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 -1, i32 0], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@p = dso_local global %struct.puzzle zeroinitializer, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%T.sroa.0 = alloca [3 x [3 x i32]], align 4
call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %T.sroa.0)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @p)
%call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 0, i64 1))
%0 = load <4 x i32>, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 0, i64 1), align 4
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <8 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 0, i64 2))
%2 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 0, i64 2), align 4, !tbaa !5
%call.149 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 0))
%3 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 0), align 4, !tbaa !5
%call.1.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 1))
%4 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 1), align 4, !tbaa !5
%call.2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 2))
%5 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 2), align 4, !tbaa !5
%call.254 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 0))
%6 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 0), align 4, !tbaa !5
%call.1.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 1))
%7 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 1), align 4, !tbaa !5
%call.2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 2))
%8 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 2), align 4, !tbaa !5
%9 = insertelement <8 x i32> %1, i32 %2, i64 1
%10 = insertelement <8 x i32> %9, i32 %3, i64 2
%11 = insertelement <8 x i32> %10, i32 %4, i64 3
%12 = insertelement <8 x i32> %11, i32 %5, i64 4
%13 = insertelement <8 x i32> %12, i32 %6, i64 5
%14 = insertelement <8 x i32> %13, i32 %7, i64 6
%15 = insertelement <8 x i32> %14, i32 %8, i64 7
%16 = icmp eq <8 x i32> %15, zeroinitializer
%17 = extractelement <8 x i1> %16, i64 0
%spec.select.1 = zext i1 %17 to i32
%18 = extractelement <8 x i1> %16, i64 1
%spec.select.2 = select i1 %18, i32 2, i32 %spec.select.1
%19 = extractelement <8 x i1> %16, i64 2
%spec.select.151 = select i1 %19, i32 0, i32 %spec.select.2
%20 = extractelement <8 x i1> %16, i64 3
%spec.select.1.1 = select i1 %20, i32 1, i32 %spec.select.151
%21 = extractelement <8 x i1> %16, i64 4
%spec.select.2.1 = select i1 %21, i32 2, i32 %spec.select.1.1
%22 = select i1 %21, i1 true, i1 %20
%narrow58 = select i1 %22, i1 true, i1 %19
%spec.select37.2.1 = zext i1 %narrow58 to i32
%23 = extractelement <8 x i1> %16, i64 5
%spec.select.256 = select i1 %23, i32 0, i32 %spec.select.2.1
%24 = extractelement <8 x i1> %16, i64 6
%spec.select.1.2 = select i1 %24, i32 1, i32 %spec.select.256
%25 = extractelement <8 x i1> %16, i64 7
%spec.select.2.2 = select i1 %25, i32 2, i32 %spec.select.1.2
%26 = select i1 %25, i1 true, i1 %24
%27 = select i1 %26, i1 true, i1 %23
%spec.select37.2.2 = select i1 %27, i32 2, i32 %spec.select37.2.1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %T.sroa.0, ptr noundef nonnull align 4 dereferenceable(36) @p, i64 36, i1 false), !tbaa.struct !9
br label %for.body16
for.cond14: ; preds = %for.body16
%inc23 = add nuw nsw i32 %i.144, 1
%exitcond.not = icmp eq i32 %inc23, 46
br i1 %exitcond.not, label %for.end24, label %for.body16, !llvm.loop !11
for.body16: ; preds = %entry, %for.cond14
%i.144 = phi i32 [ 1, %entry ], [ %inc23, %for.cond14 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) @p, ptr noundef nonnull align 4 dereferenceable(36) %T.sroa.0, i64 36, i1 false), !tbaa.struct !9
%call17 = tail call i32 @dfs(i32 noundef %spec.select.2.2, i32 noundef %spec.select37.2.2, i32 noundef %i.144, i32 noundef 0, i32 noundef -1)
%cmp18.not = icmp eq i32 %call17, -1
br i1 %cmp18.not, label %for.cond14, label %if.then19
if.then19: ; preds = %for.body16
%call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call17)
br label %for.end24
for.end24: ; preds = %for.cond14, %if.then19
call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %T.sroa.0)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %s, i32 noundef %t, i32 noundef %max, i32 noundef %count, i32 noundef %r) local_unnamed_addr #4 {
entry:
%call = tail call i32 @huri()
%cmp = icmp eq i32 %call, 0
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%add = add nsw i32 %call, %count
%cmp1 = icmp sgt i32 %add, %max
br i1 %cmp1, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %if.else
%idxprom21 = sext i32 %t to i64
%idxprom23 = sext i32 %s to i64
%arrayidx24 = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom21, i64 %idxprom23
%cmp18.not = icmp eq i32 %r, -1
%add37 = add nsw i32 %count, 1
br i1 %cmp18.not, label %for.body.us.preheader, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%add16 = add nsw i32 %r, 2
%rem = srem i32 %add16, 4
%0 = load i32, ptr @X, align 16, !tbaa !5
%add5 = add nsw i32 %0, %s
%1 = load i32, ptr @Y, align 16, !tbaa !5
%add8 = add nsw i32 %1, %t
%or.cond = icmp ugt i32 %add5, 2
%cmp12 = icmp slt i32 %add8, 0
%or.cond63 = select i1 %or.cond, i1 true, i1 %cmp12
%cmp14 = icmp sgt i32 %add8, 2
%or.cond64 = select i1 %or.cond63, i1 true, i1 %cmp14
%cmp17 = icmp eq i32 %rem, 0
%or.cond99 = select i1 %or.cond64, i1 true, i1 %cmp17
br i1 %or.cond99, label %for.inc, label %if.end20
for.body.us.preheader: ; preds = %for.cond.preheader
%2 = load i32, ptr @X, align 16, !tbaa !5
%add5.us = add nsw i32 %2, %s
%3 = load i32, ptr @Y, align 16, !tbaa !5
%add8.us = add nsw i32 %3, %t
%or.cond.us = icmp ugt i32 %add5.us, 2
%cmp12.us = icmp slt i32 %add8.us, 0
%or.cond63.us = select i1 %or.cond.us, i1 true, i1 %cmp12.us
%cmp14.us = icmp sgt i32 %add8.us, 2
%or.cond64.us = select i1 %or.cond63.us, i1 true, i1 %cmp14.us
br i1 %or.cond64.us, label %for.inc.us, label %lor.lhs.false15.us
lor.lhs.false15.us: ; preds = %for.body.us.preheader
%4 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.us = zext i32 %add8.us to i64
%idxprom27.us = zext i32 %add5.us to i64
%arrayidx28.us = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom25.us, i64 %idxprom27.us
%5 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5
store i32 %5, ptr %arrayidx24, align 4, !tbaa !5
store i32 %4, ptr %arrayidx28.us, align 4, !tbaa !5
%call38.us = tail call i32 @dfs(i32 noundef %add5.us, i32 noundef %add8.us, i32 noundef %max, i32 noundef %add37, i32 noundef 0)
%cmp39.not.us = icmp eq i32 %call38.us, -1
br i1 %cmp39.not.us, label %if.end41.us, label %cleanup
if.end41.us: ; preds = %lor.lhs.false15.us
%6 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5
store i32 %7, ptr %arrayidx24, align 4, !tbaa !5
store i32 %6, ptr %arrayidx28.us, align 4, !tbaa !5
br label %for.inc.us
for.inc.us: ; preds = %if.end41.us, %for.body.us.preheader
%8 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @X, i64 0, i64 1), align 4, !tbaa !5
%add5.us.1 = add nsw i32 %8, %s
%9 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @Y, i64 0, i64 1), align 4, !tbaa !5
%add8.us.1 = add nsw i32 %9, %t
%or.cond.us.1 = icmp ugt i32 %add5.us.1, 2
%cmp12.us.1 = icmp slt i32 %add8.us.1, 0
%or.cond63.us.1 = select i1 %or.cond.us.1, i1 true, i1 %cmp12.us.1
%cmp14.us.1 = icmp sgt i32 %add8.us.1, 2
%or.cond64.us.1 = select i1 %or.cond63.us.1, i1 true, i1 %cmp14.us.1
br i1 %or.cond64.us.1, label %for.inc.us.1, label %lor.lhs.false15.us.1
lor.lhs.false15.us.1: ; preds = %for.inc.us
%10 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.us.1 = zext i32 %add8.us.1 to i64
%idxprom27.us.1 = zext i32 %add5.us.1 to i64
%arrayidx28.us.1 = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom25.us.1, i64 %idxprom27.us.1
%11 = load i32, ptr %arrayidx28.us.1, align 4, !tbaa !5
store i32 %11, ptr %arrayidx24, align 4, !tbaa !5
store i32 %10, ptr %arrayidx28.us.1, align 4, !tbaa !5
%call38.us.1 = tail call i32 @dfs(i32 noundef %add5.us.1, i32 noundef %add8.us.1, i32 noundef %max, i32 noundef %add37, i32 noundef 1)
%cmp39.not.us.1 = icmp eq i32 %call38.us.1, -1
br i1 %cmp39.not.us.1, label %if.end41.us.1, label %cleanup
if.end41.us.1: ; preds = %lor.lhs.false15.us.1
%12 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%13 = load i32, ptr %arrayidx28.us.1, align 4, !tbaa !5
store i32 %13, ptr %arrayidx24, align 4, !tbaa !5
store i32 %12, ptr %arrayidx28.us.1, align 4, !tbaa !5
br label %for.inc.us.1
for.inc.us.1: ; preds = %if.end41.us.1, %for.inc.us
%14 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @X, i64 0, i64 2), align 8, !tbaa !5
%add5.us.2 = add nsw i32 %14, %s
%15 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @Y, i64 0, i64 2), align 8, !tbaa !5
%add8.us.2 = add nsw i32 %15, %t
%or.cond.us.2 = icmp ugt i32 %add5.us.2, 2
%cmp12.us.2 = icmp slt i32 %add8.us.2, 0
%or.cond63.us.2 = select i1 %or.cond.us.2, i1 true, i1 %cmp12.us.2
%cmp14.us.2 = icmp sgt i32 %add8.us.2, 2
%or.cond64.us.2 = select i1 %or.cond63.us.2, i1 true, i1 %cmp14.us.2
br i1 %or.cond64.us.2, label %for.inc.us.2, label %lor.lhs.false15.us.2
lor.lhs.false15.us.2: ; preds = %for.inc.us.1
%16 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.us.2 = zext i32 %add8.us.2 to i64
%idxprom27.us.2 = zext i32 %add5.us.2 to i64
%arrayidx28.us.2 = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom25.us.2, i64 %idxprom27.us.2
%17 = load i32, ptr %arrayidx28.us.2, align 4, !tbaa !5
store i32 %17, ptr %arrayidx24, align 4, !tbaa !5
store i32 %16, ptr %arrayidx28.us.2, align 4, !tbaa !5
%call38.us.2 = tail call i32 @dfs(i32 noundef %add5.us.2, i32 noundef %add8.us.2, i32 noundef %max, i32 noundef %add37, i32 noundef 2)
%cmp39.not.us.2 = icmp eq i32 %call38.us.2, -1
br i1 %cmp39.not.us.2, label %if.end41.us.2, label %cleanup
if.end41.us.2: ; preds = %lor.lhs.false15.us.2
%18 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx28.us.2, align 4, !tbaa !5
store i32 %19, ptr %arrayidx24, align 4, !tbaa !5
store i32 %18, ptr %arrayidx28.us.2, align 4, !tbaa !5
br label %for.inc.us.2
for.inc.us.2: ; preds = %if.end41.us.2, %for.inc.us.1
%20 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @X, i64 0, i64 3), align 4, !tbaa !5
%add5.us.3 = add nsw i32 %20, %s
%21 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @Y, i64 0, i64 3), align 4, !tbaa !5
%add8.us.3 = add nsw i32 %21, %t
%or.cond.us.3 = icmp ugt i32 %add5.us.3, 2
%cmp12.us.3 = icmp slt i32 %add8.us.3, 0
%or.cond63.us.3 = select i1 %or.cond.us.3, i1 true, i1 %cmp12.us.3
%cmp14.us.3 = icmp sgt i32 %add8.us.3, 2
%or.cond64.us.3 = select i1 %or.cond63.us.3, i1 true, i1 %cmp14.us.3
br i1 %or.cond64.us.3, label %cleanup, label %lor.lhs.false15.us.3
lor.lhs.false15.us.3: ; preds = %for.inc.us.2
%22 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.us.3 = zext i32 %add8.us.3 to i64
%idxprom27.us.3 = zext i32 %add5.us.3 to i64
%arrayidx28.us.3 = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom25.us.3, i64 %idxprom27.us.3
%23 = load i32, ptr %arrayidx28.us.3, align 4, !tbaa !5
store i32 %23, ptr %arrayidx24, align 4, !tbaa !5
store i32 %22, ptr %arrayidx28.us.3, align 4, !tbaa !5
%call38.us.3 = tail call i32 @dfs(i32 noundef %add5.us.3, i32 noundef %add8.us.3, i32 noundef %max, i32 noundef %add37, i32 noundef 3)
%cmp39.not.us.3 = icmp eq i32 %call38.us.3, -1
br i1 %cmp39.not.us.3, label %cleanup.sink.split, label %cleanup
if.end20: ; preds = %for.body.preheader
%24 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = zext i32 %add8 to i64
%idxprom27 = zext i32 %add5 to i64
%arrayidx28 = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom25, i64 %idxprom27
%25 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %25, ptr %arrayidx24, align 4, !tbaa !5
store i32 %24, ptr %arrayidx28, align 4, !tbaa !5
%call38 = tail call i32 @dfs(i32 noundef %add5, i32 noundef %add8, i32 noundef %max, i32 noundef %add37, i32 noundef 0)
%cmp39.not = icmp eq i32 %call38, -1
br i1 %cmp39.not, label %if.end41, label %cleanup
if.end41: ; preds = %if.end20
%26 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%27 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %27, ptr %arrayidx24, align 4, !tbaa !5
store i32 %26, ptr %arrayidx28, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body.preheader, %if.end41
%28 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @X, i64 0, i64 1), align 4, !tbaa !5
%add5.1 = add nsw i32 %28, %s
%29 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @Y, i64 0, i64 1), align 4, !tbaa !5
%add8.1 = add nsw i32 %29, %t
%or.cond.1 = icmp ugt i32 %add5.1, 2
%cmp12.1 = icmp slt i32 %add8.1, 0
%or.cond63.1 = select i1 %or.cond.1, i1 true, i1 %cmp12.1
%cmp14.1 = icmp sgt i32 %add8.1, 2
%or.cond64.1 = select i1 %or.cond63.1, i1 true, i1 %cmp14.1
%cmp17.1 = icmp eq i32 %rem, 1
%or.cond99.1 = select i1 %or.cond64.1, i1 true, i1 %cmp17.1
br i1 %or.cond99.1, label %for.inc.1, label %if.end20.1
if.end20.1: ; preds = %for.inc
%30 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.1 = zext i32 %add8.1 to i64
%idxprom27.1 = zext i32 %add5.1 to i64
%arrayidx28.1 = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom25.1, i64 %idxprom27.1
%31 = load i32, ptr %arrayidx28.1, align 4, !tbaa !5
store i32 %31, ptr %arrayidx24, align 4, !tbaa !5
store i32 %30, ptr %arrayidx28.1, align 4, !tbaa !5
%call38.1 = tail call i32 @dfs(i32 noundef %add5.1, i32 noundef %add8.1, i32 noundef %max, i32 noundef %add37, i32 noundef 1)
%cmp39.not.1 = icmp eq i32 %call38.1, -1
br i1 %cmp39.not.1, label %if.end41.1, label %cleanup
if.end41.1: ; preds = %if.end20.1
%32 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%33 = load i32, ptr %arrayidx28.1, align 4, !tbaa !5
store i32 %33, ptr %arrayidx24, align 4, !tbaa !5
store i32 %32, ptr %arrayidx28.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end41.1, %for.inc
%34 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @X, i64 0, i64 2), align 8, !tbaa !5
%add5.2 = add nsw i32 %34, %s
%35 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @Y, i64 0, i64 2), align 8, !tbaa !5
%add8.2 = add nsw i32 %35, %t
%or.cond.2 = icmp ugt i32 %add5.2, 2
%cmp12.2 = icmp slt i32 %add8.2, 0
%or.cond63.2 = select i1 %or.cond.2, i1 true, i1 %cmp12.2
%cmp14.2 = icmp sgt i32 %add8.2, 2
%or.cond64.2 = select i1 %or.cond63.2, i1 true, i1 %cmp14.2
%cmp17.2 = icmp eq i32 %rem, 2
%or.cond99.2 = select i1 %or.cond64.2, i1 true, i1 %cmp17.2
br i1 %or.cond99.2, label %for.inc.2, label %if.end20.2
if.end20.2: ; preds = %for.inc.1
%36 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.2 = zext i32 %add8.2 to i64
%idxprom27.2 = zext i32 %add5.2 to i64
%arrayidx28.2 = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom25.2, i64 %idxprom27.2
%37 = load i32, ptr %arrayidx28.2, align 4, !tbaa !5
store i32 %37, ptr %arrayidx24, align 4, !tbaa !5
store i32 %36, ptr %arrayidx28.2, align 4, !tbaa !5
%call38.2 = tail call i32 @dfs(i32 noundef %add5.2, i32 noundef %add8.2, i32 noundef %max, i32 noundef %add37, i32 noundef 2)
%cmp39.not.2 = icmp eq i32 %call38.2, -1
br i1 %cmp39.not.2, label %if.end41.2, label %cleanup
if.end41.2: ; preds = %if.end20.2
%38 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%39 = load i32, ptr %arrayidx28.2, align 4, !tbaa !5
store i32 %39, ptr %arrayidx24, align 4, !tbaa !5
store i32 %38, ptr %arrayidx28.2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end41.2, %for.inc.1
%40 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @X, i64 0, i64 3), align 4, !tbaa !5
%add5.3 = add nsw i32 %40, %s
%41 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @Y, i64 0, i64 3), align 4, !tbaa !5
%add8.3 = add nsw i32 %41, %t
%or.cond.3 = icmp ugt i32 %add5.3, 2
%cmp12.3 = icmp slt i32 %add8.3, 0
%or.cond63.3 = select i1 %or.cond.3, i1 true, i1 %cmp12.3
%cmp14.3 = icmp sgt i32 %add8.3, 2
%or.cond64.3 = select i1 %or.cond63.3, i1 true, i1 %cmp14.3
%cmp17.3 = icmp eq i32 %rem, 3
%or.cond99.3 = select i1 %or.cond64.3, i1 true, i1 %cmp17.3
br i1 %or.cond99.3, label %cleanup, label %if.end20.3
if.end20.3: ; preds = %for.inc.2
%42 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.3 = zext i32 %add8.3 to i64
%idxprom27.3 = zext i32 %add5.3 to i64
%arrayidx28.3 = getelementptr inbounds [3 x [3 x i32]], ptr @p, i64 0, i64 %idxprom25.3, i64 %idxprom27.3
%43 = load i32, ptr %arrayidx28.3, align 4, !tbaa !5
store i32 %43, ptr %arrayidx24, align 4, !tbaa !5
store i32 %42, ptr %arrayidx28.3, align 4, !tbaa !5
%call38.3 = tail call i32 @dfs(i32 noundef %add5.3, i32 noundef %add8.3, i32 noundef %max, i32 noundef %add37, i32 noundef 3)
%cmp39.not.3 = icmp eq i32 %call38.3, -1
br i1 %cmp39.not.3, label %cleanup.sink.split, label %cleanup
cleanup.sink.split: ; preds = %if.end20.3, %lor.lhs.false15.us.3
%arrayidx28.3.sink105 = phi ptr [ %arrayidx28.us.3, %lor.lhs.false15.us.3 ], [ %arrayidx28.3, %if.end20.3 ]
%44 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%45 = load i32, ptr %arrayidx28.3.sink105, align 4, !tbaa !5
store i32 %45, ptr %arrayidx24, align 4, !tbaa !5
store i32 %44, ptr %arrayidx28.3.sink105, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %cleanup.sink.split, %if.end20, %if.end20.1, %if.end20.2, %if.end20.3, %for.inc.2, %lor.lhs.false15.us, %lor.lhs.false15.us.1, %lor.lhs.false15.us.2, %lor.lhs.false15.us.3, %for.inc.us.2, %if.else, %entry
%retval.0 = phi i32 [ %count, %entry ], [ -1, %if.else ], [ %call38.us, %lor.lhs.false15.us ], [ %call38.us.1, %lor.lhs.false15.us.1 ], [ %call38.us.2, %lor.lhs.false15.us.2 ], [ %call38.us.3, %lor.lhs.false15.us.3 ], [ -1, %for.inc.us.2 ], [ %call38, %if.end20 ], [ %call38.1, %if.end20.1 ], [ %call38.2, %if.end20.2 ], [ %call38.3, %if.end20.3 ], [ -1, %for.inc.2 ], [ -1, %cleanup.sink.split ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @huri() local_unnamed_addr #5 {
entry:
%0 = load i32, ptr @p, align 4, !tbaa !5
%cmp6 = icmp eq i32 %0, 0
br i1 %cmp6, label %for.inc, label %if.end
if.end: ; preds = %entry
%sub = add nsw i32 %0, -1
%div = sdiv i32 %sub, 3
%rem = srem i32 %sub, 3
%sum.2.p = tail call i32 @llvm.abs.i32(i32 %rem, i1 true)
%cmp22 = icmp slt i32 %0, -1
br i1 %cmp22, label %if.then23, label %if.else25
if.then23: ; preds = %if.end
%sub24 = sub nsw i32 %sum.2.p, %div
br label %for.inc
if.else25: ; preds = %if.end
%add26 = add nsw i32 %sum.2.p, %div
br label %for.inc
for.inc: ; preds = %if.then23, %if.else25, %entry
%sum.3 = phi i32 [ 0, %entry ], [ %sub24, %if.then23 ], [ %add26, %if.else25 ]
%1 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 0, i64 1), align 4, !tbaa !5
%cmp6.1 = icmp eq i32 %1, 0
br i1 %cmp6.1, label %for.inc.1, label %if.end.1
if.end.1: ; preds = %for.inc
%sub.1 = add nsw i32 %1, -1
%div.1 = sdiv i32 %sub.1, 3
%rem.1 = srem i32 %sub.1, 3
%sub17.1 = add nsw i32 %rem.1, -1
%sum.2.p.1 = tail call i32 @llvm.abs.i32(i32 %sub17.1, i1 true)
%sum.2.1 = add nsw i32 %sum.2.p.1, %sum.3
%cmp22.1 = icmp slt i32 %1, -1
br i1 %cmp22.1, label %if.then23.1, label %if.else25.1
if.else25.1: ; preds = %if.end.1
%add26.1 = add nsw i32 %sum.2.1, %div.1
br label %for.inc.1
if.then23.1: ; preds = %if.end.1
%sub24.1 = sub nsw i32 %sum.2.1, %div.1
br label %for.inc.1
for.inc.1: ; preds = %if.then23.1, %if.else25.1, %for.inc
%sum.3.1 = phi i32 [ %sum.3, %for.inc ], [ %sub24.1, %if.then23.1 ], [ %add26.1, %if.else25.1 ]
%2 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 0, i64 2), align 4, !tbaa !5
%cmp6.2 = icmp eq i32 %2, 0
br i1 %cmp6.2, label %for.inc.2, label %if.end.2
if.end.2: ; preds = %for.inc.1
%sub.2 = add nsw i32 %2, -1
%div.2 = sdiv i32 %sub.2, 3
%rem.2 = srem i32 %sub.2, 3
%reass.sub = sub i32 %sum.3.1, %rem.2
%sum.2.2 = add i32 %reass.sub, 2
%cmp22.2 = icmp slt i32 %2, -1
br i1 %cmp22.2, label %if.then23.2, label %if.else25.2
if.else25.2: ; preds = %if.end.2
%add26.2 = add nsw i32 %sum.2.2, %div.2
br label %for.inc.2
if.then23.2: ; preds = %if.end.2
%sub24.2 = sub nsw i32 %sum.2.2, %div.2
br label %for.inc.2
for.inc.2: ; preds = %if.then23.2, %if.else25.2, %for.inc.1
%sum.3.2 = phi i32 [ %sum.3.1, %for.inc.1 ], [ %sub24.2, %if.then23.2 ], [ %add26.2, %if.else25.2 ]
%3 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 0), align 4, !tbaa !5
%cmp6.156 = icmp eq i32 %3, 0
br i1 %cmp6.156, label %for.inc.170, label %if.end.164
if.end.164: ; preds = %for.inc.2
%sub.157 = add nsw i32 %3, -1
%div.158 = sdiv i32 %sub.157, 3
%sub11.159 = add nsw i32 %div.158, -1
%rem.160 = srem i32 %sub.157, 3
%sum.2.p.161 = tail call i32 @llvm.abs.i32(i32 %rem.160, i1 true)
%sum.2.162 = add i32 %sum.2.p.161, %sum.3.2
%cmp22.163 = icmp slt i32 %3, 4
br i1 %cmp22.163, label %if.then23.168, label %if.else25.166
if.else25.166: ; preds = %if.end.164
%add26.165 = add nsw i32 %sum.2.162, %sub11.159
br label %for.inc.170
if.then23.168: ; preds = %if.end.164
%sub24.167 = sub nsw i32 %sum.2.162, %sub11.159
br label %for.inc.170
for.inc.170: ; preds = %if.then23.168, %if.else25.166, %for.inc.2
%sum.3.169 = phi i32 [ %sum.3.2, %for.inc.2 ], [ %sub24.167, %if.then23.168 ], [ %add26.165, %if.else25.166 ]
%4 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 1), align 4, !tbaa !5
%cmp6.1.1 = icmp eq i32 %4, 0
br i1 %cmp6.1.1, label %for.inc.1.1, label %if.end.1.1
if.end.1.1: ; preds = %for.inc.170
%sub.1.1 = add nsw i32 %4, -1
%div.1.1 = sdiv i32 %sub.1.1, 3
%sub11.1.1 = add nsw i32 %div.1.1, -1
%rem.1.1 = srem i32 %sub.1.1, 3
%sub17.1.1 = add nsw i32 %rem.1.1, -1
%sum.2.p.1.1 = tail call i32 @llvm.abs.i32(i32 %sub17.1.1, i1 true)
%sum.2.1.1 = add i32 %sum.2.p.1.1, %sum.3.169
%cmp22.1.1 = icmp slt i32 %4, 4
br i1 %cmp22.1.1, label %if.then23.1.1, label %if.else25.1.1
if.else25.1.1: ; preds = %if.end.1.1
%add26.1.1 = add nsw i32 %sum.2.1.1, %sub11.1.1
br label %for.inc.1.1
if.then23.1.1: ; preds = %if.end.1.1
%sub24.1.1 = sub nsw i32 %sum.2.1.1, %sub11.1.1
br label %for.inc.1.1
for.inc.1.1: ; preds = %if.then23.1.1, %if.else25.1.1, %for.inc.170
%sum.3.1.1 = phi i32 [ %sum.3.169, %for.inc.170 ], [ %sub24.1.1, %if.then23.1.1 ], [ %add26.1.1, %if.else25.1.1 ]
%5 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 1, i64 2), align 4, !tbaa !5
%cmp6.2.1 = icmp eq i32 %5, 0
br i1 %cmp6.2.1, label %for.inc.2.1, label %if.end.2.1
if.end.2.1: ; preds = %for.inc.1.1
%sub.2.1 = add nsw i32 %5, -1
%div.2.1 = sdiv i32 %sub.2.1, 3
%sub11.2.1 = add nsw i32 %div.2.1, -1
%rem.2.1 = srem i32 %sub.2.1, 3
%reass.sub90 = sub i32 %sum.3.1.1, %rem.2.1
%sum.2.2.1 = add i32 %reass.sub90, 2
%cmp22.2.1 = icmp slt i32 %5, 4
br i1 %cmp22.2.1, label %if.then23.2.1, label %if.else25.2.1
if.else25.2.1: ; preds = %if.end.2.1
%add26.2.1 = add nsw i32 %sum.2.2.1, %sub11.2.1
br label %for.inc.2.1
if.then23.2.1: ; preds = %if.end.2.1
%sub24.2.1 = sub nsw i32 %sum.2.2.1, %sub11.2.1
br label %for.inc.2.1
for.inc.2.1: ; preds = %if.then23.2.1, %if.else25.2.1, %for.inc.1.1
%sum.3.2.1 = phi i32 [ %sum.3.1.1, %for.inc.1.1 ], [ %sub24.2.1, %if.then23.2.1 ], [ %add26.2.1, %if.else25.2.1 ]
%6 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 0), align 4, !tbaa !5
%cmp6.272 = icmp eq i32 %6, 0
br i1 %cmp6.272, label %for.inc.286, label %if.end.280
if.end.280: ; preds = %for.inc.2.1
%sub.273 = add nsw i32 %6, -1
%div.274 = sdiv i32 %sub.273, 3
%sub11.275 = add nsw i32 %div.274, -2
%rem.276 = srem i32 %sub.273, 3
%sum.2.p.277 = tail call i32 @llvm.abs.i32(i32 %rem.276, i1 true)
%sum.2.278 = add i32 %sum.2.p.277, %sum.3.2.1
%cmp22.279 = icmp slt i32 %6, 7
br i1 %cmp22.279, label %if.then23.284, label %if.else25.282
if.else25.282: ; preds = %if.end.280
%add26.281 = add nsw i32 %sum.2.278, %sub11.275
br label %for.inc.286
if.then23.284: ; preds = %if.end.280
%sub24.283 = sub nsw i32 %sum.2.278, %sub11.275
br label %for.inc.286
for.inc.286: ; preds = %if.then23.284, %if.else25.282, %for.inc.2.1
%sum.3.285 = phi i32 [ %sum.3.2.1, %for.inc.2.1 ], [ %sub24.283, %if.then23.284 ], [ %add26.281, %if.else25.282 ]
%7 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 1), align 4, !tbaa !5
%cmp6.1.2 = icmp eq i32 %7, 0
br i1 %cmp6.1.2, label %for.inc.1.2, label %if.end.1.2
if.end.1.2: ; preds = %for.inc.286
%sub.1.2 = add nsw i32 %7, -1
%div.1.2 = sdiv i32 %sub.1.2, 3
%sub11.1.2 = add nsw i32 %div.1.2, -2
%rem.1.2 = srem i32 %sub.1.2, 3
%sub17.1.2 = add nsw i32 %rem.1.2, -1
%sum.2.p.1.2 = tail call i32 @llvm.abs.i32(i32 %sub17.1.2, i1 true)
%sum.2.1.2 = add i32 %sum.2.p.1.2, %sum.3.285
%cmp22.1.2 = icmp slt i32 %7, 7
br i1 %cmp22.1.2, label %if.then23.1.2, label %if.else25.1.2
if.else25.1.2: ; preds = %if.end.1.2
%add26.1.2 = add nsw i32 %sum.2.1.2, %sub11.1.2
br label %for.inc.1.2
if.then23.1.2: ; preds = %if.end.1.2
%sub24.1.2 = sub nsw i32 %sum.2.1.2, %sub11.1.2
br label %for.inc.1.2
for.inc.1.2: ; preds = %if.then23.1.2, %if.else25.1.2, %for.inc.286
%sum.3.1.2 = phi i32 [ %sum.3.285, %for.inc.286 ], [ %sub24.1.2, %if.then23.1.2 ], [ %add26.1.2, %if.else25.1.2 ]
%8 = load i32, ptr getelementptr inbounds (%struct.puzzle, ptr @p, i64 0, i32 0, i64 2, i64 2), align 4, !tbaa !5
%cmp6.2.2 = icmp eq i32 %8, 0
br i1 %cmp6.2.2, label %for.inc.2.2, label %if.end.2.2
if.end.2.2: ; preds = %for.inc.1.2
%sub.2.2 = add nsw i32 %8, -1
%div.2.2 = sdiv i32 %sub.2.2, 3
%rem.2.2 = srem i32 %sub.2.2, 3
%reass.sub91 = sub i32 %sum.3.1.2, %rem.2.2
%cmp22.2.2 = icmp slt i32 %8, 7
br i1 %cmp22.2.2, label %if.then23.2.2, label %if.else25.2.2
if.else25.2.2: ; preds = %if.end.2.2
%add26.2.2 = add i32 %reass.sub91, %div.2.2
br label %for.inc.2.2
if.then23.2.2: ; preds = %if.end.2.2
%9 = sub i32 %reass.sub91, %div.2.2
%sub24.2.2 = add i32 %9, 4
br label %for.inc.2.2
for.inc.2.2: ; preds = %if.then23.2.2, %if.else25.2.2, %for.inc.1.2
%sum.3.2.2 = phi i32 [ %sum.3.1.2, %for.inc.1.2 ], [ %sub24.2.2, %if.then23.2.2 ], [ %add26.2.2, %if.else25.2.2 ]
ret i32 %sum.3.2.2
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, 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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nosync nounwind memory(readwrite, argmem: 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 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i64 0, i64 36, !10}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#define M 3
typedef struct{
int A[M][M];
}Pazzle;
Pazzle P;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int heuristic(Pazzle P){
int i,j;
int hx,hy,sum=0;
for(i=0; i<M; i++){
for(j=0; j<M; j++){
if(P.A[i][j] == 0)continue;
hx = (P.A[i][j]-1)%M-j;
hy = (P.A[i][j]-1)/M-i;
if(hx < 0)sum -= hx;
else sum += hx;
if(hy < 0)sum -= hy;
else sum += hy;
}
}
return sum;
}
int dfs(int x,int y,int max,int cnt,int n){
int i,temp;
int x0,y0,ans=-1,h;
h = heuristic(P);
if(h == 0)return cnt;
if(cnt + h > max)return -1;
for(i=0; i<4; i++){
x0 = x + dx[i];
y0 = y + dy[i];
if((i == (n+2)%4 && n != -1) || !(0<=x0 && x0<M && 0<=y0 && y0<M))continue;
temp = P.A[y][x];
P.A[y][x] = P.A[y0][x0];
P.A[y0][x0] = temp;
ans = dfs(x0,y0,max,cnt+1,i);
if(ans != -1)return ans;
temp = P.A[y][x];
P.A[y][x] = P.A[y0][x0];
P.A[y0][x0] = temp;
}
return -1;
}
int main(){
int i,j;
int kx,ky,ans,a;
Pazzle tP;
for(i=0; i<M; i++){
for(j=0; j<M; j++){
scanf("%d",&a);
P.A[i][j] = a;
if(a == 0){
kx = j;
ky = i;
}
}
}
tP = P;
for(i=1; i<46; i++){
P=tP;
ans = dfs(kx,ky,i,0,-1);
if(ans != -1){
printf("%d\n",ans);
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189148/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189148/source.c"
target datalayout = "e-m:e-p270: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.Pazzle = type { [3 x [3 x i32]] }
@dx = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@dy = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 -1, i32 0], align 16
@P = dso_local local_unnamed_addr global %struct.Pazzle zeroinitializer, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @heuristic(ptr nocapture noundef readonly byval(%struct.Pazzle) align 8 %P) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %P, align 8, !tbaa !5
%cmp6 = icmp eq i32 %0, 0
br i1 %cmp6, label %for.inc, label %if.end
if.end: ; preds = %entry
%sub = add nsw i32 %0, -1
%rem = srem i32 %sub, 3
%div = sdiv i32 %sub, 3
%sum.2.p = tail call i32 @llvm.abs.i32(i32 %rem, i1 true)
%cmp24 = icmp slt i32 %0, -1
br i1 %cmp24, label %if.then25, label %if.else27
if.then25: ; preds = %if.end
%sub26 = sub nsw i32 %sum.2.p, %div
br label %for.inc
if.else27: ; preds = %if.end
%add28 = add nsw i32 %sum.2.p, %div
br label %for.inc
for.inc: ; preds = %if.then25, %if.else27, %entry
%sum.3 = phi i32 [ 0, %entry ], [ %sub26, %if.then25 ], [ %add28, %if.else27 ]
%arrayidx5.1 = getelementptr inbounds [3 x [3 x i32]], ptr %P, i64 0, i64 0, i64 1
%1 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.1 = icmp eq i32 %1, 0
br i1 %cmp6.1, label %for.inc.1, label %if.end.1
if.end.1: ; preds = %for.inc
%sub.1 = add nsw i32 %1, -1
%rem.1 = srem i32 %sub.1, 3
%sub12.1 = add nsw i32 %rem.1, -1
%div.1 = sdiv i32 %sub.1, 3
%sum.2.p.1 = tail call i32 @llvm.abs.i32(i32 %sub12.1, i1 true)
%sum.2.1 = add nsw i32 %sum.2.p.1, %sum.3
%cmp24.1 = icmp slt i32 %1, -1
br i1 %cmp24.1, label %if.then25.1, label %if.else27.1
if.else27.1: ; preds = %if.end.1
%add28.1 = add nsw i32 %sum.2.1, %div.1
br label %for.inc.1
if.then25.1: ; preds = %if.end.1
%sub26.1 = sub nsw i32 %sum.2.1, %div.1
br label %for.inc.1
for.inc.1: ; preds = %if.then25.1, %if.else27.1, %for.inc
%sum.3.1 = phi i32 [ %sum.3, %for.inc ], [ %sub26.1, %if.then25.1 ], [ %add28.1, %if.else27.1 ]
%arrayidx5.2 = getelementptr inbounds [3 x [3 x i32]], ptr %P, i64 0, i64 0, i64 2
%2 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%cmp6.2 = icmp eq i32 %2, 0
br i1 %cmp6.2, label %for.inc.2, label %if.end.2
if.end.2: ; preds = %for.inc.1
%sub.2 = add nsw i32 %2, -1
%rem.2 = srem i32 %sub.2, 3
%div.2 = sdiv i32 %sub.2, 3
%reass.sub = sub i32 %sum.3.1, %rem.2
%sum.2.2 = add i32 %reass.sub, 2
%cmp24.2 = icmp slt i32 %2, -1
br i1 %cmp24.2, label %if.then25.2, label %if.else27.2
if.else27.2: ; preds = %if.end.2
%add28.2 = add nsw i32 %sum.2.2, %div.2
br label %for.inc.2
if.then25.2: ; preds = %if.end.2
%sub26.2 = sub nsw i32 %sum.2.2, %div.2
br label %for.inc.2
for.inc.2: ; preds = %if.then25.2, %if.else27.2, %for.inc.1
%sum.3.2 = phi i32 [ %sum.3.1, %for.inc.1 ], [ %sub26.2, %if.then25.2 ], [ %add28.2, %if.else27.2 ]
%arrayidx5.157 = getelementptr inbounds [3 x [3 x i32]], ptr %P, i64 0, i64 1, i64 0
%3 = load i32, ptr %arrayidx5.157, align 4, !tbaa !5
%cmp6.158 = icmp eq i32 %3, 0
br i1 %cmp6.158, label %for.inc.172, label %if.end.166
if.end.166: ; preds = %for.inc.2
%sub.159 = add nsw i32 %3, -1
%rem.160 = srem i32 %sub.159, 3
%div.161 = sdiv i32 %sub.159, 3
%sub19.162 = add nsw i32 %div.161, -1
%sum.2.p.163 = tail call i32 @llvm.abs.i32(i32 %rem.160, i1 true)
%sum.2.164 = add i32 %sum.2.p.163, %sum.3.2
%cmp24.165 = icmp slt i32 %3, 4
br i1 %cmp24.165, label %if.then25.170, label %if.else27.168
if.else27.168: ; preds = %if.end.166
%add28.167 = add nsw i32 %sum.2.164, %sub19.162
br label %for.inc.172
if.then25.170: ; preds = %if.end.166
%sub26.169 = sub nsw i32 %sum.2.164, %sub19.162
br label %for.inc.172
for.inc.172: ; preds = %if.then25.170, %if.else27.168, %for.inc.2
%sum.3.171 = phi i32 [ %sum.3.2, %for.inc.2 ], [ %sub26.169, %if.then25.170 ], [ %add28.167, %if.else27.168 ]
%arrayidx5.1.1 = getelementptr inbounds [3 x [3 x i32]], ptr %P, i64 0, i64 1, i64 1
%4 = load i32, ptr %arrayidx5.1.1, align 8, !tbaa !5
%cmp6.1.1 = icmp eq i32 %4, 0
br i1 %cmp6.1.1, label %for.inc.1.1, label %if.end.1.1
if.end.1.1: ; preds = %for.inc.172
%sub.1.1 = add nsw i32 %4, -1
%rem.1.1 = srem i32 %sub.1.1, 3
%sub12.1.1 = add nsw i32 %rem.1.1, -1
%div.1.1 = sdiv i32 %sub.1.1, 3
%sub19.1.1 = add nsw i32 %div.1.1, -1
%sum.2.p.1.1 = tail call i32 @llvm.abs.i32(i32 %sub12.1.1, i1 true)
%sum.2.1.1 = add i32 %sum.2.p.1.1, %sum.3.171
%cmp24.1.1 = icmp slt i32 %4, 4
br i1 %cmp24.1.1, label %if.then25.1.1, label %if.else27.1.1
if.else27.1.1: ; preds = %if.end.1.1
%add28.1.1 = add nsw i32 %sum.2.1.1, %sub19.1.1
br label %for.inc.1.1
if.then25.1.1: ; preds = %if.end.1.1
%sub26.1.1 = sub nsw i32 %sum.2.1.1, %sub19.1.1
br label %for.inc.1.1
for.inc.1.1: ; preds = %if.then25.1.1, %if.else27.1.1, %for.inc.172
%sum.3.1.1 = phi i32 [ %sum.3.171, %for.inc.172 ], [ %sub26.1.1, %if.then25.1.1 ], [ %add28.1.1, %if.else27.1.1 ]
%arrayidx5.2.1 = getelementptr inbounds [3 x [3 x i32]], ptr %P, i64 0, i64 1, i64 2
%5 = load i32, ptr %arrayidx5.2.1, align 4, !tbaa !5
%cmp6.2.1 = icmp eq i32 %5, 0
br i1 %cmp6.2.1, label %for.inc.2.1, label %if.end.2.1
if.end.2.1: ; preds = %for.inc.1.1
%sub.2.1 = add nsw i32 %5, -1
%rem.2.1 = srem i32 %sub.2.1, 3
%div.2.1 = sdiv i32 %sub.2.1, 3
%sub19.2.1 = add nsw i32 %div.2.1, -1
%reass.sub92 = sub i32 %sum.3.1.1, %rem.2.1
%sum.2.2.1 = add i32 %reass.sub92, 2
%cmp24.2.1 = icmp slt i32 %5, 4
br i1 %cmp24.2.1, label %if.then25.2.1, label %if.else27.2.1
if.else27.2.1: ; preds = %if.end.2.1
%add28.2.1 = add nsw i32 %sum.2.2.1, %sub19.2.1
br label %for.inc.2.1
if.then25.2.1: ; preds = %if.end.2.1
%sub26.2.1 = sub nsw i32 %sum.2.2.1, %sub19.2.1
br label %for.inc.2.1
for.inc.2.1: ; preds = %if.then25.2.1, %if.else27.2.1, %for.inc.1.1
%sum.3.2.1 = phi i32 [ %sum.3.1.1, %for.inc.1.1 ], [ %sub26.2.1, %if.then25.2.1 ], [ %add28.2.1, %if.else27.2.1 ]
%arrayidx5.273 = getelementptr inbounds [3 x [3 x i32]], ptr %P, i64 0, i64 2, i64 0
%6 = load i32, ptr %arrayidx5.273, align 8, !tbaa !5
%cmp6.274 = icmp eq i32 %6, 0
br i1 %cmp6.274, label %for.inc.288, label %if.end.282
if.end.282: ; preds = %for.inc.2.1
%sub.275 = add nsw i32 %6, -1
%rem.276 = srem i32 %sub.275, 3
%div.277 = sdiv i32 %sub.275, 3
%sub19.278 = add nsw i32 %div.277, -2
%sum.2.p.279 = tail call i32 @llvm.abs.i32(i32 %rem.276, i1 true)
%sum.2.280 = add i32 %sum.2.p.279, %sum.3.2.1
%cmp24.281 = icmp slt i32 %6, 7
br i1 %cmp24.281, label %if.then25.286, label %if.else27.284
if.else27.284: ; preds = %if.end.282
%add28.283 = add nsw i32 %sum.2.280, %sub19.278
br label %for.inc.288
if.then25.286: ; preds = %if.end.282
%sub26.285 = sub nsw i32 %sum.2.280, %sub19.278
br label %for.inc.288
for.inc.288: ; preds = %if.then25.286, %if.else27.284, %for.inc.2.1
%sum.3.287 = phi i32 [ %sum.3.2.1, %for.inc.2.1 ], [ %sub26.285, %if.then25.286 ], [ %add28.283, %if.else27.284 ]
%arrayidx5.1.2 = getelementptr inbounds [3 x [3 x i32]], ptr %P, i64 0, i64 2, i64 1
%7 = load i32, ptr %arrayidx5.1.2, align 4, !tbaa !5
%cmp6.1.2 = icmp eq i32 %7, 0
br i1 %cmp6.1.2, label %for.inc.1.2, label %if.end.1.2
if.end.1.2: ; preds = %for.inc.288
%sub.1.2 = add nsw i32 %7, -1
%rem.1.2 = srem i32 %sub.1.2, 3
%sub12.1.2 = add nsw i32 %rem.1.2, -1
%div.1.2 = sdiv i32 %sub.1.2, 3
%sub19.1.2 = add nsw i32 %div.1.2, -2
%sum.2.p.1.2 = tail call i32 @llvm.abs.i32(i32 %sub12.1.2, i1 true)
%sum.2.1.2 = add i32 %sum.2.p.1.2, %sum.3.287
%cmp24.1.2 = icmp slt i32 %7, 7
br i1 %cmp24.1.2, label %if.then25.1.2, label %if.else27.1.2
if.else27.1.2: ; preds = %if.end.1.2
%add28.1.2 = add nsw i32 %sum.2.1.2, %sub19.1.2
br label %for.inc.1.2
if.then25.1.2: ; preds = %if.end.1.2
%sub26.1.2 = sub nsw i32 %sum.2.1.2, %sub19.1.2
br label %for.inc.1.2
for.inc.1.2: ; preds = %if.then25.1.2, %if.else27.1.2, %for.inc.288
%sum.3.1.2 = phi i32 [ %sum.3.287, %for.inc.288 ], [ %sub26.1.2, %if.then25.1.2 ], [ %add28.1.2, %if.else27.1.2 ]
%arrayidx5.2.2 = getelementptr inbounds [3 x [3 x i32]], ptr %P, i64 0, i64 2, i64 2
%8 = load i32, ptr %arrayidx5.2.2, align 8, !tbaa !5
%cmp6.2.2 = icmp eq i32 %8, 0
br i1 %cmp6.2.2, label %for.inc.2.2, label %if.end.2.2
if.end.2.2: ; preds = %for.inc.1.2
%sub.2.2 = add nsw i32 %8, -1
%rem.2.2 = srem i32 %sub.2.2, 3
%div.2.2 = sdiv i32 %sub.2.2, 3
%reass.sub93 = sub i32 %sum.3.1.2, %rem.2.2
%cmp24.2.2 = icmp slt i32 %8, 7
br i1 %cmp24.2.2, label %if.then25.2.2, label %if.else27.2.2
if.else27.2.2: ; preds = %if.end.2.2
%add28.2.2 = add i32 %reass.sub93, %div.2.2
br label %for.inc.2.2
if.then25.2.2: ; preds = %if.end.2.2
%9 = sub i32 %reass.sub93, %div.2.2
%sub26.2.2 = add i32 %9, 4
br label %for.inc.2.2
for.inc.2.2: ; preds = %if.then25.2.2, %if.else27.2.2, %for.inc.1.2
%sum.3.2.2 = phi i32 [ %sum.3.1.2, %for.inc.1.2 ], [ %sub26.2.2, %if.then25.2.2 ], [ %add28.2.2, %if.else27.2.2 ]
ret i32 %sum.3.2.2
}
; 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, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %x, i32 noundef %y, i32 noundef %max, i32 noundef %cnt, i32 noundef %n) local_unnamed_addr #2 {
entry:
%call = tail call i32 @heuristic(ptr noundef nonnull byval(%struct.Pazzle) align 8 @P)
%cmp = icmp eq i32 %call, 0
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%add = add nsw i32 %call, %cnt
%cmp1 = icmp sgt i32 %add, %max
br i1 %cmp1, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end
%idxprom21 = sext i32 %y to i64
%idxprom23 = sext i32 %x to i64
%arrayidx24 = getelementptr inbounds [3 x [3 x i32]], ptr @P, i64 0, i64 %idxprom21, i64 %idxprom23
%add9 = add nsw i32 %n, 2
%rem = srem i32 %add9, 4
%cmp11 = icmp eq i32 %n, -1
%add37 = add nsw i32 %cnt, 1
%0 = load i32, ptr @dx, align 16, !tbaa !5
%add5 = add nsw i32 %0, %x
%1 = load i32, ptr @dy, align 16, !tbaa !5
%add8 = add nsw i32 %1, %y
%cmp10 = icmp ne i32 %rem, 0
%or.cond.not99 = or i1 %cmp11, %cmp10
%cmp12 = icmp sgt i32 %add5, -1
%or.cond63 = select i1 %or.cond.not99, i1 %cmp12, i1 false
%cmp14 = icmp slt i32 %add5, 3
%or.cond64 = select i1 %or.cond63, i1 %cmp14, i1 false
%cmp16 = icmp sgt i32 %add8, -1
%or.cond65 = select i1 %or.cond64, i1 %cmp16, i1 false
%cmp18 = icmp slt i32 %add8, 3
%or.cond66 = select i1 %or.cond65, i1 %cmp18, i1 false
br i1 %or.cond66, label %if.end20, label %for.inc
if.end20: ; preds = %for.cond.preheader
%2 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = zext i32 %add8 to i64
%idxprom27 = zext i32 %add5 to i64
%arrayidx28 = getelementptr inbounds [3 x [3 x i32]], ptr @P, i64 0, i64 %idxprom25, i64 %idxprom27
%3 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %3, ptr %arrayidx24, align 4, !tbaa !5
store i32 %2, ptr %arrayidx28, align 4, !tbaa !5
%call38 = tail call i32 @dfs(i32 noundef %add5, i32 noundef %add8, i32 noundef %max, i32 noundef %add37, i32 noundef 0)
%cmp39.not = icmp eq i32 %call38, -1
br i1 %cmp39.not, label %if.end41, label %cleanup
if.end41: ; preds = %if.end20
%4 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %5, ptr %arrayidx24, align 4, !tbaa !5
store i32 %4, ptr %arrayidx28, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %if.end41
%6 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 1), align 4, !tbaa !5
%add5.1 = add nsw i32 %6, %x
%7 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 1), align 4, !tbaa !5
%add8.1 = add nsw i32 %7, %y
%cmp10.1 = icmp ne i32 %rem, 1
%or.cond.not99.1 = or i1 %cmp11, %cmp10.1
%cmp12.1 = icmp sgt i32 %add5.1, -1
%or.cond63.1 = select i1 %or.cond.not99.1, i1 %cmp12.1, i1 false
%cmp14.1 = icmp slt i32 %add5.1, 3
%or.cond64.1 = select i1 %or.cond63.1, i1 %cmp14.1, i1 false
%cmp16.1 = icmp sgt i32 %add8.1, -1
%or.cond65.1 = select i1 %or.cond64.1, i1 %cmp16.1, i1 false
%cmp18.1 = icmp slt i32 %add8.1, 3
%or.cond66.1 = select i1 %or.cond65.1, i1 %cmp18.1, i1 false
br i1 %or.cond66.1, label %if.end20.1, label %for.inc.1
if.end20.1: ; preds = %for.inc
%8 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.1 = zext i32 %add8.1 to i64
%idxprom27.1 = zext i32 %add5.1 to i64
%arrayidx28.1 = getelementptr inbounds [3 x [3 x i32]], ptr @P, i64 0, i64 %idxprom25.1, i64 %idxprom27.1
%9 = load i32, ptr %arrayidx28.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx24, align 4, !tbaa !5
store i32 %8, ptr %arrayidx28.1, align 4, !tbaa !5
%call38.1 = tail call i32 @dfs(i32 noundef %add5.1, i32 noundef %add8.1, i32 noundef %max, i32 noundef %add37, i32 noundef 1)
%cmp39.not.1 = icmp eq i32 %call38.1, -1
br i1 %cmp39.not.1, label %if.end41.1, label %cleanup
if.end41.1: ; preds = %if.end20.1
%10 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx28.1, align 4, !tbaa !5
store i32 %11, ptr %arrayidx24, align 4, !tbaa !5
store i32 %10, ptr %arrayidx28.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end41.1, %for.inc
%12 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 2), align 8, !tbaa !5
%add5.2 = add nsw i32 %12, %x
%13 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 2), align 8, !tbaa !5
%add8.2 = add nsw i32 %13, %y
%cmp10.2 = icmp ne i32 %rem, 2
%or.cond.not99.2 = or i1 %cmp11, %cmp10.2
%cmp12.2 = icmp sgt i32 %add5.2, -1
%or.cond63.2 = select i1 %or.cond.not99.2, i1 %cmp12.2, i1 false
%cmp14.2 = icmp slt i32 %add5.2, 3
%or.cond64.2 = select i1 %or.cond63.2, i1 %cmp14.2, i1 false
%cmp16.2 = icmp sgt i32 %add8.2, -1
%or.cond65.2 = select i1 %or.cond64.2, i1 %cmp16.2, i1 false
%cmp18.2 = icmp slt i32 %add8.2, 3
%or.cond66.2 = select i1 %or.cond65.2, i1 %cmp18.2, i1 false
br i1 %or.cond66.2, label %if.end20.2, label %for.inc.2
if.end20.2: ; preds = %for.inc.1
%14 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.2 = zext i32 %add8.2 to i64
%idxprom27.2 = zext i32 %add5.2 to i64
%arrayidx28.2 = getelementptr inbounds [3 x [3 x i32]], ptr @P, i64 0, i64 %idxprom25.2, i64 %idxprom27.2
%15 = load i32, ptr %arrayidx28.2, align 4, !tbaa !5
store i32 %15, ptr %arrayidx24, align 4, !tbaa !5
store i32 %14, ptr %arrayidx28.2, align 4, !tbaa !5
%call38.2 = tail call i32 @dfs(i32 noundef %add5.2, i32 noundef %add8.2, i32 noundef %max, i32 noundef %add37, i32 noundef 2)
%cmp39.not.2 = icmp eq i32 %call38.2, -1
br i1 %cmp39.not.2, label %if.end41.2, label %cleanup
if.end41.2: ; preds = %if.end20.2
%16 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx28.2, align 4, !tbaa !5
store i32 %17, ptr %arrayidx24, align 4, !tbaa !5
store i32 %16, ptr %arrayidx28.2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end41.2, %for.inc.1
%18 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 3), align 4, !tbaa !5
%add5.3 = add nsw i32 %18, %x
%19 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 3), align 4, !tbaa !5
%add8.3 = add nsw i32 %19, %y
%cmp10.3 = icmp ne i32 %rem, 3
%or.cond.not99.3 = or i1 %cmp11, %cmp10.3
%cmp12.3 = icmp sgt i32 %add5.3, -1
%or.cond63.3 = select i1 %or.cond.not99.3, i1 %cmp12.3, i1 false
%cmp14.3 = icmp slt i32 %add5.3, 3
%or.cond64.3 = select i1 %or.cond63.3, i1 %cmp14.3, i1 false
%cmp16.3 = icmp sgt i32 %add8.3, -1
%or.cond65.3 = select i1 %or.cond64.3, i1 %cmp16.3, i1 false
%cmp18.3 = icmp slt i32 %add8.3, 3
%or.cond66.3 = select i1 %or.cond65.3, i1 %cmp18.3, i1 false
br i1 %or.cond66.3, label %if.end20.3, label %cleanup
if.end20.3: ; preds = %for.inc.2
%20 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25.3 = zext i32 %add8.3 to i64
%idxprom27.3 = zext i32 %add5.3 to i64
%arrayidx28.3 = getelementptr inbounds [3 x [3 x i32]], ptr @P, i64 0, i64 %idxprom25.3, i64 %idxprom27.3
%21 = load i32, ptr %arrayidx28.3, align 4, !tbaa !5
store i32 %21, ptr %arrayidx24, align 4, !tbaa !5
store i32 %20, ptr %arrayidx28.3, align 4, !tbaa !5
%call38.3 = tail call i32 @dfs(i32 noundef %add5.3, i32 noundef %add8.3, i32 noundef %max, i32 noundef %add37, i32 noundef 3)
%cmp39.not.3 = icmp eq i32 %call38.3, -1
br i1 %cmp39.not.3, label %if.end41.3, label %cleanup
if.end41.3: ; preds = %if.end20.3
%22 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx28.3, align 4, !tbaa !5
store i32 %23, ptr %arrayidx24, align 4, !tbaa !5
store i32 %22, ptr %arrayidx28.3, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %if.end20, %if.end20.1, %if.end20.2, %if.end20.3, %if.end41.3, %for.inc.2, %if.end, %entry
%retval.0 = phi i32 [ %cnt, %entry ], [ -1, %if.end ], [ %call38, %if.end20 ], [ %call38.1, %if.end20.1 ], [ %call38.2, %if.end20.2 ], [ %call38.3, %if.end20.3 ], [ -1, %if.end41.3 ], [ -1, %for.inc.2 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%a = alloca i32, align 4
%tP.sroa.0 = alloca [3 x [3 x i32]], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %tP.sroa.0)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
store i32 %0, ptr @P, align 8, !tbaa !5
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
store i32 %1, ptr getelementptr inbounds (%struct.Pazzle, ptr @P, i64 0, i32 0, i64 0, i64 1), align 4, !tbaa !5
%cmp6.1 = icmp eq i32 %1, 0
%spec.select.1 = zext i1 %cmp6.1 to i32
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%2 = load i32, ptr %a, align 4, !tbaa !5
store i32 %2, ptr getelementptr inbounds (%struct.Pazzle, ptr @P, i64 0, i32 0, i64 0, i64 2), align 8, !tbaa !5
%cmp6.2 = icmp eq i32 %2, 0
%spec.select.2 = select i1 %cmp6.2, i32 2, i32 %spec.select.1
%call.142 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%3 = load i32, ptr %a, align 4, !tbaa !5
store i32 %3, ptr getelementptr inbounds (%struct.Pazzle, ptr @P, i64 0, i32 0, i64 1, i64 0), align 4, !tbaa !5
%cmp6.144 = icmp eq i32 %3, 0
%spec.select.145 = select i1 %cmp6.144, i32 0, i32 %spec.select.2
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%4 = load i32, ptr %a, align 4, !tbaa !5
store i32 %4, ptr getelementptr inbounds (%struct.Pazzle, ptr @P, i64 0, i32 0, i64 1, i64 1), align 8, !tbaa !5
%cmp6.1.1 = icmp eq i32 %4, 0
%spec.select.1.1 = select i1 %cmp6.1.1, i32 1, i32 %spec.select.145
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%5 = load i32, ptr %a, align 4, !tbaa !5
store i32 %5, ptr getelementptr inbounds (%struct.Pazzle, ptr @P, i64 0, i32 0, i64 1, i64 2), align 4, !tbaa !5
%cmp6.2.1 = icmp eq i32 %5, 0
%spec.select.2.1 = select i1 %cmp6.2.1, i32 2, i32 %spec.select.1.1
%6 = select i1 %cmp6.2.1, i1 true, i1 %cmp6.1.1
%narrow52 = select i1 %6, i1 true, i1 %cmp6.144
%spec.select31.2.1 = zext i1 %narrow52 to i32
%call.247 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%7 = load i32, ptr %a, align 4, !tbaa !5
store i32 %7, ptr getelementptr inbounds (%struct.Pazzle, ptr @P, i64 0, i32 0, i64 2, i64 0), align 8, !tbaa !5
%cmp6.249 = icmp eq i32 %7, 0
%spec.select.250 = select i1 %cmp6.249, i32 0, i32 %spec.select.2.1
%call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%8 = load i32, ptr %a, align 4, !tbaa !5
store i32 %8, ptr getelementptr inbounds (%struct.Pazzle, ptr @P, i64 0, i32 0, i64 2, i64 1), align 4, !tbaa !5
%cmp6.1.2 = icmp eq i32 %8, 0
%spec.select.1.2 = select i1 %cmp6.1.2, i32 1, i32 %spec.select.250
%call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%9 = load i32, ptr %a, align 4, !tbaa !5
store i32 %9, ptr getelementptr inbounds (%struct.Pazzle, ptr @P, i64 0, i32 0, i64 2, i64 2), align 8, !tbaa !5
%cmp6.2.2 = icmp eq i32 %9, 0
%spec.select.2.2 = select i1 %cmp6.2.2, i32 2, i32 %spec.select.1.2
%10 = select i1 %cmp6.2.2, i1 true, i1 %cmp6.1.2
%11 = select i1 %10, i1 true, i1 %cmp6.249
%spec.select31.2.2 = select i1 %11, i32 2, i32 %spec.select31.2.1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %tP.sroa.0, ptr noundef nonnull align 8 dereferenceable(36) @P, i64 36, i1 false), !tbaa.struct !9
br label %for.body12
for.cond10: ; preds = %for.body12
%inc19 = add nuw nsw i32 %i.138, 1
%exitcond.not = icmp eq i32 %inc19, 46
br i1 %exitcond.not, label %for.end20, label %for.body12, !llvm.loop !11
for.body12: ; preds = %entry, %for.cond10
%i.138 = phi i32 [ 1, %entry ], [ %inc19, %for.cond10 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(36) @P, ptr noundef nonnull align 4 dereferenceable(36) %tP.sroa.0, i64 36, i1 false), !tbaa.struct !9
%call13 = call i32 @dfs(i32 noundef %spec.select.2.2, i32 noundef %spec.select31.2.2, i32 noundef %i.138, i32 noundef 0, i32 noundef -1)
%cmp14.not = icmp eq i32 %call13, -1
br i1 %cmp14.not, label %for.cond10, label %if.then15
if.then15: ; preds = %for.body12
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call13)
br label %for.end20
for.end20: ; preds = %for.cond10, %if.then15
call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %tP.sroa.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7
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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #6
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{i64 0, i64 36, !10}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#define tate 3
#define yoko 3
#define total (tate*yoko)
#define N 45
extern inline void down(void);
extern inline void up(void);
extern inline void right(void);
extern inline void left(void);
extern int puzzle(int x,int y,int a,int b);
int n=0,board[total]={};
int main(void)
{
int i,x,y;
for(i=0;i<total;i++)
{
scanf("%d",&board[i]);
if(board[i]==0)
{
n=i;
}
}
x=tate-(n/yoko)-1;
y=yoko-(n%yoko)-1;
for(i=0;i<N;i++)
{
if(puzzle(x,y,i,4)==1)
{
printf("%d\n",i);
break;
}
}
return 0;
}
int puzzle(int x,int y,int a,int b)
{
int result,i;
if(a<(x+y))
{
return 0;
}
if(a==0)
{
for(i=0;i<total-1;i++)
{
if(board[i]!=(i+1))
{
return 0;
}
}
return 1;
}
for(i=0;i<4;i++)
{
result=0;
switch(i)
{
case 0:
if((x>0) && (b!=3))
{
down();
result=puzzle(x-1,y,a-1,0);
up();
}
break;
case 1:
if((y>0) && (b!=2))
{
right();
result=puzzle(x,y-1,a-1,1);
left();
}
break;
case 2:
if((y<yoko-1) && (b!=1))
{
left();
result=puzzle(x,y+1,a-1,2);
right();
}
break;
case 3:
if((x<tate-1) && (b!=0))
{
up();
result=puzzle(x+1,y,a-1,3);
down();
}
break;
default:
break;
}
if(result)
{
return 1;
}
}
return 0;
}
inline void down()
{
board[n]=board[n+yoko];
n=n+yoko;
}
inline void up()
{
board[n]=board[n-yoko];
n=n-yoko;
}
inline void right()
{
board[n]=board[n+1];
n=n+1;
}
inline void left()
{
board[n]=board[n-1];
n=n-1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189199/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189199/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@n = dso_local local_unnamed_addr global i32 0, align 4
@board = dso_local global [9 x i32] zeroinitializer, align 32
@.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:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @board)
%0 = load i32, ptr @board, align 16, !tbaa !5
%cmp3 = icmp eq i32 %0, 0
br i1 %cmp3, label %if.then, label %for.inc
if.then: ; preds = %entry
store i32 0, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %entry, %if.then
%call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 1))
%1 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 1), align 4, !tbaa !5
%cmp3.1 = icmp eq i32 %1, 0
br i1 %cmp3.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 1, ptr @n, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 2))
%2 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 2), align 8, !tbaa !5
%cmp3.2 = icmp eq i32 %2, 0
br i1 %cmp3.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i32 2, ptr @n, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 3))
%3 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 3), align 4, !tbaa !5
%cmp3.3 = icmp eq i32 %3, 0
br i1 %cmp3.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
store i32 3, ptr @n, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%call.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 4))
%4 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 4), align 16, !tbaa !5
%cmp3.4 = icmp eq i32 %4, 0
br i1 %cmp3.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
store i32 4, ptr @n, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%call.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 5))
%5 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 5), align 4, !tbaa !5
%cmp3.5 = icmp eq i32 %5, 0
br i1 %cmp3.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
store i32 5, ptr @n, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%call.6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 6))
%6 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 6), align 8, !tbaa !5
%cmp3.6 = icmp eq i32 %6, 0
br i1 %cmp3.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
store i32 6, ptr @n, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%call.7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 7))
%7 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 7), align 4, !tbaa !5
%cmp3.7 = icmp eq i32 %7, 0
br i1 %cmp3.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
store i32 7, ptr @n, align 4, !tbaa !5
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%call.8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 8))
%8 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @board, i64 0, i64 8), align 16, !tbaa !5
%cmp3.8 = icmp eq i32 %8, 0
br i1 %cmp3.8, label %if.then.8, label %for.inc.7.for.inc.8_crit_edge
for.inc.7.for.inc.8_crit_edge: ; preds = %for.inc.7
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc.8
if.then.8: ; preds = %for.inc.7
store i32 8, ptr @n, align 4, !tbaa !5
br label %for.inc.8
for.inc.8: ; preds = %for.inc.7.for.inc.8_crit_edge, %if.then.8
%9 = phi i32 [ %.pre, %for.inc.7.for.inc.8_crit_edge ], [ 8, %if.then.8 ]
%div.neg = sdiv i32 %9, -3
%sub4 = add nsw i32 %div.neg, 2
%rem = srem i32 %9, 3
%sub6 = sub nsw i32 2, %rem
br label %for.body9
for.body9: ; preds = %for.inc.8, %for.inc15
%i.128 = phi i32 [ 0, %for.inc.8 ], [ %inc16, %for.inc15 ]
%call10 = tail call i32 @puzzle(i32 noundef %sub4, i32 noundef %sub6, i32 noundef %i.128, i32 noundef 4), !range !9
%cmp11.not = icmp eq i32 %call10, 0
br i1 %cmp11.not, label %for.inc15, label %if.then12
if.then12: ; preds = %for.body9
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.128)
br label %for.end17
for.inc15: ; preds = %for.body9
%inc16 = add nuw nsw i32 %i.128, 1
%exitcond.not = icmp eq i32 %inc16, 45
br i1 %exitcond.not, label %for.end17, label %for.body9, !llvm.loop !10
for.end17: ; preds = %for.inc15, %if.then12
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @puzzle(i32 noundef %x, i32 noundef %y, i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %y, %x
%cmp = icmp sgt i32 %add, %a
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp1 = icmp eq i32 %a, 0
br i1 %cmp1, label %for.cond.preheader, label %for.cond9.preheader
for.cond.preheader: ; preds = %if.end
%0 = load <8 x i32>, ptr @board, align 32
%.fr = freeze <8 x i32> %0
%1 = icmp ne <8 x i32> %.fr, <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
%2 = bitcast <8 x i1> %1 to i8
%3 = icmp eq i8 %2, 0
%spec.select = zext i1 %3 to i32
br label %cleanup, !llvm.loop !12
for.cond9.preheader: ; preds = %if.end
%cmp36 = icmp slt i32 %x, 2
%cmp38 = icmp ne i32 %b, 0
%or.cond52 = and i1 %cmp36, %cmp38
%add40 = add nsw i32 %x, 1
%sub41 = add nsw i32 %a, -1
%cmp27 = icmp slt i32 %y, 2
%cmp29 = icmp ne i32 %b, 1
%or.cond51 = and i1 %cmp27, %cmp29
%add31 = add nsw i32 %y, 1
%cmp18 = icmp sgt i32 %y, 0
%cmp20 = icmp ne i32 %b, 2
%or.cond50 = and i1 %cmp18, %cmp20
%sub22 = add nsw i32 %y, -1
%cmp12 = icmp sgt i32 %x, 0
%cmp13 = icmp ne i32 %b, 3
%or.cond = and i1 %cmp12, %cmp13
%sub = add nsw i32 %x, -1
br label %for.body11
for.body11: ; preds = %for.cond9.preheader, %for.inc46
%i.1117 = phi i32 [ 0, %for.cond9.preheader ], [ %inc47, %for.inc46 ]
switch i32 %i.1117, label %for.inc46 [
i32 0, label %sw.bb
i32 1, label %sw.bb17
i32 2, label %sw.bb26
i32 3, label %sw.bb35
]
sw.bb: ; preds = %for.body11
br i1 %or.cond, label %if.then14, label %for.inc46
if.then14: ; preds = %sw.bb
%4 = load i32, ptr @n, align 4, !tbaa !5
%add.i = add nsw i32 %4, 3
%idxprom.i = sext i32 %add.i to i64
%arrayidx.i = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%idxprom1.i = sext i32 %4 to i64
%arrayidx2.i = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1.i
store i32 %5, ptr %arrayidx2.i, align 4, !tbaa !5
store i32 %add.i, ptr @n, align 4, !tbaa !5
%call = tail call i32 @puzzle(i32 noundef %sub, i32 noundef %y, i32 noundef %sub41, i32 noundef 0), !range !9
%6 = load i32, ptr @n, align 4, !tbaa !5
%sub.i = add nsw i32 %6, -3
br label %sw.epilog
sw.bb17: ; preds = %for.body11
br i1 %or.cond50, label %if.then21, label %for.inc46
if.then21: ; preds = %sw.bb17
%7 = load i32, ptr @n, align 4, !tbaa !5
%add.i83 = add nsw i32 %7, 1
%idxprom.i84 = sext i32 %add.i83 to i64
%arrayidx.i85 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom.i84
%8 = load i32, ptr %arrayidx.i85, align 4, !tbaa !5
%idxprom1.i86 = sext i32 %7 to i64
%arrayidx2.i87 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1.i86
store i32 %8, ptr %arrayidx2.i87, align 4, !tbaa !5
store i32 %add.i83, ptr @n, align 4, !tbaa !5
%call24 = tail call i32 @puzzle(i32 noundef %x, i32 noundef %sub22, i32 noundef %sub41, i32 noundef 1), !range !9
%9 = load i32, ptr @n, align 4, !tbaa !5
%sub.i88 = add nsw i32 %9, -1
br label %sw.epilog
sw.bb26: ; preds = %for.body11
br i1 %or.cond51, label %if.then30, label %for.inc46
if.then30: ; preds = %sw.bb26
%10 = load i32, ptr @n, align 4, !tbaa !5
%sub.i93 = add nsw i32 %10, -1
%idxprom.i94 = sext i32 %sub.i93 to i64
%arrayidx.i95 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom.i94
%11 = load i32, ptr %arrayidx.i95, align 4, !tbaa !5
%idxprom1.i96 = sext i32 %10 to i64
%arrayidx2.i97 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1.i96
store i32 %11, ptr %arrayidx2.i97, align 4, !tbaa !5
store i32 %sub.i93, ptr @n, align 4, !tbaa !5
%call33 = tail call i32 @puzzle(i32 noundef %x, i32 noundef %add31, i32 noundef %sub41, i32 noundef 2), !range !9
%12 = load i32, ptr @n, align 4, !tbaa !5
%add.i98 = add nsw i32 %12, 1
br label %sw.epilog
sw.bb35: ; preds = %for.body11
br i1 %or.cond52, label %if.then39, label %cleanup
if.then39: ; preds = %sw.bb35
%13 = load i32, ptr @n, align 4, !tbaa !5
%sub.i103 = add nsw i32 %13, -3
%idxprom.i104 = sext i32 %sub.i103 to i64
%arrayidx.i105 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom.i104
%14 = load i32, ptr %arrayidx.i105, align 4, !tbaa !5
%idxprom1.i106 = sext i32 %13 to i64
%arrayidx2.i107 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1.i106
store i32 %14, ptr %arrayidx2.i107, align 4, !tbaa !5
store i32 %sub.i103, ptr @n, align 4, !tbaa !5
%call42 = tail call i32 @puzzle(i32 noundef %add40, i32 noundef %y, i32 noundef %sub41, i32 noundef 3), !range !9
%15 = load i32, ptr @n, align 4, !tbaa !5
%add.i108 = add nsw i32 %15, 3
br label %sw.epilog
sw.epilog: ; preds = %if.then39, %if.then30, %if.then21, %if.then14
%add.i108.sink132 = phi i32 [ %add.i108, %if.then39 ], [ %add.i98, %if.then30 ], [ %sub.i88, %if.then21 ], [ %sub.i, %if.then14 ]
%.sink131 = phi i32 [ %15, %if.then39 ], [ %12, %if.then30 ], [ %9, %if.then21 ], [ %6, %if.then14 ]
%result.0 = phi i32 [ %call42, %if.then39 ], [ %call33, %if.then30 ], [ %call24, %if.then21 ], [ %call, %if.then14 ]
%idxprom.i109 = sext i32 %add.i108.sink132 to i64
%arrayidx.i110 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom.i109
%16 = load i32, ptr %arrayidx.i110, align 4, !tbaa !5
%idxprom1.i111 = sext i32 %.sink131 to i64
%arrayidx2.i112 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1.i111
store i32 %16, ptr %arrayidx2.i112, align 4, !tbaa !5
store i32 %add.i108.sink132, ptr @n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %result.0, 0
br i1 %tobool.not, label %for.inc46, label %cleanup
for.inc46: ; preds = %sw.bb, %sw.bb17, %sw.bb26, %for.body11, %sw.epilog
%inc47 = add nuw nsw i32 %i.1117, 1
%exitcond.not = icmp eq i32 %inc47, 4
br i1 %exitcond.not, label %cleanup, label %for.body11, !llvm.loop !13
cleanup: ; preds = %sw.bb35, %for.inc46, %sw.epilog, %for.cond.preheader, %entry
%retval.0 = phi i32 [ 0, %entry ], [ %spec.select, %for.cond.preheader ], [ 0, %sw.bb35 ], [ 0, %for.inc46 ], [ 1, %sw.epilog ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @down() local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%add = add nsw i32 %0, 3
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %0 to i64
%arrayidx2 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1
store i32 %1, ptr %arrayidx2, align 4, !tbaa !5
store i32 %add, ptr @n, align 4, !tbaa !5
ret void
}
; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @up() local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %0, -3
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %0 to i64
%arrayidx2 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1
store i32 %1, ptr %arrayidx2, align 4, !tbaa !5
store i32 %sub, ptr @n, align 4, !tbaa !5
ret void
}
; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @right() local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %0 to i64
%arrayidx2 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1
store i32 %1, ptr %arrayidx2, align 4, !tbaa !5
store i32 %add, ptr @n, align 4, !tbaa !5
ret void
}
; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @left() local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %0 to i64
%arrayidx2 = getelementptr inbounds [9 x i32], ptr @board, i64 0, i64 %idxprom1
store i32 %1, ptr %arrayidx2, align 4, !tbaa !5
store i32 %sub, ptr @n, align 4, !tbaa !5
ret void
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{i32 0, i32 2}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include <stdio.h>
#include <stdlib.h>
int puz[3][3];
int tmp[3][3];
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
void empty(int *x,int *y){
int i,j;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
if(!puz[i][j]){
*x=j;
*y=i;
return;
}
}
}
}
void swap(int *a,int *b){
int tmp=*a;
*a=*b;
*b=tmp;
}
int cal(){
int v,i,sum=0;
for(i=0;i<9;i++){
v=puz[i/3][i%3];
if(v){
v--;
sum += abs(i/3-v/3) + abs(i%3-v%3);
}
}
return sum;
}
int dfs(int x,int y,int p,int dep,const int lim){
int i,h,nx,ny,res;
h=cal();
if(h==0){
return dep;
}
if(dep+h > lim){
return -1;
}
for(i=0;i<4;++i){
nx=x+dx[i];
ny=y+dy[i];
if(~p && i==(p+2)%4)
continue;
if(!(0 <= nx && nx < 3 && 0 <= ny && ny < 3))
continue;
swap(&puz[y][x],&puz[ny][nx]);
res=dfs(nx,ny,i,dep+1,lim);
if(~res){
return res;
}
swap(&puz[y][x],&puz[ny][nx]);
}
return -1;
}
int main(){
int i,j,ans,x,y,l;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
scanf("%d",&puz[i][j]);
}
}
empty(&x,&y);
for(l=0;l<100;l++){
for(i=0;i<3;i++){
for(j=0;j<3;j++){
tmp[i][j]=puz[i][j];
}
}
ans=dfs(x,y,-1,0,l);
if(ans!=-1){
printf("%d\n",ans);
break;
}
for(i=0;i<3;i++){
for(j=0;j<3;j++){
puz[i][j]=tmp[i][j];
}
}
ans=-1;
if(l==99){
printf("%d\n",ans);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189249/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189249/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dx = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@dy = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 -1, i32 0], align 16
@puz = dso_local global [3 x [3 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@tmp = dso_local local_unnamed_addr global [3 x [3 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) uwtable
define dso_local void @empty(ptr nocapture noundef writeonly %x, ptr nocapture noundef writeonly %y) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @puz, align 16, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %if.then, label %for.inc
if.then: ; preds = %for.inc.1.2, %for.inc.229, %for.inc.2.1, %for.inc.1.1, %for.inc.126, %for.inc.2, %for.inc.1, %for.inc, %entry
%i.019.lcssa = phi i32 [ 0, %entry ], [ 0, %for.inc ], [ 0, %for.inc.1 ], [ 1, %for.inc.2 ], [ 1, %for.inc.126 ], [ 1, %for.inc.1.1 ], [ 2, %for.inc.2.1 ], [ 2, %for.inc.229 ], [ 2, %for.inc.1.2 ]
%j.018.lcssa.wide = phi i32 [ 0, %entry ], [ 1, %for.inc ], [ 2, %for.inc.1 ], [ 0, %for.inc.2 ], [ 1, %for.inc.126 ], [ 2, %for.inc.1.1 ], [ 0, %for.inc.2.1 ], [ 1, %for.inc.229 ], [ 2, %for.inc.1.2 ]
store i32 %j.018.lcssa.wide, ptr %x, align 4, !tbaa !5
store i32 %i.019.lcssa, ptr %y, align 4, !tbaa !5
br label %cleanup
for.inc: ; preds = %entry
%1 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 0, i64 1), align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %1, 0
br i1 %tobool.not.1, label %if.then, label %for.inc.1
for.inc.1: ; preds = %for.inc
%2 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 0, i64 2), align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %2, 0
br i1 %tobool.not.2, label %if.then, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 0), align 4, !tbaa !5
%tobool.not.125 = icmp eq i32 %3, 0
br i1 %tobool.not.125, label %if.then, label %for.inc.126
for.inc.126: ; preds = %for.inc.2
%4 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 1), align 16, !tbaa !5
%tobool.not.1.1 = icmp eq i32 %4, 0
br i1 %tobool.not.1.1, label %if.then, label %for.inc.1.1
for.inc.1.1: ; preds = %for.inc.126
%5 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 2), align 4, !tbaa !5
%tobool.not.2.1 = icmp eq i32 %5, 0
br i1 %tobool.not.2.1, label %if.then, label %for.inc.2.1
for.inc.2.1: ; preds = %for.inc.1.1
%6 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 0), align 8, !tbaa !5
%tobool.not.228 = icmp eq i32 %6, 0
br i1 %tobool.not.228, label %if.then, label %for.inc.229
for.inc.229: ; preds = %for.inc.2.1
%7 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 1), align 4, !tbaa !5
%tobool.not.1.2 = icmp eq i32 %7, 0
br i1 %tobool.not.1.2, label %if.then, label %for.inc.1.2
for.inc.1.2: ; preds = %for.inc.229
%8 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 2), align 16, !tbaa !5
%tobool.not.2.2 = icmp eq i32 %8, 0
br i1 %tobool.not.2.2, label %if.then, label %cleanup
cleanup: ; preds = %for.inc.1.2, %if.then
ret void
}
; 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 #1 {
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: mustprogress nofree nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @cal() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @puz, align 16, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %for.inc, label %if.then
if.then: ; preds = %entry
%dec = add nsw i32 %0, -1
%div4.neg = sdiv i32 %dec, -3
%1 = tail call i32 @llvm.abs.i32(i32 %div4.neg, i1 true)
%rem6 = srem i32 %dec, 3
%2 = tail call i32 @llvm.abs.i32(i32 %rem6, i1 true)
%add8 = add nuw nsw i32 %2, %1
br label %for.inc
for.inc: ; preds = %entry, %if.then
%sum.1 = phi i32 [ %add8, %if.then ], [ 0, %entry ]
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 0, i64 1), align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %3, 0
br i1 %tobool.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%dec.1 = add nsw i32 %3, -1
%div4.neg.1 = sdiv i32 %dec.1, -3
%4 = tail call i32 @llvm.abs.i32(i32 %div4.neg.1, i1 true)
%rem6.1 = srem i32 %dec.1, 3
%sub7.1 = sub nsw i32 1, %rem6.1
%5 = tail call i32 @llvm.abs.i32(i32 %sub7.1, i1 true)
%add.1 = add nuw nsw i32 %5, %sum.1
%add8.1 = add nuw nsw i32 %add.1, %4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%sum.1.1 = phi i32 [ %add8.1, %if.then.1 ], [ %sum.1, %for.inc ]
%6 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 0, i64 2), align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %6, 0
br i1 %tobool.not.2, label %for.inc.2, label %if.then.2
if.then.2: ; preds = %for.inc.1
%dec.2 = add nsw i32 %6, -1
%div4.neg.2 = sdiv i32 %dec.2, -3
%7 = tail call i32 @llvm.abs.i32(i32 %div4.neg.2, i1 true)
%rem6.2 = srem i32 %dec.2, 3
%reass.sub = sub i32 %sum.1.1, %rem6.2
%add.2 = add i32 %reass.sub, 2
%add8.2 = add nuw i32 %add.2, %7
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%sum.1.2 = phi i32 [ %add8.2, %if.then.2 ], [ %sum.1.1, %for.inc.1 ]
%8 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 0), align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %8, 0
br i1 %tobool.not.3, label %for.inc.3, label %if.then.3
if.then.3: ; preds = %for.inc.2
%dec.3 = add nsw i32 %8, -1
%div4.neg.3 = sdiv i32 %dec.3, -3
%sub.3 = add nsw i32 %div4.neg.3, 1
%9 = tail call i32 @llvm.abs.i32(i32 %sub.3, i1 true)
%rem6.3 = srem i32 %dec.3, 3
%10 = tail call i32 @llvm.abs.i32(i32 %rem6.3, i1 true)
%add.3 = add nuw i32 %10, %sum.1.2
%add8.3 = add nuw i32 %add.3, %9
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%sum.1.3 = phi i32 [ %add8.3, %if.then.3 ], [ %sum.1.2, %for.inc.2 ]
%11 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 1), align 16, !tbaa !5
%tobool.not.4 = icmp eq i32 %11, 0
br i1 %tobool.not.4, label %for.inc.4, label %if.then.4
if.then.4: ; preds = %for.inc.3
%dec.4 = add nsw i32 %11, -1
%div4.neg.4 = sdiv i32 %dec.4, -3
%sub.4 = add nsw i32 %div4.neg.4, 1
%12 = tail call i32 @llvm.abs.i32(i32 %sub.4, i1 true)
%rem6.4 = srem i32 %dec.4, 3
%sub7.4 = sub nsw i32 1, %rem6.4
%13 = tail call i32 @llvm.abs.i32(i32 %sub7.4, i1 true)
%add.4 = add nuw i32 %13, %sum.1.3
%add8.4 = add nuw i32 %add.4, %12
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%sum.1.4 = phi i32 [ %add8.4, %if.then.4 ], [ %sum.1.3, %for.inc.3 ]
%14 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 2), align 4, !tbaa !5
%tobool.not.5 = icmp eq i32 %14, 0
br i1 %tobool.not.5, label %for.inc.5, label %if.then.5
if.then.5: ; preds = %for.inc.4
%dec.5 = add nsw i32 %14, -1
%div4.neg.5 = sdiv i32 %dec.5, -3
%sub.5 = add nsw i32 %div4.neg.5, 1
%15 = tail call i32 @llvm.abs.i32(i32 %sub.5, i1 true)
%rem6.5 = srem i32 %dec.5, 3
%reass.sub22 = sub i32 %sum.1.4, %rem6.5
%add.5 = add i32 %reass.sub22, 2
%add8.5 = add i32 %add.5, %15
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%sum.1.5 = phi i32 [ %add8.5, %if.then.5 ], [ %sum.1.4, %for.inc.4 ]
%16 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 0), align 8, !tbaa !5
%tobool.not.6 = icmp eq i32 %16, 0
br i1 %tobool.not.6, label %for.inc.6, label %if.then.6
if.then.6: ; preds = %for.inc.5
%dec.6 = add nsw i32 %16, -1
%div4.neg.6 = sdiv i32 %dec.6, -3
%sub.6 = add nsw i32 %div4.neg.6, 2
%17 = tail call i32 @llvm.abs.i32(i32 %sub.6, i1 true)
%rem6.6 = srem i32 %dec.6, 3
%18 = tail call i32 @llvm.abs.i32(i32 %rem6.6, i1 true)
%add.6 = add i32 %18, %sum.1.5
%add8.6 = add i32 %add.6, %17
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%sum.1.6 = phi i32 [ %add8.6, %if.then.6 ], [ %sum.1.5, %for.inc.5 ]
%19 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 1), align 4, !tbaa !5
%tobool.not.7 = icmp eq i32 %19, 0
br i1 %tobool.not.7, label %for.inc.7, label %if.then.7
if.then.7: ; preds = %for.inc.6
%dec.7 = add nsw i32 %19, -1
%div4.neg.7 = sdiv i32 %dec.7, -3
%sub.7 = add nsw i32 %div4.neg.7, 2
%20 = tail call i32 @llvm.abs.i32(i32 %sub.7, i1 true)
%rem6.7 = srem i32 %dec.7, 3
%sub7.7 = sub nsw i32 1, %rem6.7
%21 = tail call i32 @llvm.abs.i32(i32 %sub7.7, i1 true)
%add.7 = add i32 %21, %sum.1.6
%add8.7 = add i32 %add.7, %20
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%sum.1.7 = phi i32 [ %add8.7, %if.then.7 ], [ %sum.1.6, %for.inc.6 ]
%22 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 2), align 16, !tbaa !5
%tobool.not.8 = icmp eq i32 %22, 0
br i1 %tobool.not.8, label %for.inc.8, label %if.then.8
if.then.8: ; preds = %for.inc.7
%dec.8 = add nsw i32 %22, -1
%div4.neg.8 = sdiv i32 %dec.8, -3
%sub.8 = add nsw i32 %div4.neg.8, 2
%23 = tail call i32 @llvm.abs.i32(i32 %sub.8, i1 true)
%rem6.8 = srem i32 %dec.8, 3
%reass.sub23 = sub i32 %sum.1.7, %rem6.8
%add.8 = add i32 %reass.sub23, 2
%add8.8 = add i32 %add.8, %23
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%sum.1.8 = phi i32 [ %add8.8, %if.then.8 ], [ %sum.1.7, %for.inc.7 ]
ret i32 %sum.1.8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %x, i32 noundef %y, i32 noundef %p, i32 noundef %dep, i32 noundef %lim) local_unnamed_addr #4 {
entry:
%call = tail call i32 @cal()
%cmp = icmp eq i32 %call, 0
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%add = add nsw i32 %call, %dep
%cmp1 = icmp sgt i32 %add, %lim
br i1 %cmp1, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end
%idxprom22 = sext i32 %y to i64
%idxprom24 = sext i32 %x to i64
%arrayidx25 = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom22, i64 %idxprom24
%tobool.not = icmp eq i32 %p, -1
%add30 = add nsw i32 %dep, 1
br i1 %tobool.not, label %for.body.us.preheader, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%add9 = add nsw i32 %p, 2
%rem = srem i32 %add9, 4
%0 = load i32, ptr @dx, align 16, !tbaa !5
%add5 = add nsw i32 %0, %x
%1 = load i32, ptr @dy, align 16, !tbaa !5
%add8 = add nsw i32 %1, %y
%cmp10 = icmp eq i32 %rem, 0
br i1 %cmp10, label %if.end12.1, label %if.end12
for.body.us.preheader: ; preds = %for.cond.preheader
%2 = load i32, ptr @dx, align 16, !tbaa !5
%add5.us = add nsw i32 %2, %x
%3 = load i32, ptr @dy, align 16, !tbaa !5
%add8.us = add nsw i32 %3, %y
%or.cond.us = icmp ult i32 %add5.us, 3
%cmp17.us = icmp sgt i32 %add8.us, -1
%or.cond48.us = select i1 %or.cond.us, i1 %cmp17.us, i1 false
%cmp19.us = icmp slt i32 %add8.us, 3
%or.cond49.us = select i1 %or.cond48.us, i1 %cmp19.us, i1 false
br i1 %or.cond49.us, label %if.end21.us, label %for.inc.us
if.end21.us: ; preds = %for.body.us.preheader
%idxprom26.us = zext i32 %add8.us to i64
%idxprom28.us = zext i32 %add5.us to i64
%arrayidx29.us = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom26.us, i64 %idxprom28.us
%4 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5
store i32 %5, ptr %arrayidx25, align 4, !tbaa !5
store i32 %4, ptr %arrayidx29.us, align 4, !tbaa !5
%call31.us = tail call i32 @dfs(i32 noundef %add5.us, i32 noundef %add8.us, i32 noundef 0, i32 noundef %add30, i32 noundef %lim)
%tobool33.not.us = icmp eq i32 %call31.us, -1
br i1 %tobool33.not.us, label %if.end35.us, label %cleanup
if.end35.us: ; preds = %if.end21.us
%6 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5
store i32 %7, ptr %arrayidx25, align 4, !tbaa !5
store i32 %6, ptr %arrayidx29.us, align 4, !tbaa !5
br label %for.inc.us
for.inc.us: ; preds = %if.end35.us, %for.body.us.preheader
%8 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 1), align 4, !tbaa !5
%add5.us.1 = add nsw i32 %8, %x
%9 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 1), align 4, !tbaa !5
%add8.us.1 = add nsw i32 %9, %y
%or.cond.us.1 = icmp ult i32 %add5.us.1, 3
%cmp17.us.1 = icmp sgt i32 %add8.us.1, -1
%or.cond48.us.1 = select i1 %or.cond.us.1, i1 %cmp17.us.1, i1 false
%cmp19.us.1 = icmp slt i32 %add8.us.1, 3
%or.cond49.us.1 = select i1 %or.cond48.us.1, i1 %cmp19.us.1, i1 false
br i1 %or.cond49.us.1, label %if.end21.us.1, label %for.inc.us.1
if.end21.us.1: ; preds = %for.inc.us
%idxprom26.us.1 = zext i32 %add8.us.1 to i64
%idxprom28.us.1 = zext i32 %add5.us.1 to i64
%arrayidx29.us.1 = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom26.us.1, i64 %idxprom28.us.1
%10 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx29.us.1, align 4, !tbaa !5
store i32 %11, ptr %arrayidx25, align 4, !tbaa !5
store i32 %10, ptr %arrayidx29.us.1, align 4, !tbaa !5
%call31.us.1 = tail call i32 @dfs(i32 noundef %add5.us.1, i32 noundef %add8.us.1, i32 noundef 1, i32 noundef %add30, i32 noundef %lim)
%tobool33.not.us.1 = icmp eq i32 %call31.us.1, -1
br i1 %tobool33.not.us.1, label %if.end35.us.1, label %cleanup
if.end35.us.1: ; preds = %if.end21.us.1
%12 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%13 = load i32, ptr %arrayidx29.us.1, align 4, !tbaa !5
store i32 %13, ptr %arrayidx25, align 4, !tbaa !5
store i32 %12, ptr %arrayidx29.us.1, align 4, !tbaa !5
br label %for.inc.us.1
for.inc.us.1: ; preds = %if.end35.us.1, %for.inc.us
%14 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 2), align 8, !tbaa !5
%add5.us.2 = add nsw i32 %14, %x
%15 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 2), align 8, !tbaa !5
%add8.us.2 = add nsw i32 %15, %y
%or.cond.us.2 = icmp ult i32 %add5.us.2, 3
%cmp17.us.2 = icmp sgt i32 %add8.us.2, -1
%or.cond48.us.2 = select i1 %or.cond.us.2, i1 %cmp17.us.2, i1 false
%cmp19.us.2 = icmp slt i32 %add8.us.2, 3
%or.cond49.us.2 = select i1 %or.cond48.us.2, i1 %cmp19.us.2, i1 false
br i1 %or.cond49.us.2, label %if.end21.us.2, label %for.inc.us.2
if.end21.us.2: ; preds = %for.inc.us.1
%idxprom26.us.2 = zext i32 %add8.us.2 to i64
%idxprom28.us.2 = zext i32 %add5.us.2 to i64
%arrayidx29.us.2 = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom26.us.2, i64 %idxprom28.us.2
%16 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx29.us.2, align 4, !tbaa !5
store i32 %17, ptr %arrayidx25, align 4, !tbaa !5
store i32 %16, ptr %arrayidx29.us.2, align 4, !tbaa !5
%call31.us.2 = tail call i32 @dfs(i32 noundef %add5.us.2, i32 noundef %add8.us.2, i32 noundef 2, i32 noundef %add30, i32 noundef %lim)
%tobool33.not.us.2 = icmp eq i32 %call31.us.2, -1
br i1 %tobool33.not.us.2, label %if.end35.us.2, label %cleanup
if.end35.us.2: ; preds = %if.end21.us.2
%18 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx29.us.2, align 4, !tbaa !5
store i32 %19, ptr %arrayidx25, align 4, !tbaa !5
store i32 %18, ptr %arrayidx29.us.2, align 4, !tbaa !5
br label %for.inc.us.2
for.inc.us.2: ; preds = %if.end35.us.2, %for.inc.us.1
%20 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 3), align 4, !tbaa !5
%add5.us.3 = add nsw i32 %20, %x
%21 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 3), align 4, !tbaa !5
%add8.us.3 = add nsw i32 %21, %y
%or.cond.us.3 = icmp ult i32 %add5.us.3, 3
%cmp17.us.3 = icmp sgt i32 %add8.us.3, -1
%or.cond48.us.3 = select i1 %or.cond.us.3, i1 %cmp17.us.3, i1 false
%cmp19.us.3 = icmp slt i32 %add8.us.3, 3
%or.cond49.us.3 = select i1 %or.cond48.us.3, i1 %cmp19.us.3, i1 false
br i1 %or.cond49.us.3, label %if.end21.us.3, label %cleanup
if.end21.us.3: ; preds = %for.inc.us.2
%idxprom26.us.3 = zext i32 %add8.us.3 to i64
%idxprom28.us.3 = zext i32 %add5.us.3 to i64
%arrayidx29.us.3 = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom26.us.3, i64 %idxprom28.us.3
%22 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx29.us.3, align 4, !tbaa !5
store i32 %23, ptr %arrayidx25, align 4, !tbaa !5
store i32 %22, ptr %arrayidx29.us.3, align 4, !tbaa !5
%call31.us.3 = tail call i32 @dfs(i32 noundef %add5.us.3, i32 noundef %add8.us.3, i32 noundef 3, i32 noundef %add30, i32 noundef %lim)
%tobool33.not.us.3 = icmp eq i32 %call31.us.3, -1
br i1 %tobool33.not.us.3, label %cleanup.sink.split, label %cleanup
if.end12: ; preds = %for.body.preheader
%or.cond = icmp ult i32 %add5, 3
%cmp17 = icmp sgt i32 %add8, -1
%or.cond48 = select i1 %or.cond, i1 %cmp17, i1 false
%cmp19 = icmp slt i32 %add8, 3
%or.cond49 = select i1 %or.cond48, i1 %cmp19, i1 false
br i1 %or.cond49, label %if.end21, label %for.inc
if.end21: ; preds = %if.end12
%idxprom26 = zext i32 %add8 to i64
%idxprom28 = zext i32 %add5 to i64
%arrayidx29 = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom26, i64 %idxprom28
%24 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx29, align 4, !tbaa !5
store i32 %25, ptr %arrayidx25, align 4, !tbaa !5
store i32 %24, ptr %arrayidx29, align 4, !tbaa !5
%call31 = tail call i32 @dfs(i32 noundef %add5, i32 noundef %add8, i32 noundef 0, i32 noundef %add30, i32 noundef %lim)
%tobool33.not = icmp eq i32 %call31, -1
br i1 %tobool33.not, label %if.end35, label %cleanup
if.end35: ; preds = %if.end21
%26 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%27 = load i32, ptr %arrayidx29, align 4, !tbaa !5
store i32 %27, ptr %arrayidx25, align 4, !tbaa !5
store i32 %26, ptr %arrayidx29, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end12, %if.end35
%cmp10.1 = icmp eq i32 %rem, 1
br i1 %cmp10.1, label %if.end12.2, label %if.end12.1
if.end12.1: ; preds = %for.body.preheader, %for.inc
%.pn95 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 1), align 4, !tbaa !5
%add5.181 = add nsw i32 %.pn95, %x
%.pn = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 1), align 4, !tbaa !5
%add8.182 = add nsw i32 %.pn, %y
%or.cond.1 = icmp ult i32 %add5.181, 3
%cmp17.1 = icmp sgt i32 %add8.182, -1
%or.cond48.1 = select i1 %or.cond.1, i1 %cmp17.1, i1 false
%cmp19.1 = icmp slt i32 %add8.182, 3
%or.cond49.1 = select i1 %or.cond48.1, i1 %cmp19.1, i1 false
br i1 %or.cond49.1, label %if.end21.1, label %for.inc.1
if.end21.1: ; preds = %if.end12.1
%idxprom26.1 = zext i32 %add8.182 to i64
%idxprom28.1 = zext i32 %add5.181 to i64
%arrayidx29.1 = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom26.1, i64 %idxprom28.1
%28 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%29 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5
store i32 %29, ptr %arrayidx25, align 4, !tbaa !5
store i32 %28, ptr %arrayidx29.1, align 4, !tbaa !5
%call31.1 = tail call i32 @dfs(i32 noundef %add5.181, i32 noundef %add8.182, i32 noundef 1, i32 noundef %add30, i32 noundef %lim)
%tobool33.not.1 = icmp eq i32 %call31.1, -1
br i1 %tobool33.not.1, label %if.end35.1, label %cleanup
if.end35.1: ; preds = %if.end21.1
%30 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%31 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5
store i32 %31, ptr %arrayidx25, align 4, !tbaa !5
store i32 %30, ptr %arrayidx29.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end35.1, %if.end12.1
%cmp10.2 = icmp eq i32 %rem, 2
br i1 %cmp10.2, label %if.end12.3, label %if.end12.2
if.end12.2: ; preds = %for.inc, %for.inc.1
%.pn97 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 2), align 8, !tbaa !5
%add5.286 = add nsw i32 %.pn97, %x
%.pn96 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 2), align 8, !tbaa !5
%add8.287 = add nsw i32 %.pn96, %y
%or.cond.2 = icmp ult i32 %add5.286, 3
%cmp17.2 = icmp sgt i32 %add8.287, -1
%or.cond48.2 = select i1 %or.cond.2, i1 %cmp17.2, i1 false
%cmp19.2 = icmp slt i32 %add8.287, 3
%or.cond49.2 = select i1 %or.cond48.2, i1 %cmp19.2, i1 false
br i1 %or.cond49.2, label %if.end21.2, label %for.inc.2
if.end21.2: ; preds = %if.end12.2
%idxprom26.2 = zext i32 %add8.287 to i64
%idxprom28.2 = zext i32 %add5.286 to i64
%arrayidx29.2 = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom26.2, i64 %idxprom28.2
%32 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%33 = load i32, ptr %arrayidx29.2, align 4, !tbaa !5
store i32 %33, ptr %arrayidx25, align 4, !tbaa !5
store i32 %32, ptr %arrayidx29.2, align 4, !tbaa !5
%call31.2 = tail call i32 @dfs(i32 noundef %add5.286, i32 noundef %add8.287, i32 noundef 2, i32 noundef %add30, i32 noundef %lim)
%tobool33.not.2 = icmp eq i32 %call31.2, -1
br i1 %tobool33.not.2, label %if.end35.2, label %cleanup
if.end35.2: ; preds = %if.end21.2
%34 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%35 = load i32, ptr %arrayidx29.2, align 4, !tbaa !5
store i32 %35, ptr %arrayidx25, align 4, !tbaa !5
store i32 %34, ptr %arrayidx29.2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end35.2, %if.end12.2
%cmp10.3 = icmp eq i32 %rem, 3
br i1 %cmp10.3, label %cleanup, label %if.end12.3
if.end12.3: ; preds = %for.inc.1, %for.inc.2
%.pn99 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 3), align 4, !tbaa !5
%add5.391 = add nsw i32 %.pn99, %x
%.pn98 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 3), align 4, !tbaa !5
%add8.392 = add nsw i32 %.pn98, %y
%or.cond.3 = icmp ult i32 %add5.391, 3
%cmp17.3 = icmp sgt i32 %add8.392, -1
%or.cond48.3 = select i1 %or.cond.3, i1 %cmp17.3, i1 false
%cmp19.3 = icmp slt i32 %add8.392, 3
%or.cond49.3 = select i1 %or.cond48.3, i1 %cmp19.3, i1 false
br i1 %or.cond49.3, label %if.end21.3, label %cleanup
if.end21.3: ; preds = %if.end12.3
%idxprom26.3 = zext i32 %add8.392 to i64
%idxprom28.3 = zext i32 %add5.391 to i64
%arrayidx29.3 = getelementptr inbounds [3 x [3 x i32]], ptr @puz, i64 0, i64 %idxprom26.3, i64 %idxprom28.3
%36 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%37 = load i32, ptr %arrayidx29.3, align 4, !tbaa !5
store i32 %37, ptr %arrayidx25, align 4, !tbaa !5
store i32 %36, ptr %arrayidx29.3, align 4, !tbaa !5
%call31.3 = tail call i32 @dfs(i32 noundef %add5.391, i32 noundef %add8.392, i32 noundef 3, i32 noundef %add30, i32 noundef %lim)
%tobool33.not.3 = icmp eq i32 %call31.3, -1
br i1 %tobool33.not.3, label %cleanup.sink.split, label %cleanup
cleanup.sink.split: ; preds = %if.end21.3, %if.end21.us.3
%arrayidx29.3.sink94 = phi ptr [ %arrayidx29.us.3, %if.end21.us.3 ], [ %arrayidx29.3, %if.end21.3 ]
%38 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%39 = load i32, ptr %arrayidx29.3.sink94, align 4, !tbaa !5
store i32 %39, ptr %arrayidx25, align 4, !tbaa !5
store i32 %38, ptr %arrayidx29.3.sink94, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %cleanup.sink.split, %if.end21, %if.end21.1, %if.end21.2, %if.end21.3, %if.end12.3, %for.inc.2, %if.end21.us, %if.end21.us.1, %if.end21.us.2, %if.end21.us.3, %for.inc.us.2, %if.end, %entry
%retval.0 = phi i32 [ %dep, %entry ], [ -1, %if.end ], [ %call31.us, %if.end21.us ], [ %call31.us.1, %if.end21.us.1 ], [ %call31.us.2, %if.end21.us.2 ], [ %call31.us.3, %if.end21.us.3 ], [ -1, %for.inc.us.2 ], [ %call31, %if.end21 ], [ %call31.1, %if.end21.1 ], [ %call31.2, %if.end21.2 ], [ %call31.3, %if.end21.3 ], [ -1, %if.end12.3 ], [ -1, %for.inc.2 ], [ -1, %cleanup.sink.split ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @puz)
%call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 0, i64 1))
%call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 0, i64 2))
%call.198 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 0))
%call.1.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 1))
%call.2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 2))
%call.2100 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 0))
%call.1.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 1))
%call.2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 2))
%0 = load i32, ptr @puz, align 16, !tbaa !5
%tobool.not.i = icmp eq i32 %0, 0
br i1 %tobool.not.i, label %empty.exit, label %for.inc.i
for.inc.i: ; preds = %entry
%1 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 0, i64 1), align 4, !tbaa !5
%tobool.not.1.i = icmp eq i32 %1, 0
br i1 %tobool.not.1.i, label %empty.exit, label %for.inc.1.i
for.inc.1.i: ; preds = %for.inc.i
%2 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 0, i64 2), align 8, !tbaa !5
%tobool.not.2.i = icmp eq i32 %2, 0
br i1 %tobool.not.2.i, label %empty.exit, label %for.inc.2.i
for.inc.2.i: ; preds = %for.inc.1.i
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 0), align 4, !tbaa !5
%tobool.not.125.i = icmp eq i32 %3, 0
br i1 %tobool.not.125.i, label %empty.exit, label %for.inc.126.i
for.inc.126.i: ; preds = %for.inc.2.i
%4 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 1), align 16, !tbaa !5
%tobool.not.1.1.i = icmp eq i32 %4, 0
br i1 %tobool.not.1.1.i, label %empty.exit, label %for.inc.1.1.i
for.inc.1.1.i: ; preds = %for.inc.126.i
%5 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 1, i64 2), align 4, !tbaa !5
%tobool.not.2.1.i = icmp eq i32 %5, 0
br i1 %tobool.not.2.1.i, label %empty.exit, label %for.inc.2.1.i
for.inc.2.1.i: ; preds = %for.inc.1.1.i
%6 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 0), align 8, !tbaa !5
%tobool.not.228.i = icmp eq i32 %6, 0
br i1 %tobool.not.228.i, label %empty.exit, label %for.inc.229.i
for.inc.229.i: ; preds = %for.inc.2.1.i
%7 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @puz, i64 0, i64 2, i64 1), align 4, !tbaa !5
%tobool.not.1.2.i = icmp eq i32 %7, 0
%spec.select = select i1 %tobool.not.1.2.i, i32 1, i32 2
br label %empty.exit
empty.exit: ; preds = %for.inc.229.i, %entry, %for.inc.i, %for.inc.1.i, %for.inc.2.i, %for.inc.126.i, %for.inc.1.1.i, %for.inc.2.1.i
%x.0 = phi i32 [ 0, %entry ], [ 1, %for.inc.i ], [ 2, %for.inc.1.i ], [ 0, %for.inc.2.i ], [ 1, %for.inc.126.i ], [ 2, %for.inc.1.1.i ], [ 0, %for.inc.2.1.i ], [ %spec.select, %for.inc.229.i ]
%y.0 = phi i32 [ 0, %entry ], [ 0, %for.inc.i ], [ 0, %for.inc.1.i ], [ 1, %for.inc.2.i ], [ 1, %for.inc.126.i ], [ 1, %for.inc.1.1.i ], [ 2, %for.inc.2.1.i ], [ 2, %for.inc.229.i ]
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) @tmp, ptr noundef nonnull align 16 dereferenceable(36) @puz, i64 36, i1 false), !tbaa !5
%call32110 = tail call i32 @dfs(i32 noundef %x.0, i32 noundef %y.0, i32 noundef -1, i32 noundef 0, i32 noundef 0)
%cmp33.not111 = icmp eq i32 %call32110, -1
br i1 %cmp33.not111, label %for.cond38.preheader.preheader, label %for.end61
for.cond12.preheader: ; preds = %for.cond38.preheader.preheader
%inc60 = add nuw nsw i32 %l.093112, 1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) @tmp, ptr noundef nonnull align 16 dereferenceable(36) @puz, i64 36, i1 false), !tbaa !5
%call32 = tail call i32 @dfs(i32 noundef %x.0, i32 noundef %y.0, i32 noundef -1, i32 noundef 0, i32 noundef %inc60)
%cmp33.not = icmp eq i32 %call32, -1
br i1 %cmp33.not, label %for.cond38.preheader.preheader, label %for.end61
for.cond38.preheader.preheader: ; preds = %empty.exit, %for.cond12.preheader
%l.093112 = phi i32 [ %inc60, %for.cond12.preheader ], [ 0, %empty.exit ]
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) @puz, ptr noundef nonnull align 16 dereferenceable(36) @tmp, i64 36, i1 false), !tbaa !5
%cmp55 = icmp eq i32 %l.093112, 99
br i1 %cmp55, label %for.end61, label %for.cond12.preheader
for.end61: ; preds = %for.cond12.preheader, %for.cond38.preheader.preheader, %empty.exit
%.sink = phi i32 [ %call32110, %empty.exit ], [ %call32, %for.cond12.preheader ], [ -1, %for.cond38.preheader.preheader ]
%call57 = tail 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 #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; 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) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
void swap(int *a , int *b) {
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
int main () {
int sticks[31];
int stickNum , rootNum;
int rootFrom , rootTo;
int i;
scanf("%d" , &stickNum);
for(i = 1; i <= stickNum; i++) {
sticks[i] = i;
}
scanf("%d" , &rootNum);
for(i = 0; i < rootNum; i++) {
scanf("%d,%d" , &rootFrom , &rootTo);
swap(&sticks[rootFrom] , &sticks[rootTo]);
}
for(i = 1; i <= stickNum; i++) {
printf("%d\n" , sticks[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189306/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189306/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: 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 #0 {
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: 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:
%sticks = alloca [31 x i32], align 16
%stickNum = alloca i32, align 4
%rootNum = alloca i32, align 4
%rootFrom = alloca i32, align 4
%rootTo = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %sticks) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %stickNum) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %rootNum) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %rootFrom) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %rootTo) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %stickNum)
%0 = load i32, ptr %stickNum, align 4, !tbaa !5
%cmp.not30 = icmp slt i32 %0, 1
br i1 %cmp.not30, label %for.end, label %for.body.preheader
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
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader41, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %2, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%offset.idx = or i64 %index, 1
%3 = getelementptr inbounds [31 x i32], ptr %sticks, i64 0, i64 %offset.idx
store <4 x i32> %vec.ind, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
store <4 x i32> %step.add, ptr %4, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader41
for.body.preheader41: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader41, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader41 ]
%arrayidx = getelementptr inbounds [31 x i32], ptr %sticks, i64 0, i64 %indvars.iv
%6 = trunc i64 %indvars.iv to i32
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %rootNum)
%7 = load i32, ptr %rootNum, align 4, !tbaa !5
%cmp332 = icmp sgt i32 %7, 0
br i1 %cmp332, label %for.body4, label %for.cond13.preheader
for.cond13.preheader: ; preds = %for.body4, %for.end
%8 = load i32, ptr %stickNum, align 4, !tbaa !5
%cmp14.not34 = icmp slt i32 %8, 1
br i1 %cmp14.not34, label %for.end21, label %for.body15
for.body4: ; preds = %for.end, %for.body4
%i.133 = phi i32 [ %inc11, %for.body4 ], [ 0, %for.end ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %rootFrom, ptr noundef nonnull %rootTo)
%9 = load i32, ptr %rootFrom, align 4, !tbaa !5
%idxprom6 = sext i32 %9 to i64
%arrayidx7 = getelementptr inbounds [31 x i32], ptr %sticks, i64 0, i64 %idxprom6
%10 = load i32, ptr %rootTo, align 4, !tbaa !5
%idxprom8 = sext i32 %10 to i64
%arrayidx9 = getelementptr inbounds [31 x i32], ptr %sticks, i64 0, i64 %idxprom8
%11 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx9, align 4, !tbaa !5
store i32 %12, ptr %arrayidx7, align 4, !tbaa !5
store i32 %11, ptr %arrayidx9, align 4, !tbaa !5
%inc11 = add nuw nsw i32 %i.133, 1
%13 = load i32, ptr %rootNum, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc11, %13
br i1 %cmp3, label %for.body4, label %for.cond13.preheader, !llvm.loop !14
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body15 ], [ 1, %for.cond13.preheader ]
%arrayidx17 = getelementptr inbounds [31 x i32], ptr %sticks, i64 0, i64 %indvars.iv37
%14 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%15 = load i32, ptr %stickNum, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp14.not.not = icmp slt i64 %indvars.iv37, %16
br i1 %cmp14.not.not, label %for.body15, label %for.end21, !llvm.loop !15
for.end21: ; preds = %for.body15, %for.cond13.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %rootTo) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %rootFrom) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %rootNum) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %stickNum) #4
call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %sticks) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(){
int a[31];
int n,w;
int i,j;
int x,y,tmp;
char c;
scanf("%d",&w);
scanf("%d",&n);
for(i=1;i<=w;i++)a[i]=i;
for(i=0;i<n;i++){
scanf("%d,%d",&x,&y);
tmp=a[x];
a[x]=a[y];
a[y]=tmp;
}
for(i=1;i<=w;i++)printf("%d\n",a[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189357/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189357/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [31 x i32], align 16
%n = alloca i32, align 4
%w = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #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 %w)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %w, align 4, !tbaa !5
%cmp.not34 = icmp slt i32 %0, 1
br i1 %cmp.not34, label %for.cond2.preheader, label %for.body.preheader
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
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader45, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %2, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%offset.idx = or i64 %index, 1
%3 = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %offset.idx
store <4 x i32> %vec.ind, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
store <4 x i32> %step.add, ptr %4, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader45
for.body.preheader45: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.cond2.preheader: ; preds = %for.body, %middle.block, %entry
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp336 = icmp sgt i32 %6, 0
br i1 %cmp336, label %for.body4, label %for.cond17.preheader
for.body: ; preds = %for.body.preheader45, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader45 ]
%arrayidx = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %indvars.iv
%7 = trunc i64 %indvars.iv to i32
store i32 %7, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !13
for.cond17.preheader.loopexit: ; preds = %for.body4
%.pre = load i32, ptr %w, align 4, !tbaa !5
br label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.cond17.preheader.loopexit, %for.cond2.preheader
%8 = phi i32 [ %.pre, %for.cond17.preheader.loopexit ], [ %0, %for.cond2.preheader ]
%cmp18.not38 = icmp slt i32 %8, 1
br i1 %cmp18.not38, label %for.end25, label %for.body19
for.body4: ; preds = %for.cond2.preheader, %for.body4
%i.137 = phi i32 [ %inc15, %for.body4 ], [ 0, %for.cond2.preheader ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%9 = load i32, ptr %x, align 4, !tbaa !5
%idxprom6 = sext i32 %9 to i64
%arrayidx7 = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %idxprom6
%10 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%11 = load i32, ptr %y, align 4, !tbaa !5
%idxprom8 = sext i32 %11 to i64
%arrayidx9 = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %idxprom8
%12 = load i32, ptr %arrayidx9, align 4, !tbaa !5
store i32 %12, ptr %arrayidx7, align 4, !tbaa !5
store i32 %10, ptr %arrayidx9, align 4, !tbaa !5
%inc15 = add nuw nsw i32 %i.137, 1
%13 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc15, %13
br i1 %cmp3, label %for.body4, label %for.cond17.preheader.loopexit, !llvm.loop !14
for.body19: ; preds = %for.cond17.preheader, %for.body19
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body19 ], [ 1, %for.cond17.preheader ]
%arrayidx21 = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %indvars.iv41
%14 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%15 = load i32, ptr %w, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp18.not.not = icmp slt i64 %indvars.iv41, %16
br i1 %cmp18.not.not, label %for.body19, label %for.end25, !llvm.loop !15
for.end25: ; preds = %for.body19, %for.cond17.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 124, 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
typedef struct {
int x;
long long int c;
} e;
void counting_sort(e a[], int n, int place)
{
int i, count[10] = {0};
for(i = 0 ;i < n; i++){
count[((a[i].x%place)- (a[i].x%(place/10)))/(place/10)]++;
}
for(i = 1; i< 10; i++) count[i] += count[i-1];
e temp[n];
for(i = n-1; i >= 0; i--){
temp[count[((a[i].x%place)- (a[i].x%(place/10)))/(place/10)]-1] = a[i];
count[((a[i].x%place)- (a[i].x%(place/10)))/(place/10)]--;
}
for(i = 0; i< n; i++) a[i] = temp[i];
}
void radix_sort(e a[], int n)
{
int i, j;
for(i = 10 , j = 9; j; i *= 10, j-- )
{
counting_sort(a, n, i);
}
}
int main()
{
int n, m, i, j;
long long int sum;
scanf("%d", &n);
e a[n];
for(i = 0; i < n; i++){
scanf("%d %I64d", &a[i].x, &a[i].c);
}
scanf("%d", &m);
e b[m];
for(i = 0; i < m; i++){
scanf("%d %I64d", &b[i].x, &b[i].c);
}
radix_sort(a, n);
radix_sort(b, m);
for(i = 0, j = 0, sum = 0; i < n && j < m; j++)
{
for(;a[i].x < b[j].x && i < n;i++) sum += a[i].c;
if(a[i].x == b[j].x){
if(a[i].c > b[j].c){
sum+= a[i].c;
}
else sum += b[j].c;
i++;
}
else
sum += b[j].c;
}
if(i < n){
for(;i < n; i++) sum += a[i].c;
}
if(j < m){
for(;j < m; j++) sum += b[j].c;
}
printf("%I64d \n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18940/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18940/source.c"
target datalayout = "e-m:e-p270: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.e = type { i32, i64 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %I64d\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"%I64d \0A\00", align 1
; Function Attrs: nofree nosync nounwind uwtable
define dso_local void @counting_sort(ptr nocapture noundef %a, i32 noundef %n, i32 noundef %place) local_unnamed_addr #0 {
entry:
%count = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %count) #8
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %count, i8 0, i64 40, i1 false)
%cmp107 = icmp sgt i32 %n, 0
br i1 %cmp107, label %for.body.lr.ph, label %entry.for.cond10.preheader_crit_edge
entry.for.cond10.preheader_crit_edge: ; preds = %entry
%.pre136 = zext i32 %n to i64
br label %for.cond10.preheader
for.body.lr.ph: ; preds = %entry
%div = sdiv i32 %place, 10
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond10.preheader.loopexit: ; preds = %for.body
%.pre = load i32, ptr %count, align 16, !tbaa !5
%arrayidx17.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 1
%.pre127 = load i32, ptr %arrayidx17.phi.trans.insert, align 4, !tbaa !5
%arrayidx17.1.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 2
%.pre128 = load i32, ptr %arrayidx17.1.phi.trans.insert, align 8, !tbaa !5
%arrayidx17.2.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 3
%.pre129 = load i32, ptr %arrayidx17.2.phi.trans.insert, align 4, !tbaa !5
%arrayidx17.3.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 4
%.pre130 = load i32, ptr %arrayidx17.3.phi.trans.insert, align 16, !tbaa !5
%arrayidx17.4.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 5
%.pre131 = load i32, ptr %arrayidx17.4.phi.trans.insert, align 4, !tbaa !5
%arrayidx17.5.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 6
%.pre132 = load i32, ptr %arrayidx17.5.phi.trans.insert, align 8, !tbaa !5
%arrayidx17.6.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 7
%.pre133 = load i32, ptr %arrayidx17.6.phi.trans.insert, align 4, !tbaa !5
%arrayidx17.7.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 8
%.pre134 = load i32, ptr %arrayidx17.7.phi.trans.insert, align 16, !tbaa !5
%arrayidx17.8.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 9
%.pre135 = load i32, ptr %arrayidx17.8.phi.trans.insert, align 4, !tbaa !5
%0 = add nsw i32 %.pre127, %.pre
br label %for.cond10.preheader
for.cond10.preheader: ; preds = %entry.for.cond10.preheader_crit_edge, %for.cond10.preheader.loopexit
%.pre-phi = phi i64 [ %.pre136, %entry.for.cond10.preheader_crit_edge ], [ %wide.trip.count, %for.cond10.preheader.loopexit ]
%1 = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %.pre135, %for.cond10.preheader.loopexit ]
%2 = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %.pre134, %for.cond10.preheader.loopexit ]
%3 = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %.pre133, %for.cond10.preheader.loopexit ]
%4 = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %.pre132, %for.cond10.preheader.loopexit ]
%5 = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %.pre131, %for.cond10.preheader.loopexit ]
%6 = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %.pre130, %for.cond10.preheader.loopexit ]
%7 = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %.pre129, %for.cond10.preheader.loopexit ]
%8 = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %.pre128, %for.cond10.preheader.loopexit ]
%add = phi i32 [ 0, %entry.for.cond10.preheader_crit_edge ], [ %0, %for.cond10.preheader.loopexit ]
%arrayidx17 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 1
store i32 %add, ptr %arrayidx17, align 4, !tbaa !5
%arrayidx17.1 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 2
%add.1 = add nsw i32 %8, %add
store i32 %add.1, ptr %arrayidx17.1, align 8, !tbaa !5
%arrayidx17.2 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 3
%add.2 = add nsw i32 %7, %add.1
store i32 %add.2, ptr %arrayidx17.2, align 4, !tbaa !5
%arrayidx17.3 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 4
%add.3 = add nsw i32 %6, %add.2
store i32 %add.3, ptr %arrayidx17.3, align 16, !tbaa !5
%arrayidx17.4 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 5
%add.4 = add nsw i32 %5, %add.3
store i32 %add.4, ptr %arrayidx17.4, align 4, !tbaa !5
%arrayidx17.5 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 6
%add.5 = add nsw i32 %4, %add.4
store i32 %add.5, ptr %arrayidx17.5, align 8, !tbaa !5
%arrayidx17.6 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 7
%add.6 = add nsw i32 %3, %add.5
store i32 %add.6, ptr %arrayidx17.6, align 4, !tbaa !5
%arrayidx17.7 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 8
%add.7 = add nsw i32 %2, %add.6
store i32 %add.7, ptr %arrayidx17.7, align 16, !tbaa !5
%arrayidx17.8 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 9
%add.8 = add nsw i32 %1, %add.7
store i32 %add.8, ptr %arrayidx17.8, align 4, !tbaa !5
%9 = tail call ptr @llvm.stacksave.p0()
%vla = alloca %struct.e, i64 %.pre-phi, align 16
br i1 %cmp107, label %for.body24.lr.ph, label %for.end70
for.body: ; preds = %for.body.lr.ph, %for.body
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds %struct.e, ptr %a, i64 %indvars.iv
%10 = load i32, ptr %arrayidx, align 8, !tbaa !9
%rem = srem i32 %10, %place
%rem4 = srem i32 %10, %div
%sub = sub nsw i32 %rem, %rem4
%div6 = sdiv i32 %sub, %div
%idxprom7 = sext i32 %div6 to i64
%arrayidx8 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 %idxprom7
%11 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%inc = add nsw i32 %11, 1
store i32 %inc, ptr %arrayidx8, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond10.preheader.loopexit, label %for.body, !llvm.loop !12
for.body24.lr.ph: ; preds = %for.cond10.preheader
%div32 = sdiv i32 %place, 10
br label %for.body24
for.cond61.preheader: ; preds = %for.body24
br i1 %cmp107, label %for.body63.preheader, label %for.end70
for.body63.preheader: ; preds = %for.cond61.preheader
%12 = shl nuw nsw i64 %.pre-phi, 4
call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %a, ptr nonnull align 16 %vla, i64 %12, i1 false)
br label %for.end70
for.body24: ; preds = %for.body24.lr.ph, %for.body24
%indvars.iv120 = phi i64 [ %.pre-phi, %for.body24.lr.ph ], [ %indvars.iv.next121, %for.body24 ]
%indvars.iv.next121 = add nsw i64 %indvars.iv120, -1
%idxprom25 = and i64 %indvars.iv.next121, 4294967295
%arrayidx26 = getelementptr inbounds %struct.e, ptr %a, i64 %idxprom25
%13 = load i32, ptr %arrayidx26, align 8, !tbaa !9
%rem28 = srem i32 %13, %place
%rem33 = srem i32 %13, %div32
%sub34 = sub nsw i32 %rem28, %rem33
%div36 = sdiv i32 %sub34, %div32
%idxprom37 = sext i32 %div36 to i64
%arrayidx38 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 %idxprom37
%14 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%sub39 = add nsw i32 %14, -1
%idxprom40 = sext i32 %sub39 to i64
%arrayidx41 = getelementptr inbounds %struct.e, ptr %vla, i64 %idxprom40
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx41, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx26, i64 16, i1 false), !tbaa.struct !14
store i32 %sub39, ptr %arrayidx38, align 4, !tbaa !5
%cmp23 = icmp sgt i64 %indvars.iv120, 1
br i1 %cmp23, label %for.body24, label %for.cond61.preheader, !llvm.loop !16
for.end70: ; preds = %for.cond10.preheader, %for.body63.preheader, %for.cond61.preheader
tail call void @llvm.stackrestore.p0(ptr %9)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %count) #8
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind uwtable
define dso_local void @radix_sort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 10)
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 100)
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 1000)
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 10000)
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 100000)
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 1000000)
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 10000000)
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 100000000)
tail call void @counting_sort(ptr noundef %a, i32 noundef %n, i32 noundef 1000000000)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #8
%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 %struct.e, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp141 = icmp sgt i32 %3, 0
br i1 %cmp141, 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 %struct.e, ptr %vla, i64 %indvars.iv
%c = getelementptr inbounds %struct.e, ptr %vla, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %c)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !17
for.end: ; preds = %for.body, %entry
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%6 = load i32, ptr %m, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla5 = alloca %struct.e, i64 %7, align 16
%cmp7143 = icmp sgt i32 %6, 0
br i1 %cmp7143, label %for.body8, label %for.end18
for.body8: ; preds = %for.end, %for.body8
%indvars.iv181 = phi i64 [ %indvars.iv.next182, %for.body8 ], [ 0, %for.end ]
%arrayidx10 = getelementptr inbounds %struct.e, ptr %vla5, i64 %indvars.iv181
%c14 = getelementptr inbounds %struct.e, ptr %vla5, i64 %indvars.iv181, i32 1
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx10, ptr noundef nonnull %c14)
%indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp7 = icmp slt i64 %indvars.iv.next182, %9
br i1 %cmp7, label %for.body8, label %for.end18, !llvm.loop !18
for.end18: ; preds = %for.body8, %for.end
%10 = load i32, ptr %n, align 4, !tbaa !5
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 10)
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 100)
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 1000)
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 10000)
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 100000)
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 1000000)
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 10000000)
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 100000000)
call void @counting_sort(ptr noundef nonnull %vla, i32 noundef %10, i32 noundef 1000000000)
%11 = load i32, ptr %m, align 4, !tbaa !5
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 10)
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 100)
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 1000)
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 10000)
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 100000)
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 1000000)
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 10000000)
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 100000000)
call void @counting_sort(ptr noundef nonnull %vla5, i32 noundef %11, i32 noundef 1000000000)
%12 = load i32, ptr %n, align 4
%13 = load i32, ptr %m, align 4
%cmp20156 = icmp sgt i32 %12, 0
%cmp21157 = icmp sgt i32 %13, 0
%14 = select i1 %cmp20156, i1 %cmp21157, i1 false
br i1 %14, label %for.cond23.preheader.preheader, label %for.end73
for.cond23.preheader.preheader: ; preds = %for.end18
%15 = zext i32 %12 to i64
%16 = zext i32 %13 to i64
br label %for.cond23.preheader
for.cond23.preheader: ; preds = %for.cond23.preheader.preheader, %for.inc71
%indvars.iv187 = phi i64 [ 0, %for.cond23.preheader.preheader ], [ %indvars.iv.next188, %for.inc71 ]
%i.2160 = phi i32 [ 0, %for.cond23.preheader.preheader ], [ %i.4, %for.inc71 ]
%sum.0158 = phi i64 [ 0, %for.cond23.preheader.preheader ], [ %sum.3, %for.inc71 ]
%arrayidx28 = getelementptr inbounds %struct.e, ptr %vla5, i64 %indvars.iv187
%17 = load i32, ptr %arrayidx28, align 16, !tbaa !9
%idxprom24145 = sext i32 %i.2160 to i64
%arrayidx25146 = getelementptr inbounds %struct.e, ptr %vla, i64 %idxprom24145
%18 = load i32, ptr %arrayidx25146, align 16, !tbaa !9
%cmp30147 = icmp slt i32 %18, %17
br i1 %cmp30147, label %for.body34, label %for.end40
for.body34: ; preds = %for.cond23.preheader, %for.body34
%indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.body34 ], [ %idxprom24145, %for.cond23.preheader ]
%sum.1148 = phi i64 [ %add, %for.body34 ], [ %sum.0158, %for.cond23.preheader ]
%c37 = getelementptr inbounds %struct.e, ptr %vla, i64 %indvars.iv184, i32 1
%19 = load i64, ptr %c37, align 8, !tbaa !19
%add = add nsw i64 %19, %sum.1148
%indvars.iv.next185 = add nsw i64 %indvars.iv184, 1
%arrayidx25 = getelementptr inbounds %struct.e, ptr %vla, i64 %indvars.iv.next185
%20 = load i32, ptr %arrayidx25, align 16, !tbaa !9
%cmp30 = icmp slt i32 %20, %17
%cmp32 = icmp slt i64 %indvars.iv.next185, %15
%21 = and i1 %cmp32, %cmp30
br i1 %21, label %for.body34, label %for.end40.loopexit, !llvm.loop !20
for.end40.loopexit: ; preds = %for.body34
%22 = trunc i64 %indvars.iv.next185 to i32
br label %for.end40
for.end40: ; preds = %for.end40.loopexit, %for.cond23.preheader
%sum.1.lcssa = phi i64 [ %sum.0158, %for.cond23.preheader ], [ %add, %for.end40.loopexit ]
%i.3.lcssa = phi i32 [ %i.2160, %for.cond23.preheader ], [ %22, %for.end40.loopexit ]
%idxprom24.lcssa = phi i64 [ %idxprom24145, %for.cond23.preheader ], [ %indvars.iv.next185, %for.end40.loopexit ]
%.lcssa138 = phi i32 [ %18, %for.cond23.preheader ], [ %20, %for.end40.loopexit ]
%cmp47 = icmp eq i32 %.lcssa138, %17
br i1 %cmp47, label %if.then, label %if.else65
if.then: ; preds = %for.end40
%c50 = getelementptr inbounds %struct.e, ptr %vla, i64 %idxprom24.lcssa, i32 1
%23 = load i64, ptr %c50, align 8, !tbaa !19
%c53 = getelementptr inbounds %struct.e, ptr %vla5, i64 %indvars.iv187, i32 1
%24 = load i64, ptr %c53, align 8, !tbaa !19
%. = call i64 @llvm.smax.i64(i64 %23, i64 %24)
%inc64 = add nsw i32 %i.3.lcssa, 1
br label %for.inc71
if.else65: ; preds = %for.end40
%c68 = getelementptr inbounds %struct.e, ptr %vla5, i64 %indvars.iv187, i32 1
%25 = load i64, ptr %c68, align 8, !tbaa !19
br label %for.inc71
for.inc71: ; preds = %if.then, %if.else65
%.pn.pn = phi i64 [ %., %if.then ], [ %25, %if.else65 ]
%i.4 = phi i32 [ %inc64, %if.then ], [ %i.3.lcssa, %if.else65 ]
%sum.3 = add nsw i64 %.pn.pn, %sum.1.lcssa
%indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
%cmp20 = icmp slt i32 %i.4, %12
%cmp21 = icmp ult i64 %indvars.iv.next188, %16
%26 = select i1 %cmp20, i1 %cmp21, i1 false
br i1 %26, label %for.cond23.preheader, label %for.end73.loopexit, !llvm.loop !21
for.end73.loopexit: ; preds = %for.inc71
%27 = trunc i64 %indvars.iv.next188 to i32
br label %for.end73
for.end73: ; preds = %for.end73.loopexit, %for.end18
%sum.0.lcssa = phi i64 [ 0, %for.end18 ], [ %sum.3, %for.end73.loopexit ]
%j.0.lcssa = phi i32 [ 0, %for.end18 ], [ %27, %for.end73.loopexit ]
%i.2.lcssa = phi i32 [ 0, %for.end18 ], [ %i.4, %for.end73.loopexit ]
%cmp20.lcssa = phi i1 [ %cmp20156, %for.end18 ], [ %cmp20, %for.end73.loopexit ]
%cmp21.lcssa = phi i1 [ %cmp21157, %for.end18 ], [ %cmp21, %for.end73.loopexit ]
%cmp77168 = icmp slt i32 %i.2.lcssa, %12
%or.cond = and i1 %cmp20.lcssa, %cmp77168
br i1 %or.cond, label %for.body78.preheader, label %if.end86
for.body78.preheader: ; preds = %for.end73
%28 = sext i32 %i.2.lcssa to i64
%wide.trip.count = sext i32 %12 to i64
%29 = sub nsw i64 %wide.trip.count, %28
%min.iters.check = icmp ult i64 %29, 5
br i1 %min.iters.check, label %for.body78.preheader227, label %vector.ph
vector.ph: ; preds = %for.body78.preheader
%n.mod.vf = and i64 %29, 3
%30 = icmp eq i64 %n.mod.vf, 0
%31 = select i1 %30, i64 4, i64 %n.mod.vf
%n.vec = sub nsw i64 %29, %31
%ind.end = add nsw i64 %n.vec, %28
%32 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %sum.0.lcssa, 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 <2 x i64> [ %32, %vector.ph ], [ %36, %vector.body ]
%vec.phi202 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %37, %vector.body ]
%offset.idx = add i64 %index, %28
%33 = add i64 %offset.idx, 2
%34 = getelementptr inbounds %struct.e, ptr %vla, i64 %offset.idx, i32 1
%35 = getelementptr inbounds %struct.e, ptr %vla, i64 %33, i32 1
%wide.vec = load <4 x i64>, ptr %34, align 8, !tbaa !19
%wide.vec203 = load <4 x i64>, ptr %35, align 8, !tbaa !19
%strided.vec = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
%strided.vec204 = shufflevector <4 x i64> %wide.vec203, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
%36 = add <2 x i64> %strided.vec, %vec.phi
%37 = add <2 x i64> %strided.vec204, %vec.phi202
%index.next = add nuw i64 %index, 4
%38 = icmp eq i64 %index.next, %n.vec
br i1 %38, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %37, %36
%39 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
br label %for.body78.preheader227
for.body78.preheader227: ; preds = %for.body78.preheader, %middle.block
%indvars.iv190.ph = phi i64 [ %28, %for.body78.preheader ], [ %ind.end, %middle.block ]
%sum.4169.ph = phi i64 [ %sum.0.lcssa, %for.body78.preheader ], [ %39, %middle.block ]
br label %for.body78
for.body78: ; preds = %for.body78.preheader227, %for.body78
%indvars.iv190 = phi i64 [ %indvars.iv.next191, %for.body78 ], [ %indvars.iv190.ph, %for.body78.preheader227 ]
%sum.4169 = phi i64 [ %add82, %for.body78 ], [ %sum.4169.ph, %for.body78.preheader227 ]
%c81 = getelementptr inbounds %struct.e, ptr %vla, i64 %indvars.iv190, i32 1
%40 = load i64, ptr %c81, align 8, !tbaa !19
%add82 = add nsw i64 %40, %sum.4169
%indvars.iv.next191 = add nsw i64 %indvars.iv190, 1
%exitcond.not = icmp eq i64 %indvars.iv.next191, %wide.trip.count
br i1 %exitcond.not, label %if.end86, label %for.body78, !llvm.loop !25
if.end86: ; preds = %for.body78, %for.end73
%sum.5 = phi i64 [ %sum.0.lcssa, %for.end73 ], [ %add82, %for.body78 ]
%cmp90172 = icmp slt i32 %j.0.lcssa, %13
%or.cond176 = select i1 %cmp21.lcssa, i1 %cmp90172, i1 false
br i1 %or.cond176, label %for.body91.preheader, label %if.end99
for.body91.preheader: ; preds = %if.end86
%41 = zext i32 %j.0.lcssa to i64
%wide.trip.count196 = zext i32 %13 to i64
%42 = sub nsw i64 %wide.trip.count196, %41
%min.iters.check207 = icmp ult i64 %42, 5
br i1 %min.iters.check207, label %for.body91.preheader225, label %vector.ph208
vector.ph208: ; preds = %for.body91.preheader
%n.mod.vf209 = and i64 %42, 3
%43 = icmp eq i64 %n.mod.vf209, 0
%44 = select i1 %43, i64 4, i64 %n.mod.vf209
%n.vec210 = sub nsw i64 %42, %44
%ind.end211 = add nsw i64 %n.vec210, %41
%45 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %sum.5, i64 0
br label %vector.body213
vector.body213: ; preds = %vector.body213, %vector.ph208
%index214 = phi i64 [ 0, %vector.ph208 ], [ %index.next222, %vector.body213 ]
%vec.phi215 = phi <2 x i64> [ %45, %vector.ph208 ], [ %49, %vector.body213 ]
%vec.phi216 = phi <2 x i64> [ zeroinitializer, %vector.ph208 ], [ %50, %vector.body213 ]
%offset.idx217 = add i64 %index214, %41
%46 = add i64 %offset.idx217, 2
%47 = getelementptr inbounds %struct.e, ptr %vla5, i64 %offset.idx217, i32 1
%48 = getelementptr inbounds %struct.e, ptr %vla5, i64 %46, i32 1
%wide.vec218 = load <4 x i64>, ptr %47, align 8, !tbaa !19
%wide.vec219 = load <4 x i64>, ptr %48, align 8, !tbaa !19
%strided.vec220 = shufflevector <4 x i64> %wide.vec218, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
%strided.vec221 = shufflevector <4 x i64> %wide.vec219, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
%49 = add <2 x i64> %strided.vec220, %vec.phi215
%50 = add <2 x i64> %strided.vec221, %vec.phi216
%index.next222 = add nuw i64 %index214, 4
%51 = icmp eq i64 %index.next222, %n.vec210
br i1 %51, label %middle.block205, label %vector.body213, !llvm.loop !26
middle.block205: ; preds = %vector.body213
%bin.rdx223 = add <2 x i64> %50, %49
%52 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx223)
br label %for.body91.preheader225
for.body91.preheader225: ; preds = %for.body91.preheader, %middle.block205
%indvars.iv193.ph = phi i64 [ %41, %for.body91.preheader ], [ %ind.end211, %middle.block205 ]
%sum.6173.ph = phi i64 [ %sum.5, %for.body91.preheader ], [ %52, %middle.block205 ]
br label %for.body91
for.body91: ; preds = %for.body91.preheader225, %for.body91
%indvars.iv193 = phi i64 [ %indvars.iv.next194, %for.body91 ], [ %indvars.iv193.ph, %for.body91.preheader225 ]
%sum.6173 = phi i64 [ %add95, %for.body91 ], [ %sum.6173.ph, %for.body91.preheader225 ]
%c94 = getelementptr inbounds %struct.e, ptr %vla5, i64 %indvars.iv193, i32 1
%53 = load i64, ptr %c94, align 8, !tbaa !19
%add95 = add nsw i64 %53, %sum.6173
%indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
%exitcond197.not = icmp eq i64 %indvars.iv.next194, %wide.trip.count196
br i1 %exitcond197.not, label %if.end99, label %for.body91, !llvm.loop !27
if.end99: ; preds = %for.body91, %if.end86
%sum.7 = phi i64 [ %sum.5, %if.end86 ], [ %add95, %for.body91 ]
%call100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sum.7)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #7
attributes #0 = { nofree nosync nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !11, i64 8}
!11 = !{!"long long", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i64 0, i64 4, !5, i64 8, i64 8, !15}
!15 = !{!11, !11, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = !{!10, !11, i64 8}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13, !23, !24}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !13, !24, !23}
!26 = distinct !{!26, !13, !23, !24}
!27 = distinct !{!27, !13, !24, !23}
|
#include <stdio.h>
int main(void) {
int s,t,n,o;
int i;
scanf("%d",&s);
int w[s+1];
for(i=0;i< s;i++)
w[i]=i+1;
scanf("%d",&t);
for(i=0;i< t;i++) {
scanf("%d,%d",&n,&o);
w[s]=w[n-1];
w[n-1]=w[o-1];
w[o-1]=w[s];
}
for(i=0;i< s;i++)
printf("%d\n",w[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189458/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189458/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%t = alloca i32, align 4
%n = alloca i32, align 4
%o = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %o) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %s, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %3, 0
br i1 %cmp42, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body.preheader53, 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 ]
%vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%4 = getelementptr inbounds i32, ptr %vla, i64 %index
%5 = trunc <4 x i64> %vec.ind to <4 x i32>
%6 = add <4 x i32> %5, <i32 1, i32 1, i32 1, i32 1>
%7 = trunc <4 x i64> %vec.ind to <4 x i32>
%8 = add <4 x i32> %7, <i32 5, i32 5, i32 5, i32 5>
store <4 x i32> %6, ptr %4, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %4, i64 4
store <4 x i32> %8, ptr %9, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader53
for.body.preheader53: ; 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.preheader53, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader53 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%11 = trunc i64 %indvars.iv.next to i32
store i32 %11, ptr %arrayidx, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%12 = load i32, ptr %t, align 4, !tbaa !5
%cmp444 = icmp sgt i32 %12, 0
br i1 %cmp444, label %for.body5, label %for.end.for.cond25.preheader_crit_edge
for.end.for.cond25.preheader_crit_edge: ; preds = %for.end
%.pre = load i32, ptr %s, align 4, !tbaa !5
br label %for.cond25.preheader
for.cond25.preheader: ; preds = %for.body5, %for.end.for.cond25.preheader_crit_edge
%13 = phi i32 [ %.pre, %for.end.for.cond25.preheader_crit_edge ], [ %16, %for.body5 ]
%cmp2646 = icmp sgt i32 %13, 0
br i1 %cmp2646, label %for.body27, label %for.end33
for.body5: ; preds = %for.end, %for.body5
%i.145 = phi i32 [ %inc23, %for.body5 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %o)
%14 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%idxprom7 = sext i32 %sub to i64
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %idxprom7
%15 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%16 = load i32, ptr %s, align 4, !tbaa !5
%idxprom9 = sext i32 %16 to i64
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %idxprom9
store i32 %15, ptr %arrayidx10, align 4, !tbaa !5
%17 = load i32, ptr %o, align 4, !tbaa !5
%sub11 = add nsw i32 %17, -1
%idxprom12 = sext i32 %sub11 to i64
%arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %idxprom12
%18 = load i32, ptr %arrayidx13, align 4, !tbaa !5
store i32 %18, ptr %arrayidx8, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %19, ptr %arrayidx13, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %i.145, 1
%20 = load i32, ptr %t, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc23, %20
br i1 %cmp4, label %for.body5, label %for.cond25.preheader, !llvm.loop !14
for.body27: ; preds = %for.cond25.preheader, %for.body27
%indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.body27 ], [ 0, %for.cond25.preheader ]
%arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv49
%21 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
%indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
%22 = load i32, ptr %s, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp26 = icmp slt i64 %indvars.iv.next50, %23
br i1 %cmp26, label %for.body27, label %for.end33, !llvm.loop !15
for.end33: ; preds = %for.body27, %for.cond25.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %o) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#include <stdlib.h>
void swap (int *i, int *j){
int *tmp = (int*) malloc (sizeof(int));
*tmp = *i;
*i = *j;
*j = *tmp;
free (tmp);
}
int main(void) {
int w, n, l[30], h[2], i;
scanf ("%d %d", &w, &n);
for (i=0; i<w; i++) l[i] = i+1;
for (i=0; i<n; i++){
scanf ("%d,%d", &h[0], &h[1]);
swap (&l[h[0]-1], &l[h[1]-1]);
}
for (i=0; i<w; i++) printf ("%d\n", l[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189515/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189515/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %i, ptr nocapture noundef %j) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %i, align 4, !tbaa !5
%1 = load i32, ptr %j, align 4, !tbaa !5
store i32 %1, ptr %i, align 4, !tbaa !5
store i32 %0, ptr %j, 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:
%w = alloca i32, align 4
%n = alloca i32, align 4
%l = alloca [30 x i32], align 16
%h = alloca [2 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %n)
%0 = load i32, ptr %w, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body.preheader, label %for.cond1.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader45, 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 ]
%vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%1 = getelementptr inbounds [30 x i32], ptr %l, i64 0, i64 %index
%2 = trunc <4 x i64> %vec.ind to <4 x i32>
%3 = add <4 x i32> %2, <i32 1, i32 1, i32 1, i32 1>
%4 = trunc <4 x i64> %vec.ind to <4 x i32>
%5 = add <4 x i32> %4, <i32 5, i32 5, i32 5, i32 5>
store <4 x i32> %3, ptr %1, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> %5, ptr %6, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader45
for.body.preheader45: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block, %entry
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp236 = icmp sgt i32 %8, 0
br i1 %cmp236, label %for.body3.lr.ph, label %for.cond17.preheader
for.body3.lr.ph: ; preds = %for.cond1.preheader
%arrayidx5 = getelementptr inbounds [2 x i32], ptr %h, i64 0, i64 1
br label %for.body3
for.body: ; preds = %for.body.preheader45, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader45 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [30 x i32], ptr %l, i64 0, i64 %indvars.iv
%9 = trunc i64 %indvars.iv.next to i32
store i32 %9, ptr %arrayidx, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !13
for.cond17.preheader.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %w, align 4, !tbaa !5
br label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.cond17.preheader.loopexit, %for.cond1.preheader
%10 = phi i32 [ %.pre, %for.cond17.preheader.loopexit ], [ %0, %for.cond1.preheader ]
%cmp1838 = icmp sgt i32 %10, 0
br i1 %cmp1838, label %for.body19, label %for.end25
for.body3: ; preds = %for.body3.lr.ph, %for.body3
%i.137 = phi i32 [ 0, %for.body3.lr.ph ], [ %inc15, %for.body3 ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h, ptr noundef nonnull %arrayidx5)
%11 = load i32, ptr %h, align 4, !tbaa !5
%sub = add nsw i32 %11, -1
%idxprom8 = sext i32 %sub to i64
%arrayidx9 = getelementptr inbounds [30 x i32], ptr %l, i64 0, i64 %idxprom8
%12 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%sub11 = add nsw i32 %12, -1
%idxprom12 = sext i32 %sub11 to i64
%arrayidx13 = getelementptr inbounds [30 x i32], ptr %l, i64 0, i64 %idxprom12
%13 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%14 = load i32, ptr %arrayidx13, align 4, !tbaa !5
store i32 %14, ptr %arrayidx9, align 4, !tbaa !5
store i32 %13, ptr %arrayidx13, align 4, !tbaa !5
%inc15 = add nuw nsw i32 %i.137, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc15, %15
br i1 %cmp2, label %for.body3, label %for.cond17.preheader.loopexit, !llvm.loop !14
for.body19: ; preds = %for.cond17.preheader, %for.body19
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body19 ], [ 0, %for.cond17.preheader ]
%arrayidx21 = getelementptr inbounds [30 x i32], ptr %l, i64 0, i64 %indvars.iv41
%16 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%17 = load i32, ptr %w, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp18 = icmp slt i64 %indvars.iv.next42, %18
br i1 %cmp18, label %for.body19, label %for.end25, !llvm.loop !15
for.end25: ; preds = %for.body19, %for.cond17.preheader
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main()
{
int a[30];
int w,n,i,an,bn,nazo;
scanf("%d",&w);
for(i=0;i<w;i++)a[i]=i+1;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d,%d",&an,&bn);
nazo=a[an-1];a[an-1]=a[bn-1];a[bn-1]=nazo;
}
for(i=0;i<w;i++)printf("%d\n",a[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189559/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189559/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [30 x i32], align 16
%w = alloca i32, align 4
%n = alloca i32, align 4
%an = alloca i32, align 4
%bn = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %an) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %bn) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%0 = load i32, ptr %w, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader48, 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 ]
%vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%1 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %index
%2 = trunc <4 x i64> %vec.ind to <4 x i32>
%3 = add <4 x i32> %2, <i32 1, i32 1, i32 1, i32 1>
%4 = trunc <4 x i64> %vec.ind to <4 x i32>
%5 = add <4 x i32> %4, <i32 5, i32 5, i32 5, i32 5>
store <4 x i32> %3, ptr %1, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> %5, ptr %6, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader48
for.body.preheader48: ; 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.preheader48, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader48 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv
%8 = trunc i64 %indvars.iv.next to i32
store i32 %8, ptr %arrayidx, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp339 = icmp sgt i32 %9, 0
br i1 %cmp339, label %for.body4, label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.body4, %for.end
%10 = load i32, ptr %w, align 4, !tbaa !5
%cmp2141 = icmp sgt i32 %10, 0
br i1 %cmp2141, label %for.body22, label %for.end28
for.body4: ; preds = %for.end, %for.body4
%i.140 = phi i32 [ %inc18, %for.body4 ], [ 0, %for.end ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %an, ptr noundef nonnull %bn)
%11 = load i32, ptr %an, align 4, !tbaa !5
%sub = add nsw i32 %11, -1
%idxprom6 = sext i32 %sub to i64
%arrayidx7 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %idxprom6
%12 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%13 = load i32, ptr %bn, align 4, !tbaa !5
%sub8 = add nsw i32 %13, -1
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %idxprom9
%14 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %14, ptr %arrayidx7, align 4, !tbaa !5
store i32 %12, ptr %arrayidx10, align 4, !tbaa !5
%inc18 = add nuw nsw i32 %i.140, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc18, %15
br i1 %cmp3, label %for.body4, label %for.cond20.preheader, !llvm.loop !14
for.body22: ; preds = %for.cond20.preheader, %for.body22
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body22 ], [ 0, %for.cond20.preheader ]
%arrayidx24 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv44
%16 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%17 = load i32, ptr %w, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp21 = icmp slt i64 %indvars.iv.next45, %18
br i1 %cmp21, label %for.body22, label %for.end28, !llvm.loop !15
for.end28: ; preds = %for.body22, %for.cond20.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %bn) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %an) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 120, 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main(){
int w, n, a, b, i, store, s[30];
for(i = 0; i < 30; i++) s[i] = i + 1;
scanf("%d", &w);
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d,%d", &a, &b);
store = s[a - 1];
s[a - 1] = s[b - 1];
s[b - 1] = store;
}
for(i = 0; i < w; i++) printf("%d\n", s[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189609/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189609/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%s = alloca [30 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %s) #3
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, ptr %s, align 16, !tbaa !5
%arrayidx.4 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 4
store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, ptr %arrayidx.4, align 16, !tbaa !5
%arrayidx.8 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 8
store <4 x i32> <i32 9, i32 10, i32 11, i32 12>, ptr %arrayidx.8, align 16, !tbaa !5
%arrayidx.12 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 12
store <4 x i32> <i32 13, i32 14, i32 15, i32 16>, ptr %arrayidx.12, align 16, !tbaa !5
%arrayidx.16 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 16
store <4 x i32> <i32 17, i32 18, i32 19, i32 20>, ptr %arrayidx.16, align 16, !tbaa !5
%arrayidx.20 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 20
store <4 x i32> <i32 21, i32 22, i32 23, i32 24>, ptr %arrayidx.20, align 16, !tbaa !5
%arrayidx.24 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 24
store <4 x i32> <i32 25, i32 26, i32 27, i32 28>, ptr %arrayidx.24, align 16, !tbaa !5
%arrayidx.28 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 28
store i32 29, ptr %arrayidx.28, align 16, !tbaa !5
%arrayidx.29 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 29
store i32 30, ptr %arrayidx.29, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp338 = icmp sgt i32 %0, 0
br i1 %cmp338, label %for.body4, label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.body4, %entry
%1 = load i32, ptr %w, align 4, !tbaa !5
%cmp2140 = icmp sgt i32 %1, 0
br i1 %cmp2140, label %for.body22, label %for.end28
for.body4: ; preds = %entry, %for.body4
%i.139 = phi i32 [ %inc18, %for.body4 ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%2 = load i32, ptr %a, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom6 = sext i32 %sub to i64
%arrayidx7 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 %idxprom6
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%4 = load i32, ptr %b, align 4, !tbaa !5
%sub8 = add nsw i32 %4, -1
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 %idxprom9
%5 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %5, ptr %arrayidx7, align 4, !tbaa !5
store i32 %3, ptr %arrayidx10, align 4, !tbaa !5
%inc18 = add nuw nsw i32 %i.139, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc18, %6
br i1 %cmp3, label %for.body4, label %for.cond20.preheader, !llvm.loop !9
for.body22: ; preds = %for.cond20.preheader, %for.body22
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body22 ], [ 0, %for.cond20.preheader ]
%arrayidx24 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %w, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp21 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp21, label %for.body22, label %for.end28, !llvm.loop !11
for.end28: ; preds = %for.body22, %for.cond20.preheader
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %s) #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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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 w[30];
int n, n2;
int a[30], b[30];
int i, j;
scanf("%d", &n);
scanf("%d", &n2);
for (i = 0; i < n2; i++){
scanf("%d,%d", &a[i], &b[i]);
a[i]--;
b[i]--;
}
for (i = 0; i < n; i++){
w[i] = i;
}
for (i = 0; i < n; i++){
for (j = 0; j < n2; j++){
if (w[i] == a[j]){
w[i] = b[j];
}
else if (w[i] == b[j]){
w[i] = a[j];
}
}
}
for (i = 0; i < n; i++){
for (j = 0; j < n; j++){
if (w[j] == i){
printf("%d\n", j + 1);
}
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189652/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189652/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca [30 x i32], align 16
%n = alloca i32, align 4
%n2 = alloca i32, align 4
%a = alloca [30 x i32], align 16
%b = alloca [30 x i32], align 16
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %w) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #3
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n2)
%0 = load i32, ptr %n2, align 4, !tbaa !5
%cmp97 = icmp sgt i32 %0, 0
br i1 %cmp97, label %for.body, label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.body, %entry
%.lcssa96 = phi i32 [ %0, %entry ], [ %7, %for.body ]
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp1199 = icmp sgt i32 %1, 0
br i1 %cmp1199, label %for.body12.preheader, label %for.end67
for.body12.preheader: ; preds = %for.cond10.preheader
%wide.trip.count = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body12.preheader140, label %vector.ph
vector.ph: ; preds = %for.body12.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%2 = getelementptr inbounds [30 x i32], ptr %w, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> %step.add, ptr %3, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%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
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond18.preheader, label %for.body12.preheader140
for.body12.preheader140: ; preds = %for.body12.preheader, %middle.block
%indvars.iv115.ph = phi i64 [ 0, %for.body12.preheader ], [ %n.vec, %middle.block ]
br label %for.body12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx3 = getelementptr inbounds [30 x i32], ptr %b, i64 0, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%dec = add nsw i32 %5, -1
store i32 %dec, ptr %arrayidx, align 4, !tbaa !5
%6 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%dec9 = add nsw i32 %6, -1
store i32 %dec9, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n2, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond10.preheader, !llvm.loop !13
for.cond18.preheader: ; preds = %for.body12, %middle.block
br i1 %cmp1199, label %for.cond21.preheader.lr.ph, label %for.end67
for.cond21.preheader.lr.ph: ; preds = %for.cond18.preheader
%cmp22102 = icmp sgt i32 %.lcssa96, 0
br i1 %cmp22102, label %for.cond21.preheader.us.preheader, label %for.cond53.preheader.preheader
for.cond21.preheader.us.preheader: ; preds = %for.cond21.preheader.lr.ph
%wide.trip.count126 = zext i32 %1 to i64
%wide.trip.count121 = zext i32 %.lcssa96 to i64
%xtraiter = and i64 %wide.trip.count121, 1
%9 = icmp eq i32 %.lcssa96, 1
%unroll_iter = and i64 %wide.trip.count121, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond21.preheader.us
for.cond21.preheader.us: ; preds = %for.cond21.preheader.us.preheader, %for.cond21.for.inc47_crit_edge.us
%indvars.iv123 = phi i64 [ 0, %for.cond21.preheader.us.preheader ], [ %indvars.iv.next124, %for.cond21.for.inc47_crit_edge.us ]
%arrayidx25.us = getelementptr inbounds [30 x i32], ptr %w, i64 0, i64 %indvars.iv123
%arrayidx25.promoted.us = load i32, ptr %arrayidx25.us, align 4, !tbaa !5
br i1 %9, label %for.cond21.for.inc47_crit_edge.us.unr-lcssa, label %for.body23.us
for.body23.us: ; preds = %for.cond21.preheader.us, %for.body23.us
%indvars.iv118 = phi i64 [ %indvars.iv.next119.1, %for.body23.us ], [ 0, %for.cond21.preheader.us ]
%10 = phi i32 [ %16, %for.body23.us ], [ %arrayidx25.promoted.us, %for.cond21.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.body23.us ], [ 0, %for.cond21.preheader.us ]
%arrayidx27.us = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv118
%11 = load i32, ptr %arrayidx27.us, align 8, !tbaa !5
%cmp28.us = icmp eq i32 %10, %11
%arrayidx30.us = getelementptr inbounds [30 x i32], ptr %b, i64 0, i64 %indvars.iv118
%12 = load i32, ptr %arrayidx30.us, align 8, !tbaa !5
%cmp37.us = icmp eq i32 %10, %12
%spec.select = select i1 %cmp37.us, i32 %11, i32 %10
%13 = select i1 %cmp28.us, i32 %12, i32 %spec.select
%indvars.iv.next119 = or i64 %indvars.iv118, 1
%arrayidx27.us.1 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv.next119
%14 = load i32, ptr %arrayidx27.us.1, align 4, !tbaa !5
%cmp28.us.1 = icmp eq i32 %13, %14
%arrayidx30.us.1 = getelementptr inbounds [30 x i32], ptr %b, i64 0, i64 %indvars.iv.next119
%15 = load i32, ptr %arrayidx30.us.1, align 4, !tbaa !5
%cmp37.us.1 = icmp eq i32 %13, %15
%spec.select.1 = select i1 %cmp37.us.1, i32 %14, i32 %13
%16 = select i1 %cmp28.us.1, i32 %15, i32 %spec.select.1
%indvars.iv.next119.1 = add nuw nsw i64 %indvars.iv118, 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.cond21.for.inc47_crit_edge.us.unr-lcssa, label %for.body23.us, !llvm.loop !14
for.cond21.for.inc47_crit_edge.us.unr-lcssa: ; preds = %for.body23.us, %for.cond21.preheader.us
%.lcssa139.ph = phi i32 [ undef, %for.cond21.preheader.us ], [ %16, %for.body23.us ]
%indvars.iv118.unr = phi i64 [ 0, %for.cond21.preheader.us ], [ %indvars.iv.next119.1, %for.body23.us ]
%.unr = phi i32 [ %arrayidx25.promoted.us, %for.cond21.preheader.us ], [ %16, %for.body23.us ]
br i1 %lcmp.mod.not, label %for.cond21.for.inc47_crit_edge.us, label %for.body23.us.epil
for.body23.us.epil: ; preds = %for.cond21.for.inc47_crit_edge.us.unr-lcssa
%arrayidx27.us.epil = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv118.unr
%17 = load i32, ptr %arrayidx27.us.epil, align 4, !tbaa !5
%cmp28.us.epil = icmp eq i32 %.unr, %17
%arrayidx30.us.epil = getelementptr inbounds [30 x i32], ptr %b, i64 0, i64 %indvars.iv118.unr
%18 = load i32, ptr %arrayidx30.us.epil, align 4, !tbaa !5
%cmp37.us.epil = icmp eq i32 %.unr, %18
%spec.select.epil = select i1 %cmp37.us.epil, i32 %17, i32 %.unr
%19 = select i1 %cmp28.us.epil, i32 %18, i32 %spec.select.epil
br label %for.cond21.for.inc47_crit_edge.us
for.cond21.for.inc47_crit_edge.us: ; preds = %for.cond21.for.inc47_crit_edge.us.unr-lcssa, %for.body23.us.epil
%.lcssa139 = phi i32 [ %.lcssa139.ph, %for.cond21.for.inc47_crit_edge.us.unr-lcssa ], [ %19, %for.body23.us.epil ]
store i32 %.lcssa139, ptr %arrayidx25.us, align 4, !tbaa !5
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
br i1 %exitcond127.not, label %for.cond50.preheader, label %for.cond21.preheader.us, !llvm.loop !15
for.body12: ; preds = %for.body12.preheader140, %for.body12
%indvars.iv115 = phi i64 [ %indvars.iv.next116, %for.body12 ], [ %indvars.iv115.ph, %for.body12.preheader140 ]
%arrayidx14 = getelementptr inbounds [30 x i32], ptr %w, i64 0, i64 %indvars.iv115
%20 = trunc i64 %indvars.iv115 to i32
store i32 %20, ptr %arrayidx14, align 4, !tbaa !5
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%exitcond.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count
br i1 %exitcond.not, label %for.cond18.preheader, label %for.body12, !llvm.loop !16
for.cond50.preheader: ; preds = %for.cond21.for.inc47_crit_edge.us
br i1 %cmp1199, label %for.cond53.preheader.preheader, label %for.end67
for.cond53.preheader.preheader: ; preds = %for.cond21.preheader.lr.ph, %for.cond50.preheader
br label %for.cond53.preheader
for.cond53.preheader: ; preds = %for.cond53.preheader.preheader, %for.inc65
%21 = phi i32 [ %30, %for.inc65 ], [ %1, %for.cond53.preheader.preheader ]
%i.3110 = phi i32 [ %inc66, %for.inc65 ], [ 0, %for.cond53.preheader.preheader ]
%cmp54107 = icmp sgt i32 %21, 0
br i1 %cmp54107, label %for.body55, label %for.inc65
for.body55: ; preds = %for.cond53.preheader, %for.inc62
%22 = phi i32 [ %27, %for.inc62 ], [ %21, %for.cond53.preheader ]
%23 = phi i32 [ %28, %for.inc62 ], [ %21, %for.cond53.preheader ]
%indvars.iv128 = phi i64 [ %25, %for.inc62 ], [ 0, %for.cond53.preheader ]
%arrayidx57 = getelementptr inbounds [30 x i32], ptr %w, i64 0, i64 %indvars.iv128
%24 = load i32, ptr %arrayidx57, align 4, !tbaa !5
%cmp58 = icmp eq i32 %24, %i.3110
%25 = add nuw nsw i64 %indvars.iv128, 1
br i1 %cmp58, label %if.then59, label %for.inc62
if.then59: ; preds = %for.body55
%26 = trunc i64 %25 to i32
%call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc62
for.inc62: ; preds = %for.body55, %if.then59
%27 = phi i32 [ %.pre, %if.then59 ], [ %22, %for.body55 ]
%28 = phi i32 [ %.pre, %if.then59 ], [ %23, %for.body55 ]
%29 = sext i32 %28 to i64
%cmp54 = icmp slt i64 %25, %29
br i1 %cmp54, label %for.body55, label %for.inc65, !llvm.loop !17
for.inc65: ; preds = %for.inc62, %for.cond53.preheader
%30 = phi i32 [ %21, %for.cond53.preheader ], [ %27, %for.inc62 ]
%inc66 = add nuw nsw i32 %i.3110, 1
%cmp51 = icmp slt i32 %inc66, %30
br i1 %cmp51, label %for.cond53.preheader, label %for.end67, !llvm.loop !18
for.end67: ; preds = %for.inc65, %for.cond10.preheader, %for.cond18.preheader, %for.cond50.preheader
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %w) #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, !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}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !12, !11}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
|
#include<stdio.h>
int main() {
int n,a,max=0,min=1000000000;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&a);
if(a>max){
max = a;
}
if(a<min){
min = a;
}
}
printf("%d",max-min-n+1);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18971/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18971/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %0, 0
br i1 %cmp14, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = add nuw i32 %spec.select, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%max.0.lcssa = phi i32 [ 1, %entry ], [ %1, %for.cond.cleanup.loopexit ]
%min.0.lcssa = phi i32 [ 1000000000, %entry ], [ %min.1, %for.cond.cleanup.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %4, %for.cond.cleanup.loopexit ]
%2 = add i32 %min.0.lcssa, %.lcssa
%add = sub i32 %max.0.lcssa, %2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.017 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%min.016 = phi i32 [ %min.1, %for.body ], [ 1000000000, %entry ]
%max.015 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%3 = load i32, ptr %a, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %3, i32 %max.015)
%min.1 = call i32 @llvm.smin.i32(i32 %3, i32 %min.016)
%inc = add nuw nsw i32 %i.017, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
//set many funcs template
//Ver.20180717
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int nHr(int a,int b){return nCr(a+b-1,b);}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
void shuffledget(int x[],int n){
srand(time(0));
int i,b[524288],p,c;
for(i=0;i<n;i++){
b[i]=i;
}
for(i=n;i>=1;i--){
p=rand()%i;
c=b[i-1];b[i-1]=b[p];b[p]=c;
}
for(i=0;i<n;i++){
scanf("%d",&x[b[i]]);
}
}
int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};
int search(int x,int a[],int n){
int st=0,fi=n-1,te;
while(st<=fi){
te=(st+fi)/2;
if(a[te]<x){st=te+1;}else{fi=te-1;}
}
return st;
}
typedef struct{
int val;
int node;
}sd;
int sdsortfnc(const void *a,const void *b){
if(((sd*)a)->val < ((sd*)b)->val){return -1;}
if(((sd*)a)->val > ((sd*)b)->val){return 1;}
return 0;
}
int main(void){
int i,j,n,m,k,a[32768],b,c,h,w,r=0,l,t;
int ra[32768]={0},rb[32768]={0};
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
ra[a[i]]=i;
}
for(i=1;i<=n;i++){
ra[i]+=30000*i;
rb[i]=30000*(n+1-i);
}
for(i=1;i<=n;i++){
if(i!=1){printf(" ");}
printf("%d",ra[i]);
}printf("\n");
for(i=1;i<=n;i++){
if(i!=1){printf(" ");}
printf("%d",rb[i]);
}printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189760/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189760/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16
@dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16
@dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16
@dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i32 %a, %b
%sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true)
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%mul = shl nsw i32 %rem, 1
%cmp.not = icmp sge i32 %mul, %b
%div1 = sdiv i32 %a, %b
%add = zext i1 %cmp.not to i32
%retval.0 = add nsw i32 %div1, %add
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %a, %b
%add = zext i1 %cmp to i32
%retval.0 = add nsw i32 %div, %add
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i32 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i32 %b, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %a, %a.addr.0.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i32 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %a, 1
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i32 %add, %i.07
%mul = mul nsw i32 %r.08, %sub
%div = sdiv i32 %mul, %i.07
%inc = add nuw i32 %i.07, 1
%sub.1 = sub i32 %add, %inc
%mul.1 = mul nsw i32 %div, %sub.1
%div.1 = sdiv i32 %mul.1, %inc
%inc.1 = add nuw i32 %i.07, 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.loopexit.unr-lcssa, label %for.body, !llvm.loop !7
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i32 %add, %i.07.unr
%mul.epil = mul nsw i32 %r.08.unr, %sub.epil
%div.epil = sdiv i32 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %b, %a
%cmp.not6.i = icmp slt i32 %b, 1
br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i32 %add, %i.07.i
%mul.i = mul nsw i32 %sub.i, %r.08.i
%div.i = sdiv i32 %mul.i, %i.07.i
%inc.i = add nuw i32 %i.07.i, 1
%sub.i.1 = sub i32 %add, %inc.i
%mul.i.1 = mul nsw i32 %sub.i.1, %div.i
%div.i.1 = sdiv i32 %mul.i.1, %inc.i
%inc.i.1 = add nuw i32 %i.07.i, 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 %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7
nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i32 %add, %i.07.i.unr
%mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr
br label %nCr.exit
nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i32 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i32 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %a, 8
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %a, -8
%ind.end = or i32 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = mul <4 x i32> %vec.phi, %vec.ind
%1 = mul <4 x i32> %vec.phi7, %step.add
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %a
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ]
%mul = mul nsw i32 %r.06, %i.05
%inc = add nuw i32 %i.05, 1
%exitcond.not = icmp eq i32 %i.05, %a
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i32 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %b, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%0 = mul <4 x i32> %vec.phi, %broadcast.splat
%1 = mul <4 x i32> %vec.phi6, %broadcast.splat
%index.next = add nuw i32 %index, 8
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %b
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%mul = mul nsw i32 %r.05, %a
%inc = add nuw i32 %i.04, 1
%exitcond.not = icmp eq i32 %i.04, %b
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.05, 10
%add = add nsw i32 %r.06, %rem
%div = sdiv i32 %x.addr.05, 10
%x.addr.05.off = add i32 %x.addr.05, 9
%tobool.not = icmp ult i32 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i32 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.06, %b
%add = add nsw i32 %rem, %r.07
%div = sdiv i32 %x.addr.06, %b
%tobool.not = icmp eq i32 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i32 %x, 1
%mul = mul nsw i32 %add, %x
%div = sdiv i32 %mul, 2
ret i32 %div
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i64 %a, %b
%sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true)
ret i64 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%mul = shl nsw i64 %rem, 1
%cmp.not = icmp sge i64 %mul, %b
%div1 = sdiv i64 %a, %b
%add = zext i1 %cmp.not to i64
%retval.0 = add nsw i64 %div1, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %b
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i64 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i64 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i64 %a.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i64 %b, 0
br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i64 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !16
llgcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i64 %a, %a.addr.0.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i64 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %a, 1
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i64 %add, %i.07
%mul = mul nsw i64 %r.08, %sub
%div = sdiv i64 %mul, %i.07
%inc = add nuw i64 %i.07, 1
%sub.1 = sub i64 %add, %inc
%mul.1 = mul nsw i64 %div, %sub.1
%div.1 = sdiv i64 %mul.1, %inc
%inc.1 = add nuw i64 %i.07, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !17
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i64 %add, %i.07.unr
%mul.epil = mul nsw i64 %r.08.unr, %sub.epil
%div.epil = sdiv i64 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i64 %b, %a
%cmp.not6.i = icmp slt i64 %b, 1
br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i64 %add, %i.07.i
%mul.i = mul nsw i64 %sub.i, %r.08.i
%div.i = sdiv i64 %mul.i, %i.07.i
%inc.i = add nuw i64 %i.07.i, 1
%sub.i.1 = sub i64 %add, %inc.i
%mul.i.1 = mul nsw i64 %sub.i.1, %div.i
%div.i.1 = sdiv i64 %mul.i.1, %inc.i
%inc.i.1 = add nuw i64 %i.07.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 %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17
llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i64 %add, %i.07.i.unr
%mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr
br label %llnCr.exit
llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i64 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i64 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 7
%0 = icmp ult i64 %a, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %a, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.06, %i.05
%inc = add nuw nsw i64 %i.05, 1
%mul.1 = mul nsw i64 %mul, %inc
%inc.1 = add nuw nsw i64 %i.05, 2
%mul.2 = mul nsw i64 %mul.1, %inc.1
%inc.2 = add nuw nsw i64 %i.05, 3
%mul.3 = mul nsw i64 %mul.2, %inc.2
%inc.3 = add nuw nsw i64 %i.05, 4
%mul.4 = mul nsw i64 %mul.3, %inc.3
%inc.4 = add nuw nsw i64 %i.05, 5
%mul.5 = mul nsw i64 %mul.4, %inc.4
%inc.5 = add nuw nsw i64 %i.05, 6
%mul.6 = mul nsw i64 %mul.5, %inc.5
%inc.6 = add nuw i64 %i.05, 7
%mul.7 = mul nsw i64 %mul.6, %inc.6
%inc.7 = add nuw i64 %i.05, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ]
%i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.06.epil, %i.05.epil
%inc.epil = add nuw i64 %i.05.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 !19
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i64 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.05, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.05.epil, %a
%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 !22
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.05, 10
%add = add nsw i64 %r.06, %rem
%div = sdiv i64 %x.addr.05, 10
%x.addr.05.off = add i64 %x.addr.05, 9
%tobool.not = icmp ult i64 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i64 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.06, %b
%add = add nsw i64 %rem, %r.07
%div = sdiv i64 %x.addr.06, %b
%tobool.not = icmp eq i64 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i64 %x, 1
%mul = mul nsw i64 %add, %x
%div = sdiv i64 %mul, 2
ret i64 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp.i = fcmp ogt double %a, %b
%a.b.i = select i1 %cmp.i, double %a, double %b
%cmp.i4 = fcmp olt double %a, %b
%a.b.i5 = select i1 %cmp.i4, double %a, double %b
%sub = fsub double %a.b.i, %a.b.i5
ret double %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !25
%1 = load i32, ptr %b, align 4, !tbaa !25
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext 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 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !25
%1 = load i32, ptr %b, align 4, !tbaa !25
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext 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 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext 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 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext 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 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp ogt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext 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 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #15
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #15
ret i32 %call
}
; Function Attrs: nounwind uwtable
define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #7 {
entry:
%b = alloca [524288 x i32], align 16
%call = tail call i64 @time(ptr noundef null) #16
%conv = trunc i64 %call to i32
tail call void @srand(i32 noundef %conv) #16
call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #16
%cmp44 = icmp sgt i32 %n, 0
br i1 %cmp44, label %for.body.preheader, label %for.end29
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader61, 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 ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !25
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !25
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !33
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader61
for.body.preheader61: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond2.preheader: ; preds = %for.body, %middle.block
br i1 %cmp44, label %for.body5.preheader, label %for.end29
for.body5.preheader: ; preds = %for.cond2.preheader
%3 = zext i32 %n to i64
br label %for.body5
for.body: ; preds = %for.body.preheader61, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ]
%arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !25
%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 !34
for.cond18.preheader: ; preds = %for.body5
br i1 %cmp44, label %for.body21.preheader, label %for.end29
for.body21.preheader: ; preds = %for.cond18.preheader
%wide.trip.count58 = zext i32 %n to i64
br label %for.body21
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv51 = phi i64 [ %3, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ]
%call6 = tail call i32 @rand() #16
%5 = trunc i64 %indvars.iv51 to i32
%rem = srem i32 %call6, %5
%indvars.iv.next52 = add nsw i64 %indvars.iv51, -1
%idxprom7 = and i64 %indvars.iv.next52, 4294967295
%arrayidx8 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom7
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !25
%idxprom9 = sext i32 %rem to i64
%arrayidx10 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom9
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !25
store i32 %7, ptr %arrayidx8, align 4, !tbaa !25
store i32 %6, ptr %arrayidx10, align 4, !tbaa !25
%cmp3 = icmp ugt i64 %indvars.iv51, 1
br i1 %cmp3, label %for.body5, label %for.cond18.preheader, !llvm.loop !35
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv54 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next55, %for.body21 ]
%arrayidx23 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv54
%8 = load i32, ptr %arrayidx23, align 4, !tbaa !25
%idxprom24 = sext i32 %8 to i64
%arrayidx25 = getelementptr inbounds i32, ptr %x, i64 %idxprom24
%call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx25)
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond59.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count58
br i1 %exitcond59.not, label %for.end29, label %for.body21, !llvm.loop !36
for.end29: ; preds = %for.body21, %entry, %for.cond2.preheader, %for.cond18.preheader
call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #16
ret void
}
; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #8
; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #8
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #10 {
entry:
%cmp.not9 = icmp slt i32 %n, 1
br i1 %cmp.not9, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ]
%fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ]
%add = add nsw i32 %st.011, %fi.010
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !25
%cmp1 = icmp slt i32 %0, %x
%add2 = add nsw i32 %div, 1
%sub3 = add nsw i32 %div, -1
%fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3
%st.1 = select i1 %cmp1, i32 %add2, i32 %st.011
%cmp.not = icmp sgt i32 %st.1, %fi.1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !37
while.end: ; preds = %while.body, %entry
%st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ]
ret i32 %st.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !38
%1 = load i32, ptr %b, align 4, !tbaa !38
%cmp = icmp slt i32 %0, %1
%cmp4 = icmp sgt i32 %0, %1
%. = zext i1 %cmp4 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #11 {
entry:
%n = alloca i32, align 4
%a = alloca [32768 x i32], align 16
%ra = alloca [32768 x i32], align 16
%rb = alloca [32768 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #16
call void @llvm.lifetime.start.p0(i64 131072, ptr nonnull %a) #16
call void @llvm.lifetime.start.p0(i64 131072, ptr nonnull %ra) #16
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(131072) %ra, i8 0, i64 131072, i1 false)
call void @llvm.lifetime.start.p0(i64 131072, ptr nonnull %rb) #16
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(131072) %rb, i8 0, i64 131072, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !25
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body, label %for.end28
for.cond6.preheader: ; preds = %for.body
%cmp7.not67 = icmp slt i32 %11, 1
br i1 %cmp7.not67, label %for.end28, label %for.body8.lr.ph
for.body8.lr.ph: ; preds = %for.cond6.preheader
%add11 = add nuw i32 %11, 1
%wide.trip.count = zext i32 %add11 to i64
%1 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %11, 4
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body8.lr.ph
%n.vec = and i64 %1, -4
%ind.end = or i64 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add11, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%offset.idx = or i64 %index, 1
%2 = mul nsw <4 x i32> %vec.ind, <i32 30000, i32 30000, i32 30000, i32 30000>
%3 = getelementptr inbounds [32768 x i32], ptr %ra, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !25
%4 = add nsw <4 x i32> %wide.load, %2
store <4 x i32> %4, ptr %3, align 4, !tbaa !25
%5 = sub <4 x i32> %broadcast.splat, %vec.ind
%6 = mul nsw <4 x i32> %5, <i32 30000, i32 30000, i32 30000, i32 30000>
%7 = getelementptr inbounds [32768 x i32], ptr %rb, i64 0, i64 %offset.idx
store <4 x i32> %6, ptr %7, align 4, !tbaa !25
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !40
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %for.cond18.preheader, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block
%indvars.iv75.ph = phi i64 [ 1, %for.body8.lr.ph ], [ %ind.end, %middle.block ]
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [32768 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%9 = load i32, ptr %arrayidx, align 4, !tbaa !25
%idxprom4 = sext i32 %9 to i64
%arrayidx5 = getelementptr inbounds [32768 x i32], ptr %ra, i64 0, i64 %idxprom4
%10 = trunc i64 %indvars.iv to i32
store i32 %10, ptr %arrayidx5, align 4, !tbaa !25
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %n, align 4, !tbaa !25
%12 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !41
for.cond18.preheader: ; preds = %for.body8, %middle.block
br i1 %cmp7.not67, label %for.end28, label %if.end.peel
if.end.peel: ; preds = %for.cond18.preheader
%arrayidx24.peel = getelementptr inbounds [32768 x i32], ptr %ra, i64 0, i64 1
%13 = load i32, ptr %arrayidx24.peel, align 4, !tbaa !25
%call25.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%14 = load i32, ptr %n, align 4, !tbaa !25
%cmp19.not.not.peel = icmp sgt i32 %14, 1
br i1 %cmp19.not.not.peel, label %if.end, label %for.end28
for.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body8 ], [ %indvars.iv75.ph, %for.body8.preheader ]
%15 = trunc i64 %indvars.iv75 to i32
%mul = mul nsw i32 %15, 30000
%arrayidx10 = getelementptr inbounds [32768 x i32], ptr %ra, i64 0, i64 %indvars.iv75
%16 = load i32, ptr %arrayidx10, align 4, !tbaa !25
%add = add nsw i32 %16, %mul
store i32 %add, ptr %arrayidx10, align 4, !tbaa !25
%sub = sub i32 %add11, %15
%mul12 = mul nsw i32 %sub, 30000
%arrayidx14 = getelementptr inbounds [32768 x i32], ptr %rb, i64 0, i64 %indvars.iv75
store i32 %mul12, ptr %arrayidx14, align 4, !tbaa !25
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count
br i1 %exitcond.not, label %for.cond18.preheader, label %for.body8, !llvm.loop !42
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv78 = phi i64 [ %indvars.iv.next79, %if.end ], [ 2, %if.end.peel ]
%putchar64 = call i32 @putchar(i32 32)
%arrayidx24 = getelementptr inbounds [32768 x i32], ptr %ra, i64 0, i64 %indvars.iv78
%17 = load i32, ptr %arrayidx24, align 4, !tbaa !25
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%18 = load i32, ptr %n, align 4, !tbaa !25
%19 = sext i32 %18 to i64
%cmp19.not.not = icmp slt i64 %indvars.iv78, %19
br i1 %cmp19.not.not, label %if.end, label %for.end28, !llvm.loop !43
for.end28: ; preds = %if.end, %entry, %for.cond6.preheader, %if.end.peel, %for.cond18.preheader
%putchar = call i32 @putchar(i32 10)
%20 = load i32, ptr %n, align 4, !tbaa !25
%cmp31.not71 = icmp slt i32 %20, 1
br i1 %cmp31.not71, label %for.end42, label %if.end36.peel
if.end36.peel: ; preds = %for.end28
%arrayidx38.peel = getelementptr inbounds [32768 x i32], ptr %rb, i64 0, i64 1
%21 = load i32, ptr %arrayidx38.peel, align 4, !tbaa !25
%call39.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21)
%22 = load i32, ptr %n, align 4, !tbaa !25
%cmp31.not.not.peel = icmp sgt i32 %22, 1
br i1 %cmp31.not.not.peel, label %if.end36, label %for.end42
if.end36: ; preds = %if.end36.peel, %if.end36
%indvars.iv82 = phi i64 [ %indvars.iv.next83, %if.end36 ], [ 2, %if.end36.peel ]
%putchar63 = call i32 @putchar(i32 32)
%arrayidx38 = getelementptr inbounds [32768 x i32], ptr %rb, i64 0, i64 %indvars.iv82
%23 = load i32, ptr %arrayidx38, align 4, !tbaa !25
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %23)
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%24 = load i32, ptr %n, align 4, !tbaa !25
%25 = sext i32 %24 to i64
%cmp31.not.not = icmp slt i64 %indvars.iv82, %25
br i1 %cmp31.not.not, label %if.end36, label %for.end42, !llvm.loop !45
for.end42: ; preds = %if.end36, %if.end36.peel, %for.end28
%putchar62 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 131072, ptr nonnull %rb) #16
call void @llvm.lifetime.end.p0(i64 131072, ptr nonnull %ra) #16
call void @llvm.lifetime.end.p0(i64 131072, ptr nonnull %a) #16
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #16
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #14
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 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind "no-trapping-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 "no-trapping-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 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 #11 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { nofree nounwind }
attributes #14 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #15 = { nounwind willreturn memory(read) }
attributes #16 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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 = distinct !{!8, !6, !9, !10}
!9 = !{!"llvm.loop.isvectorized", i32 1}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = distinct !{!11, !6, !10, !9}
!12 = distinct !{!12, !6, !9, !10}
!13 = distinct !{!13, !6, !10, !9}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}
!25 = !{!26, !26, i64 0}
!26 = !{!"int", !27, i64 0}
!27 = !{!"omnipotent char", !28, i64 0}
!28 = !{!"Simple C/C++ TBAA"}
!29 = !{!30, !30, i64 0}
!30 = !{!"long long", !27, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"double", !27, i64 0}
!33 = distinct !{!33, !6, !9, !10}
!34 = distinct !{!34, !6, !10, !9}
!35 = distinct !{!35, !6}
!36 = distinct !{!36, !6}
!37 = distinct !{!37, !6}
!38 = !{!39, !26, i64 0}
!39 = !{!"", !26, i64 0, !26, i64 4}
!40 = distinct !{!40, !6, !9, !10}
!41 = distinct !{!41, !6}
!42 = distinct !{!42, !6, !10, !9}
!43 = distinct !{!43, !6, !44}
!44 = !{!"llvm.loop.peeled.count", i32 1}
!45 = distinct !{!45, !6, !44}
|
#include <stdio.h>
long long int pw(long long int x,long long int n,long long int MOD){
long long int res=1;
if(n>0){
res=pw(x,n/2,MOD);
if(n%2==0)res=(res*res)%MOD;
else res=(((res*res)%MOD)*x)%MOD;
}
return res;
}
int main(){
long long int m;
long long int n;
scanf("%lld %lld",&m,&n);
printf("%lld\n", pw(m,n,1000000007));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189803/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189803/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @pw(i64 noundef %x, i64 noundef %n, i64 noundef %MOD) local_unnamed_addr #0 {
entry:
%cmp = icmp sgt i64 %n, 0
br i1 %cmp, label %if.then, label %if.end8
if.then: ; preds = %entry
%div19 = lshr i64 %n, 1
%call = tail call i64 @pw(i64 noundef %x, i64 noundef %div19, i64 noundef %MOD)
%rem = and i64 %n, 1
%cmp1 = icmp eq i64 %rem, 0
%mul = mul nsw i64 %call, %call
%rem3 = srem i64 %mul, %MOD
br i1 %cmp1, label %if.end8, label %if.else
if.else: ; preds = %if.then
%mul6 = mul nsw i64 %rem3, %x
%rem7 = srem i64 %mul6, %MOD
br label %if.end8
if.end8: ; preds = %if.then, %if.else, %entry
%res.0 = phi i64 [ %rem7, %if.else ], [ 1, %entry ], [ %rem3, %if.then ]
ret i64 %res.0
}
; 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:
%m = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%0 = load i64, ptr %m, align 8, !tbaa !5
%1 = load i64, ptr %n, align 8, !tbaa !5
%call1 = call i64 @pw(i64 noundef %0, i64 noundef %1, i64 noundef 1000000007)
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %call1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #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 nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for(i=0;i<n;i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;if(n<r) return 0;rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)(n),(int)(n))
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll modpow(ll a, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1) res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
void initialize(){
}
int main(void){
initialize();
ll n,m,i,j,k,result=0,l,r,tmp=0,sum=0;
int a[LIMIT2]={0};
char s[LIMIT1];
scanf("%lld",&n);
rep(i,n) scanf("%d",&a[i]);
r=0;
rep(l,n){
while(r<n && (tmp^(ll)a[r])==(sum+(ll)a[r])){
tmp^=(ll)a[r];
sum+=(ll)a[r];
r++;
}
//printf("%lld %lld\n",l,r);
result += (r-l);
if(l==r) r++;
else{
tmp ^= (ll)a[l];
sum -= (ll)a[l];
}
}
printf("%lld",result);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189854/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189854/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dx = dso_local local_unnamed_addr global [8 x i32] [i32 1, i32 0, i32 -1, i32 0, i32 1, i32 -1, i32 -1, i32 1], align 16
@dy = dso_local local_unnamed_addr global [8 x i32] [i32 0, i32 1, i32 0, i32 -1, i32 1, i32 1, i32 -1, i32 -1], align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @nPr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #0 {
entry:
%conv = sext i32 %r to i64
%cmp6 = icmp sgt i32 %r, 0
br i1 %cmp6, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%conv2 = sext i32 %n to i64
%xtraiter = and i64 %conv, 7
%0 = icmp ult i32 %r, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %conv, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%result.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul.7, %for.body ]
%i.07 = phi i64 [ 0, %for.body.lr.ph.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.7, %for.body ]
%sub = sub nsw i64 %conv2, %i.07
%mul = mul nsw i64 %result.08, %sub
%inc.neg = xor i64 %i.07, -1
%sub.1 = add i64 %inc.neg, %conv2
%mul.1 = mul nsw i64 %mul, %sub.1
%inc.1 = or i64 %i.07, 2
%sub.2 = sub nsw i64 %conv2, %inc.1
%mul.2 = mul nsw i64 %mul.1, %sub.2
%inc.2 = or i64 %i.07, 3
%sub.3 = sub nsw i64 %conv2, %inc.2
%mul.3 = mul nsw i64 %mul.2, %sub.3
%inc.3 = or i64 %i.07, 4
%sub.4 = sub nsw i64 %conv2, %inc.3
%mul.4 = mul nsw i64 %mul.3, %sub.4
%inc.4 = or i64 %i.07, 5
%sub.5 = sub nsw i64 %conv2, %inc.4
%mul.5 = mul nsw i64 %mul.4, %sub.5
%inc.5 = or i64 %i.07, 6
%sub.6 = sub nsw i64 %conv2, %inc.5
%mul.6 = mul nsw i64 %mul.5, %sub.6
%inc.6 = or i64 %i.07, 7
%sub.7 = sub nsw i64 %conv2, %inc.6
%mul.7 = mul nsw i64 %mul.6, %sub.7
%inc.7 = add nuw nsw i64 %i.07, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !5
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul.7, %for.body ]
%result.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul.7, %for.body ]
%i.07.unr = phi i64 [ 0, %for.body.lr.ph ], [ %inc.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%result.08.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %result.08.unr, %for.end.loopexit.unr-lcssa ]
%i.07.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%sub.epil = sub nsw i64 %conv2, %i.07.epil
%mul.epil = mul nsw i64 %result.08.epil, %sub.epil
%inc.epil = add nuw nsw i64 %i.07.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !7
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %result.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @nCr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #2 {
entry:
%cmp = icmp slt i32 %n, %r
br i1 %cmp, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = sub nsw i32 %n, %r
%cond = tail call i32 @llvm.smin.i32(i32 %sub, i32 %r)
%conv = sext i32 %cond to i64
%cmp320 = icmp sgt i32 %cond, 0
br i1 %cmp320, label %for.body.lr.ph, label %cleanup
for.body.lr.ph: ; preds = %for.cond.preheader
%conv5 = sext i32 %n to i64
%xtraiter = and i64 %conv, 1
%0 = icmp eq i32 %cond, 1
br i1 %0, label %cleanup.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %conv, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%result.022 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.021 = phi i64 [ 0, %for.body.lr.ph.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub6 = sub nsw i64 %conv5, %i.021
%mul = mul nsw i64 %result.022, %sub6
%add = or i64 %i.021, 1
%div = sdiv i64 %mul, %add
%sub6.1 = sub nsw i64 %conv5, %add
%mul.1 = mul nsw i64 %div, %sub6.1
%add.1 = add nuw nsw i64 %i.021, 2
%div.1 = sdiv i64 %mul.1, %add.1
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%result.022.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.021.unr = phi i64 [ 0, %for.body.lr.ph ], [ %add.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %cleanup, label %for.body.epil
for.body.epil: ; preds = %cleanup.loopexit.unr-lcssa
%sub6.epil = sub nsw i64 %conv5, %i.021.unr
%mul.epil = mul nsw i64 %result.022.unr, %sub6.epil
%add.epil = add nuw nsw i64 %i.021.unr, 1
%div.epil = sdiv i64 %mul.epil, %add.epil
br label %cleanup
cleanup: ; preds = %for.body.epil, %cleanup.loopexit.unr-lcssa, %for.cond.preheader, %entry
%retval.0 = phi i64 [ 0, %entry ], [ 1, %for.cond.preheader ], [ %div.lcssa.ph, %cleanup.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !10
%1 = load i32, ptr %b, align 4, !tbaa !10
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !10
%1 = load i32, ptr %b, align 4, !tbaa !10
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upchar(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %left, ptr noundef nonnull dereferenceable(1) %right) #11
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downchar(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %right, ptr noundef nonnull dereferenceable(1) %left) #11
ret i32 %call
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @modpow(i64 noundef %a, i64 noundef %n, i64 noundef %mod) local_unnamed_addr #0 {
entry:
%cmp9 = icmp sgt i64 %n, 0
br i1 %cmp9, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%res.012 = phi i64 [ %res.1, %if.end ], [ 1, %entry ]
%a.addr.011 = phi i64 [ %rem2, %if.end ], [ %a, %entry ]
%n.addr.010 = phi i64 [ %shr, %if.end ], [ %n, %entry ]
%and = and i64 %n.addr.010, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul nsw i64 %res.012, %a.addr.011
%rem = srem i64 %mul, %mod
br label %if.end
if.end: ; preds = %if.then, %while.body
%res.1 = phi i64 [ %rem, %if.then ], [ %res.012, %while.body ]
%mul1 = mul nsw i64 %a.addr.011, %a.addr.011
%rem2 = srem i64 %mul1, %mod
%shr = lshr i64 %n.addr.010, 1
%cmp.not = icmp ult i64 %n.addr.010, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %if.end, %entry
%res.0.lcssa = phi i64 [ 1, %entry ], [ %res.1, %if.end ]
ret i64 %res.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @initialize() local_unnamed_addr #6 {
entry:
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%n = alloca i64, align 8
%a = alloca [500002 x i32], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #12
call void @llvm.lifetime.start.p0(i64 2000008, ptr nonnull %a) #12
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000008) %a, i8 0, i64 2000008, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !15
%cmp52 = icmp sgt i64 %0, 0
br i1 %cmp52, label %for.body, label %for.end30
for.cond2.preheader: ; preds = %for.body
%cmp364 = icmp sgt i64 %1, 0
br i1 %cmp364, label %while.cond.preheader, label %for.end30
for.body: ; preds = %entry, %for.body
%i.053 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [500002 x i32], ptr %a, i64 0, i64 %i.053
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.053, 1
%1 = load i64, ptr %n, align 8, !tbaa !15
%cmp = icmp slt i64 %inc, %1
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !17
while.cond.preheader: ; preds = %for.cond2.preheader, %for.inc28
%sum.069 = phi i64 [ %sum.2, %for.inc28 ], [ 0, %for.cond2.preheader ]
%tmp.068 = phi i64 [ %tmp.2, %for.inc28 ], [ 0, %for.cond2.preheader ]
%r.067 = phi i64 [ %r.2, %for.inc28 ], [ 0, %for.cond2.preheader ]
%l.066 = phi i64 [ %inc29.pre-phi, %for.inc28 ], [ 0, %for.cond2.preheader ]
%result.065 = phi i64 [ %add18, %for.inc28 ], [ 0, %for.cond2.preheader ]
%cmp554 = icmp slt i64 %r.067, %1
br i1 %cmp554, label %land.rhs, label %while.end
land.rhs: ; preds = %while.cond.preheader, %while.body
%sum.157 = phi i64 [ %xor, %while.body ], [ %sum.069, %while.cond.preheader ]
%tmp.156 = phi i64 [ %xor, %while.body ], [ %tmp.068, %while.cond.preheader ]
%r.155 = phi i64 [ %inc17, %while.body ], [ %r.067, %while.cond.preheader ]
%arrayidx6 = getelementptr inbounds [500002 x i32], ptr %a, i64 0, i64 %r.155
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !10
%conv = sext i32 %2 to i64
%xor = xor i64 %tmp.156, %conv
%add = add nsw i64 %sum.157, %conv
%cmp9 = icmp eq i64 %xor, %add
br i1 %cmp9, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%inc17 = add i64 %r.155, 1
%exitcond.not = icmp eq i64 %inc17, %1
br i1 %exitcond.not, label %while.end, label %land.rhs, !llvm.loop !18
while.end: ; preds = %land.rhs, %while.body, %while.cond.preheader
%r.1.lcssa = phi i64 [ %r.067, %while.cond.preheader ], [ %1, %while.body ], [ %r.155, %land.rhs ]
%tmp.1.lcssa = phi i64 [ %tmp.068, %while.cond.preheader ], [ %xor, %while.body ], [ %tmp.156, %land.rhs ]
%sum.1.lcssa = phi i64 [ %sum.069, %while.cond.preheader ], [ %xor, %while.body ], [ %sum.157, %land.rhs ]
%sub = sub i64 %result.065, %l.066
%add18 = add i64 %sub, %r.1.lcssa
%cmp19 = icmp eq i64 %l.066, %r.1.lcssa
br i1 %cmp19, label %if.then, label %if.else
if.then: ; preds = %while.end
%inc21 = add nsw i64 %l.066, 1
br label %for.inc28
if.else: ; preds = %while.end
%arrayidx22 = getelementptr inbounds [500002 x i32], ptr %a, i64 0, i64 %l.066
%3 = load i32, ptr %arrayidx22, align 4, !tbaa !10
%conv23 = sext i32 %3 to i64
%xor24 = xor i64 %tmp.1.lcssa, %conv23
%sub27 = sub nsw i64 %sum.1.lcssa, %conv23
%.pre = add nuw nsw i64 %l.066, 1
br label %for.inc28
for.inc28: ; preds = %if.then, %if.else
%inc29.pre-phi = phi i64 [ %inc21, %if.then ], [ %.pre, %if.else ]
%r.2 = phi i64 [ %inc21, %if.then ], [ %r.1.lcssa, %if.else ]
%tmp.2 = phi i64 [ %tmp.1.lcssa, %if.then ], [ %xor24, %if.else ]
%sum.2 = phi i64 [ %sum.1.lcssa, %if.then ], [ %sub27, %if.else ]
%exitcond72.not = icmp eq i64 %inc29.pre-phi, %1
br i1 %exitcond72.not, label %for.end30, label %while.cond.preheader, !llvm.loop !19
for.end30: ; preds = %for.inc28, %entry, %for.cond2.preheader
%result.0.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %add18, %for.inc28 ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %result.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000008, ptr nonnull %a) #12
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #12
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #10
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.unroll.disable"}
!9 = distinct !{!9, !6}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C/C++ TBAA"}
!14 = distinct !{!14, !6}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !12, i64 0}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6}
|
#include<stdio.h>
int main()
{
int a, b;
scanf( "%d %d", &a, &b );
printf( "%d\n", ( a + b ) / 2 );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189962/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189962/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)/2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190003/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190003/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int A,B;
scanf("%d%d",&A, &B);
printf("%d\n",(A+B)/2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190047/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190047/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int i,j,k,r,a,b,n,m,s[12000],d[100010],M=300010;
char p[300010]={1,1};
for(i=0;i*i<M;i++){
if(p[i])continue;
for(j=i*i;j<M;j+=i)p[j]=1;
}
for(i=r=0;i<M;i++){
if(p[i]==0)d[r++]=i;
}
while(scanf("%d %d",&n,&m),n+1){
for(b=r=0;d[b]<=n;b++);
for(i=0;i<110;i++){
for(j=i;i+j<110;j++){
a=d[b+i]+d[b+j];
for(k=r++;k&&s[k-1]>a;k--)s[k]=s[k-1];
s[k]=a;
}
}
printf("%d\n",s[m-1]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190090/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190090/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%m = alloca i32, align 4
%s = alloca [12000 x i32], align 16
%d = alloca [100010 x i32], align 16
%p = alloca [300010 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 48000, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 300010, ptr nonnull %p) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(300010) %p, i8 0, i64 300010, i1 false)
store i8 1, ptr %p, align 16
%0 = getelementptr inbounds <{ i8, i8, [300008 x i8] }>, ptr %p, i64 0, i32 1
store i8 1, ptr %0, align 1
br label %for.body
for.body: ; preds = %entry, %for.inc7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc7 ]
%mul114 = phi i32 [ 0, %entry ], [ %mul, %for.inc7 ]
%arrayidx = getelementptr inbounds [300010 x i8], ptr %p, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%tobool.not = icmp eq i8 %1, 0
%cmp3110 = icmp ult i32 %mul114, 300010
%or.cond = and i1 %tobool.not, %cmp3110
br i1 %or.cond, label %for.body4.preheader, label %for.inc7
for.body4.preheader: ; preds = %for.body
%2 = zext i32 %mul114 to i64
br label %for.body4
for.body4: ; preds = %for.body4.preheader, %for.body4
%indvars.iv129 = phi i64 [ %2, %for.body4.preheader ], [ %indvars.iv.next130, %for.body4 ]
%arrayidx6 = getelementptr inbounds [300010 x i8], ptr %p, i64 0, i64 %indvars.iv129
store i8 1, ptr %arrayidx6, align 1, !tbaa !5
%indvars.iv.next130 = add i64 %indvars.iv129, %indvars.iv
%cmp3 = icmp ult i64 %indvars.iv.next130, 300010
br i1 %cmp3, label %for.body4, label %for.inc7, !llvm.loop !8
for.inc7: ; preds = %for.body4, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = trunc i64 %indvars.iv.next to i32
%mul = mul nsw i32 %3, %3
%exitcond.not = icmp eq i64 %indvars.iv.next, 548
br i1 %exitcond.not, label %for.body11, label %for.body, !llvm.loop !10
while.cond.preheader: ; preds = %for.inc21.1
%call127 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%4 = load i32, ptr %n, align 4, !tbaa !11
%tobool25.not128 = icmp eq i32 %4, -1
br i1 %tobool25.not128, label %while.end, label %for.cond26.preheader
for.body11: ; preds = %for.inc7, %for.inc21.1
%indvars.iv133 = phi i64 [ %indvars.iv.next134.1, %for.inc21.1 ], [ 0, %for.inc7 ]
%r.0115 = phi i32 [ %r.1.1, %for.inc21.1 ], [ 0, %for.inc7 ]
%arrayidx13 = getelementptr inbounds [300010 x i8], ptr %p, i64 0, i64 %indvars.iv133
%5 = load i8, ptr %arrayidx13, align 2, !tbaa !5
%cmp14 = icmp eq i8 %5, 0
br i1 %cmp14, label %if.then16, label %for.inc21
if.then16: ; preds = %for.body11
%inc17 = add nsw i32 %r.0115, 1
%idxprom18 = sext i32 %r.0115 to i64
%arrayidx19 = getelementptr inbounds [100010 x i32], ptr %d, i64 0, i64 %idxprom18
%6 = trunc i64 %indvars.iv133 to i32
store i32 %6, ptr %arrayidx19, align 4, !tbaa !11
br label %for.inc21
for.inc21: ; preds = %for.body11, %if.then16
%r.1 = phi i32 [ %inc17, %if.then16 ], [ %r.0115, %for.body11 ]
%indvars.iv.next134 = or i64 %indvars.iv133, 1
%arrayidx13.1 = getelementptr inbounds [300010 x i8], ptr %p, i64 0, i64 %indvars.iv.next134
%7 = load i8, ptr %arrayidx13.1, align 1, !tbaa !5
%cmp14.1 = icmp eq i8 %7, 0
br i1 %cmp14.1, label %if.then16.1, label %for.inc21.1
if.then16.1: ; preds = %for.inc21
%inc17.1 = add nsw i32 %r.1, 1
%idxprom18.1 = sext i32 %r.1 to i64
%arrayidx19.1 = getelementptr inbounds [100010 x i32], ptr %d, i64 0, i64 %idxprom18.1
%8 = trunc i64 %indvars.iv.next134 to i32
store i32 %8, ptr %arrayidx19.1, align 4, !tbaa !11
br label %for.inc21.1
for.inc21.1: ; preds = %if.then16.1, %for.inc21
%r.1.1 = phi i32 [ %inc17.1, %if.then16.1 ], [ %r.1, %for.inc21 ]
%indvars.iv.next134.1 = add nuw nsw i64 %indvars.iv133, 2
%exitcond136.not.1 = icmp eq i64 %indvars.iv.next134.1, 300010
br i1 %exitcond136.not.1, label %while.cond.preheader, label %for.body11, !llvm.loop !13
for.cond26.preheader: ; preds = %while.cond.preheader, %for.end73
%9 = phi i32 [ %23, %for.end73 ], [ %4, %while.cond.preheader ]
br label %for.cond26
for.cond26: ; preds = %for.cond26, %for.cond26.preheader
%indvars.iv137 = phi i64 [ %indvars.iv.next138, %for.cond26 ], [ 0, %for.cond26.preheader ]
%arrayidx28 = getelementptr inbounds [100010 x i32], ptr %d, i64 0, i64 %indvars.iv137
%10 = load i32, ptr %arrayidx28, align 4, !tbaa !11
%cmp29.not = icmp sgt i32 %10, %9
%indvars.iv.next138 = add nuw i64 %indvars.iv137, 1
br i1 %cmp29.not, label %for.cond35.preheader, label %for.cond26, !llvm.loop !14
for.cond35.preheader: ; preds = %for.cond26
%11 = and i64 %indvars.iv137, 4294967295
br label %for.cond39.preheader
for.cond39.preheader: ; preds = %for.cond35.preheader, %for.inc71
%indvars.iv145 = phi i64 [ 0, %for.cond35.preheader ], [ %indvars.iv.next146, %for.inc71 ]
%r.2125 = phi i32 [ 0, %for.cond35.preheader ], [ %r.3.lcssa, %for.inc71 ]
%cmp41121 = icmp ult i64 %indvars.iv145, 55
br i1 %cmp41121, label %for.body43.lr.ph, label %for.inc71
for.body43.lr.ph: ; preds = %for.cond39.preheader
%12 = add nuw nsw i64 %indvars.iv145, %11
%arrayidx46 = getelementptr inbounds [100010 x i32], ptr %d, i64 0, i64 %12
%13 = load i32, ptr %arrayidx46, align 4, !tbaa !11
%14 = sext i32 %r.2125 to i64
br label %for.body43
for.body43: ; preds = %for.body43.lr.ph, %for.end65
%indvars.iv147 = phi i64 [ %indvars.iv145, %for.body43.lr.ph ], [ %indvars.iv.next148, %for.end65 ]
%indvars.iv140 = phi i64 [ %14, %for.body43.lr.ph ], [ %indvars.iv.next141, %for.end65 ]
%15 = add nuw nsw i64 %indvars.iv147, %11
%arrayidx49 = getelementptr inbounds [100010 x i32], ptr %d, i64 0, i64 %15
%16 = load i32, ptr %arrayidx49, align 4, !tbaa !11
%add50 = add nsw i32 %16, %13
%indvars.iv.next141 = add nsw i64 %indvars.iv140, 1
%17 = and i64 %indvars.iv140, 4294967295
%tobool53.not117 = icmp eq i64 %17, 0
br i1 %tobool53.not117, label %for.end65, label %land.rhs
land.rhs: ; preds = %for.body43, %for.body58
%indvars.iv142 = phi i64 [ %indvars.iv.next143, %for.body58 ], [ %indvars.iv140, %for.body43 ]
%indvars.iv.next143 = add nsw i64 %indvars.iv142, -1
%arrayidx55 = getelementptr inbounds [12000 x i32], ptr %s, i64 0, i64 %indvars.iv.next143
%18 = load i32, ptr %arrayidx55, align 4, !tbaa !11
%cmp56 = icmp sgt i32 %18, %add50
br i1 %cmp56, label %for.body58, label %for.end65
for.body58: ; preds = %land.rhs
%arrayidx63 = getelementptr inbounds [12000 x i32], ptr %s, i64 0, i64 %indvars.iv142
store i32 %18, ptr %arrayidx63, align 4, !tbaa !11
%19 = and i64 %indvars.iv.next143, 4294967295
%tobool53.not = icmp eq i64 %19, 0
br i1 %tobool53.not, label %for.end65, label %land.rhs, !llvm.loop !15
for.end65: ; preds = %land.rhs, %for.body58, %for.body43
%k.0.lcssa = phi i64 [ 0, %for.body43 ], [ 0, %for.body58 ], [ %indvars.iv142, %land.rhs ]
%sext = shl i64 %k.0.lcssa, 32
%idxprom66 = ashr exact i64 %sext, 32
%arrayidx67 = getelementptr inbounds [12000 x i32], ptr %s, i64 0, i64 %idxprom66
store i32 %add50, ptr %arrayidx67, align 4, !tbaa !11
%indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
%20 = add nuw nsw i64 %indvars.iv.next148, %indvars.iv145
%cmp41 = icmp ult i64 %20, 110
br i1 %cmp41, label %for.body43, label %for.inc71.loopexit, !llvm.loop !16
for.inc71.loopexit: ; preds = %for.end65
%indvars152.le = trunc i64 %indvars.iv.next141 to i32
br label %for.inc71
for.inc71: ; preds = %for.inc71.loopexit, %for.cond39.preheader
%r.3.lcssa = phi i32 [ %r.2125, %for.cond39.preheader ], [ %indvars152.le, %for.inc71.loopexit ]
%indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
%exitcond156.not = icmp eq i64 %indvars.iv.next146, 110
br i1 %exitcond156.not, label %for.end73, label %for.cond39.preheader, !llvm.loop !17
for.end73: ; preds = %for.inc71
%21 = load i32, ptr %m, align 4, !tbaa !11
%sub74 = add nsw i32 %21, -1
%idxprom75 = sext i32 %sub74 to i64
%arrayidx76 = getelementptr inbounds [12000 x i32], ptr %s, i64 0, i64 %idxprom75
%22 = load i32, ptr %arrayidx76, align 4, !tbaa !11
%call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %22)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%23 = load i32, ptr %n, align 4, !tbaa !11
%tobool25.not = icmp eq i32 %23, -1
br i1 %tobool25.not, label %while.end, label %for.cond26.preheader, !llvm.loop !18
while.end: ; preds = %for.end73, %while.cond.preheader
call void @llvm.lifetime.end.p0(i64 300010, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 48000, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
!15 = distinct !{!15, !9}
!16 = distinct !{!16, !9}
!17 = distinct !{!17, !9}
!18 = distinct !{!18, !9}
|
// AOJ DSL_2_G RSQ and RAQ
// 2018.5.18 bal4u
#include <stdio.h>
#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in()
{
int n = 0, c = gc();
do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
return n;
}
void out(long long n)
{
int i;
char ob[40];
if (!n) pc('0');
else {
i = 0; while (n) ob[i++] = n%10 + '0', n/=10;
while (i--) pc(ob[i]);
}
pc('\n');
}
#define MAX_N 100005
int s, t, x;
long long ans;
typedef struct { int l, r; long long w; int f; } NODE;
NODE node[1<<19];
void segTree(int k, int l, int r)
{
int m;
node[k].l = l, node[k].r = r;
if (node[k].l == node[k].r) return;
m = (l + r) >> 1;
segTree( k << 1, l, m);
segTree((k << 1) | 1, m+1, r);
}
void down(int k)
{
node[ k << 1 ].f += node[k].f;
node[(k << 1) | 1].f += node[k].f;
node[ k << 1 ].w += (long long)node[k].f * (node[ k << 1 ].r - node[ k << 1 ].l + 1);
node[(k << 1) | 1].w += (long long)node[k].f * (node[(k << 1) | 1].r - node[(k << 1) | 1].l + 1);
node[k].f = 0;
}
void ask_point(int k)
{
int m;
if (node[k].l == node[k].r) {
ans = node[k].w;
return;
}
if (node[k].f) down(k);
m = (node[k].l + node[k].r) >> 1;
if (s <= m) ask_point(k << 1);
else ask_point((k << 1) | 1);
}
void change_point(int k)
{
int m;
if (node[k].l == node[k].r) {
node[k].w += x;
return;
}
if (node[k].f) down(k);
m = (node[k].l + node[k].r) >> 1;
if (s <= m) change_point(k << 1);
else change_point((k << 1) | 1);
node[k].w = node[k << 1].w + node[(k << 1) | 1].w;
}
void ask_interval(int k)
{
int m;
if (node[k].l >= s && node[k].r <= t) {
ans += node[k].w;
return;
}
if (node[k].f) down(k);
m = (node[k].l + node[k].r) >> 1;
if (s <= m) ask_interval(k << 1);
if (m < t) ask_interval((k << 1) | 1);
}
void change_interval(int k)
{
int m;
if (node[k].l >= s && node[k].r <= t) {
node[k].w += (node[k].r - node[k].l + 1) * x;
node[k].f += x;
return;
}
if (node[k].f) down(k);
m = (node[k].l + node[k].r) >> 1;
if (s <= m) change_interval(k << 1);
if (m < t) change_interval((k << 1) | 1);
node[k].w = node[k << 1].w + node[(k << 1) | 1].w;
}
int main()
{
int n, q, op;
n = in();
segTree(1, 1, n);
q = in();
while (q--) {
op = gc() & 1, gc();
if (op) {
ans = 0;
s = in(), t = in();
if (s == t) ask_point(1);
else ask_interval(1);
out(ans);
} else {
s = in(), t = in(), x = in();
if (s == t) change_point(1);
else change_interval(1);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190133/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190133/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.NODE = type { i32, i32, i64, 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] }
@node = dso_local local_unnamed_addr global [524288 x %struct.NODE] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global i64 0, align 8
@s = dso_local local_unnamed_addr global i32 0, align 4
@x = dso_local local_unnamed_addr global i32 0, align 4
@t = dso_local local_unnamed_addr global i32 0, align 4
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #7
%.pre14.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %do.body.preheader
do.body.preheader: ; preds = %cond.true.i, %cond.false.i
%.ph = phi ptr [ %0, %cond.false.i ], [ %.pre14.pre, %cond.true.i ]
%c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %do.body
do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit13
%4 = phi ptr [ %8, %getchar_unlocked.exit13 ], [ %.ph, %do.body.preheader ]
%n.0 = phi i32 [ %add, %getchar_unlocked.exit13 ], [ 0, %do.body.preheader ]
%c.0 = phi i32 [ %cond.i9, %getchar_unlocked.exit13 ], [ %c.0.ph, %do.body.preheader ]
%mul = mul nsw i32 %n.0, 10
%and = and i32 %c.0, 15
%add = add nsw i32 %and, %mul
%_IO_read_ptr.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4, align 8, !tbaa !9
%_IO_read_end.i5 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5, align 8, !tbaa !14
%cmp.not.i6 = icmp ult ptr %5, %6
br i1 %cmp.not.i6, label %cond.false.i10, label %cond.true.i7, !prof !15
cond.true.i7: ; preds = %do.body
%call.i8 = tail call i32 @__uflow(ptr noundef nonnull %4) #7
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13
cond.false.i10: ; preds = %do.body
%incdec.ptr.i11 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11, ptr %_IO_read_ptr.i4, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i12 = zext i8 %7 to i32
br label %getchar_unlocked.exit13
getchar_unlocked.exit13: ; preds = %cond.true.i7, %cond.false.i10
%8 = phi ptr [ %.pre, %cond.true.i7 ], [ %4, %cond.false.i10 ]
%cond.i9 = phi i32 [ %call.i8, %cond.true.i7 ], [ %conv3.i12, %cond.false.i10 ]
%cmp = icmp sgt i32 %cond.i9, 47
br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17
do.end: ; preds = %getchar_unlocked.exit13
ret i32 %add
}
; 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: nounwind uwtable
define dso_local void @out(i64 noundef %n) local_unnamed_addr #0 {
entry:
%ob = alloca [40 x i8], align 16
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %ob) #7
%tobool.not = icmp eq i64 %n, 0
br i1 %tobool.not, label %if.then, label %while.body
if.then: ; preds = %entry
%0 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 5
%1 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !19
%_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 6
%2 = load ptr, ptr %_IO_write_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 !15
cond.true.i: ; preds = %if.then
%call.i = tail call i32 @__overflow(ptr noundef nonnull %0, i32 noundef 48) #7
br label %if.end
cond.false.i: ; preds = %if.then
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !19
store i8 48, ptr %1, align 1, !tbaa !16
br label %if.end
while.body: ; preds = %entry, %while.body
%indvars.iv38 = phi i32 [ %indvars.iv.next39, %while.body ], [ 1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%n.addr.034 = phi i64 [ %div, %while.body ], [ %n, %entry ]
%rem = srem i64 %n.addr.034, 10
%3 = trunc i64 %rem to i8
%conv = add nsw i8 %3, 48
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [40 x i8], ptr %ob, i64 0, i64 %indvars.iv
store i8 %conv, ptr %arrayidx, align 1, !tbaa !16
%div = sdiv i64 %n.addr.034, 10
%n.addr.034.off = add i64 %n.addr.034, 9
%tobool1.not = icmp ult i64 %n.addr.034.off, 19
%indvars.iv.next39 = add nuw i32 %indvars.iv38, 1
br i1 %tobool1.not, label %while.body4.preheader, label %while.body, !llvm.loop !21
while.body4.preheader: ; preds = %while.body
%4 = sext i32 %indvars.iv38 to i64
br label %while.body4
while.body4: ; preds = %while.body4.preheader, %putchar_unlocked.exit24
%indvars.iv40 = phi i64 [ %4, %while.body4.preheader ], [ %indvars.iv.next41, %putchar_unlocked.exit24 ]
%indvars.iv.next41 = add nsw i64 %indvars.iv40, -1
%arrayidx6 = getelementptr inbounds [40 x i8], ptr %ob, i64 0, i64 %indvars.iv.next41
%5 = load i8, ptr %arrayidx6, align 1, !tbaa !16
%6 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i16 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 5
%7 = load ptr, ptr %_IO_write_ptr.i16, align 8, !tbaa !19
%_IO_write_end.i17 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 6
%8 = load ptr, ptr %_IO_write_end.i17, align 8, !tbaa !20
%cmp.not.i18 = icmp ult ptr %7, %8
br i1 %cmp.not.i18, label %cond.false.i22, label %cond.true.i19, !prof !15
cond.true.i19: ; preds = %while.body4
%conv7 = zext i8 %5 to i32
%call.i20 = tail call i32 @__overflow(ptr noundef nonnull %6, i32 noundef %conv7) #7
br label %putchar_unlocked.exit24
cond.false.i22: ; preds = %while.body4
%incdec.ptr.i23 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i23, ptr %_IO_write_ptr.i16, align 8, !tbaa !19
store i8 %5, ptr %7, align 1, !tbaa !16
br label %putchar_unlocked.exit24
putchar_unlocked.exit24: ; preds = %cond.true.i19, %cond.false.i22
%9 = and i64 %indvars.iv.next41, 4294967295
%tobool3.not = icmp eq i64 %9, 0
br i1 %tobool3.not, label %if.end, label %while.body4, !llvm.loop !22
if.end: ; preds = %putchar_unlocked.exit24, %cond.false.i, %cond.true.i
%10 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i25 = getelementptr inbounds %struct._IO_FILE, ptr %10, i64 0, i32 5
%11 = load ptr, ptr %_IO_write_ptr.i25, align 8, !tbaa !19
%_IO_write_end.i26 = getelementptr inbounds %struct._IO_FILE, ptr %10, i64 0, i32 6
%12 = load ptr, ptr %_IO_write_end.i26, align 8, !tbaa !20
%cmp.not.i27 = icmp ult ptr %11, %12
br i1 %cmp.not.i27, label %cond.false.i31, label %cond.true.i28, !prof !15
cond.true.i28: ; preds = %if.end
%call.i29 = tail call i32 @__overflow(ptr noundef nonnull %10, i32 noundef 10) #7
br label %putchar_unlocked.exit33
cond.false.i31: ; preds = %if.end
%incdec.ptr.i32 = getelementptr inbounds i8, ptr %11, i64 1
store ptr %incdec.ptr.i32, ptr %_IO_write_ptr.i25, align 8, !tbaa !19
store i8 10, ptr %11, align 1, !tbaa !16
br label %putchar_unlocked.exit33
putchar_unlocked.exit33: ; preds = %cond.true.i28, %cond.false.i31
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %ob) #7
ret void
}
; Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @segTree(i32 noundef %k, i32 noundef %l, i32 noundef %r) local_unnamed_addr #2 {
entry:
%idxprom23 = sext i32 %k to i64
%arrayidx24 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom23
store i32 %l, ptr %arrayidx24, align 8, !tbaa !23
%r425 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom23, i32 1
store i32 %r, ptr %r425, align 4, !tbaa !26
%cmp26 = icmp eq i32 %l, %r
br i1 %cmp26, label %cleanup, label %if.end
if.end: ; preds = %entry, %if.end
%l.tr28 = phi i32 [ %add12, %if.end ], [ %l, %entry ]
%k.tr27 = phi i32 [ %or, %if.end ], [ %k, %entry ]
%add = add nsw i32 %l.tr28, %r
%shr = ashr i32 %add, 1
%shl = shl i32 %k.tr27, 1
tail call void @segTree(i32 noundef %shl, i32 noundef %l.tr28, i32 noundef %shr)
%or = or i32 %shl, 1
%add12 = add nsw i32 %shr, 1
%idxprom = sext i32 %or to i64
%arrayidx = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom
store i32 %add12, ptr %arrayidx, align 8, !tbaa !23
%r4 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 1
store i32 %r, ptr %r4, align 4, !tbaa !26
%cmp = icmp eq i32 %add12, %r
br i1 %cmp, label %cleanup, label %if.end
cleanup: ; preds = %if.end, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @down(i32 noundef %k) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %k to i64
%f = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 3
%0 = load i32, ptr %f, align 8, !tbaa !27
%shl = shl i32 %k, 1
%idxprom1 = sext i32 %shl to i64
%arrayidx2 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1
%f3 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1, i32 3
%1 = load i32, ptr %f3, align 16, !tbaa !27
%add = add nsw i32 %1, %0
store i32 %add, ptr %f3, align 16, !tbaa !27
%2 = load i32, ptr %f, align 8, !tbaa !27
%or = or i32 %shl, 1
%idxprom8 = sext i32 %or to i64
%arrayidx9 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8
%f10 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8, i32 3
%3 = load i32, ptr %f10, align 8, !tbaa !27
%add11 = add nsw i32 %3, %2
store i32 %add11, ptr %f10, align 8, !tbaa !27
%4 = load i32, ptr %f, align 8, !tbaa !27
%conv = sext i32 %4 to i64
%r = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1, i32 1
%5 = load i32, ptr %r, align 4, !tbaa !26
%6 = load i32, ptr %arrayidx2, align 16, !tbaa !23
%sub = add i32 %5, 1
%add21 = sub i32 %sub, %6
%conv22 = sext i32 %add21 to i64
%mul = mul nsw i64 %conv22, %conv
%w = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1, i32 2
%7 = load i64, ptr %w, align 8, !tbaa !28
%add26 = add nsw i64 %mul, %7
store i64 %add26, ptr %w, align 8, !tbaa !28
%r35 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8, i32 1
%8 = load i32, ptr %r35, align 4, !tbaa !26
%9 = load i32, ptr %arrayidx9, align 8, !tbaa !23
%sub41 = add i32 %8, 1
%add42 = sub i32 %sub41, %9
%conv43 = sext i32 %add42 to i64
%mul44 = mul nsw i64 %conv43, %conv
%w49 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8, i32 2
%10 = load i64, ptr %w49, align 16, !tbaa !28
%add50 = add nsw i64 %mul44, %10
store i64 %add50, ptr %w49, align 16, !tbaa !28
store i32 0, ptr %f, align 8, !tbaa !27
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @ask_point(i32 noundef %k) local_unnamed_addr #4 {
entry:
%idxprom28 = sext i32 %k to i64
%arrayidx29 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom28
%0 = load i32, ptr %arrayidx29, align 8, !tbaa !23
%r30 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom28, i32 1
%1 = load i32, ptr %r30, align 4, !tbaa !26
%cmp31 = icmp eq i32 %0, %1
br i1 %cmp31, label %if.then, label %if.end.lr.ph
if.end.lr.ph: ; preds = %entry
%2 = load i32, ptr @s, align 4, !tbaa !29
br label %if.end
if.then: ; preds = %if.end8, %entry
%idxprom.lcssa = phi i64 [ %idxprom28, %entry ], [ %idxprom, %if.end8 ]
%w = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom.lcssa, i32 2
%3 = load i64, ptr %w, align 8, !tbaa !28
store i64 %3, ptr @ans, align 8, !tbaa !30
ret void
if.end: ; preds = %if.end.lr.ph, %if.end8
%4 = phi i32 [ %1, %if.end.lr.ph ], [ %18, %if.end8 ]
%5 = phi i32 [ %0, %if.end.lr.ph ], [ %17, %if.end8 ]
%idxprom33 = phi i64 [ %idxprom28, %if.end.lr.ph ], [ %idxprom, %if.end8 ]
%k.tr32 = phi i32 [ %k, %if.end.lr.ph ], [ %k.tr.be, %if.end8 ]
%f = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom33, i32 3
%6 = load i32, ptr %f, align 8, !tbaa !27
%tobool.not = icmp eq i32 %6, 0
%.pre = shl i32 %k.tr32, 1
br i1 %tobool.not, label %if.end.if.end8_crit_edge, label %if.then7
if.end.if.end8_crit_edge: ; preds = %if.end
%.pre35 = or i32 %.pre, 1
br label %if.end8
if.then7: ; preds = %if.end
%idxprom1.i = sext i32 %.pre to i64
%arrayidx2.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i
%f3.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 3
%7 = load i32, ptr %f3.i, align 16, !tbaa !27
%add.i = add nsw i32 %7, %6
store i32 %add.i, ptr %f3.i, align 16, !tbaa !27
%8 = load i32, ptr %f, align 8, !tbaa !27
%or.i = or i32 %.pre, 1
%idxprom8.i = sext i32 %or.i to i64
%arrayidx9.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i
%f10.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 3
%9 = load i32, ptr %f10.i, align 8, !tbaa !27
%add11.i = add nsw i32 %9, %8
store i32 %add11.i, ptr %f10.i, align 8, !tbaa !27
%10 = load i32, ptr %f, align 8, !tbaa !27
%conv.i = sext i32 %10 to i64
%r.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 1
%11 = load i32, ptr %r.i, align 4, !tbaa !26
%12 = load i32, ptr %arrayidx2.i, align 16, !tbaa !23
%sub.i = add i32 %11, 1
%add21.i = sub i32 %sub.i, %12
%conv22.i = sext i32 %add21.i to i64
%mul.i = mul nsw i64 %conv22.i, %conv.i
%w.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 2
%13 = load i64, ptr %w.i, align 8, !tbaa !28
%add26.i = add nsw i64 %mul.i, %13
store i64 %add26.i, ptr %w.i, align 8, !tbaa !28
%r35.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 1
%14 = load i32, ptr %r35.i, align 4, !tbaa !26
%15 = load i32, ptr %arrayidx9.i, align 8, !tbaa !23
%sub41.i = add i32 %14, 1
%add42.i = sub i32 %sub41.i, %15
%conv43.i = sext i32 %add42.i to i64
%mul44.i = mul nsw i64 %conv43.i, %conv.i
%w49.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 2
%16 = load i64, ptr %w49.i, align 16, !tbaa !28
%add50.i = add nsw i64 %mul44.i, %16
store i64 %add50.i, ptr %w49.i, align 16, !tbaa !28
store i32 0, ptr %f, align 8, !tbaa !27
br label %if.end8
if.end8: ; preds = %if.end.if.end8_crit_edge, %if.then7
%or.pre-phi = phi i32 [ %.pre35, %if.end.if.end8_crit_edge ], [ %or.i, %if.then7 ]
%add = add nsw i32 %4, %5
%shr = ashr i32 %add, 1
%cmp15.not = icmp sgt i32 %2, %shr
%k.tr.be = select i1 %cmp15.not, i32 %or.pre-phi, i32 %.pre
%idxprom = sext i32 %k.tr.be to i64
%arrayidx = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom
%17 = load i32, ptr %arrayidx, align 8, !tbaa !23
%r = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 1
%18 = load i32, ptr %r, align 4, !tbaa !26
%cmp = icmp eq i32 %17, %18
br i1 %cmp, label %if.then, label %if.end
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @change_point(i32 noundef %k) local_unnamed_addr #5 {
entry:
%idxprom = sext i32 %k to i64
%arrayidx = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 8, !tbaa !23
%r = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 1
%1 = load i32, ptr %r, align 4, !tbaa !26
%cmp = icmp eq i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%2 = load i32, ptr @x, align 4, !tbaa !29
%conv = sext i32 %2 to i64
%w = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 2
%3 = load i64, ptr %w, align 8, !tbaa !28
%add = add nsw i64 %3, %conv
store i64 %add, ptr %w, align 8, !tbaa !28
br label %cleanup
if.end: ; preds = %entry
%f = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 3
%4 = load i32, ptr %f, align 8, !tbaa !27
%tobool.not = icmp eq i32 %4, 0
br i1 %tobool.not, label %if.end8, label %if.then7
if.then7: ; preds = %if.end
%shl.i = shl i32 %k, 1
%idxprom1.i = sext i32 %shl.i to i64
%arrayidx2.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i
%f3.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 3
%5 = load i32, ptr %f3.i, align 16, !tbaa !27
%add.i = add nsw i32 %5, %4
store i32 %add.i, ptr %f3.i, align 16, !tbaa !27
%6 = load i32, ptr %f, align 8, !tbaa !27
%or.i = or i32 %shl.i, 1
%idxprom8.i = sext i32 %or.i to i64
%arrayidx9.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i
%f10.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 3
%7 = load i32, ptr %f10.i, align 8, !tbaa !27
%add11.i = add nsw i32 %7, %6
store i32 %add11.i, ptr %f10.i, align 8, !tbaa !27
%8 = load i32, ptr %f, align 8, !tbaa !27
%conv.i = sext i32 %8 to i64
%r.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 1
%9 = load i32, ptr %r.i, align 4, !tbaa !26
%10 = load i32, ptr %arrayidx2.i, align 16, !tbaa !23
%sub.i = add i32 %9, 1
%add21.i = sub i32 %sub.i, %10
%conv22.i = sext i32 %add21.i to i64
%mul.i = mul nsw i64 %conv22.i, %conv.i
%w.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 2
%11 = load i64, ptr %w.i, align 8, !tbaa !28
%add26.i = add nsw i64 %mul.i, %11
store i64 %add26.i, ptr %w.i, align 8, !tbaa !28
%r35.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 1
%12 = load i32, ptr %r35.i, align 4, !tbaa !26
%13 = load i32, ptr %arrayidx9.i, align 8, !tbaa !23
%sub41.i = add i32 %12, 1
%add42.i = sub i32 %sub41.i, %13
%conv43.i = sext i32 %add42.i to i64
%mul44.i = mul nsw i64 %conv43.i, %conv.i
%w49.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 2
%14 = load i64, ptr %w49.i, align 16, !tbaa !28
%add50.i = add nsw i64 %mul44.i, %14
store i64 %add50.i, ptr %w49.i, align 16, !tbaa !28
store i32 0, ptr %f, align 8, !tbaa !27
br label %if.end8
if.end8: ; preds = %if.then7, %if.end
%add15 = add nsw i32 %1, %0
%shr = ashr i32 %add15, 1
%15 = load i32, ptr @s, align 4, !tbaa !29
%cmp16.not = icmp sgt i32 %15, %shr
%shl19 = shl i32 %k, 1
br i1 %cmp16.not, label %if.else, label %if.then18
if.then18: ; preds = %if.end8
tail call void @change_point(i32 noundef %shl19)
%.pre = or i32 %shl19, 1
br label %if.end20
if.else: ; preds = %if.end8
%or = or i32 %shl19, 1
tail call void @change_point(i32 noundef %or)
br label %if.end20
if.end20: ; preds = %if.else, %if.then18
%or26.pre-phi = phi i32 [ %or, %if.else ], [ %.pre, %if.then18 ]
%idxprom22 = sext i32 %shl19 to i64
%w24 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom22, i32 2
%16 = load i64, ptr %w24, align 8, !tbaa !28
%idxprom27 = sext i32 %or26.pre-phi to i64
%w29 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom27, i32 2
%17 = load i64, ptr %w29, align 16, !tbaa !28
%add30 = add nsw i64 %17, %16
%w33 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 2
store i64 %add30, ptr %w33, align 8, !tbaa !28
br label %cleanup
cleanup: ; preds = %if.end20, %if.then
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @ask_interval(i32 noundef %k) local_unnamed_addr #5 {
entry:
%.pre36 = load i32, ptr @s, align 4, !tbaa !29
br label %tailrecurse
tailrecurse: ; preds = %if.then21, %entry
%0 = phi i32 [ %.pre36, %entry ], [ %18, %if.then21 ]
%k.tr = phi i32 [ %k, %entry ], [ %or, %if.then21 ]
%idxprom = sext i32 %k.tr to i64
%arrayidx = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 8, !tbaa !23
%cmp.not = icmp slt i32 %1, %0
br i1 %cmp.not, label %if.end, label %land.lhs.true
land.lhs.true: ; preds = %tailrecurse
%r = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 1
%2 = load i32, ptr %r, align 4, !tbaa !26
%3 = load i32, ptr @t, align 4, !tbaa !29
%cmp3.not = icmp sgt i32 %2, %3
br i1 %cmp3.not, label %if.end, label %if.then
if.then: ; preds = %land.lhs.true
%w = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 2
%4 = load i64, ptr %w, align 8, !tbaa !28
%5 = load i64, ptr @ans, align 8, !tbaa !30
%add = add nsw i64 %5, %4
store i64 %add, ptr @ans, align 8, !tbaa !30
br label %cleanup
if.end: ; preds = %land.lhs.true, %tailrecurse
%f = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 3
%6 = load i32, ptr %f, align 8, !tbaa !27
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %if.end9, label %if.then8
if.then8: ; preds = %if.end
%shl.i = shl i32 %k.tr, 1
%idxprom1.i = sext i32 %shl.i to i64
%arrayidx2.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i
%f3.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 3
%7 = load i32, ptr %f3.i, align 16, !tbaa !27
%add.i = add nsw i32 %7, %6
store i32 %add.i, ptr %f3.i, align 16, !tbaa !27
%8 = load i32, ptr %f, align 8, !tbaa !27
%or.i = or i32 %shl.i, 1
%idxprom8.i = sext i32 %or.i to i64
%arrayidx9.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i
%f10.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 3
%9 = load i32, ptr %f10.i, align 8, !tbaa !27
%add11.i = add nsw i32 %9, %8
store i32 %add11.i, ptr %f10.i, align 8, !tbaa !27
%10 = load i32, ptr %f, align 8, !tbaa !27
%conv.i = sext i32 %10 to i64
%r.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 1
%11 = load i32, ptr %r.i, align 4, !tbaa !26
%12 = load i32, ptr %arrayidx2.i, align 16, !tbaa !23
%sub.i = add i32 %11, 1
%add21.i = sub i32 %sub.i, %12
%conv22.i = sext i32 %add21.i to i64
%mul.i = mul nsw i64 %conv22.i, %conv.i
%w.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 2
%13 = load i64, ptr %w.i, align 8, !tbaa !28
%add26.i = add nsw i64 %mul.i, %13
store i64 %add26.i, ptr %w.i, align 8, !tbaa !28
%r35.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 1
%14 = load i32, ptr %r35.i, align 4, !tbaa !26
%15 = load i32, ptr %arrayidx9.i, align 8, !tbaa !23
%sub41.i = add i32 %14, 1
%add42.i = sub i32 %sub41.i, %15
%conv43.i = sext i32 %add42.i to i64
%mul44.i = mul nsw i64 %conv43.i, %conv.i
%w49.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 2
%16 = load i64, ptr %w49.i, align 16, !tbaa !28
%add50.i = add nsw i64 %mul44.i, %16
store i64 %add50.i, ptr %w49.i, align 16, !tbaa !28
store i32 0, ptr %f, align 8, !tbaa !27
br label %if.end9
if.end9: ; preds = %if.then8, %if.end
%r15 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 1
%17 = load i32, ptr %r15, align 4, !tbaa !26
%add16 = add nsw i32 %17, %1
%shr = ashr i32 %add16, 1
%cmp17.not = icmp sgt i32 %0, %shr
br i1 %cmp17.not, label %if.end19, label %if.then18
if.then18: ; preds = %if.end9
%shl = shl i32 %k.tr, 1
tail call void @ask_interval(i32 noundef %shl)
%.pre = load i32, ptr @s, align 4, !tbaa !29
br label %if.end19
if.end19: ; preds = %if.then18, %if.end9
%18 = phi i32 [ %.pre, %if.then18 ], [ %0, %if.end9 ]
%19 = load i32, ptr @t, align 4, !tbaa !29
%cmp20 = icmp slt i32 %shr, %19
br i1 %cmp20, label %if.then21, label %cleanup
if.then21: ; preds = %if.end19
%shl22 = shl i32 %k.tr, 1
%or = or i32 %shl22, 1
br label %tailrecurse
cleanup: ; preds = %if.end19, %if.then
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @change_interval(i32 noundef %k) local_unnamed_addr #5 {
entry:
%idxprom = sext i32 %k to i64
%arrayidx = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 8, !tbaa !23
%1 = load i32, ptr @s, align 4, !tbaa !29
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.end, label %land.lhs.true
land.lhs.true: ; preds = %entry
%r = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 1
%2 = load i32, ptr %r, align 4, !tbaa !26
%3 = load i32, ptr @t, align 4, !tbaa !29
%cmp3.not = icmp sgt i32 %2, %3
br i1 %cmp3.not, label %if.end, label %if.then
if.then: ; preds = %land.lhs.true
%reass.sub = sub i32 %2, %0
%add = add i32 %reass.sub, 1
%4 = load i32, ptr @x, align 4, !tbaa !29
%mul = mul nsw i32 %4, %add
%conv = sext i32 %mul to i64
%w = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 2
%5 = load i64, ptr %w, align 8, !tbaa !28
%add12 = add nsw i64 %5, %conv
store i64 %add12, ptr %w, align 8, !tbaa !28
%f = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 3
%6 = load i32, ptr %f, align 8, !tbaa !27
%add15 = add nsw i32 %6, %4
store i32 %add15, ptr %f, align 8, !tbaa !27
br label %cleanup
if.end: ; preds = %land.lhs.true, %entry
%f18 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 3
%7 = load i32, ptr %f18, align 8, !tbaa !27
%tobool.not = icmp eq i32 %7, 0
br i1 %tobool.not, label %if.end20, label %if.then19
if.then19: ; preds = %if.end
%shl.i = shl i32 %k, 1
%idxprom1.i = sext i32 %shl.i to i64
%arrayidx2.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i
%f3.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 3
%8 = load i32, ptr %f3.i, align 16, !tbaa !27
%add.i = add nsw i32 %8, %7
store i32 %add.i, ptr %f3.i, align 16, !tbaa !27
%9 = load i32, ptr %f18, align 8, !tbaa !27
%or.i = or i32 %shl.i, 1
%idxprom8.i = sext i32 %or.i to i64
%arrayidx9.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i
%f10.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 3
%10 = load i32, ptr %f10.i, align 8, !tbaa !27
%add11.i = add nsw i32 %10, %9
store i32 %add11.i, ptr %f10.i, align 8, !tbaa !27
%11 = load i32, ptr %f18, align 8, !tbaa !27
%conv.i = sext i32 %11 to i64
%r.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 1
%12 = load i32, ptr %r.i, align 4, !tbaa !26
%13 = load i32, ptr %arrayidx2.i, align 16, !tbaa !23
%sub.i = add i32 %12, 1
%add21.i = sub i32 %sub.i, %13
%conv22.i = sext i32 %add21.i to i64
%mul.i = mul nsw i64 %conv22.i, %conv.i
%w.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom1.i, i32 2
%14 = load i64, ptr %w.i, align 8, !tbaa !28
%add26.i = add nsw i64 %mul.i, %14
store i64 %add26.i, ptr %w.i, align 8, !tbaa !28
%r35.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 1
%15 = load i32, ptr %r35.i, align 4, !tbaa !26
%16 = load i32, ptr %arrayidx9.i, align 8, !tbaa !23
%sub41.i = add i32 %15, 1
%add42.i = sub i32 %sub41.i, %16
%conv43.i = sext i32 %add42.i to i64
%mul44.i = mul nsw i64 %conv43.i, %conv.i
%w49.i = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom8.i, i32 2
%17 = load i64, ptr %w49.i, align 16, !tbaa !28
%add50.i = add nsw i64 %mul44.i, %17
store i64 %add50.i, ptr %w49.i, align 16, !tbaa !28
store i32 0, ptr %f18, align 8, !tbaa !27
br label %if.end20
if.end20: ; preds = %if.then19, %if.end
%r26 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 1
%18 = load i32, ptr %r26, align 4, !tbaa !26
%add27 = add nsw i32 %18, %0
%shr = ashr i32 %add27, 1
%cmp28.not = icmp sgt i32 %1, %shr
br i1 %cmp28.not, label %if.end31, label %if.then30
if.then30: ; preds = %if.end20
%shl = shl i32 %k, 1
tail call void @change_interval(i32 noundef %shl)
br label %if.end31
if.end31: ; preds = %if.then30, %if.end20
%19 = load i32, ptr @t, align 4, !tbaa !29
%cmp32 = icmp slt i32 %shr, %19
%shl35 = shl i32 %k, 1
%or = or i32 %shl35, 1
br i1 %cmp32, label %if.then34, label %if.end36
if.then34: ; preds = %if.end31
tail call void @change_interval(i32 noundef %or)
br label %if.end36
if.end36: ; preds = %if.end31, %if.then34
%idxprom38 = sext i32 %shl35 to i64
%w40 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom38, i32 2
%20 = load i64, ptr %w40, align 8, !tbaa !28
%idxprom43 = sext i32 %or to i64
%w45 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom43, i32 2
%21 = load i64, ptr %w45, align 16, !tbaa !28
%add46 = add nsw i64 %21, %20
%w49 = getelementptr inbounds [524288 x %struct.NODE], ptr @node, i64 0, i64 %idxprom, i32 2
store i64 %add46, ptr %w49, align 8, !tbaa !28
br label %cleanup
cleanup: ; preds = %if.end36, %if.then
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14
%cmp.not.i.i = icmp ult ptr %1, %2
br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #7
%.pre14.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i.preheader
cond.false.i.i: ; preds = %entry
%incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i.i = zext i8 %3 to i32
br label %do.body.i.preheader
do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i
%.ph229 = phi ptr [ %0, %cond.false.i.i ], [ %.pre14.pre.i, %cond.true.i.i ]
%c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ]
br label %do.body.i
do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit13.i
%4 = phi ptr [ %8, %getchar_unlocked.exit13.i ], [ %.ph229, %do.body.i.preheader ]
%n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit13.i ], [ 0, %do.body.i.preheader ]
%c.0.i = phi i32 [ %cond.i9.i, %getchar_unlocked.exit13.i ], [ %c.0.i.ph, %do.body.i.preheader ]
%mul.i = mul nsw i32 %n.0.i, 10
%and.i = and i32 %c.0.i, 15
%add.i = add nsw i32 %and.i, %mul.i
%_IO_read_ptr.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9
%_IO_read_end.i5.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5.i, align 8, !tbaa !14
%cmp.not.i6.i = icmp ult ptr %5, %6
br i1 %cmp.not.i6.i, label %cond.false.i10.i, label %cond.true.i7.i, !prof !15
cond.true.i7.i: ; preds = %do.body.i
%call.i8.i = tail call i32 @__uflow(ptr noundef nonnull %4) #7
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i
cond.false.i10.i: ; preds = %do.body.i
%incdec.ptr.i11.i = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11.i, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i12.i = zext i8 %7 to i32
br label %getchar_unlocked.exit13.i
getchar_unlocked.exit13.i: ; preds = %cond.false.i10.i, %cond.true.i7.i
%8 = phi ptr [ %.pre.i, %cond.true.i7.i ], [ %4, %cond.false.i10.i ]
%cond.i9.i = phi i32 [ %call.i8.i, %cond.true.i7.i ], [ %conv3.i12.i, %cond.false.i10.i ]
%cmp.i = icmp sgt i32 %cond.i9.i, 47
br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17
in.exit: ; preds = %getchar_unlocked.exit13.i
tail call void @segTree(i32 noundef 1, i32 noundef 1, i32 noundef %add.i)
%9 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i17 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1
%10 = load ptr, ptr %_IO_read_ptr.i.i17, align 8, !tbaa !9
%_IO_read_end.i.i18 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2
%11 = load ptr, ptr %_IO_read_end.i.i18, align 8, !tbaa !14
%cmp.not.i.i19 = icmp ult ptr %10, %11
br i1 %cmp.not.i.i19, label %cond.false.i.i44, label %cond.true.i.i20, !prof !15
cond.true.i.i20: ; preds = %in.exit
%call.i.i21 = tail call i32 @__uflow(ptr noundef nonnull %9) #7
%.pre14.pre.i22 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i26.preheader
cond.false.i.i44: ; preds = %in.exit
%incdec.ptr.i.i45 = getelementptr inbounds i8, ptr %10, i64 1
store ptr %incdec.ptr.i.i45, ptr %_IO_read_ptr.i.i17, align 8, !tbaa !9
%12 = load i8, ptr %10, align 1, !tbaa !16
%conv3.i.i46 = zext i8 %12 to i32
br label %do.body.i26.preheader
do.body.i26.preheader: ; preds = %cond.false.i.i44, %cond.true.i.i20
%.ph228 = phi ptr [ %9, %cond.false.i.i44 ], [ %.pre14.pre.i22, %cond.true.i.i20 ]
%c.0.i28.ph = phi i32 [ %conv3.i.i46, %cond.false.i.i44 ], [ %call.i.i21, %cond.true.i.i20 ]
br label %do.body.i26
do.body.i26: ; preds = %do.body.i26.preheader, %getchar_unlocked.exit13.i38
%13 = phi ptr [ %17, %getchar_unlocked.exit13.i38 ], [ %.ph228, %do.body.i26.preheader ]
%n.0.i27 = phi i32 [ %add.i31, %getchar_unlocked.exit13.i38 ], [ 0, %do.body.i26.preheader ]
%c.0.i28 = phi i32 [ %cond.i9.i39, %getchar_unlocked.exit13.i38 ], [ %c.0.i28.ph, %do.body.i26.preheader ]
%mul.i29 = mul nsw i32 %n.0.i27, 10
%and.i30 = and i32 %c.0.i28, 15
%add.i31 = add nsw i32 %and.i30, %mul.i29
%_IO_read_ptr.i4.i32 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i4.i32, align 8, !tbaa !9
%_IO_read_end.i5.i33 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i5.i33, align 8, !tbaa !14
%cmp.not.i6.i34 = icmp ult ptr %14, %15
br i1 %cmp.not.i6.i34, label %cond.false.i10.i41, label %cond.true.i7.i35, !prof !15
cond.true.i7.i35: ; preds = %do.body.i26
%call.i8.i36 = tail call i32 @__uflow(ptr noundef nonnull %13) #7
%.pre.i37 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i38
cond.false.i10.i41: ; preds = %do.body.i26
%incdec.ptr.i11.i42 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i11.i42, ptr %_IO_read_ptr.i4.i32, align 8, !tbaa !9
%16 = load i8, ptr %14, align 1, !tbaa !16
%conv3.i12.i43 = zext i8 %16 to i32
br label %getchar_unlocked.exit13.i38
getchar_unlocked.exit13.i38: ; preds = %cond.false.i10.i41, %cond.true.i7.i35
%17 = phi ptr [ %.pre.i37, %cond.true.i7.i35 ], [ %13, %cond.false.i10.i41 ]
%cond.i9.i39 = phi i32 [ %call.i8.i36, %cond.true.i7.i35 ], [ %conv3.i12.i43, %cond.false.i10.i41 ]
%cmp.i40 = icmp sgt i32 %cond.i9.i39, 47
br i1 %cmp.i40, label %do.body.i26, label %while.cond.preheader, !llvm.loop !17
while.cond.preheader: ; preds = %getchar_unlocked.exit13.i38
%tobool.not214 = icmp eq i32 %add.i31, 0
br i1 %tobool.not214, label %while.end, label %while.body
while.body: ; preds = %while.cond.preheader, %if.end16
%dec215.in = phi i32 [ %dec215, %if.end16 ], [ %add.i31, %while.cond.preheader ]
%dec215 = add nsw i32 %dec215.in, -1
%18 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %18, i64 0, i32 2
%20 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %19, %20
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %while.body
%call.i = tail call i32 @__uflow(ptr noundef nonnull %18) #7
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i48.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre, i64 0, i32 1
%.pre216 = load ptr, ptr %_IO_read_ptr.i48.phi.trans.insert, align 8, !tbaa !9
%_IO_read_end.i49.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre, i64 0, i32 2
%.pre217 = load ptr, ptr %_IO_read_end.i49.phi.trans.insert, align 8, !tbaa !14
br label %getchar_unlocked.exit
cond.false.i: ; preds = %while.body
%incdec.ptr.i = getelementptr inbounds i8, ptr %19, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%21 = load i8, ptr %19, align 1, !tbaa !16
%conv3.i = zext i8 %21 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%22 = phi ptr [ %.pre217, %cond.true.i ], [ %20, %cond.false.i ]
%23 = phi ptr [ %.pre216, %cond.true.i ], [ %incdec.ptr.i, %cond.false.i ]
%24 = phi ptr [ %.pre, %cond.true.i ], [ %18, %cond.false.i ]
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%and = and i32 %cond.i, 1
%cmp.not.i50 = icmp ult ptr %23, %22
br i1 %cmp.not.i50, label %cond.false.i54, label %cond.true.i51, !prof !15
cond.true.i51: ; preds = %getchar_unlocked.exit
%call.i52 = tail call i32 @__uflow(ptr noundef nonnull %24) #7
br label %getchar_unlocked.exit57
cond.false.i54: ; preds = %getchar_unlocked.exit
%_IO_read_ptr.i48 = getelementptr inbounds %struct._IO_FILE, ptr %24, i64 0, i32 1
%incdec.ptr.i55 = getelementptr inbounds i8, ptr %23, i64 1
store ptr %incdec.ptr.i55, ptr %_IO_read_ptr.i48, align 8, !tbaa !9
br label %getchar_unlocked.exit57
getchar_unlocked.exit57: ; preds = %cond.true.i51, %cond.false.i54
%tobool4.not = icmp eq i32 %and, 0
br i1 %tobool4.not, label %if.else8, label %if.then
if.then: ; preds = %getchar_unlocked.exit57
store i64 0, ptr @ans, align 8, !tbaa !30
%25 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i58 = getelementptr inbounds %struct._IO_FILE, ptr %25, i64 0, i32 1
%26 = load ptr, ptr %_IO_read_ptr.i.i58, align 8, !tbaa !9
%_IO_read_end.i.i59 = getelementptr inbounds %struct._IO_FILE, ptr %25, i64 0, i32 2
%27 = load ptr, ptr %_IO_read_end.i.i59, align 8, !tbaa !14
%cmp.not.i.i60 = icmp ult ptr %26, %27
br i1 %cmp.not.i.i60, label %cond.false.i.i85, label %cond.true.i.i61, !prof !15
cond.true.i.i61: ; preds = %if.then
%call.i.i62 = tail call i32 @__uflow(ptr noundef nonnull %25) #7
%.pre14.pre.i63 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i67.preheader
cond.false.i.i85: ; preds = %if.then
%incdec.ptr.i.i86 = getelementptr inbounds i8, ptr %26, i64 1
store ptr %incdec.ptr.i.i86, ptr %_IO_read_ptr.i.i58, align 8, !tbaa !9
%28 = load i8, ptr %26, align 1, !tbaa !16
%conv3.i.i87 = zext i8 %28 to i32
br label %do.body.i67.preheader
do.body.i67.preheader: ; preds = %cond.false.i.i85, %cond.true.i.i61
%.ph225 = phi ptr [ %25, %cond.false.i.i85 ], [ %.pre14.pre.i63, %cond.true.i.i61 ]
%c.0.i69.ph = phi i32 [ %conv3.i.i87, %cond.false.i.i85 ], [ %call.i.i62, %cond.true.i.i61 ]
br label %do.body.i67
do.body.i67: ; preds = %do.body.i67.preheader, %getchar_unlocked.exit13.i79
%29 = phi ptr [ %33, %getchar_unlocked.exit13.i79 ], [ %.ph225, %do.body.i67.preheader ]
%n.0.i68 = phi i32 [ %add.i72, %getchar_unlocked.exit13.i79 ], [ 0, %do.body.i67.preheader ]
%c.0.i69 = phi i32 [ %cond.i9.i80, %getchar_unlocked.exit13.i79 ], [ %c.0.i69.ph, %do.body.i67.preheader ]
%mul.i70 = mul nsw i32 %n.0.i68, 10
%and.i71 = and i32 %c.0.i69, 15
%add.i72 = add nsw i32 %and.i71, %mul.i70
%_IO_read_ptr.i4.i73 = getelementptr inbounds %struct._IO_FILE, ptr %29, i64 0, i32 1
%30 = load ptr, ptr %_IO_read_ptr.i4.i73, align 8, !tbaa !9
%_IO_read_end.i5.i74 = getelementptr inbounds %struct._IO_FILE, ptr %29, i64 0, i32 2
%31 = load ptr, ptr %_IO_read_end.i5.i74, align 8, !tbaa !14
%cmp.not.i6.i75 = icmp ult ptr %30, %31
br i1 %cmp.not.i6.i75, label %cond.false.i10.i82, label %cond.true.i7.i76, !prof !15
cond.true.i7.i76: ; preds = %do.body.i67
%call.i8.i77 = tail call i32 @__uflow(ptr noundef nonnull %29) #7
%.pre.i78 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i79
cond.false.i10.i82: ; preds = %do.body.i67
%incdec.ptr.i11.i83 = getelementptr inbounds i8, ptr %30, i64 1
store ptr %incdec.ptr.i11.i83, ptr %_IO_read_ptr.i4.i73, align 8, !tbaa !9
%32 = load i8, ptr %30, align 1, !tbaa !16
%conv3.i12.i84 = zext i8 %32 to i32
br label %getchar_unlocked.exit13.i79
getchar_unlocked.exit13.i79: ; preds = %cond.false.i10.i82, %cond.true.i7.i76
%33 = phi ptr [ %.pre.i78, %cond.true.i7.i76 ], [ %29, %cond.false.i10.i82 ]
%cond.i9.i80 = phi i32 [ %call.i8.i77, %cond.true.i7.i76 ], [ %conv3.i12.i84, %cond.false.i10.i82 ]
%cmp.i81 = icmp sgt i32 %cond.i9.i80, 47
br i1 %cmp.i81, label %do.body.i67, label %in.exit88, !llvm.loop !17
in.exit88: ; preds = %getchar_unlocked.exit13.i79
store i32 %add.i72, ptr @s, align 4, !tbaa !29
%_IO_read_ptr.i.i89 = getelementptr inbounds %struct._IO_FILE, ptr %33, i64 0, i32 1
%34 = load ptr, ptr %_IO_read_ptr.i.i89, align 8, !tbaa !9
%_IO_read_end.i.i90 = getelementptr inbounds %struct._IO_FILE, ptr %33, i64 0, i32 2
%35 = load ptr, ptr %_IO_read_end.i.i90, align 8, !tbaa !14
%cmp.not.i.i91 = icmp ult ptr %34, %35
br i1 %cmp.not.i.i91, label %cond.false.i.i116, label %cond.true.i.i92, !prof !15
cond.true.i.i92: ; preds = %in.exit88
%call.i.i93 = tail call i32 @__uflow(ptr noundef nonnull %33) #7
%.pre14.pre.i94 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i98.preheader
cond.false.i.i116: ; preds = %in.exit88
%incdec.ptr.i.i117 = getelementptr inbounds i8, ptr %34, i64 1
store ptr %incdec.ptr.i.i117, ptr %_IO_read_ptr.i.i89, align 8, !tbaa !9
%36 = load i8, ptr %34, align 1, !tbaa !16
%conv3.i.i118 = zext i8 %36 to i32
br label %do.body.i98.preheader
do.body.i98.preheader: ; preds = %cond.false.i.i116, %cond.true.i.i92
%.ph224 = phi ptr [ %33, %cond.false.i.i116 ], [ %.pre14.pre.i94, %cond.true.i.i92 ]
%c.0.i100.ph = phi i32 [ %conv3.i.i118, %cond.false.i.i116 ], [ %call.i.i93, %cond.true.i.i92 ]
br label %do.body.i98
do.body.i98: ; preds = %do.body.i98.preheader, %getchar_unlocked.exit13.i110
%37 = phi ptr [ %41, %getchar_unlocked.exit13.i110 ], [ %.ph224, %do.body.i98.preheader ]
%n.0.i99 = phi i32 [ %add.i103, %getchar_unlocked.exit13.i110 ], [ 0, %do.body.i98.preheader ]
%c.0.i100 = phi i32 [ %cond.i9.i111, %getchar_unlocked.exit13.i110 ], [ %c.0.i100.ph, %do.body.i98.preheader ]
%mul.i101 = mul nsw i32 %n.0.i99, 10
%and.i102 = and i32 %c.0.i100, 15
%add.i103 = add nsw i32 %and.i102, %mul.i101
%_IO_read_ptr.i4.i104 = getelementptr inbounds %struct._IO_FILE, ptr %37, i64 0, i32 1
%38 = load ptr, ptr %_IO_read_ptr.i4.i104, align 8, !tbaa !9
%_IO_read_end.i5.i105 = getelementptr inbounds %struct._IO_FILE, ptr %37, i64 0, i32 2
%39 = load ptr, ptr %_IO_read_end.i5.i105, align 8, !tbaa !14
%cmp.not.i6.i106 = icmp ult ptr %38, %39
br i1 %cmp.not.i6.i106, label %cond.false.i10.i113, label %cond.true.i7.i107, !prof !15
cond.true.i7.i107: ; preds = %do.body.i98
%call.i8.i108 = tail call i32 @__uflow(ptr noundef nonnull %37) #7
%.pre.i109 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i110
cond.false.i10.i113: ; preds = %do.body.i98
%incdec.ptr.i11.i114 = getelementptr inbounds i8, ptr %38, i64 1
store ptr %incdec.ptr.i11.i114, ptr %_IO_read_ptr.i4.i104, align 8, !tbaa !9
%40 = load i8, ptr %38, align 1, !tbaa !16
%conv3.i12.i115 = zext i8 %40 to i32
br label %getchar_unlocked.exit13.i110
getchar_unlocked.exit13.i110: ; preds = %cond.false.i10.i113, %cond.true.i7.i107
%41 = phi ptr [ %.pre.i109, %cond.true.i7.i107 ], [ %37, %cond.false.i10.i113 ]
%cond.i9.i111 = phi i32 [ %call.i8.i108, %cond.true.i7.i107 ], [ %conv3.i12.i115, %cond.false.i10.i113 ]
%cmp.i112 = icmp sgt i32 %cond.i9.i111, 47
br i1 %cmp.i112, label %do.body.i98, label %in.exit119, !llvm.loop !17
in.exit119: ; preds = %getchar_unlocked.exit13.i110
store i32 %add.i103, ptr @t, align 4, !tbaa !29
%42 = load i32, ptr @s, align 4, !tbaa !29
%cmp = icmp eq i32 %42, %add.i103
br i1 %cmp, label %if.then7, label %if.else
if.then7: ; preds = %in.exit119
tail call void @ask_point(i32 noundef 1)
br label %if.end
if.else: ; preds = %in.exit119
tail call void @ask_interval(i32 noundef 1)
br label %if.end
if.end: ; preds = %if.else, %if.then7
%43 = load i64, ptr @ans, align 8, !tbaa !30
tail call void @out(i64 noundef %43)
br label %if.end16
if.else8: ; preds = %getchar_unlocked.exit57
%44 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i120 = getelementptr inbounds %struct._IO_FILE, ptr %44, i64 0, i32 1
%45 = load ptr, ptr %_IO_read_ptr.i.i120, align 8, !tbaa !9
%_IO_read_end.i.i121 = getelementptr inbounds %struct._IO_FILE, ptr %44, i64 0, i32 2
%46 = load ptr, ptr %_IO_read_end.i.i121, align 8, !tbaa !14
%cmp.not.i.i122 = icmp ult ptr %45, %46
br i1 %cmp.not.i.i122, label %cond.false.i.i147, label %cond.true.i.i123, !prof !15
cond.true.i.i123: ; preds = %if.else8
%call.i.i124 = tail call i32 @__uflow(ptr noundef nonnull %44) #7
%.pre14.pre.i125 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i129.preheader
cond.false.i.i147: ; preds = %if.else8
%incdec.ptr.i.i148 = getelementptr inbounds i8, ptr %45, i64 1
store ptr %incdec.ptr.i.i148, ptr %_IO_read_ptr.i.i120, align 8, !tbaa !9
%47 = load i8, ptr %45, align 1, !tbaa !16
%conv3.i.i149 = zext i8 %47 to i32
br label %do.body.i129.preheader
do.body.i129.preheader: ; preds = %cond.false.i.i147, %cond.true.i.i123
%.ph223 = phi ptr [ %44, %cond.false.i.i147 ], [ %.pre14.pre.i125, %cond.true.i.i123 ]
%c.0.i131.ph = phi i32 [ %conv3.i.i149, %cond.false.i.i147 ], [ %call.i.i124, %cond.true.i.i123 ]
br label %do.body.i129
do.body.i129: ; preds = %do.body.i129.preheader, %getchar_unlocked.exit13.i141
%48 = phi ptr [ %52, %getchar_unlocked.exit13.i141 ], [ %.ph223, %do.body.i129.preheader ]
%n.0.i130 = phi i32 [ %add.i134, %getchar_unlocked.exit13.i141 ], [ 0, %do.body.i129.preheader ]
%c.0.i131 = phi i32 [ %cond.i9.i142, %getchar_unlocked.exit13.i141 ], [ %c.0.i131.ph, %do.body.i129.preheader ]
%mul.i132 = mul nsw i32 %n.0.i130, 10
%and.i133 = and i32 %c.0.i131, 15
%add.i134 = add nsw i32 %and.i133, %mul.i132
%_IO_read_ptr.i4.i135 = getelementptr inbounds %struct._IO_FILE, ptr %48, i64 0, i32 1
%49 = load ptr, ptr %_IO_read_ptr.i4.i135, align 8, !tbaa !9
%_IO_read_end.i5.i136 = getelementptr inbounds %struct._IO_FILE, ptr %48, i64 0, i32 2
%50 = load ptr, ptr %_IO_read_end.i5.i136, align 8, !tbaa !14
%cmp.not.i6.i137 = icmp ult ptr %49, %50
br i1 %cmp.not.i6.i137, label %cond.false.i10.i144, label %cond.true.i7.i138, !prof !15
cond.true.i7.i138: ; preds = %do.body.i129
%call.i8.i139 = tail call i32 @__uflow(ptr noundef nonnull %48) #7
%.pre.i140 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i141
cond.false.i10.i144: ; preds = %do.body.i129
%incdec.ptr.i11.i145 = getelementptr inbounds i8, ptr %49, i64 1
store ptr %incdec.ptr.i11.i145, ptr %_IO_read_ptr.i4.i135, align 8, !tbaa !9
%51 = load i8, ptr %49, align 1, !tbaa !16
%conv3.i12.i146 = zext i8 %51 to i32
br label %getchar_unlocked.exit13.i141
getchar_unlocked.exit13.i141: ; preds = %cond.false.i10.i144, %cond.true.i7.i138
%52 = phi ptr [ %.pre.i140, %cond.true.i7.i138 ], [ %48, %cond.false.i10.i144 ]
%cond.i9.i142 = phi i32 [ %call.i8.i139, %cond.true.i7.i138 ], [ %conv3.i12.i146, %cond.false.i10.i144 ]
%cmp.i143 = icmp sgt i32 %cond.i9.i142, 47
br i1 %cmp.i143, label %do.body.i129, label %in.exit150, !llvm.loop !17
in.exit150: ; preds = %getchar_unlocked.exit13.i141
store i32 %add.i134, ptr @s, align 4, !tbaa !29
%_IO_read_ptr.i.i151 = getelementptr inbounds %struct._IO_FILE, ptr %52, i64 0, i32 1
%53 = load ptr, ptr %_IO_read_ptr.i.i151, align 8, !tbaa !9
%_IO_read_end.i.i152 = getelementptr inbounds %struct._IO_FILE, ptr %52, i64 0, i32 2
%54 = load ptr, ptr %_IO_read_end.i.i152, align 8, !tbaa !14
%cmp.not.i.i153 = icmp ult ptr %53, %54
br i1 %cmp.not.i.i153, label %cond.false.i.i178, label %cond.true.i.i154, !prof !15
cond.true.i.i154: ; preds = %in.exit150
%call.i.i155 = tail call i32 @__uflow(ptr noundef nonnull %52) #7
%.pre14.pre.i156 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i160.preheader
cond.false.i.i178: ; preds = %in.exit150
%incdec.ptr.i.i179 = getelementptr inbounds i8, ptr %53, i64 1
store ptr %incdec.ptr.i.i179, ptr %_IO_read_ptr.i.i151, align 8, !tbaa !9
%55 = load i8, ptr %53, align 1, !tbaa !16
%conv3.i.i180 = zext i8 %55 to i32
br label %do.body.i160.preheader
do.body.i160.preheader: ; preds = %cond.false.i.i178, %cond.true.i.i154
%.ph222 = phi ptr [ %52, %cond.false.i.i178 ], [ %.pre14.pre.i156, %cond.true.i.i154 ]
%c.0.i162.ph = phi i32 [ %conv3.i.i180, %cond.false.i.i178 ], [ %call.i.i155, %cond.true.i.i154 ]
br label %do.body.i160
do.body.i160: ; preds = %do.body.i160.preheader, %getchar_unlocked.exit13.i172
%56 = phi ptr [ %60, %getchar_unlocked.exit13.i172 ], [ %.ph222, %do.body.i160.preheader ]
%n.0.i161 = phi i32 [ %add.i165, %getchar_unlocked.exit13.i172 ], [ 0, %do.body.i160.preheader ]
%c.0.i162 = phi i32 [ %cond.i9.i173, %getchar_unlocked.exit13.i172 ], [ %c.0.i162.ph, %do.body.i160.preheader ]
%mul.i163 = mul nsw i32 %n.0.i161, 10
%and.i164 = and i32 %c.0.i162, 15
%add.i165 = add nsw i32 %and.i164, %mul.i163
%_IO_read_ptr.i4.i166 = getelementptr inbounds %struct._IO_FILE, ptr %56, i64 0, i32 1
%57 = load ptr, ptr %_IO_read_ptr.i4.i166, align 8, !tbaa !9
%_IO_read_end.i5.i167 = getelementptr inbounds %struct._IO_FILE, ptr %56, i64 0, i32 2
%58 = load ptr, ptr %_IO_read_end.i5.i167, align 8, !tbaa !14
%cmp.not.i6.i168 = icmp ult ptr %57, %58
br i1 %cmp.not.i6.i168, label %cond.false.i10.i175, label %cond.true.i7.i169, !prof !15
cond.true.i7.i169: ; preds = %do.body.i160
%call.i8.i170 = tail call i32 @__uflow(ptr noundef nonnull %56) #7
%.pre.i171 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i172
cond.false.i10.i175: ; preds = %do.body.i160
%incdec.ptr.i11.i176 = getelementptr inbounds i8, ptr %57, i64 1
store ptr %incdec.ptr.i11.i176, ptr %_IO_read_ptr.i4.i166, align 8, !tbaa !9
%59 = load i8, ptr %57, align 1, !tbaa !16
%conv3.i12.i177 = zext i8 %59 to i32
br label %getchar_unlocked.exit13.i172
getchar_unlocked.exit13.i172: ; preds = %cond.false.i10.i175, %cond.true.i7.i169
%60 = phi ptr [ %.pre.i171, %cond.true.i7.i169 ], [ %56, %cond.false.i10.i175 ]
%cond.i9.i173 = phi i32 [ %call.i8.i170, %cond.true.i7.i169 ], [ %conv3.i12.i177, %cond.false.i10.i175 ]
%cmp.i174 = icmp sgt i32 %cond.i9.i173, 47
br i1 %cmp.i174, label %do.body.i160, label %in.exit181, !llvm.loop !17
in.exit181: ; preds = %getchar_unlocked.exit13.i172
store i32 %add.i165, ptr @t, align 4, !tbaa !29
%_IO_read_ptr.i.i182 = getelementptr inbounds %struct._IO_FILE, ptr %60, i64 0, i32 1
%61 = load ptr, ptr %_IO_read_ptr.i.i182, align 8, !tbaa !9
%_IO_read_end.i.i183 = getelementptr inbounds %struct._IO_FILE, ptr %60, i64 0, i32 2
%62 = load ptr, ptr %_IO_read_end.i.i183, align 8, !tbaa !14
%cmp.not.i.i184 = icmp ult ptr %61, %62
br i1 %cmp.not.i.i184, label %cond.false.i.i209, label %cond.true.i.i185, !prof !15
cond.true.i.i185: ; preds = %in.exit181
%call.i.i186 = tail call i32 @__uflow(ptr noundef nonnull %60) #7
%.pre14.pre.i187 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i191.preheader
cond.false.i.i209: ; preds = %in.exit181
%incdec.ptr.i.i210 = getelementptr inbounds i8, ptr %61, i64 1
store ptr %incdec.ptr.i.i210, ptr %_IO_read_ptr.i.i182, align 8, !tbaa !9
%63 = load i8, ptr %61, align 1, !tbaa !16
%conv3.i.i211 = zext i8 %63 to i32
br label %do.body.i191.preheader
do.body.i191.preheader: ; preds = %cond.false.i.i209, %cond.true.i.i185
%.ph = phi ptr [ %60, %cond.false.i.i209 ], [ %.pre14.pre.i187, %cond.true.i.i185 ]
%c.0.i193.ph = phi i32 [ %conv3.i.i211, %cond.false.i.i209 ], [ %call.i.i186, %cond.true.i.i185 ]
br label %do.body.i191
do.body.i191: ; preds = %do.body.i191.preheader, %getchar_unlocked.exit13.i203
%64 = phi ptr [ %68, %getchar_unlocked.exit13.i203 ], [ %.ph, %do.body.i191.preheader ]
%n.0.i192 = phi i32 [ %add.i196, %getchar_unlocked.exit13.i203 ], [ 0, %do.body.i191.preheader ]
%c.0.i193 = phi i32 [ %cond.i9.i204, %getchar_unlocked.exit13.i203 ], [ %c.0.i193.ph, %do.body.i191.preheader ]
%mul.i194 = mul nsw i32 %n.0.i192, 10
%and.i195 = and i32 %c.0.i193, 15
%add.i196 = add nsw i32 %and.i195, %mul.i194
%_IO_read_ptr.i4.i197 = getelementptr inbounds %struct._IO_FILE, ptr %64, i64 0, i32 1
%65 = load ptr, ptr %_IO_read_ptr.i4.i197, align 8, !tbaa !9
%_IO_read_end.i5.i198 = getelementptr inbounds %struct._IO_FILE, ptr %64, i64 0, i32 2
%66 = load ptr, ptr %_IO_read_end.i5.i198, align 8, !tbaa !14
%cmp.not.i6.i199 = icmp ult ptr %65, %66
br i1 %cmp.not.i6.i199, label %cond.false.i10.i206, label %cond.true.i7.i200, !prof !15
cond.true.i7.i200: ; preds = %do.body.i191
%call.i8.i201 = tail call i32 @__uflow(ptr noundef nonnull %64) #7
%.pre.i202 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i203
cond.false.i10.i206: ; preds = %do.body.i191
%incdec.ptr.i11.i207 = getelementptr inbounds i8, ptr %65, i64 1
store ptr %incdec.ptr.i11.i207, ptr %_IO_read_ptr.i4.i197, align 8, !tbaa !9
%67 = load i8, ptr %65, align 1, !tbaa !16
%conv3.i12.i208 = zext i8 %67 to i32
br label %getchar_unlocked.exit13.i203
getchar_unlocked.exit13.i203: ; preds = %cond.false.i10.i206, %cond.true.i7.i200
%68 = phi ptr [ %.pre.i202, %cond.true.i7.i200 ], [ %64, %cond.false.i10.i206 ]
%cond.i9.i204 = phi i32 [ %call.i8.i201, %cond.true.i7.i200 ], [ %conv3.i12.i208, %cond.false.i10.i206 ]
%cmp.i205 = icmp sgt i32 %cond.i9.i204, 47
br i1 %cmp.i205, label %do.body.i191, label %in.exit212, !llvm.loop !17
in.exit212: ; preds = %getchar_unlocked.exit13.i203
store i32 %add.i196, ptr @x, align 4, !tbaa !29
%69 = load i32, ptr @s, align 4, !tbaa !29
%70 = load i32, ptr @t, align 4, !tbaa !29
%cmp12 = icmp eq i32 %69, %70
br i1 %cmp12, label %if.then13, label %if.else14
if.then13: ; preds = %in.exit212
tail call void @change_point(i32 noundef 1)
br label %if.end16
if.else14: ; preds = %in.exit212
tail call void @change_interval(i32 noundef 1)
br label %if.end16
if.end16: ; preds = %if.then13, %if.else14, %if.end
%tobool.not = icmp eq i32 %dec215, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !31
while.end: ; preds = %if.end16, %while.cond.preheader
ret i32 0
}
declare i32 @__uflow(ptr noundef) local_unnamed_addr #6
declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #6
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { "no-trapping-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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !6, i64 40}
!20 = !{!10, !6, i64 48}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = !{!24, !11, i64 0}
!24 = !{!"", !11, i64 0, !11, i64 4, !25, i64 8, !11, i64 16}
!25 = !{!"long long", !7, i64 0}
!26 = !{!24, !11, i64 4}
!27 = !{!24, !11, i64 16}
!28 = !{!24, !25, i64 8}
!29 = !{!11, !11, i64 0}
!30 = !{!25, !25, i64 0}
!31 = distinct !{!31, !18}
|
// AOJ 0265 Cats Going Straight
// 2018.3.11 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
typedef struct { double x, y; } PP;
typedef struct { PP s, e; } SEG, LINE;
#define INF 1e8
#define EPS 1e-8
#define EQ(a,b) (fabs((a)-(b))<EPS)
#define PPeQ(a,b) (EQ(a.x,b.x)&&EQ(a.y,b.y))
PP vadd(PP p1, PP p2) { PP r; r.x = p1.x + p2.x, r.y = p1.y + p2.y; return r; }
PP vsub(PP p1, PP p2) { PP r; r.x = p1.x - p2.x, r.y = p1.y - p2.y; return r; }
PP vsmul(PP p, double k) { PP r; r.x = p.x * k, r.y = p.y * k; return r; }
double dist(PP p1, PP p2) { return hypot(p1.x - p2.x, p1.y - p2.y); }
double cross(PP a, PP b) { return a.x * b.y - a.y * b.x; }
double dot(PP a, PP b) { return a.x * b.x + a.y * b.y; }
double norm(PP a) { return a.x * a.x + a.y * a.y; }
PP dir(SEG s) { return vsub(s.e, s.s); }
int ccw(PP p0, PP p1, PP p2) {
PP a, b; double t;
a = vsub(p1, p0), b = vsub(p2, p0), t = cross(a, b);
if (t > EPS) return 1; if (t < -EPS) return -1;
if (dot(a, b) < -EPS) return 2; if (norm(a) < norm(b)) return -2;
return 0;
}
int intersectSS(SEG s1, SEG s2) {
return ccw(s1.s, s1.e, s2.s) * ccw(s1.s, s1.e, s2.e) < 0 &&
ccw(s2.s, s2.e, s1.s) * ccw(s2.s, s2.e, s1.e) < 0;
}
int isParaLL(SEG s1, SEG s2) {
return EQ((s2.e.y - s2.s.y)*(s1.e.x - s1.s.x),
(s1.e.y - s1.s.y)*(s2.e.x - s2.s.x));
}
#define intersectLL(ln1, ln2) (!isParaLL(ln1, ln2))
PP crossPointLL(LINE ln1, LINE ln2) {
PP u = vsub(ln1.e, ln1.s), v = vsub(ln2.e, ln2.s);
return vadd(ln1.s, vsmul(u, cross(v, vsub(ln2.s, ln1.s)) / cross(v, u)));
}
int ppOnSeg(PP p, SEG s)
{
double x1 = s.s.x, y1 = s.s.y, x2 = s.e.x, y2 = s.e.y;
double d;
if (x1 >= x2) { d = x1, x1 = x2, x2 = d; d = y1, y1 = y2, y2 = d; }
return x1 <= p.x && p.x <= x2 &&
((y1 <= y2 && y1 <= p.y && p.y <= y2) ||
(y1 > y2 && y2 <= p.y && p.y <= y1))
&& EQ((p.y - y1)*(x2 - x1), (y2 - y1)*(p.x - x1));
}
typedef struct { PP p[200]; } T;
T tbl[20]; int hi[20];
PP pp[20]; int N;
SEG seg[20];
SEG *cut; int *flg; int sz;
int mask;
int visible(PP q, SEG s)
{
int i;
SEG t;
if (ccw(s.s, s.e, q) == -1) return 0;
t.s = q;
t.e.x = (s.s.x + s.e.x) / 2.0;
t.e.y = (s.s.y + s.e.y) / 2.0;
for (i = 0; i < N; i++) if (intersectSS(t, seg[i])) return 0;
return 1;
}
void update(int id, PP p)
{
int i;
for (i = 0; i < hi[id]; i++)
if (PPeQ(p, tbl[id].p[i])) return;
tbl[id].p[hi[id]++] = p;
}
static PP org;
int cmp(const void *a, const void *b)
{
double d = dist(*(PP *)a, org) - dist(*(PP *)b, org);
if (EQ(d, 0)) return 0;
if (d <= 0) return -1;
return 1;
}
int bitcount(int bits) // 32ビット用
{
bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
return (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff);
}
int main()
{
int i, j, k, ans;
PP q;
SEG s;
while (scanf("%d", &N), N) {
mask = (1 << N) - 1;
for (i = 0; i < N; i++) {
int x, y;
scanf("%d%d", &x, &y);
pp[i].x = x, pp[i].y = y;
}
memset(hi, 0, sizeof(hi));
for (i = 0; i < N; i++) {
seg[i].s = pp[i], seg[i].e = pp[(i + 1) % N];
tbl[i].p[hi[i]++] = seg[i].s;
tbl[i].p[hi[i]++] = seg[i].e;
}
for (i = 0; i < N; i++) {
s.s.x = pp[i].x, s.s.y = pp[i].y;
for (j = 0; j < N; j++) if (i != j) {
s.e.x = pp[j].x, s.e.y = pp[j].y;
for (k = 0; k < N; k++) {
if (intersectLL(s, seg[k])) {
q = crossPointLL(s, seg[k]);
if (!PPeQ(q, seg[k].s) && !PPeQ(q, seg[k].e))
if (ppOnSeg(q, seg[k])) update(k, q);
}
}
}
}
for (i = 0; i < N; i++) {
org = tbl[i].p[0];
qsort(tbl[i].p, hi[i], sizeof(PP), cmp);
}
#if 0
for (i = 0; i < N; i++) {
printf("線分%d上の点数 %d:", i, hi[i]);
for (j = 0; j < hi[i]; j++) printf("(%lf,%lf) ", tbl[i].p[j].x, tbl[i].p[j].y);
printf("\n");
}
#endif
sz = 0; for (i = 0; i < N; i++) sz += hi[i]-1;
cut = malloc(sz * sizeof(SEG));
flg = malloc(sz * sizeof(int));
sz = 0; for (i = 0; i < N; i++) {
for (j = 0; j < hi[i]-1; j++) {
cut[sz].s = tbl[i].p[j], cut[sz++].e = tbl[i].p[j + 1];
}
}
memset(flg, 0xff, sz * sizeof(int));
for (i = 0; i < N; i++) {
for (j = 0; j < sz; j++) {
if (!visible(pp[i], cut[j])) flg[j] &= ~(1 << i);
}
}
ans = N;
for (i = 1; i <= mask; i++) {
if ((k = bitcount(i)) < ans) {
for (j = 0; ; j++) {
if (j >= sz) { ans = k; break; }
if ((flg[j] & i) == 0) break;
}
}
}
printf("%d\n", ans);
free(cut), free(flg);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190177/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190177/source.c"
target datalayout = "e-m:e-p270: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.SEG = type { %struct.PP, %struct.PP }
%struct.PP = type { double, double }
%struct.T = type { [200 x %struct.PP] }
@N = dso_local global i32 0, align 4
@seg = dso_local global [20 x %struct.SEG] zeroinitializer, align 16
@hi = dso_local local_unnamed_addr global [20 x i32] zeroinitializer, align 16
@tbl = dso_local global [20 x %struct.T] zeroinitializer, align 16
@org = internal unnamed_addr global %struct.PP zeroinitializer, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@mask = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@pp = dso_local local_unnamed_addr global [20 x %struct.PP] zeroinitializer, align 16
@sz = dso_local local_unnamed_addr global i32 0, align 4
@cut = dso_local local_unnamed_addr global ptr null, align 8
@flg = dso_local local_unnamed_addr global ptr null, align 8
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { double, double } @vadd(double %p1.coerce0, double %p1.coerce1, double %p2.coerce0, double %p2.coerce1) local_unnamed_addr #0 {
entry:
%add = fadd double %p1.coerce0, %p2.coerce0
%add4 = fadd double %p1.coerce1, %p2.coerce1
%.fca.0.insert = insertvalue { double, double } poison, double %add, 0
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %add4, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { double, double } @vsub(double %p1.coerce0, double %p1.coerce1, double %p2.coerce0, double %p2.coerce1) local_unnamed_addr #0 {
entry:
%sub = fsub double %p1.coerce0, %p2.coerce0
%sub4 = fsub double %p1.coerce1, %p2.coerce1
%.fca.0.insert = insertvalue { double, double } poison, double %sub, 0
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %sub4, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { double, double } @vsmul(double %p.coerce0, double %p.coerce1, double noundef %k) local_unnamed_addr #0 {
entry:
%mul = fmul double %p.coerce0, %k
%mul2 = fmul double %p.coerce1, %k
%.fca.0.insert = insertvalue { double, double } poison, double %mul, 0
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %mul2, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: nounwind uwtable
define dso_local double @dist(double %p1.coerce0, double %p1.coerce1, double %p2.coerce0, double %p2.coerce1) local_unnamed_addr #1 {
entry:
%sub = fsub double %p1.coerce0, %p2.coerce0
%sub3 = fsub double %p1.coerce1, %p2.coerce1
%call = tail call double @hypot(double noundef %sub, double noundef %sub3) #17
ret double %call
}
; Function Attrs: nounwind
declare double @hypot(double noundef, double noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @cross(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #3 {
entry:
%0 = fneg double %a.coerce1
%neg = fmul double %0, %b.coerce0
%1 = tail call double @llvm.fmuladd.f64(double %a.coerce0, double %b.coerce1, double %neg)
ret double %1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @dot(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #3 {
entry:
%mul3 = fmul double %a.coerce1, %b.coerce1
%0 = tail call double @llvm.fmuladd.f64(double %a.coerce0, double %b.coerce0, double %mul3)
ret double %0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @norm(double %a.coerce0, double %a.coerce1) local_unnamed_addr #3 {
entry:
%mul3 = fmul double %a.coerce1, %a.coerce1
%0 = tail call double @llvm.fmuladd.f64(double %a.coerce0, double %a.coerce0, double %mul3)
ret double %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local { double, double } @dir(ptr nocapture noundef readonly byval(%struct.SEG) align 8 %s) local_unnamed_addr #5 {
entry:
%e = getelementptr inbounds %struct.SEG, ptr %s, i64 0, i32 1
%0 = load <2 x double>, ptr %e, align 8
%1 = load <2 x double>, ptr %s, align 8
%2 = fsub <2 x double> %0, %1
%3 = extractelement <2 x double> %2, i64 0
%.fca.0.insert.i = insertvalue { double, double } poison, double %3, 0
%4 = extractelement <2 x double> %2, i64 1
%.fca.1.insert.i = insertvalue { double, double } %.fca.0.insert.i, double %4, 1
ret { double, double } %.fca.1.insert.i
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ccw(double %p0.coerce0, double %p0.coerce1, double %p1.coerce0, double %p1.coerce1, double %p2.coerce0, double %p2.coerce1) local_unnamed_addr #3 {
entry:
%0 = insertelement <2 x double> poison, double %p1.coerce0, i64 0
%1 = insertelement <2 x double> %0, double %p2.coerce0, i64 1
%2 = insertelement <2 x double> poison, double %p0.coerce0, i64 0
%3 = shufflevector <2 x double> %2, <2 x double> poison, <2 x i32> zeroinitializer
%4 = fsub <2 x double> %1, %3
%5 = insertelement <2 x double> poison, double %p1.coerce1, i64 0
%6 = insertelement <2 x double> %5, double %p2.coerce1, i64 1
%7 = insertelement <2 x double> poison, double %p0.coerce1, i64 0
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer
%9 = fsub <2 x double> %6, %8
%10 = extractelement <2 x double> %9, i64 0
%11 = fneg double %10
%12 = extractelement <2 x double> %4, i64 1
%neg.i = fmul double %12, %11
%13 = extractelement <2 x double> %4, i64 0
%14 = extractelement <2 x double> %9, i64 1
%15 = tail call double @llvm.fmuladd.f64(double %13, double %14, double %neg.i)
%cmp = fcmp ogt double %15, 1.000000e-08
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = fcmp olt double %15, -1.000000e-08
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%mul3.i = fmul double %10, %14
%16 = tail call double @llvm.fmuladd.f64(double %13, double %12, double %mul3.i)
%cmp8 = fcmp olt double %16, -1.000000e-08
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%17 = fmul <2 x double> %9, %9
%18 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %4, <2 x double> %4, <2 x double> %17)
%19 = extractelement <2 x double> %18, i64 0
%20 = extractelement <2 x double> %18, i64 1
%cmp13 = fcmp olt double %19, %20
%. = select i1 %cmp13, i32 -2, i32 0
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ 1, %entry ], [ -1, %if.end ], [ 2, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #6
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #6
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @intersectSS(ptr nocapture noundef readonly byval(%struct.SEG) align 8 %s1, ptr nocapture noundef readonly byval(%struct.SEG) align 8 %s2) local_unnamed_addr #8 {
entry:
%e = getelementptr inbounds %struct.SEG, ptr %s1, i64 0, i32 1
%0 = load double, ptr %s1, align 8
%1 = getelementptr inbounds { double, double }, ptr %s1, i64 0, i32 1
%2 = load double, ptr %1, align 8
%3 = load double, ptr %e, align 8
%4 = getelementptr inbounds %struct.SEG, ptr %s1, i64 0, i32 1, i32 1
%5 = load double, ptr %4, align 8
%6 = load double, ptr %s2, align 8
%7 = getelementptr inbounds { double, double }, ptr %s2, i64 0, i32 1
%8 = load double, ptr %7, align 8
%9 = insertelement <2 x double> poison, double %3, i64 0
%10 = insertelement <2 x double> %9, double %6, i64 1
%11 = insertelement <2 x double> poison, double %0, i64 0
%12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> zeroinitializer
%13 = fsub <2 x double> %10, %12
%14 = insertelement <2 x double> poison, double %5, i64 0
%15 = insertelement <2 x double> %14, double %8, i64 1
%16 = insertelement <2 x double> poison, double %2, i64 0
%17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer
%18 = fsub <2 x double> %15, %17
%19 = extractelement <2 x double> %18, i64 0
%20 = fneg double %19
%21 = extractelement <2 x double> %13, i64 1
%neg.i.i = fmul double %21, %20
%22 = extractelement <2 x double> %13, i64 0
%23 = extractelement <2 x double> %18, i64 1
%24 = tail call double @llvm.fmuladd.f64(double %22, double %23, double %neg.i.i)
%cmp.i = fcmp ogt double %24, 1.000000e-08
br i1 %cmp.i, label %ccw.exit, label %if.end.i
if.end.i: ; preds = %entry
%cmp4.i = fcmp olt double %24, -1.000000e-08
br i1 %cmp4.i, label %ccw.exit, label %if.end6.i
if.end6.i: ; preds = %if.end.i
%mul3.i.i = fmul double %19, %23
%25 = tail call double @llvm.fmuladd.f64(double %22, double %21, double %mul3.i.i)
%cmp8.i = fcmp olt double %25, -1.000000e-08
br i1 %cmp8.i, label %ccw.exit, label %if.end10.i
if.end10.i: ; preds = %if.end6.i
%26 = fmul <2 x double> %18, %18
%27 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %13, <2 x double> %26)
%28 = extractelement <2 x double> %27, i64 0
%29 = extractelement <2 x double> %27, i64 1
%cmp13.i = fcmp olt double %28, %29
%..i = select i1 %cmp13.i, i32 -2, i32 0
br label %ccw.exit
ccw.exit: ; preds = %entry, %if.end.i, %if.end6.i, %if.end10.i
%retval.0.i = phi i32 [ 1, %entry ], [ -1, %if.end.i ], [ 2, %if.end6.i ], [ %..i, %if.end10.i ]
%e6 = getelementptr inbounds %struct.SEG, ptr %s2, i64 0, i32 1
%30 = load double, ptr %e6, align 8
%31 = getelementptr inbounds %struct.SEG, ptr %s2, i64 0, i32 1, i32 1
%32 = load double, ptr %31, align 8
%sub.i29.i20 = fsub double %30, %0
%sub4.i30.i21 = fsub double %32, %2
%neg.i.i22 = fmul double %sub.i29.i20, %20
%33 = tail call double @llvm.fmuladd.f64(double %22, double %sub4.i30.i21, double %neg.i.i22)
%cmp.i23 = fcmp ogt double %33, 1.000000e-08
br i1 %cmp.i23, label %ccw.exit35, label %if.end.i24
if.end.i24: ; preds = %ccw.exit
%cmp4.i25 = fcmp olt double %33, -1.000000e-08
br i1 %cmp4.i25, label %ccw.exit35, label %if.end6.i26
if.end6.i26: ; preds = %if.end.i24
%mul3.i.i27 = fmul double %19, %sub4.i30.i21
%34 = tail call double @llvm.fmuladd.f64(double %22, double %sub.i29.i20, double %mul3.i.i27)
%cmp8.i28 = fcmp olt double %34, -1.000000e-08
br i1 %cmp8.i28, label %ccw.exit35, label %if.end10.i29
if.end10.i29: ; preds = %if.end6.i26
%35 = insertelement <2 x double> %18, double %sub4.i30.i21, i64 1
%36 = fmul <2 x double> %35, %35
%37 = insertelement <2 x double> %13, double %sub.i29.i20, i64 1
%38 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %37, <2 x double> %37, <2 x double> %36)
%39 = extractelement <2 x double> %38, i64 0
%40 = extractelement <2 x double> %38, i64 1
%cmp13.i32 = fcmp olt double %39, %40
%..i33 = select i1 %cmp13.i32, i32 -2, i32 0
br label %ccw.exit35
ccw.exit35: ; preds = %ccw.exit, %if.end.i24, %if.end6.i26, %if.end10.i29
%retval.0.i34 = phi i32 [ 1, %ccw.exit ], [ -1, %if.end.i24 ], [ 2, %if.end6.i26 ], [ %..i33, %if.end10.i29 ]
%mul = mul nsw i32 %retval.0.i34, %retval.0.i
%cmp = icmp slt i32 %mul, 0
br i1 %cmp, label %land.rhs, label %land.end
land.rhs: ; preds = %ccw.exit35
%41 = insertelement <2 x double> poison, double %30, i64 0
%42 = insertelement <2 x double> %41, double %0, i64 1
%43 = insertelement <2 x double> poison, double %6, i64 0
%44 = shufflevector <2 x double> %43, <2 x double> poison, <2 x i32> zeroinitializer
%45 = fsub <2 x double> %42, %44
%46 = insertelement <2 x double> poison, double %32, i64 0
%47 = insertelement <2 x double> %46, double %2, i64 1
%48 = insertelement <2 x double> poison, double %8, i64 0
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
%50 = fsub <2 x double> %47, %49
%51 = extractelement <2 x double> %50, i64 0
%52 = fneg double %51
%53 = extractelement <2 x double> %45, i64 1
%neg.i.i40 = fmul double %53, %52
%54 = extractelement <2 x double> %45, i64 0
%55 = extractelement <2 x double> %50, i64 1
%56 = tail call double @llvm.fmuladd.f64(double %54, double %55, double %neg.i.i40)
%cmp.i41 = fcmp ogt double %56, 1.000000e-08
br i1 %cmp.i41, label %ccw.exit53, label %if.end.i42
if.end.i42: ; preds = %land.rhs
%cmp4.i43 = fcmp olt double %56, -1.000000e-08
br i1 %cmp4.i43, label %ccw.exit53, label %if.end6.i44
if.end6.i44: ; preds = %if.end.i42
%mul3.i.i45 = fmul double %55, %51
%57 = tail call double @llvm.fmuladd.f64(double %54, double %53, double %mul3.i.i45)
%cmp8.i46 = fcmp olt double %57, -1.000000e-08
br i1 %cmp8.i46, label %ccw.exit53, label %if.end10.i47
if.end10.i47: ; preds = %if.end6.i44
%58 = fmul <2 x double> %50, %50
%59 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %45, <2 x double> %45, <2 x double> %58)
%60 = extractelement <2 x double> %59, i64 0
%61 = extractelement <2 x double> %59, i64 1
%cmp13.i50 = fcmp olt double %60, %61
%..i51 = select i1 %cmp13.i50, i32 -2, i32 0
br label %ccw.exit53
ccw.exit53: ; preds = %land.rhs, %if.end.i42, %if.end6.i44, %if.end10.i47
%retval.0.i52 = phi i32 [ 1, %land.rhs ], [ -1, %if.end.i42 ], [ 2, %if.end6.i44 ], [ %..i51, %if.end10.i47 ]
%sub.i29.i56 = fsub double %3, %6
%sub4.i30.i57 = fsub double %5, %8
%neg.i.i58 = fmul double %sub.i29.i56, %52
%62 = tail call double @llvm.fmuladd.f64(double %54, double %sub4.i30.i57, double %neg.i.i58)
%cmp.i59 = fcmp ogt double %62, 1.000000e-08
br i1 %cmp.i59, label %ccw.exit71, label %if.end.i60
if.end.i60: ; preds = %ccw.exit53
%cmp4.i61 = fcmp olt double %62, -1.000000e-08
br i1 %cmp4.i61, label %ccw.exit71, label %if.end6.i62
if.end6.i62: ; preds = %if.end.i60
%mul3.i.i63 = fmul double %sub4.i30.i57, %51
%63 = tail call double @llvm.fmuladd.f64(double %54, double %sub.i29.i56, double %mul3.i.i63)
%cmp8.i64 = fcmp olt double %63, -1.000000e-08
br i1 %cmp8.i64, label %ccw.exit71, label %if.end10.i65
if.end10.i65: ; preds = %if.end6.i62
%64 = insertelement <2 x double> %50, double %sub4.i30.i57, i64 1
%65 = fmul <2 x double> %64, %64
%66 = insertelement <2 x double> %45, double %sub.i29.i56, i64 1
%67 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %66, <2 x double> %65)
%68 = extractelement <2 x double> %67, i64 0
%69 = extractelement <2 x double> %67, i64 1
%cmp13.i68 = fcmp olt double %68, %69
%..i69 = select i1 %cmp13.i68, i32 -2, i32 0
br label %ccw.exit71
ccw.exit71: ; preds = %ccw.exit53, %if.end.i60, %if.end6.i62, %if.end10.i65
%retval.0.i70 = phi i32 [ 1, %ccw.exit53 ], [ -1, %if.end.i60 ], [ 2, %if.end6.i62 ], [ %..i69, %if.end10.i65 ]
%mul16 = mul nsw i32 %retval.0.i70, %retval.0.i52
%mul16.lobit = lshr i32 %mul16, 31
br label %land.end
land.end: ; preds = %ccw.exit71, %ccw.exit35
%land.ext = phi i32 [ 0, %ccw.exit35 ], [ %mul16.lobit, %ccw.exit71 ]
ret i32 %land.ext
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @isParaLL(ptr nocapture noundef readonly byval(%struct.SEG) align 8 %s1, ptr nocapture noundef readonly byval(%struct.SEG) align 8 %s2) local_unnamed_addr #8 {
entry:
%e = getelementptr inbounds %struct.SEG, ptr %s2, i64 0, i32 1
%y = getelementptr inbounds %struct.SEG, ptr %s2, i64 0, i32 1, i32 1
%0 = load double, ptr %y, align 8, !tbaa !5
%y1 = getelementptr inbounds %struct.PP, ptr %s2, i64 0, i32 1
%1 = load double, ptr %y1, align 8, !tbaa !11
%sub = fsub double %0, %1
%e2 = getelementptr inbounds %struct.SEG, ptr %s1, i64 0, i32 1
%2 = load double, ptr %e2, align 8, !tbaa !12
%3 = load double, ptr %s1, align 8, !tbaa !13
%sub5 = fsub double %2, %3
%y7 = getelementptr inbounds %struct.SEG, ptr %s1, i64 0, i32 1, i32 1
%4 = load double, ptr %y7, align 8, !tbaa !5
%y9 = getelementptr inbounds %struct.PP, ptr %s1, i64 0, i32 1
%5 = load double, ptr %y9, align 8, !tbaa !11
%sub10 = fsub double %4, %5
%6 = load double, ptr %e, align 8, !tbaa !12
%7 = load double, ptr %s2, align 8, !tbaa !13
%sub15 = fsub double %6, %7
%8 = fneg double %sub10
%neg = fmul double %sub15, %8
%9 = tail call double @llvm.fmuladd.f64(double %sub, double %sub5, double %neg)
%10 = tail call double @llvm.fabs.f64(double %9)
%cmp = fcmp olt double %10, 1.000000e-08
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local { double, double } @crossPointLL(ptr nocapture noundef readonly byval(%struct.SEG) align 8 %ln1, ptr nocapture noundef readonly byval(%struct.SEG) align 8 %ln2) local_unnamed_addr #8 {
entry:
%e = getelementptr inbounds %struct.SEG, ptr %ln1, i64 0, i32 1
%e1 = getelementptr inbounds %struct.SEG, ptr %ln2, i64 0, i32 1
%0 = load double, ptr %e1, align 8
%1 = getelementptr inbounds %struct.SEG, ptr %ln2, i64 0, i32 1, i32 1
%2 = load double, ptr %1, align 8
%3 = load double, ptr %ln2, align 8
%4 = getelementptr inbounds { double, double }, ptr %ln2, i64 0, i32 1
%5 = load double, ptr %4, align 8
%sub.i17 = fsub double %0, %3
%sub4.i18 = fsub double %2, %5
%6 = fneg double %sub4.i18
%7 = load <2 x double>, ptr %e, align 8
%8 = load <2 x double>, ptr %ln1, align 8
%9 = fsub <2 x double> %7, %8
%10 = extractelement <2 x double> %8, i64 0
%sub.i21 = fsub double %3, %10
%11 = extractelement <2 x double> %8, i64 1
%sub4.i22 = fsub double %5, %11
%12 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> <i32 poison, i32 0>
%13 = insertelement <2 x double> %12, double %sub.i21, i64 0
%14 = insertelement <2 x double> poison, double %6, i64 0
%15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> zeroinitializer
%16 = fmul <2 x double> %13, %15
%17 = insertelement <2 x double> poison, double %sub.i17, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = insertelement <2 x double> %9, double %sub4.i22, i64 0
%20 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %19, <2 x double> %16)
%21 = extractelement <2 x double> %20, i64 0
%22 = extractelement <2 x double> %20, i64 1
%div = fdiv double %21, %22
%23 = insertelement <2 x double> poison, double %div, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = fmul <2 x double> %9, %24
%26 = fadd <2 x double> %8, %25
%27 = extractelement <2 x double> %26, i64 0
%.fca.0.insert.i28 = insertvalue { double, double } poison, double %27, 0
%28 = extractelement <2 x double> %26, i64 1
%.fca.1.insert.i29 = insertvalue { double, double } %.fca.0.insert.i28, double %28, 1
ret { double, double } %.fca.1.insert.i29
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ppOnSeg(double %p.coerce0, double %p.coerce1, ptr nocapture noundef readonly byval(%struct.SEG) align 8 %s) local_unnamed_addr #8 {
entry:
%0 = load double, ptr %s, align 8, !tbaa !13
%y = getelementptr inbounds %struct.PP, ptr %s, i64 0, i32 1
%1 = load double, ptr %y, align 8, !tbaa !11
%e = getelementptr inbounds %struct.SEG, ptr %s, i64 0, i32 1
%2 = load double, ptr %e, align 8, !tbaa !12
%y5 = getelementptr inbounds %struct.SEG, ptr %s, i64 0, i32 1, i32 1
%3 = load double, ptr %y5, align 8, !tbaa !5
%cmp = fcmp ult double %0, %2
br i1 %cmp, label %if.end, label %if.then
if.then: ; preds = %entry
br label %if.end
if.end: ; preds = %if.then, %entry
%y1.0 = phi double [ %3, %if.then ], [ %1, %entry ]
%x2.0 = phi double [ %0, %if.then ], [ %2, %entry ]
%y2.0 = phi double [ %1, %if.then ], [ %3, %entry ]
%x1.0 = phi double [ %2, %if.then ], [ %0, %entry ]
%cmp7 = fcmp ugt double %x1.0, %p.coerce0
%cmp9 = fcmp ult double %x2.0, %p.coerce0
%or.cond = or i1 %cmp9, %cmp7
br i1 %or.cond, label %land.end, label %land.lhs.true10
land.lhs.true10: ; preds = %if.end
%cmp11 = fcmp ugt double %y1.0, %y2.0
%cmp14 = fcmp ugt double %y1.0, %p.coerce1
%or.cond59 = select i1 %cmp11, i1 true, i1 %cmp14
%cmp17 = fcmp ult double %y2.0, %p.coerce1
%or.cond60 = select i1 %or.cond59, i1 true, i1 %cmp17
br i1 %or.cond60, label %lor.lhs.false, label %land.rhs
lor.lhs.false: ; preds = %land.lhs.true10
%cmp18 = fcmp ule double %y1.0, %y2.0
%cmp21 = fcmp ugt double %y2.0, %p.coerce1
%or.cond61 = select i1 %cmp18, i1 true, i1 %cmp21
%cmp24 = fcmp ult double %y1.0, %p.coerce1
%or.cond62 = select i1 %or.cond61, i1 true, i1 %cmp24
br i1 %or.cond62, label %land.end, label %land.rhs
land.rhs: ; preds = %lor.lhs.false, %land.lhs.true10
%sub = fsub double %p.coerce1, %y1.0
%sub26 = fsub double %x2.0, %x1.0
%sub27 = fsub double %y2.0, %y1.0
%sub29 = fsub double %p.coerce0, %x1.0
%4 = fneg double %sub27
%neg = fmul double %sub29, %4
%5 = tail call double @llvm.fmuladd.f64(double %sub, double %sub26, double %neg)
%6 = tail call double @llvm.fabs.f64(double %5)
%cmp31 = fcmp olt double %6, 1.000000e-08
%7 = zext i1 %cmp31 to i32
br label %land.end
land.end: ; preds = %land.rhs, %lor.lhs.false, %if.end
%land.ext = phi i32 [ 0, %lor.lhs.false ], [ 0, %if.end ], [ %7, %land.rhs ]
ret i32 %land.ext
}
; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @visible(double %q.coerce0, double %q.coerce1, ptr nocapture noundef readonly byval(%struct.SEG) align 8 %s) local_unnamed_addr #9 {
entry:
%t = alloca %struct.SEG, align 8
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %t) #17
%e = getelementptr inbounds %struct.SEG, ptr %s, i64 0, i32 1
%0 = load <2 x double>, ptr %s, align 8
%1 = load <2 x double>, ptr %e, align 8
%2 = extractelement <2 x double> %0, i64 0
%3 = fsub <2 x double> %1, %0
%sub.i.i = extractelement <2 x double> %3, i64 0
%4 = extractelement <2 x double> %0, i64 1
%5 = fsub <2 x double> %1, %0
%sub4.i.i = extractelement <2 x double> %5, i64 1
%sub.i29.i = fsub double %q.coerce0, %2
%sub4.i30.i = fsub double %q.coerce1, %4
%6 = fneg double %sub4.i.i
%neg.i.i = fmul double %sub.i29.i, %6
%7 = tail call double @llvm.fmuladd.f64(double %sub.i.i, double %sub4.i30.i, double %neg.i.i)
%cmp.i = fcmp ule double %7, 1.000000e-08
%cmp4.i = fcmp olt double %7, -1.000000e-08
%or.cond = and i1 %cmp.i, %cmp4.i
br i1 %or.cond, label %cleanup, label %if.end
if.end: ; preds = %entry
store double %q.coerce0, ptr %t, align 8, !tbaa.struct !14
%q.sroa.3.0.s2.sroa_idx = getelementptr inbounds i8, ptr %t, i64 8
store double %q.coerce1, ptr %q.sroa.3.0.s2.sroa_idx, align 8, !tbaa.struct !16
%8 = fadd <2 x double> %0, %1
%e6 = getelementptr inbounds %struct.SEG, ptr %t, i64 0, i32 1
%9 = fmul <2 x double> %8, <double 5.000000e-01, double 5.000000e-01>
store <2 x double> %9, ptr %e6, align 8, !tbaa !15
%10 = load i32, ptr @N, align 4, !tbaa !17
%cmp1524 = icmp sgt i32 %10, 0
br i1 %cmp1524, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %if.end
%wide.trip.count = zext i32 %10 to i64
br label %for.body
for.cond: ; preds = %for.body
%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 %cleanup, label %for.body, !llvm.loop !19
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv
%call16 = tail call i32 @intersectSS(ptr noundef nonnull byval(%struct.SEG) align 8 %t, ptr noundef nonnull byval(%struct.SEG) align 8 %arrayidx), !range !21
%tobool.not = icmp eq i32 %call16, 0
br i1 %tobool.not, label %for.cond, label %cleanup
cleanup: ; preds = %for.body, %for.cond, %if.end, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 1, %if.end ], [ 0, %for.body ], [ 1, %for.cond ]
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %t) #17
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @update(i32 noundef %id, double %p.coerce0, double %p.coerce1) local_unnamed_addr #10 {
entry:
%idxprom = sext i32 %id to i64
%arrayidx = getelementptr inbounds [20 x i32], ptr @hi, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !17
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%arrayidx2 = getelementptr inbounds [20 x %struct.T], ptr @tbl, i64 0, i64 %idxprom
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%arrayidx5 = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx2, i64 0, i64 %indvars.iv
%1 = load double, ptr %arrayidx5, align 16, !tbaa !22
%sub = fsub double %p.coerce0, %1
%2 = tail call double @llvm.fabs.f64(double %sub)
%cmp7 = fcmp olt double %2, 1.000000e-08
br i1 %cmp7, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%y13 = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx2, i64 0, i64 %indvars.iv, i32 1
%3 = load double, ptr %y13, align 8, !tbaa !23
%sub14 = fsub double %p.coerce1, %3
%4 = tail call double @llvm.fabs.f64(double %sub14)
%cmp15 = fcmp olt double %4, 1.000000e-08
br i1 %cmp15, label %cleanup, label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true
%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 !24
for.end: ; preds = %for.inc, %entry
%arrayidx17 = getelementptr inbounds [20 x %struct.T], ptr @tbl, i64 0, i64 %idxprom
%inc21 = add nsw i32 %0, 1
store i32 %inc21, ptr %arrayidx, align 4, !tbaa !17
%idxprom22 = sext i32 %0 to i64
%arrayidx23 = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx17, i64 0, i64 %idxprom22
store double %p.coerce0, ptr %arrayidx23, align 16, !tbaa.struct !14
%p.sroa.3.0.arrayidx23.sroa_idx = getelementptr inbounds i8, ptr %arrayidx23, i64 8
store double %p.coerce1, ptr %p.sroa.3.0.arrayidx23.sroa_idx, align 8, !tbaa.struct !16
br label %cleanup
cleanup: ; preds = %land.lhs.true, %for.end
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 {
entry:
%0 = load double, ptr %a, align 8
%1 = getelementptr inbounds { double, double }, ptr %a, i64 0, i32 1
%2 = load double, ptr %1, align 8
%3 = load double, ptr @org, align 8
%4 = load double, ptr getelementptr inbounds (%struct.PP, ptr @org, i64 0, i32 1), align 8
%sub.i = fsub double %0, %3
%sub3.i = fsub double %2, %4
%call.i = tail call double @hypot(double noundef %sub.i, double noundef %sub3.i) #17
%5 = load double, ptr %b, align 8
%6 = getelementptr inbounds { double, double }, ptr %b, i64 0, i32 1
%7 = load double, ptr %6, align 8
%8 = load double, ptr @org, align 8
%9 = load double, ptr getelementptr inbounds (%struct.PP, ptr @org, i64 0, i32 1), align 8
%sub.i7 = fsub double %5, %8
%sub3.i8 = fsub double %7, %9
%call.i9 = tail call double @hypot(double noundef %sub.i7, double noundef %sub3.i8) #17
%sub = fsub double %call.i, %call.i9
%10 = tail call double @llvm.fabs.f64(double %sub)
%cmp = fcmp olt double %10, 1.000000e-08
%cmp3 = fcmp ugt double %sub, 0.000000e+00
%. = select i1 %cmp3, i32 1, i32 -1
%retval.0 = select i1 %cmp, i32 0, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @bitcount(i32 noundef %bits) local_unnamed_addr #0 {
entry:
%and = and i32 %bits, 1431655765
%shr = lshr i32 %bits, 1
%and1 = and i32 %shr, 1431655765
%add = add nuw nsw i32 %and1, %and
%and2 = and i32 %add, 858993459
%shr3 = lshr i32 %add, 2
%and4 = and i32 %shr3, 322122547
%add5 = add nuw nsw i32 %and4, %and2
%and6 = and i32 %add5, 117901063
%shr7 = lshr i32 %add5, 4
%and8 = and i32 %shr7, 117901063
%add9 = add nuw nsw i32 %and8, %and6
%and10 = and i32 %add9, 983055
%shr11 = lshr i32 %add9, 8
%and12 = and i32 %shr11, 983055
%add13 = add nuw nsw i32 %and12, %and10
%and14 = and i32 %add13, 31
%shr15 = lshr i32 %add13, 16
%add17 = add nuw nsw i32 %and14, %shr15
ret i32 %add17
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
%call449 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%0 = load i32, ptr @N, align 4, !tbaa !17
%tobool.not450 = icmp eq i32 %0, 0
br i1 %tobool.not450, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end259
%1 = phi i32 [ %129, %for.end259 ], [ %0, %entry ]
%notmask = shl nsw i32 -1, %1
%sub = xor i32 %notmask, -1
store i32 %sub, ptr @mask, align 4, !tbaa !17
%cmp379 = icmp sgt i32 %1, 0
br i1 %cmp379, label %for.body, label %for.end.thread
for.end.thread: ; preds = %while.body
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) @hi, i8 0, i64 80, i1 false)
br label %for.end165
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #17
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #17
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%2 = load i32, ptr %x, align 4, !tbaa !17
%conv = sitofp i32 %2 to double
%arrayidx = getelementptr inbounds [20 x %struct.PP], ptr @pp, i64 0, i64 %indvars.iv
store double %conv, ptr %arrayidx, align 16, !tbaa !22
%3 = load i32, ptr %y, align 4, !tbaa !17
%conv3 = sitofp i32 %3 to double
%y6 = getelementptr inbounds [20 x %struct.PP], ptr @pp, i64 0, i64 %indvars.iv, i32 1
store double %conv3, ptr %y6, align 8, !tbaa !23
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #17
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #17
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr @N, align 4, !tbaa !17
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !25
for.end: ; preds = %for.body
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) @hi, i8 0, i64 80, i1 false)
%cmp8381 = icmp sgt i32 %4, 0
br i1 %cmp8381, label %for.body10.preheader, label %for.end165
for.body10.preheader: ; preds = %for.end
%6 = zext i32 %4 to i64
br label %for.body10
for.cond44.preheader: ; preds = %for.body10
br i1 %cmp8381, label %for.body47.preheader, label %for.end154
for.body47.preheader: ; preds = %for.cond44.preheader
%wide.trip.count471 = zext i32 %4 to i64
br label %for.body47
for.body10: ; preds = %for.body10.preheader, %for.body10
%indvars.iv455 = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next456, %for.body10 ]
%arrayidx12 = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv455
%arrayidx15 = getelementptr inbounds [20 x %struct.PP], ptr @pp, i64 0, i64 %indvars.iv455
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx12, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx15, i64 16, i1 false), !tbaa.struct !14
%e = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv455, i32 1
%indvars.iv.next456 = add nuw nsw i64 %indvars.iv455, 1
%7 = icmp eq i64 %indvars.iv.next456, %6
%8 = and i64 %indvars.iv.next456, 4294967295
%idxprom18 = select i1 %7, i64 0, i64 %8
%arrayidx19 = getelementptr inbounds [20 x %struct.PP], ptr @pp, i64 0, i64 %idxprom18
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %e, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19, i64 16, i1 false), !tbaa.struct !14
%arrayidx21 = getelementptr inbounds [20 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv455
%arrayidx23 = getelementptr inbounds [20 x i32], ptr @hi, i64 0, i64 %indvars.iv455
%9 = load i32, ptr %arrayidx23, align 4, !tbaa !17
%inc24 = add nsw i32 %9, 1
%idxprom25 = sext i32 %9 to i64
%arrayidx26 = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx21, i64 0, i64 %idxprom25
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx26, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx15, i64 16, i1 false)
%inc35 = add nsw i32 %9, 2
store i32 %inc35, ptr %arrayidx23, align 4, !tbaa !17
%idxprom36 = sext i32 %inc24 to i64
%arrayidx37 = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx21, i64 0, i64 %idxprom36
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx37, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19, i64 16, i1 false)
%exitcond.not = icmp eq i64 %indvars.iv.next456, %6
br i1 %exitcond.not, label %for.cond44.preheader, label %for.body10, !llvm.loop !26
for.cond138.preheader: ; preds = %for.inc135
br i1 %cmp8381, label %for.body141, label %for.end154
for.body47: ; preds = %for.body47.preheader, %for.inc135
%indvars.iv468 = phi i64 [ 0, %for.body47.preheader ], [ %indvars.iv.next469, %for.inc135 ]
%arrayidx49 = getelementptr inbounds [20 x %struct.PP], ptr @pp, i64 0, i64 %indvars.iv468
%10 = load <2 x double>, ptr %arrayidx49, align 16, !tbaa !15
%11 = extractelement <2 x double> %10, i64 0
%12 = extractelement <2 x double> %10, i64 1
br label %for.body61.us
for.body61.us: ; preds = %for.inc132.us, %for.body47
%indvars.iv463 = phi i64 [ %indvars.iv.next464, %for.inc132.us ], [ 0, %for.body47 ]
%cmp62.not.us = icmp eq i64 %indvars.iv468, %indvars.iv463
br i1 %cmp62.not.us, label %for.inc132.us, label %if.then.us
if.then.us: ; preds = %for.body61.us
%arrayidx65.us = getelementptr inbounds [20 x %struct.PP], ptr @pp, i64 0, i64 %indvars.iv463
%13 = load <2 x double>, ptr %arrayidx65.us, align 16, !tbaa !15
%14 = fsub <2 x double> %13, %10
%15 = extractelement <2 x double> %14, i64 1
%16 = fneg double %15
%17 = extractelement <2 x double> %14, i64 0
%18 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> <i32 poison, i32 0>
br label %for.body77.us
for.body77.us: ; preds = %if.then.us, %for.inc128.us
%indvars.iv458 = phi i64 [ 0, %if.then.us ], [ %indvars.iv.next459, %for.inc128.us ]
%arrayidx79.us = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv458
%e.i.us = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv458, i32 1
%y.i.us = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv458, i32 1, i32 1
%19 = load double, ptr %y.i.us, align 8
%y1.i.us = getelementptr inbounds %struct.PP, ptr %arrayidx79.us, i64 0, i32 1
%20 = load double, ptr %y1.i.us, align 8
%sub.i.us = fsub double %19, %20
%21 = load double, ptr %e.i.us, align 16
%22 = load double, ptr %arrayidx79.us, align 16
%sub15.i.us = fsub double %21, %22
%neg.i.us = fmul double %sub15.i.us, %16
%23 = call double @llvm.fmuladd.f64(double %sub.i.us, double %17, double %neg.i.us)
%24 = call double @llvm.fabs.f64(double %23)
%cmp.i.us = fcmp uge double %24, 1.000000e-08
br i1 %cmp.i.us, label %if.then82.us, label %for.inc128.us
if.then82.us: ; preds = %for.body77.us
%sub.i21.i.us = fsub double %22, %11
%sub4.i22.i.us = fsub double %20, %12
%25 = fneg double %sub.i.us
%26 = insertelement <2 x double> %18, double %sub.i21.i.us, i64 0
%27 = insertelement <2 x double> poison, double %25, i64 0
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
%29 = fmul <2 x double> %26, %28
%30 = insertelement <2 x double> poison, double %sub15.i.us, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = insertelement <2 x double> %14, double %sub4.i22.i.us, i64 0
%33 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %31, <2 x double> %32, <2 x double> %29)
%34 = extractelement <2 x double> %33, i64 0
%35 = extractelement <2 x double> %33, i64 1
%div.i.us = fdiv double %34, %35
%36 = insertelement <2 x double> poison, double %div.i.us, i64 0
%37 = shufflevector <2 x double> %36, <2 x double> poison, <2 x i32> zeroinitializer
%38 = fmul <2 x double> %14, %37
%39 = fadd <2 x double> %10, %38
%40 = extractelement <2 x double> %39, i64 0
%sub91.us = fsub double %40, %22
%41 = call double @llvm.fabs.f64(double %sub91.us)
%cmp92.us = fcmp olt double %41, 1.000000e-08
br i1 %cmp92.us, label %land.lhs.true.us, label %land.lhs.true102.us
land.lhs.true.us: ; preds = %if.then82.us
%42 = extractelement <2 x double> %39, i64 1
%sub99.us = fsub double %42, %20
%43 = call double @llvm.fabs.f64(double %sub99.us)
%cmp100.us = fcmp olt double %43, 1.000000e-08
br i1 %cmp100.us, label %for.inc128.us, label %land.lhs.true102.us
land.lhs.true102.us: ; preds = %land.lhs.true.us, %if.then82.us
%sub108.us = fsub double %40, %21
%44 = call double @llvm.fabs.f64(double %sub108.us)
%cmp109.us = fcmp olt double %44, 1.000000e-08
br i1 %cmp109.us, label %land.lhs.true111.us, label %if.then120.us
land.lhs.true111.us: ; preds = %land.lhs.true102.us
%45 = extractelement <2 x double> %39, i64 1
%sub117.us = fsub double %45, %19
%46 = call double @llvm.fabs.f64(double %sub117.us)
%cmp118.us = fcmp olt double %46, 1.000000e-08
br i1 %cmp118.us, label %for.inc128.us, label %if.then120.us
if.then120.us: ; preds = %land.lhs.true111.us, %land.lhs.true102.us
%cmp.i338.us = fcmp ult double %22, %21
br i1 %cmp.i338.us, label %if.end.i.us, label %if.then.i.us
if.then.i.us: ; preds = %if.then120.us
br label %if.end.i.us
if.end.i.us: ; preds = %if.then.i.us, %if.then120.us
%y1.0.i.us = phi double [ %19, %if.then.i.us ], [ %20, %if.then120.us ]
%x2.0.i.us = phi double [ %22, %if.then.i.us ], [ %21, %if.then120.us ]
%y2.0.i.us = phi double [ %20, %if.then.i.us ], [ %19, %if.then120.us ]
%x1.0.i.us = phi double [ %21, %if.then.i.us ], [ %22, %if.then120.us ]
%cmp7.i.us = fcmp ugt double %x1.0.i.us, %40
%cmp9.i.us = fcmp ult double %x2.0.i.us, %40
%or.cond.i.us = or i1 %cmp9.i.us, %cmp7.i.us
br i1 %or.cond.i.us, label %for.inc128.us, label %land.lhs.true10.i.us
land.lhs.true10.i.us: ; preds = %if.end.i.us
%cmp11.i.us = fcmp ugt double %y1.0.i.us, %y2.0.i.us
%47 = extractelement <2 x double> %39, i64 1
%cmp14.i.us = fcmp ugt double %y1.0.i.us, %47
%or.cond59.i.us = select i1 %cmp11.i.us, i1 true, i1 %cmp14.i.us
%cmp17.i.us = fcmp ult double %y2.0.i.us, %47
%or.cond60.i.us = select i1 %or.cond59.i.us, i1 true, i1 %cmp17.i.us
br i1 %or.cond60.i.us, label %lor.lhs.false.i.us, label %ppOnSeg.exit.us
lor.lhs.false.i.us: ; preds = %land.lhs.true10.i.us
%cmp18.i.us = fcmp ule double %y1.0.i.us, %y2.0.i.us
%cmp21.i.us = fcmp ugt double %y2.0.i.us, %47
%or.cond61.i.us = select i1 %cmp18.i.us, i1 true, i1 %cmp21.i.us
%cmp24.i.us = fcmp ult double %y1.0.i.us, %47
%or.cond62.i.us = select i1 %or.cond61.i.us, i1 true, i1 %cmp24.i.us
br i1 %or.cond62.i.us, label %for.inc128.us, label %ppOnSeg.exit.us
ppOnSeg.exit.us: ; preds = %lor.lhs.false.i.us, %land.lhs.true10.i.us
%sub.i339.us = fsub double %47, %y1.0.i.us
%sub26.i.us = fsub double %x2.0.i.us, %x1.0.i.us
%sub27.i.us = fsub double %y2.0.i.us, %y1.0.i.us
%sub29.i.us = fsub double %40, %x1.0.i.us
%48 = fneg double %sub27.i.us
%neg.i340.us = fmul double %sub29.i.us, %48
%49 = call double @llvm.fmuladd.f64(double %sub.i339.us, double %sub26.i.us, double %neg.i340.us)
%50 = call double @llvm.fabs.f64(double %49)
%cmp31.i.us = fcmp uge double %50, 1.000000e-08
br i1 %cmp31.i.us, label %for.inc128.us, label %if.then125.us
if.then125.us: ; preds = %ppOnSeg.exit.us
%arrayidx.i.us = getelementptr inbounds [20 x i32], ptr @hi, i64 0, i64 %indvars.iv458
%51 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !17
%cmp34.i.us = icmp sgt i32 %51, 0
br i1 %cmp34.i.us, label %for.body.lr.ph.i.us, label %for.end.i.us
for.body.lr.ph.i.us: ; preds = %if.then125.us
%arrayidx2.i.us = getelementptr inbounds [20 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv458
%wide.trip.count.i.us = zext i32 %51 to i64
br label %for.body.i.us
for.body.i.us: ; preds = %for.inc.i.us, %for.body.lr.ph.i.us
%indvars.iv.i.us = phi i64 [ 0, %for.body.lr.ph.i.us ], [ %indvars.iv.next.i.us, %for.inc.i.us ]
%arrayidx5.i.us = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx2.i.us, i64 0, i64 %indvars.iv.i.us
%52 = load double, ptr %arrayidx5.i.us, align 16, !tbaa !22
%sub.i341.us = fsub double %40, %52
%53 = call double @llvm.fabs.f64(double %sub.i341.us)
%cmp7.i342.us = fcmp olt double %53, 1.000000e-08
br i1 %cmp7.i342.us, label %land.lhs.true.i.us, label %for.inc.i.us
land.lhs.true.i.us: ; preds = %for.body.i.us
%y13.i.us = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx2.i.us, i64 0, i64 %indvars.iv.i.us, i32 1
%54 = load double, ptr %y13.i.us, align 8, !tbaa !23
%sub14.i.us = fsub double %47, %54
%55 = call double @llvm.fabs.f64(double %sub14.i.us)
%cmp15.i.us = fcmp olt double %55, 1.000000e-08
br i1 %cmp15.i.us, label %for.inc128.us, label %for.inc.i.us
for.inc.i.us: ; preds = %land.lhs.true.i.us, %for.body.i.us
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i.us
br i1 %exitcond.not.i.us, label %for.end.i.us, label %for.body.i.us, !llvm.loop !24
for.end.i.us: ; preds = %for.inc.i.us, %if.then125.us
%arrayidx17.i.us = getelementptr inbounds [20 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv458
%inc21.i.us = add nsw i32 %51, 1
store i32 %inc21.i.us, ptr %arrayidx.i.us, align 4, !tbaa !17
%idxprom22.i.us = sext i32 %51 to i64
%arrayidx23.i.us = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx17.i.us, i64 0, i64 %idxprom22.i.us
store <2 x double> %39, ptr %arrayidx23.i.us, align 16
br label %for.inc128.us
for.inc128.us: ; preds = %land.lhs.true.i.us, %for.end.i.us, %ppOnSeg.exit.us, %lor.lhs.false.i.us, %if.end.i.us, %land.lhs.true111.us, %land.lhs.true.us, %for.body77.us
%indvars.iv.next459 = add nuw nsw i64 %indvars.iv458, 1
%exitcond462.not = icmp eq i64 %indvars.iv.next459, %wide.trip.count471
br i1 %exitcond462.not, label %for.inc132.us, label %for.body77.us, !llvm.loop !27
for.inc132.us: ; preds = %for.inc128.us, %for.body61.us
%indvars.iv.next464 = add nuw nsw i64 %indvars.iv463, 1
%exitcond467.not = icmp eq i64 %indvars.iv.next464, %wide.trip.count471
br i1 %exitcond467.not, label %for.inc135, label %for.body61.us, !llvm.loop !28
for.inc135: ; preds = %for.inc132.us
%indvars.iv.next469 = add nuw nsw i64 %indvars.iv468, 1
%exitcond472.not = icmp eq i64 %indvars.iv.next469, %wide.trip.count471
br i1 %exitcond472.not, label %for.cond138.preheader, label %for.body47, !llvm.loop !29
for.body141: ; preds = %for.cond138.preheader, %for.body141
%indvars.iv473 = phi i64 [ %indvars.iv.next474, %for.body141 ], [ 0, %for.cond138.preheader ]
%arrayidx143 = getelementptr inbounds [20 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv473
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) @org, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx143, i64 16, i1 false), !tbaa.struct !14
%arrayidx150 = getelementptr inbounds [20 x i32], ptr @hi, i64 0, i64 %indvars.iv473
%56 = load i32, ptr %arrayidx150, align 4, !tbaa !17
%conv151 = sext i32 %56 to i64
call void @qsort(ptr noundef nonnull %arrayidx143, i64 noundef %conv151, i64 noundef 16, ptr noundef nonnull @cmp) #17
%indvars.iv.next474 = add nuw nsw i64 %indvars.iv473, 1
%57 = load i32, ptr @N, align 4, !tbaa !17
%58 = sext i32 %57 to i64
%cmp139 = icmp slt i64 %indvars.iv.next474, %58
br i1 %cmp139, label %for.body141, label %for.end154, !llvm.loop !30
for.end154: ; preds = %for.body141, %for.cond44.preheader, %for.cond138.preheader
%59 = phi i32 [ %4, %for.cond138.preheader ], [ %4, %for.cond44.preheader ], [ %57, %for.body141 ]
%cmp156393 = icmp sgt i32 %59, 0
br i1 %cmp156393, label %for.body158.preheader, label %for.end165
for.body158.preheader: ; preds = %for.end154
%wide.trip.count479 = zext i32 %59 to i64
%min.iters.check = icmp ult i32 %59, 8
br i1 %min.iters.check, label %for.body158.preheader525, label %vector.ph
vector.ph: ; preds = %for.body158.preheader
%n.vec = and i64 %wide.trip.count479, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %64, %vector.body ]
%vec.phi523 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %65, %vector.body ]
%60 = getelementptr inbounds [20 x i32], ptr @hi, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %60, align 16, !tbaa !17
%61 = getelementptr inbounds i32, ptr %60, i64 4
%wide.load524 = load <4 x i32>, ptr %61, align 16, !tbaa !17
%62 = add nsw <4 x i32> %wide.load, <i32 -1, i32 -1, i32 -1, i32 -1>
%63 = add nsw <4 x i32> %wide.load524, <i32 -1, i32 -1, i32 -1, i32 -1>
%64 = add <4 x i32> %62, %vec.phi
%65 = add <4 x i32> %63, %vec.phi523
%index.next = add nuw i64 %index, 8
%66 = icmp eq i64 %index.next, %n.vec
br i1 %66, label %middle.block, label %vector.body, !llvm.loop !31
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %65, %64
%67 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count479
br i1 %cmp.n, label %for.end165, label %for.body158.preheader525
for.body158.preheader525: ; preds = %for.body158.preheader, %middle.block
%indvars.iv476.ph = phi i64 [ 0, %for.body158.preheader ], [ %n.vec, %middle.block ]
%add162392394.ph = phi i32 [ 0, %for.body158.preheader ], [ %67, %middle.block ]
br label %for.body158
for.body158: ; preds = %for.body158.preheader525, %for.body158
%indvars.iv476 = phi i64 [ %indvars.iv.next477, %for.body158 ], [ %indvars.iv476.ph, %for.body158.preheader525 ]
%add162392394 = phi i32 [ %add162, %for.body158 ], [ %add162392394.ph, %for.body158.preheader525 ]
%arrayidx160 = getelementptr inbounds [20 x i32], ptr @hi, i64 0, i64 %indvars.iv476
%68 = load i32, ptr %arrayidx160, align 4, !tbaa !17
%sub161 = add nsw i32 %68, -1
%add162 = add nsw i32 %sub161, %add162392394
%indvars.iv.next477 = add nuw nsw i64 %indvars.iv476, 1
%exitcond480.not = icmp eq i64 %indvars.iv.next477, %wide.trip.count479
br i1 %exitcond480.not, label %for.end165, label %for.body158, !llvm.loop !34
for.end165: ; preds = %for.body158, %middle.block, %for.end.thread, %for.end, %for.end154
%cmp156393520 = phi i1 [ false, %for.end154 ], [ false, %for.end ], [ false, %for.end.thread ], [ %cmp156393, %middle.block ], [ %cmp156393, %for.body158 ]
%69 = phi i32 [ %59, %for.end154 ], [ %4, %for.end ], [ %1, %for.end.thread ], [ %59, %middle.block ], [ %59, %for.body158 ]
%70 = phi i32 [ 0, %for.end154 ], [ 0, %for.end ], [ 0, %for.end.thread ], [ %67, %middle.block ], [ %add162, %for.body158 ]
%conv166 = sext i32 %70 to i64
%mul = shl nsw i64 %conv166, 5
%call167 = call noalias ptr @malloc(i64 noundef %mul) #18
store ptr %call167, ptr @cut, align 8, !tbaa !35
%mul169 = shl nsw i64 %conv166, 2
%call170 = call noalias ptr @malloc(i64 noundef %mul169) #18
store ptr %call170, ptr @flg, align 8, !tbaa !35
store i32 0, ptr @sz, align 4, !tbaa !17
br i1 %cmp156393520, label %for.cond175.preheader.preheader, label %for.cond233.preheader
for.cond175.preheader.preheader: ; preds = %for.end165
%wide.trip.count493 = zext i32 %69 to i64
br label %for.cond175.preheader
for.cond175.preheader: ; preds = %for.cond175.preheader.preheader, %for.inc203
%indvars.iv490 = phi i64 [ 0, %for.cond175.preheader.preheader ], [ %indvars.iv.next491, %for.inc203 ]
%inc190.lcssa403405 = phi i32 [ 0, %for.cond175.preheader.preheader ], [ %inc190.lcssa402, %for.inc203 ]
%arrayidx177 = getelementptr inbounds [20 x i32], ptr @hi, i64 0, i64 %indvars.iv490
%71 = load i32, ptr %arrayidx177, align 4, !tbaa !17
%cmp179398 = icmp sgt i32 %71, 1
br i1 %cmp179398, label %for.body181.lr.ph, label %for.inc203
for.body181.lr.ph: ; preds = %for.cond175.preheader
%sub178 = add nsw i32 %71, -1
%arrayidx186 = getelementptr inbounds [20 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv490
%72 = sext i32 %inc190.lcssa403405 to i64
%wide.trip.count488 = zext i32 %sub178 to i64
br label %for.body181
for.body181: ; preds = %for.body181.lr.ph, %for.body181
%indvars.iv483 = phi i64 [ %72, %for.body181.lr.ph ], [ %indvars.iv.next484, %for.body181 ]
%indvars.iv481 = phi i64 [ 0, %for.body181.lr.ph ], [ %indvars.iv.next482, %for.body181 ]
%arrayidx183 = getelementptr inbounds %struct.SEG, ptr %call167, i64 %indvars.iv483
%arrayidx189 = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx186, i64 0, i64 %indvars.iv481
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx183, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx189, i64 16, i1 false), !tbaa.struct !14
%indvars.iv.next484 = add nsw i64 %indvars.iv483, 1
%e193 = getelementptr inbounds %struct.SEG, ptr %call167, i64 %indvars.iv483, i32 1
%indvars.iv.next482 = add nuw nsw i64 %indvars.iv481, 1
%arrayidx199 = getelementptr inbounds [200 x %struct.PP], ptr %arrayidx186, i64 0, i64 %indvars.iv.next482
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %e193, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx199, i64 16, i1 false), !tbaa.struct !14
%exitcond489.not = icmp eq i64 %indvars.iv.next482, %wide.trip.count488
br i1 %exitcond489.not, label %for.cond175.for.inc203_crit_edge, label %for.body181, !llvm.loop !37
for.cond175.for.inc203_crit_edge: ; preds = %for.body181
%73 = trunc i64 %indvars.iv.next484 to i32
store i32 %73, ptr @sz, align 4, !tbaa !17
br label %for.inc203
for.inc203: ; preds = %for.cond175.for.inc203_crit_edge, %for.cond175.preheader
%inc190.lcssa402 = phi i32 [ %73, %for.cond175.for.inc203_crit_edge ], [ %inc190.lcssa403405, %for.cond175.preheader ]
%indvars.iv.next491 = add nuw nsw i64 %indvars.iv490, 1
%exitcond494.not = icmp eq i64 %indvars.iv.next491, %wide.trip.count493
br i1 %exitcond494.not, label %for.end205, label %for.cond175.preheader, !llvm.loop !38
for.end205: ; preds = %for.inc203
%conv206 = sext i32 %inc190.lcssa402 to i64
%mul207 = shl nsw i64 %conv206, 2
call void @llvm.memset.p0.i64(ptr align 4 %call170, i8 -1, i64 %mul207, i1 false)
br i1 %cmp156393520, label %for.cond212.preheader.lr.ph, label %for.cond233.preheader
for.cond212.preheader.lr.ph: ; preds = %for.end205
%cmp213407 = icmp sgt i32 %inc190.lcssa402, 0
%wide.trip.count.i348 = zext i32 %69 to i64
br i1 %cmp213407, label %for.cond212.preheader.us.preheader, label %for.cond233.preheader
for.cond212.preheader.us.preheader: ; preds = %for.cond212.preheader.lr.ph
%wide.trip.count498 = zext i32 %inc190.lcssa402 to i64
br label %for.cond212.preheader.us
for.cond212.preheader.us: ; preds = %for.cond212.preheader.us.preheader, %for.cond212.for.inc230_crit_edge.split.us.us
%indvars.iv500 = phi i64 [ 0, %for.cond212.preheader.us.preheader ], [ %indvars.iv.next501, %for.cond212.for.inc230_crit_edge.split.us.us ]
%arrayidx217.us = getelementptr inbounds [20 x %struct.PP], ptr @pp, i64 0, i64 %indvars.iv500
%74 = load double, ptr %arrayidx217.us, align 16
%75 = getelementptr inbounds { double, double }, ptr %arrayidx217.us, i64 0, i32 1
%76 = load double, ptr %75, align 8
%77 = trunc i64 %indvars.iv500 to i32
%shl223.us = shl nuw i32 1, %77
%not.us = xor i32 %shl223.us, -1
br label %for.body215.us.us
for.body215.us.us: ; preds = %for.inc227.us.us, %for.cond212.preheader.us
%indvars.iv495 = phi i64 [ %indvars.iv.next496, %for.inc227.us.us ], [ 0, %for.cond212.preheader.us ]
%arrayidx219.us.us = getelementptr inbounds %struct.SEG, ptr %call167, i64 %indvars.iv495
%arrayidx219343.sroa.0.0.copyload.us.us = load double, ptr %arrayidx219.us.us, align 1
%arrayidx219343.sroa.4.0.arrayidx219.sroa_idx.us.us = getelementptr inbounds i8, ptr %arrayidx219.us.us, i64 8
%arrayidx219343.sroa.4.0.copyload.us.us = load double, ptr %arrayidx219343.sroa.4.0.arrayidx219.sroa_idx.us.us, align 1
%arrayidx219343.sroa.5.0.arrayidx219.sroa_idx.us.us = getelementptr inbounds i8, ptr %arrayidx219.us.us, i64 16
%arrayidx219343.sroa.5.0.copyload.us.us = load double, ptr %arrayidx219343.sroa.5.0.arrayidx219.sroa_idx.us.us, align 1
%arrayidx219343.sroa.6.0.arrayidx219.sroa_idx.us.us = getelementptr inbounds i8, ptr %arrayidx219.us.us, i64 24
%arrayidx219343.sroa.6.0.copyload.us.us = load double, ptr %arrayidx219343.sroa.6.0.arrayidx219.sroa_idx.us.us, align 1
%sub.i.i.i.us.us = fsub double %arrayidx219343.sroa.5.0.copyload.us.us, %arrayidx219343.sroa.0.0.copyload.us.us
%sub4.i.i.i.us.us = fsub double %arrayidx219343.sroa.6.0.copyload.us.us, %arrayidx219343.sroa.4.0.copyload.us.us
%sub.i29.i.i.us.us = fsub double %74, %arrayidx219343.sroa.0.0.copyload.us.us
%sub4.i30.i.i.us.us = fsub double %76, %arrayidx219343.sroa.4.0.copyload.us.us
%78 = fneg double %sub4.i.i.i.us.us
%neg.i.i.i.us.us = fmul double %sub.i29.i.i.us.us, %78
%79 = call double @llvm.fmuladd.f64(double %sub.i.i.i.us.us, double %sub4.i30.i.i.us.us, double %neg.i.i.i.us.us)
%cmp.i.i.us.us = fcmp ule double %79, 1.000000e-08
%cmp4.i.i.us.us = fcmp olt double %79, -1.000000e-08
%or.cond.i345.us.us = and i1 %cmp.i.i.us.us, %cmp4.i.i.us.us
br i1 %or.cond.i345.us.us, label %if.then222.us.us, label %if.end.i346.us.us
if.end.i346.us.us: ; preds = %for.body215.us.us
%add.i.us.us = fadd double %arrayidx219343.sroa.0.0.copyload.us.us, %arrayidx219343.sroa.5.0.copyload.us.us
%div.i347.us.us = fmul double %add.i.us.us, 5.000000e-01
%add11.i.us.us = fadd double %arrayidx219343.sroa.4.0.copyload.us.us, %arrayidx219343.sroa.6.0.copyload.us.us
%div12.i.us.us = fmul double %add11.i.us.us, 5.000000e-01
%sub.i.i.i356.us.us = fsub double %div.i347.us.us, %74
%sub4.i.i.i357.us.us = fsub double %div12.i.us.us, %76
%80 = fneg double %sub4.i.i.i357.us.us
%mul3.i33.i.i.us.us = fmul double %sub4.i.i.i357.us.us, %sub4.i.i.i357.us.us
%81 = call double @llvm.fmuladd.f64(double %sub.i.i.i356.us.us, double %sub.i.i.i356.us.us, double %mul3.i33.i.i.us.us)
br label %for.body.i349.us.us
for.body.i349.us.us: ; preds = %for.cond.i.us.us, %if.end.i346.us.us
%indvars.iv.i350.us.us = phi i64 [ 0, %if.end.i346.us.us ], [ %indvars.iv.next.i352.us.us, %for.cond.i.us.us ]
%arrayidx.i351.us.us = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv.i350.us.us
%82 = load double, ptr %arrayidx.i351.us.us, align 16
%83 = getelementptr inbounds { double, double }, ptr %arrayidx.i351.us.us, i64 0, i32 1
%84 = load double, ptr %83, align 8
%sub.i29.i.i358.us.us = fsub double %82, %74
%sub4.i30.i.i359.us.us = fsub double %84, %76
%neg.i.i.i360.us.us = fmul double %sub.i29.i.i358.us.us, %80
%85 = call double @llvm.fmuladd.f64(double %sub.i.i.i356.us.us, double %sub4.i30.i.i359.us.us, double %neg.i.i.i360.us.us)
%cmp.i.i361.us.us = fcmp ogt double %85, 1.000000e-08
br i1 %cmp.i.i361.us.us, label %ccw.exit.i.us.us, label %if.end.i.i.us.us
if.end.i.i.us.us: ; preds = %for.body.i349.us.us
%cmp4.i.i362.us.us = fcmp olt double %85, -1.000000e-08
br i1 %cmp4.i.i362.us.us, label %ccw.exit.i.us.us, label %if.end6.i.i.us.us
if.end6.i.i.us.us: ; preds = %if.end.i.i.us.us
%mul3.i.i.i.us.us = fmul double %sub4.i.i.i357.us.us, %sub4.i30.i.i359.us.us
%86 = call double @llvm.fmuladd.f64(double %sub.i.i.i356.us.us, double %sub.i29.i.i358.us.us, double %mul3.i.i.i.us.us)
%cmp8.i.i.us.us = fcmp olt double %86, -1.000000e-08
br i1 %cmp8.i.i.us.us, label %ccw.exit.i.us.us, label %if.end10.i.i.us.us
if.end10.i.i.us.us: ; preds = %if.end6.i.i.us.us
%mul3.i34.i.i.us.us = fmul double %sub4.i30.i.i359.us.us, %sub4.i30.i.i359.us.us
%87 = call double @llvm.fmuladd.f64(double %sub.i29.i.i358.us.us, double %sub.i29.i.i358.us.us, double %mul3.i34.i.i.us.us)
%cmp13.i.i.us.us = fcmp olt double %81, %87
%..i.i.us.us = select i1 %cmp13.i.i.us.us, i32 -2, i32 0
br label %ccw.exit.i.us.us
ccw.exit.i.us.us: ; preds = %if.end10.i.i.us.us, %if.end6.i.i.us.us, %if.end.i.i.us.us, %for.body.i349.us.us
%retval.0.i.i.us.us = phi i32 [ 1, %for.body.i349.us.us ], [ -1, %if.end.i.i.us.us ], [ 2, %if.end6.i.i.us.us ], [ %..i.i.us.us, %if.end10.i.i.us.us ]
%e6.i363.us.us = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv.i350.us.us, i32 1
%88 = load double, ptr %e6.i363.us.us, align 16
%89 = getelementptr inbounds [20 x %struct.SEG], ptr @seg, i64 0, i64 %indvars.iv.i350.us.us, i32 1, i32 1
%90 = load double, ptr %89, align 8
%sub.i29.i20.i.us.us = fsub double %88, %74
%sub4.i30.i21.i.us.us = fsub double %90, %76
%neg.i.i22.i.us.us = fmul double %sub.i29.i20.i.us.us, %80
%91 = call double @llvm.fmuladd.f64(double %sub.i.i.i356.us.us, double %sub4.i30.i21.i.us.us, double %neg.i.i22.i.us.us)
%cmp.i23.i.us.us = fcmp ogt double %91, 1.000000e-08
br i1 %cmp.i23.i.us.us, label %ccw.exit35.i.us.us, label %if.end.i24.i.us.us
if.end.i24.i.us.us: ; preds = %ccw.exit.i.us.us
%cmp4.i25.i.us.us = fcmp olt double %91, -1.000000e-08
br i1 %cmp4.i25.i.us.us, label %ccw.exit35.i.us.us, label %if.end6.i26.i.us.us
if.end6.i26.i.us.us: ; preds = %if.end.i24.i.us.us
%mul3.i.i27.i.us.us = fmul double %sub4.i.i.i357.us.us, %sub4.i30.i21.i.us.us
%92 = call double @llvm.fmuladd.f64(double %sub.i.i.i356.us.us, double %sub.i29.i20.i.us.us, double %mul3.i.i27.i.us.us)
%cmp8.i28.i.us.us = fcmp olt double %92, -1.000000e-08
br i1 %cmp8.i28.i.us.us, label %ccw.exit35.i.us.us, label %if.end10.i29.i.us.us
if.end10.i29.i.us.us: ; preds = %if.end6.i26.i.us.us
%mul3.i34.i31.i.us.us = fmul double %sub4.i30.i21.i.us.us, %sub4.i30.i21.i.us.us
%93 = call double @llvm.fmuladd.f64(double %sub.i29.i20.i.us.us, double %sub.i29.i20.i.us.us, double %mul3.i34.i31.i.us.us)
%cmp13.i32.i.us.us = fcmp olt double %81, %93
%..i33.i.us.us = select i1 %cmp13.i32.i.us.us, i32 -2, i32 0
br label %ccw.exit35.i.us.us
ccw.exit35.i.us.us: ; preds = %if.end10.i29.i.us.us, %if.end6.i26.i.us.us, %if.end.i24.i.us.us, %ccw.exit.i.us.us
%retval.0.i34.i.us.us = phi i32 [ 1, %ccw.exit.i.us.us ], [ -1, %if.end.i24.i.us.us ], [ 2, %if.end6.i26.i.us.us ], [ %..i33.i.us.us, %if.end10.i29.i.us.us ]
%mul.i.us.us = mul nsw i32 %retval.0.i34.i.us.us, %retval.0.i.i.us.us
%cmp.i364.us.us = icmp slt i32 %mul.i.us.us, 0
br i1 %cmp.i364.us.us, label %land.rhs.i366.us.us, label %for.cond.i.us.us
land.rhs.i366.us.us: ; preds = %ccw.exit35.i.us.us
%94 = insertelement <2 x double> poison, double %88, i64 0
%95 = insertelement <2 x double> %94, double %74, i64 1
%96 = insertelement <2 x double> poison, double %82, i64 0
%97 = shufflevector <2 x double> %96, <2 x double> poison, <2 x i32> zeroinitializer
%98 = fsub <2 x double> %95, %97
%99 = insertelement <2 x double> poison, double %90, i64 0
%100 = insertelement <2 x double> %99, double %76, i64 1
%101 = insertelement <2 x double> poison, double %84, i64 0
%102 = shufflevector <2 x double> %101, <2 x double> poison, <2 x i32> zeroinitializer
%103 = fsub <2 x double> %100, %102
%104 = extractelement <2 x double> %103, i64 0
%105 = fneg double %104
%106 = extractelement <2 x double> %98, i64 1
%neg.i.i40.i.us.us = fmul double %106, %105
%107 = extractelement <2 x double> %98, i64 0
%108 = extractelement <2 x double> %103, i64 1
%109 = call double @llvm.fmuladd.f64(double %107, double %108, double %neg.i.i40.i.us.us)
%cmp.i41.i.us.us = fcmp ogt double %109, 1.000000e-08
br i1 %cmp.i41.i.us.us, label %ccw.exit53.i.us.us, label %if.end.i42.i.us.us
if.end.i42.i.us.us: ; preds = %land.rhs.i366.us.us
%cmp4.i43.i.us.us = fcmp olt double %109, -1.000000e-08
br i1 %cmp4.i43.i.us.us, label %ccw.exit53.i.us.us, label %if.end6.i44.i.us.us
if.end6.i44.i.us.us: ; preds = %if.end.i42.i.us.us
%mul3.i.i45.i.us.us = fmul double %108, %104
%110 = call double @llvm.fmuladd.f64(double %107, double %106, double %mul3.i.i45.i.us.us)
%cmp8.i46.i.us.us = fcmp olt double %110, -1.000000e-08
br i1 %cmp8.i46.i.us.us, label %ccw.exit53.i.us.us, label %if.end10.i47.i.us.us
if.end10.i47.i.us.us: ; preds = %if.end6.i44.i.us.us
%111 = fmul <2 x double> %103, %103
%112 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %98, <2 x double> %98, <2 x double> %111)
%113 = extractelement <2 x double> %112, i64 0
%114 = extractelement <2 x double> %112, i64 1
%cmp13.i50.i.us.us = fcmp olt double %113, %114
%..i51.i.us.us = select i1 %cmp13.i50.i.us.us, i32 -2, i32 0
br label %ccw.exit53.i.us.us
ccw.exit53.i.us.us: ; preds = %if.end10.i47.i.us.us, %if.end6.i44.i.us.us, %if.end.i42.i.us.us, %land.rhs.i366.us.us
%retval.0.i52.i.us.us = phi i32 [ 1, %land.rhs.i366.us.us ], [ -1, %if.end.i42.i.us.us ], [ 2, %if.end6.i44.i.us.us ], [ %..i51.i.us.us, %if.end10.i47.i.us.us ]
%sub.i29.i56.i.us.us = fsub double %div.i347.us.us, %82
%sub4.i30.i57.i.us.us = fsub double %div12.i.us.us, %84
%neg.i.i58.i.us.us = fmul double %sub.i29.i56.i.us.us, %105
%115 = call double @llvm.fmuladd.f64(double %107, double %sub4.i30.i57.i.us.us, double %neg.i.i58.i.us.us)
%cmp.i59.i.us.us = fcmp ogt double %115, 1.000000e-08
br i1 %cmp.i59.i.us.us, label %intersectSS.exit.us.us, label %if.end.i60.i.us.us
if.end.i60.i.us.us: ; preds = %ccw.exit53.i.us.us
%cmp4.i61.i.us.us = fcmp olt double %115, -1.000000e-08
br i1 %cmp4.i61.i.us.us, label %intersectSS.exit.us.us, label %if.end6.i62.i.us.us
if.end6.i62.i.us.us: ; preds = %if.end.i60.i.us.us
%mul3.i.i63.i.us.us = fmul double %sub4.i30.i57.i.us.us, %104
%116 = call double @llvm.fmuladd.f64(double %107, double %sub.i29.i56.i.us.us, double %mul3.i.i63.i.us.us)
%cmp8.i64.i.us.us = fcmp olt double %116, -1.000000e-08
br i1 %cmp8.i64.i.us.us, label %intersectSS.exit.us.us, label %if.end10.i65.i.us.us
if.end10.i65.i.us.us: ; preds = %if.end6.i62.i.us.us
%117 = insertelement <2 x double> %103, double %sub4.i30.i57.i.us.us, i64 1
%118 = fmul <2 x double> %117, %117
%119 = insertelement <2 x double> %98, double %sub.i29.i56.i.us.us, i64 1
%120 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %119, <2 x double> %119, <2 x double> %118)
%121 = extractelement <2 x double> %120, i64 0
%122 = extractelement <2 x double> %120, i64 1
%cmp13.i68.i.us.us = fcmp olt double %121, %122
%..i69.i.us.us = select i1 %cmp13.i68.i.us.us, i32 -2, i32 0
br label %intersectSS.exit.us.us
intersectSS.exit.us.us: ; preds = %if.end10.i65.i.us.us, %if.end6.i62.i.us.us, %if.end.i60.i.us.us, %ccw.exit53.i.us.us
%retval.0.i70.i.us.us = phi i32 [ 1, %ccw.exit53.i.us.us ], [ -1, %if.end.i60.i.us.us ], [ 2, %if.end6.i62.i.us.us ], [ %..i69.i.us.us, %if.end10.i65.i.us.us ]
%mul16.i.us.us = mul nsw i32 %retval.0.i70.i.us.us, %retval.0.i52.i.us.us
%tobool.not.i.us.us = icmp sgt i32 %mul16.i.us.us, -1
br i1 %tobool.not.i.us.us, label %for.cond.i.us.us, label %if.then222.us.us
for.cond.i.us.us: ; preds = %intersectSS.exit.us.us, %ccw.exit35.i.us.us
%indvars.iv.next.i352.us.us = add nuw nsw i64 %indvars.iv.i350.us.us, 1
%exitcond.not.i353.us.us = icmp eq i64 %indvars.iv.next.i352.us.us, %wide.trip.count.i348
br i1 %exitcond.not.i353.us.us, label %for.inc227.us.us, label %for.body.i349.us.us, !llvm.loop !19
if.then222.us.us: ; preds = %intersectSS.exit.us.us, %for.body215.us.us
%arrayidx225.us.us = getelementptr inbounds i32, ptr %call170, i64 %indvars.iv495
%123 = load i32, ptr %arrayidx225.us.us, align 4, !tbaa !17
%and.us.us = and i32 %123, %not.us
store i32 %and.us.us, ptr %arrayidx225.us.us, align 4, !tbaa !17
br label %for.inc227.us.us
for.inc227.us.us: ; preds = %for.cond.i.us.us, %if.then222.us.us
%indvars.iv.next496 = add nuw nsw i64 %indvars.iv495, 1
%exitcond499.not = icmp eq i64 %indvars.iv.next496, %wide.trip.count498
br i1 %exitcond499.not, label %for.cond212.for.inc230_crit_edge.split.us.us, label %for.body215.us.us, !llvm.loop !39
for.cond212.for.inc230_crit_edge.split.us.us: ; preds = %for.inc227.us.us
%indvars.iv.next501 = add nuw nsw i64 %indvars.iv500, 1
%exitcond504.not = icmp eq i64 %indvars.iv.next501, %wide.trip.count.i348
br i1 %exitcond504.not, label %for.cond233.preheader, label %for.cond212.preheader.us, !llvm.loop !40
for.cond233.preheader: ; preds = %for.cond212.for.inc230_crit_edge.split.us.us, %for.end165, %for.cond212.preheader.lr.ph, %for.end205
%124 = phi i32 [ %inc190.lcssa402, %for.end205 ], [ %inc190.lcssa402, %for.cond212.preheader.lr.ph ], [ 0, %for.end165 ], [ %inc190.lcssa402, %for.cond212.for.inc230_crit_edge.split.us.us ]
%125 = load i32, ptr @mask, align 4, !tbaa !17
%cmp234.not444 = icmp slt i32 %125, 1
br i1 %cmp234.not444, label %for.end259, label %for.body236.lr.ph
for.body236.lr.ph: ; preds = %for.cond233.preheader
%cmp242.not440 = icmp slt i32 %124, 1
%wide.trip.count508 = zext i32 %124 to i64
br label %for.body236
for.body236: ; preds = %for.body236.lr.ph, %for.inc257
%i.7446 = phi i32 [ 1, %for.body236.lr.ph ], [ %inc258, %for.inc257 ]
%ans.0445 = phi i32 [ %69, %for.body236.lr.ph ], [ %ans.1, %for.inc257 ]
%and.i = and i32 %i.7446, 1431655765
%shr.i = lshr i32 %i.7446, 1
%and1.i = and i32 %shr.i, 357913941
%add.i354 = add nuw nsw i32 %and1.i, %and.i
%and2.i = and i32 %add.i354, 858993459
%shr3.i = lshr i32 %add.i354, 2
%and4.i = and i32 %shr3.i, 322122547
%add5.i = add nuw nsw i32 %and4.i, %and2.i
%and6.i = and i32 %add5.i, 117901063
%shr7.i = lshr i32 %add5.i, 4
%and8.i = and i32 %shr7.i, 117901063
%add9.i = add nuw nsw i32 %and8.i, %and6.i
%and10.i = and i32 %add9.i, 983055
%shr11.i = lshr i32 %add9.i, 8
%and12.i = and i32 %shr11.i, 983055
%add13.i = add nuw nsw i32 %and12.i, %and10.i
%and14.i = and i32 %add13.i, 31
%shr15.i = lshr i32 %add13.i, 16
%add17.i = add nuw nsw i32 %and14.i, %shr15.i
%cmp238 = icmp sge i32 %add17.i, %ans.0445
%brmerge = select i1 %cmp238, i1 true, i1 %cmp242.not440
%ans.0445.mux = call i32 @llvm.smin.i32(i32 %add17.i, i32 %ans.0445)
br i1 %brmerge, label %for.inc257, label %if.end245
for.cond241: ; preds = %if.end245
%indvars.iv.next506 = add nuw nsw i64 %indvars.iv505, 1
%exitcond509.not = icmp eq i64 %indvars.iv.next506, %wide.trip.count508
br i1 %exitcond509.not, label %for.inc257, label %if.end245
if.end245: ; preds = %for.body236, %for.cond241
%indvars.iv505 = phi i64 [ %indvars.iv.next506, %for.cond241 ], [ 0, %for.body236 ]
%arrayidx247 = getelementptr inbounds i32, ptr %call170, i64 %indvars.iv505
%126 = load i32, ptr %arrayidx247, align 4, !tbaa !17
%and248 = and i32 %126, %i.7446
%cmp249 = icmp eq i32 %and248, 0
br i1 %cmp249, label %for.inc257, label %for.cond241
for.inc257: ; preds = %if.end245, %for.cond241, %for.body236
%ans.1 = phi i32 [ %ans.0445.mux, %for.body236 ], [ %ans.0445, %if.end245 ], [ %add17.i, %for.cond241 ]
%inc258 = add nuw i32 %i.7446, 1
%exitcond510.not = icmp eq i32 %i.7446, %125
br i1 %exitcond510.not, label %for.end259, label %for.body236, !llvm.loop !41
for.end259: ; preds = %for.inc257, %for.cond233.preheader
%ans.0.lcssa = phi i32 [ %69, %for.cond233.preheader ], [ %ans.1, %for.inc257 ]
%call260 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
%127 = load ptr, ptr @cut, align 8, !tbaa !35
call void @free(ptr noundef %127) #17
%128 = load ptr, ptr @flg, align 8, !tbaa !35
call void @free(ptr noundef %128) #17
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%129 = load i32, ptr @N, align 4, !tbaa !17
%tobool.not = icmp eq i32 %129, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !42
while.end: ; preds = %for.end259, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #14
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #16
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #16
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #16
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind "no-trapping-math"="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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { mustprogress nofree 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 #9 = { nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { 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 #11 = { nofree nounwind "no-trapping-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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { 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 #14 = { 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 #15 = { 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 #16 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #17 = { nounwind }
attributes #18 = { 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, !8, i64 24}
!6 = !{!"", !7, i64 0, !7, i64 16}
!7 = !{!"", !8, i64 0, !8, i64 8}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!6, !8, i64 8}
!12 = !{!6, !8, i64 16}
!13 = !{!6, !8, i64 0}
!14 = !{i64 0, i64 8, !15, i64 8, i64 8, !15}
!15 = !{!8, !8, i64 0}
!16 = !{i64 0, i64 8, !15}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !9, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{i32 0, i32 2}
!22 = !{!7, !8, i64 0}
!23 = !{!7, !8, i64 8}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !20}
!27 = distinct !{!27, !20}
!28 = distinct !{!28, !20}
!29 = distinct !{!29, !20}
!30 = distinct !{!30, !20}
!31 = distinct !{!31, !20, !32, !33}
!32 = !{!"llvm.loop.isvectorized", i32 1}
!33 = !{!"llvm.loop.unroll.runtime.disable"}
!34 = distinct !{!34, !20, !33, !32}
!35 = !{!36, !36, i64 0}
!36 = !{!"any pointer", !9, i64 0}
!37 = distinct !{!37, !20}
!38 = distinct !{!38, !20}
!39 = distinct !{!39, !20}
!40 = distinct !{!40, !20}
!41 = distinct !{!41, !20}
!42 = distinct !{!42, !20}
|
#include <stdio.h>
#include <stdlib.h>
void printArray(int *, int);
void mergeSort(int *, int, int, int);
void merge(int *, int, int, int, int);
int main()
{
int i, nbr_of_keyboard, *array;
scanf("%d", &nbr_of_keyboard);
array = (int *)malloc(nbr_of_keyboard * sizeof(int));
for (i = 0; i < nbr_of_keyboard; i++)
{
scanf("%d", &array[i]);
}
mergeSort(&array[0], nbr_of_keyboard, 0, nbr_of_keyboard - 1);
int count_stolen = 0, min_index;
for(i = 1; i < nbr_of_keyboard; i++)
{
min_index = array[i - 1];
//printf("\n -- [1] Compare min_index = %d with array[i] = %d --\n", min_index, array[i]);
if (min_index + 1 != array[i])
{
//printf("\n -- [2] Compare min_index = %d with array[i] = %d --", min_index, array[i]);
do
{
count_stolen++;
min_index++;
//printf("\n -- [3] Compare min_index = %d with array[i] = %d --\n", min_index, array[i]);
} while (min_index + 1 != array[i]);
}
}
printf("%d\n", count_stolen);
free(array);
return 0;
}
// End of main.
void printArray(int *array, int arr_size)
{
int i;
for(i = 0; i < arr_size; i++)
{
printf("%d ", array[i]);
}
printf("\n");
}
// End of function printArray.
void mergeSort(int *array, int arr_size, int start, int end)
{
if (start < end)
{
int mid;
mid = (start + end) / 2;
mergeSort(array, arr_size, start, mid);
mergeSort(array, arr_size, mid + 1, end);
merge(array, arr_size, start, mid, end);
}
}
// End of mergeSort.
void merge(int *array, int arr_size, int start, int mid, int end)
{
int i, j, k, *temp;
temp = (int *)malloc(arr_size * sizeof(int));
i = start;
j = mid + 1;
k = start;
while (i <= mid && j <= end)
{
if (array[i] <= array[j])
{
temp[k] = array[i];
i++;
}
else if (array[i] > array[j])
{
temp[k] = array[j];
j++;
}
k++;
}
while(i <= mid)
{
temp[k] = array[i];
i++;
k++;
}
while(j <= end)
{
temp[k] = array[j];
j++;
k++;
}
for (i = start; i <= end; i++)
{
array[i] = temp[i];
}
free(temp);
}
// End of function merge. | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19022/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19022/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d \00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%nbr_of_keyboard = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nbr_of_keyboard) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %nbr_of_keyboard)
%0 = load i32, ptr %nbr_of_keyboard, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #10
%cmp42 = icmp sgt i32 %0, 0
br i1 %cmp42, 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 i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %nbr_of_keyboard, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
%sub = add nsw i32 %.lcssa, -1
call void @mergeSort(ptr noundef %call1, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %sub)
%3 = load i32, ptr %nbr_of_keyboard, align 4, !tbaa !5
%cmp644 = icmp sgt i32 %3, 1
br i1 %cmp644, label %for.body8.preheader, label %for.end25
for.body8.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%.pre = load i32, ptr %call1, align 4, !tbaa !5
%4 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %4, 1
%5 = icmp eq i32 %3, 2
br i1 %5, label %for.end25.loopexit.unr-lcssa, label %for.body8.preheader.new
for.body8.preheader.new: ; preds = %for.body8.preheader
%unroll_iter = and i64 %4, -2
%invariant.gep = getelementptr i32, ptr %call1, i64 1
br label %for.body8
for.body8: ; preds = %for.body8, %for.body8.preheader.new
%6 = phi i32 [ %.pre, %for.body8.preheader.new ], [ %11, %for.body8 ]
%indvars.iv50 = phi i64 [ 1, %for.body8.preheader.new ], [ %indvars.iv.next51.1, %for.body8 ]
%count_stolen.046 = phi i32 [ 0, %for.body8.preheader.new ], [ %count_stolen.2.1, %for.body8 ]
%niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.body8 ]
%add = add nsw i32 %6, 1
%arrayidx13 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv50
%7 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14.not = icmp eq i32 %add, %7
%8 = add i32 %count_stolen.046, -1
%9 = add i32 %8, %7
%10 = sub i32 %9, %6
%count_stolen.2 = select i1 %cmp14.not, i32 %count_stolen.046, i32 %10
%add.1 = add nsw i32 %7, 1
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv50
%11 = load i32, ptr %gep, align 4, !tbaa !5
%cmp14.not.1 = icmp eq i32 %add.1, %11
%12 = add i32 %count_stolen.2, -1
%13 = add i32 %12, %11
%14 = sub i32 %13, %7
%count_stolen.2.1 = select i1 %cmp14.not.1, i32 %count_stolen.2, i32 %14
%indvars.iv.next51.1 = add nuw nsw i64 %indvars.iv50, 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.end25.loopexit.unr-lcssa, label %for.body8, !llvm.loop !11
for.end25.loopexit.unr-lcssa: ; preds = %for.body8, %for.body8.preheader
%count_stolen.2.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %count_stolen.2.1, %for.body8 ]
%.unr = phi i32 [ %.pre, %for.body8.preheader ], [ %11, %for.body8 ]
%indvars.iv50.unr = phi i64 [ 1, %for.body8.preheader ], [ %indvars.iv.next51.1, %for.body8 ]
%count_stolen.046.unr = phi i32 [ 0, %for.body8.preheader ], [ %count_stolen.2.1, %for.body8 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end25, label %for.body8.epil
for.body8.epil: ; preds = %for.end25.loopexit.unr-lcssa
%add.epil = add nsw i32 %.unr, 1
%arrayidx13.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv50.unr
%15 = load i32, ptr %arrayidx13.epil, align 4, !tbaa !5
%cmp14.not.epil = icmp eq i32 %add.epil, %15
%16 = add i32 %count_stolen.046.unr, -1
%17 = add i32 %16, %15
%18 = sub i32 %17, %.unr
%count_stolen.2.epil = select i1 %cmp14.not.epil, i32 %count_stolen.046.unr, i32 %18
br label %for.end25
for.end25: ; preds = %for.body8.epil, %for.end25.loopexit.unr-lcssa, %for.end
%count_stolen.0.lcssa = phi i32 [ 0, %for.end ], [ %count_stolen.2.lcssa.ph, %for.end25.loopexit.unr-lcssa ], [ %count_stolen.2.epil, %for.body8.epil ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count_stolen.0.lcssa)
call void @free(ptr noundef %call1) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nbr_of_keyboard) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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: nounwind uwtable
define dso_local void @mergeSort(ptr noundef %array, i32 noundef %arr_size, i32 noundef %start, i32 noundef %end) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %start, %end
br i1 %cmp, label %if.then, label %common.ret14
common.ret14: ; preds = %entry, %if.then
ret void
if.then: ; preds = %entry
%add = add nsw i32 %end, %start
%div = sdiv i32 %add, 2
tail call void @mergeSort(ptr noundef %array, i32 noundef %arr_size, i32 noundef %start, i32 noundef %div)
%add1 = add nsw i32 %div, 1
tail call void @mergeSort(ptr noundef %array, i32 noundef %arr_size, i32 noundef %add1, i32 noundef %end)
tail call void @merge(ptr noundef %array, i32 noundef %arr_size, i32 noundef %start, i32 noundef %div, i32 noundef %end)
br label %common.ret14
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @printArray(ptr nocapture noundef readonly %array, i32 noundef %arr_size) local_unnamed_addr #5 {
entry:
%cmp4 = icmp sgt i32 %arr_size, 0
br i1 %cmp4, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %arr_size 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 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %0)
%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 !12
for.end: ; preds = %for.body, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @merge(ptr nocapture noundef %array, i32 noundef %arr_size, i32 noundef %start, i32 noundef %mid, i32 noundef %end) local_unnamed_addr #0 {
entry:
%conv = sext i32 %arr_size to i64
%mul = shl nsw i64 %conv, 2
%call = tail call noalias ptr @malloc(i64 noundef %mul) #10
%add = add i32 %mid, 1
%cmp99 = icmp sle i32 %start, %mid
%cmp2100 = icmp slt i32 %mid, %end
%0 = and i1 %cmp99, %cmp2100
br i1 %0, label %while.body.preheader, label %while.cond26.preheader
while.body.preheader: ; preds = %entry
%1 = sext i32 %start to i64
br label %while.body
while.cond26.preheader.loopexit: ; preds = %while.body
%2 = trunc i64 %indvars.iv.next to i32
br label %while.cond26.preheader
while.cond26.preheader: ; preds = %while.cond26.preheader.loopexit, %entry
%j.0.lcssa = phi i32 [ %add, %entry ], [ %j.1, %while.cond26.preheader.loopexit ]
%k.0.lcssa = phi i32 [ %start, %entry ], [ %2, %while.cond26.preheader.loopexit ]
%i.0.lcssa = phi i32 [ %start, %entry ], [ %i.1, %while.cond26.preheader.loopexit ]
%cmp27.not106 = icmp sgt i32 %i.0.lcssa, %mid
br i1 %cmp27.not106, label %while.cond37.preheader, label %while.body29.preheader
while.body29.preheader: ; preds = %while.cond26.preheader
%3 = sext i32 %k.0.lcssa to i64
%4 = shl nsw i64 %3, 2
%scevgep = getelementptr i8, ptr %call, i64 %4
%5 = sext i32 %i.0.lcssa to i64
%6 = shl nsw i64 %5, 2
%scevgep116 = getelementptr i8, ptr %array, i64 %6
%7 = sub i32 %mid, %i.0.lcssa
%8 = zext i32 %7 to i64
%9 = shl nuw nsw i64 %8, 2
%10 = add nuw nsw i64 %9, 4
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, ptr noundef nonnull align 4 dereferenceable(1) %scevgep116, i64 %10, i1 false), !tbaa !5
%11 = add i32 %k.0.lcssa, %7
%12 = add i32 %11, 1
br label %while.cond37.preheader
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv = phi i64 [ %1, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%i.0103 = phi i32 [ %start, %while.body.preheader ], [ %i.1, %while.body ]
%j.0101 = phi i32 [ %add, %while.body.preheader ], [ %j.1, %while.body ]
%idxprom = sext i32 %i.0103 to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom
%13 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom4 = sext i32 %j.0101 to i64
%arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %idxprom4
%14 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %13, %14
%.sink = tail call i32 @llvm.smin.i32(i32 %13, i32 %14)
%inc23 = zext i1 %cmp6.not to i32
%j.1 = add nsw i32 %j.0101, %inc23
%not.cmp6.not = xor i1 %cmp6.not, true
%inc = zext i1 %not.cmp6.not to i32
%i.1 = add nsw i32 %i.0103, %inc
%15 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv
store i32 %.sink, ptr %15, align 4
%indvars.iv.next = add i64 %indvars.iv, 1
%cmp = icmp sle i32 %i.1, %mid
%cmp2 = icmp sle i32 %j.1, %end
%16 = select i1 %cmp, i1 %cmp2, i1 false
br i1 %16, label %while.body, label %while.cond26.preheader.loopexit, !llvm.loop !13
while.cond37.preheader: ; preds = %while.body29.preheader, %while.cond26.preheader
%k.1.lcssa = phi i32 [ %k.0.lcssa, %while.cond26.preheader ], [ %12, %while.body29.preheader ]
%cmp38.not110 = icmp sgt i32 %j.0.lcssa, %end
br i1 %cmp38.not110, label %for.cond.preheader, label %while.body40.preheader
while.body40.preheader: ; preds = %while.cond37.preheader
%17 = sext i32 %k.1.lcssa to i64
%18 = shl nsw i64 %17, 2
%scevgep124 = getelementptr i8, ptr %call, i64 %18
%19 = sext i32 %j.0.lcssa to i64
%20 = shl nsw i64 %19, 2
%scevgep125 = getelementptr i8, ptr %array, i64 %20
%21 = sub i32 %end, %j.0.lcssa
%22 = zext i32 %21 to i64
%23 = shl nuw nsw i64 %22, 2
%24 = add nuw nsw i64 %23, 4
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep124, ptr noundef nonnull align 4 dereferenceable(1) %scevgep125, i64 %24, i1 false), !tbaa !5
br label %for.cond.preheader
for.cond.preheader: ; preds = %while.body40.preheader, %while.cond37.preheader
%cmp48.not113 = icmp sgt i32 %start, %end
br i1 %cmp48.not113, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%25 = sext i32 %start to i64
%26 = shl nsw i64 %25, 2
%scevgep133 = getelementptr i8, ptr %array, i64 %26
%scevgep134 = getelementptr i8, ptr %call, i64 %26
%27 = sub i32 %end, %start
%28 = zext i32 %27 to i64
%29 = shl nuw nsw i64 %28, 2
%30 = add nuw nsw i64 %29, 4
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep133, ptr noundef nonnull align 4 dereferenceable(1) %scevgep134, i64 %30, i1 false), !tbaa !5
br label %for.end
for.end: ; preds = %for.body.preheader, %for.cond.preheader
tail call void @free(ptr noundef %call) #9
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; 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) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
/*
cat <<EOF >mistaken-paste
*/
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 2000000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1000000
#define M_MAX 200000
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
// using namespace std; // HELL
using std::queue;
using std::priority_queue;
using std::stack;
using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
using std::string;
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
ull n, m;
ull h, w;
ull k;
ull q;
ull vua, vub, vuc, vud, vue, vuf;
sll vsa, vsb, vsc, vsd, vse, vsf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
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 psllcomp (const void *left, const void *right) {
sll l = *(sll*)left;
sll r = *(sll*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pcharcomp (const void *left, const void *right) {
char l = *(char*)left;
char r = *(char*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
int32_t phwllABcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
return 0;
}
int32_t 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;
}
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);
}
ull parent[N_MAX];
ull rank[N_MAX];
void uf_init (ull n) {
for (sll i = 0; i < n; i++) {
parent[i] = i;
rank[i] = 0;
}
}
ull uf_find (ull x) {
if (parent[x] == x) return x;
return parent[x] = uf_find(parent[x]);
}
sll uf_union (ull a, ull b) {
a = uf_find(a);
b = uf_find(b);
if (a == b) return -1;
if (rank[a] > rank[b]) {
a ^= (b ^= (a ^= b));
}
parent[a] = b;
if (rank[a] == rank[b]) {
rank[b]++;
}
return b;
}
sll a[N_MAX];
// sll a[3001][3001];
sll b[N_MAX];
// sll b[3001][3001];
sll c[N_MAX];
char s[N_MAX + 1];
// char s[3010][3010];
// char t[N_MAX + 1];
// char t[3010][3010];
// hwll xy[N_MAX];
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;
i = 0;
while (i < n) {
j = i;
while (i < n && a[i] == a[j]) i++;
ull num = i - j;
result += num / 2;
}
printf("%llu\n", result);
// printf("%.15lf\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
// puts("Yes");
// printf("%llu\n", result);
// puts("0");
puts("Takahashi");
return 0;
fail:
// puts("NO");
// puts("No");
// puts("0");
// puts("-1");
// puts("-1 -1 -1");
puts("Aoki");
return 1;
}
int32_t main (void) {
int32_t i, j;
int32_t x, y;
// scanf("%lf%lf", &vda, &vdb, &vdc);
// scanf("%lld%lld", &vsa, &vsb, &vsc, &vsd);
// scanf("%llu%llu", &vua, &vub, &vuc, &vud);
// scanf("%*llu%*llu");
// scanf("%llu%llu", &h, &w);
scanf("%llu", &n, &m);
// scanf("%llu", &k, &n, &m);
// scanf("%s", s);
// scanf("%s", t);
// scanf("%llu", &q);
for (i = 0; i < n; i++) {
// scanf("%lld%lld", &xy[i].a, &xy[i].b);
scanf("%lld", &a[i]);
// scanf("%lld", &b[i]);
// scanf("%lld", &c[i]);
// scanf("%lld", &t[i]);
a[i]--;
// b[i]--;
// c[i]--;
}
// scanf("%llu%llu", &m, &k);
// for (i = 0; i < w; i++) {
// scanf("%llu", &b[i]);
// // b[i]--;
// }
// scanf("%llu", &q);
// for (i = 0; i < h; i++) {
// for (j = 0; j < w; j++) {
// scanf("%llu", &a[i][j]);
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", &s[i]);
// }
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190270/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190270/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@parent = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@rank = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@n = dso_local global i64 0, align 8
@a = dso_local global [1000000 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@m = dso_local global i64 0, align 8
@.str.4 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@vua = dso_local local_unnamed_addr global i64 0, align 8
@vub = dso_local local_unnamed_addr global i64 0, align 8
@vuc = dso_local local_unnamed_addr global i64 0, align 8
@vud = dso_local local_unnamed_addr global i64 0, align 8
@vue = dso_local local_unnamed_addr global i64 0, align 8
@vuf = dso_local local_unnamed_addr global i64 0, align 8
@vsa = dso_local local_unnamed_addr global i64 0, align 8
@vsb = dso_local local_unnamed_addr global i64 0, align 8
@vsc = dso_local local_unnamed_addr global i64 0, align 8
@vsd = dso_local local_unnamed_addr global i64 0, align 8
@vse = dso_local local_unnamed_addr global i64 0, align 8
@vsf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@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
@s = dso_local local_unnamed_addr global [1000001 x i8] 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 @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 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 !13
%1 = load ptr, ptr %right, align 8, !tbaa !13
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #13
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #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 !15
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @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 !15
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.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 !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: 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: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @uf_init(i64 noundef %n) local_unnamed_addr #6 {
entry:
%cmp6.not = icmp eq i64 %n, 0
br i1 %cmp6.not, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = shl nuw i64 %n, 3
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @rank, i8 0, i64 %0, i1 false), !tbaa !8
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%1 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %index
store <2 x i64> %vec.ind, ptr %1, align 16, !tbaa !8
%2 = getelementptr inbounds i64, ptr %1, i64 2
store <2 x i64> %step.add, ptr %2, align 16, !tbaa !8
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
ret void
for.body: ; preds = %for.body.preheader9, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %i.07
store i64 %i.07, ptr %arrayidx, align 8, !tbaa !8
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !21
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @uf_find(i64 noundef %x) local_unnamed_addr #7 {
entry:
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %x
%0 = load i64, ptr %arrayidx, align 8, !tbaa !8
%cmp = icmp eq i64 %0, %x
br i1 %cmp, label %common.ret7, label %if.end
common.ret7: ; preds = %entry, %if.end
%common.ret7.op = phi i64 [ %call, %if.end ], [ %x, %entry ]
ret i64 %common.ret7.op
if.end: ; preds = %entry
%call = tail call i64 @uf_find(i64 noundef %0)
store i64 %call, ptr %arrayidx, align 8, !tbaa !8
br label %common.ret7
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @uf_union(i64 noundef %a, i64 noundef %b) local_unnamed_addr #8 {
entry:
%call = tail call i64 @uf_find(i64 noundef %a)
%call1 = tail call i64 @uf_find(i64 noundef %b)
%cmp = icmp eq i64 %call, %call1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %call
%0 = load i64, ptr %arrayidx, align 8, !tbaa !8
%arrayidx2 = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %call1
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !8
%cmp3 = icmp ugt i64 %0, %1
%spec.select = select i1 %cmp3, i64 %call1, i64 %call
%spec.select29 = select i1 %cmp3, i64 %call, i64 %call1
%arrayidx8 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %spec.select
store i64 %spec.select29, ptr %arrayidx8, align 8, !tbaa !8
%arrayidx9 = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %spec.select
%2 = load i64, ptr %arrayidx9, align 8, !tbaa !8
%arrayidx10 = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %spec.select29
%3 = load i64, ptr %arrayidx10, align 8, !tbaa !8
%cmp11 = icmp eq i64 %2, %3
br i1 %cmp11, label %if.then12, label %return
if.then12: ; preds = %if.end
%inc = add i64 %2, 1
store i64 %inc, ptr %arrayidx10, align 8, !tbaa !8
br label %return
return: ; preds = %if.end, %if.then12, %entry
%retval.0 = phi i64 [ -1, %entry ], [ %spec.select29, %if.then12 ], [ %spec.select29, %if.end ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #9 {
entry:
%0 = load i64, ptr @n, align 8, !tbaa !8
%cmp27.not = icmp eq i64 %0, 0
br i1 %cmp27.not, label %while.end6, label %while.cond1.preheader
while.cond1.preheader: ; preds = %entry, %while.end
%i.029 = phi i64 [ %i.126, %while.end ], [ 0, %entry ]
%result.028 = phi i64 [ %add, %while.end ], [ 0, %entry ]
%arrayidx3 = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %i.029
%1 = load i64, ptr %arrayidx3, align 8, !tbaa !8
%2 = add nuw i64 %i.029, 1
%umax = tail call i64 @llvm.umax.i64(i64 %0, i64 %2)
br label %land.rhs
land.rhs: ; preds = %while.cond1.preheader, %while.body5
%i.126 = phi i64 [ %i.029, %while.cond1.preheader ], [ %inc, %while.body5 ]
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %i.126
%3 = load i64, ptr %arrayidx, align 8, !tbaa !8
%cmp4 = icmp eq i64 %3, %1
br i1 %cmp4, label %while.body5, label %while.end
while.body5: ; preds = %land.rhs
%inc = add i64 %i.126, 1
%exitcond.not = icmp eq i64 %inc, %umax
br i1 %exitcond.not, label %while.end.thread, label %land.rhs, !llvm.loop !22
while.end.thread: ; preds = %while.body5
%sub31 = sub nsw i64 %umax, %i.029
%div2532 = lshr i64 %sub31, 1
%add33 = add i64 %div2532, %result.028
br label %while.end6
while.end: ; preds = %land.rhs
%sub = sub nsw i64 %i.126, %i.029
%div25 = lshr i64 %sub, 1
%add = add i64 %div25, %result.028
%cmp = icmp ult i64 %i.126, %0
br i1 %cmp, label %while.cond1.preheader, label %while.end6, !llvm.loop !23
while.end6: ; preds = %while.end, %while.end.thread, %entry
%result.0.lcssa = phi i64 [ 0, %entry ], [ %add33, %while.end.thread ], [ %add, %while.end ]
%call = 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 @n, ptr noundef nonnull @m)
%0 = load i64, ptr @n, align 8, !tbaa !8
%cmp13.not = icmp eq i64 %0, 0
br i1 %cmp13.not, label %solve.exit, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %indvars.iv
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx)
%1 = load i64, ptr %arrayidx, align 8, !tbaa !8
%dec = add nsw i64 %1, -1
store i64 %dec, ptr %arrayidx, align 8, !tbaa !8
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%2 = load i64, ptr @n, align 8, !tbaa !8
%cmp = icmp ugt i64 %2, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !24
for.end: ; preds = %for.body
%cmp27.not.i = icmp eq i64 %2, 0
br i1 %cmp27.not.i, label %solve.exit, label %while.cond1.preheader.i.preheader
while.cond1.preheader.i.preheader: ; preds = %for.end
%.pre = load i64, ptr @a, align 16, !tbaa !8
br label %while.cond1.preheader.i
while.cond1.preheader.i: ; preds = %while.cond1.preheader.i.preheader, %while.end.i
%3 = phi i64 [ %5, %while.end.i ], [ %.pre, %while.cond1.preheader.i.preheader ]
%i.029.i = phi i64 [ %i.126.i, %while.end.i ], [ 0, %while.cond1.preheader.i.preheader ]
%result.028.i = phi i64 [ %add.i, %while.end.i ], [ 0, %while.cond1.preheader.i.preheader ]
%4 = add nuw i64 %i.029.i, 1
%umax.i = tail call i64 @llvm.umax.i64(i64 %2, i64 %4)
br label %land.rhs.i
land.rhs.i: ; preds = %while.body5.i, %while.cond1.preheader.i
%i.126.i = phi i64 [ %i.029.i, %while.cond1.preheader.i ], [ %inc.i, %while.body5.i ]
%arrayidx.i = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %i.126.i
%5 = load i64, ptr %arrayidx.i, align 8, !tbaa !8
%cmp4.i = icmp eq i64 %5, %3
br i1 %cmp4.i, label %while.body5.i, label %while.end.i
while.body5.i: ; preds = %land.rhs.i
%inc.i = add i64 %i.126.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %umax.i
br i1 %exitcond.not.i, label %while.end.thread.i, label %land.rhs.i, !llvm.loop !22
while.end.thread.i: ; preds = %while.body5.i
%sub31.i = sub nsw i64 %umax.i, %i.029.i
%div2532.i = lshr i64 %sub31.i, 1
%add33.i = add i64 %div2532.i, %result.028.i
br label %solve.exit
while.end.i: ; preds = %land.rhs.i
%sub.i = sub nsw i64 %i.126.i, %i.029.i
%div25.i = lshr i64 %sub.i, 1
%add.i = add i64 %div25.i, %result.028.i
%cmp.i = icmp ult i64 %i.126.i, %2
br i1 %cmp.i, label %while.cond1.preheader.i, label %solve.exit, !llvm.loop !23
solve.exit: ; preds = %while.end.i, %entry, %for.end, %while.end.thread.i
%result.0.lcssa.i = phi i64 [ 0, %for.end ], [ %add33.i, %while.end.thread.i ], [ 0, %entry ], [ %add.i, %while.end.i ]
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %result.0.lcssa.i)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = 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 = !{!"any pointer", !10, i64 0}
!15 = !{i64 0, i64 8, !8, i64 8, i64 8, !8}
!16 = !{i64 0, i64 8, !8}
!17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8}
!18 = distinct !{!18, !6, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !6, !20, !19}
!22 = distinct !{!22, !6}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}
|
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>
#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))
#define SWAP(type, a, b) { const type tmp = a; a = b; b = tmp; }
int compare_sz_asc(const void* a, const void* b) {
return *((size_t*)a) < *((size_t*)b) ? -1 : 1;
}
int compare_sz_desc(const void* a, const void* b) {
return *((size_t*)a) > * ((size_t*)b) ? -1 : 1;
}
int compare_i64_asc(const void* a, const void* b) {
return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1;
}
int compare_i64_desc(const void* a, const void* b) {
return *((int64_t*)a) > * ((int64_t*)b) ? -1 : 1;
}
int compare_u64_asc(const void* a, const void* b) {
return *((uint64_t*)a) < *((uint64_t*)b) ? -1 : 1;
}
int compare_u64_desc(const void* a, const void* b) {
return *((uint64_t*)a) > * ((uint64_t*)b) ? -1 : 1;
}
int compare_c_asc(const void* a, const void* b) {
return *((char*)a) < *((char*)b) ? -1 : 1;
}
int compare_c_desc(const void* a, const void* b) {
return *((char*)a) > * ((char*)b) ? -1 : 1;
}
int compare_dp_asc(const void* a, const void* b) {
return *((double*)a) < *((double*)b) ? -1 : 1;
}
static uint64_t modinvU64(const uint64_t a, const uint64_t m) {
int64_t aa = (int64_t)a;
const int64_t mm = (int64_t)m;
int64_t b = mm;
int64_t u = 1;
int64_t v = 0;
while (b != 0) {
const int64_t t = aa / b;
aa -= t * b;
SWAP(uint64_t, aa, b);
u -= t * v;
SWAP(uint64_t, u, v);
}
u %= mm;
if (u < 0) {
u += m;
}
return (uint64_t)u;
}
static size_t powSz(const size_t base, const size_t exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base;
}
if (exp % 2 == 0) {
return powSz(base * base, exp / 2);
}
else {
return base * powSz(base, exp - 1);
}
}
static uint64_t powU64(const uint64_t base, const uint64_t exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base;
}
if (exp % 2 == 0) {
return powU64(base * base, exp / 2);
}
else {
return base * powU64(base, exp - 1);
}
}
static size_t comb(const size_t n, const size_t r) {
size_t result = 1;
for (size_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static uint64_t combU64(const uint64_t n, const uint64_t r) {
uint64_t result = 1;
for (uint64_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static uint64_t combU64WMod(const uint64_t n, const uint64_t r, const uint64_t m) {
uint64_t result = 1;
for (uint64_t i = 0; i < r; i++) {
result = result * (n - i) % m;
result = result * modinvU64(i + 1, m) % m;
}
return result;
}
static uint64_t permU64WMod(const uint64_t n, const uint64_t m) {
uint64_t result = 1;
for (uint64_t v = 2; v <= n; v++) {
result *= v;
result %= m;
}
return result;
}
static size_t gcdZu(size_t m, size_t n) {
size_t temp;
while (m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
static uint64_t gcdU64(uint64_t m, uint64_t n)
{
uint64_t temp;
while (m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
typedef struct {
uint64_t val;
}BHeap_Val;
#define BHEAP_VAL_TYPE BHeap_Val
#define BHEAP_INVALID_NODE ((size_t)100000000)
typedef struct {
BHEAP_VAL_TYPE val;
} BHeap_Node;
struct _BHeap_Ctx {
size_t size;
int (*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node);
void(*notifyNodeChange)(const struct _BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList);
BHeap_Node* node;
};
typedef struct _BHeap_Ctx BHeap_Ctx;
static void bHeap_Init(BHeap_Ctx* const ctx, int(*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node), void(*notifyNodeChange)(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList), BHeap_Node* const nodes) {
ctx->size = 0;
ctx->compare = compare;
ctx->notifyNodeChange = notifyNodeChange;
ctx->node = nodes;
}
static void bHeap_Swap(BHeap_Ctx* const ctx, const size_t node0, const size_t node1) {
const BHEAP_VAL_TYPE tmp = ctx->node[node0].val;
ctx->node[node0].val = ctx->node[node1].val;
ctx->node[node1].val = tmp;
if (ctx->notifyNodeChange != NULL) {
const size_t nodeList[2] = { node0,node1 };
ctx->notifyNodeChange(ctx, 2, nodeList);
}
}
static void bHeap_UpHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) {
if (nodeIdx == 0) {
return;
}
const size_t parentIdx = (nodeIdx + 1) / 2 - 1;
const int compareResult = ctx->compare(&(ctx->node[parentIdx].val), &(ctx->node[nodeIdx].val));
if (0 < compareResult) {
bHeap_Swap(ctx, nodeIdx, parentIdx);
if (parentIdx != 0) {
bHeap_UpHeap(ctx, parentIdx);
}
}
}
static void bHeap_DownHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) {
if (ctx->size - 1 <= nodeIdx) {
return;
}
const size_t leftIdx = 2 * (nodeIdx + 1) - 1;
if (leftIdx < ctx->size) {
const int leftResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[leftIdx].val));
size_t swapTarget = leftResult < 0 ? BHEAP_INVALID_NODE : leftIdx;
const size_t rightIdx = leftIdx + 1;
if (rightIdx < ctx->size) {
const int rightResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[rightIdx].val));
if (swapTarget == BHEAP_INVALID_NODE) {
if (0 < rightResult) {
swapTarget = rightIdx;
}
}
else {
if (0 < rightResult) {
const int rightLeftResult = ctx->compare(&(ctx->node[leftIdx].val), &(ctx->node[rightIdx].val));
if (0 < rightLeftResult) {
swapTarget = rightIdx;
}
}
}
}
if (swapTarget != BHEAP_INVALID_NODE) {
bHeap_Swap(ctx, nodeIdx, swapTarget);
bHeap_DownHeap(ctx, swapTarget);
}
}
}
static void bHeap_Add(BHeap_Ctx* const ctx, const BHEAP_VAL_TYPE val) {
ctx->node[ctx->size].val = val;
ctx->size++;
if (ctx->notifyNodeChange != NULL) {
const size_t node = ctx->size - 1;
ctx->notifyNodeChange(ctx, 1, &node);
}
bHeap_UpHeap(ctx, ctx->size - 1);
}
static void bHeap_RemoveTop(BHeap_Ctx* const ctx) {
if (ctx->size == 0) {
return;
}
if (ctx->size == 1) {
ctx->size--;
return;
}
ctx->node[0].val = ctx->node[ctx->size - 1].val;
if (ctx->notifyNodeChange != NULL) {
const size_t node = 0;
ctx->notifyNodeChange(ctx, 1, &node);
}
ctx->size--;
bHeap_DownHeap(ctx, 0);
}
static void bHeap_RemoveNode(BHeap_Ctx* const ctx, const size_t node) {
if (node == ctx->size - 1) {
ctx->size--;
}
else {
ctx->node[node].val = ctx->node[ctx->size - 1].val;
ctx->size--;
if (ctx->notifyNodeChange != NULL) {
ctx->notifyNodeChange(ctx, 1, &node);
}
bHeap_DownHeap(ctx, node);
bHeap_UpHeap(ctx, node);
}
}
static BHEAP_VAL_TYPE* bHeap_GetTopVal(const BHeap_Ctx* const ctx) {
return ctx->size == 0 ? NULL : &(ctx->node[0].val);
}
typedef struct {
uint64_t cnt;
size_t* child;
size_t numChild;
size_t maxNumChild;
} Tree_Node;
#define TREE_INIT_ALLOC (128)
static Tree_Node tree_Node[200000];
static void tree_Init(const uint64_t N) {
for (uint64_t i = 0; i < N; i++) {
tree_Node[i].cnt = 0;
tree_Node[i].numChild = 0;
tree_Node[i].child = malloc(sizeof(size_t) * TREE_INIT_ALLOC);
tree_Node[i].maxNumChild = TREE_INIT_ALLOC;
}
}
static void tree_AddChild(const size_t parent, const size_t child) {
if (tree_Node[parent].maxNumChild <= tree_Node[parent].numChild) {
tree_Node[parent].child = realloc(tree_Node[parent].child, sizeof(size_t) * tree_Node[parent].maxNumChild * 2);
tree_Node[parent].maxNumChild *= 2;
}
tree_Node[parent].child[tree_Node[parent].numChild] = child;
tree_Node[parent].numChild++;
}
static BHeap_Node BN_Asc[200000];
static BHeap_Node BN_Desc[200000];
static int _bHeap_Compare_Asc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
return parent->val <= node->val ? -1 : 1;
}
static int _bHeap_Compare_Desc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
return parent->val >= node->val ? -1 : 1;
}
static size_t PBHeap_Asc_Idx[200000];
static size_t PBHeap_Desc_Idx[200000];
static void _bHeap_NotifyNodeChange_Asc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) {
for (size_t i = 0; i < nodeListSize; i++) {
PBHeap_Asc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i];
}
}
static void _bHeap_NotifyNodeChange_Desc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) {
for (size_t i = 0; i < nodeListSize; i++) {
PBHeap_Desc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i];
}
}
#define MOD_VAL (UINT64_C(1000000007))
static uint64_t a[100000];
int main(void) {
uint64_t N;
scanf("%"PRIu64, &N);
for (uint64_t i = 0; i < N; i++) {
scanf("%"PRIu64, &a[i]);
}
qsort(a, N, sizeof(uint64_t), compare_u64_asc);
uint64_t contLength = 1;
uint64_t delCnt = 0;
for (uint64_t i = 1; i < N; i++) {
if (a[i] != a[i - 1]) {
if (a[i - 1] <= contLength) {
delCnt += contLength - a[i - 1];
}
else {
delCnt += contLength;
}
contLength = 1;
}
else {
contLength++;
}
}
if (a[N - 1] <= contLength) {
delCnt += contLength - a[N - 1];
}
else {
delCnt += contLength;
}
printf("%"PRIu64"\n", delCnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190320/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190320/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lu\00", align 1
@a = internal global [100000 x i64] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [5 x i8] c"%lu\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_sz_asc(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
%cmp = icmp ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_sz_desc(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
%cmp = icmp ugt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_i64_asc(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
%cmp = icmp slt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_i64_desc(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
%cmp = icmp sgt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_u64_asc(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 ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_u64_desc(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
%cmp = icmp ugt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_c_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%1 = load i8, ptr %b, align 1, !tbaa !9
%cmp = icmp slt i8 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_c_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%1 = load i8, ptr %b, align 1, !tbaa !9
%cmp = icmp sgt i8 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_dp_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !10
%1 = load double, ptr %b, align 8, !tbaa !10
%cmp = fcmp olt double %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp57.not = icmp eq i64 %0, 0
br i1 %cmp57.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa56 = phi i64 [ 0, %entry ], [ %4, %for.body ]
call void @qsort(ptr noundef nonnull @a, i64 noundef %.lcssa56, i64 noundef 8, ptr noundef nonnull @compare_u64_asc) #5
%1 = load i64, ptr %N, align 8, !tbaa !5
%cmp459 = icmp ugt i64 %1, 1
br i1 %cmp459, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond.cleanup
%.pre = load i64, ptr @a, align 16, !tbaa !5
%2 = add i64 %1, -1
%xtraiter = and i64 %2, 1
%3 = icmp eq i64 %1, 2
br i1 %3, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %2, -2
br label %for.body6
for.body: ; preds = %entry, %for.body
%i.058 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %i.058
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw i64 %i.058, 1
%4 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp ult i64 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !12
for.cond.cleanup5.loopexit.unr-lcssa: ; preds = %for.inc21.1, %for.body6.preheader
%contLength.1.lcssa.ph = phi i64 [ undef, %for.body6.preheader ], [ %contLength.1.1, %for.inc21.1 ]
%delCnt.2.lcssa.ph = phi i64 [ undef, %for.body6.preheader ], [ %delCnt.2.1, %for.inc21.1 ]
%.unr = phi i64 [ %.pre, %for.body6.preheader ], [ %9, %for.inc21.1 ]
%i2.062.unr = phi i64 [ 1, %for.body6.preheader ], [ %inc22.1, %for.inc21.1 ]
%delCnt.061.unr = phi i64 [ 0, %for.body6.preheader ], [ %delCnt.2.1, %for.inc21.1 ]
%contLength.060.unr = phi i64 [ 1, %for.body6.preheader ], [ %contLength.1.1, %for.inc21.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup5, label %for.body6.epil
for.body6.epil: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa
%arrayidx7.epil = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %i2.062.unr
%5 = load i64, ptr %arrayidx7.epil, align 8, !tbaa !5
%cmp9.not.epil = icmp eq i64 %5, %.unr
br i1 %cmp9.not.epil, label %if.else18.epil, label %if.then.epil
if.then.epil: ; preds = %for.body6.epil
%cmp12.not.epil = icmp ugt i64 %.unr, %contLength.060.unr
%sub16.epil = select i1 %cmp12.not.epil, i64 0, i64 %.unr
%sub16.pn.epil = add i64 %delCnt.061.unr, %contLength.060.unr
%delCnt.1.epil = sub i64 %sub16.pn.epil, %sub16.epil
br label %for.cond.cleanup5
if.else18.epil: ; preds = %for.body6.epil
%inc19.epil = add i64 %contLength.060.unr, 1
br label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa, %if.else18.epil, %if.then.epil, %for.cond.cleanup
%contLength.0.lcssa = phi i64 [ 1, %for.cond.cleanup ], [ %contLength.1.lcssa.ph, %for.cond.cleanup5.loopexit.unr-lcssa ], [ 1, %if.then.epil ], [ %inc19.epil, %if.else18.epil ]
%delCnt.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ %delCnt.2.lcssa.ph, %for.cond.cleanup5.loopexit.unr-lcssa ], [ %delCnt.1.epil, %if.then.epil ], [ %delCnt.061.unr, %if.else18.epil ]
%sub24 = add i64 %1, -1
%arrayidx25 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %sub24
%6 = load i64, ptr %arrayidx25, align 8, !tbaa !5
%cmp26.not = icmp ugt i64 %6, %contLength.0.lcssa
%sub30 = select i1 %cmp26.not, i64 0, i64 %6
%sub30.pn = add i64 %delCnt.0.lcssa, %contLength.0.lcssa
%delCnt.3 = sub i64 %sub30.pn, %sub30
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %delCnt.3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #5
ret i32 0
for.body6: ; preds = %for.inc21.1, %for.body6.preheader.new
%7 = phi i64 [ %.pre, %for.body6.preheader.new ], [ %9, %for.inc21.1 ]
%i2.062 = phi i64 [ 1, %for.body6.preheader.new ], [ %inc22.1, %for.inc21.1 ]
%delCnt.061 = phi i64 [ 0, %for.body6.preheader.new ], [ %delCnt.2.1, %for.inc21.1 ]
%contLength.060 = phi i64 [ 1, %for.body6.preheader.new ], [ %contLength.1.1, %for.inc21.1 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.inc21.1 ]
%arrayidx7 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %i2.062
%8 = load i64, ptr %arrayidx7, align 8, !tbaa !5
%cmp9.not = icmp eq i64 %8, %7
br i1 %cmp9.not, label %if.else18, label %if.then
if.then: ; preds = %for.body6
%cmp12.not = icmp ugt i64 %7, %contLength.060
%sub16 = select i1 %cmp12.not, i64 0, i64 %7
%sub16.pn = add i64 %delCnt.061, %contLength.060
%delCnt.1 = sub i64 %sub16.pn, %sub16
br label %for.inc21
if.else18: ; preds = %for.body6
%inc19 = add i64 %contLength.060, 1
br label %for.inc21
for.inc21: ; preds = %if.then, %if.else18
%contLength.1 = phi i64 [ 1, %if.then ], [ %inc19, %if.else18 ]
%delCnt.2 = phi i64 [ %delCnt.1, %if.then ], [ %delCnt.061, %if.else18 ]
%inc22 = add nuw i64 %i2.062, 1
%arrayidx7.1 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %inc22
%9 = load i64, ptr %arrayidx7.1, align 8, !tbaa !5
%cmp9.not.1 = icmp eq i64 %9, %8
br i1 %cmp9.not.1, label %if.else18.1, label %if.then.1
if.then.1: ; preds = %for.inc21
%cmp12.not.1 = icmp ugt i64 %8, %contLength.1
%sub16.1 = select i1 %cmp12.not.1, i64 0, i64 %8
%sub16.pn.1 = add i64 %delCnt.2, %contLength.1
%delCnt.1.1 = sub i64 %sub16.pn.1, %sub16.1
br label %for.inc21.1
if.else18.1: ; preds = %for.inc21
%inc19.1 = add i64 %contLength.1, 1
br label %for.inc21.1
for.inc21.1: ; preds = %if.else18.1, %if.then.1
%contLength.1.1 = phi i64 [ 1, %if.then.1 ], [ %inc19.1, %if.else18.1 ]
%delCnt.2.1 = phi i64 [ %delCnt.1.1, %if.then.1 ], [ %delCnt.2, %if.else18.1 ]
%inc22.1 = add nuw i64 %i2.062, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup5.loopexit.unr-lcssa, label %for.body6, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
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 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct{
int b;
int c;
} Node;
int cmp(const void *p, const void *q){
return *(int *)p - *(int *)q;
}
int main(void){
int ans=0, blen, i, j, N, a[100000];
Node n[100000];
scanf("%d", &N);
for (i = 0; i < N; i++){
scanf("%d", &a[i]);
}
qsort(a, N, sizeof(int), cmp);
i = 0;
j = 0;
for (i = 0; i < N; i++){
(n + j)->b++;
//printf("(n+%d)->b = %d\n", j, (n + j)->b);
(n + j)->c = a[i];
//printf("(n+%d)->c = %d\n", j, (n + j)->c);
if (a[i] != a[i + 1]){
j++;
}
}
blen = j;
for (i = 0; i < blen; i++){
if((n+i)->b == (n+i)->c){
//printf("(n+%d)->b = %d , (n+%d)->c = %d\n", i,(n + i)->b,i,(n + i)->c);
}
else if ((n + i)->b > (n + i)->c){
//printf("B\n");
ans += (n + i)->b - (n + i)->c;
} else {
//printf("C\n");
ans += (n + i)->b;
}
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190364/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190364/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #0 {
entry:
%0 = load i32, ptr %p, align 4, !tbaa !5
%1 = load i32, ptr %q, 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
%a = alloca [100000 x i32], align 16
%n = alloca [100000 x %struct.Node], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp93 = icmp sgt i32 %0, 0
br i1 %cmp93, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre113 = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre113, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #5
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp395 = icmp sgt i32 %3, 0
br i1 %cmp395, label %for.body5.preheader, label %for.end68
for.body5.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%.pre = load i32, ptr %a, align 16, !tbaa !5
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %3, 1
br i1 %4, label %for.cond23.preheader.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body5
for.cond23.preheader.unr-lcssa.loopexit: ; preds = %for.body5
%5 = add nuw nsw i64 %indvars.iv105, 3
br label %for.cond23.preheader.unr-lcssa
for.cond23.preheader.unr-lcssa: ; preds = %for.cond23.preheader.unr-lcssa.loopexit, %for.body5.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body5.preheader ], [ %spec.select.1, %for.cond23.preheader.unr-lcssa.loopexit ]
%.unr = phi i32 [ %.pre, %for.body5.preheader ], [ %13, %for.cond23.preheader.unr-lcssa.loopexit ]
%indvars.iv105.unr = phi i64 [ 1, %for.body5.preheader ], [ %5, %for.cond23.preheader.unr-lcssa.loopexit ]
%j.097.unr = phi i32 [ 0, %for.body5.preheader ], [ %spec.select.1, %for.cond23.preheader.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond23.preheader, label %for.body5.epil
for.body5.epil: ; preds = %for.cond23.preheader.unr-lcssa
%idx.ext.epil = zext i32 %j.097.unr to i64
%add.ptr.epil = getelementptr inbounds %struct.Node, ptr %n, i64 %idx.ext.epil
%6 = load i32, ptr %add.ptr.epil, align 8, !tbaa !11
%inc7.epil = add nsw i32 %6, 1
store i32 %inc7.epil, ptr %add.ptr.epil, align 8, !tbaa !11
%c.epil = getelementptr inbounds %struct.Node, ptr %n, i64 %idx.ext.epil, i32 1
store i32 %.unr, ptr %c.epil, align 4, !tbaa !13
%arrayidx16.epil = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv105.unr
%7 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
%cmp17.not.epil = icmp ne i32 %.unr, %7
%inc19.epil = zext i1 %cmp17.not.epil to i32
%spec.select.epil = add nuw nsw i32 %j.097.unr, %inc19.epil
br label %for.cond23.preheader
for.cond23.preheader: ; preds = %for.cond23.preheader.unr-lcssa, %for.body5.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.cond23.preheader.unr-lcssa ], [ %spec.select.epil, %for.body5.epil ]
%cmp2499.not = icmp eq i32 %spec.select.lcssa, 0
br i1 %cmp2499.not, label %for.end68, label %for.body26.preheader
for.body26.preheader: ; preds = %for.cond23.preheader
%wide.trip.count111 = zext i32 %spec.select.lcssa to i64
%xtraiter118 = and i64 %wide.trip.count111, 1
%8 = icmp eq i32 %spec.select.lcssa, 1
br i1 %8, label %for.end68.loopexit.unr-lcssa, label %for.body26.preheader.new
for.body26.preheader.new: ; preds = %for.body26.preheader
%unroll_iter121 = and i64 %wide.trip.count111, 4294967294
br label %for.body26
for.body5: ; preds = %for.body5, %for.body5.preheader.new
%9 = phi i32 [ %.pre, %for.body5.preheader.new ], [ %13, %for.body5 ]
%indvars.iv105 = phi i64 [ 0, %for.body5.preheader.new ], [ %indvars.iv.next106.1, %for.body5 ]
%j.097 = phi i32 [ 0, %for.body5.preheader.new ], [ %spec.select.1, %for.body5 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.body5 ]
%idx.ext = zext i32 %j.097 to i64
%add.ptr = getelementptr inbounds %struct.Node, ptr %n, i64 %idx.ext
%10 = load i32, ptr %add.ptr, align 8, !tbaa !11
%inc7 = add nsw i32 %10, 1
store i32 %inc7, ptr %add.ptr, align 8, !tbaa !11
%c = getelementptr inbounds %struct.Node, ptr %n, i64 %idx.ext, i32 1
store i32 %9, ptr %c, align 4, !tbaa !13
%indvars.iv.next106 = or i64 %indvars.iv105, 1
%arrayidx16 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv.next106
%11 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17.not = icmp ne i32 %9, %11
%inc19 = zext i1 %cmp17.not to i32
%spec.select = add nuw nsw i32 %j.097, %inc19
%idx.ext.1 = zext i32 %spec.select to i64
%add.ptr.1 = getelementptr inbounds %struct.Node, ptr %n, i64 %idx.ext.1
%12 = load i32, ptr %add.ptr.1, align 8, !tbaa !11
%inc7.1 = add nsw i32 %12, 1
store i32 %inc7.1, ptr %add.ptr.1, align 8, !tbaa !11
%c.1 = getelementptr inbounds %struct.Node, ptr %n, i64 %idx.ext.1, i32 1
store i32 %11, ptr %c.1, align 4, !tbaa !13
%indvars.iv.next106.1 = add nuw nsw i64 %indvars.iv105, 2
%arrayidx16.1 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv.next106.1
%13 = load i32, ptr %arrayidx16.1, align 8, !tbaa !5
%cmp17.not.1 = icmp ne i32 %11, %13
%inc19.1 = zext i1 %cmp17.not.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc19.1
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond23.preheader.unr-lcssa.loopexit, label %for.body5, !llvm.loop !14
for.body26: ; preds = %for.body26, %for.body26.preheader.new
%indvars.iv108 = phi i64 [ 0, %for.body26.preheader.new ], [ %indvars.iv.next109.1, %for.body26 ]
%ans.0100 = phi i32 [ 0, %for.body26.preheader.new ], [ %ans.1.1, %for.body26 ]
%niter122 = phi i64 [ 0, %for.body26.preheader.new ], [ %niter122.next.1, %for.body26 ]
%add.ptr29 = getelementptr inbounds %struct.Node, ptr %n, i64 %indvars.iv108
%14 = load i32, ptr %add.ptr29, align 16, !tbaa !11
%c34 = getelementptr inbounds %struct.Node, ptr %n, i64 %indvars.iv108, i32 1
%15 = load i32, ptr %c34, align 4, !tbaa !13
%cmp35 = icmp eq i32 %14, %15
%cmp46 = icmp sgt i32 %14, %15
%sub = add i32 %14, %ans.0100
%add57 = select i1 %cmp46, i32 %15, i32 0
%spec.select116 = sub i32 %sub, %add57
%ans.1 = select i1 %cmp35, i32 %ans.0100, i32 %spec.select116
%indvars.iv.next109 = or i64 %indvars.iv108, 1
%add.ptr29.1 = getelementptr inbounds %struct.Node, ptr %n, i64 %indvars.iv.next109
%16 = load i32, ptr %add.ptr29.1, align 8, !tbaa !11
%c34.1 = getelementptr inbounds %struct.Node, ptr %n, i64 %indvars.iv.next109, i32 1
%17 = load i32, ptr %c34.1, align 4, !tbaa !13
%cmp35.1 = icmp eq i32 %16, %17
%cmp46.1 = icmp sgt i32 %16, %17
%sub.1 = add i32 %16, %ans.1
%add57.1 = select i1 %cmp46.1, i32 %17, i32 0
%spec.select116.1 = sub i32 %sub.1, %add57.1
%ans.1.1 = select i1 %cmp35.1, i32 %ans.1, i32 %spec.select116.1
%indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 2
%niter122.next.1 = add i64 %niter122, 2
%niter122.ncmp.1 = icmp eq i64 %niter122.next.1, %unroll_iter121
br i1 %niter122.ncmp.1, label %for.end68.loopexit.unr-lcssa, label %for.body26, !llvm.loop !15
for.end68.loopexit.unr-lcssa: ; preds = %for.body26, %for.body26.preheader
%ans.1.lcssa.ph = phi i32 [ undef, %for.body26.preheader ], [ %ans.1.1, %for.body26 ]
%indvars.iv108.unr = phi i64 [ 0, %for.body26.preheader ], [ %indvars.iv.next109.1, %for.body26 ]
%ans.0100.unr = phi i32 [ 0, %for.body26.preheader ], [ %ans.1.1, %for.body26 ]
%lcmp.mod119.not = icmp eq i64 %xtraiter118, 0
br i1 %lcmp.mod119.not, label %for.end68, label %for.body26.epil
for.body26.epil: ; preds = %for.end68.loopexit.unr-lcssa
%add.ptr29.epil = getelementptr inbounds %struct.Node, ptr %n, i64 %indvars.iv108.unr
%18 = load i32, ptr %add.ptr29.epil, align 8, !tbaa !11
%c34.epil = getelementptr inbounds %struct.Node, ptr %n, i64 %indvars.iv108.unr, i32 1
%19 = load i32, ptr %c34.epil, align 4, !tbaa !13
%cmp35.epil = icmp eq i32 %18, %19
%cmp46.epil = icmp sgt i32 %18, %19
%sub.epil = add i32 %18, %ans.0100.unr
%add57.epil = select i1 %cmp46.epil, i32 %19, i32 0
%spec.select116.epil = sub i32 %sub.epil, %add57.epil
%ans.1.epil = select i1 %cmp35.epil, i32 %ans.0100.unr, i32 %spec.select116.epil
br label %for.end68
for.end68: ; preds = %for.body26.epil, %for.end68.loopexit.unr-lcssa, %for.end, %for.cond23.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond23.preheader ], [ 0, %for.end ], [ %ans.1.lcssa.ph, %for.end68.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body26.epil ]
%call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 400000, 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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !6, i64 0}
!12 = !{!"", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#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;
using std::get;
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;
}
#define BEGCMP(NAME) int32_t NAME (const void *left, const void *right)
#define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right
#define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1
// 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;
// }
BEGCMP(pullcomp){
DEFLR(ull);
CMPRET(l, r);
return 0;
}
BEGCMP(prevcomp){
DEFLR(ull);
CMPRET(r, l);
return 0;
}
BEGCMP(psllcomp){
DEFLR(sll);
CMPRET(l, r);
return 0;
}
BEGCMP(pcharcomp){
DEFLR(char);
CMPRET(l, r);
return 0;
}
BEGCMP(pdoublecomp){
DEFLR(double);
CMPRET(l, r);
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
BEGCMP(phwllABcomp){
DEFLR(hwll);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwllREVcomp){
DEFLR(hwll);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
return 0;
}
BEGCMP(ptriplecomp){
DEFLR(hwllc);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleREVcomp){
DEFLR(hwllc);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
CMPRET(l.c, r.c);
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 + 5];
// ull a[N_MAX + 5];
// sll a[3001][3001];
sll b[N_MAX + 5];
// ull b[N_MAX + 5];
// sll b[3001][3001];
sll c[N_MAX + 5];
sll d[N_MAX + 5];
sll e[N_MAX];
char s[N_MAX + 1];
// char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
char u[N_MAX + 1];
hwll xy[N_MAX + 5];
hwllc tup[N_MAX + 5];
// sll table[3005][3005];
ull gin[N_MAX];
// here we go
hwll ming[N_MAX];
ull ablesize[N_MAX];
bool iswatched[N_MAX];
bool mind[N_MAX];
bool valide[N_MAX];
ull parent[N_MAX], size[N_MAX];
ull versize[N_MAX];
void init (ull n) {
sll i;
for (i = 0; i < n; i++) {
parent[i] = i;
size[i] = 1;
versize[i] = d[i];
}
}
ull find (ull x) {
if (parent[x] == x) return x;
return parent[x] = find(parent[x]);
}
bool unite (ull a, ull b) {
a = find(a);
b = find(b);
if (a == b) return false;
if (size[a] < size[b]) {
a ^= b;
b ^= a;
a ^= b;
}
size[a] += size[b];
parent[b] = a;
versize[a] += versize[b];
return true;
}
void dfs (ull v, ull x, ull pe) {
// printf("%lld!\n", v);
for (sll i = gin[v]; i < gin[v + 1]; i++) {
ull e = ming[i].b;
if (e == pe || iswatched[e]) continue;
valide[e] = true;
iswatched[e] = true;
dfs(a[e] ^ b[e] ^ v, x, e);
}
}
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;
init(n);
for (i = 0; i < m; i++) {
xy[i] = (hwll){c[i], i};
}
qsort(xy, m, sizeof(hwll), phwllABcomp);
ull len = 0;
for (i = 0; i < m; i++) {
ull e = xy[i].b;
if (unite(a[e], b[e])) {
mind[e] = true;
ming[len++] = (hwll){a[e], e};
ming[len++] = (hwll){b[e], e};
ablesize[e] = versize[find(a[e])];
// printf("%lld,,, %llu\n", e, versize[find(a[e])]);
}
}
qsort(ming, len, sizeof(hwll), phwllABcomp);
i = j = 0;
while (i <= n) {
gin[i] = j;
while (j < len && ming[j].a == i) j++;
i++;
}
for (i = m - 1; i >= 0; i--) {
ull e = xy[i].b;
iswatched[e] = true;
if (!mind[e]) continue;
if (valide[e]) continue;
if (ablesize[e] >= c[e]) {
valide[e] = true;
dfs(a[e], e, e);
dfs(b[e], e, e);
}
}
init(n);
for (i = 0; i < m; i++) {
if (valide[i]) {
// printf("%lld!\n", i);
unite(a[i], b[i]);
}
}
// for (i = 0; i < n; i++) {
// printf("%lld parent: %lld size: %lld\n", i, find(i), versize[find(i)]);
// }
for (i = 0; i < m; i++) {
if (find(a[i]) != find(b[i]) || versize[find(a[i])] < c[i]) {
// printf("%lld oops (%lld != %lld or %lld < %lld)\n", i, find(a[i]), find(b[i]), versize[find(a[i])], c[i]);
result++;
}
}
printf("%lld\n", result);
// printf("%.15lf\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("Hanako");
return 0;
fail:
// puts("NO");
// puts("No");
puts("0");
// puts("-1");
// puts("-1 -1 -1");
// puts("Jiro");
return 1;
}
int32_t main (int argc, char *argv[]) {
int32_t i, j;
n = 3;
m = 0;
// scanf("%llu%llu", &h, &w);
scanf("%llu%llu", &n, &m);
// scanf("%llu", &k, &n, &m);
// scanf("%llu%llu", &h, &w);
// scanf("%s", s);
// scanf("%llu", &q);
// scanf("%lld%lld", &va, &vb, &vc, &vd);
// scanf("%llu%llu%llu", &ua, &ub, &uc, &ud, &ue);
// scanf("%s", t);
// scanf("%s", u);
// scanf("%llu", &k);
// scanf("%lld", &m);
for (i = 0; i < n; i++) {
scanf("%llu", &d[i]);
}
for (i = 0; i < m; 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]--;
// xy[i].a--;
// xy[i].b--;
// tup[i].a--;
// tup[i].b--;
}
// for (i = 0; i < m; i++) {
// scanf("%lld%lld", &a[i], &b[i]);
// a[i]--;
// b[i]--;
// }
// for (i = 0; i < q; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld", &c[i]);
// // xy[i].a--;
// // xy[i].b--;
// }
// for (i = 0; i < n; i++) {
// for (j = 0; j < m; j++) {
// scanf("%lld", &table[i][j]);
// // table[i][j]--;
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", s[i]);
// }
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190407/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190407/source.c"
target datalayout = "e-m:e-p270: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 }
@parent = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@size = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@d = dso_local global [1000005 x i64] zeroinitializer, align 16
@versize = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@gin = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@ming = dso_local global [1000000 x %struct.hwll] zeroinitializer, align 16
@iswatched = dso_local local_unnamed_addr global [1000000 x i8] zeroinitializer, align 16
@valide = dso_local local_unnamed_addr global [1000000 x i8] zeroinitializer, align 16
@a = dso_local global [1000005 x i64] zeroinitializer, align 16
@b = dso_local global [1000005 x i64] zeroinitializer, align 16
@n = dso_local global i64 0, align 8
@m = dso_local global i64 0, align 8
@xy = dso_local global [1000005 x %struct.hwll] zeroinitializer, align 16
@c = dso_local global [1000005 x i64] zeroinitializer, align 16
@mind = dso_local local_unnamed_addr global [1000000 x i8] zeroinitializer, align 16
@ablesize = dso_local local_unnamed_addr global [1000000 x i64] 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 [5 x i8] c"%llu\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@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
@e = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@u = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@tup = dso_local local_unnamed_addr global [1000005 x %struct.hwllc] 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 ult i64 %1, %0
%cmp1 = icmp ugt i64 %1, %0
%. = 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) #13
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #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) #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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
; Function Attrs: 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: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init(i64 noundef %n) local_unnamed_addr #7 {
entry:
%cmp10.not = icmp eq i64 %n, 0
br i1 %cmp10.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = shl nuw i64 %n, 3
tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @versize, ptr nonnull align 16 @d, i64 %0, i1 false), !tbaa !8
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader13, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%1 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %index
store <2 x i64> %vec.ind, ptr %1, align 16, !tbaa !8
%2 = getelementptr inbounds i64, ptr %1, i64 2
store <2 x i64> %step.add, ptr %2, align 16, !tbaa !8
%3 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %index
store <2 x i64> <i64 1, i64 1>, ptr %3, align 16, !tbaa !8
%4 = getelementptr inbounds i64, ptr %3, i64 2
store <2 x i64> <i64 1, i64 1>, ptr %4, align 16, !tbaa !8
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.end, label %for.body.preheader13
for.body.preheader13: ; preds = %for.body.preheader, %middle.block
%i.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader13, %for.body
%i.011 = phi i64 [ %inc, %for.body ], [ %i.011.ph, %for.body.preheader13 ]
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %i.011
store i64 %i.011, ptr %arrayidx, align 8, !tbaa !8
%arrayidx1 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %i.011
store i64 1, ptr %arrayidx1, align 8, !tbaa !8
%inc = add nuw nsw i64 %i.011, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !24
for.end: ; preds = %for.body, %middle.block, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @find(i64 noundef %x) local_unnamed_addr #7 {
entry:
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %x
%0 = load i64, ptr %arrayidx, align 8, !tbaa !8
%cmp = icmp eq i64 %0, %x
br i1 %cmp, label %common.ret7, label %if.end
common.ret7: ; preds = %entry, %if.end
%common.ret7.op = phi i64 [ %call, %if.end ], [ %x, %entry ]
ret i64 %common.ret7.op
if.end: ; preds = %entry
%call = tail call i64 @find(i64 noundef %0)
store i64 %call, ptr %arrayidx, align 8, !tbaa !8
br label %common.ret7
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local zeroext i1 @unite(i64 noundef %a, i64 noundef %b) local_unnamed_addr #8 {
entry:
%call = tail call i64 @find(i64 noundef %a)
%call1 = tail call i64 @find(i64 noundef %b)
%cmp = icmp ne i64 %call, %call1
br i1 %cmp, label %if.end, label %return
if.end: ; preds = %entry
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %call
%0 = load i64, ptr %arrayidx, align 8, !tbaa !8
%arrayidx2 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %call1
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !8
%cmp3 = icmp ult i64 %0, %1
%spec.select = select i1 %cmp3, i64 %call1, i64 %call
%spec.select30 = select i1 %cmp3, i64 %call, i64 %call1
%arrayidx8 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %spec.select30
%2 = load i64, ptr %arrayidx8, align 8, !tbaa !8
%arrayidx9 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %spec.select
%3 = load i64, ptr %arrayidx9, align 8, !tbaa !8
%add = add i64 %3, %2
store i64 %add, ptr %arrayidx9, align 8, !tbaa !8
%arrayidx10 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %spec.select30
store i64 %spec.select, ptr %arrayidx10, align 8, !tbaa !8
%arrayidx11 = getelementptr inbounds [1000000 x i64], ptr @versize, i64 0, i64 %spec.select30
%4 = load i64, ptr %arrayidx11, align 8, !tbaa !8
%arrayidx12 = getelementptr inbounds [1000000 x i64], ptr @versize, i64 0, i64 %spec.select
%5 = load i64, ptr %arrayidx12, align 8, !tbaa !8
%add13 = add i64 %5, %4
store i64 %add13, ptr %arrayidx12, align 8, !tbaa !8
br label %return
return: ; preds = %entry, %if.end
ret i1 %cmp
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs(i64 noundef %v, i64 noundef %x, i64 noundef %pe) local_unnamed_addr #7 {
entry:
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @gin, i64 0, i64 %v
%0 = load i64, ptr %arrayidx, align 8, !tbaa !8
%add = add i64 %v, 1
%arrayidx1 = getelementptr inbounds [1000000 x i64], ptr @gin, i64 0, i64 %add
%1 = load i64, ptr %arrayidx1, align 8, !tbaa !8
%cmp21 = icmp ult i64 %0, %1
br i1 %cmp21, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %cleanup, %entry
ret void
for.body: ; preds = %entry, %cleanup
%2 = phi i64 [ %8, %cleanup ], [ %1, %entry ]
%i.022 = phi i64 [ %inc, %cleanup ], [ %0, %entry ]
%b = getelementptr inbounds [1000000 x %struct.hwll], ptr @ming, i64 0, i64 %i.022, i32 1
%3 = load i64, ptr %b, align 8, !tbaa !25
%cmp3 = icmp eq i64 %3, %pe
br i1 %cmp3, label %cleanup, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body
%arrayidx4 = getelementptr inbounds [1000000 x i8], ptr @iswatched, i64 0, i64 %3
%4 = load i8, ptr %arrayidx4, align 1, !tbaa !27, !range !29, !noundef !30
%tobool.not = icmp eq i8 %4, 0
br i1 %tobool.not, label %if.end, label %cleanup
if.end: ; preds = %lor.lhs.false
%arrayidx5 = getelementptr inbounds [1000000 x i8], ptr @valide, i64 0, i64 %3
store i8 1, ptr %arrayidx5, align 1, !tbaa !27
store i8 1, ptr %arrayidx4, align 1, !tbaa !27
%arrayidx7 = getelementptr inbounds [1000005 x i64], ptr @a, i64 0, i64 %3
%5 = load i64, ptr %arrayidx7, align 8, !tbaa !8
%arrayidx8 = getelementptr inbounds [1000005 x i64], ptr @b, i64 0, i64 %3
%6 = load i64, ptr %arrayidx8, align 8, !tbaa !8
%7 = xor i64 %5, %6
%xor9 = xor i64 %7, %v
tail call void @dfs(i64 noundef %xor9, i64 noundef %x, i64 noundef %3)
%.pre = load i64, ptr %arrayidx1, align 8, !tbaa !8
br label %cleanup
cleanup: ; preds = %for.body, %lor.lhs.false, %if.end
%8 = phi i64 [ %2, %for.body ], [ %2, %lor.lhs.false ], [ %.pre, %if.end ]
%inc = add nuw nsw i64 %i.022, 1
%cmp = icmp ult i64 %inc, %8
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !31
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #9 {
entry:
%0 = load i64, ptr @n, align 8, !tbaa !8
%cmp10.not.i = icmp eq i64 %0, 0
br i1 %cmp10.not.i, label %init.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%1 = shl nuw i64 %0, 3
tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @versize, ptr nonnull align 16 @d, i64 %1, i1 false), !tbaa !8
%min.iters.check = icmp ult i64 %0, 4
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %0, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%2 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %index
store <2 x i64> %vec.ind, ptr %2, align 16, !tbaa !8
%3 = getelementptr inbounds i64, ptr %2, i64 2
store <2 x i64> %step.add, ptr %3, align 16, !tbaa !8
%4 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %index
store <2 x i64> <i64 1, i64 1>, ptr %4, align 16, !tbaa !8
%5 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> <i64 1, i64 1>, ptr %5, align 16, !tbaa !8
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !32
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
br i1 %cmp.n, label %init.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%i.011.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%i.011.i = phi i64 [ %inc.i, %for.body.i ], [ %i.011.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %i.011.i
store i64 %i.011.i, ptr %arrayidx.i, align 8, !tbaa !8
%arrayidx1.i = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %i.011.i
store i64 1, ptr %arrayidx1.i, align 8, !tbaa !8
%inc.i = add nuw nsw i64 %i.011.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %0
br i1 %exitcond.not.i, label %init.exit, label %for.body.i, !llvm.loop !33
init.exit: ; preds = %for.body.i, %middle.block, %entry
%7 = load i64, ptr @m, align 8, !tbaa !8
%cmp188.not = icmp eq i64 %7, 0
br i1 %cmp188.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %init.exit
%xtraiter = and i64 %7, 1
%8 = icmp eq i64 %7, 1
br i1 %8, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %7, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%i.0189 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [1000005 x %struct.hwll], ptr @xy, i64 0, i64 %i.0189
%arrayidx1 = getelementptr inbounds [1000005 x i64], ptr @c, i64 0, i64 %i.0189
%9 = load i64, ptr %arrayidx1, align 16, !tbaa !8
store i64 %9, ptr %arrayidx, align 16, !tbaa.struct !17
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8
store i64 %i.0189, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !18
%inc = or i64 %i.0189, 1
%arrayidx.1 = getelementptr inbounds [1000005 x %struct.hwll], ptr @xy, i64 0, i64 %inc
%arrayidx1.1 = getelementptr inbounds [1000005 x i64], ptr @c, i64 0, i64 %inc
%10 = load i64, ptr %arrayidx1.1, align 8, !tbaa !8
store i64 %10, ptr %arrayidx.1, align 16, !tbaa.struct !17
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx.1 = getelementptr inbounds i8, ptr %arrayidx.1, i64 8
store i64 %inc, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx.1, align 8, !tbaa.struct !18
%inc.1 = add nuw nsw i64 %i.0189, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !34
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%i.0189.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds [1000005 x %struct.hwll], ptr @xy, i64 0, i64 %i.0189.unr
%arrayidx1.epil = getelementptr inbounds [1000005 x i64], ptr @c, i64 0, i64 %i.0189.unr
%11 = load i64, ptr %arrayidx1.epil, align 8, !tbaa !8
store i64 %11, ptr %arrayidx.epil, align 16, !tbaa.struct !17
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx.epil = getelementptr inbounds i8, ptr %arrayidx.epil, i64 8
store i64 %i.0189.unr, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx.epil, align 8, !tbaa.struct !18
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %init.exit
tail call void @qsort(ptr noundef nonnull @xy, i64 noundef %7, i64 noundef 16, ptr noundef nonnull @phwllABcomp) #14
%12 = load i64, ptr @m, align 8, !tbaa !8
%cmp3190.not = icmp eq i64 %12, 0
br i1 %cmp3190.not, label %for.end28, label %for.body4
for.body4: ; preds = %for.end, %if.end
%i.1192 = phi i64 [ %inc27, %if.end ], [ 0, %for.end ]
%len.0191 = phi i64 [ %len.1, %if.end ], [ 0, %for.end ]
%b6 = getelementptr inbounds [1000005 x %struct.hwll], ptr @xy, i64 0, i64 %i.1192, i32 1
%13 = load i64, ptr %b6, align 8, !tbaa !25
%arrayidx7 = getelementptr inbounds [1000005 x i64], ptr @a, i64 0, i64 %13
%14 = load i64, ptr %arrayidx7, align 8, !tbaa !8
%arrayidx8 = getelementptr inbounds [1000005 x i64], ptr @b, i64 0, i64 %13
%15 = load i64, ptr %arrayidx8, align 8, !tbaa !8
%call.i = tail call i64 @find(i64 noundef %14)
%call1.i = tail call i64 @find(i64 noundef %15)
%cmp.i.not = icmp eq i64 %call.i, %call1.i
br i1 %cmp.i.not, label %if.end, label %if.then
if.then: ; preds = %for.body4
%arrayidx.i161 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %call.i
%16 = load i64, ptr %arrayidx.i161, align 8, !tbaa !8
%arrayidx2.i = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %call1.i
%17 = load i64, ptr %arrayidx2.i, align 8, !tbaa !8
%cmp3.i = icmp ult i64 %16, %17
%spec.select.i = select i1 %cmp3.i, i64 %call1.i, i64 %call.i
%spec.select30.i = select i1 %cmp3.i, i64 %call.i, i64 %call1.i
%arrayidx8.i = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %spec.select30.i
%18 = load i64, ptr %arrayidx8.i, align 8, !tbaa !8
%arrayidx9.i = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %spec.select.i
%19 = load i64, ptr %arrayidx9.i, align 8, !tbaa !8
%add.i = add i64 %19, %18
store i64 %add.i, ptr %arrayidx9.i, align 8, !tbaa !8
%arrayidx10.i = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %spec.select30.i
store i64 %spec.select.i, ptr %arrayidx10.i, align 8, !tbaa !8
%arrayidx11.i = getelementptr inbounds [1000000 x i64], ptr @versize, i64 0, i64 %spec.select30.i
%20 = load i64, ptr %arrayidx11.i, align 8, !tbaa !8
%arrayidx12.i = getelementptr inbounds [1000000 x i64], ptr @versize, i64 0, i64 %spec.select.i
%21 = load i64, ptr %arrayidx12.i, align 8, !tbaa !8
%add13.i = add i64 %21, %20
store i64 %add13.i, ptr %arrayidx12.i, align 8, !tbaa !8
%arrayidx9 = getelementptr inbounds [1000000 x i8], ptr @mind, i64 0, i64 %13
store i8 1, ptr %arrayidx9, align 1, !tbaa !27
%inc10 = add i64 %len.0191, 1
%arrayidx11 = getelementptr inbounds [1000000 x %struct.hwll], ptr @ming, i64 0, i64 %len.0191
%22 = load i64, ptr %arrayidx7, align 8, !tbaa !8
store i64 %22, ptr %arrayidx11, align 16, !tbaa.struct !17
%.compoundliteral12.sroa.2.0.arrayidx11.sroa_idx = getelementptr inbounds i8, ptr %arrayidx11, i64 8
store i64 %13, ptr %.compoundliteral12.sroa.2.0.arrayidx11.sroa_idx, align 8, !tbaa.struct !18
%inc16 = add i64 %len.0191, 2
%arrayidx17 = getelementptr inbounds [1000000 x %struct.hwll], ptr @ming, i64 0, i64 %inc10
%23 = load i64, ptr %arrayidx8, align 8, !tbaa !8
store i64 %23, ptr %arrayidx17, align 16, !tbaa.struct !17
%.compoundliteral18.sroa.2.0.arrayidx17.sroa_idx = getelementptr inbounds i8, ptr %arrayidx17, i64 8
store i64 %13, ptr %.compoundliteral18.sroa.2.0.arrayidx17.sroa_idx, align 8, !tbaa.struct !18
%call23 = tail call i64 @find(i64 noundef %22)
%arrayidx24 = getelementptr inbounds [1000000 x i64], ptr @versize, i64 0, i64 %call23
%24 = load i64, ptr %arrayidx24, align 8, !tbaa !8
%arrayidx25 = getelementptr inbounds [1000000 x i64], ptr @ablesize, i64 0, i64 %13
store i64 %24, ptr %arrayidx25, align 8, !tbaa !8
br label %if.end
if.end: ; preds = %for.body4, %if.then
%len.1 = phi i64 [ %inc16, %if.then ], [ %len.0191, %for.body4 ]
%inc27 = add nuw nsw i64 %i.1192, 1
%25 = load i64, ptr @m, align 8, !tbaa !8
%cmp3 = icmp ult i64 %inc27, %25
br i1 %cmp3, label %for.body4, label %for.end28, !llvm.loop !35
for.end28: ; preds = %if.end, %for.end
%len.0.lcssa = phi i64 [ 0, %for.end ], [ %len.1, %if.end ]
tail call void @qsort(ptr noundef nonnull @ming, i64 noundef %len.0.lcssa, i64 noundef 16, ptr noundef nonnull @phwllABcomp) #14
%26 = load i64, ptr @n, align 8, !tbaa !8
br label %while.body
while.body: ; preds = %for.end28, %while.end
%i.2199 = phi i64 [ 0, %for.end28 ], [ %inc38, %while.end ]
%j.0198 = phi i64 [ 0, %for.end28 ], [ %j.1.lcssa, %while.end ]
%arrayidx30 = getelementptr inbounds [1000000 x i64], ptr @gin, i64 0, i64 %i.2199
store i64 %j.0198, ptr %arrayidx30, align 8, !tbaa !8
%cmp32194 = icmp ult i64 %j.0198, %len.0.lcssa
br i1 %cmp32194, label %land.rhs, label %while.end
land.rhs: ; preds = %while.body, %while.body36
%j.1195 = phi i64 [ %inc37, %while.body36 ], [ %j.0198, %while.body ]
%arrayidx33 = getelementptr inbounds [1000000 x %struct.hwll], ptr @ming, i64 0, i64 %j.1195
%27 = load i64, ptr %arrayidx33, align 16, !tbaa !36
%cmp35 = icmp eq i64 %27, %i.2199
br i1 %cmp35, label %while.body36, label %while.end
while.body36: ; preds = %land.rhs
%inc37 = add i64 %j.1195, 1
%exitcond209.not = icmp eq i64 %inc37, %len.0.lcssa
br i1 %exitcond209.not, label %while.end, label %land.rhs, !llvm.loop !37
while.end: ; preds = %land.rhs, %while.body36, %while.body
%j.1.lcssa = phi i64 [ %j.0198, %while.body ], [ %len.0.lcssa, %while.body36 ], [ %j.1195, %land.rhs ]
%inc38 = add nuw i64 %i.2199, 1
%exitcond210.not = icmp eq i64 %i.2199, %26
br i1 %exitcond210.not, label %while.end39, label %while.body, !llvm.loop !38
while.end39: ; preds = %while.end
%28 = load i64, ptr @m, align 8, !tbaa !8
%i.3200 = add i64 %28, -1
%cmp41201 = icmp sgt i64 %i.3200, -1
br i1 %cmp41201, label %for.body42, label %for.end63
for.body42: ; preds = %while.end39, %cleanup
%i.3202 = phi i64 [ %i.3, %cleanup ], [ %i.3200, %while.end39 ]
%b45 = getelementptr inbounds [1000005 x %struct.hwll], ptr @xy, i64 0, i64 %i.3202, i32 1
%29 = load i64, ptr %b45, align 8, !tbaa !25
%arrayidx46 = getelementptr inbounds [1000000 x i8], ptr @iswatched, i64 0, i64 %29
store i8 1, ptr %arrayidx46, align 1, !tbaa !27
%arrayidx47 = getelementptr inbounds [1000000 x i8], ptr @mind, i64 0, i64 %29
%30 = load i8, ptr %arrayidx47, align 1, !tbaa !27, !range !29, !noundef !30
%tobool.not = icmp eq i8 %30, 0
br i1 %tobool.not, label %cleanup, label %if.end49
if.end49: ; preds = %for.body42
%arrayidx50 = getelementptr inbounds [1000000 x i8], ptr @valide, i64 0, i64 %29
%31 = load i8, ptr %arrayidx50, align 1, !tbaa !27, !range !29, !noundef !30
%tobool51.not = icmp eq i8 %31, 0
br i1 %tobool51.not, label %if.end53, label %cleanup
if.end53: ; preds = %if.end49
%arrayidx54 = getelementptr inbounds [1000000 x i64], ptr @ablesize, i64 0, i64 %29
%32 = load i64, ptr %arrayidx54, align 8, !tbaa !8
%arrayidx55 = getelementptr inbounds [1000005 x i64], ptr @c, i64 0, i64 %29
%33 = load i64, ptr %arrayidx55, align 8, !tbaa !8
%cmp56.not = icmp ult i64 %32, %33
br i1 %cmp56.not, label %cleanup, label %if.then57
if.then57: ; preds = %if.end53
store i8 1, ptr %arrayidx50, align 1, !tbaa !27
%arrayidx59 = getelementptr inbounds [1000005 x i64], ptr @a, i64 0, i64 %29
%34 = load i64, ptr %arrayidx59, align 8, !tbaa !8
tail call void @dfs(i64 noundef %34, i64 noundef %29, i64 noundef %29)
%arrayidx60 = getelementptr inbounds [1000005 x i64], ptr @b, i64 0, i64 %29
%35 = load i64, ptr %arrayidx60, align 8, !tbaa !8
tail call void @dfs(i64 noundef %35, i64 noundef %29, i64 noundef %29)
br label %cleanup
cleanup: ; preds = %if.end53, %if.then57, %if.end49, %for.body42
%i.3 = add nsw i64 %i.3202, -1
%cmp41 = icmp sgt i64 %i.3202, 0
br i1 %cmp41, label %for.body42, label %for.end63.loopexit, !llvm.loop !39
for.end63.loopexit: ; preds = %cleanup
%.pre = load i64, ptr @n, align 8, !tbaa !8
br label %for.end63
for.end63: ; preds = %for.end63.loopexit, %while.end39
%36 = phi i64 [ %.pre, %for.end63.loopexit ], [ %26, %while.end39 ]
%cmp10.not.i162 = icmp eq i64 %36, 0
br i1 %cmp10.not.i162, label %init.exit170, label %for.body.preheader.i163
for.body.preheader.i163: ; preds = %for.end63
%37 = shl nuw i64 %36, 3
tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @versize, ptr nonnull align 16 @d, i64 %37, i1 false), !tbaa !8
%min.iters.check215 = icmp ult i64 %36, 4
br i1 %min.iters.check215, label %for.body.i164.preheader, label %vector.ph216
vector.ph216: ; preds = %for.body.preheader.i163
%n.vec218 = and i64 %36, -4
br label %vector.body221
vector.body221: ; preds = %vector.body221, %vector.ph216
%index222 = phi i64 [ 0, %vector.ph216 ], [ %index.next227, %vector.body221 ]
%vec.ind223 = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph216 ], [ %vec.ind.next226, %vector.body221 ]
%step.add224 = add <2 x i64> %vec.ind223, <i64 2, i64 2>
%38 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %index222
store <2 x i64> %vec.ind223, ptr %38, align 16, !tbaa !8
%39 = getelementptr inbounds i64, ptr %38, i64 2
store <2 x i64> %step.add224, ptr %39, align 16, !tbaa !8
%40 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %index222
store <2 x i64> <i64 1, i64 1>, ptr %40, align 16, !tbaa !8
%41 = getelementptr inbounds i64, ptr %40, i64 2
store <2 x i64> <i64 1, i64 1>, ptr %41, align 16, !tbaa !8
%index.next227 = add nuw i64 %index222, 4
%vec.ind.next226 = add <2 x i64> %vec.ind223, <i64 4, i64 4>
%42 = icmp eq i64 %index.next227, %n.vec218
br i1 %42, label %middle.block213, label %vector.body221, !llvm.loop !40
middle.block213: ; preds = %vector.body221
%cmp.n220 = icmp eq i64 %36, %n.vec218
br i1 %cmp.n220, label %init.exit170, label %for.body.i164.preheader
for.body.i164.preheader: ; preds = %for.body.preheader.i163, %middle.block213
%i.011.i165.ph = phi i64 [ 0, %for.body.preheader.i163 ], [ %n.vec218, %middle.block213 ]
br label %for.body.i164
for.body.i164: ; preds = %for.body.i164.preheader, %for.body.i164
%i.011.i165 = phi i64 [ %inc.i168, %for.body.i164 ], [ %i.011.i165.ph, %for.body.i164.preheader ]
%arrayidx.i166 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %i.011.i165
store i64 %i.011.i165, ptr %arrayidx.i166, align 8, !tbaa !8
%arrayidx1.i167 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %i.011.i165
store i64 1, ptr %arrayidx1.i167, align 8, !tbaa !8
%inc.i168 = add nuw nsw i64 %i.011.i165, 1
%exitcond.not.i169 = icmp eq i64 %inc.i168, %36
br i1 %exitcond.not.i169, label %init.exit170, label %for.body.i164, !llvm.loop !41
init.exit170: ; preds = %for.body.i164, %middle.block213, %for.end63
%43 = load i64, ptr @m, align 8, !tbaa !8
%cmp65203.not = icmp eq i64 %43, 0
br i1 %cmp65203.not, label %for.end95, label %for.body66
for.cond77.preheader: ; preds = %for.inc74
%44 = icmp eq i64 %54, 0
br i1 %44, label %for.end95, label %for.body79
for.body66: ; preds = %init.exit170, %for.inc74
%i.4204 = phi i64 [ %inc75, %for.inc74 ], [ 0, %init.exit170 ]
%arrayidx67 = getelementptr inbounds [1000000 x i8], ptr @valide, i64 0, i64 %i.4204
%45 = load i8, ptr %arrayidx67, align 1, !tbaa !27, !range !29, !noundef !30
%tobool68.not = icmp eq i8 %45, 0
br i1 %tobool68.not, label %for.inc74, label %if.then69
if.then69: ; preds = %for.body66
%arrayidx70 = getelementptr inbounds [1000005 x i64], ptr @a, i64 0, i64 %i.4204
%46 = load i64, ptr %arrayidx70, align 8, !tbaa !8
%arrayidx71 = getelementptr inbounds [1000005 x i64], ptr @b, i64 0, i64 %i.4204
%47 = load i64, ptr %arrayidx71, align 8, !tbaa !8
%call.i171 = tail call i64 @find(i64 noundef %46)
%call1.i172 = tail call i64 @find(i64 noundef %47)
%cmp.i173.not = icmp eq i64 %call.i171, %call1.i172
br i1 %cmp.i173.not, label %for.inc74, label %if.end.i174
if.end.i174: ; preds = %if.then69
%arrayidx.i175 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %call.i171
%48 = load i64, ptr %arrayidx.i175, align 8, !tbaa !8
%arrayidx2.i176 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %call1.i172
%49 = load i64, ptr %arrayidx2.i176, align 8, !tbaa !8
%cmp3.i177 = icmp ult i64 %48, %49
%spec.select.i178 = select i1 %cmp3.i177, i64 %call1.i172, i64 %call.i171
%spec.select30.i179 = select i1 %cmp3.i177, i64 %call.i171, i64 %call1.i172
%arrayidx8.i180 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %spec.select30.i179
%50 = load i64, ptr %arrayidx8.i180, align 8, !tbaa !8
%arrayidx9.i181 = getelementptr inbounds [1000000 x i64], ptr @size, i64 0, i64 %spec.select.i178
%51 = load i64, ptr %arrayidx9.i181, align 8, !tbaa !8
%add.i182 = add i64 %51, %50
store i64 %add.i182, ptr %arrayidx9.i181, align 8, !tbaa !8
%arrayidx10.i183 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %spec.select30.i179
store i64 %spec.select.i178, ptr %arrayidx10.i183, align 8, !tbaa !8
%arrayidx11.i184 = getelementptr inbounds [1000000 x i64], ptr @versize, i64 0, i64 %spec.select30.i179
%52 = load i64, ptr %arrayidx11.i184, align 8, !tbaa !8
%arrayidx12.i185 = getelementptr inbounds [1000000 x i64], ptr @versize, i64 0, i64 %spec.select.i178
%53 = load i64, ptr %arrayidx12.i185, align 8, !tbaa !8
%add13.i186 = add i64 %53, %52
store i64 %add13.i186, ptr %arrayidx12.i185, align 8, !tbaa !8
br label %for.inc74
for.inc74: ; preds = %if.end.i174, %if.then69, %for.body66
%inc75 = add nuw nsw i64 %i.4204, 1
%54 = load i64, ptr @m, align 8, !tbaa !8
%cmp65 = icmp ult i64 %inc75, %54
br i1 %cmp65, label %for.body66, label %for.cond77.preheader, !llvm.loop !42
for.body79: ; preds = %for.cond77.preheader, %for.inc93
%i.5207 = phi i64 [ %inc94, %for.inc93 ], [ 0, %for.cond77.preheader ]
%result.0206 = phi i64 [ %result.1, %for.inc93 ], [ 0, %for.cond77.preheader ]
%arrayidx80 = getelementptr inbounds [1000005 x i64], ptr @a, i64 0, i64 %i.5207
%55 = load i64, ptr %arrayidx80, align 8, !tbaa !8
%call81 = tail call i64 @find(i64 noundef %55)
%arrayidx82 = getelementptr inbounds [1000005 x i64], ptr @b, i64 0, i64 %i.5207
%56 = load i64, ptr %arrayidx82, align 8, !tbaa !8
%call83 = tail call i64 @find(i64 noundef %56)
%cmp84.not = icmp eq i64 %call81, %call83
br i1 %cmp84.not, label %lor.lhs.false, label %if.then90
lor.lhs.false: ; preds = %for.body79
%57 = load i64, ptr %arrayidx80, align 8, !tbaa !8
%call86 = tail call i64 @find(i64 noundef %57)
%arrayidx87 = getelementptr inbounds [1000000 x i64], ptr @versize, i64 0, i64 %call86
%58 = load i64, ptr %arrayidx87, align 8, !tbaa !8
%arrayidx88 = getelementptr inbounds [1000005 x i64], ptr @c, i64 0, i64 %i.5207
%59 = load i64, ptr %arrayidx88, align 8, !tbaa !8
%cmp89 = icmp ult i64 %58, %59
br i1 %cmp89, label %if.then90, label %for.inc93
if.then90: ; preds = %lor.lhs.false, %for.body79
%inc91 = add nsw i64 %result.0206, 1
br label %for.inc93
for.inc93: ; preds = %lor.lhs.false, %if.then90
%result.1 = phi i64 [ %inc91, %if.then90 ], [ %result.0206, %lor.lhs.false ]
%inc94 = add nuw nsw i64 %i.5207, 1
%60 = load i64, ptr @m, align 8, !tbaa !8
%cmp78 = icmp ult i64 %inc94, %60
br i1 %cmp78, label %for.body79, label %for.end95, !llvm.loop !43
for.end95: ; preds = %for.inc93, %init.exit170, %for.cond77.preheader
%result.0.lcssa = phi i64 [ 0, %for.cond77.preheader ], [ 0, %init.exit170 ], [ %result.1, %for.inc93 ]
%call96 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %result.0.lcssa)
ret i64 0
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #10
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #9 {
entry:
store i64 3, ptr @n, align 8, !tbaa !8
store i64 0, ptr @m, align 8, !tbaa !8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i64, ptr @n, align 8, !tbaa !8
%cmp35.not = icmp eq i64 %0, 0
br i1 %cmp35.not, label %for.cond3.preheader, label %for.body
for.cond3.preheader: ; preds = %for.body, %entry
%1 = load i64, ptr @m, align 8, !tbaa !8
%cmp538.not = icmp eq i64 %1, 0
br i1 %cmp538.not, label %for.end24, label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000005 x i64], ptr @d, 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
%2 = load i64, ptr @n, align 8, !tbaa !8
%cmp = icmp ugt i64 %2, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !44
for.body7: ; preds = %for.cond3.preheader, %for.body7
%indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body7 ], [ 0, %for.cond3.preheader ]
%arrayidx9 = getelementptr inbounds [1000005 x i64], ptr @a, i64 0, i64 %indvars.iv42
%call10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx9)
%arrayidx12 = getelementptr inbounds [1000005 x i64], ptr @b, i64 0, i64 %indvars.iv42
%call13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx12)
%arrayidx15 = getelementptr inbounds [1000005 x i64], ptr @c, i64 0, i64 %indvars.iv42
%call16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx15)
%3 = load i64, ptr %arrayidx9, align 8, !tbaa !8
%dec = add nsw i64 %3, -1
store i64 %dec, ptr %arrayidx9, align 8, !tbaa !8
%4 = load i64, ptr %arrayidx12, align 8, !tbaa !8
%dec21 = add nsw i64 %4, -1
store i64 %dec21, ptr %arrayidx12, align 8, !tbaa !8
%indvars.iv.next43 = add nuw i64 %indvars.iv42, 1
%5 = load i64, ptr @m, align 8, !tbaa !8
%cmp5 = icmp ugt i64 %5, %indvars.iv.next43
br i1 %cmp5, label %for.body7, label %for.end24, !llvm.loop !45
for.end24: ; preds = %for.body7, %for.cond3.preheader
%call25 = tail call i64 @solve()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #12
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { 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 #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 "no-trapping-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 = { nofree nounwind "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #13 = { nounwind willreturn memory(read) }
attributes #14 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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, !23}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !6, !23, !22}
!25 = !{!26, !9, i64 8}
!26 = !{!"", !9, i64 0, !9, i64 8}
!27 = !{!28, !28, i64 0}
!28 = !{!"_Bool", !10, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !6}
!32 = distinct !{!32, !6, !22, !23}
!33 = distinct !{!33, !6, !23, !22}
!34 = distinct !{!34, !6}
!35 = distinct !{!35, !6}
!36 = !{!26, !9, i64 0}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}
!39 = distinct !{!39, !6}
!40 = distinct !{!40, !6, !22, !23}
!41 = distinct !{!41, !6, !23, !22}
!42 = distinct !{!42, !6}
!43 = distinct !{!43, !6}
!44 = distinct !{!44, !6}
!45 = distinct !{!45, !6}
|
#include <stdio.h>
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");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190500/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190500/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@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>
#include<string.h>
#include<math.h>
#define loop(i, l, r) for(i=l; i<r; i++)/*Instead of function, (for).*/
#define rep(i,r) for(i=0; i<r; i++)
#define Min(a, b) ((a < b)? a : b)
#define Max(a, b) ((a > b)? a : b)
#define Abs(x) ((x>=0)? x : -x)/*Return the absolute value of x.*/
typedef long long int lli;
/*Return Combination ,(nCr)*/
int combi(int n, int r)
{
if(r==0 || r==n) return 1;
else return combi(n-1,r) + combi(n-1,r-1);
}
/*Return gcd(a, b)*/
int gcd(int a, int b){
if(b == 0) return a;
else return gcd(b, a % b);
}
int main(void)
{
lli a, b, k;
scanf("%lld%lld", &a, &b);
if((a+b)%2 != 0){
puts("IMPOSSIBLE");
return 0;
}
k = (a+b)/2;
printf("%lld", k);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190559/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190559/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"IMPOSSIBLE\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @combi(i32 noundef %n, i32 noundef %r) local_unnamed_addr #0 {
entry:
%cmp10 = icmp eq i32 %r, 0
%cmp111 = icmp eq i32 %r, %n
%or.cond12 = or i1 %cmp10, %cmp111
br i1 %or.cond12, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%r.tr15 = phi i32 [ %sub3, %if.else ], [ %r, %entry ]
%n.tr14 = phi i32 [ %sub, %if.else ], [ %n, %entry ]
%accumulator.tr13 = phi i32 [ %add, %if.else ], [ 0, %entry ]
%sub = add nsw i32 %n.tr14, -1
%call = tail call i32 @combi(i32 noundef %sub, i32 noundef %r.tr15)
%sub3 = add nsw i32 %r.tr15, -1
%add = add nsw i32 %call, %accumulator.tr13
%cmp = icmp eq i32 %sub3, 0
%cmp1 = icmp eq i32 %r.tr15, %n.tr14
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %return.loopexit, label %if.else
return.loopexit: ; preds = %if.else
%0 = add nsw i32 %add, 1
br label %return
return: ; preds = %return.loopexit, %entry
%accumulator.tr.lcssa = phi i32 [ 1, %entry ], [ %0, %return.loopexit ]
ret i32 %accumulator.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%b.tr6 = phi i32 [ %rem, %if.else ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.else ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.else ]
ret i32 %a.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%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.not = icmp eq i64 %2, 0
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
if.end: ; preds = %entry
%div = sdiv i64 %add, 2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
br label %cleanup
cleanup: ; preds = %if.end, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long 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)&1))
printf("%lld\n", (a+b)/2);
else
printf("IMPOSSIBLE\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190609/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190609/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@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, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%and = and i64 %sub, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %if.then, label %if.else
if.then: ; preds = %entry
%add = add nsw i64 %1, %0
%div = sdiv i64 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 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 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"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.