Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
#include<stdlib.h>
int main(){
int N;
if(scanf("%d", &N) == EOF) exit(1);
int A[N];
for(int i = 0; i < N; i++){
if(scanf("%d", &A[i]) == EOF) exit(1);
}
int s = 0;
for(int i = 0; i < N; i++){
s += A[i];
}
int sum = s / 2;
for(int i = 0; i < (N-1)/2; i++){
sum -= A[2*i];
}
//この時のsumの値*2が、N番目の山に降った雨量
int ans2[N];
ans2[N-1] = sum;
ans2[0] = A[N-1] - ans2[N-1];
for(int i = 1; i < N-1; i++){
ans2[i] = A[i-1] - ans2[i-1];
}
for(int i = 0; i < N; i++){
printf("%d ", ans2[i] * 2);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120033/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120033/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%cmp = icmp eq i32 %call, -1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
call void @exit(i32 noundef 1) #7
unreachable
if.end: ; preds = %entry
%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
%cmp185 = icmp sgt i32 %3, 0
br i1 %cmp185, label %for.body, label %for.cond.cleanup61
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp1, label %for.body, label %for.cond7.preheader, !llvm.loop !9
for.cond7.preheader: ; preds = %for.cond
%cmp887 = icmp sgt i32 %4, 0
br i1 %cmp887, label %for.body10.preheader, label %for.cond.cleanup61
for.body10.preheader: ; preds = %for.cond7.preheader
%wide.trip.count = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.body10.preheader173, label %vector.ph
vector.ph: ; preds = %for.body10.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.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi153 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%6 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load154 = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = add <4 x i32> %wide.load, %vec.phi
%9 = add <4 x i32> %wide.load154, %vec.phi153
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %9, %8
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup9, label %for.body10.preheader173
for.body10.preheader173: ; preds = %for.body10.preheader, %middle.block
%indvars.iv102.ph = phi i64 [ 0, %for.body10.preheader ], [ %n.vec, %middle.block ]
%s.088.ph = phi i32 [ 0, %for.body10.preheader ], [ %11, %middle.block ]
br label %for.body10
for.body: ; preds = %if.end, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %if.end ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%cmp3 = icmp eq i32 %call2, -1
br i1 %cmp3, label %if.then4, label %for.cond
if.then4: ; preds = %for.body
call void @exit(i32 noundef 1) #7
unreachable
for.cond.cleanup9: ; preds = %for.body10, %middle.block
%add.lcssa = phi i32 [ %11, %middle.block ], [ %add, %for.body10 ]
%12 = sdiv i32 %add.lcssa, 2
%sub = add i32 %4, -1
%cmp1991 = icmp sgt i32 %4, 2
br i1 %cmp1991, label %for.body21.preheader, label %for.cond.cleanup20.thread
for.cond.cleanup20.thread: ; preds = %for.cond.cleanup9
%13 = zext i32 %4 to i64
%vla28133 = alloca i32, i64 %13, align 16
%idxprom30134 = sext i32 %sub to i64
%arrayidx31135 = getelementptr inbounds i32, ptr %vla28133, i64 %idxprom30134
store i32 %12, ptr %arrayidx31135, align 4, !tbaa !5
%arrayidx34136 = getelementptr inbounds i32, ptr %vla, i64 %idxprom30134
%14 = load i32, ptr %arrayidx34136, align 4, !tbaa !5
%sub38137 = sub nsw i32 %14, %12
store i32 %sub38137, ptr %vla28133, align 16, !tbaa !5
br i1 %cmp887, label %for.body62.preheader, label %for.cond.cleanup61
for.body21.preheader: ; preds = %for.cond.cleanup9
%div18151152 = lshr i32 %sub, 1
%wide.trip.count109 = zext i32 %div18151152 to i64
%min.iters.check157 = icmp ult i32 %4, 19
br i1 %min.iters.check157, label %for.body21.preheader171, label %vector.ph158
vector.ph158: ; preds = %for.body21.preheader
%n.mod.vf159 = and i64 %wide.trip.count109, 7
%15 = icmp eq i64 %n.mod.vf159, 0
%16 = select i1 %15, i64 8, i64 %n.mod.vf159
%n.vec160 = sub nsw i64 %wide.trip.count109, %16
%17 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %12, i64 0
br label %vector.body162
vector.body162: ; preds = %vector.body162, %vector.ph158
%index163 = phi i64 [ 0, %vector.ph158 ], [ %index.next168, %vector.body162 ]
%vec.phi164 = phi <4 x i32> [ %17, %vector.ph158 ], [ %23, %vector.body162 ]
%vec.phi165 = phi <4 x i32> [ zeroinitializer, %vector.ph158 ], [ %24, %vector.body162 ]
%18 = shl nuw nsw i64 %index163, 1
%19 = shl i64 %index163, 1
%20 = or i64 %19, 8
%21 = getelementptr inbounds i32, ptr %vla, i64 %18
%22 = getelementptr inbounds i32, ptr %vla, i64 %20
%wide.vec = load <8 x i32>, ptr %21, align 16, !tbaa !5
%wide.vec166 = load <8 x i32>, ptr %22, align 16, !tbaa !5
%strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec167 = shufflevector <8 x i32> %wide.vec166, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%23 = sub <4 x i32> %vec.phi164, %strided.vec
%24 = sub <4 x i32> %vec.phi165, %strided.vec167
%index.next168 = add nuw i64 %index163, 8
%25 = icmp eq i64 %index.next168, %n.vec160
br i1 %25, label %middle.block155, label %vector.body162, !llvm.loop !14
middle.block155: ; preds = %vector.body162
%bin.rdx169 = add <4 x i32> %24, %23
%26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx169)
br label %for.body21.preheader171
for.body21.preheader171: ; preds = %for.body21.preheader, %middle.block155
%indvars.iv105.ph = phi i64 [ 0, %for.body21.preheader ], [ %n.vec160, %middle.block155 ]
%sum.092.ph = phi i32 [ %12, %for.body21.preheader ], [ %26, %middle.block155 ]
br label %for.body21
for.body10: ; preds = %for.body10.preheader173, %for.body10
%indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.body10 ], [ %indvars.iv102.ph, %for.body10.preheader173 ]
%s.088 = phi i32 [ %add, %for.body10 ], [ %s.088.ph, %for.body10.preheader173 ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv102
%27 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%add = add nsw i32 %27, %s.088
%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.cond.cleanup9, label %for.body10, !llvm.loop !15
for.cond.cleanup20: ; preds = %for.body21
%28 = zext i32 %4 to i64
%vla28 = alloca i32, i64 %28, align 16
%idxprom30 = sext i32 %sub to i64
%arrayidx31 = getelementptr inbounds i32, ptr %vla28, i64 %idxprom30
store i32 %sub24, ptr %arrayidx31, align 4, !tbaa !5
%arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %idxprom30
%29 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%sub38 = sub nsw i32 %29, %sub24
store i32 %sub38, ptr %vla28, align 16, !tbaa !5
br i1 %cmp1991, label %for.body45.preheader, label %for.cond59.preheader
for.body45.preheader: ; preds = %for.cond.cleanup20
%wide.trip.count115 = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %vla, i64 -1
%30 = add nsw i64 %wide.trip.count115, -1
%31 = add nsw i64 %wide.trip.count115, -2
%xtraiter = and i64 %30, 3
%32 = icmp ult i64 %31, 3
br i1 %32, label %for.cond59.preheader.loopexit.unr-lcssa, label %for.body45.preheader.new
for.body45.preheader.new: ; preds = %for.body45.preheader
%unroll_iter = and i64 %30, -4
%invariant.gep183 = getelementptr i32, ptr %vla28, i64 1
br label %for.body45
for.body21: ; preds = %for.body21.preheader171, %for.body21
%indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.body21 ], [ %indvars.iv105.ph, %for.body21.preheader171 ]
%sum.092 = phi i32 [ %sub24, %for.body21 ], [ %sum.092.ph, %for.body21.preheader171 ]
%33 = shl nuw nsw i64 %indvars.iv105, 1
%arrayidx23 = getelementptr inbounds i32, ptr %vla, i64 %33
%34 = load i32, ptr %arrayidx23, align 8, !tbaa !5
%sub24 = sub nsw i32 %sum.092, %34
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%exitcond110.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count109
br i1 %exitcond110.not, label %for.cond.cleanup20, label %for.body21, !llvm.loop !16
for.cond59.preheader.loopexit.unr-lcssa: ; preds = %for.body45, %for.body45.preheader
%.unr = phi i32 [ %sub38, %for.body45.preheader ], [ %sub52.3, %for.body45 ]
%indvars.iv111.unr = phi i64 [ 1, %for.body45.preheader ], [ %indvars.iv.next112.3, %for.body45 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond59.preheader, label %for.body45.epil
for.body45.epil: ; preds = %for.cond59.preheader.loopexit.unr-lcssa, %for.body45.epil
%35 = phi i32 [ %sub52.epil, %for.body45.epil ], [ %.unr, %for.cond59.preheader.loopexit.unr-lcssa ]
%indvars.iv111.epil = phi i64 [ %indvars.iv.next112.epil, %for.body45.epil ], [ %indvars.iv111.unr, %for.cond59.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body45.epil ], [ 0, %for.cond59.preheader.loopexit.unr-lcssa ]
%gep.epil = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv111.epil
%36 = load i32, ptr %gep.epil, align 4, !tbaa !5
%sub52.epil = sub nsw i32 %36, %35
%arrayidx54.epil = getelementptr inbounds i32, ptr %vla28, i64 %indvars.iv111.epil
store i32 %sub52.epil, ptr %arrayidx54.epil, align 4, !tbaa !5
%indvars.iv.next112.epil = add nuw nsw i64 %indvars.iv111.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond59.preheader, label %for.body45.epil, !llvm.loop !17
for.cond59.preheader: ; preds = %for.cond59.preheader.loopexit.unr-lcssa, %for.body45.epil, %for.cond.cleanup20
br i1 %cmp887, label %for.body62.preheader, label %for.cond.cleanup61
for.body62.preheader: ; preds = %for.cond.cleanup20.thread, %for.cond59.preheader
%vla28139150 = phi ptr [ %vla28133, %for.cond.cleanup20.thread ], [ %vla28, %for.cond59.preheader ]
br label %for.body62
for.body45: ; preds = %for.body45, %for.body45.preheader.new
%37 = phi i32 [ %sub38, %for.body45.preheader.new ], [ %sub52.3, %for.body45 ]
%indvars.iv111 = phi i64 [ 1, %for.body45.preheader.new ], [ %indvars.iv.next112.3, %for.body45 ]
%niter = phi i64 [ 0, %for.body45.preheader.new ], [ %niter.next.3, %for.body45 ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv111
%38 = load i32, ptr %gep, align 4, !tbaa !5
%sub52 = sub nsw i32 %38, %37
%arrayidx54 = getelementptr inbounds i32, ptr %vla28, i64 %indvars.iv111
store i32 %sub52, ptr %arrayidx54, align 4, !tbaa !5
%gep.1 = getelementptr i32, ptr %vla, i64 %indvars.iv111
%39 = load i32, ptr %gep.1, align 4, !tbaa !5
%sub52.1 = sub nsw i32 %39, %sub52
%gep184 = getelementptr i32, ptr %invariant.gep183, i64 %indvars.iv111
store i32 %sub52.1, ptr %gep184, align 4, !tbaa !5
%indvars.iv.next112.1 = add nuw nsw i64 %indvars.iv111, 2
%gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next112.1
%40 = load i32, ptr %gep.2, align 4, !tbaa !5
%sub52.2 = sub nsw i32 %40, %sub52.1
%arrayidx54.2 = getelementptr inbounds i32, ptr %vla28, i64 %indvars.iv.next112.1
store i32 %sub52.2, ptr %arrayidx54.2, align 4, !tbaa !5
%indvars.iv.next112.2 = add nuw nsw i64 %indvars.iv111, 3
%gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next112.2
%41 = load i32, ptr %gep.3, align 4, !tbaa !5
%sub52.3 = sub nsw i32 %41, %sub52.2
%arrayidx54.3 = getelementptr inbounds i32, ptr %vla28, i64 %indvars.iv.next112.2
store i32 %sub52.3, ptr %arrayidx54.3, align 4, !tbaa !5
%indvars.iv.next112.3 = add nuw nsw i64 %indvars.iv111, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond59.preheader.loopexit.unr-lcssa, label %for.body45, !llvm.loop !19
for.cond.cleanup61: ; preds = %for.body62, %for.cond7.preheader, %if.end, %for.cond.cleanup20.thread, %for.cond59.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
for.body62: ; preds = %for.body62.preheader, %for.body62
%indvars.iv117 = phi i64 [ 0, %for.body62.preheader ], [ %indvars.iv.next118, %for.body62 ]
%arrayidx64 = getelementptr inbounds i32, ptr %vla28139150, i64 %indvars.iv117
%42 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%mul65 = shl nsw i32 %42, 1
%call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul65)
%indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
%43 = load i32, ptr %N, align 4, !tbaa !5
%44 = sext i32 %43 to i64
%cmp60 = icmp slt i64 %indvars.iv.next118, %44
br i1 %cmp60, label %for.body62, label %for.cond.cleanup61, !llvm.loop !20
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12, !13}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10, !13, !12}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
int main(void)
{
int n, k;
scanf("%d%d", &n, &k);
char s[n + 1];
scanf("%s", s);
int l = 0;
int r = 0;
while (r < n && s[r] == '1') r++;
while (r < n && k > 0) {
while (r < n && s[r] == '0') r++;
while (r < n && s[r] == '1') r++;
k--;
}
int ans = r - l;
while (r < n) {
while (r < n && s[r] == '0') r++;
while (r < n && s[r] == '1') r++;
while (l < n && s[l] == '1') l++;
while (l < n && s[l] == '0') l++;
if (ans < r - l) ans = r - l;
}
printf("%d\n", ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120077/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120077/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add 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)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp129 = icmp sgt i32 %3, 0
br i1 %cmp129, label %land.rhs.preheader, label %while.end
land.rhs.preheader: ; preds = %entry
%wide.trip.count = zext i32 %3 to i64
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%indvars.iv = phi i64 [ 0, %land.rhs.preheader ], [ %indvars.iv.next, %while.body ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp2 = icmp eq i8 %4, 49
br i1 %cmp2, label %while.body, label %while.end.loopexit
while.body: ; preds = %land.rhs
%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.end99, label %land.rhs, !llvm.loop !10
while.end.loopexit: ; preds = %land.rhs
%5 = trunc i64 %indvars.iv to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %5, %while.end.loopexit ]
%k.promoted = load i32, ptr %k, align 4
%cmp5140 = icmp slt i32 %r.0.lcssa, %3
%cmp8141 = icmp sgt i32 %k.promoted, 0
%6 = select i1 %cmp5140, i1 %cmp8141, i1 false
br i1 %6, label %while.cond12.preheader.preheader, label %while.cond39.preheader
while.cond12.preheader.preheader: ; preds = %while.end
%7 = sext i32 %3 to i64
br label %while.cond12.preheader
while.cond12.preheader: ; preds = %while.cond12.preheader.preheader, %while.end37
%r.1143 = phi i32 [ %r.3.lcssa, %while.end37 ], [ %r.0.lcssa, %while.cond12.preheader.preheader ]
%dec139142 = phi i32 [ %dec, %while.end37 ], [ %k.promoted, %while.cond12.preheader.preheader ]
%8 = sext i32 %r.1143 to i64
br label %land.rhs15
while.cond4.while.cond39.preheader_crit_edge: ; preds = %while.end37, %while.end37.thread
%dec200 = phi i32 [ %dec196, %while.end37.thread ], [ %dec, %while.end37 ]
%r.3.lcssa199 = phi i32 [ %r.3.lcssa.ph, %while.end37.thread ], [ %r.3.lcssa, %while.end37 ]
store i32 %dec200, ptr %k, align 4, !tbaa !5
br label %while.cond39.preheader
while.cond39.preheader: ; preds = %while.cond4.while.cond39.preheader_crit_edge, %while.end
%r.1.lcssa = phi i32 [ %r.3.lcssa199, %while.cond4.while.cond39.preheader_crit_edge ], [ %r.0.lcssa, %while.end ]
%cmp40158 = icmp slt i32 %r.1.lcssa, %3
br i1 %cmp40158, label %while.cond43.preheader.preheader, label %while.end99
while.cond43.preheader.preheader: ; preds = %while.cond39.preheader
%9 = sext i32 %3 to i64
br label %while.cond43.preheader
land.rhs15: ; preds = %while.cond12.preheader, %while.body22
%indvars.iv164 = phi i64 [ %8, %while.cond12.preheader ], [ %indvars.iv.next165, %while.body22 ]
%arrayidx17 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv164
%10 = load i8, ptr %arrayidx17, align 1, !tbaa !9
%cmp19 = icmp eq i8 %10, 48
br i1 %cmp19, label %while.body22, label %while.end24
while.body22: ; preds = %land.rhs15
%indvars.iv.next165 = add nsw i64 %indvars.iv164, 1
%cmp13 = icmp slt i64 %indvars.iv.next165, %7
br i1 %cmp13, label %land.rhs15, label %while.end37.thread.loopexit207, !llvm.loop !12
while.end24: ; preds = %land.rhs15
%11 = trunc i64 %indvars.iv164 to i32
%cmp26135 = icmp sgt i32 %3, %11
br i1 %cmp26135, label %land.rhs28.preheader, label %while.end37
land.rhs28.preheader: ; preds = %while.end24
%sext = shl i64 %indvars.iv164, 32
%12 = ashr exact i64 %sext, 32
br label %land.rhs28
land.rhs28: ; preds = %land.rhs28.preheader, %while.body35
%indvars.iv167 = phi i64 [ %12, %land.rhs28.preheader ], [ %indvars.iv.next168, %while.body35 ]
%arrayidx30 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv167
%13 = load i8, ptr %arrayidx30, align 1, !tbaa !9
%cmp32 = icmp eq i8 %13, 49
br i1 %cmp32, label %while.body35, label %while.end37.loopexit
while.body35: ; preds = %land.rhs28
%indvars.iv.next168 = add nsw i64 %indvars.iv167, 1
%exitcond170.not = icmp eq i64 %indvars.iv.next168, %7
br i1 %exitcond170.not, label %while.end37.thread, label %land.rhs28, !llvm.loop !13
while.end37.thread.loopexit207: ; preds = %while.body22
%14 = add nsw i32 %r.1143, 1
%smax.le = call i32 @llvm.smax.i32(i32 %3, i32 %14)
br label %while.end37.thread
while.end37.thread: ; preds = %while.body35, %while.end37.thread.loopexit207
%r.3.lcssa.ph = phi i32 [ %smax.le, %while.end37.thread.loopexit207 ], [ %3, %while.body35 ]
%dec196 = add nsw i32 %dec139142, -1
br label %while.cond4.while.cond39.preheader_crit_edge
while.end37.loopexit: ; preds = %land.rhs28
%15 = trunc i64 %indvars.iv167 to i32
br label %while.end37
while.end37: ; preds = %while.end37.loopexit, %while.end24
%r.3.lcssa = phi i32 [ %11, %while.end24 ], [ %15, %while.end37.loopexit ]
%dec = add nsw i32 %dec139142, -1
%cmp5 = icmp slt i32 %r.3.lcssa, %3
%cmp8 = icmp sgt i32 %dec139142, 1
%16 = select i1 %cmp5, i1 %cmp8, i1 false
br i1 %16, label %while.cond12.preheader, label %while.cond4.while.cond39.preheader_crit_edge, !llvm.loop !14
while.cond43.preheader: ; preds = %while.cond43.preheader.preheader, %while.end94
%ans.0161 = phi i32 [ %spec.select, %while.end94 ], [ %r.1.lcssa, %while.cond43.preheader.preheader ]
%r.4160 = phi i32 [ %r.6.lcssa, %while.end94 ], [ %r.1.lcssa, %while.cond43.preheader.preheader ]
%l.0159 = phi i32 [ %l.2.lcssa, %while.end94 ], [ 0, %while.cond43.preheader.preheader ]
%17 = sext i32 %r.4160 to i64
%18 = add nsw i32 %r.4160, 1
%smax173 = call i32 @llvm.smax.i32(i32 %3, i32 %18)
br label %land.rhs46
land.rhs46: ; preds = %while.cond43.preheader, %while.body53
%indvars.iv171 = phi i64 [ %17, %while.cond43.preheader ], [ %indvars.iv.next172, %while.body53 ]
%arrayidx48 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv171
%19 = load i8, ptr %arrayidx48, align 1, !tbaa !9
%cmp50 = icmp eq i8 %19, 48
br i1 %cmp50, label %while.body53, label %while.end55
while.body53: ; preds = %land.rhs46
%indvars.iv.next172 = add nsw i64 %indvars.iv171, 1
%cmp44 = icmp slt i64 %indvars.iv.next172, %9
br i1 %cmp44, label %land.rhs46, label %while.end68, !llvm.loop !15
while.end55: ; preds = %land.rhs46
%20 = trunc i64 %indvars.iv171 to i32
%cmp57146 = icmp sgt i32 %3, %20
br i1 %cmp57146, label %land.rhs59.preheader, label %while.end68
land.rhs59.preheader: ; preds = %while.end55
%sext229 = shl i64 %indvars.iv171, 32
%21 = ashr exact i64 %sext229, 32
br label %land.rhs59
land.rhs59: ; preds = %land.rhs59.preheader, %while.body66
%indvars.iv175 = phi i64 [ %21, %land.rhs59.preheader ], [ %indvars.iv.next176, %while.body66 ]
%arrayidx61 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv175
%22 = load i8, ptr %arrayidx61, align 1, !tbaa !9
%cmp63 = icmp eq i8 %22, 49
br i1 %cmp63, label %while.body66, label %while.end68.loopexit.split.loop.exit225
while.body66: ; preds = %land.rhs59
%indvars.iv.next176 = add nsw i64 %indvars.iv175, 1
%exitcond178.not = icmp eq i64 %indvars.iv.next176, %9
br i1 %exitcond178.not, label %while.end68, label %land.rhs59, !llvm.loop !16
while.end68.loopexit.split.loop.exit225: ; preds = %land.rhs59
%23 = trunc i64 %indvars.iv175 to i32
br label %while.end68
while.end68: ; preds = %while.body53, %while.body66, %while.end68.loopexit.split.loop.exit225, %while.end55
%r.6.lcssa = phi i32 [ %20, %while.end55 ], [ %23, %while.end68.loopexit.split.loop.exit225 ], [ %3, %while.body66 ], [ %smax173, %while.body53 ]
%cmp70150 = icmp slt i32 %l.0159, %3
br i1 %cmp70150, label %land.rhs72.preheader, label %while.end81
land.rhs72.preheader: ; preds = %while.end68
%24 = sext i32 %l.0159 to i64
br label %land.rhs72
land.rhs72: ; preds = %land.rhs72.preheader, %while.body79
%indvars.iv179 = phi i64 [ %24, %land.rhs72.preheader ], [ %indvars.iv.next180, %while.body79 ]
%arrayidx74 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv179
%25 = load i8, ptr %arrayidx74, align 1, !tbaa !9
%cmp76 = icmp eq i8 %25, 49
br i1 %cmp76, label %while.body79, label %while.end81.loopexit
while.body79: ; preds = %land.rhs72
%indvars.iv.next180 = add nsw i64 %indvars.iv179, 1
%exitcond182.not = icmp eq i64 %indvars.iv.next180, %9
br i1 %exitcond182.not, label %while.end94, label %land.rhs72, !llvm.loop !17
while.end81.loopexit: ; preds = %land.rhs72
%26 = trunc i64 %indvars.iv179 to i32
br label %while.end81
while.end81: ; preds = %while.end81.loopexit, %while.end68
%l.1.lcssa = phi i32 [ %l.0159, %while.end68 ], [ %26, %while.end81.loopexit ]
%cmp83154 = icmp slt i32 %l.1.lcssa, %3
br i1 %cmp83154, label %land.rhs85.preheader, label %while.end94
land.rhs85.preheader: ; preds = %while.end81
%27 = sext i32 %l.1.lcssa to i64
br label %land.rhs85
land.rhs85: ; preds = %land.rhs85.preheader, %while.body92
%indvars.iv183 = phi i64 [ %27, %land.rhs85.preheader ], [ %indvars.iv.next184, %while.body92 ]
%arrayidx87 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv183
%28 = load i8, ptr %arrayidx87, align 1, !tbaa !9
%cmp89 = icmp eq i8 %28, 48
br i1 %cmp89, label %while.body92, label %while.end94.loopexit.split.loop.exit227
while.body92: ; preds = %land.rhs85
%indvars.iv.next184 = add nsw i64 %indvars.iv183, 1
%exitcond186.not = icmp eq i64 %indvars.iv.next184, %9
br i1 %exitcond186.not, label %while.end94, label %land.rhs85, !llvm.loop !18
while.end94.loopexit.split.loop.exit227: ; preds = %land.rhs85
%29 = trunc i64 %indvars.iv183 to i32
br label %while.end94
while.end94: ; preds = %while.body79, %while.body92, %while.end94.loopexit.split.loop.exit227, %while.end81
%l.2.lcssa = phi i32 [ %l.1.lcssa, %while.end81 ], [ %29, %while.end94.loopexit.split.loop.exit227 ], [ %3, %while.body92 ], [ %3, %while.body79 ]
%sub95 = sub nsw i32 %r.6.lcssa, %l.2.lcssa
%spec.select = call i32 @llvm.smax.i32(i32 %ans.0161, i32 %sub95)
%cmp40 = icmp slt i32 %r.6.lcssa, %3
br i1 %cmp40, label %while.cond43.preheader, label %while.end99, !llvm.loop !19
while.end99: ; preds = %while.body, %while.end94, %while.cond39.preheader
%ans.0.lcssa = phi i32 [ %r.1.lcssa, %while.cond39.preheader ], [ %spec.select, %while.end94 ], [ %3, %while.body ]
%call100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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.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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
|
#include<stdio.h>
int main(){
int a,b,i=0;
scanf("%d %d",&a,&b);
while(a<=b){
a=a*3;
b=b*2;
i++;
}
printf("%d\n",i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12012/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12012/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp.not6 = icmp sgt i32 %a.promoted, %b.promoted
br i1 %cmp.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%i.09 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%mul48 = phi i32 [ %mul, %while.body ], [ %a.promoted, %entry ]
%mul157 = phi i32 [ %mul1, %while.body ], [ %b.promoted, %entry ]
%mul = mul nsw i32 %mul48, 3
%mul1 = shl nsw i32 %mul157, 1
%inc = add nuw nsw i32 %i.09, 1
%cmp.not = icmp sgt i32 %mul, %mul1
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %mul, ptr %a, align 4, !tbaa !5
store i32 %mul1, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%i.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <string.h>
#include <stdio.h>
int main()
{
char s[4];
scanf("%s", &s);
if (strcmp(s, "SUN") == 0)
printf("7");
else if (strcmp(s, "MON") == 0)
printf("6");
else if (strcmp(s, "TUE") == 0)
printf("5");
else if (strcmp(s, "WED") == 0)
printf("4");
else if (strcmp(s, "THU") == 0)
printf("3");
else if (strcmp(s, "FRI") == 0)
printf("2");
else if (strcmp(s, "SAT") == 0)
printf("1");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120163/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120163/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"SUN\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"MON\00", align 1
@.str.5 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1
@.str.7 = private unnamed_addr constant [4 x i8] c"WED\00", align 1
@.str.9 = private unnamed_addr constant [4 x i8] c"THU\00", align 1
@.str.11 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1
@.str.13 = private unnamed_addr constant [4 x i8] c"SAT\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.1, i64 4)
%cmp = icmp eq i32 %bcmp, 0
br i1 %cmp, label %if.end43.sink.split, label %if.else
if.else: ; preds = %entry
%bcmp44 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.3, i64 4)
%cmp5 = icmp eq i32 %bcmp44, 0
br i1 %cmp5, label %if.end43.sink.split, label %if.else8
if.else8: ; preds = %if.else
%bcmp45 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.5, i64 4)
%cmp11 = icmp eq i32 %bcmp45, 0
br i1 %cmp11, label %if.end43.sink.split, label %if.else14
if.else14: ; preds = %if.else8
%bcmp46 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.7, i64 4)
%cmp17 = icmp eq i32 %bcmp46, 0
br i1 %cmp17, label %if.end43.sink.split, label %if.else20
if.else20: ; preds = %if.else14
%bcmp47 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.9, i64 4)
%cmp23 = icmp eq i32 %bcmp47, 0
br i1 %cmp23, label %if.end43.sink.split, label %if.else26
if.else26: ; preds = %if.else20
%bcmp48 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.11, i64 4)
%cmp29 = icmp eq i32 %bcmp48, 0
br i1 %cmp29, label %if.end43.sink.split, label %if.else32
if.else32: ; preds = %if.else26
%bcmp49 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.13, i64 4)
%cmp35 = icmp eq i32 %bcmp49, 0
br i1 %cmp35, label %if.end43.sink.split, label %if.end43
if.end43.sink.split: ; preds = %if.else32, %if.else26, %if.else20, %if.else14, %if.else8, %if.else, %entry
%.sink = phi i32 [ 55, %entry ], [ 54, %if.else ], [ 53, %if.else8 ], [ 52, %if.else14 ], [ 51, %if.else20 ], [ 50, %if.else26 ], [ 49, %if.else32 ]
%putchar54 = call i32 @putchar(i32 %.sink)
br label %if.end43
if.end43: ; preds = %if.end43.sink.split, %if.else32
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind willreturn memory(argmem: read) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
#include<string.h>
int main(void){
char now[5];
char day[7][5] = {"SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"};
scanf("%s", now);
for(int i = 0; i < 7; i++){
if(strcmp(day[i], now) == 0){
printf("%d\n", i + 1);
return 0;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120206/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120206/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.day = private unnamed_addr constant [7 x [5 x i8]] [[5 x i8] c"SAT\00\00", [5 x i8] c"FRI\00\00", [5 x i8] c"THU\00\00", [5 x i8] c"WED\00\00", [5 x i8] c"TUE\00\00", [5 x i8] c"MON\00\00", [5 x i8] c"SUN\00\00"], align 16
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%now = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %now) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %now)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) @__const.main.day, ptr noundef nonnull dereferenceable(4) %now, i64 4)
%cmp4 = icmp eq i32 %bcmp, 0
br i1 %cmp4, label %if.then, label %for.inc
if.then: ; preds = %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%i.012.lcssa.wide = phi i32 [ 1, %entry ], [ 2, %for.inc ], [ 3, %for.inc.1 ], [ 4, %for.inc.2 ], [ 5, %for.inc.3 ], [ 6, %for.inc.4 ], [ 7, %for.inc.5 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.012.lcssa.wide)
br label %cleanup6
for.inc: ; preds = %entry
%bcmp15 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [5 x i8]], ptr @__const.main.day, i64 0, i64 1), ptr noundef nonnull dereferenceable(4) %now, i64 4)
%cmp4.1 = icmp eq i32 %bcmp15, 0
br i1 %cmp4.1, label %if.then, label %for.inc.1
for.inc.1: ; preds = %for.inc
%bcmp16 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [5 x i8]], ptr @__const.main.day, i64 0, i64 2), ptr noundef nonnull dereferenceable(4) %now, i64 4)
%cmp4.2 = icmp eq i32 %bcmp16, 0
br i1 %cmp4.2, label %if.then, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%bcmp17 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [5 x i8]], ptr @__const.main.day, i64 0, i64 3), ptr noundef nonnull dereferenceable(4) %now, i64 4)
%cmp4.3 = icmp eq i32 %bcmp17, 0
br i1 %cmp4.3, label %if.then, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%bcmp18 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [5 x i8]], ptr @__const.main.day, i64 0, i64 4), ptr noundef nonnull dereferenceable(4) %now, i64 4)
%cmp4.4 = icmp eq i32 %bcmp18, 0
br i1 %cmp4.4, label %if.then, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%bcmp19 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [5 x i8]], ptr @__const.main.day, i64 0, i64 5), ptr noundef nonnull dereferenceable(4) %now, i64 4)
%cmp4.5 = icmp eq i32 %bcmp19, 0
br i1 %cmp4.5, label %if.then, label %for.inc.5
for.inc.5: ; preds = %for.inc.4
%bcmp20 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [5 x i8]], ptr @__const.main.day, i64 0, i64 6), ptr noundef nonnull dereferenceable(4) %now, i64 4)
%cmp4.6 = icmp eq i32 %bcmp20, 0
br i1 %cmp4.6, label %if.then, label %cleanup6
cleanup6: ; preds = %for.inc.5, %if.then
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %now) #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 willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main()
{
int a,b,c=0;
scanf("%d %d",&a,&b);
while(a<=b)
{
a=3*a;
b=2*b;
c++;
}
printf("%d",c);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12025/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12025/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp.not6 = icmp sgt i32 %a.promoted, %b.promoted
br i1 %cmp.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%c.09 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%mul48 = phi i32 [ %mul, %while.body ], [ %a.promoted, %entry ]
%mul157 = phi i32 [ %mul1, %while.body ], [ %b.promoted, %entry ]
%mul = mul nsw i32 %mul48, 3
%mul1 = shl nsw i32 %mul157, 1
%inc = add nuw nsw i32 %c.09, 1
%cmp.not = icmp sgt i32 %mul, %mul1
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %mul, ptr %a, align 4, !tbaa !5
store i32 %mul1, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%c.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
char d1[4];
char d2[7][4] = {{'S','U','N'},{'M','O','N'},{'T','U','E'},{'W','E','D'},{'T','H','U'},{'F','R','I'},{'S','A','T'}};
int i,j,k;
scanf("%s",d1);
for(i = 0;i < 7;i++){
for(j = 0;j < 3;j++){
if((d2[i][j] == d1[j])&&(j == 2)){
k = i;
printf("%d\n",7 - k);
}
else if(d2[i][j] != d1[j]){
break;
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120307/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120307/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d1 = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d1) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d1)
%0 = load i8, ptr %d1, align 1, !tbaa !5
%cmp944 = icmp eq i8 %0, 83
%arrayidx7 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 1
%1 = load i8, ptr %arrayidx7, align 1
%cmp9 = icmp eq i8 %1, 85
%or.cond = select i1 %cmp944, i1 %cmp9, i1 false
%arrayidx7.171 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 2
%2 = load i8, ptr %arrayidx7.171, align 1
%cmp9.172 = icmp eq i8 %2, 78
%or.cond93 = select i1 %or.cond, i1 %cmp9.172, i1 false
br i1 %or.cond93, label %if.then, label %if.else.1, !llvm.loop !8
if.then: ; preds = %entry
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 7)
br label %if.else.1
if.else.1: ; preds = %if.then, %entry
%3 = load i8, ptr %d1, align 1, !tbaa !5
%cmp9.147 = icmp eq i8 %3, 77
%arrayidx7.1 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 1
%4 = load i8, ptr %arrayidx7.1, align 1
%cmp9.1 = icmp eq i8 %4, 79
%or.cond87 = select i1 %cmp9.147, i1 %cmp9.1, i1 false
%arrayidx7.1.1 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 2
%5 = load i8, ptr %arrayidx7.1.1, align 1
%cmp9.1.1 = icmp eq i8 %5, 78
%or.cond94 = select i1 %or.cond87, i1 %cmp9.1.1, i1 false
br i1 %or.cond94, label %if.then.1, label %if.else.2, !llvm.loop !8
if.then.1: ; preds = %if.else.1
%call13.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 6)
br label %if.else.2
if.else.2: ; preds = %if.then.1, %if.else.1
%6 = load i8, ptr %d1, align 1, !tbaa !5
%cmp9.250 = icmp eq i8 %6, 84
%arrayidx7.2 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 1
%7 = load i8, ptr %arrayidx7.2, align 1
%cmp9.2 = icmp eq i8 %7, 85
%or.cond88 = select i1 %cmp9.250, i1 %cmp9.2, i1 false
%arrayidx7.2.1 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 2
%8 = load i8, ptr %arrayidx7.2.1, align 1
%cmp9.2.1 = icmp eq i8 %8, 69
%or.cond95 = select i1 %or.cond88, i1 %cmp9.2.1, i1 false
br i1 %or.cond95, label %if.then.2, label %if.else.3, !llvm.loop !8
if.then.2: ; preds = %if.else.2
%call13.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 5)
br label %if.else.3
if.else.3: ; preds = %if.then.2, %if.else.2
%9 = load i8, ptr %d1, align 1, !tbaa !5
%cmp9.353 = icmp eq i8 %9, 87
%arrayidx7.3 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 1
%10 = load i8, ptr %arrayidx7.3, align 1
%cmp9.3 = icmp eq i8 %10, 69
%or.cond89 = select i1 %cmp9.353, i1 %cmp9.3, i1 false
%arrayidx7.3.1 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 2
%11 = load i8, ptr %arrayidx7.3.1, align 1
%cmp9.3.1 = icmp eq i8 %11, 68
%or.cond96 = select i1 %or.cond89, i1 %cmp9.3.1, i1 false
br i1 %or.cond96, label %if.then.3, label %if.else.4, !llvm.loop !8
if.then.3: ; preds = %if.else.3
%call13.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 4)
br label %if.else.4
if.else.4: ; preds = %if.then.3, %if.else.3
%12 = load i8, ptr %d1, align 1, !tbaa !5
%cmp9.456 = icmp eq i8 %12, 84
%arrayidx7.4 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 1
%13 = load i8, ptr %arrayidx7.4, align 1
%cmp9.4 = icmp eq i8 %13, 72
%or.cond90 = select i1 %cmp9.456, i1 %cmp9.4, i1 false
%arrayidx7.4.1 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 2
%14 = load i8, ptr %arrayidx7.4.1, align 1
%cmp9.4.1 = icmp eq i8 %14, 85
%or.cond97 = select i1 %or.cond90, i1 %cmp9.4.1, i1 false
br i1 %or.cond97, label %if.then.4, label %if.else.5, !llvm.loop !8
if.then.4: ; preds = %if.else.4
%call13.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 3)
br label %if.else.5
if.else.5: ; preds = %if.then.4, %if.else.4
%15 = load i8, ptr %d1, align 1, !tbaa !5
%cmp9.559 = icmp eq i8 %15, 70
%arrayidx7.5 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 1
%16 = load i8, ptr %arrayidx7.5, align 1
%cmp9.5 = icmp eq i8 %16, 82
%or.cond91 = select i1 %cmp9.559, i1 %cmp9.5, i1 false
%arrayidx7.5.1 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 2
%17 = load i8, ptr %arrayidx7.5.1, align 1
%cmp9.5.1 = icmp eq i8 %17, 73
%or.cond98 = select i1 %or.cond91, i1 %cmp9.5.1, i1 false
br i1 %or.cond98, label %if.then.5, label %if.else.6, !llvm.loop !8
if.then.5: ; preds = %if.else.5
%call13.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 2)
br label %if.else.6
if.else.6: ; preds = %if.then.5, %if.else.5
%18 = load i8, ptr %d1, align 1, !tbaa !5
%cmp9.662 = icmp eq i8 %18, 83
%arrayidx7.6 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 1
%19 = load i8, ptr %arrayidx7.6, align 1
%cmp9.6 = icmp eq i8 %19, 65
%or.cond92 = select i1 %cmp9.662, i1 %cmp9.6, i1 false
%arrayidx7.6.1 = getelementptr inbounds [4 x i8], ptr %d1, i64 0, i64 2
%20 = load i8, ptr %arrayidx7.6.1, align 1
%cmp9.6.1 = icmp eq i8 %20, 84
%or.cond99 = select i1 %or.cond92, i1 %cmp9.6.1, i1 false
br i1 %or.cond99, label %if.then.6, label %for.inc26.6, !llvm.loop !8
if.then.6: ; preds = %if.else.6
%call13.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1)
br label %for.inc26.6
for.inc26.6: ; preds = %if.else.6, %if.then.6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d1) #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"}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
char S[4];
char S_NUM[7][4] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
int i;
scanf("%s", S);
for(i=0; i<7; i++)
{
if(!strcmp(S_NUM[i], S))
break;
}
printf("%d\n", 7-i);
//system("pause");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120358/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120358/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.S_NUM = private unnamed_addr constant [7 x [4 x i8]] [[4 x i8] c"SUN\00", [4 x i8] c"MON\00", [4 x i8] c"TUE\00", [4 x i8] c"WED\00", [4 x i8] c"THU\00", [4 x i8] c"FRI\00", [4 x i8] c"SAT\00"], align 16
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) @__const.main.S_NUM, ptr noundef nonnull dereferenceable(4) %S, i64 4)
%tobool.not = icmp eq i32 %bcmp, 0
br i1 %tobool.not, label %for.end, label %for.inc
for.inc: ; preds = %entry
%bcmp10 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.S_NUM, i64 0, i64 1), ptr noundef nonnull dereferenceable(4) %S, i64 4)
%tobool.not.1 = icmp eq i32 %bcmp10, 0
br i1 %tobool.not.1, label %for.end, label %for.inc.1
for.inc.1: ; preds = %for.inc
%bcmp11 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.S_NUM, i64 0, i64 2), ptr noundef nonnull dereferenceable(4) %S, i64 4)
%tobool.not.2 = icmp eq i32 %bcmp11, 0
br i1 %tobool.not.2, label %for.end, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%bcmp12 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.S_NUM, i64 0, i64 3), ptr noundef nonnull dereferenceable(4) %S, i64 4)
%tobool.not.3 = icmp eq i32 %bcmp12, 0
br i1 %tobool.not.3, label %for.end, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%bcmp13 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.S_NUM, i64 0, i64 4), ptr noundef nonnull dereferenceable(4) %S, i64 4)
%tobool.not.4 = icmp eq i32 %bcmp13, 0
br i1 %tobool.not.4, label %for.end, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%bcmp14 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.S_NUM, i64 0, i64 5), ptr noundef nonnull dereferenceable(4) %S, i64 4)
%tobool.not.5 = icmp eq i32 %bcmp14, 0
br i1 %tobool.not.5, label %for.end, label %for.inc.5
for.inc.5: ; preds = %for.inc.4
%bcmp15 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.S_NUM, i64 0, i64 6), ptr noundef nonnull dereferenceable(4) %S, i64 4)
%tobool.not.6 = icmp eq i32 %bcmp15, 0
%spec.select = zext i1 %tobool.not.6 to i32
br label %for.end
for.end: ; preds = %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%i.0.lcssa.neg = phi i32 [ 7, %entry ], [ 6, %for.inc ], [ 5, %for.inc.1 ], [ 4, %for.inc.2 ], [ 3, %for.inc.3 ], [ 2, %for.inc.4 ], [ %spec.select, %for.inc.5 ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa.neg)
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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main() {
char s[3];
int ans;
scanf ("%s", s);
if (s[0] == 'M') ans = 6;
else if (s[0] == 'W') ans = 4;
else if (s[0] == 'F') ans = 2;
else if (s[2] == 'N') ans = 7;
else if (s[2] == 'E') ans = 5;
else if (s[2] == 'U') ans = 3;
else if (s[2] == 'T') ans = 1;
printf ("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120400/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120400/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
switch i8 %0, label %if.else13 [
i8 77, label %if.end42
i8 87, label %if.then6
i8 70, label %if.then12
]
if.then6: ; preds = %entry
br label %if.end42
if.then12: ; preds = %entry
br label %if.end42
if.else13: ; preds = %entry
%arrayidx14 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2
%1 = load i8, ptr %arrayidx14, align 1, !tbaa !5
switch i8 %1, label %if.end42 [
i8 84, label %if.then36
i8 69, label %if.then24
i8 85, label %if.then30
]
if.then24: ; preds = %if.else13
br label %if.end42
if.then30: ; preds = %if.else13
br label %if.end42
if.then36: ; preds = %if.else13
br label %if.end42
if.end42: ; preds = %if.else13, %entry, %if.then6, %if.then30, %if.then36, %if.then24, %if.then12
%ans.0 = phi i32 [ 4, %if.then6 ], [ 2, %if.then12 ], [ 5, %if.then24 ], [ 3, %if.then30 ], [ 1, %if.then36 ], [ 6, %entry ], [ 7, %if.else13 ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int a[100005], b[100005];
int asca(const void* x, const void* y)
{
return a[*(int*)x] - a[*(int*)y];
}
int ascb(const void* x, const void* y)
{
return b[*(int*)x] - b[*(int*)y];
}
int main()
{
long long int n, k;
scanf("%lld %lld", &n, &k);
long long int i;
for (i = 0; i < n - 1; i++)
{
scanf("%d %d", &a[i], &b[i]);
if (a[i] > b[i])
{
a[i] ^= b[i];
b[i] ^= a[i];
a[i] ^= b[i];
}
}
long long int p = 1000000007;
int c[100005], d[100005];
for (i = 0; i < n - 1; i++)
c[i] = d[i] = i;
qsort(c, n - 1, sizeof(int), asca);
qsort(d, n - 1, sizeof(int), ascb);
long long int count[100005];
for (i = 0; i < n + 2; i++)
count[i] = 1;
int m = 0, q[100005];
q[m] = 1;
m++;
int min, mid, max;
long long int ans = k;
int visited[100005];
for (i = 0; i < n + 2; i++)
visited[i] = 0;
int Q;
while (m > 0)
{
m--;
min = 0;
max = n - 1;
Q = q[m];
visited[Q] = 1;
while (max - min > 1)
{
mid = (max + min) / 2;
if (a[c[mid]] < Q)
min = mid;
else
max = mid;
}
if (a[c[min]] < Q)
min++;
if (min < n - 1)
{
while (a[c[min]] == Q)
{
if (visited[b[c[min]]] == 0)
{
if (count[Q] >= k)
{
printf("0\n");
return 0;
}
ans *= k - count[Q];
ans %= p;
count[Q]++;
count[b[c[min]]]++;
q[m] = b[c[min]];
m++;
visited[b[c[min]]] = 1;
}
min++;
if (min == n - 1)
break;
}
}
min = 0;
max = n - 1;
while (max - min > 1)
{
mid = (max + min) / 2;
if (b[d[mid]] < Q)
min = mid;
else
max = mid;
}
if (b[d[min]] < Q)
min++;
if (min < n - 1)
{
while (b[d[min]] == Q)
{
if (visited[a[d[min]]] == 0)
{
if (count[Q] >= k)
{
printf("0\n");
return 0;
}
ans *= k - count[Q];
ans %= p;
count[Q]++;
count[a[d[min]]]++;
q[m] = a[d[min]];
m++;
visited[a[d[min]]] = 1;
}
min++;
if (min == n - 1)
break;
}
}
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120451/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@a = dso_local global [100005 x i32] zeroinitializer, align 16
@b = dso_local global [100005 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @asca(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %y, align 4, !tbaa !5
%idxprom1 = sext i32 %2 to i64
%arrayidx2 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %idxprom1
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%sub = sub nsw i32 %1, %3
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @ascb(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %y, align 4, !tbaa !5
%idxprom1 = sext i32 %2 to i64
%arrayidx2 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %idxprom1
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%sub = sub nsw i32 %1, %3
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i64, align 8
%k = alloca i64, align 8
%c = alloca [100005 x i32], align 16
%d = alloca [100005 x i32], align 16
%count = alloca [100005 x i64], align 16
%q = alloca [100005 x i32], align 16
%visited = alloca [100005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i64, ptr %n, align 8, !tbaa !9
%cmp340 = icmp sgt i64 %0, 1
br i1 %cmp340, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub339 = add nsw i64 %0, -1
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %c) #8
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %d) #8
br label %for.end22
for.body: ; preds = %entry, %for.inc
%i.0341 = phi i64 [ %inc, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %i.0341
%arrayidx1 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %i.0341
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx1)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %1, %2
br i1 %cmp5, label %if.then, label %for.inc
if.then: ; preds = %for.body
store i32 %1, ptr %arrayidx1, align 4, !tbaa !5
store i32 %2, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%inc = add nuw nsw i64 %i.0341, 1
%3 = load i64, ptr %n, align 8, !tbaa !9
%sub = add nsw i64 %3, -1
%cmp = icmp slt i64 %inc, %sub
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %c) #8
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %d) #8
%cmp16342 = icmp sgt i64 %3, 1
br i1 %cmp16342, label %for.body17.preheader, label %for.end22
for.body17.preheader: ; preds = %for.end
%min.iters.check = icmp ult i64 %3, 9
br i1 %min.iters.check, label %for.body17.preheader383, label %vector.ph
vector.ph: ; preds = %for.body17.preheader
%n.vec = and i64 %sub, -8
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>
%4 = getelementptr inbounds [100005 x i32], ptr %d, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
store <4 x i32> %step.add, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds [100005 x i32], ptr %c, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %step.add, ptr %7, 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>
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %sub, %n.vec
br i1 %cmp.n, label %for.end22, label %for.body17.preheader383
for.body17.preheader383: ; preds = %for.body17.preheader, %middle.block
%i.1343.ph = phi i64 [ 0, %for.body17.preheader ], [ %n.vec, %middle.block ]
br label %for.body17
for.body17: ; preds = %for.body17.preheader383, %for.body17
%i.1343 = phi i64 [ %inc21, %for.body17 ], [ %i.1343.ph, %for.body17.preheader383 ]
%conv = trunc i64 %i.1343 to i32
%arrayidx18 = getelementptr inbounds [100005 x i32], ptr %d, i64 0, i64 %i.1343
store i32 %conv, ptr %arrayidx18, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds [100005 x i32], ptr %c, i64 0, i64 %i.1343
store i32 %conv, ptr %arrayidx19, align 4, !tbaa !5
%inc21 = add nuw nsw i64 %i.1343, 1
%exitcond.not = icmp eq i64 %inc21, %sub
br i1 %exitcond.not, label %for.end22, label %for.body17, !llvm.loop !16
for.end22: ; preds = %for.body17, %middle.block, %for.end.thread, %for.end
%sub.lcssa369 = phi i64 [ %sub339, %for.end.thread ], [ %sub, %for.end ], [ %sub, %middle.block ], [ %sub, %for.body17 ]
call void @qsort(ptr noundef nonnull %c, i64 noundef %sub.lcssa369, i64 noundef 4, ptr noundef nonnull @asca) #8
%9 = load i64, ptr %n, align 8, !tbaa !9
%sub25 = add nsw i64 %9, -1
call void @qsort(ptr noundef nonnull %d, i64 noundef %sub25, i64 noundef 4, ptr noundef nonnull @ascb) #8
call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %count) #8
%10 = load i64, ptr %n, align 8, !tbaa !9
%add = add i64 %10, 2
%cmp27344 = icmp sgt i64 %10, -2
br i1 %cmp27344, label %for.body29.preheader, label %for.end33.thread
for.end33.thread: ; preds = %for.end22
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %q) #8
store i32 1, ptr %q, align 16, !tbaa !5
%11 = load i64, ptr %k, align 8, !tbaa !9
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %visited) #8
br label %while.cond.preheader
for.body29.preheader: ; preds = %for.end22
%smax = call i64 @llvm.smax.i64(i64 %add, i64 1)
%min.iters.check373 = icmp ult i64 %smax, 4
br i1 %min.iters.check373, label %for.body29.preheader382, label %vector.ph374
vector.ph374: ; preds = %for.body29.preheader
%n.vec376 = and i64 %smax, 9223372036854775804
br label %vector.body379
vector.body379: ; preds = %vector.body379, %vector.ph374
%index380 = phi i64 [ 0, %vector.ph374 ], [ %index.next381, %vector.body379 ]
%12 = getelementptr inbounds [100005 x i64], ptr %count, i64 0, i64 %index380
store <2 x i64> <i64 1, i64 1>, ptr %12, align 16, !tbaa !9
%13 = getelementptr inbounds i64, ptr %12, i64 2
store <2 x i64> <i64 1, i64 1>, ptr %13, align 16, !tbaa !9
%index.next381 = add nuw i64 %index380, 4
%14 = icmp eq i64 %index.next381, %n.vec376
br i1 %14, label %middle.block371, label %vector.body379, !llvm.loop !17
middle.block371: ; preds = %vector.body379
%cmp.n378 = icmp eq i64 %smax, %n.vec376
br i1 %cmp.n378, label %for.end33, label %for.body29.preheader382
for.body29.preheader382: ; preds = %for.body29.preheader, %middle.block371
%i.2345.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec376, %middle.block371 ]
br label %for.body29
for.body29: ; preds = %for.body29.preheader382, %for.body29
%i.2345 = phi i64 [ %inc32, %for.body29 ], [ %i.2345.ph, %for.body29.preheader382 ]
%arrayidx30 = getelementptr inbounds [100005 x i64], ptr %count, i64 0, i64 %i.2345
store i64 1, ptr %arrayidx30, align 8, !tbaa !9
%inc32 = add nuw nsw i64 %i.2345, 1
%exitcond361.not = icmp eq i64 %inc32, %smax
br i1 %exitcond361.not, label %for.end33, label %for.body29, !llvm.loop !18
for.end33: ; preds = %for.body29, %middle.block371
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %q) #8
store i32 1, ptr %q, align 16, !tbaa !5
%15 = load i64, ptr %k, align 8, !tbaa !9
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %visited) #8
br i1 %cmp27344, label %for.body40.preheader, label %while.cond.preheader
for.body40.preheader: ; preds = %for.end33
%smax362 = call i64 @llvm.smax.i64(i64 %add, i64 1)
%16 = shl nuw i64 %smax362, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %visited, i8 0, i64 %16, i1 false), !tbaa !5
br label %while.cond.preheader
while.cond.preheader: ; preds = %for.end33.thread, %for.body40.preheader, %for.end33
%17 = phi i64 [ %11, %for.end33.thread ], [ %15, %for.body40.preheader ], [ %15, %for.end33 ]
%18 = trunc i64 %10 to i32
%conv48 = add i32 %18, -1
%cmp55350 = icmp sgt i32 %conv48, 1
%sub77 = add nsw i64 %10, -1
br label %while.body
while.body: ; preds = %while.cond.preheader, %if.end235
%ans.0359 = phi i64 [ %17, %while.cond.preheader ], [ %ans.6, %if.end235 ]
%m.0358 = phi i32 [ 1, %while.cond.preheader ], [ %m.6, %if.end235 ]
%dec = add nsw i32 %m.0358, -1
%idxprom49 = zext i32 %dec to i64
%arrayidx50 = getelementptr inbounds [100005 x i32], ptr %q, i64 0, i64 %idxprom49
%19 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%idxprom51 = sext i32 %19 to i64
%arrayidx52 = getelementptr inbounds [100005 x i32], ptr %visited, i64 0, i64 %idxprom51
store i32 1, ptr %arrayidx52, align 4, !tbaa !5
br i1 %cmp55350, label %while.body57, label %while.end
while.body57: ; preds = %while.body, %while.body57
%max.0352 = phi i32 [ %max.0.div, %while.body57 ], [ %conv48, %while.body ]
%min.0351 = phi i32 [ %div.min.0, %while.body57 ], [ 0, %while.body ]
%add58 = add nsw i32 %max.0352, %min.0351
%div = sdiv i32 %add58, 2
%idxprom59 = sext i32 %div to i64
%arrayidx60 = getelementptr inbounds [100005 x i32], ptr %c, i64 0, i64 %idxprom59
%20 = load i32, ptr %arrayidx60, align 4, !tbaa !5
%idxprom61 = sext i32 %20 to i64
%arrayidx62 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %idxprom61
%21 = load i32, ptr %arrayidx62, align 4, !tbaa !5
%cmp63 = icmp slt i32 %21, %19
%div.min.0 = select i1 %cmp63, i32 %div, i32 %min.0351
%max.0.div = select i1 %cmp63, i32 %max.0352, i32 %div
%sub54 = sub nsw i32 %max.0.div, %div.min.0
%cmp55 = icmp sgt i32 %sub54, 1
br i1 %cmp55, label %while.body57, label %while.end, !llvm.loop !19
while.end: ; preds = %while.body57, %while.body
%min.0.lcssa = phi i32 [ 0, %while.body ], [ %div.min.0, %while.body57 ]
%idxprom67 = sext i32 %min.0.lcssa to i64
%arrayidx68 = getelementptr inbounds [100005 x i32], ptr %c, i64 0, i64 %idxprom67
%22 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%idxprom69 = sext i32 %22 to i64
%arrayidx70 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %idxprom69
%23 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%cmp71 = icmp slt i32 %23, %19
%inc74 = zext i1 %cmp71 to i32
%spec.select = add nsw i32 %min.0.lcssa, %inc74
%conv76 = sext i32 %spec.select to i64
%cmp78 = icmp sgt i64 %sub77, %conv76
br i1 %cmp78, label %while.cond81.preheader, label %if.end140
while.cond81.preheader: ; preds = %while.end
%arrayidx99 = getelementptr inbounds [100005 x i64], ptr %count, i64 0, i64 %idxprom51
br label %while.cond81
while.cond81: ; preds = %while.cond81.preheader, %if.end131
%indvars.iv = phi i64 [ %conv76, %while.cond81.preheader ], [ %indvars.iv.next, %if.end131 ]
%m.1 = phi i32 [ %dec, %while.cond81.preheader ], [ %m.2, %if.end131 ]
%ans.1 = phi i64 [ %ans.0359, %while.cond81.preheader ], [ %ans.2, %if.end131 ]
%arrayidx83 = getelementptr inbounds [100005 x i32], ptr %c, i64 0, i64 %indvars.iv
%24 = load i32, ptr %arrayidx83, align 4, !tbaa !5
%idxprom84 = sext i32 %24 to i64
%arrayidx85 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %idxprom84
%25 = load i32, ptr %arrayidx85, align 4, !tbaa !5
%cmp86 = icmp eq i32 %25, %19
br i1 %cmp86, label %while.body88, label %if.end140
while.body88: ; preds = %while.cond81
%arrayidx92 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %idxprom84
%26 = load i32, ptr %arrayidx92, align 4, !tbaa !5
%idxprom93 = sext i32 %26 to i64
%arrayidx94 = getelementptr inbounds [100005 x i32], ptr %visited, i64 0, i64 %idxprom93
%27 = load i32, ptr %arrayidx94, align 4, !tbaa !5
%cmp95 = icmp eq i32 %27, 0
br i1 %cmp95, label %if.then97, label %if.end131
if.then97: ; preds = %while.body88
%28 = load i64, ptr %arrayidx99, align 8, !tbaa !9
%cmp100.not = icmp slt i64 %28, %17
br i1 %cmp100.not, label %if.end104, label %if.then102
if.then102: ; preds = %if.then97
%puts335 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %cleanup
if.end104: ; preds = %if.then97
%sub107 = sub nsw i64 %17, %28
%mul = mul nsw i64 %sub107, %ans.1
%rem = srem i64 %mul, 1000000007
%inc110 = add nsw i64 %28, 1
store i64 %inc110, ptr %arrayidx99, align 8, !tbaa !9
%arrayidx116 = getelementptr inbounds [100005 x i64], ptr %count, i64 0, i64 %idxprom93
%29 = load i64, ptr %arrayidx116, align 8, !tbaa !9
%inc117 = add nsw i64 %29, 1
store i64 %inc117, ptr %arrayidx116, align 8, !tbaa !9
%idxprom122 = sext i32 %m.1 to i64
%arrayidx123 = getelementptr inbounds [100005 x i32], ptr %q, i64 0, i64 %idxprom122
store i32 %26, ptr %arrayidx123, align 4, !tbaa !5
%inc124 = add nsw i32 %m.1, 1
store i32 1, ptr %arrayidx94, align 4, !tbaa !5
br label %if.end131
if.end131: ; preds = %if.end104, %while.body88
%m.2 = phi i32 [ %inc124, %if.end104 ], [ %m.1, %while.body88 ]
%ans.2 = phi i64 [ %rem, %if.end104 ], [ %ans.1, %while.body88 ]
%indvars.iv.next = add i64 %indvars.iv, 1
%cmp135 = icmp eq i64 %sub77, %indvars.iv.next
br i1 %cmp135, label %if.end140, label %while.cond81, !llvm.loop !20
if.end140: ; preds = %while.cond81, %if.end131, %while.end
%m.3 = phi i32 [ %dec, %while.end ], [ %m.1, %while.cond81 ], [ %m.2, %if.end131 ]
%ans.3 = phi i64 [ %ans.0359, %while.end ], [ %ans.1, %while.cond81 ], [ %ans.2, %if.end131 ]
br i1 %cmp55350, label %while.body147, label %while.end159
while.body147: ; preds = %if.end140, %while.body147
%max.2356 = phi i32 [ %max.2.div149, %while.body147 ], [ %conv48, %if.end140 ]
%min.4355 = phi i32 [ %div149.min.4, %while.body147 ], [ 0, %if.end140 ]
%add148 = add nsw i32 %max.2356, %min.4355
%div149 = sdiv i32 %add148, 2
%idxprom150 = sext i32 %div149 to i64
%arrayidx151 = getelementptr inbounds [100005 x i32], ptr %d, i64 0, i64 %idxprom150
%30 = load i32, ptr %arrayidx151, align 4, !tbaa !5
%idxprom152 = sext i32 %30 to i64
%arrayidx153 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %idxprom152
%31 = load i32, ptr %arrayidx153, align 4, !tbaa !5
%cmp154 = icmp slt i32 %31, %19
%div149.min.4 = select i1 %cmp154, i32 %div149, i32 %min.4355
%max.2.div149 = select i1 %cmp154, i32 %max.2356, i32 %div149
%sub144 = sub nsw i32 %max.2.div149, %div149.min.4
%cmp145 = icmp sgt i32 %sub144, 1
br i1 %cmp145, label %while.body147, label %while.end159, !llvm.loop !21
while.end159: ; preds = %while.body147, %if.end140
%min.4.lcssa = phi i32 [ 0, %if.end140 ], [ %div149.min.4, %while.body147 ]
%idxprom160 = sext i32 %min.4.lcssa to i64
%arrayidx161 = getelementptr inbounds [100005 x i32], ptr %d, i64 0, i64 %idxprom160
%32 = load i32, ptr %arrayidx161, align 4, !tbaa !5
%idxprom162 = sext i32 %32 to i64
%arrayidx163 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %idxprom162
%33 = load i32, ptr %arrayidx163, align 4, !tbaa !5
%cmp164 = icmp slt i32 %33, %19
%inc167 = zext i1 %cmp164 to i32
%spec.select336 = add nsw i32 %min.4.lcssa, %inc167
%conv169 = sext i32 %spec.select336 to i64
%cmp171 = icmp sgt i64 %sub77, %conv169
br i1 %cmp171, label %while.cond174.preheader, label %if.end235
while.cond174.preheader: ; preds = %while.end159
%arrayidx192 = getelementptr inbounds [100005 x i64], ptr %count, i64 0, i64 %idxprom51
br label %while.cond174
while.cond174: ; preds = %while.cond174.preheader, %if.end226
%indvars.iv364 = phi i64 [ %conv169, %while.cond174.preheader ], [ %indvars.iv.next365, %if.end226 ]
%m.4 = phi i32 [ %m.3, %while.cond174.preheader ], [ %m.5, %if.end226 ]
%ans.4 = phi i64 [ %ans.3, %while.cond174.preheader ], [ %ans.5, %if.end226 ]
%arrayidx176 = getelementptr inbounds [100005 x i32], ptr %d, i64 0, i64 %indvars.iv364
%34 = load i32, ptr %arrayidx176, align 4, !tbaa !5
%idxprom177 = sext i32 %34 to i64
%arrayidx178 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %idxprom177
%35 = load i32, ptr %arrayidx178, align 4, !tbaa !5
%cmp179 = icmp eq i32 %35, %19
br i1 %cmp179, label %while.body181, label %if.end235
while.body181: ; preds = %while.cond174
%arrayidx185 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %idxprom177
%36 = load i32, ptr %arrayidx185, align 4, !tbaa !5
%idxprom186 = sext i32 %36 to i64
%arrayidx187 = getelementptr inbounds [100005 x i32], ptr %visited, i64 0, i64 %idxprom186
%37 = load i32, ptr %arrayidx187, align 4, !tbaa !5
%cmp188 = icmp eq i32 %37, 0
br i1 %cmp188, label %if.then190, label %if.end226
if.then190: ; preds = %while.body181
%38 = load i64, ptr %arrayidx192, align 8, !tbaa !9
%cmp193.not = icmp slt i64 %38, %17
br i1 %cmp193.not, label %if.end197, label %if.then195
if.then195: ; preds = %if.then190
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %cleanup
if.end197: ; preds = %if.then190
%sub200 = sub nsw i64 %17, %38
%mul201 = mul nsw i64 %sub200, %ans.4
%rem202 = srem i64 %mul201, 1000000007
%inc205 = add nsw i64 %38, 1
store i64 %inc205, ptr %arrayidx192, align 8, !tbaa !9
%arrayidx211 = getelementptr inbounds [100005 x i64], ptr %count, i64 0, i64 %idxprom186
%39 = load i64, ptr %arrayidx211, align 8, !tbaa !9
%inc212 = add nsw i64 %39, 1
store i64 %inc212, ptr %arrayidx211, align 8, !tbaa !9
%idxprom217 = sext i32 %m.4 to i64
%arrayidx218 = getelementptr inbounds [100005 x i32], ptr %q, i64 0, i64 %idxprom217
store i32 %36, ptr %arrayidx218, align 4, !tbaa !5
%inc219 = add nsw i32 %m.4, 1
store i32 1, ptr %arrayidx187, align 4, !tbaa !5
br label %if.end226
if.end226: ; preds = %if.end197, %while.body181
%m.5 = phi i32 [ %inc219, %if.end197 ], [ %m.4, %while.body181 ]
%ans.5 = phi i64 [ %rem202, %if.end197 ], [ %ans.4, %while.body181 ]
%indvars.iv.next365 = add i64 %indvars.iv364, 1
%cmp230 = icmp eq i64 %sub77, %indvars.iv.next365
br i1 %cmp230, label %if.end235, label %while.cond174, !llvm.loop !22
if.end235: ; preds = %while.cond174, %if.end226, %while.end159
%m.6 = phi i32 [ %m.3, %while.end159 ], [ %m.4, %while.cond174 ], [ %m.5, %if.end226 ]
%ans.6 = phi i64 [ %ans.3, %while.end159 ], [ %ans.4, %while.cond174 ], [ %ans.5, %if.end226 ]
%cmp45 = icmp sgt i32 %m.6, 0
br i1 %cmp45, label %while.body, label %while.end236, !llvm.loop !23
while.end236: ; preds = %if.end235
%call237 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %ans.6)
br label %cleanup
cleanup: ; preds = %while.end236, %if.then195, %if.then102
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %visited) #8
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %q) #8
call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %count) #8
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %d) #8
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %c) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #8
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
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
!17 = distinct !{!17, !12, !14, !15}
!18 = distinct !{!18, !12, !15, !14}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
|
#include <stdio.h>
int main(void){
while(1){
//入力
int n;
scanf("%d", &n);
if(!n) break;
int a[1001];
for(int i=0; i<n; i++){
scanf("%d", &a[i]);
}
//処理
int ans = 5000000;//とりあえず大きい数字で初期化
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
int tmp;
if(a[i] < a[j]){
tmp = a[j] - a[i];
} else{
tmp = a[i] - a[j];
}
if(tmp < ans){
ans = tmp;
}
}
}
//出力(改行を忘れないように)
printf("%d\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120501/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120501/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not65 = icmp eq i32 %0, 0
br i1 %tobool.not65, label %while.end, label %if.end
if.end: ; preds = %entry, %cleanup
%1 = phi i32 [ %19, %cleanup ], [ %0, %entry ]
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %a) #4
%cmp54 = icmp sgt i32 %1, 0
br i1 %cmp54, label %for.body, label %cleanup
for.cond3.preheader: ; preds = %for.body
%cmp460 = icmp sgt i32 %3, 0
br i1 %cmp460, label %for.body6.preheader, label %cleanup
for.body6.preheader: ; preds = %for.cond3.preheader
%2 = zext i32 %3 to i64
%wide.trip.count76 = zext i32 %3 to i64
br label %for.body6
for.body: ; preds = %if.end, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %if.end ]
%arrayidx = getelementptr inbounds [1001 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
%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.cond3.preheader, !llvm.loop !9
for.cond3.loopexit: ; preds = %for.body10, %middle.block, %for.body6
%ans.1.lcssa = phi i32 [ %ans.061, %for.body6 ], [ %17, %middle.block ], [ %ans.2, %for.body10 ]
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond77.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count76
br i1 %exitcond77.not, label %cleanup, label %for.body6, !llvm.loop !11
for.body6: ; preds = %for.body6.preheader, %for.cond3.loopexit
%indvars.iv73 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next74, %for.cond3.loopexit ]
%indvars.iv68 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next69, %for.cond3.loopexit ]
%ans.061 = phi i32 [ 5000000, %for.body6.preheader ], [ %ans.1.lcssa, %for.cond3.loopexit ]
%5 = xor i64 %indvars.iv73, -1
%6 = add nsw i64 %5, %wide.trip.count76
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%cmp856 = icmp ult i64 %indvars.iv.next74, %2
br i1 %cmp856, label %for.body10.lr.ph, label %for.cond3.loopexit
for.body10.lr.ph: ; preds = %for.body6
%arrayidx12 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv73
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%min.iters.check = icmp ult i64 %6, 8
br i1 %min.iters.check, label %for.body10.preheader, label %vector.ph
vector.ph: ; preds = %for.body10.lr.ph
%n.vec = and i64 %6, -8
%ind.end = add i64 %indvars.iv68, %n.vec
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %ans.061, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %7, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %14, %vector.body ]
%vec.phi80 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %15, %vector.body ]
%offset.idx = add i64 %indvars.iv68, %index
%8 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load81 = load <4 x i32>, ptr %9, align 4, !tbaa !5
%10 = sub nsw <4 x i32> %broadcast.splat, %wide.load
%11 = sub nsw <4 x i32> %broadcast.splat, %wide.load81
%12 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %10, i1 true)
%13 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %11, i1 true)
%14 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %12, <4 x i32> %vec.phi)
%15 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %13, <4 x i32> %vec.phi80)
%index.next = add nuw i64 %index, 8
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %14, <4 x i32> %15)
%17 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %6, %n.vec
br i1 %cmp.n, label %for.cond3.loopexit, label %for.body10.preheader
for.body10.preheader: ; preds = %for.body10.lr.ph, %middle.block
%indvars.iv70.ph = phi i64 [ %indvars.iv68, %for.body10.lr.ph ], [ %ind.end, %middle.block ]
%ans.157.ph = phi i32 [ %ans.061, %for.body10.lr.ph ], [ %17, %middle.block ]
br label %for.body10
for.body10: ; preds = %for.body10.preheader, %for.body10
%indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body10 ], [ %indvars.iv70.ph, %for.body10.preheader ]
%ans.157 = phi i32 [ %ans.2, %for.body10 ], [ %ans.157.ph, %for.body10.preheader ]
%arrayidx14 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv70
%18 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%sub25 = sub nsw i32 %7, %18
%tmp.0 = call i32 @llvm.abs.i32(i32 %sub25, i1 true)
%ans.2 = call i32 @llvm.smin.i32(i32 %tmp.0, i32 %ans.157)
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count76
br i1 %exitcond.not, label %for.cond3.loopexit, label %for.body10, !llvm.loop !15
cleanup: ; preds = %for.cond3.loopexit, %if.end, %for.cond3.preheader
%ans.0.lcssa = phi i32 [ 5000000, %for.cond3.preheader ], [ 5000000, %if.end ], [ %ans.1.lcssa, %for.cond3.loopexit ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%19 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %19, 0
br i1 %tobool.not, label %while.end, label %if.end
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; 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 <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
|
#include<stdio.h>
int sum(int n){
if(n ==0)return 0;
return n%10 +sum(n/10);
}
int main(){
int a;
scanf("%d", &a);
if(a%sum(a)==0){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120545/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @sum(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp3 = icmp eq i32 %n, 0
br i1 %cmp3, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%n.tr5 = phi i32 [ %div, %if.end ], [ %n, %entry ]
%accumulator.tr4 = phi i32 [ %add, %if.end ], [ 0, %entry ]
%rem = srem i32 %n.tr5, 10
%div = sdiv i32 %n.tr5, 10
%add = add nsw i32 %rem, %accumulator.tr4
%n.tr5.off = add i32 %n.tr5, 9
%cmp = icmp ult i32 %n.tr5.off, 19
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
%accumulator.tr.lcssa = phi i32 [ 0, %entry ], [ %add, %if.end ]
ret i32 %accumulator.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp3.i = icmp eq i32 %0, 0
br i1 %cmp3.i, label %sum.exit, label %if.end.i
if.end.i: ; preds = %entry, %if.end.i
%n.tr5.i = phi i32 [ %div.i, %if.end.i ], [ %0, %entry ]
%accumulator.tr4.i = phi i32 [ %add.i, %if.end.i ], [ 0, %entry ]
%rem.i = srem i32 %n.tr5.i, 10
%div.i = sdiv i32 %n.tr5.i, 10
%add.i = add nsw i32 %rem.i, %accumulator.tr4.i
%n.tr5.off.i = add i32 %n.tr5.i, 9
%cmp.i = icmp ult i32 %n.tr5.off.i, 19
br i1 %cmp.i, label %sum.exit, label %if.end.i
sum.exit: ; preds = %if.end.i, %entry
%accumulator.tr.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %if.end.i ]
%rem = srem i32 %0, %accumulator.tr.lcssa.i
%cmp = icmp eq i32 %rem, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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"}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>
/*以下便利なマクロを定義する。*/
#define rep(i, min, max) for(i=min; i<=max; i=i+1)
#define if_forall(i, min, max, prop)\
\
rep(i, min, max)\
{\
if(!(prop))\
{\
break;\
}\
}\
\
if(i==max+1)\
#define if_exists(i, min, max, prop)\
\
rep(i, min, max)\
{\
if(prop)\
{\
break;\
}\
}\
\
if(i<max+1)\
#define sum(i, min, max, sequence, answer)\
{\
answer=0;\
rep(i, min, max)\
{\
answer=answer+sequence;\
}\
}\
#define prod(i, min, max, sequence, answer)\
{\
answer=1;\
rep(i, min, max)\
{\
answer=answer*sequence;\
}\
}\
/*以下便利な関数を定義する。*/
void fill_int(int array[], int min, int max, int element)
{
int i=min;
rep(i, min, max)
{
array[i]=element;
}
}
void fill_char(char array[], int min, int max, char element)
{
int i=min;
rep(i, min, max)
{
array[i]=element;
}
}
void swap_int(int* x, int* y)
{
int tmp;
tmp = *x;
*x = *y;
*y = tmp;
}
void swap_int_array(int x[], int y[], int min, int max)
{
int i;
rep(i, min, max)
{
swap_int(&x[i], &y[i]);
}
}
void swap_char(char* x, char* y)
{
char tmp;
tmp = *x;
*x = *y;
*y = tmp;
}
void swap_char_array(char x[], char y[], int min, int max)
{
int i;
rep(i, min, max)
{
swap_char(&x[i], &y[i]);
}
}
void reverse_char(char array[], int min, int max)
{
int i;
rep(i, min, (min+max)/2)
{
swap_char(&array[i], &array[min+max-i]);
}
}
int max_int(int var1, int var2)
{
int answer=var1;
if(answer<var2)
{
answer=var2;
}
return answer;
}
int min_int(int var1, int var2)
{
int answer=var1;
if(answer>var2)
{
answer=var2;
}
return answer;
}
long int pow_int(int base, unsigned int exponent)
{
long int answer=1;
answer=(long int)pow((double)base, (double)exponent);
return answer;
}
long int pow_int_mod(int base, unsigned int exponent, int mod)
{
long int answer=1;
while (exponent>0)
{
if (exponent&1)
{
answer=(answer*(base%mod))%mod;
if(answer==0)
{
break;
}
}
base=(base*base)%mod;
exponent=exponent>>1;
}
return answer;
}
unsigned long int factorial(unsigned int num)
{
unsigned int i=0;
unsigned long int answer=1;
rep(i, 2, num)
{
answer=answer*i;
}
return answer;
}
unsigned long int factorial_mod(unsigned int num, int mod)
{
unsigned int i=0;
unsigned long int answer=1;
rep(i, 2, num)
{
answer=(answer*(i%mod))%mod;
if(answer==0)
{
break;
}
}
return answer;
}
unsigned long int combination(unsigned int n, unsigned int k)
{
unsigned int i=0;
unsigned long int numerator=1;
unsigned long int denominator=1;
k=min_int(k, n-k);
rep(i, 2, k)
{
numerator=numerator*(n+1-i);
denominator=denominator*i;
}
return numerator/denominator;
}
double combination_general(double alpha, unsigned int k)
{
unsigned int i;
double numerator=1;
unsigned long int denominator=1;
rep(i, 1, k)
{
numerator=numerator*(alpha+1-i);
denominator=denominator*i;
}
return numerator/denominator;
}
int gcd(int a, int b)
{
if(a<b)
{
swap_int(&a, &b);
}
int r=a%b;
while(r!=0)
{
a=b;
b=r;
r=a%b;
}
return b;
}
int lcm(int a, int b)
{
return (a/gcd(a, b))*b;
}
int order(long int num)
{
int answer=-1;
while(num!=0)
{
num=num/10;
answer=answer+1;
}
return answer;
}
long int convert_adic_int(char num[], unsigned int p_adic, unsigned int q_adic)
{
int i=0;
long int answer=0;
bool sgn=0;
long int tmp=strtol(num, NULL, p_adic);
if(tmp<0)
{
sgn=1;
tmp=-tmp;
}
while(tmp>0)
{
answer=answer+(tmp%q_adic)*pow_int(10, i);
tmp=tmp/q_adic;
i=i+1;
}
if(sgn==0)
{
return answer;
}
else
{
return -answer;
}
}
void convert_adic_char(char num[], unsigned int p_adic, unsigned int q_adic)
{
int i=0;
int mod[32]={0};
bool sgn=0;
int digit=0;
long int tmp=strtol(num, NULL, p_adic);
if(tmp<0)
{
sgn=1;
tmp=-tmp;
}
while(tmp>0)
{
mod[i]=tmp%q_adic;
digit=i;
tmp=tmp/q_adic;
i=i+1;
}
fill_char(num, 0, strlen(num)-1, '\0');
if(sgn==1)
{
num[0]='-';
}
rep(i, 0, digit)
{
if(mod[i]<10)
{
num[sgn+digit-i]='0'+mod[i];
}
else if(mod[i]<q_adic)
{
num[sgn+digit-i]='a'+(mod[i]-10);
}
}
}
int sum_digit(int num)
{
int answer=0;
num=abs(num);
while(num>0)
{
answer=answer+num%10;
num=num/10;
}
return answer;
}
int count_mod(int min, int max, int num)
{
if(min>0)
{
return max/num-(min-1)/num;
}
else if(min==0)
{
return max/num+1;
}
else
{
return -1;
}
}
void shift_char(char array[], int min, int max, int num)
{
int i;
for(i=max; i>=min; i=i-1)
{
array[i+num]=array[i];
}
rep(i, min, min+num-1)
{
array[i]='\0';
}
}
void convert_char(char array[], int min, int max, char pre, char post)
{
int i=min;
rep(i, min, max)
{
if(array[i]==pre)
{
array[i]=post;
}
}
}
void sort_asc_int(int array[], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(array[i]>array[j])
{
swap_int(&array[i], &array[j]);
}
}
}
}
void sort_des_int(int array[], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(array[i]<array[j])
{
swap_int(&array[i], &array[j]);
}
}
}
}
void sort_asc_char_dic(char array[], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(strcmp(&array[i], &array[j])>0)
{
swap_char(&array[i], &array[j]);
}
}
}
}
void sort_asc_char_array_dic(int size, char array[][size], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(strcmp(array[i], array[j])>0)
{
swap_char_array(array[i], array[j], 0, size-1);
}
}
}
}
void sort_des_char_dic(char array[], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(strcmp(&array[i], &array[j])<0)
{
swap_char(&array[i], &array[j]);
}
}
}
}
void sort_des_char_array_dic(int size, char array[][size], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(strcmp(array[i], array[j])<0)
{
swap_char_array(array[i], array[j], 0, size-1);
}
}
}
}
int max_int_array(int array[], int min, int max)
{
int i;
int answer;
answer=array[min];
for(i=min+1; i<=max; i=i+1)
{
answer=max_int(answer, array[i]);
}
return answer;
}
void max_int_array_num(int array[], int min, int max, int answer[])
{
int i=min;
int count=0;
int max_value=max_int_array(array, min, max);
fill_int(answer, 0, max-min, -1);
rep(i, min, max)
{
if(array[i]==max_value)
{
answer[count]=i;
count=count+1;
}
}
}
int min_int_array(int array[], int min, int max)
{
int i;
int answer;
answer=array[min];
for(i=min+1; i<=max; i=i+1)
{
answer=min_int(answer, array[i]);
}
return answer;
}
void min_int_array_num(int array[], int min, int max, int answer[])
{
int i=min;
int count=0;
int min_value=min_int_array(array, min, max);
fill_int(answer, 0, max-min, -1);
rep(i, min, max)
{
if(array[i]==min_value)
{
answer[count]=i;
count=count+1;
}
}
}
int max_char_array_dic(int size, char array[][size], int min, int max)
{
int i;
int answer=min;
rep(i, min+1, max)
{
if(strcmp(array[answer], array[i])<0)
{
answer=i;
}
}
return answer;
}
int min_char_array_dic(int size, char array[][size], int min, int max)
{
int i;
int answer=min;
rep(i, min+1, max)
{
if(strcmp(array[answer], array[i])>0)
{
answer=i;
}
}
return answer;
}
int sum_array(int array[], int min, int max)
{
int i=min;
int answer=0;
rep(i, min, max)
{
answer=answer+array[i];
}
return answer;
}
bool detect_int(int array[], int min, int max, int element)
{
int i;
bool answer=0;
if_exists(i, min, max, array[i]==element)
{
answer=1;
}
return answer;
}
bool detect_char(char array[], int min, int max, char element)
{
int i;
bool answer=0;
if_exists(i, min, max, array[i]==element)
{
answer=1;
}
return answer;
}
bool detect_char_array(char array[], int min, int max, char element[], int start, int goal)
{
int i, j;
bool answer=0;
if(goal-start<=max-min)
{
rep(i, min, max-(goal-start))
{
if_forall(j, start, goal, array[i+j-start]==element[j])
{
answer=1;
break;
}
}
}
return answer;
}
int count_differentelement_int(int array[], int min, int max)
{
int i=min;
int pickup[max];
fill_int(pickup, 0, max, 0);
int answer=0;
rep(i, min, max)
{
if(detect_int(pickup, 0, answer-1, array[i])==0)
{
pickup[answer]=array[i];
answer=answer+1;
}
}
return answer;
}
int count_differentelement_char(char array[], int min, int max)
{
int i=min;
char pickup[max];
fill_char(pickup, 0, max, '\0');
int answer=0;
rep(i, min, max)
{
if(detect_char_array(pickup, 0, answer-1, array, i, i)==0)
{
pickup[answer]=array[i];
answer=answer+1;
}
}
return answer;
}
int count_equalelement_int(int array[], int min, int max, int element)
{
int i;
int answer=0;
rep(i, min, max)
{
if(array[i]==element)
{
answer=answer+1;
}
}
return answer;
}
int count_equalelement_char(char array[], int min, int max, char element)
{
int i;
int answer=0;
rep(i, min, max)
{
if(array[i]==element)
{
answer=answer+1;
}
}
return answer;
}
int count_equalelement_char_array(int size, char array[][size], int min, int max, char element[])
{
int i;
int answer=0;
rep(i, min, max)
{
if(strcmp(array[i], element)==0)
{
answer=answer+1;
}
}
return answer;
}
void scanf_int_array(int array[], int min, int max)
{
int i;
rep(i, min, max)
{
scanf("%d", &array[i]);
}
}
void scanf_int_array_2(int array1[], int array2[], int min, int max)
{
int i;
rep(i, min, max)
{
scanf("%d %d", &array1[i], &array2[i]);
}
}
void scanf_int_array_3(int array1[], int array2[], int array3[], int min, int max)
{
int i;
rep(i, min, max)
{
scanf("%d %d %d", &array1[i], &array2[i], &array3[i]);
}
}
void scanf_char_array(char array[], int num)
{
scanf("%s", array);
shift_char(array, 0, strlen(array)-1, num);
}
void printf_int_array(int array[], int min, int max)
{
int i;
rep(i, min, max)
{
printf("%d\n", array[i]);
}
}
void printf_char_array(char array[], int min, int max)
{
int i;
for(i=min; i<=max; i=i+1)
{
printf("%c", array[i]);
}
}
int main()
{
int i;
int N;
scanf("%d", &N);
if(N%sum_digit(N)==0)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120589/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120589/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.8 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable
define dso_local void @fill_int(ptr nocapture noundef writeonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp sgt i32 %min, %max
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
store <4 x i32> %broadcast.splat, ptr %gep, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %gep, i64 4
store <4 x i32> %broadcast.splat, ptr %5, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader7 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
store i32 %element, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
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: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @fill_char(ptr nocapture noundef writeonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp sgt i32 %min, %max
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%scevgep = getelementptr i8, ptr %array, i64 %0
%1 = sub i32 %max, %min
%2 = zext i32 %1 to i64
%3 = add nuw nsw i64 %2, 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 %element, i64 %3, i1 false), !tbaa !14
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap_int(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @swap_int_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 15
br i1 %min.iters.check, label %for.body.preheader15, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%5 = shl nsw i64 %0, 2
%scevgep = getelementptr i8, ptr %x, i64 %5
%6 = sub i32 %max, %min
%7 = zext i32 %6 to i64
%8 = add nsw i64 %0, %7
%9 = shl nsw i64 %8, 2
%10 = add nsw i64 %9, 4
%scevgep9 = getelementptr i8, ptr %x, i64 %10
%scevgep10 = getelementptr i8, ptr %y, i64 %5
%scevgep11 = getelementptr i8, ptr %y, i64 %10
%bound0 = icmp ult ptr %scevgep, %scevgep11
%bound1 = icmp ult ptr %scevgep10, %scevgep9
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = add i64 %index, %0
%11 = getelementptr inbounds i32, ptr %x, i64 %offset.idx
%12 = getelementptr inbounds i32, ptr %y, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5, !alias.scope !15, !noalias !18
%13 = getelementptr inbounds i32, ptr %11, i64 4
%wide.load12 = load <4 x i32>, ptr %13, align 4, !tbaa !5, !alias.scope !15, !noalias !18
%wide.load13 = load <4 x i32>, ptr %12, align 4, !tbaa !5, !alias.scope !18
%14 = getelementptr inbounds i32, ptr %12, i64 4
%wide.load14 = load <4 x i32>, ptr %14, align 4, !tbaa !5, !alias.scope !18
store <4 x i32> %wide.load13, ptr %11, align 4, !tbaa !5, !alias.scope !15, !noalias !18
store <4 x i32> %wide.load14, ptr %13, align 4, !tbaa !5, !alias.scope !15, !noalias !18
store <4 x i32> %wide.load, ptr %12, align 4, !tbaa !5, !alias.scope !18
store <4 x i32> %wide.load12, ptr %14, align 4, !tbaa !5, !alias.scope !18
%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 !20
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %vector.memcheck ], [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%16 = add i32 %max, 1
%17 = trunc i64 %indvars.iv.ph to i32
%18 = sub i32 %16, %17
%xtraiter = and i32 %18, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader15
%arrayidx.prol = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.ph
%arrayidx2.prol = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.ph
%19 = load i32, ptr %arrayidx.prol, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
store i32 %20, ptr %arrayidx.prol, align 4, !tbaa !5
store i32 %19, ptr %arrayidx2.prol, align 4, !tbaa !5
%indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader15
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader15 ], [ %indvars.iv.next.prol, %for.body.prol ]
%21 = icmp eq i32 %17, %max
br i1 %21, 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 ]
%arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv
%22 = load i32, ptr %arrayidx, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %23, ptr %arrayidx, align 4, !tbaa !5
store i32 %22, ptr %arrayidx2, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next
%arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next
%24 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
store i32 %25, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %24, ptr %arrayidx2.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
%exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1
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, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap_char(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %x, align 1, !tbaa !14
%1 = load i8, ptr %y, align 1, !tbaa !14
store i8 %1, ptr %x, align 1, !tbaa !14
store i8 %0, ptr %y, align 1, !tbaa !14
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @swap_char_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck
vector.memcheck: ; preds = %iter.check
%scevgep = getelementptr i8, ptr %x, i64 %0
%5 = sub i32 %max, %min
%6 = zext i32 %5 to i64
%7 = add nsw i64 %0, %6
%8 = add nsw i64 %7, 1
%scevgep9 = getelementptr i8, ptr %x, i64 %8
%scevgep10 = getelementptr i8, ptr %y, i64 %0
%scevgep11 = getelementptr i8, ptr %y, i64 %8
%bound0 = icmp ult ptr %scevgep, %scevgep11
%bound1 = icmp ult ptr %scevgep10, %scevgep9
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check12 = icmp ult i32 %2, 31
br i1 %min.iters.check12, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %4, 8589934560
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = add i64 %index, %0
%9 = getelementptr inbounds i8, ptr %x, i64 %offset.idx
%10 = getelementptr inbounds i8, ptr %y, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %9, align 1, !tbaa !14, !alias.scope !22, !noalias !25
%11 = getelementptr inbounds i8, ptr %9, i64 16
%wide.load13 = load <16 x i8>, ptr %11, align 1, !tbaa !14, !alias.scope !22, !noalias !25
%wide.load14 = load <16 x i8>, ptr %10, align 1, !tbaa !14, !alias.scope !25
%12 = getelementptr inbounds i8, ptr %10, i64 16
%wide.load15 = load <16 x i8>, ptr %12, align 1, !tbaa !14, !alias.scope !25
store <16 x i8> %wide.load14, ptr %9, align 1, !tbaa !14, !alias.scope !22, !noalias !25
store <16 x i8> %wide.load15, ptr %11, align 1, !tbaa !14, !alias.scope !22, !noalias !25
store <16 x i8> %wide.load, ptr %10, align 1, !tbaa !14, !alias.scope !25
store <16 x i8> %wide.load13, ptr %12, align 1, !tbaa !14, !alias.scope !25
%index.next = add nuw i64 %index, 32
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !27
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end18 = add nsw i64 %n.vec, %0
%n.vec.remaining = and i64 %4, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec17 = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec17, %0
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index20 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next24, %vec.epilog.vector.body ]
%offset.idx21 = add i64 %index20, %0
%14 = getelementptr inbounds i8, ptr %x, i64 %offset.idx21
%15 = getelementptr inbounds i8, ptr %y, i64 %offset.idx21
%wide.load22 = load <8 x i8>, ptr %14, align 1, !tbaa !14, !alias.scope !28, !noalias !31
%wide.load23 = load <8 x i8>, ptr %15, align 1, !tbaa !14, !alias.scope !31
store <8 x i8> %wide.load23, ptr %14, align 1, !tbaa !14, !alias.scope !28, !noalias !31
store <8 x i8> %wide.load22, ptr %15, align 1, !tbaa !14, !alias.scope !31
%index.next24 = add nuw i64 %index20, 8
%16 = icmp eq i64 %index.next24, %n.vec17
br i1 %16, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !33
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n19 = icmp eq i64 %4, %n.vec17
br i1 %cmp.n19, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %ind.end18, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
%17 = add i32 %max, 1
%18 = trunc i64 %indvars.iv.ph to i32
%19 = sub i32 %17, %18
%xtraiter = and i32 %19, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx.prol = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.ph
%arrayidx2.prol = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.ph
%20 = load i8, ptr %arrayidx.prol, align 1, !tbaa !14
%21 = load i8, ptr %arrayidx2.prol, align 1, !tbaa !14
store i8 %21, ptr %arrayidx.prol, align 1, !tbaa !14
store i8 %20, ptr %arrayidx2.prol, align 1, !tbaa !14
%indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ]
%22 = icmp eq i32 %18, %max
br i1 %22, 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 ]
%arrayidx = getelementptr inbounds i8, ptr %x, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv
%23 = load i8, ptr %arrayidx, align 1, !tbaa !14
%24 = load i8, ptr %arrayidx2, align 1, !tbaa !14
store i8 %24, ptr %arrayidx, align 1, !tbaa !14
store i8 %23, ptr %arrayidx2, align 1, !tbaa !14
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.next
%arrayidx2.1 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.next
%25 = load i8, ptr %arrayidx.1, align 1, !tbaa !14
%26 = load i8, ptr %arrayidx2.1, align 1, !tbaa !14
store i8 %26, ptr %arrayidx.1, align 1, !tbaa !14
store i8 %25, ptr %arrayidx2.1, align 1, !tbaa !14
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
%exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !34
for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @reverse_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%add = add nsw i32 %max, %min
%div = sdiv i32 %add, 2
%cmp.not12 = icmp slt i32 %div, %min
br i1 %cmp.not12, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = sext i32 %add to i64
%2 = add nsw i32 %div, 1
%3 = add nsw i32 %div, 1
%4 = sub i32 %3, %min
%xtraiter = and i32 %4, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx.prol = getelementptr inbounds i8, ptr %array, i64 %0
%5 = sub nsw i64 %1, %0
%arrayidx3.prol = getelementptr inbounds i8, ptr %array, i64 %5
%6 = load i8, ptr %arrayidx.prol, align 1, !tbaa !14
%7 = load i8, ptr %arrayidx3.prol, align 1, !tbaa !14
store i8 %7, ptr %arrayidx.prol, align 1, !tbaa !14
store i8 %6, ptr %arrayidx3.prol, align 1, !tbaa !14
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ]
%8 = icmp eq i32 %div, %min
br i1 %8, 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 ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%9 = sub nsw i64 %1, %indvars.iv
%arrayidx3 = getelementptr inbounds i8, ptr %array, i64 %9
%10 = load i8, ptr %arrayidx, align 1, !tbaa !14
%11 = load i8, ptr %arrayidx3, align 1, !tbaa !14
store i8 %11, ptr %arrayidx, align 1, !tbaa !14
store i8 %10, ptr %arrayidx3, align 1, !tbaa !14
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next
%12 = sub nsw i64 %1, %indvars.iv.next
%arrayidx3.1 = getelementptr inbounds i8, ptr %array, i64 %12
%13 = load i8, ptr %arrayidx.1, align 1, !tbaa !14
%14 = load i8, ptr %arrayidx3.1, align 1, !tbaa !14
store i8 %14, ptr %arrayidx.1, align 1, !tbaa !14
store i8 %13, ptr %arrayidx3.1, align 1, !tbaa !14
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
%exitcond.not.1 = icmp eq i32 %2, %lftr.wideiv.1
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !35
for.end: ; preds = %for.body.prol.loopexit, %for.body, %entry
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max_int(i32 noundef %var1, i32 noundef %var2) local_unnamed_addr #5 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %var1, i32 %var2)
ret i32 %spec.select
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min_int(i32 noundef %var1, i32 noundef %var2) local_unnamed_addr #5 {
entry:
%spec.select = tail call i32 @llvm.smin.i32(i32 %var1, i32 %var2)
ret i32 %spec.select
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @pow_int(i32 noundef %base, i32 noundef %exponent) local_unnamed_addr #6 {
entry:
%conv = sitofp i32 %base to double
%conv1 = uitofp i32 %exponent to double
%call = tail call double @pow(double noundef %conv, double noundef %conv1) #24
%conv2 = fptosi double %call to i64
ret i64 %conv2
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #7
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @pow_int_mod(i32 noundef %base, i32 noundef %exponent, i32 noundef %mod) local_unnamed_addr #8 {
entry:
%cmp.not17 = icmp eq i32 %exponent, 0
br i1 %cmp.not17, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%conv1 = sext i32 %mod to i64
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end6
%answer.020 = phi i64 [ 1, %while.body.lr.ph ], [ %answer.1, %if.end6 ]
%base.addr.019 = phi i32 [ %base, %while.body.lr.ph ], [ %rem8, %if.end6 ]
%exponent.addr.018 = phi i32 [ %exponent, %while.body.lr.ph ], [ %shr, %if.end6 ]
%and = and i32 %exponent.addr.018, 1
%tobool.not = icmp eq i32 %and, 0
br i1 %tobool.not, label %if.end6, label %if.then
if.then: ; preds = %while.body
%rem = srem i32 %base.addr.019, %mod
%conv = sext i32 %rem to i64
%mul = mul nsw i64 %answer.020, %conv
%rem2 = srem i64 %mul, %conv1
%cmp3 = icmp eq i64 %rem2, 0
br i1 %cmp3, label %while.end, label %if.end6
if.end6: ; preds = %if.then, %while.body
%answer.1 = phi i64 [ %rem2, %if.then ], [ %answer.020, %while.body ]
%mul7 = mul nsw i32 %base.addr.019, %base.addr.019
%rem8 = srem i32 %mul7, %mod
%shr = lshr i32 %exponent.addr.018, 1
%cmp.not = icmp ult i32 %exponent.addr.018, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !36
while.end: ; preds = %if.end6, %if.then, %entry
%answer.2 = phi i64 [ 1, %entry ], [ 0, %if.then ], [ %answer.1, %if.end6 ]
ret i64 %answer.2
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @factorial(i32 noundef %num) local_unnamed_addr #9 {
entry:
%cmp.not4 = icmp ult i32 %num, 2
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = add i32 %num, 1
%umax = tail call i32 @llvm.umax.i32(i32 %0, i32 3)
%wide.trip.count = zext i32 %umax to i64
%1 = add nsw i64 %wide.trip.count, -2
%2 = add nsw i64 %wide.trip.count, -3
%xtraiter = and i64 %1, 7
%3 = icmp ult i64 %2, 7
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %1, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next.7, %for.body ]
%answer.06 = 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 i64 %answer.06, %indvars.iv
%indvars.iv.next = or i64 %indvars.iv, 1
%mul.1 = mul i64 %mul, %indvars.iv.next
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul i64 %mul.1, %indvars.iv.next.1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul i64 %mul.2, %indvars.iv.next.2
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%mul.4 = mul i64 %mul.3, %indvars.iv.next.3
%indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5
%mul.5 = mul i64 %mul.4, %indvars.iv.next.4
%indvars.iv.next.5 = add nuw nsw i64 %indvars.iv, 6
%mul.6 = mul i64 %mul.5, %indvars.iv.next.5
%indvars.iv.next.6 = add nuw nsw i64 %indvars.iv, 7
%mul.7 = mul i64 %mul.6, %indvars.iv.next.6
%indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 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 !37
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%indvars.iv.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next.7, %for.body ]
%answer.06.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
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%answer.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %answer.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 i64 %answer.06.epil, %indvars.iv.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !38
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%answer.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @factorial_mod(i32 noundef %num, i32 noundef %mod) local_unnamed_addr #8 {
entry:
%cmp.not10 = icmp ult i32 %num, 2
br i1 %cmp.not10, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%conv1 = sext i32 %mod to i64
br label %for.body
for.cond: ; preds = %for.body
%add = add i32 %i.011, 1
%cmp.not = icmp ugt i32 %add, %num
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !40
for.body: ; preds = %for.body.lr.ph, %for.cond
%answer.012 = phi i64 [ 1, %for.body.lr.ph ], [ %rem2, %for.cond ]
%i.011 = phi i32 [ 2, %for.body.lr.ph ], [ %add, %for.cond ]
%rem = urem i32 %i.011, %mod
%conv = zext i32 %rem to i64
%mul = mul i64 %answer.012, %conv
%rem2 = urem i64 %mul, %conv1
%cmp3 = icmp eq i64 %rem2, 0
br i1 %cmp3, label %for.end, label %for.cond
for.end: ; preds = %for.cond, %for.body, %entry
%answer.1 = phi i64 [ 1, %entry ], [ 0, %for.body ], [ %rem2, %for.cond ]
ret i64 %answer.1
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @combination(i32 noundef %n, i32 noundef %k) local_unnamed_addr #9 {
entry:
%sub = sub i32 %n, %k
%spec.select.i = tail call i32 @llvm.smin.i32(i32 %k, i32 %sub)
%cmp.not13 = icmp ult i32 %spec.select.i, 2
br i1 %cmp.not13, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add i32 %n, 1
%0 = add i32 %spec.select.i, 1
%umax = tail call i32 @llvm.umax.i32(i32 %0, i32 3)
%wide.trip.count = zext i32 %umax to i64
%1 = add nsw i64 %wide.trip.count, -2
%2 = add nsw i64 %wide.trip.count, -3
%xtraiter = and i64 %1, 3
%3 = icmp ult i64 %2, 3
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %1, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 2, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ]
%denominator.016 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul3.3, %for.body ]
%numerator.015 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul.3, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%4 = trunc i64 %indvars.iv to i32
%sub1 = sub i32 %add, %4
%conv = zext i32 %sub1 to i64
%mul = mul i64 %numerator.015, %conv
%mul3 = mul i64 %denominator.016, %indvars.iv
%indvars.iv.next = or i64 %indvars.iv, 1
%5 = trunc i64 %indvars.iv.next to i32
%sub1.1 = sub i32 %add, %5
%conv.1 = zext i32 %sub1.1 to i64
%mul.1 = mul i64 %mul, %conv.1
%mul3.1 = mul i64 %mul3, %indvars.iv.next
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%6 = trunc i64 %indvars.iv.next.1 to i32
%sub1.2 = sub i32 %add, %6
%conv.2 = zext i32 %sub1.2 to i64
%mul.2 = mul i64 %mul.1, %conv.2
%mul3.2 = mul i64 %mul3.1, %indvars.iv.next.1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%7 = trunc i64 %indvars.iv.next.2 to i32
%sub1.3 = sub i32 %add, %7
%conv.3 = zext i32 %sub1.3 to i64
%mul.3 = mul i64 %mul.2, %conv.3
%mul3.3 = mul i64 %mul3.2, %indvars.iv.next.2
%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 !41
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul.3, %for.body ]
%mul3.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul3.3, %for.body ]
%indvars.iv.unr = phi i64 [ 2, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ]
%denominator.016.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul3.3, %for.body ]
%numerator.015.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit, 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 ]
%denominator.016.epil = phi i64 [ %mul3.epil, %for.body.epil ], [ %denominator.016.unr, %for.end.loopexit.unr-lcssa ]
%numerator.015.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %numerator.015.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%8 = trunc i64 %indvars.iv.epil to i32
%sub1.epil = sub i32 %add, %8
%conv.epil = zext i32 %sub1.epil to i64
%mul.epil = mul i64 %numerator.015.epil, %conv.epil
%mul3.epil = mul i64 %denominator.016.epil, %indvars.iv.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end.loopexit, label %for.body.epil, !llvm.loop !42
for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa
%mul.lcssa = phi i64 [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
%mul3.lcssa = phi i64 [ %mul3.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul3.epil, %for.body.epil ]
%9 = udiv i64 %mul.lcssa, %mul3.lcssa
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%div = phi i64 [ 1, %entry ], [ %9, %for.end.loopexit ]
ret i64 %div
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local double @combination_general(double noundef %alpha, i32 noundef %k) local_unnamed_addr #9 {
entry:
%cmp.not10 = icmp eq i32 %k, 0
br i1 %cmp.not10, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = fadd double %alpha, 1.000000e+00
%0 = add i32 %k, 1
%umax = tail call i32 @llvm.umax.i32(i32 %0, i32 2)
%wide.trip.count = zext i32 %umax to i64
%1 = add nsw i64 %wide.trip.count, -1
%2 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %1, 3
%3 = icmp ult i64 %2, 3
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %1, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 1, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ]
%denominator.013 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul2.3, %for.body ]
%numerator.012 = phi double [ 1.000000e+00, %for.body.lr.ph.new ], [ %mul.3, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%4 = trunc i64 %indvars.iv to i32
%conv = uitofp i32 %4 to double
%sub = fsub double %add, %conv
%mul = fmul double %numerator.012, %sub
%mul2 = mul i64 %denominator.013, %indvars.iv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = trunc i64 %indvars.iv.next to i32
%conv.1 = uitofp i32 %5 to double
%sub.1 = fsub double %add, %conv.1
%mul.1 = fmul double %mul, %sub.1
%mul2.1 = mul i64 %mul2, %indvars.iv.next
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%6 = trunc i64 %indvars.iv.next.1 to i32
%conv.2 = uitofp i32 %6 to double
%sub.2 = fsub double %add, %conv.2
%mul.2 = fmul double %mul.1, %sub.2
%mul2.2 = mul i64 %mul2.1, %indvars.iv.next.1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%7 = trunc i64 %indvars.iv.next.2 to i32
%conv.3 = uitofp i32 %7 to double
%sub.3 = fsub double %add, %conv.3
%mul.3 = fmul double %mul.2, %sub.3
%mul2.3 = mul i64 %mul2.2, %indvars.iv.next.2
%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 !43
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.lcssa.ph = phi double [ undef, %for.body.lr.ph ], [ %mul.3, %for.body ]
%mul2.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul2.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ]
%denominator.013.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul2.3, %for.body ]
%numerator.012.unr = phi double [ 1.000000e+00, %for.body.lr.ph ], [ %mul.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit, 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 ]
%denominator.013.epil = phi i64 [ %mul2.epil, %for.body.epil ], [ %denominator.013.unr, %for.end.loopexit.unr-lcssa ]
%numerator.012.epil = phi double [ %mul.epil, %for.body.epil ], [ %numerator.012.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%8 = trunc i64 %indvars.iv.epil to i32
%conv.epil = uitofp i32 %8 to double
%sub.epil = fsub double %add, %conv.epil
%mul.epil = fmul double %numerator.012.epil, %sub.epil
%mul2.epil = mul i64 %denominator.013.epil, %indvars.iv.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end.loopexit, label %for.body.epil, !llvm.loop !44
for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa
%mul.lcssa = phi double [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
%mul2.lcssa = phi i64 [ %mul2.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul2.epil, %for.body.epil ]
%9 = uitofp i64 %mul2.lcssa to double
%10 = fdiv double %mul.lcssa, %9
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%div = phi double [ 1.000000e+00, %entry ], [ %10, %for.end.loopexit ]
ret double %div
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #9 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
%spec.select8 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%rem = srem i32 %spec.select, %spec.select8
%cmp1.not9 = icmp eq i32 %rem, 0
br i1 %cmp1.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.011 = phi i32 [ %rem2, %while.body ], [ %rem, %entry ]
%b.addr.110 = phi i32 [ %r.011, %while.body ], [ %spec.select8, %entry ]
%rem2 = srem i32 %b.addr.110, %r.011
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !45
while.end: ; preds = %while.body, %entry
%b.addr.1.lcssa = phi i32 [ %spec.select8, %entry ], [ %r.011, %while.body ]
ret i32 %b.addr.1.lcssa
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #9 {
entry:
%spec.select.i = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
%spec.select8.i = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%rem.i = srem i32 %spec.select.i, %spec.select8.i
%cmp1.not9.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.not9.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%r.011.i = phi i32 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ]
%b.addr.110.i = phi i32 [ %r.011.i, %while.body.i ], [ %spec.select8.i, %entry ]
%rem2.i = srem i32 %b.addr.110.i, %r.011.i
%cmp1.not.i = icmp eq i32 %rem2.i, 0
br i1 %cmp1.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !45
gcd.exit: ; preds = %while.body.i, %entry
%b.addr.1.lcssa.i = phi i32 [ %spec.select8.i, %entry ], [ %r.011.i, %while.body.i ]
%div = sdiv i32 %a, %b.addr.1.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @order(i64 noundef %num) local_unnamed_addr #8 {
entry:
%cmp.not3 = icmp eq i64 %num, 0
br i1 %cmp.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%answer.05 = phi i32 [ %add, %while.body ], [ -1, %entry ]
%num.addr.04 = phi i64 [ %div, %while.body ], [ %num, %entry ]
%div = sdiv i64 %num.addr.04, 10
%add = add nsw i32 %answer.05, 1
%num.addr.04.off = add i64 %num.addr.04, 9
%cmp.not = icmp ult i64 %num.addr.04.off, 19
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !46
while.end: ; preds = %while.body, %entry
%answer.0.lcssa = phi i32 [ -1, %entry ], [ %add, %while.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @convert_adic_int(ptr nocapture noundef readonly %num, i32 noundef %p_adic, i32 noundef %q_adic) local_unnamed_addr #10 {
entry:
%call = tail call i64 @strtol(ptr nocapture noundef %num, ptr noundef null, i32 noundef %p_adic) #24
%cmp122.not = icmp eq i64 %call, 0
br i1 %cmp122.not, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%spec.select = tail call i64 @llvm.abs.i64(i64 %call, i1 true)
%conv = zext i32 %q_adic to i64
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%tmp.125 = phi i64 [ %spec.select, %while.body.lr.ph ], [ %div, %while.body ]
%answer.024 = phi i64 [ 0, %while.body.lr.ph ], [ %add, %while.body ]
%i.023 = phi i32 [ 0, %while.body.lr.ph ], [ %add4, %while.body ]
%rem = urem i64 %tmp.125, %conv
%conv1.i = uitofp i32 %i.023 to double
%call.i = tail call double @pow(double noundef 1.000000e+01, double noundef %conv1.i) #24
%conv2.i = fptosi double %call.i to i64
%mul = mul nsw i64 %rem, %conv2.i
%add = add nsw i64 %mul, %answer.024
%div = udiv i64 %tmp.125, %conv
%add4 = add nuw nsw i32 %i.023, 1
%cmp1.not = icmp ult i64 %tmp.125, %conv
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !47
while.end: ; preds = %while.body, %entry
%answer.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
%sub9 = sub nsw i64 0, %answer.0.lcssa
%cmp621 = icmp slt i64 %call, 0
%retval.0 = select i1 %cmp621, i64 %sub9, i64 %answer.0.lcssa
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #11
; Function Attrs: nofree nounwind uwtable
define dso_local void @convert_adic_char(ptr nocapture noundef %num, i32 noundef %p_adic, i32 noundef %q_adic) local_unnamed_addr #10 {
entry:
%mod = alloca [32 x i32], align 16
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %mod) #24
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %mod, i8 0, i64 128, i1 false)
%call = tail call i64 @strtol(ptr nocapture noundef %num, ptr noundef null, i32 noundef %p_adic) #24
%cmp = icmp slt i64 %call, 0
%cmp174.not = icmp eq i64 %call, 0
br i1 %cmp174.not, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%spec.select = tail call i64 @llvm.abs.i64(i64 %call, i1 true)
%conv = zext i32 %q_adic to i64
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next, %while.body ]
%tmp.176 = phi i64 [ %spec.select, %while.body.lr.ph ], [ %div, %while.body ]
%rem = urem i64 %tmp.176, %conv
%conv2 = trunc i64 %rem to i32
%arrayidx = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv
store i32 %conv2, ptr %arrayidx, align 4, !tbaa !5
%div = udiv i64 %tmp.176, %conv
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%cmp1.not = icmp ult i64 %tmp.176, %conv
br i1 %cmp1.not, label %while.end.loopexit, label %while.body, !llvm.loop !48
while.end.loopexit: ; preds = %while.body
%0 = trunc i64 %indvars.iv to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%digit.0.lcssa = phi i32 [ 0, %entry ], [ %0, %while.end.loopexit ]
%call4 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num) #25
%1 = trunc i64 %call4 to i32
%conv6 = add i32 %1, -1
%cmp.not4.i = icmp slt i32 %conv6, 0
br i1 %cmp.not4.i, label %fill_char.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %while.end
%2 = zext i32 %conv6 to i64
%3 = add nuw nsw i64 %2, 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %num, i8 0, i64 %3, i1 false), !tbaa !14
br label %fill_char.exit
fill_char.exit: ; preds = %while.end, %for.body.preheader.i
%call.lobit = lshr i64 %call, 63
%conv7 = trunc i64 %call.lobit to i32
br i1 %cmp, label %if.then10, label %if.end12
if.then10: ; preds = %fill_char.exit
store i8 45, ptr %num, align 1, !tbaa !14
br label %if.end12
if.end12: ; preds = %if.then10, %fill_char.exit
%add42 = add nuw nsw i32 %digit.0.lcssa, %conv7
%4 = add i32 %digit.0.lcssa, 1
%wide.trip.count = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 16
br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %if.end12
%5 = add nsw i64 %wide.trip.count, -1
%6 = add i32 %digit.0.lcssa, %conv7
%7 = trunc i64 %5 to i32
%8 = sub i32 %6, %7
%9 = icmp sgt i32 %8, %6
%10 = icmp ugt i64 %5, 4294967295
%11 = or i1 %9, %10
br i1 %11, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %wide.trip.count, 4294967292
%ind.end = sub nsw i64 0, %n.vec
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %q_adic, 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 = %pred.store.continue95, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue95 ]
%12 = trunc i64 %index to i32
%13 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %13, align 16, !tbaa !5
%14 = icmp slt <4 x i32> %wide.load, <i32 10, i32 10, i32 10, i32 10>
%15 = icmp ult <4 x i32> %wide.load, %broadcast.splat
%16 = xor <4 x i1> %14, <i1 true, i1 true, i1 true, i1 true>
%17 = select <4 x i1> %16, <4 x i1> %15, <4 x i1> zeroinitializer
%predphi = select <4 x i1> %17, <4 x i8> <i8 87, i8 87, i8 87, i8 87>, <4 x i8> <i8 48, i8 48, i8 48, i8 48>
%18 = or <4 x i1> %17, %14
%19 = extractelement <4 x i1> %18, i64 0
br i1 %19, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%20 = sub i32 %add42, %12
%21 = sext i32 %20 to i64
%22 = bitcast <4 x i32> %wide.load to <16 x i8>
%23 = extractelement <16 x i8> %22, i64 0
%24 = getelementptr inbounds i8, ptr %num, i64 %21
%25 = extractelement <4 x i8> %predphi, i64 0
%26 = add i8 %25, %23
store i8 %26, ptr %24, align 1, !tbaa !14
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%27 = extractelement <4 x i1> %18, i64 1
br i1 %27, label %pred.store.if90, label %pred.store.continue91
pred.store.if90: ; preds = %pred.store.continue
%28 = xor i32 %12, -1
%29 = add i32 %add42, %28
%30 = sext i32 %29 to i64
%31 = bitcast <4 x i32> %wide.load to <16 x i8>
%32 = extractelement <16 x i8> %31, i64 4
%33 = getelementptr inbounds i8, ptr %num, i64 %30
%34 = extractelement <4 x i8> %predphi, i64 1
%35 = add i8 %34, %32
store i8 %35, ptr %33, align 1, !tbaa !14
br label %pred.store.continue91
pred.store.continue91: ; preds = %pred.store.if90, %pred.store.continue
%36 = extractelement <4 x i1> %18, i64 2
br i1 %36, label %pred.store.if92, label %pred.store.continue93
pred.store.if92: ; preds = %pred.store.continue91
%reass.sub = sub i32 %add42, %12
%37 = add i32 %reass.sub, -2
%38 = sext i32 %37 to i64
%39 = bitcast <4 x i32> %wide.load to <16 x i8>
%40 = extractelement <16 x i8> %39, i64 8
%41 = getelementptr inbounds i8, ptr %num, i64 %38
%42 = extractelement <4 x i8> %predphi, i64 2
%43 = add i8 %42, %40
store i8 %43, ptr %41, align 1, !tbaa !14
br label %pred.store.continue93
pred.store.continue93: ; preds = %pred.store.if92, %pred.store.continue91
%44 = extractelement <4 x i1> %18, i64 3
br i1 %44, label %pred.store.if94, label %pred.store.continue95
pred.store.if94: ; preds = %pred.store.continue93
%reass.sub96 = sub i32 %add42, %12
%45 = add i32 %reass.sub96, -3
%46 = sext i32 %45 to i64
%47 = bitcast <4 x i32> %wide.load to <16 x i8>
%48 = extractelement <16 x i8> %47, i64 12
%49 = getelementptr inbounds i8, ptr %num, i64 %46
%50 = extractelement <4 x i8> %predphi, i64 3
%51 = add i8 %50, %48
store i8 %51, ptr %49, align 1, !tbaa !14
br label %pred.store.continue95
pred.store.continue95: ; preds = %pred.store.if94, %pred.store.continue93
%index.next = add nuw i64 %index, 4
%52 = icmp eq i64 %index.next, %n.vec
br i1 %52, label %middle.block, label %vector.body, !llvm.loop !49
middle.block: ; preds = %pred.store.continue95
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %vector.scevcheck, %if.end12, %middle.block
%indvars.iv82.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %if.end12 ], [ %n.vec, %middle.block ]
%indvars.iv80.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %if.end12 ], [ %ind.end, %middle.block ]
%xtraiter = and i64 %wide.trip.count, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx16.prol = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv82.ph
%53 = load i32, ptr %arrayidx16.prol, align 16, !tbaa !5
%cmp17.prol = icmp slt i32 %53, 10
br i1 %cmp17.prol, label %for.inc.sink.split.prol, label %if.else.prol
if.else.prol: ; preds = %for.body.prol
%cmp32.prol = icmp ult i32 %53, %q_adic
br i1 %cmp32.prol, label %for.inc.sink.split.prol, label %for.inc.prol
for.inc.sink.split.prol: ; preds = %if.else.prol, %for.body.prol
%.sink88.prol = phi i8 [ 48, %for.body.prol ], [ 87, %if.else.prol ]
%54 = trunc i32 %53 to i8
%conv23.prol = add i8 %.sink88.prol, %54
%55 = trunc i64 %indvars.iv80.ph to i32
%sub27.prol = add i32 %add42, %55
%idxprom28.prol = sext i32 %sub27.prol to i64
%arrayidx29.prol = getelementptr inbounds i8, ptr %num, i64 %idxprom28.prol
store i8 %conv23.prol, ptr %arrayidx29.prol, align 1, !tbaa !14
br label %for.inc.prol
for.inc.prol: ; preds = %for.inc.sink.split.prol, %if.else.prol
%indvars.iv.next83.prol = or i64 %indvars.iv82.ph, 1
%indvars.iv.next81.prol = add nsw i64 %indvars.iv80.ph, -1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%indvars.iv82.unr = phi i64 [ %indvars.iv82.ph, %for.body.preheader ], [ %indvars.iv.next83.prol, %for.inc.prol ]
%indvars.iv80.unr = phi i64 [ %indvars.iv80.ph, %for.body.preheader ], [ %indvars.iv.next81.prol, %for.inc.prol ]
%56 = sub nsw i64 0, %wide.trip.count
%57 = xor i64 %indvars.iv82.ph, %56
%58 = icmp eq i64 %57, -1
br i1 %58, label %for.end, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv82 = phi i64 [ %indvars.iv.next83.1, %for.inc.1 ], [ %indvars.iv82.unr, %for.body.prol.loopexit ]
%indvars.iv80 = phi i64 [ %indvars.iv.next81.1, %for.inc.1 ], [ %indvars.iv80.unr, %for.body.prol.loopexit ]
%arrayidx16 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv82
%59 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp slt i32 %59, 10
br i1 %cmp17, label %for.inc.sink.split, label %if.else
if.else: ; preds = %for.body
%cmp32 = icmp ult i32 %59, %q_adic
br i1 %cmp32, label %for.inc.sink.split, label %for.inc
for.inc.sink.split: ; preds = %if.else, %for.body
%.sink88 = phi i8 [ 48, %for.body ], [ 87, %if.else ]
%60 = trunc i32 %59 to i8
%conv23 = add i8 %.sink88, %60
%61 = trunc i64 %indvars.iv80 to i32
%sub27 = add i32 %add42, %61
%idxprom28 = sext i32 %sub27 to i64
%arrayidx29 = getelementptr inbounds i8, ptr %num, i64 %idxprom28
store i8 %conv23, ptr %arrayidx29, align 1, !tbaa !14
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %if.else
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%arrayidx16.1 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv.next83
%62 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
%cmp17.1 = icmp slt i32 %62, 10
br i1 %cmp17.1, label %for.inc.sink.split.1, label %if.else.1
if.else.1: ; preds = %for.inc
%cmp32.1 = icmp ult i32 %62, %q_adic
br i1 %cmp32.1, label %for.inc.sink.split.1, label %for.inc.1
for.inc.sink.split.1: ; preds = %if.else.1, %for.inc
%.sink88.1 = phi i8 [ 48, %for.inc ], [ 87, %if.else.1 ]
%63 = trunc i32 %62 to i8
%conv23.1 = add i8 %.sink88.1, %63
%64 = trunc i64 %indvars.iv80 to i32
%65 = add i32 %64, -1
%sub27.1 = add i32 %add42, %65
%idxprom28.1 = sext i32 %sub27.1 to i64
%arrayidx29.1 = getelementptr inbounds i8, ptr %num, i64 %idxprom28.1
store i8 %conv23.1, ptr %arrayidx29.1, align 1, !tbaa !14
br label %for.inc.1
for.inc.1: ; preds = %for.inc.sink.split.1, %if.else.1
%indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2
%indvars.iv.next81.1 = add nsw i64 %indvars.iv80, -2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next83.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !50
for.end: ; preds = %for.body.prol.loopexit, %for.inc.1, %middle.block
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %mod) #24
ret void
}
; 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @sum_digit(i32 noundef %num) local_unnamed_addr #9 {
entry:
%cmp.not5 = icmp eq i32 %num, 0
br i1 %cmp.not5, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%0 = tail call i32 @llvm.abs.i32(i32 %num, i1 true)
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%answer.07 = phi i32 [ %add, %while.body ], [ 0, %while.body.preheader ]
%num.addr.06 = phi i32 [ %div, %while.body ], [ %0, %while.body.preheader ]
%rem = urem i32 %num.addr.06, 10
%add = add nuw nsw i32 %answer.07, %rem
%div = udiv i32 %num.addr.06, 10
%cmp.not = icmp ult i32 %num.addr.06, 10
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !51
while.end: ; preds = %while.body, %entry
%answer.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #14
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @count_mod(i32 noundef %min, i32 noundef %max, i32 noundef %num) local_unnamed_addr #15 {
entry:
%cmp = icmp sgt i32 %min, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %max, %num
%sub = add nsw i32 %min, -1
%div1 = sdiv i32 %sub, %num
%sub2 = sub nsw i32 %div, %div1
br label %return
if.else: ; preds = %entry
%cmp3 = icmp eq i32 %min, 0
br i1 %cmp3, label %if.then4, label %return
if.then4: ; preds = %if.else
%div5 = sdiv i32 %max, %num
%add = add nsw i32 %div5, 1
br label %return
return: ; preds = %if.else, %if.then4, %if.then
%retval.0 = phi i32 [ %sub2, %if.then ], [ %add, %if.then4 ], [ -1, %if.else ]
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @shift_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max, i32 noundef %num) local_unnamed_addr #16 {
entry:
%array39 = ptrtoint ptr %array to i64
%cmp.not24 = icmp slt i32 %max, %min
br i1 %cmp.not24, label %for.cond3.preheader, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %num to i64
%2 = sext i32 %min to i64
%invariant.gep = getelementptr i8, ptr %array, i64 %1
%3 = add nsw i64 %0, 1
%4 = sub nsw i64 %3, %2
%min.iters.check = icmp ult i64 %4, 4
br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %iter.check
%5 = sub nsw i64 %0, %2
%6 = getelementptr i8, ptr %array, i64 %1
%scevgep34 = getelementptr i8, ptr %6, i64 %0
%7 = sub nsw i64 0, %5
%8 = getelementptr i8, ptr %scevgep34, i64 %7
%9 = icmp ugt ptr %8, %scevgep34
%scevgep35 = getelementptr i8, ptr %array, i64 %0
%10 = sub nsw i64 0, %5
%11 = getelementptr i8, ptr %scevgep35, i64 %10
%12 = icmp ugt ptr %11, %scevgep35
%13 = or i1 %9, %12
br i1 %13, label %for.body.preheader, label %vector.memcheck
vector.memcheck: ; preds = %vector.scevcheck
%14 = add i64 %array39, %0
%15 = add i64 %array39, %1
%16 = add i64 %15, %0
%17 = sub i64 %14, %16
%diff.check = icmp ult i64 %17, 16
br i1 %diff.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check40 = icmp ult i64 %4, 16
br i1 %min.iters.check40, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %4, -16
%invariant.gep52 = getelementptr i8, ptr %array, i64 -15
%invariant.gep54 = getelementptr i8, ptr %invariant.gep, i64 -15
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = sub i64 %0, %index
%gep53 = getelementptr i8, ptr %invariant.gep52, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %gep53, align 1, !tbaa !14
%gep55 = getelementptr i8, ptr %invariant.gep54, i64 %offset.idx
store <16 x i8> %wide.load, ptr %gep55, align 1, !tbaa !14
%index.next = add nuw i64 %index, 16
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !52
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.cond3.preheader, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end44 = sub nsw i64 %0, %n.vec
%n.vec.remaining = and i64 %4, 12
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec43 = and i64 %4, -4
%ind.end = sub nsw i64 %0, %n.vec43
%invariant.gep56 = getelementptr i8, ptr %array, i64 -3
%invariant.gep58 = getelementptr i8, ptr %invariant.gep, i64 -3
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index46 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next51, %vec.epilog.vector.body ]
%offset.idx47 = sub i64 %0, %index46
%gep57 = getelementptr i8, ptr %invariant.gep56, i64 %offset.idx47
%wide.load48 = load <4 x i8>, ptr %gep57, align 1, !tbaa !14
%gep59 = getelementptr i8, ptr %invariant.gep58, i64 %offset.idx47
store <4 x i8> %wide.load48, ptr %gep59, align 1, !tbaa !14
%index.next51 = add nuw i64 %index46, 4
%19 = icmp eq i64 %index.next51, %n.vec43
br i1 %19, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !53
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n45 = icmp eq i64 %4, %n.vec43
br i1 %cmp.n45, label %for.cond3.preheader, label %for.body.preheader
for.body.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %0, %vector.scevcheck ], [ %ind.end44, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body
for.cond3.preheader: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry
%cmp6.not.not26 = icmp sgt i32 %num, 0
br i1 %cmp6.not.not26, label %for.body7.preheader, label %for.end12
for.body7.preheader: ; preds = %for.cond3.preheader
%add4 = add i32 %num, %min
%20 = sext i32 %min to i64
%scevgep = getelementptr i8, ptr %array, i64 %20
%21 = add i32 %min, 1
%smax = tail call i32 @llvm.smax.i32(i32 %add4, i32 %21)
%22 = xor i32 %min, -1
%23 = add i32 %smax, %22
%24 = zext i32 %23 to i64
%25 = add nuw nsw i64 %24, 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 0, i64 %25, i1 false), !tbaa !14
br label %for.end12
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%26 = load i8, ptr %arrayidx, align 1, !tbaa !14
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv
store i8 %26, ptr %gep, align 1, !tbaa !14
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%cmp.not.not = icmp sgt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !54
for.end12: ; preds = %for.body7.preheader, %for.cond3.preheader
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @convert_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %pre, i8 noundef signext %post) local_unnamed_addr #4 {
entry:
%cmp.not11 = icmp sgt i32 %min, %max
br i1 %cmp.not11, label %for.end, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check14 = icmp ult i32 %2, 31
br i1 %min.iters.check14, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %4, 8589934560
%broadcast.splatinsert = insertelement <16 x i8> poison, i8 %pre, i64 0
%broadcast.splat = shufflevector <16 x i8> %broadcast.splatinsert, <16 x i8> poison, <16 x i32> zeroinitializer
%invariant.gep = getelementptr i8, ptr %array, i64 1
%invariant.gep104 = getelementptr i8, ptr %array, i64 2
%invariant.gep106 = getelementptr i8, ptr %array, i64 3
%invariant.gep108 = getelementptr i8, ptr %array, i64 4
%invariant.gep110 = getelementptr i8, ptr %array, i64 5
%invariant.gep112 = getelementptr i8, ptr %array, i64 6
%invariant.gep114 = getelementptr i8, ptr %array, i64 7
%invariant.gep116 = getelementptr i8, ptr %array, i64 8
%invariant.gep118 = getelementptr i8, ptr %array, i64 9
%invariant.gep120 = getelementptr i8, ptr %array, i64 10
%invariant.gep122 = getelementptr i8, ptr %array, i64 11
%invariant.gep124 = getelementptr i8, ptr %array, i64 12
%invariant.gep126 = getelementptr i8, ptr %array, i64 13
%invariant.gep128 = getelementptr i8, ptr %array, i64 14
%invariant.gep130 = getelementptr i8, ptr %array, i64 15
%invariant.gep132 = getelementptr i8, ptr %array, i64 16
%invariant.gep134 = getelementptr i8, ptr %array, i64 17
%invariant.gep136 = getelementptr i8, ptr %array, i64 18
%invariant.gep138 = getelementptr i8, ptr %array, i64 19
%invariant.gep140 = getelementptr i8, ptr %array, i64 20
%invariant.gep142 = getelementptr i8, ptr %array, i64 21
%invariant.gep144 = getelementptr i8, ptr %array, i64 22
%invariant.gep146 = getelementptr i8, ptr %array, i64 23
%invariant.gep148 = getelementptr i8, ptr %array, i64 24
%invariant.gep150 = getelementptr i8, ptr %array, i64 25
%invariant.gep152 = getelementptr i8, ptr %array, i64 26
%invariant.gep154 = getelementptr i8, ptr %array, i64 27
%invariant.gep156 = getelementptr i8, ptr %array, i64 28
%invariant.gep158 = getelementptr i8, ptr %array, i64 29
%invariant.gep160 = getelementptr i8, ptr %array, i64 30
%invariant.gep162 = getelementptr i8, ptr %array, i64 31
br label %vector.body
vector.body: ; preds = %pred.store.continue77, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue77 ]
%offset.idx = add i64 %index, %0
%5 = getelementptr inbounds i8, ptr %array, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %5, align 1, !tbaa !14
%6 = getelementptr inbounds i8, ptr %5, i64 16
%wide.load15 = load <16 x i8>, ptr %6, align 1, !tbaa !14
%7 = icmp eq <16 x i8> %wide.load, %broadcast.splat
%8 = icmp eq <16 x i8> %wide.load15, %broadcast.splat
%9 = extractelement <16 x i1> %7, i64 0
br i1 %9, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%10 = getelementptr inbounds i8, ptr %array, i64 %offset.idx
store i8 %post, ptr %10, align 1, !tbaa !14
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%11 = extractelement <16 x i1> %7, i64 1
br i1 %11, label %pred.store.if16, label %pred.store.continue17
pred.store.if16: ; preds = %pred.store.continue
%gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx
store i8 %post, ptr %gep, align 1, !tbaa !14
br label %pred.store.continue17
pred.store.continue17: ; preds = %pred.store.if16, %pred.store.continue
%12 = extractelement <16 x i1> %7, i64 2
br i1 %12, label %pred.store.if18, label %pred.store.continue19
pred.store.if18: ; preds = %pred.store.continue17
%gep105 = getelementptr i8, ptr %invariant.gep104, i64 %offset.idx
store i8 %post, ptr %gep105, align 1, !tbaa !14
br label %pred.store.continue19
pred.store.continue19: ; preds = %pred.store.if18, %pred.store.continue17
%13 = extractelement <16 x i1> %7, i64 3
br i1 %13, label %pred.store.if20, label %pred.store.continue21
pred.store.if20: ; preds = %pred.store.continue19
%gep107 = getelementptr i8, ptr %invariant.gep106, i64 %offset.idx
store i8 %post, ptr %gep107, align 1, !tbaa !14
br label %pred.store.continue21
pred.store.continue21: ; preds = %pred.store.if20, %pred.store.continue19
%14 = extractelement <16 x i1> %7, i64 4
br i1 %14, label %pred.store.if22, label %pred.store.continue23
pred.store.if22: ; preds = %pred.store.continue21
%gep109 = getelementptr i8, ptr %invariant.gep108, i64 %offset.idx
store i8 %post, ptr %gep109, align 1, !tbaa !14
br label %pred.store.continue23
pred.store.continue23: ; preds = %pred.store.if22, %pred.store.continue21
%15 = extractelement <16 x i1> %7, i64 5
br i1 %15, label %pred.store.if24, label %pred.store.continue25
pred.store.if24: ; preds = %pred.store.continue23
%gep111 = getelementptr i8, ptr %invariant.gep110, i64 %offset.idx
store i8 %post, ptr %gep111, align 1, !tbaa !14
br label %pred.store.continue25
pred.store.continue25: ; preds = %pred.store.if24, %pred.store.continue23
%16 = extractelement <16 x i1> %7, i64 6
br i1 %16, label %pred.store.if26, label %pred.store.continue27
pred.store.if26: ; preds = %pred.store.continue25
%gep113 = getelementptr i8, ptr %invariant.gep112, i64 %offset.idx
store i8 %post, ptr %gep113, align 1, !tbaa !14
br label %pred.store.continue27
pred.store.continue27: ; preds = %pred.store.if26, %pred.store.continue25
%17 = extractelement <16 x i1> %7, i64 7
br i1 %17, label %pred.store.if28, label %pred.store.continue29
pred.store.if28: ; preds = %pred.store.continue27
%gep115 = getelementptr i8, ptr %invariant.gep114, i64 %offset.idx
store i8 %post, ptr %gep115, align 1, !tbaa !14
br label %pred.store.continue29
pred.store.continue29: ; preds = %pred.store.if28, %pred.store.continue27
%18 = extractelement <16 x i1> %7, i64 8
br i1 %18, label %pred.store.if30, label %pred.store.continue31
pred.store.if30: ; preds = %pred.store.continue29
%gep117 = getelementptr i8, ptr %invariant.gep116, i64 %offset.idx
store i8 %post, ptr %gep117, align 1, !tbaa !14
br label %pred.store.continue31
pred.store.continue31: ; preds = %pred.store.if30, %pred.store.continue29
%19 = extractelement <16 x i1> %7, i64 9
br i1 %19, label %pred.store.if32, label %pred.store.continue33
pred.store.if32: ; preds = %pred.store.continue31
%gep119 = getelementptr i8, ptr %invariant.gep118, i64 %offset.idx
store i8 %post, ptr %gep119, align 1, !tbaa !14
br label %pred.store.continue33
pred.store.continue33: ; preds = %pred.store.if32, %pred.store.continue31
%20 = extractelement <16 x i1> %7, i64 10
br i1 %20, label %pred.store.if34, label %pred.store.continue35
pred.store.if34: ; preds = %pred.store.continue33
%gep121 = getelementptr i8, ptr %invariant.gep120, i64 %offset.idx
store i8 %post, ptr %gep121, align 1, !tbaa !14
br label %pred.store.continue35
pred.store.continue35: ; preds = %pred.store.if34, %pred.store.continue33
%21 = extractelement <16 x i1> %7, i64 11
br i1 %21, label %pred.store.if36, label %pred.store.continue37
pred.store.if36: ; preds = %pred.store.continue35
%gep123 = getelementptr i8, ptr %invariant.gep122, i64 %offset.idx
store i8 %post, ptr %gep123, align 1, !tbaa !14
br label %pred.store.continue37
pred.store.continue37: ; preds = %pred.store.if36, %pred.store.continue35
%22 = extractelement <16 x i1> %7, i64 12
br i1 %22, label %pred.store.if38, label %pred.store.continue39
pred.store.if38: ; preds = %pred.store.continue37
%gep125 = getelementptr i8, ptr %invariant.gep124, i64 %offset.idx
store i8 %post, ptr %gep125, align 1, !tbaa !14
br label %pred.store.continue39
pred.store.continue39: ; preds = %pred.store.if38, %pred.store.continue37
%23 = extractelement <16 x i1> %7, i64 13
br i1 %23, label %pred.store.if40, label %pred.store.continue41
pred.store.if40: ; preds = %pred.store.continue39
%gep127 = getelementptr i8, ptr %invariant.gep126, i64 %offset.idx
store i8 %post, ptr %gep127, align 1, !tbaa !14
br label %pred.store.continue41
pred.store.continue41: ; preds = %pred.store.if40, %pred.store.continue39
%24 = extractelement <16 x i1> %7, i64 14
br i1 %24, label %pred.store.if42, label %pred.store.continue43
pred.store.if42: ; preds = %pred.store.continue41
%gep129 = getelementptr i8, ptr %invariant.gep128, i64 %offset.idx
store i8 %post, ptr %gep129, align 1, !tbaa !14
br label %pred.store.continue43
pred.store.continue43: ; preds = %pred.store.if42, %pred.store.continue41
%25 = extractelement <16 x i1> %7, i64 15
br i1 %25, label %pred.store.if44, label %pred.store.continue45
pred.store.if44: ; preds = %pred.store.continue43
%gep131 = getelementptr i8, ptr %invariant.gep130, i64 %offset.idx
store i8 %post, ptr %gep131, align 1, !tbaa !14
br label %pred.store.continue45
pred.store.continue45: ; preds = %pred.store.if44, %pred.store.continue43
%26 = extractelement <16 x i1> %8, i64 0
br i1 %26, label %pred.store.if46, label %pred.store.continue47
pred.store.if46: ; preds = %pred.store.continue45
%gep133 = getelementptr i8, ptr %invariant.gep132, i64 %offset.idx
store i8 %post, ptr %gep133, align 1, !tbaa !14
br label %pred.store.continue47
pred.store.continue47: ; preds = %pred.store.if46, %pred.store.continue45
%27 = extractelement <16 x i1> %8, i64 1
br i1 %27, label %pred.store.if48, label %pred.store.continue49
pred.store.if48: ; preds = %pred.store.continue47
%gep135 = getelementptr i8, ptr %invariant.gep134, i64 %offset.idx
store i8 %post, ptr %gep135, align 1, !tbaa !14
br label %pred.store.continue49
pred.store.continue49: ; preds = %pred.store.if48, %pred.store.continue47
%28 = extractelement <16 x i1> %8, i64 2
br i1 %28, label %pred.store.if50, label %pred.store.continue51
pred.store.if50: ; preds = %pred.store.continue49
%gep137 = getelementptr i8, ptr %invariant.gep136, i64 %offset.idx
store i8 %post, ptr %gep137, align 1, !tbaa !14
br label %pred.store.continue51
pred.store.continue51: ; preds = %pred.store.if50, %pred.store.continue49
%29 = extractelement <16 x i1> %8, i64 3
br i1 %29, label %pred.store.if52, label %pred.store.continue53
pred.store.if52: ; preds = %pred.store.continue51
%gep139 = getelementptr i8, ptr %invariant.gep138, i64 %offset.idx
store i8 %post, ptr %gep139, align 1, !tbaa !14
br label %pred.store.continue53
pred.store.continue53: ; preds = %pred.store.if52, %pred.store.continue51
%30 = extractelement <16 x i1> %8, i64 4
br i1 %30, label %pred.store.if54, label %pred.store.continue55
pred.store.if54: ; preds = %pred.store.continue53
%gep141 = getelementptr i8, ptr %invariant.gep140, i64 %offset.idx
store i8 %post, ptr %gep141, align 1, !tbaa !14
br label %pred.store.continue55
pred.store.continue55: ; preds = %pred.store.if54, %pred.store.continue53
%31 = extractelement <16 x i1> %8, i64 5
br i1 %31, label %pred.store.if56, label %pred.store.continue57
pred.store.if56: ; preds = %pred.store.continue55
%gep143 = getelementptr i8, ptr %invariant.gep142, i64 %offset.idx
store i8 %post, ptr %gep143, align 1, !tbaa !14
br label %pred.store.continue57
pred.store.continue57: ; preds = %pred.store.if56, %pred.store.continue55
%32 = extractelement <16 x i1> %8, i64 6
br i1 %32, label %pred.store.if58, label %pred.store.continue59
pred.store.if58: ; preds = %pred.store.continue57
%gep145 = getelementptr i8, ptr %invariant.gep144, i64 %offset.idx
store i8 %post, ptr %gep145, align 1, !tbaa !14
br label %pred.store.continue59
pred.store.continue59: ; preds = %pred.store.if58, %pred.store.continue57
%33 = extractelement <16 x i1> %8, i64 7
br i1 %33, label %pred.store.if60, label %pred.store.continue61
pred.store.if60: ; preds = %pred.store.continue59
%gep147 = getelementptr i8, ptr %invariant.gep146, i64 %offset.idx
store i8 %post, ptr %gep147, align 1, !tbaa !14
br label %pred.store.continue61
pred.store.continue61: ; preds = %pred.store.if60, %pred.store.continue59
%34 = extractelement <16 x i1> %8, i64 8
br i1 %34, label %pred.store.if62, label %pred.store.continue63
pred.store.if62: ; preds = %pred.store.continue61
%gep149 = getelementptr i8, ptr %invariant.gep148, i64 %offset.idx
store i8 %post, ptr %gep149, align 1, !tbaa !14
br label %pred.store.continue63
pred.store.continue63: ; preds = %pred.store.if62, %pred.store.continue61
%35 = extractelement <16 x i1> %8, i64 9
br i1 %35, label %pred.store.if64, label %pred.store.continue65
pred.store.if64: ; preds = %pred.store.continue63
%gep151 = getelementptr i8, ptr %invariant.gep150, i64 %offset.idx
store i8 %post, ptr %gep151, align 1, !tbaa !14
br label %pred.store.continue65
pred.store.continue65: ; preds = %pred.store.if64, %pred.store.continue63
%36 = extractelement <16 x i1> %8, i64 10
br i1 %36, label %pred.store.if66, label %pred.store.continue67
pred.store.if66: ; preds = %pred.store.continue65
%gep153 = getelementptr i8, ptr %invariant.gep152, i64 %offset.idx
store i8 %post, ptr %gep153, align 1, !tbaa !14
br label %pred.store.continue67
pred.store.continue67: ; preds = %pred.store.if66, %pred.store.continue65
%37 = extractelement <16 x i1> %8, i64 11
br i1 %37, label %pred.store.if68, label %pred.store.continue69
pred.store.if68: ; preds = %pred.store.continue67
%gep155 = getelementptr i8, ptr %invariant.gep154, i64 %offset.idx
store i8 %post, ptr %gep155, align 1, !tbaa !14
br label %pred.store.continue69
pred.store.continue69: ; preds = %pred.store.if68, %pred.store.continue67
%38 = extractelement <16 x i1> %8, i64 12
br i1 %38, label %pred.store.if70, label %pred.store.continue71
pred.store.if70: ; preds = %pred.store.continue69
%gep157 = getelementptr i8, ptr %invariant.gep156, i64 %offset.idx
store i8 %post, ptr %gep157, align 1, !tbaa !14
br label %pred.store.continue71
pred.store.continue71: ; preds = %pred.store.if70, %pred.store.continue69
%39 = extractelement <16 x i1> %8, i64 13
br i1 %39, label %pred.store.if72, label %pred.store.continue73
pred.store.if72: ; preds = %pred.store.continue71
%gep159 = getelementptr i8, ptr %invariant.gep158, i64 %offset.idx
store i8 %post, ptr %gep159, align 1, !tbaa !14
br label %pred.store.continue73
pred.store.continue73: ; preds = %pred.store.if72, %pred.store.continue71
%40 = extractelement <16 x i1> %8, i64 14
br i1 %40, label %pred.store.if74, label %pred.store.continue75
pred.store.if74: ; preds = %pred.store.continue73
%gep161 = getelementptr i8, ptr %invariant.gep160, i64 %offset.idx
store i8 %post, ptr %gep161, align 1, !tbaa !14
br label %pred.store.continue75
pred.store.continue75: ; preds = %pred.store.if74, %pred.store.continue73
%41 = extractelement <16 x i1> %8, i64 15
br i1 %41, label %pred.store.if76, label %pred.store.continue77
pred.store.if76: ; preds = %pred.store.continue75
%gep163 = getelementptr i8, ptr %invariant.gep162, i64 %offset.idx
store i8 %post, ptr %gep163, align 1, !tbaa !14
br label %pred.store.continue77
pred.store.continue77: ; preds = %pred.store.if76, %pred.store.continue75
%index.next = add nuw i64 %index, 32
%42 = icmp eq i64 %index.next, %n.vec
br i1 %42, label %middle.block, label %vector.body, !llvm.loop !55
middle.block: ; preds = %pred.store.continue77
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end80 = add nsw i64 %n.vec, %0
%n.vec.remaining = and i64 %4, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec79 = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec79, %0
%broadcast.splatinsert85 = insertelement <8 x i8> poison, i8 %pre, i64 0
%broadcast.splat86 = shufflevector <8 x i8> %broadcast.splatinsert85, <8 x i8> poison, <8 x i32> zeroinitializer
%invariant.gep164 = getelementptr i8, ptr %array, i64 1
%invariant.gep166 = getelementptr i8, ptr %array, i64 2
%invariant.gep168 = getelementptr i8, ptr %array, i64 3
%invariant.gep170 = getelementptr i8, ptr %array, i64 4
%invariant.gep172 = getelementptr i8, ptr %array, i64 5
%invariant.gep174 = getelementptr i8, ptr %array, i64 6
%invariant.gep176 = getelementptr i8, ptr %array, i64 7
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %pred.store.continue102, %vec.epilog.ph
%index82 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next103, %pred.store.continue102 ]
%offset.idx83 = add i64 %index82, %0
%43 = getelementptr inbounds i8, ptr %array, i64 %offset.idx83
%wide.load84 = load <8 x i8>, ptr %43, align 1, !tbaa !14
%44 = icmp eq <8 x i8> %wide.load84, %broadcast.splat86
%45 = extractelement <8 x i1> %44, i64 0
br i1 %45, label %pred.store.if87, label %pred.store.continue88
pred.store.if87: ; preds = %vec.epilog.vector.body
%46 = getelementptr inbounds i8, ptr %array, i64 %offset.idx83
store i8 %post, ptr %46, align 1, !tbaa !14
br label %pred.store.continue88
pred.store.continue88: ; preds = %pred.store.if87, %vec.epilog.vector.body
%47 = extractelement <8 x i1> %44, i64 1
br i1 %47, label %pred.store.if89, label %pred.store.continue90
pred.store.if89: ; preds = %pred.store.continue88
%gep165 = getelementptr i8, ptr %invariant.gep164, i64 %offset.idx83
store i8 %post, ptr %gep165, align 1, !tbaa !14
br label %pred.store.continue90
pred.store.continue90: ; preds = %pred.store.if89, %pred.store.continue88
%48 = extractelement <8 x i1> %44, i64 2
br i1 %48, label %pred.store.if91, label %pred.store.continue92
pred.store.if91: ; preds = %pred.store.continue90
%gep167 = getelementptr i8, ptr %invariant.gep166, i64 %offset.idx83
store i8 %post, ptr %gep167, align 1, !tbaa !14
br label %pred.store.continue92
pred.store.continue92: ; preds = %pred.store.if91, %pred.store.continue90
%49 = extractelement <8 x i1> %44, i64 3
br i1 %49, label %pred.store.if93, label %pred.store.continue94
pred.store.if93: ; preds = %pred.store.continue92
%gep169 = getelementptr i8, ptr %invariant.gep168, i64 %offset.idx83
store i8 %post, ptr %gep169, align 1, !tbaa !14
br label %pred.store.continue94
pred.store.continue94: ; preds = %pred.store.if93, %pred.store.continue92
%50 = extractelement <8 x i1> %44, i64 4
br i1 %50, label %pred.store.if95, label %pred.store.continue96
pred.store.if95: ; preds = %pred.store.continue94
%gep171 = getelementptr i8, ptr %invariant.gep170, i64 %offset.idx83
store i8 %post, ptr %gep171, align 1, !tbaa !14
br label %pred.store.continue96
pred.store.continue96: ; preds = %pred.store.if95, %pred.store.continue94
%51 = extractelement <8 x i1> %44, i64 5
br i1 %51, label %pred.store.if97, label %pred.store.continue98
pred.store.if97: ; preds = %pred.store.continue96
%gep173 = getelementptr i8, ptr %invariant.gep172, i64 %offset.idx83
store i8 %post, ptr %gep173, align 1, !tbaa !14
br label %pred.store.continue98
pred.store.continue98: ; preds = %pred.store.if97, %pred.store.continue96
%52 = extractelement <8 x i1> %44, i64 6
br i1 %52, label %pred.store.if99, label %pred.store.continue100
pred.store.if99: ; preds = %pred.store.continue98
%gep175 = getelementptr i8, ptr %invariant.gep174, i64 %offset.idx83
store i8 %post, ptr %gep175, align 1, !tbaa !14
br label %pred.store.continue100
pred.store.continue100: ; preds = %pred.store.if99, %pred.store.continue98
%53 = extractelement <8 x i1> %44, i64 7
br i1 %53, label %pred.store.if101, label %pred.store.continue102
pred.store.if101: ; preds = %pred.store.continue100
%gep177 = getelementptr i8, ptr %invariant.gep176, i64 %offset.idx83
store i8 %post, ptr %gep177, align 1, !tbaa !14
br label %pred.store.continue102
pred.store.continue102: ; preds = %pred.store.if101, %pred.store.continue100
%index.next103 = add nuw i64 %index82, 8
%54 = icmp eq i64 %index.next103, %n.vec79
br i1 %54, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !56
vec.epilog.middle.block: ; preds = %pred.store.continue102
%cmp.n81 = icmp eq i64 %4, %n.vec79
br i1 %cmp.n81, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %ind.end80, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %indvars.iv.ph, %for.body.preheader ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%55 = load i8, ptr %arrayidx, align 1, !tbaa !14
%cmp2 = icmp eq i8 %55, %pre
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
store i8 %post, ptr %arrayidx, align 1, !tbaa !14
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !57
for.end: ; preds = %for.inc, %middle.block, %vec.epilog.middle.block, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_asc_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%cmp.not28 = icmp sgt i32 %min, %max
br i1 %cmp.not28, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next34 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !58
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next34 = add nsw i64 %indvars.iv33, 1
%cmp2.not26.not = icmp slt i64 %indvars.iv33, %0
br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%3 = sext i32 %indvars.iv to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ]
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv30
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %4, %5
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
store i32 %5, ptr %arrayidx, align 4, !tbaa !5
store i32 %4, ptr %arrayidx5, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%indvars.iv.next31 = add nsw i64 %indvars.iv30, 1
%cmp2.not.not = icmp slt i64 %indvars.iv30, %0
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !59
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_des_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%cmp.not28 = icmp sgt i32 %min, %max
br i1 %cmp.not28, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next34 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !60
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next34 = add nsw i64 %indvars.iv33, 1
%cmp2.not26.not = icmp slt i64 %indvars.iv33, %0
br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%3 = sext i32 %indvars.iv to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ]
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv30
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp slt i32 %4, %5
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
store i32 %5, ptr %arrayidx, align 4, !tbaa !5
store i32 %4, ptr %arrayidx5, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%indvars.iv.next31 = add nsw i64 %indvars.iv30, 1
%cmp2.not.not = icmp slt i64 %indvars.iv30, %0
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !61
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_asc_char_dic(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 {
entry:
%cmp.not28 = icmp sgt i32 %min, %max
br i1 %cmp.not28, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next34 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !62
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next34 = add nsw i64 %indvars.iv33, 1
%cmp2.not26.not = icmp slt i64 %indvars.iv33, %0
br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%3 = sext i32 %indvars.iv to i64
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv33
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ]
%arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv30
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #25
%cmp6 = icmp sgt i32 %call, 0
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
%4 = load i8, ptr %arrayidx, align 1, !tbaa !14
%5 = load i8, ptr %arrayidx5, align 1, !tbaa !14
store i8 %5, ptr %arrayidx, align 1, !tbaa !14
store i8 %4, ptr %arrayidx5, align 1, !tbaa !14
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%indvars.iv.next31 = add nsw i64 %indvars.iv30, 1
%cmp2.not.not = icmp slt i64 %indvars.iv30, %0
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !63
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_asc_char_array_dic(i32 noundef %size, ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 {
entry:
%0 = zext i32 %size to i64
%cmp.not29 = icmp sgt i32 %min, %max
%cmp.not6.i = icmp slt i32 %size, 1
%or.cond = or i1 %cmp.not29, %cmp.not6.i
br i1 %or.cond, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = sext i32 %max to i64
%2 = sext i32 %min to i64
%3 = add i32 %max, 1
%4 = add nsw i64 %2, 1
%5 = add i32 %min, 1
%min.iters.check = icmp ult i32 %size, 8
%min.iters.check45 = icmp ult i32 %size, 32
%n.vec = and i64 %0, 4294967264
%cmp.n = icmp eq i64 %n.vec, %0
%n.vec.remaining = and i64 %0, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
%n.vec50 = and i64 %0, 4294967288
%cmp.n51 = icmp eq i64 %n.vec50, %0
%xtraiter = and i64 %0, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%6 = sub nsw i64 0, %0
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next38 to i32
%exitcond.not = icmp eq i32 %3, %lftr.wideiv
%indvar.next = add i64 %indvar, 1
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !64
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ]
%indvars.iv37 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next38, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%7 = add i64 %indvar, %2
%8 = mul i64 %7, %0
%scevgep = getelementptr i8, ptr %array, i64 %8
%9 = add i64 %4, %indvar
%10 = mul i64 %9, %0
%scevgep40 = getelementptr i8, ptr %array, i64 %10
%11 = trunc i64 %indvar to i32
%12 = add i32 %5, %11
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, 1
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next38 = add nsw i64 %indvars.iv37, 1
%cmp2.not27.not = icmp slt i64 %indvars.iv37, %1
br i1 %cmp2.not27.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%15 = sext i32 %indvars.iv to i64
%16 = mul nsw i64 %indvars.iv37, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %16
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvar41 = phi i64 [ 0, %for.body3.lr.ph ], [ %indvar.next42, %for.inc ]
%indvars.iv34 = phi i64 [ %15, %for.body3.lr.ph ], [ %indvars.iv.next35, %for.inc ]
%17 = add i64 %indvar41, %13
%18 = mul i64 %17, %0
%scevgep43 = getelementptr i8, ptr %array, i64 %18
%19 = add i64 %14, %indvar41
%20 = mul i64 %19, %0
%scevgep44 = getelementptr i8, ptr %array, i64 %20
%21 = mul nsw i64 %indvars.iv34, %0
%arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %21
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #25
%cmp6 = icmp slt i32 %call, 1
br i1 %cmp6, label %for.inc, label %iter.check
iter.check: ; preds = %for.body3
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %iter.check
%bound0 = icmp ult ptr %scevgep, %scevgep44
%bound1 = icmp ult ptr %scevgep43, %scevgep40
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body.i.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
br i1 %min.iters.check45, label %vec.epilog.ph, label %vector.body
vector.body: ; preds = %vector.main.loop.iter.check, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ]
%22 = getelementptr inbounds i8, ptr %arrayidx, i64 %index
%23 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index
%wide.load = load <16 x i8>, ptr %22, align 1, !tbaa !14, !alias.scope !65, !noalias !68
%24 = getelementptr inbounds i8, ptr %22, i64 16
%wide.load46 = load <16 x i8>, ptr %24, align 1, !tbaa !14, !alias.scope !65, !noalias !68
%wide.load47 = load <16 x i8>, ptr %23, align 1, !tbaa !14, !alias.scope !68
%25 = getelementptr inbounds i8, ptr %23, i64 16
%wide.load48 = load <16 x i8>, ptr %25, align 1, !tbaa !14, !alias.scope !68
store <16 x i8> %wide.load47, ptr %22, align 1, !tbaa !14, !alias.scope !65, !noalias !68
store <16 x i8> %wide.load48, ptr %24, align 1, !tbaa !14, !alias.scope !65, !noalias !68
store <16 x i8> %wide.load, ptr %23, align 1, !tbaa !14, !alias.scope !68
store <16 x i8> %wide.load46, ptr %25, align 1, !tbaa !14, !alias.scope !68
%index.next = add nuw i64 %index, 32
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !70
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.inc, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ]
%27 = getelementptr inbounds i8, ptr %arrayidx, i64 %index52
%28 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index52
%wide.load53 = load <8 x i8>, ptr %27, align 1, !tbaa !14, !alias.scope !71, !noalias !74
%wide.load54 = load <8 x i8>, ptr %28, align 1, !tbaa !14, !alias.scope !74
store <8 x i8> %wide.load54, ptr %27, align 1, !tbaa !14, !alias.scope !71, !noalias !74
store <8 x i8> %wide.load53, ptr %28, align 1, !tbaa !14, !alias.scope !74
%index.next55 = add nuw i64 %index52, 8
%29 = icmp eq i64 %index.next55, %n.vec50
br i1 %29, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !76
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
br i1 %cmp.n51, label %for.inc, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.i.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ]
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader
%arrayidx.i.prol = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i.ph
%arrayidx2.i.prol = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i.ph
%30 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14
%31 = load i8, ptr %arrayidx2.i.prol, align 1, !tbaa !14
store i8 %31, ptr %arrayidx.i.prol, align 1, !tbaa !14
store i8 %30, ptr %arrayidx2.i.prol, align 1, !tbaa !14
%indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%32 = xor i64 %indvars.iv.i.ph, %6
%33 = icmp eq i64 %32, -1
br i1 %33, label %for.inc, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i
%arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i
%34 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%35 = load i8, ptr %arrayidx2.i, align 1, !tbaa !14
store i8 %35, ptr %arrayidx.i, align 1, !tbaa !14
store i8 %34, ptr %arrayidx2.i, align 1, !tbaa !14
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.next.i
%arrayidx2.i.1 = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.next.i
%36 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14
%37 = load i8, ptr %arrayidx2.i.1, align 1, !tbaa !14
store i8 %37, ptr %arrayidx.i.1, align 1, !tbaa !14
store i8 %36, ptr %arrayidx2.i.1, align 1, !tbaa !14
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%38 = icmp eq i64 %indvars.iv.next.i.1, %0
br i1 %38, label %for.inc, label %for.body.i, !llvm.loop !77
for.inc: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %for.body3
%indvars.iv.next35 = add nsw i64 %indvars.iv34, 1
%cmp2.not.not = icmp slt i64 %indvars.iv34, %1
%indvar.next42 = add i64 %indvar41, 1
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !78
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_des_char_dic(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 {
entry:
%cmp.not28 = icmp sgt i32 %min, %max
br i1 %cmp.not28, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next34 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !79
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next34 = add nsw i64 %indvars.iv33, 1
%cmp2.not26.not = icmp slt i64 %indvars.iv33, %0
br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%3 = sext i32 %indvars.iv to i64
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv33
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ]
%arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv30
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #25
%cmp6 = icmp slt i32 %call, 0
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
%4 = load i8, ptr %arrayidx, align 1, !tbaa !14
%5 = load i8, ptr %arrayidx5, align 1, !tbaa !14
store i8 %5, ptr %arrayidx, align 1, !tbaa !14
store i8 %4, ptr %arrayidx5, align 1, !tbaa !14
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%indvars.iv.next31 = add nsw i64 %indvars.iv30, 1
%cmp2.not.not = icmp slt i64 %indvars.iv30, %0
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !80
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_des_char_array_dic(i32 noundef %size, ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 {
entry:
%0 = zext i32 %size to i64
%cmp.not29 = icmp sgt i32 %min, %max
%cmp.not6.i = icmp slt i32 %size, 1
%or.cond = or i1 %cmp.not29, %cmp.not6.i
br i1 %or.cond, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = sext i32 %max to i64
%2 = sext i32 %min to i64
%3 = add i32 %max, 1
%4 = add nsw i64 %2, 1
%5 = add i32 %min, 1
%min.iters.check = icmp ult i32 %size, 8
%min.iters.check45 = icmp ult i32 %size, 32
%n.vec = and i64 %0, 4294967264
%cmp.n = icmp eq i64 %n.vec, %0
%n.vec.remaining = and i64 %0, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
%n.vec50 = and i64 %0, 4294967288
%cmp.n51 = icmp eq i64 %n.vec50, %0
%xtraiter = and i64 %0, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%6 = sub nsw i64 0, %0
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next38 to i32
%exitcond.not = icmp eq i32 %3, %lftr.wideiv
%indvar.next = add i64 %indvar, 1
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !81
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ]
%indvars.iv37 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next38, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%7 = add i64 %indvar, %2
%8 = mul i64 %7, %0
%scevgep = getelementptr i8, ptr %array, i64 %8
%9 = add i64 %4, %indvar
%10 = mul i64 %9, %0
%scevgep40 = getelementptr i8, ptr %array, i64 %10
%11 = trunc i64 %indvar to i32
%12 = add i32 %5, %11
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, 1
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next38 = add nsw i64 %indvars.iv37, 1
%cmp2.not27.not = icmp slt i64 %indvars.iv37, %1
br i1 %cmp2.not27.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%15 = sext i32 %indvars.iv to i64
%16 = mul nsw i64 %indvars.iv37, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %16
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvar41 = phi i64 [ 0, %for.body3.lr.ph ], [ %indvar.next42, %for.inc ]
%indvars.iv34 = phi i64 [ %15, %for.body3.lr.ph ], [ %indvars.iv.next35, %for.inc ]
%17 = add i64 %indvar41, %13
%18 = mul i64 %17, %0
%scevgep43 = getelementptr i8, ptr %array, i64 %18
%19 = add i64 %14, %indvar41
%20 = mul i64 %19, %0
%scevgep44 = getelementptr i8, ptr %array, i64 %20
%21 = mul nsw i64 %indvars.iv34, %0
%arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %21
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #25
%cmp6 = icmp sgt i32 %call, -1
br i1 %cmp6, label %for.inc, label %iter.check
iter.check: ; preds = %for.body3
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %iter.check
%bound0 = icmp ult ptr %scevgep, %scevgep44
%bound1 = icmp ult ptr %scevgep43, %scevgep40
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body.i.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
br i1 %min.iters.check45, label %vec.epilog.ph, label %vector.body
vector.body: ; preds = %vector.main.loop.iter.check, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ]
%22 = getelementptr inbounds i8, ptr %arrayidx, i64 %index
%23 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index
%wide.load = load <16 x i8>, ptr %22, align 1, !tbaa !14, !alias.scope !82, !noalias !85
%24 = getelementptr inbounds i8, ptr %22, i64 16
%wide.load46 = load <16 x i8>, ptr %24, align 1, !tbaa !14, !alias.scope !82, !noalias !85
%wide.load47 = load <16 x i8>, ptr %23, align 1, !tbaa !14, !alias.scope !85
%25 = getelementptr inbounds i8, ptr %23, i64 16
%wide.load48 = load <16 x i8>, ptr %25, align 1, !tbaa !14, !alias.scope !85
store <16 x i8> %wide.load47, ptr %22, align 1, !tbaa !14, !alias.scope !82, !noalias !85
store <16 x i8> %wide.load48, ptr %24, align 1, !tbaa !14, !alias.scope !82, !noalias !85
store <16 x i8> %wide.load, ptr %23, align 1, !tbaa !14, !alias.scope !85
store <16 x i8> %wide.load46, ptr %25, align 1, !tbaa !14, !alias.scope !85
%index.next = add nuw i64 %index, 32
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !87
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.inc, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ]
%27 = getelementptr inbounds i8, ptr %arrayidx, i64 %index52
%28 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index52
%wide.load53 = load <8 x i8>, ptr %27, align 1, !tbaa !14, !alias.scope !88, !noalias !91
%wide.load54 = load <8 x i8>, ptr %28, align 1, !tbaa !14, !alias.scope !91
store <8 x i8> %wide.load54, ptr %27, align 1, !tbaa !14, !alias.scope !88, !noalias !91
store <8 x i8> %wide.load53, ptr %28, align 1, !tbaa !14, !alias.scope !91
%index.next55 = add nuw i64 %index52, 8
%29 = icmp eq i64 %index.next55, %n.vec50
br i1 %29, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !93
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
br i1 %cmp.n51, label %for.inc, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.i.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ]
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader
%arrayidx.i.prol = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i.ph
%arrayidx2.i.prol = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i.ph
%30 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14
%31 = load i8, ptr %arrayidx2.i.prol, align 1, !tbaa !14
store i8 %31, ptr %arrayidx.i.prol, align 1, !tbaa !14
store i8 %30, ptr %arrayidx2.i.prol, align 1, !tbaa !14
%indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%32 = xor i64 %indvars.iv.i.ph, %6
%33 = icmp eq i64 %32, -1
br i1 %33, label %for.inc, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i
%arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i
%34 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%35 = load i8, ptr %arrayidx2.i, align 1, !tbaa !14
store i8 %35, ptr %arrayidx.i, align 1, !tbaa !14
store i8 %34, ptr %arrayidx2.i, align 1, !tbaa !14
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.next.i
%arrayidx2.i.1 = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.next.i
%36 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14
%37 = load i8, ptr %arrayidx2.i.1, align 1, !tbaa !14
store i8 %37, ptr %arrayidx.i.1, align 1, !tbaa !14
store i8 %36, ptr %arrayidx2.i.1, align 1, !tbaa !14
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%38 = icmp eq i64 %indvars.iv.next.i.1, %0
br i1 %38, label %for.inc, label %for.body.i, !llvm.loop !94
for.inc: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %for.body3
%indvars.iv.next35 = add nsw i64 %indvars.iv34, 1
%cmp2.not.not = icmp slt i64 %indvars.iv34, %1
%indvar.next42 = add i64 %indvar41, 1
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !95
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @max_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 {
entry:
%idxprom = sext i32 %min to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not.not9 = icmp slt i32 %min, %max
br i1 %cmp.not.not9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = sext i32 %max to i64
%1 = sub nsw i64 %wide.trip.count, %idxprom
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %1, -8
%ind.end = add nsw i64 %n.vec, %idxprom
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %idxprom
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi13 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%2 = getelementptr i32, ptr %gep, i64 1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr i32, ptr %gep, i64 5
%wide.load14 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi13, <4 x i32> %wide.load14)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !96
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.011.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ]
%answer.011 = phi i32 [ %spec.select.i, %for.body ], [ %answer.011.ph, %for.body.preheader15 ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%spec.select.i = tail call i32 @llvm.smax.i32(i32 %answer.011, i32 %8)
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !97
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @max_int_array_num(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef writeonly %answer) local_unnamed_addr #16 {
entry:
%idxprom.i = sext i32 %min to i64
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %idxprom.i
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.not.not9.i = icmp slt i32 %min, %max
br i1 %cmp.not.not9.i, label %for.body.preheader.i, label %max_int_array.exit
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = sext i32 %max to i64
%1 = sub nsw i64 %wide.trip.count.i, %idxprom.i
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %1, -8
%ind.end = add nsw i64 %n.vec, %idxprom.i
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %idxprom.i
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi26 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%2 = getelementptr i32, ptr %gep, i64 1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr i32, ptr %gep, i64 5
%wide.load27 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi26, <4 x i32> %wide.load27)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !98
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %max_int_array.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ %idxprom.i, %for.body.preheader.i ], [ %ind.end, %middle.block ]
%answer.011.i.ph = phi i32 [ %0, %for.body.preheader.i ], [ %7, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%answer.011.i = phi i32 [ %spec.select.i.i, %for.body.i ], [ %answer.011.i.ph, %for.body.i.preheader ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%spec.select.i.i = tail call i32 @llvm.smax.i32(i32 %answer.011.i, i32 %8)
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %max_int_array.exit, label %for.body.i, !llvm.loop !99
max_int_array.exit: ; preds = %for.body.i, %middle.block, %entry
%answer.0.lcssa.i = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i.i, %for.body.i ]
%sub = sub nsw i32 %max, %min
%cmp.not4.i = icmp slt i32 %sub, 0
br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i16
for.body.preheader.i16: ; preds = %max_int_array.exit
%9 = add nuw i32 %sub, 1
%10 = zext i32 %9 to i64
%11 = shl nuw nsw i64 %10, 2
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %answer, i8 -1, i64 %11, i1 false), !tbaa !5
br label %fill_int.exit
fill_int.exit: ; preds = %for.body.preheader.i16, %max_int_array.exit
%cmp.not22 = icmp sgt i32 %min, %max
br i1 %cmp.not22, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %fill_int.exit
%12 = add i32 %max, 1
%13 = sub i32 %12, %min
%xtraiter = and i32 %13, 1
%14 = icmp eq i32 %max, %min
br i1 %14, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %13, -2
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %idxprom.i, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%count.023 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%15 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %15, %answer.0.lcssa.i
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%idxprom2 = sext i32 %count.023 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2
%16 = trunc i64 %indvars.iv to i32
store i32 %16, ptr %arrayidx3, align 4, !tbaa !5
%add = add nsw i32 %count.023, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%count.1 = phi i32 [ %add, %if.then ], [ %count.023, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp1.1 = icmp eq i32 %17, %answer.0.lcssa.i
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%idxprom2.1 = sext i32 %count.1 to i64
%arrayidx3.1 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2.1
%18 = trunc i64 %indvars.iv.next to i32
store i32 %18, ptr %arrayidx3.1, align 4, !tbaa !5
%add.1 = add nsw i32 %count.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%count.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %count.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 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.loopexit, label %for.body, !llvm.loop !100
for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1
%19 = sext i32 %count.1.1 to i64
br label %for.end.loopexit.unr-lcssa
for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader
%indvars.iv.unr = phi i64 [ %idxprom.i, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ]
%count.023.unr = phi i64 [ 0, %for.body.preheader ], [ %19, %for.end.loopexit.unr-lcssa.loopexit ]
%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
%arrayidx.epil = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.unr
%20 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%cmp1.epil = icmp eq i32 %20, %answer.0.lcssa.i
br i1 %cmp1.epil, label %if.then.epil, label %for.end
if.then.epil: ; preds = %for.body.epil
%arrayidx3.epil = getelementptr inbounds i32, ptr %answer, i64 %count.023.unr
%21 = trunc i64 %indvars.iv.unr to i32
store i32 %21, ptr %arrayidx3.epil, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %fill_int.exit
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @min_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 {
entry:
%idxprom = sext i32 %min to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not.not9 = icmp slt i32 %min, %max
br i1 %cmp.not.not9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = sext i32 %max to i64
%1 = sub nsw i64 %wide.trip.count, %idxprom
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %1, -8
%ind.end = add nsw i64 %n.vec, %idxprom
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %idxprom
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi13 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%2 = getelementptr i32, ptr %gep, i64 1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr i32, ptr %gep, i64 5
%wide.load14 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi13, <4 x i32> %wide.load14)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !101
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.011.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ]
%answer.011 = phi i32 [ %spec.select.i, %for.body ], [ %answer.011.ph, %for.body.preheader15 ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%spec.select.i = tail call i32 @llvm.smin.i32(i32 %answer.011, i32 %8)
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !102
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @min_int_array_num(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef writeonly %answer) local_unnamed_addr #16 {
entry:
%idxprom.i = sext i32 %min to i64
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %idxprom.i
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.not.not9.i = icmp slt i32 %min, %max
br i1 %cmp.not.not9.i, label %for.body.preheader.i, label %min_int_array.exit
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = sext i32 %max to i64
%1 = sub nsw i64 %wide.trip.count.i, %idxprom.i
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %1, -8
%ind.end = add nsw i64 %n.vec, %idxprom.i
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %idxprom.i
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi26 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%2 = getelementptr i32, ptr %gep, i64 1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr i32, ptr %gep, i64 5
%wide.load27 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi26, <4 x i32> %wide.load27)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !103
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %min_int_array.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ %idxprom.i, %for.body.preheader.i ], [ %ind.end, %middle.block ]
%answer.011.i.ph = phi i32 [ %0, %for.body.preheader.i ], [ %7, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%answer.011.i = phi i32 [ %spec.select.i.i, %for.body.i ], [ %answer.011.i.ph, %for.body.i.preheader ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%spec.select.i.i = tail call i32 @llvm.smin.i32(i32 %answer.011.i, i32 %8)
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %min_int_array.exit, label %for.body.i, !llvm.loop !104
min_int_array.exit: ; preds = %for.body.i, %middle.block, %entry
%answer.0.lcssa.i = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i.i, %for.body.i ]
%sub = sub nsw i32 %max, %min
%cmp.not4.i = icmp slt i32 %sub, 0
br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i16
for.body.preheader.i16: ; preds = %min_int_array.exit
%9 = add nuw i32 %sub, 1
%10 = zext i32 %9 to i64
%11 = shl nuw nsw i64 %10, 2
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %answer, i8 -1, i64 %11, i1 false), !tbaa !5
br label %fill_int.exit
fill_int.exit: ; preds = %for.body.preheader.i16, %min_int_array.exit
%cmp.not22 = icmp sgt i32 %min, %max
br i1 %cmp.not22, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %fill_int.exit
%12 = add i32 %max, 1
%13 = sub i32 %12, %min
%xtraiter = and i32 %13, 1
%14 = icmp eq i32 %max, %min
br i1 %14, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %13, -2
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %idxprom.i, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%count.023 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%15 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %15, %answer.0.lcssa.i
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%idxprom2 = sext i32 %count.023 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2
%16 = trunc i64 %indvars.iv to i32
store i32 %16, ptr %arrayidx3, align 4, !tbaa !5
%add = add nsw i32 %count.023, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%count.1 = phi i32 [ %add, %if.then ], [ %count.023, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp1.1 = icmp eq i32 %17, %answer.0.lcssa.i
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%idxprom2.1 = sext i32 %count.1 to i64
%arrayidx3.1 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2.1
%18 = trunc i64 %indvars.iv.next to i32
store i32 %18, ptr %arrayidx3.1, align 4, !tbaa !5
%add.1 = add nsw i32 %count.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%count.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %count.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 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.loopexit, label %for.body, !llvm.loop !105
for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1
%19 = sext i32 %count.1.1 to i64
br label %for.end.loopexit.unr-lcssa
for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader
%indvars.iv.unr = phi i64 [ %idxprom.i, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ]
%count.023.unr = phi i64 [ 0, %for.body.preheader ], [ %19, %for.end.loopexit.unr-lcssa.loopexit ]
%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
%arrayidx.epil = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.unr
%20 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%cmp1.epil = icmp eq i32 %20, %answer.0.lcssa.i
br i1 %cmp1.epil, label %if.then.epil, label %for.end
if.then.epil: ; preds = %for.body.epil
%arrayidx3.epil = getelementptr inbounds i32, ptr %answer, i64 %count.023.unr
%21 = trunc i64 %indvars.iv.unr to i32
store i32 %21, ptr %arrayidx3.epil, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %fill_int.exit
ret void
}
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i32 @max_char_array_dic(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #19 {
entry:
%0 = zext i32 %size to i64
%cmp.not.not11 = icmp slt i32 %min, %max
br i1 %cmp.not.not11, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = sext i32 %min to i64
%wide.trip.count = sext i32 %max to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%answer.013 = phi i32 [ %min, %for.body.preheader ], [ %spec.select, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%idxprom = sext i32 %answer.013 to i64
%2 = mul nsw i64 %idxprom, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %2
%3 = mul nsw i64 %indvars.iv.next, %0
%arrayidx2 = getelementptr inbounds i8, ptr %array, i64 %3
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #25
%cmp3 = icmp slt i32 %call, 0
%4 = trunc i64 %indvars.iv.next to i32
%spec.select = select i1 %cmp3, i32 %4, i32 %answer.013
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !106
for.end: ; preds = %for.body, %entry
%answer.0.lcssa = phi i32 [ %min, %entry ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i32 @min_char_array_dic(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #19 {
entry:
%0 = zext i32 %size to i64
%cmp.not.not11 = icmp slt i32 %min, %max
br i1 %cmp.not.not11, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = sext i32 %min to i64
%wide.trip.count = sext i32 %max to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%answer.013 = phi i32 [ %min, %for.body.preheader ], [ %spec.select, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%idxprom = sext i32 %answer.013 to i64
%2 = mul nsw i64 %idxprom, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %2
%3 = mul nsw i64 %indvars.iv.next, %0
%arrayidx2 = getelementptr inbounds i8, ptr %array, i64 %3
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #25
%cmp3 = icmp sgt i32 %call, 0
%4 = trunc i64 %indvars.iv.next to i32
%spec.select = select i1 %cmp3, i32 %4, i32 %answer.013
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !107
for.end: ; preds = %for.body, %entry
%answer.0.lcssa = phi i32 [ %min, %entry ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @sum_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #20 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%invariant.gep = getelementptr i32, ptr %array, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %gep, i64 4
%wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = add <4 x i32> %wide.load, %vec.phi
%7 = add <4 x i32> %wide.load11, %vec.phi10
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !108
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader12
for.body.preheader12: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader12, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ]
%answer.08 = phi i32 [ %add, %for.body ], [ %answer.08.ph, %for.body.preheader12 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%10 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %10, %answer.08
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !109
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local zeroext i1 @detect_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #20 {
entry:
%cmp.not10 = icmp sgt i32 %min, %max
br i1 %cmp.not10, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %2, %element
br i1 %cmp1, label %for.end.loopexit.split.loop.exit, label %for.inc
for.inc: ; preds = %for.body
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !110
for.end.loopexit.split.loop.exit: ; preds = %for.body
%3 = trunc i64 %indvars.iv to i32
br label %for.end
for.end: ; preds = %for.inc, %for.end.loopexit.split.loop.exit, %entry
%i.0.lcssa = phi i32 [ %min, %entry ], [ %3, %for.end.loopexit.split.loop.exit ], [ %1, %for.inc ]
%cmp3.not = icmp sle i32 %i.0.lcssa, %max
ret i1 %cmp3.not
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local zeroext i1 @detect_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #20 {
entry:
%cmp.not13 = icmp sgt i32 %min, %max
br i1 %cmp.not13, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !14
%cmp2 = icmp eq i8 %2, %element
br i1 %cmp2, label %for.end.loopexit.split.loop.exit, label %for.inc
for.inc: ; preds = %for.body
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !111
for.end.loopexit.split.loop.exit: ; preds = %for.body
%3 = trunc i64 %indvars.iv to i32
br label %for.end
for.end: ; preds = %for.inc, %for.end.loopexit.split.loop.exit, %entry
%i.0.lcssa = phi i32 [ %min, %entry ], [ %3, %for.end.loopexit.split.loop.exit ], [ %1, %for.inc ]
%cmp5.not = icmp sle i32 %i.0.lcssa, %max
ret i1 %cmp5.not
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local zeroext i1 @detect_char_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef readonly %element, i32 noundef %start, i32 noundef %goal) local_unnamed_addr #20 {
entry:
%sub = sub nsw i32 %goal, %start
%sub1 = sub nsw i32 %max, %min
%cmp.not = icmp sgt i32 %sub, %sub1
br i1 %cmp.not, label %if.end24, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub3 = sub nsw i32 %max, %sub
%cmp4.not42 = icmp slt i32 %sub3, %min
br i1 %cmp4.not42, label %if.end24, label %for.cond5.preheader.lr.ph
for.cond5.preheader.lr.ph: ; preds = %for.cond.preheader
%cmp6.not39 = icmp sgt i32 %start, %goal
%add16 = add i32 %goal, 1
br i1 %cmp6.not39, label %for.cond5.preheader.lr.ph.split.us, label %for.cond5.preheader.preheader
for.cond5.preheader.preheader: ; preds = %for.cond5.preheader.lr.ph
%0 = sext i32 %start to i64
br label %for.cond5.preheader
for.cond5.preheader.lr.ph.split.us: ; preds = %for.cond5.preheader.lr.ph
%cmp17.us = icmp eq i32 %add16, %start
br label %if.end24
for.cond5.preheader: ; preds = %for.end, %for.cond5.preheader.preheader
%i.043 = phi i32 [ %min, %for.cond5.preheader.preheader ], [ %add22, %for.end ]
%add = sub i32 %i.043, %start
br label %for.body7
for.body7: ; preds = %for.cond5.preheader, %for.inc
%indvars.iv = phi i64 [ %0, %for.cond5.preheader ], [ %indvars.iv.next, %for.inc ]
%1 = trunc i64 %indvars.iv to i32
%sub8 = add i32 %add, %1
%idxprom = sext i32 %sub8 to i64
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %idxprom
%2 = load i8, ptr %arrayidx, align 1, !tbaa !14
%arrayidx10 = getelementptr inbounds i8, ptr %element, i64 %indvars.iv
%3 = load i8, ptr %arrayidx10, align 1, !tbaa !14
%cmp12 = icmp eq i8 %2, %3
br i1 %cmp12, label %for.inc, label %for.end
for.inc: ; preds = %for.body7
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %add16, %lftr.wideiv
br i1 %exitcond.not, label %if.end24, label %for.body7, !llvm.loop !112
for.end: ; preds = %for.body7
%cmp17 = icmp eq i32 %add16, %1
%add22 = add nsw i32 %i.043, 1
%cmp4.not.not = icmp sge i32 %i.043, %sub3
%or.cond.not = or i1 %cmp4.not.not, %cmp17
br i1 %or.cond.not, label %if.end24, label %for.cond5.preheader, !llvm.loop !113
if.end24: ; preds = %for.end, %for.inc, %for.cond5.preheader.lr.ph.split.us, %for.cond.preheader, %entry
%answer.0 = phi i1 [ false, %entry ], [ false, %for.cond.preheader ], [ %cmp17.us, %for.cond5.preheader.lr.ph.split.us ], [ true, %for.inc ], [ %cmp17, %for.end ]
ret i1 %answer.0
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @count_differentelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 {
entry:
%0 = zext i32 %max to i64
%vla = alloca i32, i64 %0, align 16
%cmp.not4.i = icmp slt i32 %max, 0
br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%1 = add nuw i32 %max, 1
%2 = zext i32 %1 to i64
%3 = shl nuw nsw i64 %2, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %3, i1 false), !tbaa !5
br label %fill_int.exit
fill_int.exit: ; preds = %for.body.preheader.i, %entry
%cmp.not28 = icmp sgt i32 %min, %max
br i1 %cmp.not28, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %fill_int.exit
%4 = sext i32 %min to i64
%5 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %4, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%answer.030 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not10.i = icmp slt i32 %answer.030, 1
br i1 %cmp.not10.i, label %detect_int.exit, label %for.body.i19.preheader
for.body.i19.preheader: ; preds = %for.body
%zext = zext i32 %answer.030 to i64
br label %for.body.i19
for.body.i19: ; preds = %for.body.i19.preheader, %for.inc.i
%indvars.iv.i20 = phi i64 [ %indvars.iv.next.i22, %for.inc.i ], [ 0, %for.body.i19.preheader ]
%arrayidx.i21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i20
%7 = load i32, ptr %arrayidx.i21, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %7, %6
br i1 %cmp1.i, label %for.end.loopexit.split.loop.exit.i, label %for.inc.i
for.inc.i: ; preds = %for.body.i19
%indvars.iv.next.i22 = add nuw nsw i64 %indvars.iv.i20, 1
%8 = icmp eq i64 %indvars.iv.next.i22, %zext
br i1 %8, label %if.then, label %for.body.i19, !llvm.loop !110
for.end.loopexit.split.loop.exit.i: ; preds = %for.body.i19
%9 = trunc i64 %indvars.iv.i20 to i32
br label %detect_int.exit
detect_int.exit: ; preds = %for.body, %for.end.loopexit.split.loop.exit.i
%i.0.lcssa.i = phi i32 [ 0, %for.body ], [ %9, %for.end.loopexit.split.loop.exit.i ]
%cmp3.not.i.not.not = icmp slt i32 %i.0.lcssa.i, %answer.030
br i1 %cmp3.not.i.not.not, label %for.inc, label %if.then
if.then: ; preds = %for.inc.i, %detect_int.exit
%idxprom5 = sext i32 %answer.030 to i64
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5
store i32 %6, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %answer.030, 1
br label %for.inc
for.inc: ; preds = %detect_int.exit, %if.then
%answer.1 = phi i32 [ %add, %if.then ], [ %answer.030, %detect_int.exit ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %5, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !114
for.end: ; preds = %for.inc, %fill_int.exit
%answer.0.lcssa = phi i32 [ 0, %fill_int.exit ], [ %answer.1, %for.inc ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @count_differentelement_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 {
entry:
%0 = zext i32 %max to i64
%vla = alloca i8, i64 %0, align 16
%cmp.not4.i = icmp slt i32 %max, 0
br i1 %cmp.not4.i, label %fill_char.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%1 = add nuw nsw i64 %0, 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %1, i1 false), !tbaa !14
br label %fill_char.exit
fill_char.exit: ; preds = %entry, %for.body.preheader.i
%cmp.not20 = icmp sgt i32 %min, %max
br i1 %cmp.not20, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %fill_char.exit
%2 = sext i32 %min to i64
%3 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv26 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next27, %for.inc ]
%answer.022 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ]
%cmp.not.i = icmp slt i32 %answer.022, 1
br i1 %cmp.not.i, label %for.body.if.then_crit_edge, label %for.cond5.preheader.lr.ph.i
for.body.if.then_crit_edge: ; preds = %for.body
%arrayidx.phi.trans.insert = getelementptr inbounds i8, ptr %array, i64 %indvars.iv26
%.pre30 = load i8, ptr %arrayidx.phi.trans.insert, align 1, !tbaa !14
br label %if.then
for.cond5.preheader.lr.ph.i: ; preds = %for.body
%4 = zext i32 %answer.022 to i64
%arrayidx10.i.phi.trans.insert = getelementptr inbounds i8, ptr %array, i64 %indvars.iv26
%.pre = load i8, ptr %arrayidx10.i.phi.trans.insert, align 1, !tbaa !14
br label %for.cond5.preheader.i
for.cond.i: ; preds = %for.cond5.preheader.i
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %4
br i1 %exitcond.not, label %if.then, label %for.cond5.preheader.i, !llvm.loop !113
for.cond5.preheader.i: ; preds = %for.cond.i, %for.cond5.preheader.lr.ph.i
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond.i ], [ 0, %for.cond5.preheader.lr.ph.i ]
%arrayidx.i = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%5 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%cmp12.i = icmp eq i8 %5, %.pre
br i1 %cmp12.i, label %for.inc, label %for.cond.i
if.then: ; preds = %for.cond.i, %for.body.if.then_crit_edge
%6 = phi i8 [ %.pre30, %for.body.if.then_crit_edge ], [ %.pre, %for.cond.i ]
%idxprom3 = sext i32 %answer.022 to i64
%arrayidx4 = getelementptr inbounds i8, ptr %vla, i64 %idxprom3
store i8 %6, ptr %arrayidx4, align 1, !tbaa !14
%add = add nsw i32 %answer.022, 1
br label %for.inc
for.inc: ; preds = %for.cond5.preheader.i, %if.then
%answer.1 = phi i32 [ %add, %if.then ], [ %answer.022, %for.cond5.preheader.i ]
%indvars.iv.next27 = add nsw i64 %indvars.iv26, 1
%lftr.wideiv = trunc i64 %indvars.iv.next27 to i32
%exitcond29.not = icmp eq i32 %3, %lftr.wideiv
br i1 %exitcond29.not, label %for.end, label %for.body, !llvm.loop !115
for.end: ; preds = %for.inc, %fill_char.exit
%answer.0.lcssa = phi i32 [ 0, %fill_char.exit ], [ %answer.1, %for.inc ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @count_equalelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #20 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %gep, i64 4
%wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = icmp eq <4 x i32> %wide.load, %broadcast.splat
%7 = icmp eq <4 x i32> %wide.load11, %broadcast.splat
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = add <4 x i32> %vec.phi, %8
%11 = add <4 x i32> %vec.phi10, %9
%index.next = add nuw i64 %index, 8
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !116
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %11, %10
%13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader12
for.body.preheader12: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader12, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ]
%answer.08 = phi i32 [ %spec.select, %for.body ], [ %answer.08.ph, %for.body.preheader12 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%14 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %14, %element
%add = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %answer.08, %add
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !117
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @count_equalelement_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #20 {
entry:
%cmp.not8 = icmp sgt i32 %min, %max
br i1 %cmp.not8, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader14, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%broadcast.splatinsert = insertelement <4 x i8> poison, i8 %element, i64 0
%broadcast.splat = shufflevector <4 x i8> %broadcast.splatinsert, <4 x i8> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i8, ptr %array, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi12 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%gep = getelementptr i8, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i8>, ptr %gep, align 1, !tbaa !14
%5 = getelementptr inbounds i8, ptr %gep, i64 4
%wide.load13 = load <4 x i8>, ptr %5, align 1, !tbaa !14
%6 = icmp eq <4 x i8> %wide.load, %broadcast.splat
%7 = icmp eq <4 x i8> %wide.load13, %broadcast.splat
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = add <4 x i32> %vec.phi, %8
%11 = add <4 x i32> %vec.phi12, %9
%index.next = add nuw i64 %index, 8
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !118
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %11, %10
%13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader14
for.body.preheader14: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.010.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader14, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader14 ]
%answer.010 = phi i32 [ %spec.select, %for.body ], [ %answer.010.ph, %for.body.preheader14 ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%14 = load i8, ptr %arrayidx, align 1, !tbaa !14
%cmp2 = icmp eq i8 %14, %element
%add = zext i1 %cmp2 to i32
%spec.select = add nuw nsw i32 %answer.010, %add
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !119
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i32 @count_equalelement_char_array(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef readonly %element) local_unnamed_addr #19 {
entry:
%0 = zext i32 %size to i64
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%answer.08 = phi i32 [ 0, %for.body.preheader ], [ %spec.select, %for.body ]
%3 = mul nsw i64 %indvars.iv, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %3
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %element) #25
%cmp1 = icmp eq i32 %call, 0
%add = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %answer.08, %add
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !120
for.end: ; preds = %for.body, %entry
%answer.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @scanf_int_array(ptr noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not3 = icmp sgt i32 %min, %max
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
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
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !121
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #21
; Function Attrs: nofree nounwind uwtable
define dso_local void @scanf_int_array_2(ptr noundef %array1, ptr noundef %array2, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
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 %array1, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds i32, ptr %array2, i64 %indvars.iv
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef %arrayidx2)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !122
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @scanf_int_array_3(ptr noundef %array1, ptr noundef %array2, ptr noundef %array3, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not9 = icmp sgt i32 %min, %max
br i1 %cmp.not9, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
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 %array1, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds i32, ptr %array2, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds i32, ptr %array3, i64 %indvars.iv
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx, ptr noundef %arrayidx2, ptr noundef %arrayidx4)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !123
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @scanf_char_array(ptr noundef %array, i32 noundef %num) local_unnamed_addr #10 {
entry:
%array8 = ptrtoint ptr %array to i64
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %array)
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %array) #25
%0 = trunc i64 %call1 to i32
%conv = add i32 %0, -1
%cmp.not24.i = icmp slt i32 %conv, 0
br i1 %cmp.not24.i, label %for.cond3.preheader.i, label %iter.check
iter.check: ; preds = %entry
%1 = zext i32 %conv to i64
%2 = sext i32 %num to i64
%invariant.gep.i = getelementptr i8, ptr %array, i64 %2
%3 = add nuw nsw i64 %1, 1
%min.iters.check = icmp ult i32 %conv, 3
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %iter.check
%4 = getelementptr i8, ptr %array, i64 %2
%scevgep = getelementptr i8, ptr %4, i64 %1
%5 = icmp ugt ptr %4, %scevgep
%scevgep4 = getelementptr i8, ptr %array, i64 %1
%6 = icmp ult ptr %scevgep4, %array
%7 = or i1 %5, %6
br i1 %7, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %vector.scevcheck
%8 = add i64 %array8, %1
%9 = add i64 %array8, %2
%10 = add i64 %9, %1
%11 = sub i64 %8, %10
%diff.check = icmp ult i64 %11, 16
br i1 %diff.check, label %for.body.i.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check9 = icmp ult i32 %conv, 15
br i1 %min.iters.check9, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %3, 8589934576
%invariant.gep = getelementptr i8, ptr %array, i64 -15
%invariant.gep21 = getelementptr i8, ptr %invariant.gep.i, i64 -15
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = sub i64 %1, %index
%gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %gep, align 1, !tbaa !14
%gep22 = getelementptr i8, ptr %invariant.gep21, i64 %offset.idx
store <16 x i8> %wide.load, ptr %gep22, align 1, !tbaa !14
%index.next = add nuw i64 %index, 16
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !124
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %3, %n.vec
br i1 %cmp.n, label %for.cond3.preheader.i, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end13 = sub nsw i64 %1, %n.vec
%n.vec.remaining = and i64 %3, 12
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec12 = and i64 %3, 8589934588
%ind.end = sub nsw i64 %1, %n.vec12
%invariant.gep23 = getelementptr i8, ptr %array, i64 -3
%invariant.gep25 = getelementptr i8, ptr %invariant.gep.i, i64 -3
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index15 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next20, %vec.epilog.vector.body ]
%offset.idx16 = sub i64 %1, %index15
%gep24 = getelementptr i8, ptr %invariant.gep23, i64 %offset.idx16
%wide.load17 = load <4 x i8>, ptr %gep24, align 1, !tbaa !14
%gep26 = getelementptr i8, ptr %invariant.gep25, i64 %offset.idx16
store <4 x i8> %wide.load17, ptr %gep26, align 1, !tbaa !14
%index.next20 = add nuw i64 %index15, 4
%13 = icmp eq i64 %index.next20, %n.vec12
br i1 %13, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !125
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n14 = icmp eq i64 %3, %n.vec12
br i1 %cmp.n14, label %for.cond3.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.i.ph = phi i64 [ %1, %iter.check ], [ %1, %vector.memcheck ], [ %1, %vector.scevcheck ], [ %ind.end13, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
%14 = add nsw i64 %indvars.iv.i.ph, 1
%xtraiter = and i64 %14, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.i.prol
%15 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14
%gep.i.prol = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
store i8 %15, ptr %gep.i.prol, align 1, !tbaa !14
%indvars.iv.next.i.prol = add nsw i64 %indvars.iv.i.prol, -1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !126
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%16 = icmp ult i64 %indvars.iv.i.ph, 3
br i1 %16, label %for.cond3.preheader.i, label %for.body.i
for.cond3.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %entry
%cmp6.not.not26.i = icmp sgt i32 %num, 0
br i1 %cmp6.not.not26.i, label %for.body7.preheader.i, label %shift_char.exit
for.body7.preheader.i: ; preds = %for.cond3.preheader.i
%17 = zext i32 %num to i64
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %array, i8 0, i64 %17, i1 false), !tbaa !14
br label %shift_char.exit
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.i
%18 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%gep.i = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i
store i8 %18, ptr %gep.i, align 1, !tbaa !14
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i
%19 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14
%gep.i.1 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i
store i8 %19, ptr %gep.i.1, align 1, !tbaa !14
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, -2
%arrayidx.i.2 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i.1
%20 = load i8, ptr %arrayidx.i.2, align 1, !tbaa !14
%gep.i.2 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
store i8 %20, ptr %gep.i.2, align 1, !tbaa !14
%indvars.iv.next.i.2 = add nsw i64 %indvars.iv.i, -3
%arrayidx.i.3 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i.2
%21 = load i8, ptr %arrayidx.i.3, align 1, !tbaa !14
%gep.i.3 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
store i8 %21, ptr %gep.i.3, align 1, !tbaa !14
%indvars.iv.next.i.3 = add nsw i64 %indvars.iv.i, -4
%cmp.not.not.i.not.3 = icmp eq i64 %indvars.iv.next.i.2, 0
br i1 %cmp.not.not.i.not.3, label %for.cond3.preheader.i, label %for.body.i, !llvm.loop !127
shift_char.exit: ; preds = %for.cond3.preheader.i, %for.body7.preheader.i
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printf_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not3 = icmp sgt i32 %min, %max
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
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
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %2)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !128
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #21
; Function Attrs: nofree nounwind uwtable
define dso_local void @printf_char_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not3 = icmp sgt i32 %min, %max
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
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 i8, ptr %array, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !14
%conv = sext i8 %2 to i32
%putchar = tail call i32 @putchar(i32 %conv)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !129
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #10 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #24
%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.i = icmp eq i32 %0, 0
br i1 %cmp.not5.i, label %sum_digit.exit, label %while.body.preheader.i
while.body.preheader.i: ; preds = %entry
%1 = call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %while.body.i
while.body.i: ; preds = %while.body.i, %while.body.preheader.i
%answer.07.i = phi i32 [ %add.i, %while.body.i ], [ 0, %while.body.preheader.i ]
%num.addr.06.i = phi i32 [ %div.i, %while.body.i ], [ %1, %while.body.preheader.i ]
%rem.i = urem i32 %num.addr.06.i, 10
%add.i = add nuw nsw i32 %rem.i, %answer.07.i
%div.i = udiv i32 %num.addr.06.i, 10
%cmp.not.i = icmp ult i32 %num.addr.06.i, 10
br i1 %cmp.not.i, label %sum_digit.exit, label %while.body.i, !llvm.loop !51
sum_digit.exit: ; preds = %while.body.i, %entry
%answer.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %while.body.i ]
%rem = srem i32 %0, %answer.0.lcssa.i
%cmp = icmp eq i32 %rem, 0
%str.8.str = select i1 %cmp, ptr @str.8, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.8.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #24
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #22
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #22
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #23
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn 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 #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse 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 #5 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 #8 = { 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 #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { mustprogress 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 #12 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { 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 #14 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #15 = { 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 #16 = { 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 #17 = { nofree 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 #18 = { 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 #19 = { 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 #20 = { 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 #21 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #22 = { nofree nounwind }
attributes #23 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #24 = { nounwind }
attributes #25 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !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 = !{!7, !7, i64 0}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !10, !11, !12}
!21 = distinct !{!21, !10, !11}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !10, !11, !12}
!28 = !{!29}
!29 = distinct !{!29, !30}
!30 = distinct !{!30, !"LVerDomain"}
!31 = !{!32}
!32 = distinct !{!32, !30}
!33 = distinct !{!33, !10, !11, !12}
!34 = distinct !{!34, !10, !11}
!35 = distinct !{!35, !10}
!36 = distinct !{!36, !10}
!37 = distinct !{!37, !10}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.unroll.disable"}
!40 = distinct !{!40, !10}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !39}
!43 = distinct !{!43, !10}
!44 = distinct !{!44, !39}
!45 = distinct !{!45, !10}
!46 = distinct !{!46, !10}
!47 = distinct !{!47, !10}
!48 = distinct !{!48, !10}
!49 = distinct !{!49, !10, !11, !12}
!50 = distinct !{!50, !10, !11}
!51 = distinct !{!51, !10}
!52 = distinct !{!52, !10, !11, !12}
!53 = distinct !{!53, !10, !11, !12}
!54 = distinct !{!54, !10, !11}
!55 = distinct !{!55, !10, !11, !12}
!56 = distinct !{!56, !10, !11, !12}
!57 = distinct !{!57, !10, !12, !11}
!58 = distinct !{!58, !10}
!59 = distinct !{!59, !10}
!60 = distinct !{!60, !10}
!61 = distinct !{!61, !10}
!62 = distinct !{!62, !10}
!63 = distinct !{!63, !10}
!64 = distinct !{!64, !10}
!65 = !{!66}
!66 = distinct !{!66, !67}
!67 = distinct !{!67, !"LVerDomain"}
!68 = !{!69}
!69 = distinct !{!69, !67}
!70 = distinct !{!70, !10, !11, !12}
!71 = !{!72}
!72 = distinct !{!72, !73}
!73 = distinct !{!73, !"LVerDomain"}
!74 = !{!75}
!75 = distinct !{!75, !73}
!76 = distinct !{!76, !10, !11, !12}
!77 = distinct !{!77, !10, !11}
!78 = distinct !{!78, !10}
!79 = distinct !{!79, !10}
!80 = distinct !{!80, !10}
!81 = distinct !{!81, !10}
!82 = !{!83}
!83 = distinct !{!83, !84}
!84 = distinct !{!84, !"LVerDomain"}
!85 = !{!86}
!86 = distinct !{!86, !84}
!87 = distinct !{!87, !10, !11, !12}
!88 = !{!89}
!89 = distinct !{!89, !90}
!90 = distinct !{!90, !"LVerDomain"}
!91 = !{!92}
!92 = distinct !{!92, !90}
!93 = distinct !{!93, !10, !11, !12}
!94 = distinct !{!94, !10, !11}
!95 = distinct !{!95, !10}
!96 = distinct !{!96, !10, !11, !12}
!97 = distinct !{!97, !10, !12, !11}
!98 = distinct !{!98, !10, !11, !12}
!99 = distinct !{!99, !10, !12, !11}
!100 = distinct !{!100, !10}
!101 = distinct !{!101, !10, !11, !12}
!102 = distinct !{!102, !10, !12, !11}
!103 = distinct !{!103, !10, !11, !12}
!104 = distinct !{!104, !10, !12, !11}
!105 = distinct !{!105, !10}
!106 = distinct !{!106, !10}
!107 = distinct !{!107, !10}
!108 = distinct !{!108, !10, !11, !12}
!109 = distinct !{!109, !10, !12, !11}
!110 = distinct !{!110, !10}
!111 = distinct !{!111, !10}
!112 = distinct !{!112, !10}
!113 = distinct !{!113, !10}
!114 = distinct !{!114, !10}
!115 = distinct !{!115, !10}
!116 = distinct !{!116, !10, !11, !12}
!117 = distinct !{!117, !10, !12, !11}
!118 = distinct !{!118, !10, !11, !12}
!119 = distinct !{!119, !10, !12, !11}
!120 = distinct !{!120, !10}
!121 = distinct !{!121, !10}
!122 = distinct !{!122, !10}
!123 = distinct !{!123, !10}
!124 = distinct !{!124, !10, !11, !12}
!125 = distinct !{!125, !10, !11, !12}
!126 = distinct !{!126, !39}
!127 = distinct !{!127, !10, !11}
!128 = distinct !{!128, !10}
!129 = distinct !{!129, !10}
|
#include<stdio.h>
int main(void){
int n,i=0,dig=1,sum=0;
scanf("%d",&n);
int temp = n;
while(dig<n){
dig *=10;
i++;
}
dig/=10;
//printf("%d %d\n",dig,i);
for(i=i;i>0;i--){
sum+=temp/dig;
temp = n%dig;
dig/=10;
}
//printf("%d\n",sum);
if(n%sum==0){
printf("Yes");
}else{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120631/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120631/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%cmp17 = icmp sgt i32 %0, 1
br i1 %cmp17, label %while.body, label %for.end
while.body: ; preds = %entry, %while.body
%dig.019 = phi i32 [ %mul, %while.body ], [ 1, %entry ]
%i.018 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%mul = mul nuw nsw i32 %dig.019, 10
%inc = add nuw nsw i32 %i.018, 1
%cmp = icmp slt i32 %mul, %0
br i1 %cmp, label %while.body, label %for.body, !llvm.loop !9
for.body: ; preds = %while.body, %for.body
%temp.025 = phi i32 [ %rem, %for.body ], [ %0, %while.body ]
%sum.024 = phi i32 [ %add, %for.body ], [ 0, %while.body ]
%dig.123 = phi i32 [ %div3, %for.body ], [ %dig.019, %while.body ]
%i.122 = phi i32 [ %dec, %for.body ], [ %inc, %while.body ]
%div2 = sdiv i32 %temp.025, %dig.123
%add = add nsw i32 %div2, %sum.024
%rem = srem i32 %0, %dig.123
%div3 = udiv i32 %dig.123, 10
%dec = add nsw i32 %i.122, -1
%cmp1 = icmp sgt i32 %i.122, 1
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%rem4 = srem i32 %0, %sum.0.lcssa
%cmp5 = icmp eq i32 %rem4, 0
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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}
|
#include<stdio.h>
int main(void){
int i,j,S=0,n,N,ans;
scanf("%d",&N);
n = N;
for(i=1;i<11;i++){
S += n % 10;
n = n /10;
}
if(N % S == 0){
printf("Yes");
return 0;
}
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120675/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120675/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 10
%div = sdiv i32 %0, 10
%rem.1 = srem i32 %div, 10
%add.1 = add nsw i32 %rem.1, %rem
%div.1 = sdiv i32 %0, 100
%rem.2 = srem i32 %div.1, 10
%add.2 = add nsw i32 %rem.2, %add.1
%div.2 = sdiv i32 %0, 1000
%rem.3 = srem i32 %div.2, 10
%add.3 = add nsw i32 %rem.3, %add.2
%div.3 = sdiv i32 %0, 10000
%rem.4 = srem i32 %div.3, 10
%add.4 = add nsw i32 %rem.4, %add.3
%div.4 = sdiv i32 %0, 100000
%rem.5.lhs.trunc = trunc i32 %div.4 to i16
%rem.516 = srem i16 %rem.5.lhs.trunc, 10
%rem.5.sext = sext i16 %rem.516 to i32
%add.5 = add nsw i32 %add.4, %rem.5.sext
%div.5 = sdiv i32 %0, 1000000
%rem.6.lhs.trunc = trunc i32 %div.5 to i16
%rem.617 = srem i16 %rem.6.lhs.trunc, 10
%rem.6.sext = sext i16 %rem.617 to i32
%add.6 = add nsw i32 %add.5, %rem.6.sext
%div.6 = sdiv i32 %0, 10000000
%rem.7.lhs.trunc = trunc i32 %div.6 to i16
%rem.718 = srem i16 %rem.7.lhs.trunc, 10
%rem.7.sext = sext i16 %rem.718 to i32
%add.7 = add nsw i32 %add.6, %rem.7.sext
%div.7 = sdiv i32 %0, 100000000
%rem.8.lhs.trunc = trunc i32 %div.7 to i8
%rem.819 = srem i8 %rem.8.lhs.trunc, 10
%rem.8.sext = sext i8 %rem.819 to i32
%add.8 = add nsw i32 %add.7, %rem.8.sext
%div.8 = sdiv i32 %0, 1000000000
%add.9 = add nsw i32 %div.8, %add.8
%rem1 = srem i32 %0, %add.9
%cmp2 = icmp eq i32 %rem1, 0
%.str.1..str.2 = select i1 %cmp2, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
char s[12];
scanf("%s",s);
int j,i=0,sum = 0;
double N = 0,ten = 1.0/10.0;
while(1){
if(s[i] == '\0'){
break;
}
sum += ((int)s[i])-48;
i++;
}
for(j = i-1;j>=0;j--){
N += ((int)s[j]-48.0)*ten*10.0;
ten = ten*10.0;
}
if(((int)N)%((int)sum) == 0){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120718/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120718/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [12 x i8], align 1
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%cmp31 = icmp eq i8 %0, 0
br i1 %cmp31, label %for.end, label %if.end
for.cond.preheader: ; preds = %if.end
%1 = trunc i64 %indvars.iv.next to i32
%cmp635 = icmp sgt i32 %1, 0
br i1 %cmp635, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%2 = and i64 %indvars.iv.next, 4294967295
%xtraiter = and i64 %indvars.iv.next, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%indvars.iv.next41.prol = add nsw i64 %2, -1
%arrayidx9.prol = getelementptr inbounds [12 x i8], ptr %s, i64 0, i64 %indvars.iv.next41.prol
%3 = load i8, ptr %arrayidx9.prol, align 1, !tbaa !5
%conv11.prol = sitofp i8 %3 to double
%sub12.prol = fadd double %conv11.prol, -4.800000e+01
%mul.prol = fmul double %sub12.prol, 1.000000e-01
%4 = call double @llvm.fmuladd.f64(double %mul.prol, double 1.000000e+01, double 0.000000e+00)
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader
%indvars.iv40.unr = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next41.prol, %for.body.prol ]
%ten.038.unr = phi double [ 1.000000e-01, %for.body.preheader ], [ 1.000000e+00, %for.body.prol ]
%N.037.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %4, %for.body.prol ]
%.lcssa.unr = phi double [ undef, %for.body.preheader ], [ %4, %for.body.prol ]
%5 = icmp eq i64 %2, 1
br i1 %5, label %for.end.loopexit, label %for.body
if.end: ; preds = %entry, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%6 = phi i8 [ %7, %if.end ], [ %0, %entry ]
%sum.033 = phi i32 [ %add, %if.end ], [ 0, %entry ]
%conv = sext i8 %6 to i32
%sub = add i32 %sum.033, -48
%add = add i32 %sub, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [12 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %7, 0
br i1 %cmp, label %for.cond.preheader, label %if.end
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv40 = phi i64 [ %indvars.iv.next41.1, %for.body ], [ %indvars.iv40.unr, %for.body.prol.loopexit ]
%ten.038 = phi double [ %mul14.1, %for.body ], [ %ten.038.unr, %for.body.prol.loopexit ]
%N.037 = phi double [ %11, %for.body ], [ %N.037.unr, %for.body.prol.loopexit ]
%indvars.iv.next41 = add nsw i64 %indvars.iv40, -1
%arrayidx9 = getelementptr inbounds [12 x i8], ptr %s, i64 0, i64 %indvars.iv.next41
%8 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%conv11 = sitofp i8 %8 to double
%sub12 = fadd double %conv11, -4.800000e+01
%mul = fmul double %ten.038, %sub12
%9 = call double @llvm.fmuladd.f64(double %mul, double 1.000000e+01, double %N.037)
%mul14 = fmul double %ten.038, 1.000000e+01
%indvars.iv.next41.1 = add nsw i64 %indvars.iv40, -2
%arrayidx9.1 = getelementptr inbounds [12 x i8], ptr %s, i64 0, i64 %indvars.iv.next41.1
%10 = load i8, ptr %arrayidx9.1, align 1, !tbaa !5
%conv11.1 = sitofp i8 %10 to double
%sub12.1 = fadd double %conv11.1, -4.800000e+01
%mul.1 = fmul double %mul14, %sub12.1
%11 = call double @llvm.fmuladd.f64(double %mul.1, double 1.000000e+01, double %9)
%mul14.1 = fmul double %mul14, 1.000000e+01
%cmp6.1 = icmp ugt i64 %indvars.iv.next41, 1
br i1 %cmp6.1, label %for.body, label %for.end.loopexit, !llvm.loop !8
for.end.loopexit: ; preds = %for.body, %for.body.prol.loopexit
%.lcssa = phi double [ %.lcssa.unr, %for.body.prol.loopexit ], [ %11, %for.body ]
%12 = fptosi double %.lcssa to i32
br label %for.end
for.end: ; preds = %entry, %for.end.loopexit, %for.cond.preheader
%sum.0.lcssa46 = phi i32 [ %add, %for.cond.preheader ], [ %add, %for.end.loopexit ], [ 0, %entry ]
%N.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %12, %for.end.loopexit ], [ 0, %entry ]
%rem = srem i32 %N.0.lcssa, %sum.0.lcssa46
%cmp16 = icmp eq i32 %rem, 0
%str.3.str = select i1 %cmp16, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n,m,i,t;
scanf("%d",&n);
t=0,i=n;
while(n>0){
m=n%10;
t+=m;
n/=10;
}
if(i%t==0) printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120761/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120761/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%t.08 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%1 = phi i32 [ %div, %while.body ], [ %0, %entry ]
%rem = urem i32 %1, 10
%add = add nuw nsw i32 %t.08, %rem
%div = udiv i32 %1, 10
%cmp.not = icmp ult i32 %1, 10
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %div, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%t.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%rem1 = srem i32 %0, %t.0.lcssa
%cmp2 = icmp eq i32 %rem1, 0
%str.3.str = select i1 %cmp2, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int n,r;
int s = 0;
scanf("%d",&n);
int z = n;
while (n > 0){
r = n % 10;
n = n / 10;
s = s + r;
}
if(z % s == 0)
printf("Yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120811/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120811/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%s.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%1 = phi i32 [ %div, %while.body ], [ %0, %entry ]
%rem = urem i32 %1, 10
%div = udiv i32 %1, 10
%add = add nuw nsw i32 %s.07, %rem
%cmp.not = icmp ult i32 %1, 10
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %div, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%s.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%rem1 = srem i32 %0, %s.0.lcssa
%cmp2 = icmp eq i32 %rem1, 0
%.str.1..str.2 = select i1 %cmp2, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
int i, n, len;
int sum = 0;
char buf[11];
scanf("%s", buf);
n = atoi(buf);
len = strlen(buf);
for (i = 0; i < len; i++) {
sum += buf[i] - '0';
}
if (n % sum == 0) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120862/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120862/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%buf = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %buf) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %buf)
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %buf, ptr noundef null, i32 noundef 10) #7
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %buf) #8
%conv = trunc i64 %call4 to i32
%cmp15 = icmp sgt i32 %conv, 0
br i1 %cmp15, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call4, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader21, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call4, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi19 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%0 = getelementptr inbounds [11 x i8], ptr %buf, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %0, align 1, !tbaa !5
%1 = getelementptr inbounds i8, ptr %0, i64 4
%wide.load20 = load <4 x i8>, ptr %1, align 1, !tbaa !5
%2 = sext <4 x i8> %wide.load to <4 x i32>
%3 = sext <4 x i8> %wide.load20 to <4 x i32>
%4 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48>
%5 = add <4 x i32> %vec.phi19, <i32 -48, i32 -48, i32 -48, i32 -48>
%6 = add <4 x i32> %4, %2
%7 = add <4 x i32> %5, %3
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.end, label %for.body.preheader21
for.body.preheader21: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%sum.017.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader21, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader21 ]
%sum.017 = phi i32 [ %add, %for.body ], [ %sum.017.ph, %for.body.preheader21 ]
%arrayidx = getelementptr inbounds [11 x i8], ptr %buf, i64 0, i64 %indvars.iv
%10 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv6 = sext i8 %10 to i32
%sub = add i32 %sum.017, -48
%add = add i32 %sub, %conv6
%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, %middle.block, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body ]
%conv.i = trunc i64 %call.i to i32
%rem = srem i32 %conv.i, %sum.0.lcssa
%cmp7 = icmp eq i32 %rem, 0
%str.3.str = select i1 %cmp7, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %buf) #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 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: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x 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 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 = { 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 #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
|
#include <stdio.h>
int main(void) {
int a[4],max=0,s,i;
for(i=0;i<4;i++)
scanf("%d",&a[i]);
for(i=0;i<4;i++)
{
if(a[i]>max)
max=a[i];
}
for(i=0;i<4;i++)
{
s=max-a[i];
if(s!=0)
printf("%d ",s);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12092/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12092/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%arrayidx.1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%0 = load i32, ptr %a, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%2 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2)
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %3)
%spec.select.3 = call i32 @llvm.smax.i32(i32 %spec.select.2, i32 0)
%cmp17.not = icmp eq i32 %spec.select.3, %0
br i1 %cmp17.not, label %for.inc21, label %if.then18
if.then18: ; preds = %entry
%sub = sub nsw i32 %spec.select.3, %0
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%.pre = load i32, ptr %arrayidx.1, align 4, !tbaa !5
br label %for.inc21
for.inc21: ; preds = %entry, %if.then18
%4 = phi i32 [ %1, %entry ], [ %.pre, %if.then18 ]
%cmp17.not.1 = icmp eq i32 %spec.select.3, %4
br i1 %cmp17.not.1, label %for.inc21.1, label %if.then18.1
if.then18.1: ; preds = %for.inc21
%sub.1 = sub nsw i32 %spec.select.3, %4
%call19.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.1)
br label %for.inc21.1
for.inc21.1: ; preds = %if.then18.1, %for.inc21
%5 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp17.not.2 = icmp eq i32 %spec.select.3, %5
br i1 %cmp17.not.2, label %for.inc21.2, label %if.then18.2
if.then18.2: ; preds = %for.inc21.1
%sub.2 = sub nsw i32 %spec.select.3, %5
%call19.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.2)
br label %for.inc21.2
for.inc21.2: ; preds = %if.then18.2, %for.inc21.1
%6 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp17.not.3 = icmp eq i32 %spec.select.3, %6
br i1 %cmp17.not.3, label %for.inc21.3, label %if.then18.3
if.then18.3: ; preds = %for.inc21.2
%sub.3 = sub nsw i32 %spec.select.3, %6
%call19.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.3)
br label %for.inc21.3
for.inc21.3: ; preds = %if.then18.3, %for.inc21.2
call void @llvm.lifetime.end.p0(i64 16, 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.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <inttypes.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
intmax_t N, M, K;
intmax_t A[200000], B[200000];
intmax_t time = 0, num_a = 0, num_b = 0, ans = 0;
scanf("%jd%jd%jd", &N, &M, &K);
for (size_t i = 0; i < N; i++) {
scanf("%jd", &A[i]);
}
for (size_t i = 0; i < M; i++) {
scanf("%jd", &B[i]);
}
for (size_t i = 0; i < N; i++) {
if ((time + A[i]) <= K) {
time += A[i];
num_a++;
} else {
break;
}
}
for (size_t i = 0; i < M; i++) {
if ((time + B[i]) <= K) {
time += B[i];
num_b++;
} else {
break;
}
}
ans = num_a + num_b;
while ((num_b < M) && (num_a > 0)) {
num_a--;
time -= A[num_a];
while ((num_b < M) && ((time + B[num_b]) <= K)) {
time += B[num_b];
num_b++;
}
if (ans < (num_a + num_b))
ans = num_a + num_b;
}
printf("%jd\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120963/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120963/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%jd%jd%jd\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%jd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%jd\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%M = alloca i64, align 8
%K = alloca i64, align 8
%A = alloca [200000 x i64], align 16
%B = alloca [200000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %M) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M, ptr noundef nonnull %K)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp105.not = icmp eq i64 %0, 0
br i1 %cmp105.not, label %for.cond3.preheader, label %for.body
for.cond3.preheader: ; preds = %for.body, %entry
%1 = phi i64 [ 0, %entry ], [ %3, %for.body ]
%2 = load i64, ptr %M, align 8, !tbaa !5
%cmp4107.not = icmp eq i64 %2, 0
br i1 %cmp4107.not, label %for.cond13.preheader, label %for.body6
for.body: ; preds = %entry, %for.body
%i.0106 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x i64], ptr %A, i64 0, i64 %i.0106
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw i64 %i.0106, 1
%3 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp ult i64 %inc, %3
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond13.preheader.loopexit: ; preds = %for.body6
%.pre = load i64, ptr %N, align 8, !tbaa !5
br label %for.cond13.preheader
for.cond13.preheader: ; preds = %for.cond13.preheader.loopexit, %for.cond3.preheader
%4 = phi i64 [ %1, %for.cond3.preheader ], [ %.pre, %for.cond13.preheader.loopexit ]
%.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ %6, %for.cond13.preheader.loopexit ]
%cmp14109.not = icmp eq i64 %4, 0
br i1 %cmp14109.not, label %cleanup, label %for.body16.lr.ph
for.body16.lr.ph: ; preds = %for.cond13.preheader
%5 = load i64, ptr %K, align 8, !tbaa !5
br label %for.body16
for.body6: ; preds = %for.cond3.preheader, %for.body6
%i2.0108 = phi i64 [ %inc10, %for.body6 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [200000 x i64], ptr %B, i64 0, i64 %i2.0108
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%inc10 = add nuw i64 %i2.0108, 1
%6 = load i64, ptr %M, align 8, !tbaa !5
%cmp4 = icmp ult i64 %inc10, %6
br i1 %cmp4, label %for.body6, label %for.cond13.preheader.loopexit, !llvm.loop !11
for.body16: ; preds = %for.body16.lr.ph, %if.then
%i12.0112 = phi i64 [ 0, %for.body16.lr.ph ], [ %inc23, %if.then ]
%time.0110 = phi i64 [ 0, %for.body16.lr.ph ], [ %add, %if.then ]
%arrayidx17 = getelementptr inbounds [200000 x i64], ptr %A, i64 0, i64 %i12.0112
%7 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%add = add nsw i64 %7, %time.0110
%cmp18.not = icmp sgt i64 %add, %5
br i1 %cmp18.not, label %cleanup, label %if.then
if.then: ; preds = %for.body16
%inc23 = add nuw i64 %i12.0112, 1
%exitcond.not = icmp eq i64 %inc23, %4
br i1 %exitcond.not, label %cleanup, label %for.body16, !llvm.loop !12
cleanup: ; preds = %if.then, %for.body16, %for.cond13.preheader
%time.0.lcssa = phi i64 [ 0, %for.cond13.preheader ], [ %time.0110, %for.body16 ], [ %add, %if.then ]
%num_a.0.lcssa = phi i64 [ 0, %for.cond13.preheader ], [ %i12.0112, %for.body16 ], [ %4, %if.then ]
%cmp27117.not = icmp eq i64 %.lcssa, 0
br i1 %cmp27117.not, label %cleanup41, label %for.body29.lr.ph
for.body29.lr.ph: ; preds = %cleanup
%8 = load i64, ptr %K, align 8, !tbaa !5
br label %for.body29
for.body29: ; preds = %for.body29.lr.ph, %if.then33
%i25.0120 = phi i64 [ 0, %for.body29.lr.ph ], [ %inc40, %if.then33 ]
%time.1118 = phi i64 [ %time.0.lcssa, %for.body29.lr.ph ], [ %add31, %if.then33 ]
%arrayidx30 = getelementptr inbounds [200000 x i64], ptr %B, i64 0, i64 %i25.0120
%9 = load i64, ptr %arrayidx30, align 8, !tbaa !5
%add31 = add nsw i64 %9, %time.1118
%cmp32.not = icmp sgt i64 %add31, %8
br i1 %cmp32.not, label %cleanup41, label %if.then33
if.then33: ; preds = %for.body29
%inc40 = add nuw i64 %i25.0120, 1
%exitcond135.not = icmp eq i64 %inc40, %.lcssa
br i1 %exitcond135.not, label %cleanup41.thread, label %for.body29, !llvm.loop !13
cleanup41.thread: ; preds = %if.then33
%add43139 = add nuw nsw i64 %.lcssa, %num_a.0.lcssa
br label %while.end63
cleanup41: ; preds = %for.body29, %cleanup
%time.1.lcssa = phi i64 [ %time.0.lcssa, %cleanup ], [ %time.1118, %for.body29 ]
%num_b.0.lcssa = phi i64 [ 0, %cleanup ], [ %i25.0120, %for.body29 ]
%add43 = add nuw nsw i64 %num_b.0.lcssa, %num_a.0.lcssa
%cmp44127 = icmp slt i64 %num_b.0.lcssa, %.lcssa
%cmp45128 = icmp sgt i64 %num_a.0.lcssa, 0
%10 = and i1 %cmp44127, %cmp45128
br i1 %10, label %while.body.lr.ph, label %while.end63
while.body.lr.ph: ; preds = %cleanup41
%11 = load i64, ptr %K, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.end
%ans.0132 = phi i64 [ %add43, %while.body.lr.ph ], [ %spec.select, %while.end ]
%num_b.1131 = phi i64 [ %num_b.0.lcssa, %while.body.lr.ph ], [ %num_b.2126, %while.end ]
%num_a.1130 = phi i64 [ %num_a.0.lcssa, %while.body.lr.ph ], [ %dec, %while.end ]
%time.2129 = phi i64 [ %time.1.lcssa, %while.body.lr.ph ], [ %time.3125, %while.end ]
%dec = add nsw i64 %num_a.1130, -1
%arrayidx46 = getelementptr inbounds [200000 x i64], ptr %A, i64 0, i64 %dec
%12 = load i64, ptr %arrayidx46, align 8, !tbaa !5
%sub = sub nsw i64 %time.2129, %12
%13 = add nsw i64 %num_b.1131, 1
%smax = call i64 @llvm.smax.i64(i64 %.lcssa, i64 %13)
br label %land.rhs49
land.rhs49: ; preds = %while.body, %while.body54
%num_b.2126 = phi i64 [ %num_b.1131, %while.body ], [ %inc57, %while.body54 ]
%time.3125 = phi i64 [ %sub, %while.body ], [ %add51, %while.body54 ]
%arrayidx50 = getelementptr inbounds [200000 x i64], ptr %B, i64 0, i64 %num_b.2126
%14 = load i64, ptr %arrayidx50, align 8, !tbaa !5
%add51 = add nsw i64 %14, %time.3125
%cmp52.not = icmp sgt i64 %add51, %11
br i1 %cmp52.not, label %while.end, label %while.body54
while.body54: ; preds = %land.rhs49
%inc57 = add i64 %num_b.2126, 1
%exitcond136.not = icmp eq i64 %inc57, %smax
br i1 %exitcond136.not, label %while.end.thread, label %land.rhs49, !llvm.loop !14
while.end.thread: ; preds = %while.body54
%add58144 = add nsw i64 %smax, %dec
%spec.select145 = call i64 @llvm.smax.i64(i64 %ans.0132, i64 %add58144)
br label %while.end63
while.end: ; preds = %land.rhs49
%add58 = add nsw i64 %num_b.2126, %dec
%spec.select = call i64 @llvm.smax.i64(i64 %ans.0132, i64 %add58)
%cmp44 = icmp slt i64 %num_b.2126, %.lcssa
%cmp45 = icmp sgt i64 %num_a.1130, 1
%15 = and i1 %cmp44, %cmp45
br i1 %15, label %while.body, label %while.end63, !llvm.loop !15
while.end63: ; preds = %while.end, %while.end.thread, %cleanup41.thread, %cleanup41
%ans.0.lcssa = phi i64 [ %add43, %cleanup41 ], [ %add43139, %cleanup41.thread ], [ %spec.select145, %while.end.thread ], [ %spec.select, %while.end ]
%call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %M) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#include <string.h>
#pragma warning(disable : 4996)
int main()
{
int i,j;
long N;
char s[300010];
int a[300000];
long ans = 300000;
int sum;
scanf("%ld", &N);
scanf("%s", s);
a[0] = (s[0] == 'W') ? 1 : 0;
//西を向いている人の数
for (i = 1; i < N; i++) {
a[i] = a[i - 1] + ((s[i] == 'W') ? 1 : 0);
}
for (i = 0; i < N; i++) {
if(i == 0)
sum = (N - i - 1 - (a[N - 1] - a[i]));
else
sum = a[i - 1] + (N - i -1 - (a[N-1] - a[i]));
if (sum < ans)
ans = sum;
}
printf("%ld", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121005/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121005/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [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 i64, align 8
%s = alloca [300010 x i8], align 16
%a = alloca [300000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 300010, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %a) #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 %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp = icmp eq i8 %0, 87
%cond = zext i1 %cmp to i32
store i32 %cond, ptr %a, align 16, !tbaa !8
%1 = load i64, ptr %N, align 8, !tbaa !10
%cmp575 = icmp sgt i64 %1, 1
br i1 %cmp575, label %for.body.preheader, label %for.cond16.preheader
for.body.preheader: ; preds = %entry
%2 = add i64 %1, -1
%xtraiter = and i64 %2, 1
%3 = icmp eq i64 %1, 2
br i1 %3, label %for.cond16.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %2, -2
br label %for.body
for.cond16.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%.unr = phi i32 [ %cond, %for.body.preheader ], [ %add.1, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond16.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond16.preheader.loopexit.unr-lcssa
%arrayidx9.epil = getelementptr inbounds [300010 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%4 = load i8, ptr %arrayidx9.epil, align 1, !tbaa !5
%cmp11.epil = icmp eq i8 %4, 87
%cond13.epil = zext i1 %cmp11.epil to i32
%add.epil = add nuw nsw i32 %.unr, %cond13.epil
%arrayidx15.epil = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %indvars.iv.unr
store i32 %add.epil, ptr %arrayidx15.epil, align 4, !tbaa !8
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.body.epil, %for.cond16.preheader.loopexit.unr-lcssa, %entry
%cmp1878 = icmp sgt i64 %1, 0
br i1 %cmp1878, label %if.end.peel, label %for.end58
if.end.peel: ; preds = %for.cond16.preheader
%sub41 = add nsw i64 %1, -1
%arrayidx42 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %sub41
%5 = load i32, ptr %arrayidx42, align 4, !tbaa !8
%6 = trunc i64 %sub41 to i32
%sub30.neg.peel = sub i32 %6, %5
%conv33.peel = add i32 %sub30.neg.peel, %cond
%7 = call i32 @llvm.smin.i32(i32 %conv33.peel, i32 300000)
%spec.select.peel = sext i32 %7 to i64
%exitcond89.peel.not = icmp eq i64 %1, 1
br i1 %exitcond89.peel.not, label %for.end58, label %if.end.preheader
if.end.preheader: ; preds = %if.end.peel
%8 = add i64 %1, -1
%min.iters.check = icmp ult i64 %1, 5
br i1 %min.iters.check, label %if.end.preheader98, label %vector.ph
vector.ph: ; preds = %if.end.preheader
%n.vec = and i64 %8, -4
%ind.end = or i64 %n.vec, 1
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %spec.select.peel, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %1, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert94 = insertelement <2 x i32> poison, i32 %5, i64 0
%broadcast.splat95 = shufflevector <2 x i32> %broadcast.splatinsert94, <2 x i32> 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.ind = phi <2 x i64> [ <i64 1, i64 2>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %26, %vector.body ]
%vec.phi92 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %27, %vector.body ]
%offset.idx = or i64 %index, 1
%9 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <2 x i32>, ptr %9, align 16, !tbaa !8
%10 = getelementptr inbounds i32, ptr %9, i64 2
%wide.load93 = load <2 x i32>, ptr %10, align 8, !tbaa !8
%11 = xor <2 x i64> %vec.ind, <i64 -1, i64 -1>
%12 = add <2 x i64> %broadcast.splat, %11
%reass.sub = sub <2 x i64> %broadcast.splat, %vec.ind
%13 = trunc <2 x i64> %12 to <2 x i32>
%14 = trunc <2 x i64> %reass.sub to <2 x i32>
%15 = add <2 x i32> %14, <i32 -3, i32 -3>
%16 = add <2 x i32> %wide.load, %13
%17 = add <2 x i32> %wide.load93, %15
%18 = sub <2 x i32> %16, %broadcast.splat95
%19 = sub <2 x i32> %17, %broadcast.splat95
%20 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %offset.idx
%wide.load96 = load <2 x i32>, ptr %20, align 4, !tbaa !8
%21 = getelementptr inbounds i32, ptr %20, i64 2
%wide.load97 = load <2 x i32>, ptr %21, align 4, !tbaa !8
%22 = add <2 x i32> %18, %wide.load96
%23 = add <2 x i32> %19, %wide.load97
%24 = sext <2 x i32> %22 to <2 x i64>
%25 = sext <2 x i32> %23 to <2 x i64>
%26 = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %24)
%27 = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi92, <2 x i64> %25)
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%28 = icmp eq i64 %index.next, %n.vec
br i1 %28, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%rdx.minmax = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %26, <2 x i64> %27)
%29 = call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %8, %n.vec
br i1 %cmp.n, label %for.end58, label %if.end.preheader98
if.end.preheader98: ; preds = %if.end.preheader, %middle.block
%indvars.iv85.ph = phi i64 [ 1, %if.end.preheader ], [ %ind.end, %middle.block ]
%ans.080.ph = phi i64 [ %spec.select.peel, %if.end.preheader ], [ %29, %middle.block ]
br label %if.end
for.body: ; preds = %for.body, %for.body.preheader.new
%30 = phi i32 [ %cond, %for.body.preheader.new ], [ %add.1, %for.body ]
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx9 = getelementptr inbounds [300010 x i8], ptr %s, i64 0, i64 %indvars.iv
%31 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%cmp11 = icmp eq i8 %31, 87
%cond13 = zext i1 %cmp11 to i32
%add = add nuw nsw i32 %30, %cond13
%arrayidx15 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 %add, ptr %arrayidx15, align 4, !tbaa !8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx9.1 = getelementptr inbounds [300010 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%32 = load i8, ptr %arrayidx9.1, align 1, !tbaa !5
%cmp11.1 = icmp eq i8 %32, 87
%cond13.1 = zext i1 %cmp11.1 to i32
%add.1 = add nuw nsw i32 %add, %cond13.1
%arrayidx15.1 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %indvars.iv.next
store i32 %add.1, ptr %arrayidx15.1, align 4, !tbaa !8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond16.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !17
if.end: ; preds = %if.end.preheader98, %if.end
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %if.end ], [ %indvars.iv85.ph, %if.end.preheader98 ]
%ans.080 = phi i64 [ %spec.select, %if.end ], [ %ans.080.ph, %if.end.preheader98 ]
%33 = add nsw i64 %indvars.iv85, -1
%arrayidx36 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %33
%34 = load i32, ptr %arrayidx36, align 4, !tbaa !8
%35 = xor i64 %indvars.iv85, -1
%sub40 = add i64 %1, %35
%36 = trunc i64 %sub40 to i32
%sub45.neg = add i32 %34, %36
%37 = sub i32 %sub45.neg, %5
%arrayidx44 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %indvars.iv85
%38 = load i32, ptr %arrayidx44, align 4, !tbaa !8
%conv49 = add i32 %37, %38
%conv50 = sext i32 %conv49 to i64
%spec.select = call i64 @llvm.smin.i64(i64 %ans.080, i64 %conv50)
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%exitcond89.not = icmp eq i64 %indvars.iv.next86, %1
br i1 %exitcond89.not, label %for.end58, label %if.end, !llvm.loop !18
for.end58: ; preds = %if.end, %middle.block, %if.end.peel, %for.cond16.preheader
%ans.0.lcssa = phi i64 [ 300000, %for.cond16.preheader ], [ %spec.select.peel, %if.end.peel ], [ %29, %middle.block ], [ %spec.select, %if.end ]
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 300010, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
; 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 <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x 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 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = distinct !{!12, !13, !14, !15, !16}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.peeled.count", i32 1}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13, !14, !16, !15}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
int n, c = 0, ans = 300002, si[300002];
char s[300002];
if(scanf("%d", &n) == 1);
if(scanf("%s", s) == 1);
for(int i = 0; i < n; i++) {
if(s[i] == 'W') {
c++;
}
si[i] = c;
}
for(int i = 0; i < n; i++) {
if(i == 0) {
if(ans > n - si[n - 1]) {
ans = n - si[n - 1];
if(si[0] == 'W') {
ans++;
}
}
} else if(i == n - 1) {
if(ans > si[i - 1]) {
ans = si[i - 1];
}
} else {
if (ans > si[i - 1] + ((n - si[n - 1]) - (i + 1 - si[i]))) {
ans = si[i - 1] + ((n - si[n - 1]) - (i + 1 - si[i]));
}
}
}
printf("%d", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121049/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121049/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%si = alloca [300002 x i32], align 16
%s = alloca [300002 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 1200008, ptr nonnull %si) #4
call void @llvm.lifetime.start.p0(i64 300002, ptr nonnull %s) #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 %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp5112 = icmp sgt i32 %0, 0
br i1 %cmp5112, label %for.body.preheader, label %for.cond.cleanup17
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %0, 1
br i1 %1, label %for.cond14.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.cond14.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%c.0113.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond14.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond14.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [300002 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%2 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%cmp6.epil = icmp eq i8 %2, 87
%inc.epil = zext i1 %cmp6.epil to i32
%spec.select.epil = add nuw nsw i32 %c.0113.unr, %inc.epil
%arrayidx11.epil = getelementptr inbounds [300002 x i32], ptr %si, i64 0, i64 %indvars.iv.unr
store i32 %spec.select.epil, ptr %arrayidx11.epil, align 4, !tbaa !5
br label %for.cond14.preheader
for.cond14.preheader: ; preds = %for.cond14.preheader.unr-lcssa, %for.body.epil
br i1 %cmp5112, label %for.inc85.peel, label %for.cond.cleanup17
for.inc85.peel: ; preds = %for.cond14.preheader
%sub39 = add nsw i32 %0, -1
%idxprom58 = zext i32 %sub39 to i64
%arrayidx59 = getelementptr inbounds [300002 x i32], ptr %si, i64 0, i64 %idxprom58
%3 = zext i32 %sub39 to i64
%wide.trip.count127 = zext i32 %0 to i64
%4 = load i32, ptr %si, align 16
%cmp33 = icmp eq i32 %4, 87
%inc36 = zext i1 %cmp33 to i32
%5 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%sub24.peel = sub nsw i32 %0, %5
%cmp25.peel = icmp slt i32 %sub24.peel, 300002
%spec.select109.peel = add nsw i32 %sub24.peel, %inc36
%spec.select119.peel = select i1 %cmp25.peel, i32 %spec.select109.peel, i32 300002
%exitcond128.peel.not = icmp eq i32 %0, 1
br i1 %exitcond128.peel.not, label %for.cond.cleanup17, label %for.body18.peel.next
for.body18.peel.next: ; preds = %for.inc85.peel
%6 = add nsw i64 %3, -1
%arrayidx45 = getelementptr inbounds [300002 x i32], ptr %si, i64 0, i64 %6
br label %if.else
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%c.0113 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [300002 x i8], ptr %s, i64 0, i64 %indvars.iv
%7 = load i8, ptr %arrayidx, align 2, !tbaa !9
%cmp6 = icmp eq i8 %7, 87
%inc = zext i1 %cmp6 to i32
%spec.select = add nuw nsw i32 %c.0113, %inc
%arrayidx11 = getelementptr inbounds [300002 x i32], ptr %si, i64 0, i64 %indvars.iv
store i32 %spec.select, ptr %arrayidx11, align 8, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [300002 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%8 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%cmp6.1 = icmp eq i8 %8, 87
%inc.1 = zext i1 %cmp6.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%arrayidx11.1 = getelementptr inbounds [300002 x i32], ptr %si, i64 0, i64 %indvars.iv.next
store i32 %spec.select.1, ptr %arrayidx11.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond14.preheader.unr-lcssa, label %for.body, !llvm.loop !10
for.cond.cleanup17: ; preds = %for.inc85, %entry, %for.inc85.peel, %for.cond14.preheader
%ans.0.lcssa = phi i32 [ 300002, %for.cond14.preheader ], [ %spec.select119.peel, %for.inc85.peel ], [ 300002, %entry ], [ %spec.select111, %for.inc85 ]
%call88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 300002, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 1200008, ptr nonnull %si) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
if.else: ; preds = %for.inc85, %for.body18.peel.next
%indvars.iv121 = phi i64 [ 1, %for.body18.peel.next ], [ %indvars.iv.next122, %for.inc85 ]
%ans.0116 = phi i32 [ %spec.select119.peel, %for.body18.peel.next ], [ %spec.select111, %for.inc85 ]
%cmp40 = icmp eq i64 %indvars.iv121, %3
br i1 %cmp40, label %if.then42, label %if.else53
if.then42: ; preds = %if.else
%9 = load i32, ptr %arrayidx45, align 4, !tbaa !5
br label %for.inc85
if.else53: ; preds = %if.else
%10 = add nsw i64 %indvars.iv121, -1
%arrayidx56 = getelementptr inbounds [300002 x i32], ptr %si, i64 0, i64 %10
%11 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%arrayidx62 = getelementptr inbounds [300002 x i32], ptr %si, i64 0, i64 %indvars.iv121
%13 = load i32, ptr %arrayidx62, align 4, !tbaa !5
%14 = trunc i64 %indvars.iv121 to i32
%15 = xor i32 %14, -1
%sub63.neg = add i32 %0, %15
%sub60 = add i32 %sub63.neg, %11
%sub64 = sub i32 %sub60, %12
%add65 = add i32 %sub64, %13
br label %for.inc85
for.inc85: ; preds = %if.else53, %if.then42
%add65.sink = phi i32 [ %add65, %if.else53 ], [ %9, %if.then42 ]
%spec.select111 = call i32 @llvm.smin.i32(i32 %ans.0116, i32 %add65.sink)
%indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
%exitcond128.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count127
br i1 %exitcond128.not, label %for.cond.cleanup17, label %if.else, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
int main(void){
long int N;
scanf("%d",&N);
char S[N+1];
scanf("%s",S);
int ans=N;
int i,j;
int count;
for(i=0;i<N;i++){
if(S[i] =='E') count++;
}
for(i=0;i<N;i++){
if(S[i] =='E') count--;
if(S[i-1] =='W') count++;
if(count <= ans) ans=count;
}
printf("%d",ans);
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121092/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121092/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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
%add = add nsw i64 %0, 1
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %add, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%2 = load i64, ptr %N, align 8, !tbaa !5
%conv = trunc i64 %2 to i32
%cmp48 = icmp sgt i64 %2, 0
br i1 %cmp48, label %for.body.preheader, label %for.end34
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %2, 8
br i1 %min.iters.check, label %for.body.preheader67, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %2, -8
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 undef, i32 0, i32 0, i32 0>, %vector.ph ], [ %9, %vector.body ]
%vec.phi65 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%3 = getelementptr inbounds i8, ptr %vla, i64 %index
%wide.load = load <4 x i8>, ptr %3, align 8, !tbaa !9
%4 = getelementptr inbounds i8, ptr %3, i64 4
%wide.load66 = load <4 x i8>, ptr %4, align 4, !tbaa !9
%5 = icmp eq <4 x i8> %wide.load, <i8 69, i8 69, i8 69, i8 69>
%6 = icmp eq <4 x i8> %wide.load66, <i8 69, i8 69, i8 69, i8 69>
%7 = zext <4 x i1> %5 to <4 x i32>
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = add <4 x i32> %vec.phi, %7
%10 = add <4 x i32> %vec.phi65, %8
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %10, %9
%12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.cond8.preheader, label %for.body.preheader67
for.body.preheader67: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%count.050.ph = phi i32 [ undef, %for.body.preheader ], [ %12, %middle.block ]
br label %for.body
for.cond8.preheader: ; preds = %for.body, %middle.block
%spec.select.lcssa = phi i32 [ %12, %middle.block ], [ %spec.select, %for.body ]
br i1 %cmp48, label %for.body12.preheader, label %for.end34
for.body12.preheader: ; preds = %for.cond8.preheader
%arrayidx21.phi.trans.insert = getelementptr inbounds i8, ptr %vla, i64 -1
%.pre = load i8, ptr %arrayidx21.phi.trans.insert, align 1, !tbaa !9
%xtraiter = and i64 %2, 1
%13 = icmp eq i64 %2, 1
br i1 %13, label %for.end34.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %2, -2
br label %for.body12
for.body: ; preds = %for.body.preheader67, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader67 ]
%count.050 = phi i32 [ %spec.select, %for.body ], [ %count.050.ph, %for.body.preheader67 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%14 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp5 = icmp eq i8 %14, 69
%inc = zext i1 %cmp5 to i32
%spec.select = add nsw i32 %count.050, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %2
br i1 %exitcond.not, label %for.cond8.preheader, label %for.body, !llvm.loop !14
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%15 = phi i8 [ %.pre, %for.body12.preheader.new ], [ %17, %for.body12 ]
%indvars.iv59 = phi i64 [ 0, %for.body12.preheader.new ], [ %indvars.iv.next60.1, %for.body12 ]
%count.255 = phi i32 [ %spec.select.lcssa, %for.body12.preheader.new ], [ %count.4.1, %for.body12 ]
%ans.053 = phi i32 [ %conv, %for.body12.preheader.new ], [ %ans.1.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%arrayidx14 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv59
%16 = load i8, ptr %arrayidx14, align 2, !tbaa !9
%cmp16 = icmp eq i8 %16, 69
%dec = sext i1 %cmp16 to i32
%spec.select47 = add nsw i32 %count.255, %dec
%cmp23 = icmp eq i8 %15, 87
%inc26 = zext i1 %cmp23 to i32
%count.4 = add nsw i32 %spec.select47, %inc26
%ans.1 = call i32 @llvm.smin.i32(i32 %count.4, i32 %ans.053)
%indvars.iv.next60 = or i64 %indvars.iv59, 1
%arrayidx14.1 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.next60
%17 = load i8, ptr %arrayidx14.1, align 1, !tbaa !9
%cmp16.1 = icmp eq i8 %17, 69
%dec.1 = sext i1 %cmp16.1 to i32
%spec.select47.1 = add nsw i32 %count.4, %dec.1
%cmp23.1 = icmp eq i8 %16, 87
%inc26.1 = zext i1 %cmp23.1 to i32
%count.4.1 = add nsw i32 %spec.select47.1, %inc26.1
%ans.1.1 = call i32 @llvm.smin.i32(i32 %count.4.1, i32 %ans.1)
%indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59, 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.end34.loopexit.unr-lcssa, label %for.body12, !llvm.loop !15
for.end34.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%ans.1.lcssa.ph = phi i32 [ undef, %for.body12.preheader ], [ %ans.1.1, %for.body12 ]
%.unr = phi i8 [ %.pre, %for.body12.preheader ], [ %17, %for.body12 ]
%indvars.iv59.unr = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next60.1, %for.body12 ]
%count.255.unr = phi i32 [ %spec.select.lcssa, %for.body12.preheader ], [ %count.4.1, %for.body12 ]
%ans.053.unr = phi i32 [ %conv, %for.body12.preheader ], [ %ans.1.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end34, label %for.body12.epil
for.body12.epil: ; preds = %for.end34.loopexit.unr-lcssa
%arrayidx14.epil = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv59.unr
%18 = load i8, ptr %arrayidx14.epil, align 1, !tbaa !9
%cmp16.epil = icmp eq i8 %18, 69
%dec.epil = sext i1 %cmp16.epil to i32
%spec.select47.epil = add nsw i32 %count.255.unr, %dec.epil
%cmp23.epil = icmp eq i8 %.unr, 87
%inc26.epil = zext i1 %cmp23.epil to i32
%count.4.epil = add nsw i32 %spec.select47.epil, %inc26.epil
%ans.1.epil = call i32 @llvm.smin.i32(i32 %count.4.epil, i32 %ans.053.unr)
br label %for.end34
for.end34: ; preds = %for.body12.epil, %for.end34.loopexit.unr-lcssa, %entry, %for.cond8.preheader
%ans.0.lcssa = phi i32 [ %conv, %for.cond8.preheader ], [ %conv, %entry ], [ %ans.1.lcssa.ph, %for.end34.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body12.epil ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11}
|
#include <stdio.h>
#include <stdlib.h>
int compare(const void *x, const void *y)
{
if (*(long*)x < *(long*)y) return 1;
if (*(long*)x > *(long*)y) return -1;
return 0;
}
void calc(long A, long *ans, int *tmp, int *i)
{
if (*tmp == 0) *ans = A;
else *ans *= A;
++*tmp;
++*i;
}
int main(void)
{
int N, tmp = 0, i;
long A[100000], ans;
scanf("%d", &N);
for (i = 0; i < N; ++i) scanf("%ld", &A[i]);
qsort(A, N, sizeof(long), compare);
for (i = 0; i < N - 1 && tmp != 2; ++i) {
if (A[i] == A[i + 1]) calc(A[i], &ans, &tmp, &i);
}
if (tmp == 2) printf("%ld", ans);
else puts("0");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121135/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121135/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 {
entry:
%0 = load i64, ptr %x, align 8, !tbaa !5
%1 = load i64, ptr %y, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt 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: readwrite) uwtable
define dso_local void @calc(i64 noundef %A, ptr nocapture noundef %ans, ptr nocapture noundef %tmp, ptr nocapture noundef %i) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr %tmp, align 4, !tbaa !9
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %if.end, label %if.else
if.else: ; preds = %entry
%1 = load i64, ptr %ans, align 8, !tbaa !5
%mul = mul nsw i64 %1, %A
br label %if.end
if.end: ; preds = %entry, %if.else
%storemerge = phi i64 [ %mul, %if.else ], [ %A, %entry ]
store i64 %storemerge, ptr %ans, align 8, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr %tmp, align 4, !tbaa !9
%2 = load i32, ptr %i, align 4, !tbaa !9
%inc1 = add nsw i32 %2, 1
store i32 %inc1, ptr %i, align 4, !tbaa !9
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i32, align 4
%A = alloca [100000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !9
%cmp33 = icmp sgt i32 %0, 0
br i1 %cmp33, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre43 = 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 i64], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !9
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre43, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull %A, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @compare) #6
%3 = load i32, ptr %N, align 4, !tbaa !9
%sub = add nsw i32 %3, -1
%cmp335 = icmp sgt i32 %3, 1
br i1 %cmp335, label %for.body7, label %if.else
for.body7: ; preds = %for.end, %for.inc16
%storemerge2838 = phi i32 [ %inc17.pre-phi, %for.inc16 ], [ 0, %for.end ]
%ans.037 = phi i64 [ %ans.1, %for.inc16 ], [ undef, %for.end ]
%tmp.036 = phi i32 [ %tmp.1, %for.inc16 ], [ 0, %for.end ]
%idxprom8 = sext i32 %storemerge2838 to i64
%arrayidx9 = getelementptr inbounds [100000 x i64], ptr %A, i64 0, i64 %idxprom8
%4 = load i64, ptr %arrayidx9, align 8, !tbaa !5
%add = add nsw i32 %storemerge2838, 1
%idxprom10 = sext i32 %add to i64
%arrayidx11 = getelementptr inbounds [100000 x i64], ptr %A, i64 0, i64 %idxprom10
%5 = load i64, ptr %arrayidx11, align 8, !tbaa !5
%cmp12 = icmp eq i64 %4, %5
br i1 %cmp12, label %if.then, label %for.inc16
if.then: ; preds = %for.body7
%cmp.i = icmp eq i32 %tmp.036, 0
%mul.i = select i1 %cmp.i, i64 1, i64 %ans.037
%spec.select = mul nsw i64 %4, %mul.i
%inc.i = add nsw i32 %tmp.036, 1
%.pre = add nsw i32 %storemerge2838, 2
br label %for.inc16
for.inc16: ; preds = %for.body7, %if.then
%inc17.pre-phi = phi i32 [ %add, %for.body7 ], [ %.pre, %if.then ]
%tmp.1 = phi i32 [ %tmp.036, %for.body7 ], [ %inc.i, %if.then ]
%ans.1 = phi i64 [ %ans.037, %for.body7 ], [ %spec.select, %if.then ]
%cmp3 = icmp slt i32 %inc17.pre-phi, %sub
%cmp5 = icmp ne i32 %tmp.1, 2
%6 = select i1 %cmp3, i1 %cmp5, i1 false
br i1 %6, label %for.body7, label %for.end18, !llvm.loop !13
for.end18: ; preds = %for.inc16
%7 = icmp eq i32 %tmp.1, 2
br i1 %7, label %if.then21, label %if.else
if.then21: ; preds = %for.end18
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.1)
br label %if.end24
if.else: ; preds = %for.end, %for.end18
%call23 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end24
if.end24: ; preds = %if.else, %if.then21
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
#include <string.h>
int main()
{
char s[100];
int i;
long long k, ans = 0;
scanf("%s %lld", s, &k);
int len = strlen(s);
int cnt = 1, a = 1, b = 1;
for (i = 1; i < len; i++) {
if (s[i - 1] != s[i])break;
a++;
}
if (i == len)
{
printf("%lld", k * len / 2);
}
else
{
for (i = 1; i < len; i++)
{
if (s[i - 1] == s[i])cnt++;
else
{
ans += cnt / 2;
cnt = 1;
}
}
ans += cnt / 2;
if (s[0] == s[len - 1])
{
for (i = len - 1; i > 0; i--)
{
if (s[i - 1] != s[i])break;
b++;
}
printf("%lld", k * ans - (a / 2 + b / 2 - (a + b) / 2) * (k - 1));
}
else
{
printf("%lld", k * ans);
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121179/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121179/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%s %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:
%s = alloca [100 x i8], align 16
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %k)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%conv = trunc i64 %call2 to i32
%cmp115 = icmp sgt i32 %conv, 1
br i1 %cmp115, label %for.body.preheader, label %for.end.thread148
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
%.pre = load i8, ptr %s, align 16, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.preheader, %if.end
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %if.end ]
%arrayidx6 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8.not = icmp eq i8 %.pre, %0
br i1 %cmp8.not, label %if.end, label %for.end
if.end: ; 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 %if.then13, label %for.body, !llvm.loop !8
for.end: ; preds = %for.body
%indvars133.le = trunc i64 %indvars.iv to i32
%cmp11 = icmp eq i32 %indvars133.le, %conv
br i1 %cmp11, label %if.then13, label %for.cond16.preheader
for.end.thread148: ; preds = %entry
%cmp11150 = icmp eq i32 %conv, 1
br i1 %cmp11150, label %if.then13, label %for.end37.thread
for.cond16.preheader: ; preds = %for.end
br i1 %cmp115, label %for.body19.preheader, label %for.end37.thread
for.body19.preheader: ; preds = %for.cond16.preheader
%.pre143 = load i8, ptr %s, align 16, !tbaa !5
%1 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %1, 1
%2 = icmp eq i64 %wide.trip.count, 2
br i1 %2, label %for.end37.unr-lcssa, label %for.body19.preheader.new
for.body19.preheader.new: ; preds = %for.body19.preheader
%unroll_iter = and i64 %1, -2
br label %for.body19
if.then13: ; preds = %if.end, %for.end.thread148, %for.end
%3 = load i64, ptr %k, align 8, !tbaa !10
%sext = shl i64 %call2, 32
%conv14 = ashr exact i64 %sext, 32
%mul = mul nsw i64 %3, %conv14
%div = sdiv i64 %mul, 2
br label %if.end85
for.body19: ; preds = %for.inc35.1, %for.body19.preheader.new
%4 = phi i8 [ %.pre143, %for.body19.preheader.new ], [ %6, %for.inc35.1 ]
%indvars.iv136 = phi i64 [ 1, %for.body19.preheader.new ], [ %indvars.iv.next137.1, %for.inc35.1 ]
%cnt.0124 = phi i32 [ 1, %for.body19.preheader.new ], [ %cnt.1.1, %for.inc35.1 ]
%ans.0122 = phi i64 [ 0, %for.body19.preheader.new ], [ %ans.1.1, %for.inc35.1 ]
%niter = phi i64 [ 0, %for.body19.preheader.new ], [ %niter.next.1, %for.inc35.1 ]
%arrayidx25 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv136
%5 = load i8, ptr %arrayidx25, align 1, !tbaa !5
%cmp27 = icmp eq i8 %4, %5
br i1 %cmp27, label %if.then29, label %if.else31
if.then29: ; preds = %for.body19
%inc30 = add nsw i32 %cnt.0124, 1
br label %for.inc35
if.else31: ; preds = %for.body19
%div32 = sdiv i32 %cnt.0124, 2
%conv33 = sext i32 %div32 to i64
%add = add nsw i64 %ans.0122, %conv33
br label %for.inc35
for.inc35: ; preds = %if.then29, %if.else31
%ans.1 = phi i64 [ %ans.0122, %if.then29 ], [ %add, %if.else31 ]
%cnt.1 = phi i32 [ %inc30, %if.then29 ], [ 1, %if.else31 ]
%indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
%arrayidx25.1 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next137
%6 = load i8, ptr %arrayidx25.1, align 1, !tbaa !5
%cmp27.1 = icmp eq i8 %5, %6
br i1 %cmp27.1, label %if.then29.1, label %if.else31.1
if.else31.1: ; preds = %for.inc35
%div32.1 = sdiv i32 %cnt.1, 2
%conv33.1 = sext i32 %div32.1 to i64
%add.1 = add nsw i64 %ans.1, %conv33.1
br label %for.inc35.1
if.then29.1: ; preds = %for.inc35
%inc30.1 = add nsw i32 %cnt.1, 1
br label %for.inc35.1
for.inc35.1: ; preds = %if.then29.1, %if.else31.1
%ans.1.1 = phi i64 [ %ans.1, %if.then29.1 ], [ %add.1, %if.else31.1 ]
%cnt.1.1 = phi i32 [ %inc30.1, %if.then29.1 ], [ 1, %if.else31.1 ]
%indvars.iv.next137.1 = add nuw nsw i64 %indvars.iv136, 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.end37.unr-lcssa, label %for.body19, !llvm.loop !12
for.end37.unr-lcssa: ; preds = %for.inc35.1, %for.body19.preheader
%ans.1.lcssa.ph = phi i64 [ undef, %for.body19.preheader ], [ %ans.1.1, %for.inc35.1 ]
%cnt.1.lcssa.ph = phi i32 [ undef, %for.body19.preheader ], [ %cnt.1.1, %for.inc35.1 ]
%.unr = phi i8 [ %.pre143, %for.body19.preheader ], [ %6, %for.inc35.1 ]
%indvars.iv136.unr = phi i64 [ 1, %for.body19.preheader ], [ %indvars.iv.next137.1, %for.inc35.1 ]
%cnt.0124.unr = phi i32 [ 1, %for.body19.preheader ], [ %cnt.1.1, %for.inc35.1 ]
%ans.0122.unr = phi i64 [ 0, %for.body19.preheader ], [ %ans.1.1, %for.inc35.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end37, label %for.body19.epil
for.body19.epil: ; preds = %for.end37.unr-lcssa
%arrayidx25.epil = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv136.unr
%7 = load i8, ptr %arrayidx25.epil, align 1, !tbaa !5
%cmp27.epil = icmp eq i8 %.unr, %7
br i1 %cmp27.epil, label %if.then29.epil, label %if.else31.epil
if.else31.epil: ; preds = %for.body19.epil
%div32.epil = sdiv i32 %cnt.0124.unr, 2
%conv33.epil = sext i32 %div32.epil to i64
%add.epil = add nsw i64 %ans.0122.unr, %conv33.epil
br label %for.end37
if.then29.epil: ; preds = %for.body19.epil
%inc30.epil = add nsw i32 %cnt.0124.unr, 1
br label %for.end37
for.end37: ; preds = %if.else31.epil, %if.then29.epil, %for.end37.unr-lcssa
%ans.1.lcssa = phi i64 [ %ans.1.lcssa.ph, %for.end37.unr-lcssa ], [ %ans.0122.unr, %if.then29.epil ], [ %add.epil, %if.else31.epil ]
%cnt.1.lcssa = phi i32 [ %cnt.1.lcssa.ph, %for.end37.unr-lcssa ], [ %inc30.epil, %if.then29.epil ], [ 1, %if.else31.epil ]
%8 = sdiv i32 %cnt.1.lcssa, 2
%9 = sext i32 %8 to i64
%10 = add nsw i64 %ans.1.lcssa, %9
%sub43 = add nsw i32 %conv, -1
%idxprom44 = sext i32 %sub43 to i64
%arrayidx45 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom44
%11 = load i8, ptr %arrayidx45, align 1, !tbaa !5
%cmp47 = icmp eq i8 %.pre143, %11
br i1 %cmp47, label %for.cond51.preheader, label %if.else81
for.end37.thread: ; preds = %for.cond16.preheader, %for.end.thread148
%i.0.lcssa151154 = phi i32 [ %indvars133.le, %for.cond16.preheader ], [ 1, %for.end.thread148 ]
%.pre144 = load i8, ptr %s, align 16, !tbaa !5
%sub43157 = shl i64 %call2, 32
%sext171 = add i64 %sub43157, -4294967296
%idxprom44158 = ashr exact i64 %sext171, 32
%arrayidx45159 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom44158
%12 = load i8, ptr %arrayidx45159, align 1, !tbaa !5
%cmp47160 = icmp eq i8 %.pre144, %12
br i1 %cmp47160, label %for.end68, label %if.else81
for.cond51.preheader: ; preds = %for.end37
br i1 %cmp115, label %for.body54.preheader, label %for.end68
for.body54.preheader: ; preds = %for.cond51.preheader
%idxprom59.phi.trans.insert = zext i32 %sub43 to i64
%arrayidx60.phi.trans.insert = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom59.phi.trans.insert
%.pre145 = load i8, ptr %arrayidx60.phi.trans.insert, align 1, !tbaa !5
br label %for.body54
for.body54: ; preds = %for.body54.preheader, %if.end65
%b.0129 = phi i32 [ %inc66, %if.end65 ], [ 1, %for.body54.preheader ]
%i.2128 = phi i32 [ %sub55, %if.end65 ], [ %sub43, %for.body54.preheader ]
%sub55 = add nsw i32 %i.2128, -1
%idxprom56 = zext i32 %sub55 to i64
%arrayidx57 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom56
%13 = load i8, ptr %arrayidx57, align 1, !tbaa !5
%cmp62.not = icmp eq i8 %13, %.pre145
br i1 %cmp62.not, label %if.end65, label %for.end68
if.end65: ; preds = %for.body54
%inc66 = add nuw i32 %b.0129, 1
%exitcond142.not = icmp eq i32 %inc66, %conv
br i1 %exitcond142.not, label %for.end68, label %for.body54, !llvm.loop !13
for.end68: ; preds = %if.end65, %for.body54, %for.end37.thread, %for.cond51.preheader
%i.0.lcssa151153161169 = phi i32 [ %indvars133.le, %for.cond51.preheader ], [ %i.0.lcssa151154, %for.end37.thread ], [ %indvars133.le, %for.body54 ], [ %indvars133.le, %if.end65 ]
%add40163168 = phi i64 [ %10, %for.cond51.preheader ], [ 0, %for.end37.thread ], [ %10, %for.body54 ], [ %10, %if.end65 ]
%b.0.lcssa = phi i32 [ 1, %for.cond51.preheader ], [ 1, %for.end37.thread ], [ %conv, %if.end65 ], [ %b.0129, %for.body54 ]
%14 = load i64, ptr %k, align 8, !tbaa !10
%mul69 = mul nsw i64 %14, %add40163168
%div70112 = lshr i32 %i.0.lcssa151153161169, 1
%div71113 = lshr i32 %b.0.lcssa, 1
%add72 = add nuw nsw i32 %div71113, %div70112
%add73 = add nuw nsw i32 %b.0.lcssa, %i.0.lcssa151153161169
%div74114 = lshr i32 %add73, 1
%sub75 = sub nsw i32 %add72, %div74114
%conv76 = sext i32 %sub75 to i64
%sub77 = add nsw i64 %14, -1
%mul78 = mul nsw i64 %sub77, %conv76
%sub79 = sub nsw i64 %mul69, %mul78
br label %if.end85
if.else81: ; preds = %for.end37.thread, %for.end37
%add40162 = phi i64 [ 0, %for.end37.thread ], [ %10, %for.end37 ]
%15 = load i64, ptr %k, align 8, !tbaa !10
%mul82 = mul nsw i64 %15, %add40162
br label %if.end85
if.end85: ; preds = %for.end68, %if.else81, %if.then13
%sub79.sink = phi i64 [ %sub79, %for.end68 ], [ %mul82, %if.else81 ], [ %div, %if.then13 ]
%call80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub79.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !6, i64 0}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef long long ll;
int max(int a, int b){
if(a > b) return a;
else return b;
}
int min(int a, int b){
if(a < b) return a;
else return b;
}
ll n;
void func(ll cur, int use, ll *counter){
if(cur > n) return;
if(use == 0b111) ++(*counter);
func(cur*10 + 3, use | 0b001, counter);
func(cur*10 + 5, use | 0b010, counter);
func(cur*10 + 7, use | 0b100, counter);
}
int main(){
scanf("%d",&n);
ll *res_ptr;
ll res = 0;
res_ptr = &res;
func(0, 0, res_ptr);
printf("%d",res);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121229/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121229/source.c"
target datalayout = "e-m:e-p270: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 i64 0, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: 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: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @func(i64 noundef %cur, i32 noundef %use, ptr noundef %counter) local_unnamed_addr #1 {
entry:
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp19 = icmp slt i64 %0, %cur
br i1 %cmp19, label %return, label %if.end.preheader
if.end.preheader: ; preds = %entry
%cmp1.peel = icmp eq i32 %use, 7
br i1 %cmp1.peel, label %if.then2.peel, label %if.end3.peel
if.then2.peel: ; preds = %if.end.preheader
%1 = load i64, ptr %counter, align 8, !tbaa !5
%inc.peel = add nsw i64 %1, 1
store i64 %inc.peel, ptr %counter, align 8, !tbaa !5
br label %if.end3.peel
if.end3.peel: ; preds = %if.then2.peel, %if.end.preheader
%mul.peel = mul nsw i64 %cur, 10
%add.peel = add nsw i64 %mul.peel, 3
%or.peel = or i32 %use, 1
tail call void @func(i64 noundef %add.peel, i32 noundef %or.peel, ptr noundef %counter)
%add5.peel = add nsw i64 %mul.peel, 5
%or6.peel = or i32 %use, 2
tail call void @func(i64 noundef %add5.peel, i32 noundef %or6.peel, ptr noundef %counter)
%add8.peel = add nsw i64 %mul.peel, 7
%2 = load i64, ptr @n, align 8, !tbaa !5
%cmp.peel = icmp slt i64 %2, %add8.peel
br i1 %cmp.peel, label %return, label %if.end.peel.next
if.end.peel.next: ; preds = %if.end3.peel
%3 = and i32 %use, -5
%cmp1 = icmp eq i32 %3, 3
%or = or i32 %use, 5
%or6 = or i32 %use, 6
br label %if.end
if.end: ; preds = %if.end.peel.next, %if.end3
%cur.tr20 = phi i64 [ %add8, %if.end3 ], [ %add8.peel, %if.end.peel.next ]
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
%4 = load i64, ptr %counter, align 8, !tbaa !5
%inc = add nsw i64 %4, 1
store i64 %inc, ptr %counter, align 8, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%mul = mul nsw i64 %cur.tr20, 10
%add = add nsw i64 %mul, 3
tail call void @func(i64 noundef %add, i32 noundef %or, ptr noundef %counter)
%add5 = add nsw i64 %mul, 5
tail call void @func(i64 noundef %add5, i32 noundef %or6, ptr noundef %counter)
%add8 = add nsw i64 %mul, 7
%5 = load i64, ptr @n, align 8, !tbaa !5
%cmp = icmp slt i64 %5, %add8
br i1 %cmp, label %return, label %if.end, !llvm.loop !9
return: ; preds = %if.end3, %if.end3.peel, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%res = alloca i64, align 8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %res) #6
store i64 0, ptr %res, align 8, !tbaa !5
call void @func(i64 noundef 0, i32 noundef 0, ptr noundef nonnull %res)
%0 = load i64, ptr %res, align 8, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %res) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
long long is753(long long n);
long long dfs(long long num);
long long n;
long long dn[] = {7, 5, 3};
long long main()
{
scanf("%lld", &n);
printf("%lld\n", dfs(0));
return 0;
}
long long is753(long long n)
{
long long cnt[10] = {};
while (n) {
cnt[n % 10]++;
n = n / 10;
}
return (cnt[3] && cnt[5] && cnt[7]);
}
long long dfs(long long num)
{
long long res = 0;
if (is753(num) && num <= n) {
res = 1;
} else if (num > n) {
return 0;
}
num = num * 10;
for (long long i = 0; i < 3; i++) {
res += dfs(num + dn[i]);
}
return res;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121272/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121272/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dn = dso_local local_unnamed_addr global [3 x i64] [i64 7, i64 5, i64 3], align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@n = dso_local global i64 0, align 8
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%call1 = tail call i64 @dfs(i64 noundef 0)
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %call1)
ret i64 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 nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @dfs(i64 noundef %num) local_unnamed_addr #2 {
entry:
%cnt.i = alloca [10 x i64], align 16
br label %tailrecurse
tailrecurse: ; preds = %if.end3, %entry
%accumulator.tr = phi i64 [ 0, %entry ], [ %add6.2, %if.end3 ]
%num.tr = phi i64 [ %num, %entry ], [ %add.2, %if.end3 ]
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %cnt.i) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %cnt.i, i8 0, i64 80, i1 false)
%tobool.not9.i = icmp eq i64 %num.tr, 0
br i1 %tobool.not9.i, label %is753.exit.thread, label %while.body.i
is753.exit.thread: ; preds = %tailrecurse
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %cnt.i) #6
%0 = load i64, ptr @n, align 8
%cmp.not16 = icmp slt i64 %0, 0
br i1 %cmp.not16, label %cleanup, label %if.end3
while.body.i: ; preds = %tailrecurse, %while.body.i
%n.addr.010.i = phi i64 [ %div.i, %while.body.i ], [ %num.tr, %tailrecurse ]
%rem.i = srem i64 %n.addr.010.i, 10
%arrayidx.i = getelementptr inbounds [10 x i64], ptr %cnt.i, i64 0, i64 %rem.i
%1 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%inc.i = add nsw i64 %1, 1
store i64 %inc.i, ptr %arrayidx.i, align 8, !tbaa !5
%div.i = sdiv i64 %n.addr.010.i, 10
%n.addr.010.off.i = add i64 %n.addr.010.i, 9
%tobool.not.i = icmp ult i64 %n.addr.010.off.i, 19
br i1 %tobool.not.i, label %is753.exit, label %while.body.i, !llvm.loop !9
is753.exit: ; preds = %while.body.i
%arrayidx1.phi.trans.insert.i = getelementptr inbounds [10 x i64], ptr %cnt.i, i64 0, i64 3
%.pre.i = load i64, ptr %arrayidx1.phi.trans.insert.i, align 8, !tbaa !5
%arrayidx3.phi.trans.insert.i = getelementptr inbounds [10 x i64], ptr %cnt.i, i64 0, i64 5
%.pre11.i = load i64, ptr %arrayidx3.phi.trans.insert.i, align 8
%arrayidx5.phi.trans.insert.i = getelementptr inbounds [10 x i64], ptr %cnt.i, i64 0, i64 7
%.pre12.i = load i64, ptr %arrayidx5.phi.trans.insert.i, align 8
%2 = icmp eq i64 %.pre.i, 0
%3 = icmp eq i64 %.pre11.i, 0
%.not20 = select i1 %2, i1 true, i1 %3
%4 = icmp eq i64 %.pre12.i, 0
%5 = select i1 %.not20, i1 true, i1 %4
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %cnt.i) #6
%6 = load i64, ptr @n, align 8
%cmp.not = icmp slt i64 %6, %num.tr
%or.cond = or i1 %5, %cmp.not
%or.cond.not = xor i1 %or.cond, true
%.mux = zext i1 %or.cond.not to i64
br i1 %cmp.not, label %cleanup, label %if.end3
if.end3: ; preds = %is753.exit, %is753.exit.thread
%res.0 = phi i64 [ %.mux, %is753.exit ], [ 0, %is753.exit.thread ]
%mul = mul nsw i64 %num.tr, 10
%7 = load i64, ptr @dn, align 16, !tbaa !5
%add = add nsw i64 %7, %mul
%call5 = tail call i64 @dfs(i64 noundef %add)
%add6 = add nsw i64 %call5, %res.0
%8 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @dn, i64 0, i64 1), align 8, !tbaa !5
%add.1 = add nsw i64 %8, %mul
%call5.1 = tail call i64 @dfs(i64 noundef %add.1)
%add6.1 = add nsw i64 %call5.1, %add6
%9 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @dn, i64 0, i64 2), align 16, !tbaa !5
%add.2 = add nsw i64 %9, %mul
%add6.2 = add nsw i64 %accumulator.tr, %add6.1
br label %tailrecurse
cleanup: ; preds = %is753.exit, %is753.exit.thread
%accumulator.ret.tr = add nsw i64 %accumulator.tr, 0
ret i64 %accumulator.ret.tr
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @is753(i64 noundef %n) local_unnamed_addr #3 {
entry:
%cnt = alloca [10 x i64], align 16
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %cnt) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %cnt, i8 0, i64 80, i1 false)
%tobool.not9 = icmp eq i64 %n, 0
br i1 %tobool.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%n.addr.010 = phi i64 [ %div, %while.body ], [ %n, %entry ]
%rem = srem i64 %n.addr.010, 10
%arrayidx = getelementptr inbounds [10 x i64], ptr %cnt, i64 0, i64 %rem
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%inc = add nsw i64 %0, 1
store i64 %inc, ptr %arrayidx, align 8, !tbaa !5
%div = sdiv i64 %n.addr.010, 10
%n.addr.010.off = add i64 %n.addr.010, 9
%tobool.not = icmp ult i64 %n.addr.010.off, 19
br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !9
while.end.loopexit: ; preds = %while.body
%arrayidx1.phi.trans.insert = getelementptr inbounds [10 x i64], ptr %cnt, i64 0, i64 3
%.pre = load i64, ptr %arrayidx1.phi.trans.insert, align 8, !tbaa !5
%arrayidx3.phi.trans.insert = getelementptr inbounds [10 x i64], ptr %cnt, i64 0, i64 5
%.pre11 = load i64, ptr %arrayidx3.phi.trans.insert, align 8
%arrayidx5.phi.trans.insert = getelementptr inbounds [10 x i64], ptr %cnt, i64 0, i64 7
%.pre12 = load i64, ptr %arrayidx5.phi.trans.insert, align 8
%1 = icmp ne i64 %.pre, 0
%2 = icmp ne i64 %.pre11, 0
%3 = select i1 %1, i1 %2, i1 false
%4 = icmp ne i64 %.pre12, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = zext i1 %5 to i64
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%tobool2 = phi i64 [ %6, %while.end.loopexit ], [ 0, %entry ]
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %cnt) #6
ret i64 %tobool2
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nofree nounwind "no-trapping-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(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int c,cont1=0,cont2=0,a=0,b=0;
for(int i=0;i<4;i++){
c = getchar();
if(a==0)a=c;
else if(c!=a && b==0)b=c;
else if(c==a)cont1++;
else if(c==b)cont2++;
}
if(cont1==1 && cont2==1)printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121366/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121366/source.c"
target datalayout = "e-m:e-p270: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"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 {
for.inc:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.1 = tail call i32 @getc(ptr noundef %1)
%cmp1.1 = icmp eq i32 %call.i, 0
br i1 %cmp1.1, label %for.inc.1, label %if.else.1
if.else.1: ; preds = %for.inc
%cmp2.1.not = icmp eq i32 %call.i.1, %call.i
%spec.select = zext i1 %cmp2.1.not to i32
%spec.select66 = select i1 %cmp2.1.not, i32 0, i32 %call.i.1
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.244 = tail call i32 @getc(ptr noundef %2)
br label %if.else.2
for.inc.1: ; preds = %for.inc
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.2 = tail call i32 @getc(ptr noundef %3)
%cmp1.2 = icmp eq i32 %call.i.1, 0
br i1 %cmp1.2, label %for.inc.2, label %if.else.2
if.else.2: ; preds = %if.else.1, %for.inc.1
%call.i.249 = phi i32 [ %call.i.244, %if.else.1 ], [ %call.i.2, %for.inc.1 ]
%b.1.148 = phi i32 [ %spec.select66, %if.else.1 ], [ 0, %for.inc.1 ]
%a.1.147 = phi i32 [ %call.i, %if.else.1 ], [ %call.i.1, %for.inc.1 ]
%cont1.1.146 = phi i32 [ %spec.select, %if.else.1 ], [ 0, %for.inc.1 ]
%cmp2.2 = icmp ne i32 %call.i.249, %a.1.147
%cmp3.2 = icmp eq i32 %b.1.148, 0
%or.cond.2 = and i1 %cmp2.2, %cmp3.2
br i1 %or.cond.2, label %for.inc.2.thread, label %if.else5.2
if.else5.2: ; preds = %if.else.2
%cmp6.2 = icmp eq i32 %call.i.249, %a.1.147
br i1 %cmp6.2, label %if.then7.2, label %if.else8.2
if.else8.2: ; preds = %if.else5.2
%cmp9.2 = icmp eq i32 %call.i.249, %b.1.148
%inc11.2 = zext i1 %cmp9.2 to i32
br label %for.inc.2.thread
if.then7.2: ; preds = %if.else5.2
%inc.2 = add nuw nsw i32 %cont1.1.146, 1
br label %for.inc.2.thread
for.inc.2.thread: ; preds = %if.then7.2, %if.else.2, %if.else8.2
%cont1.1.2.ph = phi i32 [ %cont1.1.146, %if.else8.2 ], [ %cont1.1.146, %if.else.2 ], [ %inc.2, %if.then7.2 ]
%cont2.1.2.ph = phi i32 [ %inc11.2, %if.else8.2 ], [ 0, %if.else.2 ], [ 0, %if.then7.2 ]
%b.1.2.ph = phi i32 [ %b.1.148, %if.else8.2 ], [ %call.i.249, %if.else.2 ], [ %b.1.148, %if.then7.2 ]
%4 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.354 = tail call i32 @getc(ptr noundef %4)
br label %if.else.3
for.inc.2: ; preds = %for.inc.1
%5 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.3 = tail call i32 @getc(ptr noundef %5)
%cmp1.3 = icmp eq i32 %call.i.2, 0
br i1 %cmp1.3, label %if.else21, label %if.else.3
if.else.3: ; preds = %for.inc.2.thread, %for.inc.2
%call.i.360 = phi i32 [ %call.i.354, %for.inc.2.thread ], [ %call.i.3, %for.inc.2 ]
%b.1.259 = phi i32 [ %b.1.2.ph, %for.inc.2.thread ], [ 0, %for.inc.2 ]
%a.1.258 = phi i32 [ %a.1.147, %for.inc.2.thread ], [ %call.i.2, %for.inc.2 ]
%cont2.1.257 = phi i32 [ %cont2.1.2.ph, %for.inc.2.thread ], [ 0, %for.inc.2 ]
%cont1.1.256 = phi i32 [ %cont1.1.2.ph, %for.inc.2.thread ], [ 0, %for.inc.2 ]
%cmp2.3 = icmp ne i32 %call.i.360, %a.1.258
%cmp3.3 = icmp eq i32 %b.1.259, 0
%or.cond.3 = and i1 %cmp2.3, %cmp3.3
br i1 %or.cond.3, label %for.inc.3, label %if.else5.3
if.else5.3: ; preds = %if.else.3
%cmp6.3 = icmp eq i32 %call.i.360, %a.1.258
br i1 %cmp6.3, label %if.then7.3, label %if.else8.3
if.else8.3: ; preds = %if.else5.3
%cmp9.3 = icmp eq i32 %call.i.360, %b.1.259
%inc11.3 = zext i1 %cmp9.3 to i32
%spec.select.3 = add nuw nsw i32 %cont2.1.257, %inc11.3
br label %for.inc.3
if.then7.3: ; preds = %if.else5.3
%inc.3 = add nuw nsw i32 %cont1.1.256, 1
br label %for.inc.3
for.inc.3: ; preds = %if.then7.3, %if.else8.3, %if.else.3
%cont1.1.3 = phi i32 [ %inc.3, %if.then7.3 ], [ %cont1.1.256, %if.else.3 ], [ %cont1.1.256, %if.else8.3 ]
%cont2.1.3 = phi i32 [ %cont2.1.257, %if.then7.3 ], [ %cont2.1.257, %if.else.3 ], [ %spec.select.3, %if.else8.3 ]
%cmp16 = icmp eq i32 %cont1.1.3, 1
%cmp18 = icmp eq i32 %cont2.1.3, 1
%or.cond24 = select i1 %cmp16, i1 %cmp18, i1 false
br i1 %or.cond24, label %if.end23, label %if.else21
if.else21: ; preds = %for.inc.2, %for.inc.3
br label %if.end23
if.end23: ; preds = %for.inc.3, %if.else21
%str.sink = phi ptr [ @str, %if.else21 ], [ @str.2, %for.inc.3 ]
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-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 }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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"}
|
#include<stdio.h>
int main(void)
{
int x=0,y=0,i,j;
char s[4];
scanf("%s", s);
for(i=1; i<4; i++)
{
if(s[0]==s[i])
x++;
else
{
for(j=i+1; j<4; j++)
{
if(s[i]==s[j])
y++;
}
}
}
if(x==1&&y==1)
printf("Yes\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121416/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121416/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp3 = icmp eq i8 %0, %1
br i1 %cmp3, label %for.inc21, label %for.body8.preheader
for.body8.preheader: ; preds = %entry
%arrayidx13 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx13, align 1, !tbaa !5
%cmp15 = icmp eq i8 %1, %2
%inc18 = zext i1 %cmp15 to i32
%arrayidx13.154 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx13.154, align 1, !tbaa !5
%cmp15.155 = icmp eq i8 %1, %3
%inc18.156 = zext i1 %cmp15.155 to i32
%spec.select.157 = add nuw nsw i32 %inc18, %inc18.156
br label %for.inc21
for.inc21: ; preds = %entry, %for.body8.preheader
%x.1 = phi i32 [ 0, %for.body8.preheader ], [ 1, %entry ]
%y.3 = phi i32 [ %spec.select.157, %for.body8.preheader ], [ 0, %entry ]
%arrayidx1.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%4 = load i8, ptr %arrayidx1.1, align 1, !tbaa !5
%cmp3.1 = icmp eq i8 %0, %4
br i1 %cmp3.1, label %if.then.1, label %for.body8.preheader.1
for.body8.preheader.1: ; preds = %for.inc21
%arrayidx13.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3
%5 = load i8, ptr %arrayidx13.1, align 1, !tbaa !5
%cmp15.1 = icmp eq i8 %4, %5
%inc18.1 = zext i1 %cmp15.1 to i32
%spec.select.1 = add nuw nsw i32 %y.3, %inc18.1
br label %for.inc21.1
if.then.1: ; preds = %for.inc21
%inc.1 = add nuw nsw i32 %x.1, 1
br label %for.inc21.1
for.inc21.1: ; preds = %if.then.1, %for.body8.preheader.1
%x.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %x.1, %for.body8.preheader.1 ]
%y.3.1 = phi i32 [ %y.3, %if.then.1 ], [ %spec.select.1, %for.body8.preheader.1 ]
%arrayidx1.2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3
%6 = load i8, ptr %arrayidx1.2, align 1, !tbaa !5
%cmp3.2 = icmp eq i8 %0, %6
%inc.2 = zext i1 %cmp3.2 to i32
%spec.select = add nuw nsw i32 %x.1.1, %inc.2
%cmp24 = icmp eq i32 %spec.select, 1
%cmp26 = icmp eq i32 %y.3.1, 1
%or.cond = select i1 %cmp24, i1 %cmp26, i1 false
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main()
{
char str[4];
int count=0,i,j;
scanf("%s",str);
for(i=0;i<3;i++)
for(j=i+1;j<4;j++)
{
if(str[j]==str[i])
count++;
}
if(count==2)
printf("Yes");
else
printf("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121467/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121467/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 {
for.cond.loopexit.2:
%str = alloca [4 x i8], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%arrayidx = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 1
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx.137 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 2
%1 = load i8, ptr %arrayidx.137, align 2, !tbaa !5
%arrayidx.242 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 3
%2 = load i8, ptr %arrayidx.242, align 1, !tbaa !5
%3 = load <4 x i8>, ptr %str, align 4, !tbaa !5
%4 = extractelement <4 x i8> %3, i64 0
%cmp7 = icmp eq i8 %0, %4
%inc = zext i1 %cmp7 to i32
%cmp7.138 = icmp eq i8 %1, %4
%inc.139 = zext i1 %cmp7.138 to i32
%5 = insertelement <4 x i8> poison, i8 %2, i64 0
%6 = shufflevector <4 x i8> %5, <4 x i8> %3, <4 x i32> <i32 0, i32 7, i32 5, i32 poison>
%7 = insertelement <4 x i8> %6, i8 %1, i64 3
%8 = icmp eq <4 x i8> %3, %7
%9 = bitcast <4 x i1> %8 to i4
%10 = call i4 @llvm.ctpop.i4(i4 %9), !range !8
%11 = zext i4 %10 to i32
%op.rdx = add nuw nsw i32 %11, %inc.139
%op.rdx47 = add nuw nsw i32 %op.rdx, %inc
%cmp13 = icmp eq i32 %op.rdx47, 2
%.str.1..str.2 = select i1 %cmp13, ptr @.str.1, ptr @.str.2
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 i4 @llvm.ctpop.i4(i4) #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 = !{i4 0, i4 5}
|
#include <stdio.h>
int
main(){
char s[4];
int i;
char tmp[4];
int j=0;
scanf("%s",s);
static int cnt[4];
int k;
int l=0;
for(i=0;i<4;i++){
tmp[j]=s[i];
for(k=i+1;k<4;k++){
if(tmp[j]==s[k])cnt[l]++;
}
if(cnt[l]!=0)l++;
}
if(cnt[0]*cnt[1] == 1)printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121517/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121517/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@main.cnt = internal unnamed_addr global [4 x i32] zeroinitializer, align 16
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.body5.lr.ph:
%s = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%arrayidx9 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%cmp11 = icmp eq i8 %0, %1
br i1 %cmp11, label %if.then, label %for.inc
if.then: ; preds = %for.body5.lr.ph
%2 = load i32, ptr @main.cnt, align 16, !tbaa !8
%inc = add nsw i32 %2, 1
store i32 %inc, ptr @main.cnt, align 16, !tbaa !8
br label %for.inc
for.inc: ; preds = %for.body5.lr.ph, %if.then
%arrayidx9.152 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%3 = load i8, ptr %arrayidx9.152, align 1, !tbaa !5
%cmp11.153 = icmp eq i8 %0, %3
br i1 %cmp11.153, label %if.then.156, label %for.inc.157
if.then.156: ; preds = %for.inc
%4 = load i32, ptr @main.cnt, align 16, !tbaa !8
%inc.155 = add nsw i32 %4, 1
store i32 %inc.155, ptr @main.cnt, align 16, !tbaa !8
br label %for.inc.157
for.inc.157: ; preds = %if.then.156, %for.inc
%arrayidx9.258 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3
%5 = load i8, ptr %arrayidx9.258, align 1, !tbaa !5
%cmp11.259 = icmp eq i8 %0, %5
br i1 %cmp11.259, label %if.then.262, label %for.body5.lr.ph.1
if.then.262: ; preds = %for.inc.157
%6 = load i32, ptr @main.cnt, align 16, !tbaa !8
%inc.261 = add nsw i32 %6, 1
store i32 %inc.261, ptr @main.cnt, align 16, !tbaa !8
br label %for.body5.lr.ph.1
for.body5.lr.ph.1: ; preds = %if.then.262, %for.inc.157
%7 = load i32, ptr @main.cnt, align 16, !tbaa !8
%cmp18.not = icmp ne i32 %7, 0
%inc21 = zext i1 %cmp18.not to i64
%idxprom13.1 = zext i1 %cmp18.not to i64
%arrayidx14.1 = getelementptr inbounds [4 x i32], ptr @main.cnt, i64 0, i64 %idxprom13.1
%arrayidx9.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%8 = load i8, ptr %arrayidx9.1, align 1, !tbaa !5
%cmp11.1 = icmp eq i8 %1, %8
%.pre67.pre.pre = load i32, ptr %arrayidx14.1, align 4, !tbaa !8
br i1 %cmp11.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.body5.lr.ph.1
%inc.1 = add nsw i32 %.pre67.pre.pre, 1
store i32 %inc.1, ptr %arrayidx14.1, align 4, !tbaa !8
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.body5.lr.ph.1
%.pre67.pre = phi i32 [ %inc.1, %if.then.1 ], [ %.pre67.pre.pre, %for.body5.lr.ph.1 ]
%arrayidx9.1.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3
%9 = load i8, ptr %arrayidx9.1.1, align 1, !tbaa !5
%cmp11.1.1 = icmp eq i8 %1, %9
br i1 %cmp11.1.1, label %if.then.1.1, label %for.body5.lr.ph.2
if.then.1.1: ; preds = %for.inc.1
%inc.1.1 = add nsw i32 %.pre67.pre, 1
store i32 %inc.1.1, ptr %arrayidx14.1, align 4, !tbaa !8
br label %for.body5.lr.ph.2
for.body5.lr.ph.2: ; preds = %if.then.1.1, %for.inc.1
%.pre67 = phi i32 [ %inc.1.1, %if.then.1.1 ], [ %.pre67.pre, %for.inc.1 ]
%arrayidx9.2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3
%10 = load i8, ptr %arrayidx9.2, align 1, !tbaa !5
%cmp11.2 = icmp eq i8 %8, %10
br i1 %cmp11.2, label %if.then.2, label %for.end.3
if.then.2: ; preds = %for.body5.lr.ph.2
%cmp18.not.1 = icmp ne i32 %.pre67, 0
%inc21.1 = zext i1 %cmp18.not.1 to i64
%spec.select.1 = add nuw nsw i64 %inc21, %inc21.1
%arrayidx14.2 = getelementptr inbounds [4 x i32], ptr @main.cnt, i64 0, i64 %spec.select.1
%.pre68.pre = load i32, ptr %arrayidx14.2, align 4, !tbaa !8
%inc.2 = add nsw i32 %.pre68.pre, 1
store i32 %inc.2, ptr %arrayidx14.2, align 4, !tbaa !8
br label %for.end.3
for.end.3: ; preds = %if.then.2, %for.body5.lr.ph.2
%11 = load i32, ptr @main.cnt, align 16, !tbaa !8
%12 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @main.cnt, i64 0, i64 1), align 4, !tbaa !8
%mul = mul nsw i32 %12, %11
%cmp26 = icmp eq i32 %mul, 1
%str.3.str = select i1 %cmp26, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#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 repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
ll a[10];
char s[10];
int main(){
scanf("%s",s);
rep(i,0,4)a[i]=s[i];
sortup(a,4);
puts(a[0]==a[1]&&a[1]!=a[2]&&a[2]==a[3]?"Yes":"No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121560/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121560/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@s = dso_local global [10 x i8] zeroinitializer, align 1
@a = dso_local global [10 x i64] zeroinitializer, align 16
@.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: 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 norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @pom(i64 noundef %a, i64 noundef %n, i32 noundef %m) local_unnamed_addr #3 {
entry:
%conv = sext i32 %m to i64
%tobool.not16 = icmp eq i64 %n, 0
br i1 %tobool.not16, label %for.end, label %for.body
for.body: ; preds = %entry, %cond.end
%mul4.pn = phi i64 [ %mul4, %cond.end ], [ %a, %entry ]
%x.018 = phi i64 [ %x.1, %cond.end ], [ 1, %entry ]
%n.addr.017 = phi i64 [ %div, %cond.end ], [ %n, %entry ]
%a.addr.019 = srem i64 %mul4.pn, %conv
%and = and i64 %n.addr.017, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %cond.end, label %cond.true
cond.true: ; preds = %for.body
%mul = mul nsw i64 %a.addr.019, %x.018
%rem3 = srem i64 %mul, %conv
br label %cond.end
cond.end: ; preds = %for.body, %cond.true
%x.1 = phi i64 [ %rem3, %cond.true ], [ %x.018, %for.body ]
%mul4 = mul nsw i64 %a.addr.019, %a.addr.019
%div = sdiv i64 %n.addr.017, 2
%n.addr.017.off = add i64 %n.addr.017, 1
%tobool.not = icmp ult i64 %n.addr.017.off, 3
br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %cond.end, %entry
%x.0.lcssa = phi i64 [ 1, %entry ], [ %x.1, %cond.end ]
ret i64 %x.0.lcssa
}
; Function Attrs: 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 @s)
%0 = load i8, ptr @s, align 1, !tbaa !11
%conv = sext i8 %0 to i64
store i64 %conv, ptr @a, align 16, !tbaa !5
%1 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @s, i64 0, i64 1), align 1, !tbaa !11
%conv.1 = sext i8 %1 to i64
store i64 %conv.1, ptr getelementptr inbounds ([10 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !5
%2 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @s, i64 0, i64 2), align 1, !tbaa !11
%conv.2 = sext i8 %2 to i64
store i64 %conv.2, ptr getelementptr inbounds ([10 x i64], ptr @a, i64 0, i64 2), align 16, !tbaa !5
%3 = load i8, ptr getelementptr inbounds ([10 x i8], ptr @s, i64 0, i64 3), align 1, !tbaa !11
%conv.3 = sext i8 %3 to i64
store i64 %conv.3, ptr getelementptr inbounds ([10 x i64], ptr @a, i64 0, i64 3), align 8, !tbaa !5
tail call void @qsort(ptr noundef nonnull @a, i64 noundef 4, i64 noundef 8, ptr noundef nonnull @upll) #5
%4 = load i64, ptr @a, align 16, !tbaa !5
%5 = load i64, ptr getelementptr inbounds ([10 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !5
%cmp2 = icmp eq i64 %4, %5
br i1 %cmp2, label %land.lhs.true, label %land.end
land.lhs.true: ; preds = %entry
%6 = load i64, ptr getelementptr inbounds ([10 x i64], ptr @a, i64 0, i64 2), align 16, !tbaa !5
%cmp4.not = icmp eq i64 %4, %6
br i1 %cmp4.not, label %land.end, label %land.rhs
land.rhs: ; preds = %land.lhs.true
%7 = load i64, ptr getelementptr inbounds ([10 x i64], ptr @a, i64 0, i64 3), align 8, !tbaa !5
%cmp6 = icmp eq i64 %6, %7
%8 = select i1 %cmp6, ptr @.str.1, ptr @.str.2
br label %land.end
land.end: ; preds = %land.rhs, %land.lhs.true, %entry
%cond = phi ptr [ @.str.2, %land.lhs.true ], [ @.str.2, %entry ], [ %8, %land.rhs ]
%call8 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
|
#include <stdio.h>
int main(void){
char c1,c2,c3,c4;
scanf("%c %c %c %c",&c1,&c2,&c3,&c4);
if(c1==c2){
if(c1!=c3&&c3==c4)
printf("Yes\n");
else
printf("No\n");
}
else if(c1==c3){
if(c1!=c2&&c2==c4)
printf("Yes\n");
else
printf("No\n");
}
else if(c1==c4){
if(c1!=c2&&c2==c3)
printf("Yes\n");
else
printf("No\n");
}
else
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121610/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121610/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%c %c %c %c\00", align 1
@str.7 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.8 = 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:
%c1 = alloca i8, align 1
%c2 = alloca i8, align 1
%c3 = alloca i8, align 1
%c4 = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c1) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c2) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c3) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c4) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c1, ptr noundef nonnull %c2, ptr noundef nonnull %c3, ptr noundef nonnull %c4)
%0 = load i8, ptr %c1, align 1, !tbaa !5
%1 = load i8, ptr %c2, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
%2 = load i8, ptr %c3, align 1, !tbaa !5
%3 = load i8, ptr %c4, align 1
br i1 %cmp, label %if.then, label %if.else14
if.then: ; preds = %entry
%cmp5.not = icmp ne i8 %0, %2
%cmp9 = icmp eq i8 %2, %3
%or.cond = select i1 %cmp5.not, i1 %cmp9, i1 false
%str.8.str.7 = select i1 %or.cond, ptr @str.8, ptr @str.7
br label %if.end58
if.else14: ; preds = %entry
%cmp17 = icmp eq i8 %0, %2
br i1 %cmp17, label %if.then19, label %if.else34
if.then19: ; preds = %if.else14
%cmp27 = icmp eq i8 %1, %3
%str.6.str.5 = select i1 %cmp27, ptr @str.8, ptr @str.7
br label %if.end58
if.else34: ; preds = %if.else14
%cmp37 = icmp eq i8 %0, %3
br i1 %cmp37, label %if.then39, label %if.end58
if.then39: ; preds = %if.else34
%cmp47 = icmp eq i8 %1, %2
%str.4.str.3 = select i1 %cmp47, ptr @str.8, ptr @str.7
br label %if.end58
if.end58: ; preds = %if.else34, %if.then39, %if.then19, %if.then
%str.5.sink = phi ptr [ %str.8.str.7, %if.then ], [ %str.6.str.5, %if.then19 ], [ %str.4.str.3, %if.then39 ], [ @str.7, %if.else34 ]
%puts61 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c4) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c3) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c2) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
char s[4];
char judge1;
char judge2;
int ans1 = 0;
int ans2 = 0;
int i;
scanf("%s\n", s );
judge1 = s[0];
if( s[0] != s[1] )
{
judge2 = s[1];
}
else if( s[1] != s[2] )
{
judge2 = s[2];
}
else if( s[2] != s[3])
{
judge2 = s[3];
}
else
{
judge2 = 0;
}
for( i = 0; i < 4; i++ )
{
if( s[i] == judge1 )
{
ans1 += 1;
}
if( s[i] == judge2 )
{
ans2 += 1;
}
}
if ( (ans1 == 2) && (ans2 == 2) )
{
printf("Yes\n");
}
else
{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121654/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121654/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%arrayidx2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, %1
%arrayidx8 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx8, align 1, !tbaa !5
br i1 %cmp.not, label %if.else, label %if.end25
if.else: ; preds = %entry
%cmp10.not = icmp eq i8 %0, %2
br i1 %cmp10.not, label %if.else14, label %if.end25
if.else14: ; preds = %if.else
%arrayidx17 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx17, align 1, !tbaa !5
%cmp19.not = icmp eq i8 %0, %3
%. = select i1 %cmp19.not, i8 0, i8 %3
br label %if.end25
if.end25: ; preds = %entry, %if.else14, %if.else
%spec.select.1 = phi i32 [ 2, %if.else ], [ 2, %if.else14 ], [ 1, %entry ]
%4 = phi i8 [ %2, %if.else ], [ %0, %if.else14 ], [ %2, %entry ]
%judge2.0 = phi i8 [ %2, %if.else ], [ %., %if.else14 ], [ %1, %entry ]
%cmp39 = icmp eq i8 %0, %judge2.0
%add42 = zext i1 %cmp39 to i32
%cmp39.1 = icmp eq i8 %1, %judge2.0
%add42.1 = zext i1 %cmp39.1 to i32
%ans2.1.1 = add nuw nsw i32 %add42, %add42.1
%cmp31.2 = icmp eq i8 %4, %0
%add.2 = zext i1 %cmp31.2 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %add.2
%cmp39.2 = icmp eq i8 %4, %judge2.0
%add42.2 = zext i1 %cmp39.2 to i32
%ans2.1.2 = add nuw nsw i32 %ans2.1.1, %add42.2
%arrayidx28.3 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3
%5 = load i8, ptr %arrayidx28.3, align 1, !tbaa !5
%cmp31.3 = icmp eq i8 %5, %0
%add.3 = zext i1 %cmp31.3 to i32
%spec.select.3 = add nuw nsw i32 %spec.select.2, %add.3
%cmp39.3 = icmp eq i8 %5, %judge2.0
%add42.3 = zext i1 %cmp39.3 to i32
%ans2.1.3 = add nuw nsw i32 %ans2.1.2, %add42.3
%cmp44 = icmp eq i32 %spec.select.3, 2
%cmp46 = icmp eq i32 %ans2.1.3, 2
%or.cond = select i1 %cmp44, i1 %cmp46, i1 false
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
char s[5];
int i, j, cnt;
scanf("%s", s);
for(i=0; i<4; i++){
cnt=0;
for(j=0; j<4; j++){
if(s[i] == s[j])
cnt++;
}
if(cnt != 2){
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121704/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121704/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%arrayidx5.1 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx5.1, align 1, !tbaa !5
%cmp7.1 = icmp eq i8 %0, %1
%spec.select.1 = select i1 %cmp7.1, i32 2, i32 1
%arrayidx5.2 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx5.2, align 1, !tbaa !5
%cmp7.2 = icmp eq i8 %0, %2
%inc.2 = zext i1 %cmp7.2 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2
%arrayidx5.3 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx5.3, align 1, !tbaa !5
%cmp7.3 = icmp eq i8 %0, %3
%inc.3 = zext i1 %cmp7.3 to i32
%spec.select.3 = add nuw nsw i32 %spec.select.2, %inc.3
%cmp10.not = icmp eq i32 %spec.select.3, 2
br i1 %cmp10.not, label %for.cond, label %if.then12
for.cond: ; preds = %entry
%cmp7.2.1 = icmp eq i8 %1, %2
%inc.2.1 = zext i1 %cmp7.2.1 to i32
%spec.select.2.1 = add nuw nsw i32 %spec.select.1, %inc.2.1
%cmp7.3.1 = icmp eq i8 %1, %3
%inc.3.1 = zext i1 %cmp7.3.1 to i32
%spec.select.3.1 = add nuw nsw i32 %spec.select.2.1, %inc.3.1
%cmp10.not.1 = icmp eq i32 %spec.select.3.1, 2
br i1 %cmp10.not.1, label %for.cond.1, label %if.then12
for.cond.1: ; preds = %for.cond
%spec.select.1.2 = add nuw nsw i32 %inc.2, %inc.2.1
%spec.select.2.2 = add nuw nsw i32 %spec.select.1.2, 1
%cmp7.3.2 = icmp eq i8 %2, %3
%inc.3.2 = zext i1 %cmp7.3.2 to i32
%spec.select.3.2 = add nuw nsw i32 %spec.select.2.2, %inc.3.2
%cmp10.not.2 = icmp eq i32 %spec.select.3.2, 2
br i1 %cmp10.not.2, label %for.cond.2, label %if.then12
for.cond.2: ; preds = %for.cond.1
%spec.select.1.3 = add nuw nsw i32 %inc.3, %inc.3.1
%spec.select.2.3 = add nuw nsw i32 %spec.select.1.3, %inc.3.2
%cmp10.not.3 = icmp eq i32 %spec.select.2.3, 1
br i1 %cmp10.not.3, label %cleanup, label %if.then12
if.then12: ; preds = %for.cond.2, %for.cond.1, %for.cond, %entry
br label %cleanup
cleanup: ; preds = %for.cond.2, %if.then12
%str.sink = phi ptr [ @str.3, %if.then12 ], [ @str, %for.cond.2 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int solve(char* key,int n1,char* s,int n2){
int i,j,flag;
int k;
k=0;
while(n1+k*(n1-1)<=n2){
for(i=0;i<n2-(n1+k*(n1-1))+1;i++){
flag=1;
for(j=0;j<n1;j++){
if(key[j]!=s[i+(k+1)*j]){
flag=0;
break;
}
}
if(flag) return 1;
}
k++;
}
return 0;
}
int main(void){
int n,i,j;
char name[30],s[101];
int n1,n2,ans=0;
scanf("%d",&n);
scanf("%s",name);
n1=strlen(name);
for(i=0;i<n;i++){
scanf("%s",s);
n2=strlen(s);
if(solve(name,n1,s,n2)){
ans++;
}
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121748/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121748/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @solve(ptr nocapture noundef readonly %key, i32 noundef %n1, ptr nocapture noundef readonly %s, i32 noundef %n2) local_unnamed_addr #0 {
entry:
%sub = add nsw i32 %n1, -1
%cmp.not45 = icmp sgt i32 %n1, %n2
br i1 %cmp.not45, label %cleanup, label %for.cond.preheader.lr.ph
for.cond.preheader.lr.ph: ; preds = %entry
%cmp841 = icmp sgt i32 %n1, 0
br i1 %cmp841, label %for.cond.preheader.us.preheader, label %cleanup
for.cond.preheader.us.preheader: ; preds = %for.cond.preheader.lr.ph
%0 = zext i32 %sub to i64
%1 = zext i32 %n1 to i64
%2 = sext i32 %n2 to i64
%wide.trip.count = zext i32 %n1 to i64
br label %for.cond.preheader.us
for.cond.preheader.us: ; preds = %for.cond.preheader.us.preheader, %for.end22.us
%indvars.iv57 = phi i64 [ 0, %for.cond.preheader.us.preheader ], [ %.pre, %for.end22.us ]
%add47.us = phi i32 [ %n1, %for.cond.preheader.us.preheader ], [ %9, %for.end22.us ]
%sub4.us = sub nsw i32 %n2, %add47.us
%cmp6.not43.us = icmp slt i32 %sub4.us, 0
%.pre = add nuw i64 %indvars.iv57, 1
br i1 %cmp6.not43.us, label %for.end22.us, label %for.cond7.preheader.lr.ph.us
for.cond7.us: ; preds = %for.body9.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body9.us, !llvm.loop !5
for.body9.us: ; preds = %for.cond7.preheader.us, %for.cond7.us
%indvars.iv = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next, %for.cond7.us ]
%arrayidx.us = getelementptr inbounds i8, ptr %key, i64 %indvars.iv
%3 = load i8, ptr %arrayidx.us, align 1, !tbaa !7
%4 = mul nsw i64 %indvars.iv, %.pre
%5 = add nuw nsw i64 %4, %indvars.iv54
%idxprom13.us = and i64 %5, 4294967295
%arrayidx14.us = getelementptr inbounds i8, ptr %s, i64 %idxprom13.us
%6 = load i8, ptr %arrayidx14.us, align 1, !tbaa !7
%cmp16.not.us = icmp eq i8 %3, %6
br i1 %cmp16.not.us, label %for.cond7.us, label %for.inc20.us
for.inc20.us: ; preds = %for.body9.us
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%cmp6.not.us.not = icmp ult i64 %indvars.iv54, %10
br i1 %cmp6.not.us.not, label %for.cond7.preheader.us, label %for.end22.us, !llvm.loop !10
for.end22.us: ; preds = %for.inc20.us, %for.cond.preheader.us
%7 = mul nsw i64 %.pre, %0
%8 = add nsw i64 %7, %1
%cmp.not.us = icmp sgt i64 %8, %2
%9 = trunc i64 %8 to i32
br i1 %cmp.not.us, label %cleanup, label %for.cond.preheader.us, !llvm.loop !11
for.cond7.preheader.us: ; preds = %for.cond7.preheader.lr.ph.us, %for.inc20.us
%indvars.iv54 = phi i64 [ 0, %for.cond7.preheader.lr.ph.us ], [ %indvars.iv.next55, %for.inc20.us ]
br label %for.body9.us
for.cond7.preheader.lr.ph.us: ; preds = %for.cond.preheader.us
%10 = zext i32 %sub4.us to i64
br label %for.cond7.preheader.us
cleanup: ; preds = %for.end22.us, %for.cond7.us, %for.cond.preheader.lr.ph, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 1, %for.cond.preheader.lr.ph ], [ 1, %for.cond7.us ], [ 0, %for.end22.us ]
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
%name = alloca [30 x i8], align 16
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %name) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %name)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %name) #6
%call3.fr = freeze i64 %call3
%conv = trunc i64 %call3.fr to i32
%0 = load i32, ptr %n, align 4, !tbaa !12
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub.i = add i64 %call3.fr, 4294967295
%cmp841.i = icmp sgt i32 %conv, 0
%1 = and i64 %sub.i, 4294967295
%2 = and i64 %call3.fr, 4294967295
br i1 %cmp841.i, label %for.body.us, label %for.body
for.body.us: ; preds = %for.body.lr.ph, %for.cond.us
%ans.022.us = phi i32 [ %13, %for.cond.us ], [ 0, %for.body.lr.ph ]
%i.021.us = phi i32 [ %inc13.us, %for.cond.us ], [ 0, %for.body.lr.ph ]
%call6.us = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%call8.us = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv9.us = trunc i64 %call8.us to i32
%cmp.not45.i.us = icmp sgt i32 %conv, %conv9.us
br i1 %cmp.not45.i.us, label %for.cond.us, label %for.cond.preheader.lr.ph.i.us
for.cond.preheader.lr.ph.i.us: ; preds = %for.body.us
%sext.us = shl i64 %call8.us, 32
%3 = ashr exact i64 %sext.us, 32
%4 = sub i32 %conv9.us, %conv
br label %for.cond.preheader.us.i.us
for.cond.preheader.us.i.us: ; preds = %for.end22.us.i.us, %for.cond.preheader.lr.ph.i.us
%indvars.iv = phi i32 [ %indvars.iv.next, %for.end22.us.i.us ], [ %4, %for.cond.preheader.lr.ph.i.us ]
%indvars.iv57.i.us = phi i64 [ %.pre.i.us, %for.end22.us.i.us ], [ 0, %for.cond.preheader.lr.ph.i.us ]
%add47.us.i.us = phi i32 [ %12, %for.end22.us.i.us ], [ %conv, %for.cond.preheader.lr.ph.i.us ]
%5 = zext i32 %indvars.iv to i64
%cmp6.not43.us.i.us = icmp sgt i32 %add47.us.i.us, %conv9.us
%.pre.i.us = add nuw i64 %indvars.iv57.i.us, 1
br i1 %cmp6.not43.us.i.us, label %for.end22.us.i.us, label %for.cond7.preheader.us.i.us
for.cond7.preheader.us.i.us: ; preds = %for.cond.preheader.us.i.us, %for.inc20.us.i.us
%indvars.iv54.i.us = phi i64 [ %indvars.iv.next55.i.us, %for.inc20.us.i.us ], [ 0, %for.cond.preheader.us.i.us ]
br label %for.body9.us.i.us
for.body9.us.i.us: ; preds = %for.cond7.us.i.us, %for.cond7.preheader.us.i.us
%indvars.iv.i.us = phi i64 [ 0, %for.cond7.preheader.us.i.us ], [ %indvars.iv.next.i.us, %for.cond7.us.i.us ]
%arrayidx.us.i.us = getelementptr inbounds i8, ptr %name, i64 %indvars.iv.i.us
%6 = load i8, ptr %arrayidx.us.i.us, align 1, !tbaa !7
%7 = mul nsw i64 %indvars.iv.i.us, %.pre.i.us
%8 = add nuw nsw i64 %7, %indvars.iv54.i.us
%idxprom13.us.i.us = and i64 %8, 4294967295
%arrayidx14.us.i.us = getelementptr inbounds i8, ptr %s, i64 %idxprom13.us.i.us
%9 = load i8, ptr %arrayidx14.us.i.us, align 1, !tbaa !7
%cmp16.not.us.i.us = icmp eq i8 %6, %9
br i1 %cmp16.not.us.i.us, label %for.cond7.us.i.us, label %for.inc20.us.i.us
for.inc20.us.i.us: ; preds = %for.body9.us.i.us
%indvars.iv.next55.i.us = add nuw nsw i64 %indvars.iv54.i.us, 1
%exitcond.not = icmp eq i64 %indvars.iv54.i.us, %5
br i1 %exitcond.not, label %for.end22.us.i.us, label %for.cond7.preheader.us.i.us, !llvm.loop !10
for.cond7.us.i.us: ; preds = %for.body9.us.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, %2
br i1 %exitcond.not.i.us, label %solve.exit.loopexit.us, label %for.body9.us.i.us, !llvm.loop !5
for.end22.us.i.us: ; preds = %for.inc20.us.i.us, %for.cond.preheader.us.i.us
%10 = mul nsw i64 %.pre.i.us, %1
%11 = add nsw i64 %10, %2
%cmp.not.us.i.us = icmp sgt i64 %11, %3
%12 = trunc i64 %11 to i32
%reass.sub = sub i32 %indvars.iv, %conv
%indvars.iv.next = add i32 %reass.sub, 1
br i1 %cmp.not.us.i.us, label %for.cond.us, label %for.cond.preheader.us.i.us, !llvm.loop !11
for.cond.us: ; preds = %for.end22.us.i.us, %solve.exit.loopexit.us, %for.body.us
%13 = phi i32 [ %inc.us, %solve.exit.loopexit.us ], [ %ans.022.us, %for.body.us ], [ %ans.022.us, %for.end22.us.i.us ]
%inc13.us = add nuw nsw i32 %i.021.us, 1
%14 = load i32, ptr %n, align 4, !tbaa !12
%cmp.us = icmp slt i32 %inc13.us, %14
br i1 %cmp.us, label %for.body.us, label %for.end, !llvm.loop !14
solve.exit.loopexit.us: ; preds = %for.cond7.us.i.us
%inc.us = add nsw i32 %ans.022.us, 1
br label %for.cond.us
for.body: ; preds = %for.body.lr.ph, %for.body
%ans.022 = phi i32 [ %spec.select, %for.body ], [ 0, %for.body.lr.ph ]
%i.021 = phi i32 [ %inc13, %for.body ], [ 0, %for.body.lr.ph ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%call8 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv9 = trunc i64 %call8 to i32
%cmp.not45.i = icmp sle i32 %conv, %conv9
%inc = zext i1 %cmp.not45.i to i32
%spec.select = add nuw nsw i32 %ans.022, %inc
%inc13 = add nuw nsw i32 %i.021, 1
%15 = load i32, ptr %n, align 4, !tbaa !12
%cmp = icmp slt i32 %inc13, %15
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body, %for.cond.us, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %13, %for.cond.us ], [ %spec.select, %for.body ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %name) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(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 = { 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 = { 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 = 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}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = distinct !{!14, !6}
|
# include <stdio.h>
# include <math.h>
int main(){
int count=0;
double a,b;
/* double tempa=0,tempb=0;store a and b*/
while (scanf("%lf %lf",&a,&b)!=EOF){
double GCD,LCM;
double tempa=0,tempb=0; /*store a and b*/
tempa=a;
tempb=b;
while (count==0){
a=fmod(a,b);
/* a=a%b;*/
if (a==0){
GCD=b;
count=1;
}
else{
b=fmod(b,a);
/* b=b%a;*/
if (b==0){
GCD=a;
count=1;
}
}
}
LCM=(tempa/GCD)*(tempb/GCD)*GCD;
printf("%.0f %.0f\n",GCD,LCM);
count=0;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121799/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121799/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"%.0f %.0f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, 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
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not19 = icmp eq i32 %call18, -1
br i1 %cmp.not19, label %while.end13, label %while.body
while.body: ; preds = %entry, %while.end
%0 = load double, ptr %a, align 8, !tbaa !5
%1 = load double, ptr %b, align 8, !tbaa !5
br label %while.body3
while.body3: ; preds = %if.else, %while.body
%2 = phi double [ %1, %while.body ], [ %call6, %if.else ]
%3 = load double, ptr %a, align 8, !tbaa !5
%call4 = call double @fmod(double noundef %3, double noundef %2) #4
store double %call4, ptr %a, align 8, !tbaa !5
%cmp5 = fcmp oeq double %call4, 0.000000e+00
%4 = load double, ptr %b, align 8, !tbaa !5
br i1 %cmp5, label %while.end, label %if.else
if.else: ; preds = %while.body3
%call6 = call double @fmod(double noundef %4, double noundef %call4) #4
store double %call6, ptr %b, align 8, !tbaa !5
%cmp7 = fcmp oeq double %call6, 0.000000e+00
br i1 %cmp7, label %if.then8, label %while.body3, !llvm.loop !9
if.then8: ; preds = %if.else
%5 = load double, ptr %a, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.body3, %if.then8
%GCD.2.ph = phi double [ %5, %if.then8 ], [ %4, %while.body3 ]
%6 = insertelement <2 x double> poison, double %0, i64 0
%7 = insertelement <2 x double> %6, double %1, i64 1
%8 = insertelement <2 x double> poison, double %GCD.2.ph, i64 0
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> zeroinitializer
%10 = fdiv <2 x double> %7, %9
%shift = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%11 = fmul <2 x double> %10, %shift
%mul = extractelement <2 x double> %11, i64 0
%mul11 = fmul double %GCD.2.ph, %mul
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %GCD.2.ph, double noundef %mul11)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end13, label %while.body, !llvm.loop !11
while.end13: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @fmod(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int gcd( int m, int n )
{
// 引数に0がある場合は0を返す
if ( ( 0 == m ) || ( 0 == n ) )
return 0;
// ユークリッドの方法
while( m != n )
{
if ( m > n ) m = m - n;
else n = n - m;
}
return m;
}//gcd
int lcm( int m, int n ,int yaku)
{
// 引数に0がある場合は0を返す
if ( ( 0 == m ) || ( 0 == n ) )
return 0;
return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int main(void){
int a,b;
int yaku,bai;
while(scanf("%d %d",&a,&b)!=EOF){
yaku = gcd(a,b);
bai = lcm(a,b,yaku);
printf("%d %d\n",yaku,bai);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121841/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121841/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %m, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %m, 0
%cmp1 = icmp eq i32 %n, 0
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %return, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%cmp2.not16 = icmp eq i32 %m, %n
br i1 %cmp2.not16, label %return, label %while.body
while.body: ; preds = %while.cond.preheader, %while.body
%n.addr.018 = phi i32 [ %n.addr.1, %while.body ], [ %n, %while.cond.preheader ]
%m.addr.017 = phi i32 [ %m.addr.1, %while.body ], [ %m, %while.cond.preheader ]
%cmp3 = icmp sgt i32 %m.addr.017, %n.addr.018
%sub = select i1 %cmp3, i32 %n.addr.018, i32 0
%m.addr.1 = sub nsw i32 %m.addr.017, %sub
%sub5 = select i1 %cmp3, i32 0, i32 %m.addr.017
%n.addr.1 = sub nsw i32 %n.addr.018, %sub5
%cmp2.not = icmp eq i32 %m.addr.1, %n.addr.1
br i1 %cmp2.not, label %return, label %while.body, !llvm.loop !5
return: ; preds = %while.body, %while.cond.preheader, %entry
%retval.0 = phi i32 [ 0, %entry ], [ %m, %while.cond.preheader ], [ %m.addr.1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %m, i32 noundef %n, i32 noundef %yaku) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %m, 0
%cmp1 = icmp eq i32 %n, 0
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %return, label %while.cond.preheader.i
while.cond.preheader.i: ; preds = %entry
%cmp2.not16.i = icmp eq i32 %m, %n
br i1 %cmp2.not16.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %while.cond.preheader.i, %while.body.i
%n.addr.018.i = phi i32 [ %n.addr.1.i, %while.body.i ], [ %n, %while.cond.preheader.i ]
%m.addr.017.i = phi i32 [ %m.addr.1.i, %while.body.i ], [ %m, %while.cond.preheader.i ]
%cmp3.i = icmp sgt i32 %m.addr.017.i, %n.addr.018.i
%sub.i = select i1 %cmp3.i, i32 %n.addr.018.i, i32 0
%m.addr.1.i = sub nsw i32 %m.addr.017.i, %sub.i
%sub5.i = select i1 %cmp3.i, i32 0, i32 %m.addr.017.i
%n.addr.1.i = sub nsw i32 %n.addr.018.i, %sub5.i
%cmp2.not.i = icmp eq i32 %m.addr.1.i, %n.addr.1.i
br i1 %cmp2.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %while.cond.preheader.i
%retval.0.i = phi i32 [ %m, %while.cond.preheader.i ], [ %m.addr.1.i, %while.body.i ]
%div = sdiv i32 %m, %retval.0.i
%mul = mul nsw i32 %div, %n
br label %return
return: ; preds = %entry, %gcd.exit
%retval.0 = phi i32 [ %mul, %gcd.exit ], [ 0, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not15 = icmp eq i32 %call14, -1
br i1 %cmp.not15, label %while.end, label %while.body
while.body: ; preds = %entry, %lcm.exit
%0 = load i32, ptr %a, align 4, !tbaa !7
%1 = load i32, ptr %b, align 4, !tbaa !7
%cmp.i = icmp eq i32 %0, 0
%cmp1.i = icmp eq i32 %1, 0
%or.cond.i = or i1 %cmp.i, %cmp1.i
br i1 %or.cond.i, label %lcm.exit, label %while.cond.preheader.i
while.cond.preheader.i: ; preds = %while.body
%cmp2.not16.i = icmp eq i32 %0, %1
br i1 %cmp2.not16.i, label %gcd.exit.i, label %while.body.i
while.body.i: ; preds = %while.cond.preheader.i, %while.body.i
%n.addr.018.i = phi i32 [ %n.addr.1.i, %while.body.i ], [ %1, %while.cond.preheader.i ]
%m.addr.017.i = phi i32 [ %m.addr.1.i, %while.body.i ], [ %0, %while.cond.preheader.i ]
%cmp3.i = icmp sgt i32 %m.addr.017.i, %n.addr.018.i
%sub.i = select i1 %cmp3.i, i32 %n.addr.018.i, i32 0
%m.addr.1.i = sub nsw i32 %m.addr.017.i, %sub.i
%sub5.i = select i1 %cmp3.i, i32 0, i32 %m.addr.017.i
%n.addr.1.i = sub nsw i32 %n.addr.018.i, %sub5.i
%cmp2.not.i = icmp eq i32 %m.addr.1.i, %n.addr.1.i
br i1 %cmp2.not.i, label %while.cond.preheader.i.i, label %while.body.i, !llvm.loop !5
while.cond.preheader.i.i: ; preds = %while.body.i
br i1 %cmp2.not16.i, label %gcd.exit.i, label %while.body.i.i
while.body.i.i: ; preds = %while.cond.preheader.i.i, %while.body.i.i
%n.addr.018.i.i = phi i32 [ %n.addr.1.i.i, %while.body.i.i ], [ %1, %while.cond.preheader.i.i ]
%m.addr.017.i.i = phi i32 [ %m.addr.1.i.i, %while.body.i.i ], [ %0, %while.cond.preheader.i.i ]
%cmp3.i.i = icmp sgt i32 %m.addr.017.i.i, %n.addr.018.i.i
%sub.i.i = select i1 %cmp3.i.i, i32 %n.addr.018.i.i, i32 0
%m.addr.1.i.i = sub nsw i32 %m.addr.017.i.i, %sub.i.i
%sub5.i.i = select i1 %cmp3.i.i, i32 0, i32 %m.addr.017.i.i
%n.addr.1.i.i = sub nsw i32 %n.addr.018.i.i, %sub5.i.i
%cmp2.not.i.i = icmp eq i32 %m.addr.1.i.i, %n.addr.1.i.i
br i1 %cmp2.not.i.i, label %gcd.exit.i, label %while.body.i.i, !llvm.loop !5
gcd.exit.i: ; preds = %while.body.i.i, %while.cond.preheader.i, %while.cond.preheader.i.i
%retval.0.i1317 = phi i32 [ %m.addr.1.i, %while.cond.preheader.i.i ], [ %0, %while.cond.preheader.i ], [ %m.addr.1.i, %while.body.i.i ]
%retval.0.i.i = phi i32 [ %0, %while.cond.preheader.i.i ], [ %0, %while.cond.preheader.i ], [ %m.addr.1.i.i, %while.body.i.i ]
%div.i = sdiv i32 %0, %retval.0.i.i
%mul.i = mul nsw i32 %div.i, %1
br label %lcm.exit
lcm.exit: ; preds = %while.body, %gcd.exit.i
%retval.0.i10 = phi i32 [ %retval.0.i1317, %gcd.exit.i ], [ 0, %while.body ]
%retval.0.i8 = phi i32 [ %mul.i, %gcd.exit.i ], [ 0, %while.body ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i10, i32 noundef %retval.0.i8)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %lcm.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include<stdio.h>
int gcd( int m, int n )
{
if ( ( 0 == m ) || ( 0 == n ) )
return 0;
while( m != n )
{
if ( m > n ) m = m - n;
else n = n - m;
}
return m;
}
int lcm( int m, int n )
{
if ( ( 0 == m ) || ( 0 == n ) )
return 0;
return ((m / gcd(m, n)) * n);
}
int main(void){
int m,n;
int a,b;
while(scanf("%d",&m)!=EOF){
scanf("%d",&n);
a=gcd(m,n);
b=lcm(m,n);
printf("%d %d\n",a,b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121885/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121885/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %m, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %m, 0
%cmp1 = icmp eq i32 %n, 0
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %return, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%cmp2.not16 = icmp eq i32 %m, %n
br i1 %cmp2.not16, label %return, label %while.body
while.body: ; preds = %while.cond.preheader, %while.body
%n.addr.018 = phi i32 [ %n.addr.1, %while.body ], [ %n, %while.cond.preheader ]
%m.addr.017 = phi i32 [ %m.addr.1, %while.body ], [ %m, %while.cond.preheader ]
%cmp3 = icmp sgt i32 %m.addr.017, %n.addr.018
%sub = select i1 %cmp3, i32 %n.addr.018, i32 0
%m.addr.1 = sub nsw i32 %m.addr.017, %sub
%sub5 = select i1 %cmp3, i32 0, i32 %m.addr.017
%n.addr.1 = sub nsw i32 %n.addr.018, %sub5
%cmp2.not = icmp eq i32 %m.addr.1, %n.addr.1
br i1 %cmp2.not, label %return, label %while.body, !llvm.loop !5
return: ; preds = %while.body, %while.cond.preheader, %entry
%retval.0 = phi i32 [ 0, %entry ], [ %m, %while.cond.preheader ], [ %m.addr.1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %m, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %m, 0
%cmp1 = icmp eq i32 %n, 0
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %return, label %while.cond.preheader.i
while.cond.preheader.i: ; preds = %entry
%cmp2.not16.i = icmp eq i32 %m, %n
br i1 %cmp2.not16.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %while.cond.preheader.i, %while.body.i
%n.addr.018.i = phi i32 [ %n.addr.1.i, %while.body.i ], [ %n, %while.cond.preheader.i ]
%m.addr.017.i = phi i32 [ %m.addr.1.i, %while.body.i ], [ %m, %while.cond.preheader.i ]
%cmp3.i = icmp sgt i32 %m.addr.017.i, %n.addr.018.i
%sub.i = select i1 %cmp3.i, i32 %n.addr.018.i, i32 0
%m.addr.1.i = sub nsw i32 %m.addr.017.i, %sub.i
%sub5.i = select i1 %cmp3.i, i32 0, i32 %m.addr.017.i
%n.addr.1.i = sub nsw i32 %n.addr.018.i, %sub5.i
%cmp2.not.i = icmp eq i32 %m.addr.1.i, %n.addr.1.i
br i1 %cmp2.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %while.cond.preheader.i
%retval.0.i = phi i32 [ %m, %while.cond.preheader.i ], [ %m.addr.1.i, %while.body.i ]
%div = sdiv i32 %m, %retval.0.i
%mul = mul nsw i32 %div, %n
br label %return
return: ; preds = %entry, %gcd.exit
%retval.0 = phi i32 [ %mul, %gcd.exit ], [ 0, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not15 = icmp eq i32 %call14, -1
br i1 %cmp.not15, label %while.end, label %while.body
while.body: ; preds = %entry, %lcm.exit
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %m, align 4, !tbaa !7
%1 = load i32, ptr %n, align 4, !tbaa !7
%cmp.i = icmp eq i32 %0, 0
%cmp1.i = icmp eq i32 %1, 0
%or.cond.i = or i1 %cmp.i, %cmp1.i
br i1 %or.cond.i, label %lcm.exit, label %while.cond.preheader.i
while.cond.preheader.i: ; preds = %while.body
%cmp2.not16.i = icmp eq i32 %0, %1
br i1 %cmp2.not16.i, label %gcd.exit.i, label %while.body.i
while.body.i: ; preds = %while.cond.preheader.i, %while.body.i
%n.addr.018.i = phi i32 [ %n.addr.1.i, %while.body.i ], [ %1, %while.cond.preheader.i ]
%m.addr.017.i = phi i32 [ %m.addr.1.i, %while.body.i ], [ %0, %while.cond.preheader.i ]
%cmp3.i = icmp sgt i32 %m.addr.017.i, %n.addr.018.i
%sub.i = select i1 %cmp3.i, i32 %n.addr.018.i, i32 0
%m.addr.1.i = sub nsw i32 %m.addr.017.i, %sub.i
%sub5.i = select i1 %cmp3.i, i32 0, i32 %m.addr.017.i
%n.addr.1.i = sub nsw i32 %n.addr.018.i, %sub5.i
%cmp2.not.i = icmp eq i32 %m.addr.1.i, %n.addr.1.i
br i1 %cmp2.not.i, label %while.cond.preheader.i.i, label %while.body.i, !llvm.loop !5
while.cond.preheader.i.i: ; preds = %while.body.i
br i1 %cmp2.not16.i, label %gcd.exit.i, label %while.body.i.i
while.body.i.i: ; preds = %while.cond.preheader.i.i, %while.body.i.i
%n.addr.018.i.i = phi i32 [ %n.addr.1.i.i, %while.body.i.i ], [ %1, %while.cond.preheader.i.i ]
%m.addr.017.i.i = phi i32 [ %m.addr.1.i.i, %while.body.i.i ], [ %0, %while.cond.preheader.i.i ]
%cmp3.i.i = icmp sgt i32 %m.addr.017.i.i, %n.addr.018.i.i
%sub.i.i = select i1 %cmp3.i.i, i32 %n.addr.018.i.i, i32 0
%m.addr.1.i.i = sub nsw i32 %m.addr.017.i.i, %sub.i.i
%sub5.i.i = select i1 %cmp3.i.i, i32 0, i32 %m.addr.017.i.i
%n.addr.1.i.i = sub nsw i32 %n.addr.018.i.i, %sub5.i.i
%cmp2.not.i.i = icmp eq i32 %m.addr.1.i.i, %n.addr.1.i.i
br i1 %cmp2.not.i.i, label %gcd.exit.i, label %while.body.i.i, !llvm.loop !5
gcd.exit.i: ; preds = %while.body.i.i, %while.cond.preheader.i, %while.cond.preheader.i.i
%retval.0.i1317 = phi i32 [ %m.addr.1.i, %while.cond.preheader.i.i ], [ %0, %while.cond.preheader.i ], [ %m.addr.1.i, %while.body.i.i ]
%retval.0.i.i = phi i32 [ %0, %while.cond.preheader.i.i ], [ %0, %while.cond.preheader.i ], [ %m.addr.1.i.i, %while.body.i.i ]
%div.i = sdiv i32 %0, %retval.0.i.i
%mul.i = mul nsw i32 %div.i, %1
br label %lcm.exit
lcm.exit: ; preds = %while.body, %gcd.exit.i
%retval.0.i10 = phi i32 [ %retval.0.i1317, %gcd.exit.i ], [ 0, %while.body ]
%retval.0.i8 = phi i32 [ %mul.i, %gcd.exit.i ], [ 0, %while.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i10, i32 noundef %retval.0.i8)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %lcm.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include<stdio.h>
#include<math.h>
int main()
{
long long int num1,num2,num;
while (scanf("%lld %lld",&num1,&num2) !=EOF){
num = num1*num2;
while(num1 != num2)
{
if(num1 > num2){
num1 = num1-num2;
}
else{
num2 = num2-num1;
}
}
printf("%lld %lld\n",num1,num/num1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121928/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121928/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%lld %lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num1 = alloca i64, align 8
%num2 = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %num1) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %num2) #3
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num1, ptr noundef nonnull %num2)
%cmp.not17 = icmp eq i32 %call16, -1
br i1 %cmp.not17, label %while.end7, label %while.body
while.body: ; preds = %entry, %while.end
%0 = load i64, ptr %num1, align 8, !tbaa !5
%1 = load i64, ptr %num2, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%cmp2.not13 = icmp eq i64 %0, %1
br i1 %cmp2.not13, label %while.end, label %while.body3
while.body3: ; preds = %while.body, %if.end
%sub1015 = phi i64 [ %sub9, %if.end ], [ %0, %while.body ]
%sub51214 = phi i64 [ %sub511, %if.end ], [ %1, %while.body ]
%cmp4 = icmp sgt i64 %sub1015, %sub51214
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %while.body3
%sub = sub nsw i64 %sub1015, %sub51214
store i64 %sub, ptr %num1, align 8, !tbaa !5
br label %if.end
if.else: ; preds = %while.body3
%sub5 = sub nsw i64 %sub51214, %sub1015
store i64 %sub5, ptr %num2, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.else, %if.then
%sub511 = phi i64 [ %sub5, %if.else ], [ %sub51214, %if.then ]
%sub9 = phi i64 [ %sub1015, %if.else ], [ %sub, %if.then ]
%cmp2.not = icmp eq i64 %sub9, %sub511
br i1 %cmp2.not, label %while.end, label %while.body3, !llvm.loop !9
while.end: ; preds = %if.end, %while.body
%.lcssa = phi i64 [ %0, %while.body ], [ %sub511, %if.end ]
%div = sdiv i64 %mul, %.lcssa
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.lcssa, i64 noundef %div)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num1, ptr noundef nonnull %num2)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end7, label %while.body, !llvm.loop !11
while.end7: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num2) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int euclid(int, int);
int main(void) {
int a, b, gcd, lcm;
while(~scanf("%d %d", &a, &b)) {
gcd = a > b ? euclid(a, b) : euclid(b, a);
lcm = a / gcd * b;
printf("%d %d\n", gcd, lcm);
}
return 0;
}
int euclid(int a, int b) {
return a % b ? euclid(b, a % b) : b;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121971/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121971/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%tobool.not15 = icmp eq i32 %call14, -1
br i1 %tobool.not15, label %while.end, label %while.body
while.body: ; preds = %entry, %cond.end
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %tailrecurse.i, label %tailrecurse.i7
tailrecurse.i: ; preds = %while.body, %tailrecurse.i
%a.tr.i = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %0, %while.body ]
%b.tr.i = phi i32 [ %rem.i, %tailrecurse.i ], [ %1, %while.body ]
%rem.i = srem i32 %a.tr.i, %b.tr.i
%tobool.not.i = icmp eq i32 %rem.i, 0
br i1 %tobool.not.i, label %cond.end, label %tailrecurse.i
tailrecurse.i7: ; preds = %while.body, %tailrecurse.i7
%a.tr.i8 = phi i32 [ %b.tr.i9, %tailrecurse.i7 ], [ %1, %while.body ]
%b.tr.i9 = phi i32 [ %rem.i10, %tailrecurse.i7 ], [ %0, %while.body ]
%rem.i10 = srem i32 %a.tr.i8, %b.tr.i9
%tobool.not.i11 = icmp eq i32 %rem.i10, 0
br i1 %tobool.not.i11, label %cond.end, label %tailrecurse.i7
cond.end: ; preds = %tailrecurse.i7, %tailrecurse.i
%cond = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %b.tr.i9, %tailrecurse.i7 ]
%div = sdiv i32 %0, %cond
%mul = mul nsw i32 %div, %1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond, i32 noundef %mul)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %cond.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @euclid(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i32 [ %a, %entry ], [ %b.tr, %tailrecurse ]
%b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ]
%rem = srem i32 %a.tr, %b.tr
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %cond.end, label %tailrecurse
cond.end: ; preds = %tailrecurse
ret i32 %b.tr
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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(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"}
|
#include <stdio.h>
int gcd(int a, int b) {
if (b == 0) return a;
return gcd(b, a % b);
}
int main(void)
{
int a, b;
while (~scanf("%d%d", &a, &b)) {
int g = gcd(a, b);
printf("%d %d\n", g, a / g * b);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122013/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122013/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ]
ret i32 %a.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%tobool.not5 = icmp eq i32 %call4, -1
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %gcd.exit
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.i = icmp eq i32 %1, 0
br i1 %cmp4.i, label %gcd.exit, label %if.end.i
if.end.i: ; preds = %while.body, %if.end.i
%b.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %1, %while.body ]
%a.tr5.i = phi i32 [ %b.tr6.i, %if.end.i ], [ %0, %while.body ]
%rem.i = srem i32 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %if.end.i
gcd.exit: ; preds = %if.end.i, %while.body
%a.tr.lcssa.i = phi i32 [ %0, %while.body ], [ %b.tr6.i, %if.end.i ]
%div = sdiv i32 %0, %a.tr.lcssa.i
%mul = mul nsw i32 %div, %1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.tr.lcssa.i, i32 noundef %mul)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %gcd.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
long a,b,tmp,gdc,lcm,alpha;
long k,l;
while(scanf("%ld %ld",&a,&b)!=EOF){
if(a>b){ //?????¶??????a<=b?????¶????????????
tmp=a;
a=b;
b=tmp;
}
for(k=1;k<=b;k++){
if(b%k==0){
l=b/k;
if(a%l==0){
gdc=l;
break;
}
}
}
alpha = a/gdc;
lcm = alpha * b;
printf("%ld %ld\n",gdc,lcm);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122057/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122057/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not25 = icmp eq i32 %call24, -1
br i1 %cmp.not25, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%gdc.026 = phi i64 [ %gdc.1, %for.end ], [ undef, %entry ]
%0 = load i64, ptr %a, align 8
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp1 = icmp sgt i64 %0, %1
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %while.body
store i64 %1, ptr %a, align 8, !tbaa !5
store i64 %0, ptr %b, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%2 = phi i64 [ %1, %if.then ], [ %0, %while.body ]
%3 = phi i64 [ %0, %if.then ], [ %1, %while.body ]
%cmp2.not19 = icmp slt i64 %3, 1
br i1 %cmp2.not19, label %for.end, label %for.body
for.body: ; preds = %if.end, %for.inc
%k.020 = phi i64 [ %inc, %for.inc ], [ 1, %if.end ]
%rem = srem i64 %3, %k.020
%div = sdiv i64 %3, %k.020
%cmp3 = icmp eq i64 %rem, 0
br i1 %cmp3, label %if.then4, label %for.inc
if.then4: ; preds = %for.body
%rem5 = srem i64 %2, %div
%cmp6 = icmp eq i64 %rem5, 0
br i1 %cmp6, label %for.end, label %for.inc
for.inc: ; preds = %for.body, %if.then4
%inc = add nuw i64 %k.020, 1
%exitcond.not = icmp eq i64 %k.020, %3
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc, %if.then4, %if.end
%gdc.1 = phi i64 [ %gdc.026, %if.end ], [ %div, %if.then4 ], [ %gdc.026, %for.inc ]
%div10 = sdiv i64 %2, %gdc.1
%mul = mul nsw i64 %div10, %3
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %gdc.1, i64 noundef %mul)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int L[1000100];
int n;
while(scanf("%d", &n) != EOF){
int sum = n;
for(int i = 0; i < n; i++){
scanf("%d", &L[i]);
}
int l = L[n-1];
for(int i = n-2; i >= 0; i--){
if(l>0){
sum--;
l--;
}
if(L[i] > l){
l = L[i];
}
}
printf("%d", sum);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12210/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12210/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%L = alloca [1000100 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000400, ptr nonnull %L) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not41 = icmp eq i32 %call40, -1
br i1 %cmp.not41, label %while.end, label %while.body
while.body: ; preds = %entry, %for.cond.cleanup9
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp133 = icmp sgt i32 %0, 0
br i1 %cmp133, label %for.body, label %for.cond.cleanup9
for.cond.cleanup: ; preds = %for.body
%cmp835 = icmp sgt i32 %6, 1
br i1 %cmp835, label %for.body10.preheader, label %for.cond.cleanup9
for.body10.preheader: ; preds = %for.cond.cleanup
%sub6 = add i32 %6, -2
%sub = add nsw i32 %6, -1
%idxprom3 = zext i32 %sub to i64
%arrayidx4 = getelementptr inbounds [1000100 x i32], ptr %L, i64 0, i64 %idxprom3
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%2 = zext i32 %sub6 to i64
%3 = and i64 %2, 1
%lcmp.mod.not.not = icmp eq i64 %3, 0
br i1 %lcmp.mod.not.not, label %for.body10.prol, label %for.body10.prol.loopexit
for.body10.prol: ; preds = %for.body10.preheader
%cmp11.prol = icmp sgt i32 %1, 0
%dec.prol = sext i1 %cmp11.prol to i32
%sum.1.prol = add nsw i32 %0, %dec.prol
%l.1.prol = add nsw i32 %1, %dec.prol
%arrayidx14.prol = getelementptr inbounds [1000100 x i32], ptr %L, i64 0, i64 %2
%4 = load i32, ptr %arrayidx14.prol, align 4, !tbaa !5
%l.2.prol = call i32 @llvm.smax.i32(i32 %4, i32 %l.1.prol)
%indvars.iv.next45.prol = add nsw i64 %2, -1
br label %for.body10.prol.loopexit
for.body10.prol.loopexit: ; preds = %for.body10.prol, %for.body10.preheader
%sum.1.lcssa.unr = phi i32 [ undef, %for.body10.preheader ], [ %sum.1.prol, %for.body10.prol ]
%indvars.iv44.unr = phi i64 [ %2, %for.body10.preheader ], [ %indvars.iv.next45.prol, %for.body10.prol ]
%l.037.unr = phi i32 [ %1, %for.body10.preheader ], [ %l.2.prol, %for.body10.prol ]
%sum.036.unr = phi i32 [ %0, %for.body10.preheader ], [ %sum.1.prol, %for.body10.prol ]
%5 = icmp eq i32 %sub6, 0
br i1 %5, label %for.cond.cleanup9, label %for.body10
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [1000100 x i32], ptr %L, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp1, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup9: ; preds = %for.body10.prol.loopexit, %for.body10, %while.body, %for.cond.cleanup
%sum.0.lcssa = phi i32 [ %0, %for.cond.cleanup ], [ %0, %while.body ], [ %sum.1.lcssa.unr, %for.body10.prol.loopexit ], [ %sum.1.1, %for.body10 ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
for.body10: ; preds = %for.body10.prol.loopexit, %for.body10
%indvars.iv44 = phi i64 [ %indvars.iv.next45.1, %for.body10 ], [ %indvars.iv44.unr, %for.body10.prol.loopexit ]
%l.037 = phi i32 [ %l.2.1, %for.body10 ], [ %l.037.unr, %for.body10.prol.loopexit ]
%sum.036 = phi i32 [ %sum.1.1, %for.body10 ], [ %sum.036.unr, %for.body10.prol.loopexit ]
%cmp11 = icmp sgt i32 %l.037, 0
%dec = sext i1 %cmp11 to i32
%sum.1 = add nsw i32 %sum.036, %dec
%l.1 = add nsw i32 %l.037, %dec
%arrayidx14 = getelementptr inbounds [1000100 x i32], ptr %L, i64 0, i64 %indvars.iv44
%8 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%l.2 = call i32 @llvm.smax.i32(i32 %8, i32 %l.1)
%indvars.iv.next45 = add nsw i64 %indvars.iv44, -1
%cmp11.1 = icmp sgt i32 %l.2, 0
%dec.1 = sext i1 %cmp11.1 to i32
%sum.1.1 = add nsw i32 %sum.1, %dec.1
%l.1.1 = add nsw i32 %l.2, %dec.1
%arrayidx14.1 = getelementptr inbounds [1000100 x i32], ptr %L, i64 0, i64 %indvars.iv.next45
%9 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5
%l.2.1 = call i32 @llvm.smax.i32(i32 %9, i32 %l.1.1)
%indvars.iv.next45.1 = add nsw i64 %indvars.iv44, -2
%cmp8.not.1 = icmp eq i64 %indvars.iv.next45, 0
br i1 %cmp8.not.1, label %for.cond.cleanup9, label %for.body10, !llvm.loop !12
while.end: ; preds = %for.cond.cleanup9, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4000400, ptr nonnull %L) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int gcd(int a, int b) {
int r;
if(a >= b){
do{
r=a%b;
a=b;
b=r;
}while(r != 0);
return a;
}
else if(a < b){
do{
r=b%a;
b=a;
a=r;
}while(r != 0);
return b;
}
}
int main(void){
int a,b;
while(scanf("%d %d",&a,&b) != EOF) {
int lcm = a/gcd(a,b)*b;
printf("%d %d\n",gcd(a,b),lcm);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122143/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122143/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp.not = icmp slt i32 %a, %b
br i1 %cmp.not, label %do.body4, label %do.body
do.body: ; preds = %entry, %do.body
%a.addr.0 = phi i32 [ %b.addr.0, %do.body ], [ %a, %entry ]
%b.addr.0 = phi i32 [ %rem, %do.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.0, %b.addr.0
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %cleanup, label %do.body, !llvm.loop !5
do.body4: ; preds = %entry, %do.body4
%a.addr.1 = phi i32 [ %rem5, %do.body4 ], [ %a, %entry ]
%b.addr.1 = phi i32 [ %a.addr.1, %do.body4 ], [ %b, %entry ]
%rem5 = srem i32 %b.addr.1, %a.addr.1
%cmp7.not = icmp eq i32 %rem5, 0
br i1 %cmp7.not, label %cleanup, label %do.body4, !llvm.loop !7
cleanup: ; preds = %do.body, %do.body4
%retval.0 = phi i32 [ %a.addr.1, %do.body4 ], [ %b.addr.0, %do.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:
%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
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not20 = icmp eq i32 %call19, -1
br i1 %cmp.not20, label %while.end, label %while.body
while.body: ; preds = %entry, %gcd.exit16
%0 = load i32, ptr %a, align 4, !tbaa !8
%1 = load i32, ptr %b, align 4, !tbaa !8
%cmp.not.i = icmp slt i32 %0, %1
br i1 %cmp.not.i, label %do.body4.i, label %do.body.i
do.body.i: ; preds = %while.body, %do.body.i
%a.addr.0.i = phi i32 [ %b.addr.0.i, %do.body.i ], [ %0, %while.body ]
%b.addr.0.i = phi i32 [ %rem.i, %do.body.i ], [ %1, %while.body ]
%rem.i = srem i32 %a.addr.0.i, %b.addr.0.i
%cmp1.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.not.i, label %gcd.exit, label %do.body.i, !llvm.loop !5
do.body4.i: ; preds = %while.body, %do.body4.i
%a.addr.1.i = phi i32 [ %rem5.i, %do.body4.i ], [ %0, %while.body ]
%b.addr.1.i = phi i32 [ %a.addr.1.i, %do.body4.i ], [ %1, %while.body ]
%rem5.i = srem i32 %b.addr.1.i, %a.addr.1.i
%cmp7.not.i = icmp eq i32 %rem5.i, 0
br i1 %cmp7.not.i, label %gcd.exit, label %do.body4.i, !llvm.loop !7
gcd.exit: ; preds = %do.body.i, %do.body4.i
%retval.0.i = phi i32 [ %a.addr.1.i, %do.body4.i ], [ %b.addr.0.i, %do.body.i ]
%div = sdiv i32 %0, %retval.0.i
%mul = mul nsw i32 %div, %1
br i1 %cmp.not.i, label %do.body4.i11, label %do.body.i5
do.body.i5: ; preds = %gcd.exit, %do.body.i5
%a.addr.0.i6 = phi i32 [ %b.addr.0.i7, %do.body.i5 ], [ %0, %gcd.exit ]
%b.addr.0.i7 = phi i32 [ %rem.i8, %do.body.i5 ], [ %1, %gcd.exit ]
%rem.i8 = srem i32 %a.addr.0.i6, %b.addr.0.i7
%cmp1.not.i9 = icmp eq i32 %rem.i8, 0
br i1 %cmp1.not.i9, label %gcd.exit16, label %do.body.i5, !llvm.loop !5
do.body4.i11: ; preds = %gcd.exit, %do.body4.i11
%a.addr.1.i12 = phi i32 [ %rem5.i14, %do.body4.i11 ], [ %0, %gcd.exit ]
%b.addr.1.i13 = phi i32 [ %a.addr.1.i12, %do.body4.i11 ], [ %1, %gcd.exit ]
%rem5.i14 = srem i32 %b.addr.1.i13, %a.addr.1.i12
%cmp7.not.i15 = icmp eq i32 %rem5.i14, 0
br i1 %cmp7.not.i15, label %gcd.exit16, label %do.body4.i11, !llvm.loop !7
gcd.exit16: ; preds = %do.body.i5, %do.body4.i11
%retval.0.i10 = phi i32 [ %a.addr.1.i12, %do.body4.i11 ], [ %b.addr.0.i7, %do.body.i5 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i10, i32 noundef %mul)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %gcd.exit16, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = distinct !{!12, !6}
|
#include<stdio.h>
typedef unsigned int u_int;
u_int euclid(u_int m,u_int n);
int main(void){
u_int m,n;
while(fscanf(stdin,"%u %u",&m,&n)!=EOF) printf("%u %u\n",euclid(m,n),m/euclid(m,n)*n);
return 0;
}
u_int euclid(u_int m,u_int n){
if(n==0) return m;
return euclid(n,m%n);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122194/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122194/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [6 x i8] c"%u %u\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%u %u\0A\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call14 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n) #5
%cmp.not15 = icmp eq i32 %call14, -1
br i1 %cmp.not15, label %while.end, label %while.body
while.body: ; preds = %entry, %euclid.exit11
%1 = load i32, ptr %m, align 4, !tbaa !9
%2 = load i32, ptr %n, align 4, !tbaa !9
%cmp4.i = icmp eq i32 %2, 0
br i1 %cmp4.i, label %euclid.exit11, label %if.end.i
if.end.i: ; preds = %while.body, %if.end.i
%n.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %2, %while.body ]
%m.tr5.i = phi i32 [ %n.tr6.i, %if.end.i ], [ %1, %while.body ]
%rem.i = urem i32 %m.tr5.i, %n.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %if.end.i5, label %if.end.i
if.end.i5: ; preds = %if.end.i, %if.end.i5
%n.tr6.i6 = phi i32 [ %rem.i8, %if.end.i5 ], [ %2, %if.end.i ]
%m.tr5.i7 = phi i32 [ %n.tr6.i6, %if.end.i5 ], [ %1, %if.end.i ]
%rem.i8 = urem i32 %m.tr5.i7, %n.tr6.i6
%cmp.i9 = icmp eq i32 %rem.i8, 0
br i1 %cmp.i9, label %euclid.exit11, label %if.end.i5
euclid.exit11: ; preds = %if.end.i5, %while.body
%m.tr.lcssa.i13 = phi i32 [ %1, %while.body ], [ %n.tr6.i, %if.end.i5 ]
%m.tr.lcssa.i10 = phi i32 [ %1, %while.body ], [ %n.tr6.i6, %if.end.i5 ]
%div = udiv i32 %1, %m.tr.lcssa.i10
%mul = mul i32 %div, %2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.tr.lcssa.i13, i32 noundef %mul)
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %3, ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n) #5
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %euclid.exit11, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @euclid(i32 noundef %m, i32 noundef %n) local_unnamed_addr #4 {
entry:
%cmp4 = icmp eq i32 %n, 0
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%n.tr6 = phi i32 [ %rem, %if.end ], [ %n, %entry ]
%m.tr5 = phi i32 [ %n.tr6, %if.end ], [ %m, %entry ]
%rem = urem i32 %m.tr5, %n.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
%m.tr.lcssa = phi i32 [ %m, %entry ], [ %n.tr6, %if.end ]
ret i32 %m.tr.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
/* ltzzさん、FE合格おめでとう。僕もなんか受けてみます。 */
int main(){
int a,b,c,d,e,f;
while(scanf("%d %d",&a,&b)!=EOF){
/* 大きい方をaに入れたい */
if(a<b){c=a;a=b;b=c;}
/* ユークリッドさんの互助会 */
c=a;d=b;
while((e=c%d) !=0){
c=d;d=e;
}
/* 大きい方の倍数を小さい方で割り切れればおk*/
for(f=1;f<=b;f++){
if((a*f%b)==0)break;
}
printf("%d %d\n",d,a*f);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122237/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122237/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not25 = icmp eq i32 %call24, -1
br i1 %cmp.not25, label %while.end12, label %while.body
while.body: ; preds = %entry, %for.end
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp slt i32 %0, %1
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %while.body
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%2 = phi i32 [ %0, %if.then ], [ %1, %while.body ]
%3 = phi i32 [ %1, %if.then ], [ %0, %while.body ]
br label %while.cond2
while.cond2: ; preds = %while.cond2, %if.end
%d.0 = phi i32 [ %2, %if.end ], [ %rem, %while.cond2 ]
%c.0 = phi i32 [ %3, %if.end ], [ %d.0, %while.cond2 ]
%rem = srem i32 %c.0, %d.0
%cmp3.not = icmp eq i32 %rem, 0
br i1 %cmp3.not, label %for.cond.preheader, label %while.cond2, !llvm.loop !9
for.cond.preheader: ; preds = %while.cond2
%cmp5.not21 = icmp slt i32 %2, 1
br i1 %cmp5.not21, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%4 = add nuw i32 %2, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%f.022 = phi i32 [ %inc, %for.inc ], [ 1, %for.body.preheader ]
%mul = mul nsw i32 %f.022, %3
%rem6 = srem i32 %mul, %2
%cmp7 = icmp eq i32 %rem6, 0
br i1 %cmp7, label %for.end, label %for.inc
for.inc: ; preds = %for.body
%inc = add nuw i32 %f.022, 1
%exitcond.not = icmp eq i32 %f.022, %2
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.inc, %for.body, %for.cond.preheader
%f.0.lcssa = phi i32 [ 1, %for.cond.preheader ], [ %f.022, %for.body ], [ %4, %for.inc ]
%mul10 = mul nsw i32 %f.0.lcssa, %3
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %d.0, i32 noundef %mul10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end12, label %while.body, !llvm.loop !12
while.end12: ; preds = %for.end, %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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
void swap(int *i, int *j)
{
*i += *j;
*j = *i - *j;
*i -= *j;
}
int search(int a, int b)
{
a %= b;
if (a){
search(b, a);
}
else {
return (b);
}
}
int main(void)
{
int a, b;
long int lcd, gcd; /*gcd = 最大公約数、lcd = 最小公倍数*/
while (scanf("%d %d", &a, &b) != EOF){
if (a < b){
swap(&a, &b);
}
gcd = search(a, b);
lcd = a / gcd * b;
printf("%d %d\n", gcd, lcd);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122280/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122280/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(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 %j, align 4, !tbaa !5
%1 = load i32, ptr %i, align 4, !tbaa !5
%add = add nsw i32 %1, %0
store i32 %add, ptr %i, align 4, !tbaa !5
%2 = load i32, ptr %j, align 4, !tbaa !5
%sub = sub nsw i32 %add, %2
store i32 %sub, ptr %j, align 4, !tbaa !5
%3 = load i32, ptr %i, align 4, !tbaa !5
%sub1 = sub nsw i32 %3, %sub
store i32 %sub1, ptr %i, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @search(i32 noundef %a, i32 noundef returned %b) local_unnamed_addr #1 {
entry:
%rem6 = srem i32 %a, %b
%tobool.not7.not = icmp eq i32 %rem6, 0
br i1 %tobool.not7.not, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%rem11 = phi i32 [ %rem, %if.then ], [ %rem6, %entry ]
%b.tr8 = phi i32 [ %rem11, %if.then ], [ %b, %entry ]
%rem = srem i32 %b.tr8, %rem11
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret i32 %b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not8 = icmp eq i32 %call7, -1
br i1 %cmp.not8, label %while.end, label %while.body
while.body: ; preds = %entry, %search.exit
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp slt i32 %0, %1
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %while.body
store i32 %0, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%2 = phi i32 [ %0, %if.then ], [ %1, %while.body ]
%3 = phi i32 [ %1, %if.then ], [ %0, %while.body ]
%.fr = freeze i32 %3
%rem6.i = srem i32 %.fr, %2
%tobool.not7.not.i = icmp eq i32 %rem6.i, 0
br i1 %tobool.not7.not.i, label %search.exit, label %if.then.i
if.then.i: ; preds = %if.end, %if.then.i
%rem11.i = phi i32 [ %rem.i, %if.then.i ], [ %rem6.i, %if.end ]
%b.tr8.i = phi i32 [ %rem11.i, %if.then.i ], [ %2, %if.end ]
%rem.i = srem i32 %b.tr8.i, %rem11.i
%tobool.not.i = icmp eq i32 %rem.i, 0
br i1 %tobool.not.i, label %search.exit, label %if.then.i
search.exit: ; preds = %if.then.i, %if.end
%conv = sext i32 %2 to i64
%conv3 = sext i32 %.fr to i64
%4 = srem i64 %conv3, %conv
%mul = sub nsw i64 %conv3, %4
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %conv, i64 noundef %mul)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %search.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
void swap(unsigned long *a, unsigned long *b) {
unsigned long tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
unsigned long gcd(unsigned long a, unsigned long b) {
unsigned long tmp;
while (b) {
tmp = b;
b = a % b;
a = tmp;
}
return a;
}
unsigned long lcm(unsigned long a, unsigned long b) {
return a / gcd(a, b) * b;
}
int main(void) {
unsigned long a, b;
while (scanf("%lu %lu", &a, &b) != EOF) {
if (a < b) swap(&a, &b);
printf("%lu %lu\n", gcd(a, b), lcm(a, b));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122330/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122330/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%lu %lu\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lu %lu\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 i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
store i64 %1, ptr %a, align 8, !tbaa !5
store i64 %0, ptr %b, align 8, !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 norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.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 = urem i64 %a.addr.06, %b.addr.05
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
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 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.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 = urem i64 %a.addr.06.i, %b.addr.05.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !9
gcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = udiv i64 %a, %a.addr.0.lcssa.i
%mul = mul i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
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
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not8 = icmp eq i32 %call7, -1
br i1 %cmp.not8, label %while.end, label %while.body
while.body: ; preds = %entry, %lcm.exit
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp1 = icmp ult i64 %0, %1
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %while.body
store i64 %1, ptr %a, align 8, !tbaa !5
store i64 %0, ptr %b, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%2 = phi i64 [ %1, %if.then ], [ %0, %while.body ]
%3 = phi i64 [ %0, %if.then ], [ %1, %while.body ]
%tobool.not4.i = icmp eq i64 %3, 0
br i1 %tobool.not4.i, label %lcm.exit, label %while.body.i
while.body.i: ; preds = %if.end, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %2, %if.end ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %3, %if.end ]
%rem.i = urem i64 %a.addr.06.i, %b.addr.05.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %while.body.i.i, label %while.body.i, !llvm.loop !9
while.body.i.i: ; preds = %while.body.i, %while.body.i.i
%a.addr.06.i.i = phi i64 [ %b.addr.05.i.i, %while.body.i.i ], [ %2, %while.body.i ]
%b.addr.05.i.i = phi i64 [ %rem.i.i, %while.body.i.i ], [ %3, %while.body.i ]
%rem.i.i = urem i64 %a.addr.06.i.i, %b.addr.05.i.i
%tobool.not.i.i = icmp eq i64 %rem.i.i, 0
br i1 %tobool.not.i.i, label %lcm.exit, label %while.body.i.i, !llvm.loop !9
lcm.exit: ; preds = %while.body.i.i, %if.end
%a.addr.0.lcssa.i6 = phi i64 [ %2, %if.end ], [ %b.addr.05.i, %while.body.i.i ]
%a.addr.0.lcssa.i.i = phi i64 [ %2, %if.end ], [ %b.addr.05.i.i, %while.body.i.i ]
%div.i = udiv i64 %2, %a.addr.0.lcssa.i.i
%mul.i = mul i64 %div.i, %3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %a.addr.0.lcssa.i6, i64 noundef %mul.i)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %lcm.exit, %entry
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: 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 = { 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 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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) {
long long int a = 0, b = 0, c = 0, tmp = 0, r = 0;
while ( scanf("%d %d",&a,&b) != EOF ) {
r = a*b;
if ( b > a ) {
tmp = b;
b = a;
a = tmp;
}
while ( b > 0 ) {
c = b;
b = a % b;
a = c;
}
printf("%d %d\n",a,(r / a));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122374/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122374/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
store i64 0, ptr %a, align 8, !tbaa !5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
store i64 0, ptr %b, align 8, !tbaa !5
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not11 = icmp eq i32 %call10, -1
br i1 %cmp.not11, label %while.end6, label %while.body
while.body: ; preds = %entry, %while.end
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%cmp1 = icmp sgt i64 %1, %0
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %while.body
store i64 %0, ptr %b, align 8, !tbaa !5
store i64 %1, ptr %a, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%a.promoted = phi i64 [ %1, %if.then ], [ %0, %while.body ]
%.pr = phi i64 [ %0, %if.then ], [ %1, %while.body ]
%cmp39 = icmp sgt i64 %.pr, 0
br i1 %cmp39, label %while.body4, label %while.end
while.body4: ; preds = %if.end, %while.body4
%2 = phi i64 [ %rem, %while.body4 ], [ %.pr, %if.end ]
%3 = phi i64 [ %2, %while.body4 ], [ %a.promoted, %if.end ]
%rem = srem i64 %3, %2
%cmp3 = icmp sgt i64 %rem, 0
br i1 %cmp3, label %while.body4, label %while.cond2.while.end_crit_edge, !llvm.loop !9
while.cond2.while.end_crit_edge: ; preds = %while.body4
store i64 %rem, ptr %b, align 8, !tbaa !5
store i64 %2, ptr %a, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond2.while.end_crit_edge, %if.end
%4 = phi i64 [ %2, %while.cond2.while.end_crit_edge ], [ %a.promoted, %if.end ]
%div = sdiv i64 %mul, %4
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4, i64 noundef %div)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end6, label %while.body, !llvm.loop !11
while.end6: ; preds = %while.end, %entry
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int m,n,g,l,work,a,b;
while(scanf("%d%d",&m,&n)!=EOF){
a=m;
b=n;
if(m<n){
work=m;
m=n;
n=work;
}
while(n!=0){
work=m%n;
m=n;
n=work;
}
g=m;
l=a/g;
l*=b;
printf("%d %d\n",g,l);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122424/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122424/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%cmp.not14 = icmp eq i32 %call13, -1
br i1 %cmp.not14, label %while.end6, label %while.body
while.body: ; preds = %entry, %while.end
%0 = load i32, ptr %m, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %0, %1
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %while.body
store i32 %1, ptr %m, align 4, !tbaa !5
store i32 %0, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%m.promoted = phi i32 [ %1, %if.then ], [ %0, %while.body ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %while.body ]
%cmp3.not12 = icmp eq i32 %.pr, 0
br i1 %cmp3.not12, label %while.end, label %while.body4
while.body4: ; preds = %if.end, %while.body4
%2 = phi i32 [ %rem, %while.body4 ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body4 ], [ %m.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp3.not = icmp eq i32 %rem, 0
br i1 %cmp3.not, label %while.cond2.while.end_crit_edge, label %while.body4, !llvm.loop !9
while.cond2.while.end_crit_edge: ; preds = %while.body4
store i32 %2, ptr %m, align 4, !tbaa !5
store i32 0, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond2.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond2.while.end_crit_edge ], [ %m.promoted, %if.end ]
%div = sdiv i32 %0, %4
%mul = mul nsw i32 %div, %1
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %mul)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end6, label %while.body, !llvm.loop !11
while.end6: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int gcd(int, int);
int main(void) {
int a, b, n;
while(scanf("%d %d", &a, &b) != EOF) {
n = gcd(a, b);
printf("%d %d\n", n, (a/n)*b);
}
return 0;
}
int gcd(int x, int y) {
int tmp, r;
if(x < y) {
tmp = x;
x = y;
y = tmp;
}
while(y != 0) {
r = x%y;
x = y;
y = r;
}
return x;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122468/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122468/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not5 = icmp eq i32 %call4, -1
br i1 %cmp.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %gcd.exit
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%spec.select.i = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%spec.select9.i = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%cmp1.not10.i = icmp eq i32 %spec.select.i, 0
br i1 %cmp1.not10.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %while.body, %while.body.i
%x.addr.112.i = phi i32 [ %y.addr.111.i, %while.body.i ], [ %spec.select9.i, %while.body ]
%y.addr.111.i = phi i32 [ %rem.i, %while.body.i ], [ %spec.select.i, %while.body ]
%rem.i = srem i32 %x.addr.112.i, %y.addr.111.i
%cmp1.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !9
gcd.exit: ; preds = %while.body.i, %while.body
%x.addr.1.lcssa.i = phi i32 [ %spec.select9.i, %while.body ], [ %y.addr.111.i, %while.body.i ]
%div = sdiv i32 %0, %x.addr.1.lcssa.i
%mul = mul nsw i32 %div, %1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.addr.1.lcssa.i, i32 noundef %mul)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %gcd.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 {
entry:
%spec.select = tail call i32 @llvm.smin.i32(i32 %x, i32 %y)
%spec.select9 = tail call i32 @llvm.smax.i32(i32 %x, i32 %y)
%cmp1.not10 = icmp eq i32 %spec.select, 0
br i1 %cmp1.not10, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%x.addr.112 = phi i32 [ %y.addr.111, %while.body ], [ %spec.select9, %entry ]
%y.addr.111 = phi i32 [ %rem, %while.body ], [ %spec.select, %entry ]
%rem = srem i32 %x.addr.112, %y.addr.111
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%x.addr.1.lcssa = phi i32 [ %spec.select9, %entry ], [ %y.addr.111, %while.body ]
ret i32 %x.addr.1.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d %d %f\n",a/b,a%b,(double)a/(double)b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122510/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122510/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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;
int d, r;
double f;
scanf("%d %d", &a, &b);
d = a / b;
r = a % b;
f = (double)a / (double)b;
printf("%d ", d);
printf("%d ", r);
printf("%6.5f\n", f);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122554/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122554/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%6.5f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div2)
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;
double f, ans;
scanf("%d %d", &a, &b);
ans = (double)a / b;
printf("%d %d %lf\n", a / b, a % b, ans);
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122604/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122604/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"%d %d %lf\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
%conv = sitofp i32 %0 to double
%1 = load i32, ptr %b, align 4, !tbaa !5
%conv1 = sitofp i32 %1 to double
%div = fdiv double %conv, %conv1
%div2 = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div2, i32 noundef %rem, double 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 argc, const char * argv[]) {
int a,b;
int d,r;
float f,a1,b1;
scanf("%d %d",&a,&b);
a1=a;
b1=b;
d=a/b;
r=a%b;
f=a1/b1;
printf("%d %d %.5f\n",d,r,f);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122648/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122648/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %.5f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
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
%conv = sitofp i32 %0 to float
%1 = load i32, ptr %b, align 4, !tbaa !5
%conv1 = sitofp i32 %1 to float
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%div2 = fdiv float %conv, %conv1
%conv3 = fpext float %div2 to double
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %conv3)
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 %d %f", (int)a/b, a%b, a/(double)b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122691/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122691/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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 a,b,d,r;
double f;
scanf("%d%d",&a,&b);
d = (int)(a / b);
r = (int)(a % b);
f = (double)a / b;
printf("%d %d %lf",d,r,f);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122734/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122734/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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 x, y;
scanf("%d %d", &x, &y);
printf("%d %d %f\n", x/y, x%y, (double)x/(double)y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122778/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122778/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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 a, b;
double fa, fb;
scanf("%d %d", &a, &b);
fa = a;
fb = b;
printf("%d %d %f\n", a/b, a%b, fa/fb);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122828/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122828/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\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
%conv = sitofp i32 %0 to double
%1 = load i32, ptr %b, align 4, !tbaa !5
%conv1 = sitofp i32 %1 to double
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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 %d %.5f\n",a/b,a%b,(double)a/b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122886/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122886/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %.5f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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 <string.h>
int main(void)
{
int i,count=0;
char s[17];
scanf("%s",s);
if(s[0]!='C'){
count++;
}
if(s[1]!='O'){
count++;
}
if(s[2]!='D'){
count++;
}
if(s[3]!='E'){
count++;
}
if(s[4]!='F'){
count++;
}
if(s[5]!='E'){
count++;
}
if(s[6]!='S'){
count++;
}
if(s[7]!='T'){
count++;
}
if(s[8]!='I'){
count++;
}
if(s[9]!='V'){
count++;
}
if(s[10]!='A'){
count++;
}
if(s[11]!='L'){
count++;
}
if(s[12]!='2'){
count++;
}
if(s[13]!='0'){
count++;
}
if(s[14]!='1'){
count++;
}
if(s[15]!='6'){
count++;
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122929/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122929/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [17 x i8], align 16
call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not = icmp ne i8 %0, 67
%spec.select = zext i1 %cmp.not to i32
%arrayidx2 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp4.not = icmp eq i8 %1, 79
%inc7 = select i1 %cmp.not, i32 2, i32 1
%count.1 = select i1 %cmp4.not, i32 %spec.select, i32 %inc7
%arrayidx9 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 2
%2 = load <8 x i8>, ptr %arrayidx9, align 2, !tbaa !5
%3 = icmp ne <8 x i8> %2, <i8 68, i8 69, i8 70, i8 69, i8 83, i8 84, i8 73, i8 86>
%arrayidx65 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 10
%4 = load <4 x i8>, ptr %arrayidx65, align 2, !tbaa !5
%5 = icmp ne <4 x i8> %4, <i8 65, i8 76, i8 50, i8 48>
%arrayidx93 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 14
%6 = load i8, ptr %arrayidx93, align 2, !tbaa !5
%cmp95.not = icmp ne i8 %6, 49
%inc98 = zext i1 %cmp95.not to i32
%arrayidx100 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 15
%7 = load i8, ptr %arrayidx100, align 1, !tbaa !5
%cmp102.not = icmp ne i8 %7, 54
%inc105 = zext i1 %cmp102.not to i32
%8 = bitcast <8 x i1> %3 to i8
%9 = call i8 @llvm.ctpop.i8(i8 %8), !range !8
%10 = zext i8 %9 to i32
%11 = bitcast <4 x i1> %5 to i4
%12 = call i4 @llvm.ctpop.i4(i4 %11), !range !9
%13 = zext i4 %12 to i32
%op.rdx = add nuw nsw i32 %10, %13
%op.rdx124 = add nuw nsw i32 %op.rdx, %inc98
%op.rdx125 = add nuw nsw i32 %count.1, %inc105
%op.rdx126 = add nuw nsw i32 %op.rdx124, %op.rdx125
%call107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %op.rdx126)
call void @llvm.lifetime.end.p0(i64 17, 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 i8 @llvm.ctpop.i8(i8) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i4 @llvm.ctpop.i4(i4) #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 = !{i8 0, i8 9}
!9 = !{i4 0, i4 5}
|
#include <stdio.h>
#include <stdlib.h>
#define INIT_CAP 10
#define INF 1000000000
#define min(a, b) (((a) < (b)) ? (a) : (b))
typedef struct {
int to, w;
} Edge;
typedef struct {
Edge *elem;
int cap, size;
} VecEdge;
typedef struct {
int num, d;
} PNumDis;
VecEdge adj[65536];
PNumDis heap[1048576];
int hsize;
int d[65536];
void init(int n) {
while (n--)
adj[n] = (VecEdge){malloc(sizeof(Edge) * INIT_CAP), INIT_CAP, 0};
}
void add(int from, int to, int w) {
if (adj[from].size == adj[from].cap) {
adj[from].cap <<= 1;
adj[from].elem = realloc(adj[from].elem, sizeof(Edge) * adj[from].cap);
}
adj[from].elem[adj[from].size++] = (Edge){to, w};
}
void freeAll(int n) {
while (n--)
free(adj[n].elem);
}
void insert(int num, int d) {
int i;
for (i = hsize++; i > 0 && d < heap[i - 1 >> 1].d; i = i - 1 >> 1)
heap[i] = heap[i - 1 >> 1];
heap[i] = (PNumDis){num, d};
}
int calcNextIdx(int i) {
return i * 2 + 1 + (i * 2 + 2 < hsize && heap[i * 2 + 1].d > heap[i * 2 + 2].d);
}
PNumDis delete(void) {
int i;
int nextIdx;
const PNumDis root = heap[0], last = heap[--hsize];
for (i = 0; i * 2 + 1 < hsize && last.d > heap[nextIdx = calcNextIdx(i)].d; i = nextIdx)
heap[i] = heap[nextIdx];
heap[i] = last;
return root;
}
void dijkstra(int n, int s) {
int i;
for (i = 0; i < n; i++)
d[i] = INF;
d[s] = 0;
insert(s, 0);
while (hsize > 0) {
const PNumDis fromP = delete();
if (fromP.d > d[fromP.num])
continue;
for (i = 0; i < adj[fromP.num].size; i++) {
const Edge e = adj[fromP.num].elem[i];
if (fromP.d + e.w < d[e.to]) {
d[e.to] = fromP.d + e.w;
insert(e.to, d[e.to]);
}
}
}
}
int main(void) {
int i, j, k;
int n, t[16][17];
int v;
while (scanf("%d", &n), n) {
for (i = 0; i < n; i++)
for (j = 0; j <= n; j++)
scanf("%d", t[i] + j);
v = 1;
for (i = 0; i < n; i++)
v <<= 1;
init(v);
for (i = 0; i < v - 1; i++)
for (j = 0; j < n; j++)
if (!(i & 1 << j)) {
int min = t[j][0];
for (k = 0; k < n; k++)
if (i & 1 << k)
min = min(min, t[j][k + 1]);
add(i, i | 1 << j, min);
}
dijkstra(v, 0);
printf("%d\n", d[v - 1]);
freeAll(v);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122972/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122972/source.c"
target datalayout = "e-m:e-p270: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.VecEdge = type { ptr, i32, i32 }
%struct.PNumDis = type { i32, i32 }
%struct.Edge = type { i32, i32 }
@adj = dso_local local_unnamed_addr global [65536 x %struct.VecEdge] zeroinitializer, align 16
@hsize = dso_local local_unnamed_addr global i32 0, align 4
@heap = dso_local local_unnamed_addr global [1048576 x %struct.PNumDis] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [65536 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 nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable
define dso_local void @init(i32 noundef %n) local_unnamed_addr #0 {
entry:
%tobool.not2 = icmp eq i32 %n, 0
br i1 %tobool.not2, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%0 = sext i32 %n to i64
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv = phi i64 [ %0, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv.next
%call = tail call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #12
store ptr %call, ptr %arrayidx, align 16, !tbaa.struct !5
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8
store i32 10, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !12
%.compoundliteral.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 12
store i32 0, ptr %.compoundliteral.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !13
%1 = and i64 %indvars.iv.next, 4294967295
%tobool.not = icmp eq i64 %1, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @add(i32 noundef %from, i32 noundef %to, i32 noundef %w) local_unnamed_addr #2 {
entry:
%idxprom = sext i32 %from to i64
%arrayidx = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom
%size = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom, i32 2
%0 = load i32, ptr %size, align 4, !tbaa !16
%cap = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom, i32 1
%1 = load i32, ptr %cap, align 8, !tbaa !18
%cmp = icmp eq i32 %0, %1
%.pre = load ptr, ptr %arrayidx, align 16, !tbaa !19
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%shl = shl i32 %0, 1
store i32 %shl, ptr %cap, align 8, !tbaa !18
%conv = sext i32 %shl to i64
%mul = shl nsw i64 %conv, 3
%call = tail call ptr @realloc(ptr noundef %.pre, i64 noundef %mul) #13
store ptr %call, ptr %arrayidx, align 16, !tbaa !19
%.pre31 = load i32, ptr %size, align 4, !tbaa !16
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre31, %if.then ], [ %0, %entry ]
%3 = phi ptr [ %call, %if.then ], [ %.pre, %entry ]
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %size, align 4, !tbaa !16
%idxprom20 = sext i32 %2 to i64
%arrayidx21 = getelementptr inbounds %struct.Edge, ptr %3, i64 %idxprom20
store i32 %to, ptr %arrayidx21, align 4, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx21.sroa_idx = getelementptr inbounds i8, ptr %arrayidx21, i64 4
store i32 %w, ptr %.compoundliteral.sroa.2.0.arrayidx21.sroa_idx, align 4, !tbaa.struct !13
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #3
; Function Attrs: nounwind uwtable
define dso_local void @freeAll(i32 noundef %n) local_unnamed_addr #4 {
entry:
%tobool.not2 = icmp eq i32 %n, 0
br i1 %tobool.not2, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%0 = sext i32 %n to i64
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv = phi i64 [ %0, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv.next
%1 = load ptr, ptr %arrayidx, align 16, !tbaa !19
tail call void @free(ptr noundef %1) #14
%2 = and i64 %indvars.iv.next, 4294967295
%tobool.not = icmp eq i64 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !20
while.end: ; preds = %while.body, %entry
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @insert(i32 noundef %num, i32 noundef %d) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr @hsize, align 4, !tbaa !10
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @hsize, align 4, !tbaa !10
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %land.rhs, label %for.end
land.rhs: ; preds = %entry, %for.body
%i.022 = phi i32 [ %shr, %for.body ], [ %0, %entry ]
%sub = add nsw i32 %i.022, -1
%shr = lshr i32 %sub, 1
%idxprom = zext i32 %shr to i64
%d1 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom, i32 1
%1 = load i32, ptr %d1, align 4, !tbaa !21
%cmp2 = icmp sgt i32 %1, %d
br i1 %cmp2, label %for.body, label %for.end
for.body: ; preds = %land.rhs
%arrayidx = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom
%idxprom3 = zext i32 %i.022 to i64
%arrayidx4 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom3
%2 = load i64, ptr %arrayidx, align 8
store i64 %2, ptr %arrayidx4, align 8
%cmp.not = icmp ult i32 %sub, 2
br i1 %cmp.not, label %for.end, label %land.rhs, !llvm.loop !23
for.end: ; preds = %land.rhs, %for.body, %entry
%i.0.lcssa = phi i32 [ %0, %entry ], [ %shr, %for.body ], [ %i.022, %land.rhs ]
%idxprom11 = sext i32 %i.0.lcssa to i64
%arrayidx12 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom11
store i32 %num, ptr %arrayidx12, align 8, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx12.sroa_idx = getelementptr inbounds i8, ptr %arrayidx12, i64 4
store i32 %d, ptr %.compoundliteral.sroa.2.0.arrayidx12.sroa_idx, align 4, !tbaa.struct !13
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #7
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #7
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @calcNextIdx(i32 noundef %i) local_unnamed_addr #8 {
entry:
%mul = shl nsw i32 %i, 1
%add = or i32 %mul, 1
%add2 = add nsw i32 %mul, 2
%0 = load i32, ptr @hsize, align 4, !tbaa !10
%cmp = icmp slt i32 %add2, %0
br i1 %cmp, label %land.rhs, label %land.end
land.rhs: ; preds = %entry
%idxprom = sext i32 %add to i64
%d = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom, i32 1
%1 = load i32, ptr %d, align 4, !tbaa !21
%idxprom7 = sext i32 %add2 to i64
%d9 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom7, i32 1
%2 = load i32, ptr %d9, align 4, !tbaa !21
%cmp10 = icmp sgt i32 %1, %2
%3 = zext i1 %cmp10 to i32
br label %land.end
land.end: ; preds = %land.rhs, %entry
%land.ext = phi i32 [ 0, %entry ], [ %3, %land.rhs ]
%add11 = add nsw i32 %land.ext, %add
ret i32 %add11
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @delete() local_unnamed_addr #6 {
entry:
%retval.sroa.0.0.copyload = load i64, ptr @heap, align 16, !tbaa.struct !12
%0 = load i32, ptr @hsize, align 4, !tbaa !10
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @hsize, align 4, !tbaa !10
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom
%last.sroa.0.0.copyload = load i32, ptr %arrayidx, align 8, !tbaa.struct !12
%last.sroa.4.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%last.sroa.4.0.copyload = load i32, ptr %last.sroa.4.0.arrayidx.sroa_idx, align 4, !tbaa.struct !13
%cmp17 = icmp sgt i32 %0, 2
br i1 %cmp17, label %land.rhs, label %for.end
land.rhs: ; preds = %entry, %for.body
%add20 = phi i32 [ %add, %for.body ], [ 1, %entry ]
%mul19 = phi i32 [ %mul, %for.body ], [ 0, %entry ]
%i.018 = phi i32 [ %add11.i, %for.body ], [ 0, %entry ]
%add2.i = add nsw i32 %mul19, 2
%cmp.i = icmp slt i32 %add2.i, %dec
br i1 %cmp.i, label %land.rhs.i, label %calcNextIdx.exit
land.rhs.i: ; preds = %land.rhs
%idxprom.i = sext i32 %add20 to i64
%d.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i, i32 1
%1 = load i32, ptr %d.i, align 4, !tbaa !21
%idxprom7.i = sext i32 %add2.i to i64
%d9.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom7.i, i32 1
%2 = load i32, ptr %d9.i, align 4, !tbaa !21
%cmp10.i = icmp sgt i32 %1, %2
%3 = zext i1 %cmp10.i to i32
br label %calcNextIdx.exit
calcNextIdx.exit: ; preds = %land.rhs, %land.rhs.i
%land.ext.i = phi i32 [ 0, %land.rhs ], [ %3, %land.rhs.i ]
%add11.i = add nsw i32 %land.ext.i, %add20
%idxprom1 = sext i32 %add11.i to i64
%d3 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom1, i32 1
%4 = load i32, ptr %d3, align 4, !tbaa !21
%cmp4 = icmp sgt i32 %last.sroa.4.0.copyload, %4
br i1 %cmp4, label %for.body, label %for.end.loopexit
for.body: ; preds = %calcNextIdx.exit
%arrayidx2 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom1
%idxprom5 = sext i32 %i.018 to i64
%arrayidx6 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom5
%5 = load i64, ptr %arrayidx2, align 8
store i64 %5, ptr %arrayidx6, align 8
%mul = shl nsw i32 %add11.i, 1
%add = or i32 %mul, 1
%cmp = icmp slt i32 %add, %dec
br i1 %cmp, label %land.rhs, label %for.end.loopexit, !llvm.loop !24
for.end.loopexit: ; preds = %for.body, %calcNextIdx.exit
%i.0.lcssa.ph = phi i32 [ %i.018, %calcNextIdx.exit ], [ %add11.i, %for.body ]
%6 = sext i32 %i.0.lcssa.ph to i64
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i64 [ 0, %entry ], [ %6, %for.end.loopexit ]
%arrayidx10 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %i.0.lcssa
store i32 %last.sroa.0.0.copyload, ptr %arrayidx10, align 8, !tbaa.struct !12
%last.sroa.4.0.arrayidx10.sroa_idx = getelementptr inbounds i8, ptr %arrayidx10, i64 4
store i32 %last.sroa.4.0.copyload, ptr %last.sroa.4.0.arrayidx10.sroa_idx, align 4, !tbaa.struct !13
ret i64 %retval.sroa.0.0.copyload
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @dijkstra(i32 noundef %n, i32 noundef %s) local_unnamed_addr #9 {
entry:
%cmp75 = icmp sgt i32 %n, 0
br i1 %cmp75, label %for.body.preheader, label %for.end
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.preheader100, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds [65536 x i32], ptr @d, i64 0, i64 %index
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %0, align 16, !tbaa !10
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %1, align 16, !tbaa !10
%index.next = add nuw i64 %index, 8
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !25
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.preheader100
for.body.preheader100: ; 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.preheader100, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader100 ]
%arrayidx = getelementptr inbounds [65536 x i32], ptr @d, i64 0, i64 %indvars.iv
store i32 1000000000, ptr %arrayidx, align 4, !tbaa !10
%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 !28
for.end: ; preds = %for.body, %middle.block, %entry
%idxprom1 = sext i32 %s to i64
%arrayidx2 = getelementptr inbounds [65536 x i32], ptr @d, i64 0, i64 %idxprom1
store i32 0, ptr %arrayidx2, align 4, !tbaa !10
%3 = load i32, ptr @hsize, align 4, !tbaa !10
%inc.i = add nsw i32 %3, 1
store i32 %inc.i, ptr @hsize, align 4, !tbaa !10
%cmp21.i = icmp sgt i32 %3, 0
br i1 %cmp21.i, label %land.rhs.i, label %insert.exit
land.rhs.i: ; preds = %for.end, %for.body.i
%i.022.i = phi i32 [ %shr.i, %for.body.i ], [ %3, %for.end ]
%sub.i = add nsw i32 %i.022.i, -1
%shr.i = lshr i32 %sub.i, 1
%idxprom.i = zext i32 %shr.i to i64
%d1.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i, i32 1
%4 = load i32, ptr %d1.i, align 4, !tbaa !21
%cmp2.i = icmp sgt i32 %4, 0
br i1 %cmp2.i, label %for.body.i, label %insert.exit
for.body.i: ; preds = %land.rhs.i
%arrayidx.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i
%idxprom3.i = zext i32 %i.022.i to i64
%arrayidx4.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom3.i
%5 = load i64, ptr %arrayidx.i, align 8
store i64 %5, ptr %arrayidx4.i, align 8
%cmp.not.i = icmp ult i32 %sub.i, 2
br i1 %cmp.not.i, label %insert.exit, label %land.rhs.i, !llvm.loop !23
insert.exit: ; preds = %land.rhs.i, %for.body.i, %for.end
%i.0.lcssa.i = phi i32 [ %3, %for.end ], [ %i.022.i, %land.rhs.i ], [ %shr.i, %for.body.i ]
%idxprom11.i = sext i32 %i.0.lcssa.i to i64
%arrayidx12.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom11.i
store i32 %s, ptr %arrayidx12.i, align 8, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx12.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx12.i, i64 4
store i32 0, ptr %.compoundliteral.sroa.2.0.arrayidx12.sroa_idx.i, align 4, !tbaa.struct !13
%cmp386 = icmp sgt i32 %3, -1
br i1 %cmp386, label %while.body, label %while.end
while.body: ; preds = %insert.exit, %cleanup
%hsize.promoted8387 = phi i32 [ %hsize.promoted84, %cleanup ], [ %inc.i, %insert.exit ]
%retval.sroa.0.0.copyload.i = load i64, ptr @heap, align 16, !tbaa.struct !12
%dec.i = add nsw i32 %hsize.promoted8387, -1
store i32 %dec.i, ptr @hsize, align 4, !tbaa !10
%idxprom.i51 = zext i32 %dec.i to i64
%arrayidx.i52 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i51
%last.sroa.0.0.copyload.i = load i32, ptr %arrayidx.i52, align 8, !tbaa.struct !12
%last.sroa.4.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i52, i64 4
%last.sroa.4.0.copyload.i = load i32, ptr %last.sroa.4.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !13
%cmp17.i = icmp ugt i32 %hsize.promoted8387, 2
br i1 %cmp17.i, label %land.rhs.i54, label %delete.exit
land.rhs.i54: ; preds = %while.body, %for.body.i55
%add20.i = phi i32 [ %add.i, %for.body.i55 ], [ 1, %while.body ]
%mul19.i = phi i32 [ %mul.i, %for.body.i55 ], [ 0, %while.body ]
%i.018.i = phi i32 [ %add11.i.i, %for.body.i55 ], [ 0, %while.body ]
%add2.i.i = add nsw i32 %mul19.i, 2
%cmp.i.i = icmp slt i32 %add2.i.i, %dec.i
br i1 %cmp.i.i, label %land.rhs.i.i, label %calcNextIdx.exit.i
land.rhs.i.i: ; preds = %land.rhs.i54
%idxprom.i.i = sext i32 %add20.i to i64
%d.i.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i.i, i32 1
%6 = load i32, ptr %d.i.i, align 4, !tbaa !21
%idxprom7.i.i = sext i32 %add2.i.i to i64
%d9.i.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom7.i.i, i32 1
%7 = load i32, ptr %d9.i.i, align 4, !tbaa !21
%cmp10.i.i = icmp sgt i32 %6, %7
%8 = zext i1 %cmp10.i.i to i32
br label %calcNextIdx.exit.i
calcNextIdx.exit.i: ; preds = %land.rhs.i.i, %land.rhs.i54
%land.ext.i.i = phi i32 [ 0, %land.rhs.i54 ], [ %8, %land.rhs.i.i ]
%add11.i.i = add nsw i32 %land.ext.i.i, %add20.i
%idxprom1.i = sext i32 %add11.i.i to i64
%d3.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom1.i, i32 1
%9 = load i32, ptr %d3.i, align 4, !tbaa !21
%cmp4.i = icmp sgt i32 %last.sroa.4.0.copyload.i, %9
br i1 %cmp4.i, label %for.body.i55, label %calcNextIdx.exit.i.for.end.loopexit.i_crit_edge
calcNextIdx.exit.i.for.end.loopexit.i_crit_edge: ; preds = %calcNextIdx.exit.i
%.pre = sext i32 %i.018.i to i64
br label %delete.exit
for.body.i55: ; preds = %calcNextIdx.exit.i
%arrayidx2.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom1.i
%idxprom5.i = sext i32 %i.018.i to i64
%arrayidx6.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom5.i
%10 = load i64, ptr %arrayidx2.i, align 8
store i64 %10, ptr %arrayidx6.i, align 8
%mul.i = shl nsw i32 %add11.i.i, 1
%add.i = or i32 %mul.i, 1
%cmp.i = icmp slt i32 %add.i, %dec.i
br i1 %cmp.i, label %land.rhs.i54, label %delete.exit, !llvm.loop !24
delete.exit: ; preds = %for.body.i55, %calcNextIdx.exit.i.for.end.loopexit.i_crit_edge, %while.body
%i.0.lcssa.i53 = phi i64 [ 0, %while.body ], [ %.pre, %calcNextIdx.exit.i.for.end.loopexit.i_crit_edge ], [ %idxprom1.i, %for.body.i55 ]
%arrayidx10.i = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %i.0.lcssa.i53
store i32 %last.sroa.0.0.copyload.i, ptr %arrayidx10.i, align 8, !tbaa.struct !12
%last.sroa.4.0.arrayidx10.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx10.i, i64 4
store i32 %last.sroa.4.0.copyload.i, ptr %last.sroa.4.0.arrayidx10.sroa_idx.i, align 4, !tbaa.struct !13
%fromP.sroa.6.0.extract.shift = lshr i64 %retval.sroa.0.0.copyload.i, 32
%fromP.sroa.6.0.extract.trunc = trunc i64 %fromP.sroa.6.0.extract.shift to i32
%sext = shl i64 %retval.sroa.0.0.copyload.i, 32
%idxprom4 = ashr exact i64 %sext, 32
%arrayidx5 = getelementptr inbounds [65536 x i32], ptr @d, i64 0, i64 %idxprom4
%11 = load i32, ptr %arrayidx5, align 4, !tbaa !10
%cmp6 = icmp slt i32 %11, %fromP.sroa.6.0.extract.trunc
br i1 %cmp6, label %cleanup, label %for.cond7.preheader, !llvm.loop !29
for.cond7.preheader: ; preds = %delete.exit
%size = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom4, i32 2
%12 = load i32, ptr %size, align 4, !tbaa !16
%cmp1179 = icmp sgt i32 %12, 0
br i1 %cmp1179, label %for.body12.lr.ph, label %cleanup
for.body12.lr.ph: ; preds = %for.cond7.preheader
%arrayidx10 = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom4
%13 = load ptr, ptr %arrayidx10, align 16, !tbaa !19
%wide.trip.count92 = zext i32 %12 to i64
br label %for.body12
for.body12: ; preds = %for.body12.lr.ph, %if.end33
%indvars.iv89 = phi i64 [ 0, %for.body12.lr.ph ], [ %indvars.iv.next90, %if.end33 ]
%inc.i567880 = phi i32 [ %dec.i, %for.body12.lr.ph ], [ %inc.i5677, %if.end33 ]
%arrayidx17 = getelementptr inbounds %struct.Edge, ptr %13, i64 %indvars.iv89
%e.sroa.0.0.copyload = load i32, ptr %arrayidx17, align 4, !tbaa.struct !12
%e.sroa.7.0.arrayidx17.sroa_idx = getelementptr inbounds i8, ptr %arrayidx17, i64 4
%e.sroa.7.0.copyload = load i32, ptr %e.sroa.7.0.arrayidx17.sroa_idx, align 4, !tbaa.struct !13
%add = add nsw i32 %e.sroa.7.0.copyload, %fromP.sroa.6.0.extract.trunc
%idxprom19 = sext i32 %e.sroa.0.0.copyload to i64
%arrayidx20 = getelementptr inbounds [65536 x i32], ptr @d, i64 0, i64 %idxprom19
%14 = load i32, ptr %arrayidx20, align 4, !tbaa !10
%cmp21 = icmp slt i32 %add, %14
br i1 %cmp21, label %if.then22, label %if.end33
if.then22: ; preds = %for.body12
store i32 %add, ptr %arrayidx20, align 4, !tbaa !10
%inc.i56 = add nsw i32 %inc.i567880, 1
store i32 %inc.i56, ptr @hsize, align 4, !tbaa !10
%cmp21.i57 = icmp sgt i32 %inc.i567880, 0
br i1 %cmp21.i57, label %land.rhs.i62, label %insert.exit74
land.rhs.i62: ; preds = %if.then22, %for.body.i69
%i.022.i63 = phi i32 [ %shr.i65, %for.body.i69 ], [ %inc.i567880, %if.then22 ]
%sub.i64 = add nsw i32 %i.022.i63, -1
%shr.i65 = lshr i32 %sub.i64, 1
%idxprom.i66 = zext i32 %shr.i65 to i64
%d1.i67 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i66, i32 1
%15 = load i32, ptr %d1.i67, align 4, !tbaa !21
%cmp2.i68 = icmp sgt i32 %15, %add
br i1 %cmp2.i68, label %for.body.i69, label %insert.exit74
for.body.i69: ; preds = %land.rhs.i62
%arrayidx.i70 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i66
%idxprom3.i71 = zext i32 %i.022.i63 to i64
%arrayidx4.i72 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom3.i71
%16 = load i64, ptr %arrayidx.i70, align 8
store i64 %16, ptr %arrayidx4.i72, align 8
%cmp.not.i73 = icmp ult i32 %sub.i64, 2
br i1 %cmp.not.i73, label %insert.exit74, label %land.rhs.i62, !llvm.loop !23
insert.exit74: ; preds = %land.rhs.i62, %for.body.i69, %if.then22
%i.0.lcssa.i58 = phi i32 [ %inc.i567880, %if.then22 ], [ %i.022.i63, %land.rhs.i62 ], [ %shr.i65, %for.body.i69 ]
%idxprom11.i59 = sext i32 %i.0.lcssa.i58 to i64
%arrayidx12.i60 = getelementptr inbounds [1048576 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom11.i59
store i32 %e.sroa.0.0.copyload, ptr %arrayidx12.i60, align 8, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx12.sroa_idx.i61 = getelementptr inbounds i8, ptr %arrayidx12.i60, i64 4
store i32 %add, ptr %.compoundliteral.sroa.2.0.arrayidx12.sroa_idx.i61, align 4, !tbaa.struct !13
br label %if.end33
if.end33: ; preds = %insert.exit74, %for.body12
%inc.i5677 = phi i32 [ %inc.i56, %insert.exit74 ], [ %inc.i567880, %for.body12 ]
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92
br i1 %exitcond93.not, label %cleanup, label %for.body12, !llvm.loop !30
cleanup: ; preds = %if.end33, %for.cond7.preheader, %delete.exit
%hsize.promoted84 = phi i32 [ %dec.i, %delete.exit ], [ %dec.i, %for.cond7.preheader ], [ %inc.i5677, %if.end33 ]
%cmp3 = icmp sgt i32 %hsize.promoted84, 0
br i1 %cmp3, label %while.body, label %while.end
while.end: ; preds = %cleanup, %insert.exit
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%t = alloca [16 x [17 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #14
call void @llvm.lifetime.start.p0(i64 1088, ptr nonnull %t) #14
%call114 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !10
%tobool.not115 = icmp eq i32 %0, 0
br i1 %tobool.not115, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %freeAll.exit
%1 = phi i32 [ %36, %freeAll.exit ], [ %0, %entry ]
%cmp98 = icmp sgt i32 %1, 0
br i1 %cmp98, label %for.cond1.preheader, label %while.body.preheader.i
for.cond8.preheader: ; preds = %for.inc5
%cmp9100 = icmp sgt i32 %6, 0
br i1 %cmp9100, label %for.body10.preheader, label %while.body.preheader.i
for.body10.preheader: ; preds = %for.cond8.preheader
%xtraiter = and i32 %6, 7
%2 = icmp ult i32 %6, 8
br i1 %2, label %for.end13.unr-lcssa, label %for.body10.preheader.new
for.body10.preheader.new: ; preds = %for.body10.preheader
%unroll_iter = and i32 %6, -8
br label %for.body10
for.cond1.preheader: ; preds = %for.cond.preheader, %for.inc5
%3 = phi i32 [ %6, %for.inc5 ], [ %1, %for.cond.preheader ]
%indvars.iv120 = phi i64 [ %indvars.iv.next121, %for.inc5 ], [ 0, %for.cond.preheader ]
%cmp2.not96 = icmp slt i32 %3, 0
br i1 %cmp2.not96, label %for.cond1.preheader.for.inc5_crit_edge, label %for.body3.lr.ph
for.cond1.preheader.for.inc5_crit_edge: ; preds = %for.cond1.preheader
%.pre137 = sext i32 %3 to i64
br label %for.inc5
for.body3.lr.ph: ; preds = %for.cond1.preheader
%arrayidx = getelementptr inbounds [16 x [17 x i32]], ptr %t, i64 0, i64 %indvars.iv120
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.body3
%indvars.iv = phi i64 [ 0, %for.body3.lr.ph ], [ %indvars.iv.next, %for.body3 ]
%add.ptr = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !10
%5 = sext i32 %4 to i64
%cmp2.not.not = icmp slt i64 %indvars.iv, %5
br i1 %cmp2.not.not, label %for.body3, label %for.inc5, !llvm.loop !31
for.inc5: ; preds = %for.body3, %for.cond1.preheader.for.inc5_crit_edge
%.pre-phi = phi i64 [ %.pre137, %for.cond1.preheader.for.inc5_crit_edge ], [ %5, %for.body3 ]
%6 = phi i32 [ %3, %for.cond1.preheader.for.inc5_crit_edge ], [ %4, %for.body3 ]
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
%cmp = icmp slt i64 %indvars.iv.next121, %.pre-phi
br i1 %cmp, label %for.cond1.preheader, label %for.cond8.preheader, !llvm.loop !32
for.body10: ; preds = %for.body10, %for.body10.preheader.new
%v.0102 = phi i32 [ 1, %for.body10.preheader.new ], [ %shl, %for.body10 ]
%niter = phi i32 [ 0, %for.body10.preheader.new ], [ %niter.next.7, %for.body10 ]
%shl = shl i32 %v.0102, 8
%niter.next.7 = add i32 %niter, 8
%niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end13.unr-lcssa, label %for.body10, !llvm.loop !34
for.end13.unr-lcssa: ; preds = %for.body10, %for.body10.preheader
%shl.lcssa.ph = phi i32 [ undef, %for.body10.preheader ], [ %shl, %for.body10 ]
%v.0102.unr = phi i32 [ 1, %for.body10.preheader ], [ %shl, %for.body10 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end13, label %for.body10.epil
for.body10.epil: ; preds = %for.end13.unr-lcssa, %for.body10.epil
%v.0102.epil = phi i32 [ %shl.epil, %for.body10.epil ], [ %v.0102.unr, %for.end13.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body10.epil ], [ 0, %for.end13.unr-lcssa ]
%shl.epil = shl i32 %v.0102.epil, 1
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end13, label %for.body10.epil, !llvm.loop !35
for.end13: ; preds = %for.body10.epil, %for.end13.unr-lcssa
%shl.lcssa = phi i32 [ %shl.lcssa.ph, %for.end13.unr-lcssa ], [ %shl.epil, %for.body10.epil ]
%tobool.not2.i = icmp eq i32 %shl.lcssa, 0
br i1 %tobool.not2.i, label %for.end52, label %while.body.preheader.i
while.body.preheader.i: ; preds = %for.cond.preheader, %for.cond8.preheader, %for.end13
%v.0.lcssa146 = phi i32 [ %shl.lcssa, %for.end13 ], [ 1, %for.cond8.preheader ], [ 1, %for.cond.preheader ]
%.lcssa140144 = phi i32 [ %6, %for.end13 ], [ %6, %for.cond8.preheader ], [ %1, %for.cond.preheader ]
%7 = sext i32 %v.0.lcssa146 to i64
br label %while.body.i
while.body.i: ; preds = %while.body.i, %while.body.preheader.i
%indvars.iv.i = phi i64 [ %7, %while.body.preheader.i ], [ %indvars.iv.next.i, %while.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%arrayidx.i = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv.next.i
%call.i = call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #12
store ptr %call.i, ptr %arrayidx.i, align 16, !tbaa.struct !5
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 8
store i32 10, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !12
%.compoundliteral.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 12
store i32 0, ptr %.compoundliteral.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !13
%8 = and i64 %indvars.iv.next.i, 4294967295
%tobool.not.i = icmp eq i64 %8, 0
br i1 %tobool.not.i, label %init.exit, label %while.body.i, !llvm.loop !14
init.exit: ; preds = %while.body.i
%sub = add i32 %v.0.lcssa146, -1
%cmp15110 = icmp sgt i32 %v.0.lcssa146, 1
%9 = icmp sgt i32 %.lcssa140144, 0
%or.cond = and i1 %cmp15110, %9
br i1 %or.cond, label %for.cond17.preheader.preheader, label %for.end52
for.cond17.preheader.preheader: ; preds = %init.exit
%wide.trip.count134 = zext i32 %sub to i64
br label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.cond17.preheader.preheader, %for.inc50
%10 = phi i32 [ %.lcssa140144, %for.cond17.preheader.preheader ], [ %30, %for.inc50 ]
%11 = phi i32 [ %.lcssa140144, %for.cond17.preheader.preheader ], [ %31, %for.inc50 ]
%indvars.iv131 = phi i64 [ 0, %for.cond17.preheader.preheader ], [ %indvars.iv.next132, %for.inc50 ]
%cmp18108 = icmp sgt i32 %11, 0
br i1 %cmp18108, label %for.body19.lr.ph, label %for.inc50
for.body19.lr.ph: ; preds = %for.cond17.preheader
%arrayidx.i87 = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv131
%size.i = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv131, i32 2
%cap.i = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv131, i32 1
%12 = trunc i64 %indvars.iv131 to i32
br label %for.body19
for.body19: ; preds = %for.body19.lr.ph, %for.inc47
%13 = phi i32 [ %10, %for.body19.lr.ph ], [ %28, %for.inc47 ]
%indvars.iv128 = phi i64 [ 0, %for.body19.lr.ph ], [ %indvars.iv.next129, %for.inc47 ]
%14 = phi i32 [ %11, %for.body19.lr.ph ], [ %28, %for.inc47 ]
%15 = trunc i64 %indvars.iv128 to i32
%shl20 = shl nuw i32 1, %15
%and = and i32 %shl20, %12
%tobool21.not = icmp eq i32 %and, 0
br i1 %tobool21.not, label %if.then, label %for.inc47
if.then: ; preds = %for.body19
%arrayidx23 = getelementptr inbounds [16 x [17 x i32]], ptr %t, i64 0, i64 %indvars.iv128
%16 = load i32, ptr %arrayidx23, align 4, !tbaa !10
%cmp26104 = icmp sgt i32 %14, 0
br i1 %cmp26104, label %for.body27.preheader, label %for.end44
for.body27.preheader: ; preds = %if.then
%wide.trip.count = zext i32 %14 to i64
%xtraiter168 = and i64 %wide.trip.count, 1
%17 = icmp eq i32 %14, 1
br i1 %17, label %for.end44.loopexit.unr-lcssa, label %for.body27.preheader.new
for.body27.preheader.new: ; preds = %for.body27.preheader
%unroll_iter172 = and i64 %wide.trip.count, 4294967294
br label %for.body27
for.body27: ; preds = %for.inc42.1, %for.body27.preheader.new
%indvars.iv123 = phi i64 [ 0, %for.body27.preheader.new ], [ %.pre136.1, %for.inc42.1 ]
%min.0106 = phi i32 [ %16, %for.body27.preheader.new ], [ %min.1.1, %for.inc42.1 ]
%niter173 = phi i64 [ 0, %for.body27.preheader.new ], [ %niter173.next.1, %for.inc42.1 ]
%18 = trunc i64 %indvars.iv123 to i32
%shl28 = shl nuw i32 1, %18
%and29 = and i32 %shl28, %12
%tobool30.not = icmp eq i32 %and29, 0
%.pre136 = or i64 %indvars.iv123, 1
br i1 %tobool30.not, label %for.inc42, label %if.then31
if.then31: ; preds = %for.body27
%arrayidx35 = getelementptr inbounds [16 x [17 x i32]], ptr %t, i64 0, i64 %indvars.iv128, i64 %.pre136
%19 = load i32, ptr %arrayidx35, align 4, !tbaa !10
%min.0. = call i32 @llvm.smin.i32(i32 %min.0106, i32 %19)
br label %for.inc42
for.inc42: ; preds = %for.body27, %if.then31
%min.1 = phi i32 [ %min.0., %if.then31 ], [ %min.0106, %for.body27 ]
%20 = trunc i64 %.pre136 to i32
%shl28.1 = shl nuw i32 1, %20
%and29.1 = and i32 %shl28.1, %12
%tobool30.not.1 = icmp eq i32 %and29.1, 0
%.pre136.1 = add nuw nsw i64 %indvars.iv123, 2
br i1 %tobool30.not.1, label %for.inc42.1, label %if.then31.1
if.then31.1: ; preds = %for.inc42
%arrayidx35.1 = getelementptr inbounds [16 x [17 x i32]], ptr %t, i64 0, i64 %indvars.iv128, i64 %.pre136.1
%21 = load i32, ptr %arrayidx35.1, align 4, !tbaa !10
%min.0..1 = call i32 @llvm.smin.i32(i32 %min.1, i32 %21)
br label %for.inc42.1
for.inc42.1: ; preds = %if.then31.1, %for.inc42
%min.1.1 = phi i32 [ %min.0..1, %if.then31.1 ], [ %min.1, %for.inc42 ]
%niter173.next.1 = add i64 %niter173, 2
%niter173.ncmp.1 = icmp eq i64 %niter173.next.1, %unroll_iter172
br i1 %niter173.ncmp.1, label %for.end44.loopexit.unr-lcssa, label %for.body27, !llvm.loop !37
for.end44.loopexit.unr-lcssa: ; preds = %for.inc42.1, %for.body27.preheader
%min.1.lcssa.ph = phi i32 [ undef, %for.body27.preheader ], [ %min.1.1, %for.inc42.1 ]
%indvars.iv123.unr = phi i64 [ 0, %for.body27.preheader ], [ %.pre136.1, %for.inc42.1 ]
%min.0106.unr = phi i32 [ %16, %for.body27.preheader ], [ %min.1.1, %for.inc42.1 ]
%lcmp.mod170.not = icmp eq i64 %xtraiter168, 0
br i1 %lcmp.mod170.not, label %for.end44, label %for.body27.epil
for.body27.epil: ; preds = %for.end44.loopexit.unr-lcssa
%22 = trunc i64 %indvars.iv123.unr to i32
%shl28.epil = shl nuw i32 1, %22
%and29.epil = and i32 %shl28.epil, %12
%tobool30.not.epil = icmp eq i32 %and29.epil, 0
br i1 %tobool30.not.epil, label %for.end44, label %if.then31.epil
if.then31.epil: ; preds = %for.body27.epil
%.pre136.epil = add nuw nsw i64 %indvars.iv123.unr, 1
%arrayidx35.epil = getelementptr inbounds [16 x [17 x i32]], ptr %t, i64 0, i64 %indvars.iv128, i64 %.pre136.epil
%23 = load i32, ptr %arrayidx35.epil, align 4, !tbaa !10
%min.0..epil = call i32 @llvm.smin.i32(i32 %min.0106.unr, i32 %23)
br label %for.end44
for.end44: ; preds = %for.end44.loopexit.unr-lcssa, %if.then31.epil, %for.body27.epil, %if.then
%min.0.lcssa = phi i32 [ %16, %if.then ], [ %min.1.lcssa.ph, %for.end44.loopexit.unr-lcssa ], [ %min.0..epil, %if.then31.epil ], [ %min.0106.unr, %for.body27.epil ]
%or = or i32 %shl20, %12
%24 = load i32, ptr %size.i, align 4, !tbaa !16
%25 = load i32, ptr %cap.i, align 8, !tbaa !18
%cmp.i = icmp eq i32 %24, %25
%.pre.i = load ptr, ptr %arrayidx.i87, align 16, !tbaa !19
br i1 %cmp.i, label %if.then.i, label %add.exit
if.then.i: ; preds = %for.end44
%shl.i = shl i32 %24, 1
store i32 %shl.i, ptr %cap.i, align 8, !tbaa !18
%conv.i = sext i32 %shl.i to i64
%mul.i = shl nsw i64 %conv.i, 3
%call.i88 = call ptr @realloc(ptr noundef %.pre.i, i64 noundef %mul.i) #13
store ptr %call.i88, ptr %arrayidx.i87, align 16, !tbaa !19
%.pre31.i = load i32, ptr %size.i, align 4, !tbaa !16
br label %add.exit
add.exit: ; preds = %for.end44, %if.then.i
%26 = phi i32 [ %.pre31.i, %if.then.i ], [ %24, %for.end44 ]
%27 = phi ptr [ %call.i88, %if.then.i ], [ %.pre.i, %for.end44 ]
%inc.i = add nsw i32 %26, 1
store i32 %inc.i, ptr %size.i, align 4, !tbaa !16
%idxprom20.i = sext i32 %26 to i64
%arrayidx21.i = getelementptr inbounds %struct.Edge, ptr %27, i64 %idxprom20.i
store i32 %or, ptr %arrayidx21.i, align 4, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx21.i, i64 4
store i32 %min.0.lcssa, ptr %.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i, align 4, !tbaa.struct !13
%.pre = load i32, ptr %n, align 4, !tbaa !10
br label %for.inc47
for.inc47: ; preds = %for.body19, %add.exit
%28 = phi i32 [ %13, %for.body19 ], [ %.pre, %add.exit ]
%indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
%29 = sext i32 %28 to i64
%cmp18 = icmp slt i64 %indvars.iv.next129, %29
br i1 %cmp18, label %for.body19, label %for.inc50, !llvm.loop !38
for.inc50: ; preds = %for.inc47, %for.cond17.preheader
%30 = phi i32 [ %10, %for.cond17.preheader ], [ %28, %for.inc47 ]
%31 = phi i32 [ %11, %for.cond17.preheader ], [ %28, %for.inc47 ]
%indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
%exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count134
br i1 %exitcond135.not, label %for.end52, label %for.cond17.preheader, !llvm.loop !39
for.end52: ; preds = %for.inc50, %for.end13, %init.exit
%sub157 = phi i32 [ %sub, %init.exit ], [ -1, %for.end13 ], [ %sub, %for.inc50 ]
%v.0.lcssa147156 = phi i32 [ %v.0.lcssa146, %init.exit ], [ 0, %for.end13 ], [ %v.0.lcssa146, %for.inc50 ]
%tobool.not2.i149155 = phi i1 [ false, %init.exit ], [ true, %for.end13 ], [ false, %for.inc50 ]
call void @dijkstra(i32 noundef %v.0.lcssa147156, i32 noundef 0)
%idxprom54 = sext i32 %sub157 to i64
%arrayidx55 = getelementptr inbounds [65536 x i32], ptr @d, i64 0, i64 %idxprom54
%32 = load i32, ptr %arrayidx55, align 4, !tbaa !10
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %32)
br i1 %tobool.not2.i149155, label %freeAll.exit, label %while.body.preheader.i90
while.body.preheader.i90: ; preds = %for.end52
%33 = sext i32 %v.0.lcssa147156 to i64
br label %while.body.i91
while.body.i91: ; preds = %while.body.i91, %while.body.preheader.i90
%indvars.iv.i92 = phi i64 [ %33, %while.body.preheader.i90 ], [ %indvars.iv.next.i93, %while.body.i91 ]
%indvars.iv.next.i93 = add nsw i64 %indvars.iv.i92, -1
%arrayidx.i94 = getelementptr inbounds [65536 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv.next.i93
%34 = load ptr, ptr %arrayidx.i94, align 16, !tbaa !19
call void @free(ptr noundef %34) #14
%35 = and i64 %indvars.iv.next.i93, 4294967295
%tobool.not.i95 = icmp eq i64 %35, 0
br i1 %tobool.not.i95, label %freeAll.exit, label %while.body.i91, !llvm.loop !20
freeAll.exit: ; preds = %while.body.i91, %for.end52
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%36 = load i32, ptr %n, align 4, !tbaa !10
%tobool.not = icmp eq i32 %36, 0
br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !40
while.end: ; preds = %freeAll.exit, %entry
call void @llvm.lifetime.end.p0(i64 1088, ptr nonnull %t) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #14
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #11
attributes #0 = { nofree nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 nounwind willreturn allockind("realloc") allocsize(1) 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 #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree norecurse 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 #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nounwind allocsize(0) }
attributes #13 = { nounwind allocsize(1) }
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 = !{i64 0, i64 8, !6, i64 8, i64 4, !10, i64 12, i64 4, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{i64 0, i64 4, !10, i64 4, i64 4, !10}
!13 = !{i64 0, i64 4, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !11, i64 12}
!17 = !{!"", !7, i64 0, !11, i64 8, !11, i64 12}
!18 = !{!17, !11, i64 8}
!19 = !{!17, !7, i64 0}
!20 = distinct !{!20, !15}
!21 = !{!22, !11, i64 4}
!22 = !{!"", !11, i64 0, !11, i64 4}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15, !26, !27}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = distinct !{!28, !15, !27, !26}
!29 = distinct !{!29, !15}
!30 = distinct !{!30, !15}
!31 = distinct !{!31, !15}
!32 = distinct !{!32, !15, !33}
!33 = !{!"llvm.loop.unswitch.partial.disable"}
!34 = distinct !{!34, !15}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.unroll.disable"}
!37 = distinct !{!37, !15}
!38 = distinct !{!38, !15}
!39 = distinct !{!39, !15, !33}
!40 = distinct !{!40, !15}
|
#include <stdio.h>
int main(void){
int a[4], i, j1=0, j9=0, j7=0, j4=0;
for(i=0;i<4;i++){
scanf("%d", &a[i]);
}
for(i=0;i<4;i++){
if(j1==0 && a[i] == 1)
j1=1;
if(j9==0 && a[i] == 9)
j9=1;
if(j7==0 && a[i] == 7)
j7 = 1;
if(j4 == 0 && a[i] == 4)
j4 = 1;
}
if(j1==1 && j9 == 1 && j7 == 1 && j4 == 1)
printf("YES\n");
else
printf("NO\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123065/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123065/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.inc29:
%a = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%arrayidx.1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%0 = load i32, ptr %a, align 16, !tbaa !5
%cmp7.not = icmp ne i32 %0, 1
%cmp12.not = icmp ne i32 %0, 9
%cmp19.not = icmp ne i32 %0, 7
%cmp26.not = icmp ne i32 %0, 4
%1 = load i32, ptr %arrayidx.1, align 4
%cmp7.1 = icmp ne i32 %1, 1
%j1.1.1 = select i1 %cmp7.not, i1 %cmp7.1, i1 false
%cmp12.1 = icmp ne i32 %1, 9
%j9.1.1 = select i1 %cmp12.not, i1 %cmp12.1, i1 false
%cmp19.1 = icmp ne i32 %1, 7
%j7.1.1 = select i1 %cmp19.not, i1 %cmp19.1, i1 false
%2 = load i32, ptr %arrayidx.1, align 4
%cmp26.1 = icmp ne i32 %2, 4
%j4.1.1 = select i1 %cmp26.not, i1 %cmp26.1, i1 false
br i1 %j1.1.1, label %land.lhs.true.2, label %if.end.2
land.lhs.true.2: ; preds = %for.inc29
%3 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp7.2 = icmp eq i32 %3, 1
br label %if.end.2
if.end.2: ; preds = %land.lhs.true.2, %for.inc29
%j1.1.2 = phi i1 [ true, %for.inc29 ], [ %cmp7.2, %land.lhs.true.2 ]
br i1 %j9.1.1, label %land.lhs.true9.2, label %if.end14.2
land.lhs.true9.2: ; preds = %if.end.2
%4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp12.2 = icmp eq i32 %4, 9
br label %if.end14.2
if.end14.2: ; preds = %land.lhs.true9.2, %if.end.2
%j9.1.2 = phi i1 [ true, %if.end.2 ], [ %cmp12.2, %land.lhs.true9.2 ]
br i1 %j7.1.1, label %land.lhs.true16.2, label %if.end21.2
land.lhs.true16.2: ; preds = %if.end14.2
%5 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp19.2 = icmp eq i32 %5, 7
br label %if.end21.2
if.end21.2: ; preds = %land.lhs.true16.2, %if.end14.2
%j7.1.2 = phi i1 [ true, %if.end14.2 ], [ %cmp19.2, %land.lhs.true16.2 ]
br i1 %j4.1.1, label %land.lhs.true23.2, label %for.inc29.2
land.lhs.true23.2: ; preds = %if.end21.2
%6 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp26.2 = icmp eq i32 %6, 4
br label %for.inc29.2
for.inc29.2: ; preds = %land.lhs.true23.2, %if.end21.2
%j4.1.2 = phi i1 [ true, %if.end21.2 ], [ %cmp26.2, %land.lhs.true23.2 ]
%7 = load i32, ptr %arrayidx.3, align 4
%cmp7.3 = icmp eq i32 %7, 1
%j1.1.3 = select i1 %j1.1.2, i1 true, i1 %cmp7.3
%cmp12.3 = icmp eq i32 %7, 9
%j9.1.3 = select i1 %j9.1.2, i1 true, i1 %cmp12.3
%cmp19.3 = icmp eq i32 %7, 7
%j7.1.3 = select i1 %j7.1.2, i1 true, i1 %cmp19.3
%8 = load i32, ptr %arrayidx.3, align 4
%cmp26.3 = icmp eq i32 %8, 4
%j4.1.3 = select i1 %j4.1.2, i1 true, i1 %cmp26.3
%or.cond = and i1 %j1.1.3, %j9.1.3
%or.cond43 = and i1 %or.cond, %j7.1.3
%or.cond44 = and i1 %or.cond43, %j4.1.3
%str.sink = select i1 %or.cond44, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) {
return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) {
return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;
int main(void) {
int h, w, n;
int a[MAX];
scanf("%d%d%d", &h, &w, &n);
rep(i, 0, n) scanf("%d", &a[i]);
int now = 0;
int line[101];
rep(hi, 0, h) {
if ( hi % 2 == 0 ) {
for ( int wi = 0; wi < w; wi++ ) {
line[wi] = now+1;
a[now]--;
if ( a[now] == 0 ) now++;
}
} else {
for ( int wi = w-1; wi >= 0; wi-- ) {
line[wi] = now+1;
a[now]--;
if ( a[now] == 0 ) now++;
}
}
rep(wi, 0, w) {
printf("%d ", line[wi]);
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123108/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123108/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !9
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !10
%1 = load ptr, ptr %b, align 8, !tbaa !10
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #7
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [100001 x i32], align 16
%line = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %a) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp78 = icmp sgt i32 %0, 0
br i1 %cmp78, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %line) #8
%1 = load i32, ptr %h, align 4, !tbaa !5
%cmp389 = icmp sgt i32 %1, 0
br i1 %cmp389, label %for.body5, label %for.cond.cleanup4
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.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !12
for.cond.cleanup4: ; preds = %for.cond.cleanup47, %for.cond.cleanup
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %line) #8
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %a) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #8
ret i32 0
for.body5: ; preds = %for.cond.cleanup, %for.cond.cleanup47
%hi.091 = phi i32 [ %inc57, %for.cond.cleanup47 ], [ 0, %for.cond.cleanup ]
%now.090 = phi i32 [ %now.5107, %for.cond.cleanup47 ], [ 0, %for.cond.cleanup ]
%rem = and i32 %hi.091, 1
%cmp6 = icmp eq i32 %rem, 0
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp883 = icmp sgt i32 %4, 0
br i1 %cmp6, label %for.cond7.preheader, label %if.else
for.cond7.preheader: ; preds = %for.body5
br i1 %cmp883, label %for.body10.preheader, label %for.cond.cleanup47
for.body10.preheader: ; preds = %for.cond7.preheader
%wide.trip.count = zext i32 %4 to i64
%xtraiter111 = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %4, 1
br i1 %5, label %if.end43.loopexit.unr-lcssa, label %for.body10.preheader.new
for.body10.preheader.new: ; preds = %for.body10.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body10
for.body10: ; preds = %for.body10, %for.body10.preheader.new
%indvars.iv97 = phi i64 [ 0, %for.body10.preheader.new ], [ %indvars.iv.next98.1, %for.body10 ]
%now.184 = phi i32 [ %now.090, %for.body10.preheader.new ], [ %spec.select.1, %for.body10 ]
%niter = phi i64 [ 0, %for.body10.preheader.new ], [ %niter.next.1, %for.body10 ]
%add = add nsw i32 %now.184, 1
%arrayidx12 = getelementptr inbounds [101 x i32], ptr %line, i64 0, i64 %indvars.iv97
store i32 %add, ptr %arrayidx12, align 8, !tbaa !5
%idxprom13 = sext i32 %now.184 to i64
%arrayidx14 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%dec = add nsw i32 %6, -1
store i32 %dec, ptr %arrayidx14, align 4, !tbaa !5
%cmp17 = icmp eq i32 %dec, 0
%spec.select = select i1 %cmp17, i32 %add, i32 %now.184
%indvars.iv.next98 = or i64 %indvars.iv97, 1
%add.1 = add nsw i32 %spec.select, 1
%arrayidx12.1 = getelementptr inbounds [101 x i32], ptr %line, i64 0, i64 %indvars.iv.next98
store i32 %add.1, ptr %arrayidx12.1, align 4, !tbaa !5
%idxprom13.1 = sext i32 %spec.select to i64
%arrayidx14.1 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom13.1
%7 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5
%dec.1 = add nsw i32 %7, -1
store i32 %dec.1, ptr %arrayidx14.1, align 4, !tbaa !5
%cmp17.1 = icmp eq i32 %dec.1, 0
%spec.select.1 = select i1 %cmp17.1, i32 %add.1, i32 %spec.select
%indvars.iv.next98.1 = add nuw nsw i64 %indvars.iv97, 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 %if.end43.loopexit.unr-lcssa, label %for.body10, !llvm.loop !14
if.else: ; preds = %for.body5
br i1 %cmp883, label %for.body27.preheader, label %for.cond.cleanup47
for.body27.preheader: ; preds = %if.else
%8 = zext i32 %4 to i64
%xtraiter = and i64 %8, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body27.prol.loopexit, label %for.body27.prol
for.body27.prol: ; preds = %for.body27.preheader
%indvars.iv.next95.prol = add nsw i64 %8, -1
%add28.prol = add nsw i32 %now.090, 1
%idxprom29.prol = and i64 %indvars.iv.next95.prol, 4294967295
%arrayidx30.prol = getelementptr inbounds [101 x i32], ptr %line, i64 0, i64 %idxprom29.prol
store i32 %add28.prol, ptr %arrayidx30.prol, align 4, !tbaa !5
%idxprom31.prol = sext i32 %now.090 to i64
%arrayidx32.prol = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom31.prol
%9 = load i32, ptr %arrayidx32.prol, align 4, !tbaa !5
%dec33.prol = add nsw i32 %9, -1
store i32 %dec33.prol, ptr %arrayidx32.prol, align 4, !tbaa !5
%cmp36.prol = icmp eq i32 %dec33.prol, 0
%spec.select76.prol = select i1 %cmp36.prol, i32 %add28.prol, i32 %now.090
br label %for.body27.prol.loopexit
for.body27.prol.loopexit: ; preds = %for.body27.prol, %for.body27.preheader
%indvars.iv94.unr = phi i64 [ %8, %for.body27.preheader ], [ %indvars.iv.next95.prol, %for.body27.prol ]
%now.381.unr = phi i32 [ %now.090, %for.body27.preheader ], [ %spec.select76.prol, %for.body27.prol ]
%spec.select76.lcssa.unr = phi i32 [ undef, %for.body27.preheader ], [ %spec.select76.prol, %for.body27.prol ]
%10 = icmp eq i32 %4, 1
br i1 %10, label %if.end43, label %for.body27
for.body27: ; preds = %for.body27.prol.loopexit, %for.body27
%indvars.iv94 = phi i64 [ %indvars.iv.next95.1, %for.body27 ], [ %indvars.iv94.unr, %for.body27.prol.loopexit ]
%now.381 = phi i32 [ %spec.select76.1, %for.body27 ], [ %now.381.unr, %for.body27.prol.loopexit ]
%indvars.iv.next95 = add nsw i64 %indvars.iv94, -1
%add28 = add nsw i32 %now.381, 1
%idxprom29 = and i64 %indvars.iv.next95, 4294967295
%arrayidx30 = getelementptr inbounds [101 x i32], ptr %line, i64 0, i64 %idxprom29
store i32 %add28, ptr %arrayidx30, align 4, !tbaa !5
%idxprom31 = sext i32 %now.381 to i64
%arrayidx32 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom31
%11 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%dec33 = add nsw i32 %11, -1
store i32 %dec33, ptr %arrayidx32, align 4, !tbaa !5
%cmp36 = icmp eq i32 %dec33, 0
%spec.select76 = select i1 %cmp36, i32 %add28, i32 %now.381
%indvars.iv.next95.1 = add nsw i64 %indvars.iv94, -2
%add28.1 = add nsw i32 %spec.select76, 1
%idxprom29.1 = and i64 %indvars.iv.next95.1, 4294967295
%arrayidx30.1 = getelementptr inbounds [101 x i32], ptr %line, i64 0, i64 %idxprom29.1
store i32 %add28.1, ptr %arrayidx30.1, align 4, !tbaa !5
%idxprom31.1 = sext i32 %spec.select76 to i64
%arrayidx32.1 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom31.1
%12 = load i32, ptr %arrayidx32.1, align 4, !tbaa !5
%dec33.1 = add nsw i32 %12, -1
store i32 %dec33.1, ptr %arrayidx32.1, align 4, !tbaa !5
%cmp36.1 = icmp eq i32 %dec33.1, 0
%spec.select76.1 = select i1 %cmp36.1, i32 %add28.1, i32 %spec.select76
%cmp25.1 = icmp ugt i64 %indvars.iv.next95, 1
br i1 %cmp25.1, label %for.body27, label %if.end43, !llvm.loop !15
if.end43.loopexit.unr-lcssa: ; preds = %for.body10, %for.body10.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body10.preheader ], [ %spec.select.1, %for.body10 ]
%indvars.iv97.unr = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next98.1, %for.body10 ]
%now.184.unr = phi i32 [ %now.090, %for.body10.preheader ], [ %spec.select.1, %for.body10 ]
%lcmp.mod112.not = icmp eq i64 %xtraiter111, 0
br i1 %lcmp.mod112.not, label %if.end43, label %for.body10.epil
for.body10.epil: ; preds = %if.end43.loopexit.unr-lcssa
%add.epil = add nsw i32 %now.184.unr, 1
%arrayidx12.epil = getelementptr inbounds [101 x i32], ptr %line, i64 0, i64 %indvars.iv97.unr
store i32 %add.epil, ptr %arrayidx12.epil, align 4, !tbaa !5
%idxprom13.epil = sext i32 %now.184.unr to i64
%arrayidx14.epil = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom13.epil
%13 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5
%dec.epil = add nsw i32 %13, -1
store i32 %dec.epil, ptr %arrayidx14.epil, align 4, !tbaa !5
%cmp17.epil = icmp eq i32 %dec.epil, 0
%spec.select.epil = select i1 %cmp17.epil, i32 %add.epil, i32 %now.184.unr
br label %if.end43
if.end43: ; preds = %for.body27.prol.loopexit, %for.body27, %for.body10.epil, %if.end43.loopexit.unr-lcssa
%now.5 = phi i32 [ %spec.select.lcssa.ph, %if.end43.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body10.epil ], [ %spec.select76.lcssa.unr, %for.body27.prol.loopexit ], [ %spec.select76.1, %for.body27 ]
%cmp4687 = icmp sgt i32 %4, 0
br i1 %cmp4687, label %for.body48, label %for.cond.cleanup47
for.cond.cleanup47: ; preds = %for.body48, %if.else, %for.cond7.preheader, %if.end43
%now.5107 = phi i32 [ %now.5, %if.end43 ], [ %now.090, %for.cond7.preheader ], [ %now.090, %if.else ], [ %now.5, %for.body48 ]
%putchar = call i32 @putchar(i32 10)
%inc57 = add nuw nsw i32 %hi.091, 1
%14 = load i32, ptr %h, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc57, %14
br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !16
for.body48: ; preds = %if.end43, %for.body48
%indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body48 ], [ 0, %if.end43 ]
%arrayidx50 = getelementptr inbounds [101 x i32], ptr %line, i64 0, i64 %indvars.iv101
%15 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%16 = load i32, ptr %w, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp46 = icmp slt i64 %indvars.iv.next102, %17
br i1 %cmp46, label %for.body48, label %for.cond.cleanup47, !llvm.loop !17
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind willreturn memory(read) }
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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) {
return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) {
return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define readi(x) scanf("%d", &x)
#define reads(s) scanf("%s", s)
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100002
#define MOD 1000000007
int main(void) {
long long int n, c;
scanf("%lld %lld", &n, &c);
long long int x[MAX], v[MAX];
x[0] = 0; x[n + 1] = c;
v[0] = v[n + 1] = 0;
for ( int i = 1; i <= n; i++ )
scanf("%lld %lld", &x[i], &v[i]);
// 時計回りの位置をA,反時計回りの位置をB
// va[a]: v(1) + v(2) + ... + v(a)
// vb[b]: v(n) + v(n - 1) + ... + v(b)
long long int va[MAX], vb[MAX];
va[0] = va[n + 1] = 0;
vb[0] = vb[n + 1] = 0;
for ( int i = 0; i < n; i++ )
va[i + 1] = va[i] + v[i + 1];
vb[n] = v[n];
for ( int i = n; i > 1; i-- )
vb[i - 1] = vb[i] + v[i - 1];
// geta(a): v(1) + v(2) + ... + v(a) - x(a)
// getb(b): v(n) + v(n-1) + ... + v(b) - (c - x(b))
long long int geta[MAX], getb[MAX];
geta[0] = geta[n + 1] = 0;
getb[0] = getb[n + 1] = 0;
for ( int i = 1; i <= n; i++ ) {
geta[i] = va[i] - x[i];
getb[i] = vb[i] - ( c - x[i] );
}
// maxa(a): max{ geta(0), geta(1), ..., get(a) }
// maxb(b): max{ getb(n), getb(n-1), ..., getb(b) }
long long int maxa[MAX], maxb[MAX];
maxa[0] = maxa[n + 1] = 0;
maxb[0] = maxb[n + 1] = 0;
for ( int i = 0; i < n; i++ ) {
maxa[i + 1] = max(maxa[i], geta[i + 1]);
maxb[n - i] = max(maxb[n - i + 1], getb[n - i]);
}
long long int ans = 0;
for ( int i = 0; i <= n; i++ ) {
ans = max(ans, maxa[i] + getb[i + 1] - (c - x[i + 1]));
ans = max(ans, maxb[i + 1] + geta[i] - x[i]);
}
printf("%lld\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123151/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123151/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !9
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !10
%1 = load ptr, ptr %b, align 8, !tbaa !10
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #7
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i64, align 8
%c = alloca i64, align 8
%x = alloca [100002 x i64], align 16
%v = alloca [100002 x i64], align 16
%va = alloca [100002 x i64], align 16
%vb = alloca [100002 x i64], align 16
%vb312 = ptrtoint ptr %vb to i64
%geta = alloca [100002 x i64], align 16
%getb = alloca [100002 x i64], align 16
%maxa = alloca [100002 x i64], align 16
%maxb = alloca [100002 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %c)
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %x) #8
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %v) #8
store i64 0, ptr %x, align 16, !tbaa !12
%0 = load i64, ptr %c, align 8, !tbaa !12
%1 = load i64, ptr %n, align 8, !tbaa !12
%add = add i64 %1, 1
%arrayidx1 = getelementptr inbounds [100002 x i64], ptr %x, i64 0, i64 %add
store i64 %0, ptr %arrayidx1, align 8, !tbaa !12
%arrayidx3 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %add
store i64 0, ptr %arrayidx3, align 8, !tbaa !12
store i64 0, ptr %v, align 16, !tbaa !12
%cmp.not254 = icmp slt i64 %1, 1
br i1 %cmp.not254, label %for.cond.cleanup.thread, label %for.body
for.cond.cleanup.thread: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %va) #8
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %vb) #8
%arrayidx11299 = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %add
store i64 0, ptr %arrayidx11299, align 8, !tbaa !12
%arrayidx14300 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %add
store i64 0, ptr %arrayidx14300, align 8, !tbaa !12
store i64 0, ptr %vb, align 16, !tbaa !12
br label %for.cond.cleanup21
for.cond.cleanup: ; preds = %for.body
%.pre296 = add nsw i64 %3, 1
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %va) #8
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %vb) #8
%arrayidx11 = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %.pre296
store i64 0, ptr %arrayidx11, align 8, !tbaa !12
%arrayidx14 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %.pre296
store i64 0, ptr %arrayidx14, align 8, !tbaa !12
store i64 0, ptr %vb, align 16, !tbaa !12
%cmp19257 = icmp sgt i64 %3, 0
br i1 %cmp19257, label %for.body22.preheader, label %for.cond.cleanup21
for.body22.preheader: ; preds = %for.cond.cleanup
%xtraiter = and i64 %3, 3
%2 = icmp ult i64 %3, 4
br i1 %2, label %for.cond.cleanup21.loopexit.unr-lcssa, label %for.body22.preheader.new
for.body22.preheader.new: ; preds = %for.body22.preheader
%unroll_iter = and i64 %3, -4
br label %for.body22
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx6 = getelementptr inbounds [100002 x i64], ptr %x, i64 0, i64 %indvars.iv
%arrayidx8 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %indvars.iv
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx8)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%3 = load i64, ptr %n, align 8, !tbaa !12
%cmp.not = icmp slt i64 %3, %indvars.iv.next
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14
for.cond.cleanup21.loopexit.unr-lcssa: ; preds = %for.body22, %for.body22.preheader
%.unr = phi i64 [ 0, %for.body22.preheader ], [ %add28.3, %for.body22 ]
%indvars.iv275.unr = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next276.3, %for.body22 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup21, label %for.body22.epil
for.body22.epil: ; preds = %for.cond.cleanup21.loopexit.unr-lcssa, %for.body22.epil
%4 = phi i64 [ %add28.epil, %for.body22.epil ], [ %.unr, %for.cond.cleanup21.loopexit.unr-lcssa ]
%indvars.iv275.epil = phi i64 [ %indvars.iv.next276.epil, %for.body22.epil ], [ %indvars.iv275.unr, %for.cond.cleanup21.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body22.epil ], [ 0, %for.cond.cleanup21.loopexit.unr-lcssa ]
%indvars.iv.next276.epil = add nuw nsw i64 %indvars.iv275.epil, 1
%arrayidx27.epil = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %indvars.iv.next276.epil
%5 = load i64, ptr %arrayidx27.epil, align 8, !tbaa !12
%add28.epil = add nsw i64 %5, %4
%arrayidx31.epil = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %indvars.iv.next276.epil
store i64 %add28.epil, ptr %arrayidx31.epil, align 8, !tbaa !12
%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.cleanup21, label %for.body22.epil, !llvm.loop !16
for.cond.cleanup21: ; preds = %for.cond.cleanup21.loopexit.unr-lcssa, %for.body22.epil, %for.cond.cleanup.thread, %for.cond.cleanup
%cmp19257304 = phi i1 [ false, %for.cond.cleanup.thread ], [ false, %for.cond.cleanup ], [ %cmp19257, %for.body22.epil ], [ %cmp19257, %for.cond.cleanup21.loopexit.unr-lcssa ]
%.lcssa303 = phi i64 [ %1, %for.cond.cleanup.thread ], [ %3, %for.cond.cleanup ], [ %3, %for.body22.epil ], [ %3, %for.cond.cleanup21.loopexit.unr-lcssa ]
%add10.pre-phi302 = phi i64 [ %add, %for.cond.cleanup.thread ], [ %.pre296, %for.cond.cleanup ], [ %.pre296, %for.body22.epil ], [ %.pre296, %for.cond.cleanup21.loopexit.unr-lcssa ]
%arrayidx35 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %.lcssa303
%6 = load i64, ptr %arrayidx35, align 8, !tbaa !12
%arrayidx36 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %.lcssa303
store i64 %6, ptr %arrayidx36, align 8, !tbaa !12
%conv38 = trunc i64 %.lcssa303 to i32
%cmp40260 = icmp sgt i32 %conv38, 1
br i1 %cmp40260, label %for.body43.preheader, label %for.cond.cleanup42
for.body43.preheader: ; preds = %for.cond.cleanup21
%7 = and i64 %.lcssa303, 4294967295
%8 = call i64 @llvm.usub.sat.i64(i64 %7, i64 2)
%9 = add nuw nsw i64 %8, 1
%min.iters.check = icmp ult i64 %8, 45
br i1 %min.iters.check, label %for.body43.preheader367, label %vector.scevcheck
vector.scevcheck: ; preds = %for.body43.preheader
%10 = call i64 @llvm.usub.sat.i64(i64 %7, i64 2)
%11 = add i32 %conv38, -1
%12 = trunc i64 %10 to i32
%13 = icmp ult i32 %11, %12
%14 = zext i32 %11 to i64
%15 = shl nuw nsw i64 %14, 3
%scevgep = getelementptr i8, ptr %vb, i64 %15
%mul305.neg = mul nsw i64 %10, -8
%16 = getelementptr i8, ptr %scevgep, i64 %mul305.neg
%17 = icmp ugt ptr %16, %scevgep
%18 = shl nuw nsw i64 %7, 3
%scevgep308 = getelementptr i8, ptr %vb, i64 %18
%mul309.neg = mul nsw i64 %10, -8
%19 = getelementptr i8, ptr %scevgep308, i64 %mul309.neg
%20 = icmp ugt ptr %19, %scevgep308
%21 = or i1 %13, %17
%22 = or i1 %21, %20
br i1 %22, label %for.body43.preheader367, label %vector.memcheck
vector.memcheck: ; preds = %vector.scevcheck
%23 = shl nuw nsw i64 %7, 3
%24 = add i64 %23, %vb312
%25 = shl i64 %.lcssa303, 3
%26 = add i64 %25, 34359738360
%27 = and i64 %26, 34359738360
%28 = add i64 %27, %vb312
%29 = sub i64 %24, %28
%diff.check = icmp ult i64 %29, 32
br i1 %diff.check, label %for.body43.preheader367, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %9, 8589934588
%ind.end = sub nsw i64 %7, %n.vec
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = sub i64 %7, %index
%30 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %offset.idx
%31 = getelementptr inbounds i64, ptr %30, i64 -1
%wide.load = load <2 x i64>, ptr %31, align 8, !tbaa !12
%32 = getelementptr inbounds i64, ptr %30, i64 -3
%wide.load314 = load <2 x i64>, ptr %32, align 8, !tbaa !12
%33 = add i64 %offset.idx, 4294967295
%34 = and i64 %33, 4294967295
%35 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %34
%36 = getelementptr inbounds i64, ptr %35, i64 -1
%wide.load316 = load <2 x i64>, ptr %36, align 8, !tbaa !12
%37 = getelementptr inbounds i64, ptr %35, i64 -3
%wide.load318 = load <2 x i64>, ptr %37, align 8, !tbaa !12
%38 = add nsw <2 x i64> %wide.load316, %wide.load
%39 = add nsw <2 x i64> %wide.load318, %wide.load314
%40 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %34
%41 = getelementptr inbounds i64, ptr %40, i64 -1
store <2 x i64> %38, ptr %41, align 8, !tbaa !12
%42 = getelementptr inbounds i64, ptr %40, i64 -3
store <2 x i64> %39, ptr %42, align 8, !tbaa !12
%index.next = add nuw i64 %index, 4
%43 = icmp eq i64 %index.next, %n.vec
br i1 %43, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %9, %n.vec
br i1 %cmp.n, label %for.cond.cleanup42, label %for.body43.preheader367
for.body43.preheader367: ; preds = %vector.memcheck, %vector.scevcheck, %for.body43.preheader, %middle.block
%indvars.iv278.ph = phi i64 [ %7, %vector.memcheck ], [ %7, %vector.scevcheck ], [ %7, %for.body43.preheader ], [ %ind.end, %middle.block ]
br label %for.body43
for.body22: ; preds = %for.body22, %for.body22.preheader.new
%44 = phi i64 [ 0, %for.body22.preheader.new ], [ %add28.3, %for.body22 ]
%indvars.iv275 = phi i64 [ 0, %for.body22.preheader.new ], [ %indvars.iv.next276.3, %for.body22 ]
%niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.3, %for.body22 ]
%indvars.iv.next276 = or i64 %indvars.iv275, 1
%arrayidx27 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %indvars.iv.next276
%45 = load i64, ptr %arrayidx27, align 8, !tbaa !12
%add28 = add nsw i64 %45, %44
%arrayidx31 = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %indvars.iv.next276
store i64 %add28, ptr %arrayidx31, align 8, !tbaa !12
%indvars.iv.next276.1 = or i64 %indvars.iv275, 2
%arrayidx27.1 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %indvars.iv.next276.1
%46 = load i64, ptr %arrayidx27.1, align 16, !tbaa !12
%add28.1 = add nsw i64 %46, %add28
%arrayidx31.1 = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %indvars.iv.next276.1
store i64 %add28.1, ptr %arrayidx31.1, align 16, !tbaa !12
%indvars.iv.next276.2 = or i64 %indvars.iv275, 3
%arrayidx27.2 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %indvars.iv.next276.2
%47 = load i64, ptr %arrayidx27.2, align 8, !tbaa !12
%add28.2 = add nsw i64 %47, %add28.1
%arrayidx31.2 = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %indvars.iv.next276.2
store i64 %add28.2, ptr %arrayidx31.2, align 8, !tbaa !12
%indvars.iv.next276.3 = add nuw nsw i64 %indvars.iv275, 4
%arrayidx27.3 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %indvars.iv.next276.3
%48 = load i64, ptr %arrayidx27.3, align 16, !tbaa !12
%add28.3 = add nsw i64 %48, %add28.2
%arrayidx31.3 = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %indvars.iv.next276.3
store i64 %add28.3, ptr %arrayidx31.3, align 16, !tbaa !12
%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.cleanup21.loopexit.unr-lcssa, label %for.body22, !llvm.loop !21
for.cond.cleanup42: ; preds = %for.body43, %middle.block, %for.cond.cleanup21
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %geta) #8
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %getb) #8
%arrayidx55 = getelementptr inbounds [100002 x i64], ptr %geta, i64 0, i64 %add10.pre-phi302
store i64 0, ptr %arrayidx55, align 8, !tbaa !12
store i64 0, ptr %geta, align 16, !tbaa !12
%arrayidx58 = getelementptr inbounds [100002 x i64], ptr %getb, i64 0, i64 %add10.pre-phi302
store i64 0, ptr %arrayidx58, align 8, !tbaa !12
store i64 0, ptr %getb, align 16, !tbaa !12
%cmp63.not262 = icmp slt i64 %.lcssa303, 1
br i1 %cmp63.not262, label %for.cond.cleanup65, label %for.body66.lr.ph
for.body66.lr.ph: ; preds = %for.cond.cleanup42
%49 = load i64, ptr %c, align 8, !tbaa !12
%50 = add i64 %add10.pre-phi302, -1
%min.iters.check324 = icmp ult i64 %50, 4
br i1 %min.iters.check324, label %for.body66.preheader, label %vector.ph325
vector.ph325: ; preds = %for.body66.lr.ph
%n.vec327 = and i64 %50, -4
%ind.end328 = or i64 %n.vec327, 1
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %49, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body331
vector.body331: ; preds = %vector.body331, %vector.ph325
%index332 = phi i64 [ 0, %vector.ph325 ], [ %index.next340, %vector.body331 ]
%offset.idx333 = or i64 %index332, 1
%51 = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %offset.idx333
%wide.load334 = load <2 x i64>, ptr %51, align 8, !tbaa !12
%52 = getelementptr inbounds i64, ptr %51, i64 2
%wide.load335 = load <2 x i64>, ptr %52, align 8, !tbaa !12
%53 = getelementptr inbounds [100002 x i64], ptr %x, i64 0, i64 %offset.idx333
%wide.load336 = load <2 x i64>, ptr %53, align 8, !tbaa !12
%54 = getelementptr inbounds i64, ptr %53, i64 2
%wide.load337 = load <2 x i64>, ptr %54, align 8, !tbaa !12
%55 = sub nsw <2 x i64> %wide.load334, %wide.load336
%56 = sub nsw <2 x i64> %wide.load335, %wide.load337
%57 = getelementptr inbounds [100002 x i64], ptr %geta, i64 0, i64 %offset.idx333
store <2 x i64> %55, ptr %57, align 8, !tbaa !12
%58 = getelementptr inbounds i64, ptr %57, i64 2
store <2 x i64> %56, ptr %58, align 8, !tbaa !12
%59 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %offset.idx333
%wide.load338 = load <2 x i64>, ptr %59, align 8, !tbaa !12
%60 = getelementptr inbounds i64, ptr %59, i64 2
%wide.load339 = load <2 x i64>, ptr %60, align 8, !tbaa !12
%61 = add <2 x i64> %wide.load338, %wide.load336
%62 = add <2 x i64> %wide.load339, %wide.load337
%63 = sub <2 x i64> %61, %broadcast.splat
%64 = sub <2 x i64> %62, %broadcast.splat
%65 = getelementptr inbounds [100002 x i64], ptr %getb, i64 0, i64 %offset.idx333
store <2 x i64> %63, ptr %65, align 8, !tbaa !12
%66 = getelementptr inbounds i64, ptr %65, i64 2
store <2 x i64> %64, ptr %66, align 8, !tbaa !12
%index.next340 = add nuw i64 %index332, 4
%67 = icmp eq i64 %index.next340, %n.vec327
br i1 %67, label %middle.block322, label %vector.body331, !llvm.loop !22
middle.block322: ; preds = %vector.body331
%cmp.n330 = icmp eq i64 %50, %n.vec327
br i1 %cmp.n330, label %for.cond.cleanup65, label %for.body66.preheader
for.body66.preheader: ; preds = %for.body66.lr.ph, %middle.block322
%indvars.iv281.ph = phi i64 [ 1, %for.body66.lr.ph ], [ %ind.end328, %middle.block322 ]
br label %for.body66
for.body43: ; preds = %for.body43.preheader367, %for.body43
%indvars.iv278 = phi i64 [ %indvars.iv.next279, %for.body43 ], [ %indvars.iv278.ph, %for.body43.preheader367 ]
%arrayidx45 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %indvars.iv278
%68 = load i64, ptr %arrayidx45, align 8, !tbaa !12
%indvars.iv.next279 = add nsw i64 %indvars.iv278, -1
%idxprom46 = and i64 %indvars.iv.next279, 4294967295
%arrayidx47 = getelementptr inbounds [100002 x i64], ptr %v, i64 0, i64 %idxprom46
%69 = load i64, ptr %arrayidx47, align 8, !tbaa !12
%add48 = add nsw i64 %69, %68
%arrayidx51 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %idxprom46
store i64 %add48, ptr %arrayidx51, align 8, !tbaa !12
%cmp40 = icmp ugt i64 %indvars.iv278, 2
br i1 %cmp40, label %for.body43, label %for.cond.cleanup42, !llvm.loop !23
for.cond.cleanup65: ; preds = %for.body66, %middle.block322, %for.cond.cleanup42
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %maxa) #8
call void @llvm.lifetime.start.p0(i64 800016, ptr nonnull %maxb) #8
%arrayidx86 = getelementptr inbounds [100002 x i64], ptr %maxa, i64 0, i64 %add10.pre-phi302
store i64 0, ptr %arrayidx86, align 8, !tbaa !12
store i64 0, ptr %maxa, align 16, !tbaa !12
%arrayidx89 = getelementptr inbounds [100002 x i64], ptr %maxb, i64 0, i64 %add10.pre-phi302
store i64 0, ptr %arrayidx89, align 8, !tbaa !12
store i64 0, ptr %maxb, align 16, !tbaa !12
br i1 %cmp19257304, label %for.body97.preheader, label %for.cond140.preheader
for.body97.preheader: ; preds = %for.cond.cleanup65
%70 = shl i64 %.lcssa303, 3
%71 = getelementptr i8, ptr %maxb, i64 %70
%scevgep365 = getelementptr i8, ptr %71, i64 8
%load_initial = load i64, ptr %scevgep365, align 8
%xtraiter369 = and i64 %.lcssa303, 1
%72 = icmp eq i64 %.lcssa303, 1
br i1 %72, label %for.cond140.preheader.loopexit.unr-lcssa, label %for.body97.preheader.new
for.body97.preheader.new: ; preds = %for.body97.preheader
%unroll_iter373 = and i64 %.lcssa303, -2
br label %for.body97
for.body66: ; preds = %for.body66.preheader, %for.body66
%indvars.iv281 = phi i64 [ %indvars.iv.next282, %for.body66 ], [ %indvars.iv281.ph, %for.body66.preheader ]
%arrayidx68 = getelementptr inbounds [100002 x i64], ptr %va, i64 0, i64 %indvars.iv281
%73 = load i64, ptr %arrayidx68, align 8, !tbaa !12
%arrayidx70 = getelementptr inbounds [100002 x i64], ptr %x, i64 0, i64 %indvars.iv281
%74 = load i64, ptr %arrayidx70, align 8, !tbaa !12
%sub71 = sub nsw i64 %73, %74
%arrayidx73 = getelementptr inbounds [100002 x i64], ptr %geta, i64 0, i64 %indvars.iv281
store i64 %sub71, ptr %arrayidx73, align 8, !tbaa !12
%arrayidx75 = getelementptr inbounds [100002 x i64], ptr %vb, i64 0, i64 %indvars.iv281
%75 = load i64, ptr %arrayidx75, align 8, !tbaa !12
%sub78.neg = add i64 %75, %74
%sub79 = sub i64 %sub78.neg, %49
%arrayidx81 = getelementptr inbounds [100002 x i64], ptr %getb, i64 0, i64 %indvars.iv281
store i64 %sub79, ptr %arrayidx81, align 8, !tbaa !12
%indvars.iv.next282 = add nuw nsw i64 %indvars.iv281, 1
%exitcond285 = icmp eq i64 %indvars.iv.next282, %add10.pre-phi302
br i1 %exitcond285, label %for.cond.cleanup65, label %for.body66, !llvm.loop !24
for.cond140.preheader.loopexit.unr-lcssa: ; preds = %for.body97, %for.body97.preheader
%store_forwarded.unr = phi i64 [ %load_initial, %for.body97.preheader ], [ %cond132.1, %for.body97 ]
%.unr371 = phi i64 [ 0, %for.body97.preheader ], [ %..1, %for.body97 ]
%indvars.iv286.unr = phi i64 [ 0, %for.body97.preheader ], [ %indvars.iv.next287.1, %for.body97 ]
%lcmp.mod372.not = icmp eq i64 %xtraiter369, 0
br i1 %lcmp.mod372.not, label %for.cond140.preheader, label %for.body97.epil
for.body97.epil: ; preds = %for.cond140.preheader.loopexit.unr-lcssa
%indvars.iv.next287.epil = add nuw nsw i64 %indvars.iv286.unr, 1
%arrayidx102.epil = getelementptr inbounds [100002 x i64], ptr %geta, i64 0, i64 %indvars.iv.next287.epil
%76 = load i64, ptr %arrayidx102.epil, align 8, !tbaa !12
%..epil = call i64 @llvm.smax.i64(i64 %.unr371, i64 %76)
%arrayidx112.epil = getelementptr inbounds [100002 x i64], ptr %maxa, i64 0, i64 %indvars.iv.next287.epil
store i64 %..epil, ptr %arrayidx112.epil, align 8, !tbaa !12
%sub114.epil = sub nsw i64 %.lcssa303, %indvars.iv286.unr
%arrayidx119.epil = getelementptr inbounds [100002 x i64], ptr %getb, i64 0, i64 %sub114.epil
%77 = load i64, ptr %arrayidx119.epil, align 8, !tbaa !12
%cond132.epil = call i64 @llvm.smax.i64(i64 %store_forwarded.unr, i64 %77)
%arrayidx135.epil = getelementptr inbounds [100002 x i64], ptr %maxb, i64 0, i64 %sub114.epil
store i64 %cond132.epil, ptr %arrayidx135.epil, align 8, !tbaa !12
br label %for.cond140.preheader
for.cond140.preheader: ; preds = %for.body97.epil, %for.cond140.preheader.loopexit.unr-lcssa, %for.cond.cleanup65
%cmp142.not268 = icmp slt i64 %.lcssa303, 0
br i1 %cmp142.not268, label %for.cond.cleanup144, label %for.body145.lr.ph
for.body145.lr.ph: ; preds = %for.cond140.preheader
%78 = load i64, ptr %c, align 8, !tbaa !12
%.pre = load i64, ptr %x, align 16, !tbaa !12
%min.iters.check343 = icmp ult i64 %add10.pre-phi302, 4
br i1 %min.iters.check343, label %for.body145.preheader, label %vector.ph344
vector.ph344: ; preds = %for.body145.lr.ph
%n.vec346 = and i64 %add10.pre-phi302, -4
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
%broadcast.splatinsert358 = insertelement <2 x i64> poison, i64 %78, i64 0
%broadcast.splat359 = shufflevector <2 x i64> %broadcast.splatinsert358, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body349
vector.body349: ; preds = %vector.body349, %vector.ph344
%index350 = phi i64 [ 0, %vector.ph344 ], [ %index.next364, %vector.body349 ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph344 ], [ %wide.load357, %vector.body349 ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph344 ], [ %104, %vector.body349 ]
%vec.phi351 = phi <2 x i64> [ zeroinitializer, %vector.ph344 ], [ %105, %vector.body349 ]
%79 = getelementptr inbounds [100002 x i64], ptr %maxa, i64 0, i64 %index350
%wide.load352 = load <2 x i64>, ptr %79, align 16, !tbaa !12
%80 = getelementptr inbounds i64, ptr %79, i64 2
%wide.load353 = load <2 x i64>, ptr %80, align 16, !tbaa !12
%81 = or i64 %index350, 1
%82 = getelementptr inbounds [100002 x i64], ptr %getb, i64 0, i64 %81
%wide.load354 = load <2 x i64>, ptr %82, align 8, !tbaa !12
%83 = getelementptr inbounds i64, ptr %82, i64 2
%wide.load355 = load <2 x i64>, ptr %83, align 8, !tbaa !12
%84 = getelementptr inbounds [100002 x i64], ptr %x, i64 0, i64 %81
%wide.load356 = load <2 x i64>, ptr %84, align 8, !tbaa !12
%85 = getelementptr inbounds i64, ptr %84, i64 2
%wide.load357 = load <2 x i64>, ptr %85, align 8, !tbaa !12
%86 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load356, <2 x i32> <i32 1, i32 2>
%87 = shufflevector <2 x i64> %wide.load356, <2 x i64> %wide.load357, <2 x i32> <i32 1, i32 2>
%88 = add <2 x i64> %wide.load354, %wide.load352
%89 = add <2 x i64> %wide.load355, %wide.load353
%90 = sub <2 x i64> %88, %broadcast.splat359
%91 = sub <2 x i64> %89, %broadcast.splat359
%92 = add <2 x i64> %90, %wide.load356
%93 = add <2 x i64> %91, %wide.load357
%94 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %92)
%95 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi351, <2 x i64> %93)
%96 = getelementptr inbounds [100002 x i64], ptr %maxb, i64 0, i64 %81
%wide.load360 = load <2 x i64>, ptr %96, align 8, !tbaa !12
%97 = getelementptr inbounds i64, ptr %96, i64 2
%wide.load361 = load <2 x i64>, ptr %97, align 8, !tbaa !12
%98 = getelementptr inbounds [100002 x i64], ptr %geta, i64 0, i64 %index350
%wide.load362 = load <2 x i64>, ptr %98, align 16, !tbaa !12
%99 = getelementptr inbounds i64, ptr %98, i64 2
%wide.load363 = load <2 x i64>, ptr %99, align 16, !tbaa !12
%100 = add nsw <2 x i64> %wide.load362, %wide.load360
%101 = add nsw <2 x i64> %wide.load363, %wide.load361
%102 = sub <2 x i64> %100, %86
%103 = sub <2 x i64> %101, %87
%104 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %94, <2 x i64> %102)
%105 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %95, <2 x i64> %103)
%index.next364 = add nuw i64 %index350, 4
%106 = icmp eq i64 %index.next364, %n.vec346
br i1 %106, label %middle.block341, label %vector.body349, !llvm.loop !25
middle.block341: ; preds = %vector.body349
%rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %104, <2 x i64> %105)
%107 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n348 = icmp eq i64 %add10.pre-phi302, %n.vec346
%vector.recur.extract = extractelement <2 x i64> %wide.load357, i64 1
br i1 %cmp.n348, label %for.cond.cleanup144, label %for.body145.preheader
for.body145.preheader: ; preds = %for.body145.lr.ph, %middle.block341
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block341 ], [ %.pre, %for.body145.lr.ph ]
%indvars.iv291.ph = phi i64 [ %n.vec346, %middle.block341 ], [ 0, %for.body145.lr.ph ]
%ans.0269.ph = phi i64 [ %107, %middle.block341 ], [ 0, %for.body145.lr.ph ]
br label %for.body145
for.body97: ; preds = %for.body97, %for.body97.preheader.new
%store_forwarded = phi i64 [ %load_initial, %for.body97.preheader.new ], [ %cond132.1, %for.body97 ]
%108 = phi i64 [ 0, %for.body97.preheader.new ], [ %..1, %for.body97 ]
%indvars.iv286 = phi i64 [ 0, %for.body97.preheader.new ], [ %indvars.iv.next287.1, %for.body97 ]
%niter374 = phi i64 [ 0, %for.body97.preheader.new ], [ %niter374.next.1, %for.body97 ]
%indvars.iv.next287 = or i64 %indvars.iv286, 1
%arrayidx102 = getelementptr inbounds [100002 x i64], ptr %geta, i64 0, i64 %indvars.iv.next287
%109 = load i64, ptr %arrayidx102, align 8, !tbaa !12
%. = call i64 @llvm.smax.i64(i64 %108, i64 %109)
%arrayidx112 = getelementptr inbounds [100002 x i64], ptr %maxa, i64 0, i64 %indvars.iv.next287
store i64 %., ptr %arrayidx112, align 8, !tbaa !12
%sub114 = sub nsw i64 %.lcssa303, %indvars.iv286
%arrayidx119 = getelementptr inbounds [100002 x i64], ptr %getb, i64 0, i64 %sub114
%110 = load i64, ptr %arrayidx119, align 8, !tbaa !12
%cond132 = call i64 @llvm.smax.i64(i64 %store_forwarded, i64 %110)
%arrayidx135 = getelementptr inbounds [100002 x i64], ptr %maxb, i64 0, i64 %sub114
store i64 %cond132, ptr %arrayidx135, align 8, !tbaa !12
%indvars.iv.next287.1 = add nuw nsw i64 %indvars.iv286, 2
%arrayidx102.1 = getelementptr inbounds [100002 x i64], ptr %geta, i64 0, i64 %indvars.iv.next287.1
%111 = load i64, ptr %arrayidx102.1, align 16, !tbaa !12
%..1 = call i64 @llvm.smax.i64(i64 %., i64 %111)
%arrayidx112.1 = getelementptr inbounds [100002 x i64], ptr %maxa, i64 0, i64 %indvars.iv.next287.1
store i64 %..1, ptr %arrayidx112.1, align 16, !tbaa !12
%sub114.1 = sub nsw i64 %.lcssa303, %indvars.iv.next287
%arrayidx119.1 = getelementptr inbounds [100002 x i64], ptr %getb, i64 0, i64 %sub114.1
%112 = load i64, ptr %arrayidx119.1, align 8, !tbaa !12
%cond132.1 = call i64 @llvm.smax.i64(i64 %cond132, i64 %112)
%arrayidx135.1 = getelementptr inbounds [100002 x i64], ptr %maxb, i64 0, i64 %sub114.1
store i64 %cond132.1, ptr %arrayidx135.1, align 8, !tbaa !12
%niter374.next.1 = add i64 %niter374, 2
%niter374.ncmp.1 = icmp eq i64 %niter374.next.1, %unroll_iter373
br i1 %niter374.ncmp.1, label %for.cond140.preheader.loopexit.unr-lcssa, label %for.body97, !llvm.loop !26
for.cond.cleanup144: ; preds = %for.body145, %middle.block341, %for.cond140.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond140.preheader ], [ %107, %middle.block341 ], [ %cond197, %for.body145 ]
%call201 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800016, ptr nonnull %maxb) #8
call void @llvm.lifetime.end.p0(i64 800016, ptr nonnull %maxa) #8
call void @llvm.lifetime.end.p0(i64 800016, ptr nonnull %getb) #8
call void @llvm.lifetime.end.p0(i64 800016, ptr nonnull %geta) #8
call void @llvm.lifetime.end.p0(i64 800016, ptr nonnull %vb) #8
call void @llvm.lifetime.end.p0(i64 800016, ptr nonnull %va) #8
call void @llvm.lifetime.end.p0(i64 800016, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 800016, ptr nonnull %x) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #8
ret i32 0
for.body145: ; preds = %for.body145.preheader, %for.body145
%scalar.recur = phi i64 [ %115, %for.body145 ], [ %scalar.recur.ph, %for.body145.preheader ]
%indvars.iv291 = phi i64 [ %indvars.iv.next292, %for.body145 ], [ %indvars.iv291.ph, %for.body145.preheader ]
%ans.0269 = phi i64 [ %cond197, %for.body145 ], [ %ans.0269.ph, %for.body145.preheader ]
%arrayidx147 = getelementptr inbounds [100002 x i64], ptr %maxa, i64 0, i64 %indvars.iv291
%113 = load i64, ptr %arrayidx147, align 8, !tbaa !12
%indvars.iv.next292 = add nuw nsw i64 %indvars.iv291, 1
%arrayidx150 = getelementptr inbounds [100002 x i64], ptr %getb, i64 0, i64 %indvars.iv.next292
%114 = load i64, ptr %arrayidx150, align 8, !tbaa !12
%arrayidx154 = getelementptr inbounds [100002 x i64], ptr %x, i64 0, i64 %indvars.iv.next292
%115 = load i64, ptr %arrayidx154, align 8, !tbaa !12
%sub155.neg = add i64 %114, %113
%add151 = sub i64 %sub155.neg, %78
%sub156 = add i64 %add151, %115
%ans.0.sub156 = call i64 @llvm.smax.i64(i64 %ans.0269, i64 %sub156)
%arrayidx176 = getelementptr inbounds [100002 x i64], ptr %maxb, i64 0, i64 %indvars.iv.next292
%116 = load i64, ptr %arrayidx176, align 8, !tbaa !12
%arrayidx178 = getelementptr inbounds [100002 x i64], ptr %geta, i64 0, i64 %indvars.iv291
%117 = load i64, ptr %arrayidx178, align 8, !tbaa !12
%add179 = add nsw i64 %117, %116
%sub182 = sub i64 %add179, %scalar.recur
%cond197 = call i64 @llvm.smax.i64(i64 %ans.0.sub156, i64 %sub182)
%exitcond295 = icmp eq i64 %indvars.iv.next292, %add10.pre-phi302
br i1 %exitcond295, label %for.cond.cleanup144, label %for.body145, !llvm.loop !27
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.usub.sat.i64(i64, i64) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind willreturn memory(read) }
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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !15, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15, !19, !20}
!23 = distinct !{!23, !15, !19}
!24 = distinct !{!24, !15, !20, !19}
!25 = distinct !{!25, !15, !19, !20}
!26 = distinct !{!26, !15}
!27 = distinct !{!27, !15, !20, !19}
|
#include <stdio.h>
#include <string.h>
int main(void){
char S[1010] ;
char T[1009] ;
int lengthS;
int lengthT;
int r ;
int p ;
scanf("%s",S);
scanf("%s",T);
lengthS = strlen(S);
lengthT =strlen(T);
int answer = lengthT;
for(r=0;r<=lengthS -lengthT ;r++){
int total =lengthT;
for(p=0;p<=lengthT -1;p++){
if(S[p+r]==T[p]){--total;}
}
if(answer>total) {answer = total ;}
}
printf("%d",answer);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123201/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123201/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [1010 x i8], align 16
%T = alloca [1009 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1010, ptr nonnull %S) #5
call void @llvm.lifetime.start.p0(i64 1009, ptr nonnull %T) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6
%conv = trunc i64 %call4 to i32
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %T) #6
%conv7 = trunc i64 %call6 to i32
%cmp.not43 = icmp sge i32 %conv, %conv7
%cmp11.not.not40 = icmp sgt i32 %conv7, 0
%or.cond = and i1 %cmp.not43, %cmp11.not.not40
br i1 %or.cond, label %for.cond9.preheader.us.preheader, label %for.end26
for.cond9.preheader.us.preheader: ; preds = %entry
%0 = add i64 %call4, 1
%1 = sub i64 %0, %call6
%wide.trip.count53 = and i64 %1, 4294967295
%wide.trip.count = and i64 %call6, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
%n.mod.vf = and i64 %call6, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
%2 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %conv7, i64 0
%cmp.n = icmp eq i64 %n.mod.vf, 0
br label %for.cond9.preheader.us
for.cond9.preheader.us: ; preds = %for.cond9.preheader.us.preheader, %for.cond9.for.end_crit_edge.us
%indvars.iv50 = phi i64 [ 0, %for.cond9.preheader.us.preheader ], [ %indvars.iv.next51, %for.cond9.for.end_crit_edge.us ]
%answer.045.us = phi i32 [ %conv7, %for.cond9.preheader.us.preheader ], [ %spec.select39.us, %for.cond9.for.end_crit_edge.us ]
br i1 %min.iters.check, label %for.body13.us.preheader, label %vector.body
vector.body: ; preds = %for.cond9.preheader.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond9.preheader.us ]
%vec.phi = phi <4 x i32> [ %12, %vector.body ], [ %2, %for.cond9.preheader.us ]
%vec.phi55 = phi <4 x i32> [ %13, %vector.body ], [ zeroinitializer, %for.cond9.preheader.us ]
%3 = add nuw nsw i64 %index, %indvars.iv50
%4 = getelementptr inbounds [1010 x i8], ptr %S, i64 0, i64 %3
%wide.load = load <4 x i8>, ptr %4, align 1, !tbaa !5
%5 = getelementptr inbounds i8, ptr %4, i64 4
%wide.load56 = load <4 x i8>, ptr %5, align 1, !tbaa !5
%6 = getelementptr inbounds [1009 x i8], ptr %T, i64 0, i64 %index
%wide.load57 = load <4 x i8>, ptr %6, align 8, !tbaa !5
%7 = getelementptr inbounds i8, ptr %6, i64 4
%wide.load58 = load <4 x i8>, ptr %7, align 4, !tbaa !5
%8 = icmp eq <4 x i8> %wide.load, %wide.load57
%9 = icmp eq <4 x i8> %wide.load56, %wide.load58
%10 = sext <4 x i1> %8 to <4 x i32>
%11 = sext <4 x i1> %9 to <4 x i32>
%12 = add <4 x i32> %vec.phi, %10
%13 = add <4 x i32> %vec.phi55, %11
%index.next = add nuw i64 %index, 8
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %13, %12
%15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond9.for.end_crit_edge.us, label %for.body13.us.preheader
for.body13.us.preheader: ; preds = %for.cond9.preheader.us, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.cond9.preheader.us ], [ %n.vec, %middle.block ]
%total.042.us.ph = phi i32 [ %conv7, %for.cond9.preheader.us ], [ %15, %middle.block ]
br label %for.body13.us
for.body13.us: ; preds = %for.body13.us.preheader, %for.body13.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body13.us ], [ %indvars.iv.ph, %for.body13.us.preheader ]
%total.042.us = phi i32 [ %spec.select.us, %for.body13.us ], [ %total.042.us.ph, %for.body13.us.preheader ]
%16 = add nuw nsw i64 %indvars.iv, %indvars.iv50
%arrayidx.us = getelementptr inbounds [1010 x i8], ptr %S, i64 0, i64 %16
%17 = load i8, ptr %arrayidx.us, align 1, !tbaa !5
%arrayidx16.us = getelementptr inbounds [1009 x i8], ptr %T, i64 0, i64 %indvars.iv
%18 = load i8, ptr %arrayidx16.us, align 1, !tbaa !5
%cmp18.us = icmp eq i8 %17, %18
%dec.us = sext i1 %cmp18.us to i32
%spec.select.us = add nsw i32 %total.042.us, %dec.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond9.for.end_crit_edge.us, label %for.body13.us, !llvm.loop !12
for.cond9.for.end_crit_edge.us: ; preds = %for.body13.us, %middle.block
%spec.select.us.lcssa = phi i32 [ %15, %middle.block ], [ %spec.select.us, %for.body13.us ]
%spec.select39.us = call i32 @llvm.smin.i32(i32 %answer.045.us, i32 %spec.select.us.lcssa)
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond54.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count53
br i1 %exitcond54.not, label %for.end26, label %for.cond9.preheader.us, !llvm.loop !13
for.end26: ; preds = %for.cond9.for.end_crit_edge.us, %entry
%answer.0.lcssa = phi i32 [ %conv7, %entry ], [ %spec.select39.us, %for.cond9.for.end_crit_edge.us ]
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %answer.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1009, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 1010, ptr nonnull %S) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
!13 = distinct !{!13, !9}
|
#include<stdio.h>
#include<string.h>
int main()
{
char s1[1001],s2[1001];
int len1,len2,count=0,i,j,max;
scanf("%s %s",s1,s2);
len1=strlen(s1);
len2=strlen(s2);
max=0;
for(i=0;i<(len1+1)-len2;i++){
count=0;
for(j=0;j<len2;j++){
if(s1[i+j]==s2[j]){
count++;
}
}
if(max<count)
max=count;
}
printf("%d\n",(len2-max));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123245/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123245/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca [1001 x i8], align 16
%s2 = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s1) #5
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s2) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s1) #6
%conv = trunc i64 %call3 to i32
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s2) #6
%conv6 = trunc i64 %call5 to i32
%add = add nsw i32 %conv, 1
%sub = sub i32 %add, %conv6
%cmp43 = icmp sgt i32 %sub, 0
%cmp940 = icmp sgt i32 %conv6, 0
%or.cond = and i1 %cmp43, %cmp940
br i1 %or.cond, label %for.cond8.preheader.us.preheader, label %for.end26
for.cond8.preheader.us.preheader: ; preds = %entry
%wide.trip.count53 = zext i32 %sub to i64
%wide.trip.count = and i64 %call5, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
%n.mod.vf = and i64 %call5, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
%cmp.n = icmp eq i64 %n.mod.vf, 0
br label %for.cond8.preheader.us
for.cond8.preheader.us: ; preds = %for.cond8.preheader.us.preheader, %for.cond8.for.end_crit_edge.us
%indvars.iv50 = phi i64 [ 0, %for.cond8.preheader.us.preheader ], [ %indvars.iv.next51, %for.cond8.for.end_crit_edge.us ]
%max.045.us = phi i32 [ 0, %for.cond8.preheader.us.preheader ], [ %spec.select39.us, %for.cond8.for.end_crit_edge.us ]
br i1 %min.iters.check, label %for.body11.us.preheader, label %vector.body
vector.body: ; preds = %for.cond8.preheader.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond8.preheader.us ]
%vec.phi = phi <4 x i32> [ %9, %vector.body ], [ zeroinitializer, %for.cond8.preheader.us ]
%vec.phi55 = phi <4 x i32> [ %10, %vector.body ], [ zeroinitializer, %for.cond8.preheader.us ]
%0 = add nuw nsw i64 %index, %indvars.iv50
%1 = getelementptr inbounds [1001 x i8], ptr %s1, i64 0, i64 %0
%wide.load = load <4 x i8>, ptr %1, align 1, !tbaa !5
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load56 = load <4 x i8>, ptr %2, align 1, !tbaa !5
%3 = getelementptr inbounds [1001 x i8], ptr %s2, i64 0, i64 %index
%wide.load57 = load <4 x i8>, ptr %3, align 8, !tbaa !5
%4 = getelementptr inbounds i8, ptr %3, i64 4
%wide.load58 = load <4 x i8>, ptr %4, align 4, !tbaa !5
%5 = icmp eq <4 x i8> %wide.load, %wide.load57
%6 = icmp eq <4 x i8> %wide.load56, %wide.load58
%7 = zext <4 x i1> %5 to <4 x i32>
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = add <4 x i32> %vec.phi, %7
%10 = add <4 x i32> %vec.phi55, %8
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %10, %9
%12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond8.for.end_crit_edge.us, label %for.body11.us.preheader
for.body11.us.preheader: ; preds = %for.cond8.preheader.us, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.cond8.preheader.us ], [ %n.vec, %middle.block ]
%count.041.us.ph = phi i32 [ 0, %for.cond8.preheader.us ], [ %12, %middle.block ]
br label %for.body11.us
for.body11.us: ; preds = %for.body11.us.preheader, %for.body11.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body11.us ], [ %indvars.iv.ph, %for.body11.us.preheader ]
%count.041.us = phi i32 [ %spec.select.us, %for.body11.us ], [ %count.041.us.ph, %for.body11.us.preheader ]
%13 = add nuw nsw i64 %indvars.iv, %indvars.iv50
%arrayidx.us = getelementptr inbounds [1001 x i8], ptr %s1, i64 0, i64 %13
%14 = load i8, ptr %arrayidx.us, align 1, !tbaa !5
%arrayidx15.us = getelementptr inbounds [1001 x i8], ptr %s2, i64 0, i64 %indvars.iv
%15 = load i8, ptr %arrayidx15.us, align 1, !tbaa !5
%cmp17.us = icmp eq i8 %14, %15
%inc.us = zext i1 %cmp17.us to i32
%spec.select.us = add nuw nsw i32 %count.041.us, %inc.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond8.for.end_crit_edge.us, label %for.body11.us, !llvm.loop !12
for.cond8.for.end_crit_edge.us: ; preds = %for.body11.us, %middle.block
%spec.select.us.lcssa = phi i32 [ %12, %middle.block ], [ %spec.select.us, %for.body11.us ]
%spec.select39.us = call i32 @llvm.smax.i32(i32 %max.045.us, i32 %spec.select.us.lcssa)
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond54.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count53
br i1 %exitcond54.not, label %for.end26, label %for.cond8.preheader.us, !llvm.loop !13
for.end26: ; preds = %for.cond8.for.end_crit_edge.us, %entry
%max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select39.us, %for.cond8.for.end_crit_edge.us ]
%sub27 = sub nsw i32 %conv6, %max.0.lcssa
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub27)
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s2) #5
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s1) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
!13 = distinct !{!13, !9}
|
#include <stdio.h>
int main(void){
char s[1001] = { '\0' };
char t[1001] = { '\0' };
int l_s = 0;
int l_t = 0;
int max_match = 0;
scanf("%s", s);
scanf("%s", t);
while(s[l_s] != '\0'){
l_s++;
}
while(t[l_t] != '\0'){
l_t++;
}
for(int i=0; i<l_s - l_t + 1; i++){
int match = 0;
for(int j=0; j<l_t; j++){
if(s[i+j] == t[j]){
match++;
}
}
if(match>max_match){
max_match = match;
}
}
printf("%d\n", l_t-max_match);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123302/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123302/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1001 x i8], align 16
%t = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %s, i8 0, i64 1001, i1 false)
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %t) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %t, i8 0, i64 1001, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv76 = phi i32 [ %indvars.iv.next77, %while.cond ], [ 1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 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.next77 = add nuw i32 %indvars.iv76, 1
br i1 %cmp.not, label %while.cond4, label %while.cond, !llvm.loop !8
while.cond4: ; preds = %while.cond, %while.cond4
%indvars.iv78 = phi i32 [ %indvars.iv.next79, %while.cond4 ], [ %indvars.iv76, %while.cond ]
%indvars.iv71 = phi i32 [ %indvars.iv.next72, %while.cond4 ], [ 0, %while.cond ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %while.cond4 ], [ 0, %while.cond ]
%arrayidx6 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv64
%1 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8.not = icmp eq i8 %1, 0
%indvars.iv.next65 = add nuw i64 %indvars.iv64, 1
%indvars.iv.next72 = add nuw i32 %indvars.iv71, 1
%indvars.iv.next79 = add i32 %indvars.iv78, -1
br i1 %cmp8.not, label %for.cond.preheader, label %while.cond4, !llvm.loop !10
for.cond.preheader: ; preds = %while.cond4
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv64 to i32
%cmp13.not58 = icmp slt i32 %2, %3
%cmp1655.not = icmp eq i32 %3, 0
%or.cond = or i1 %cmp13.not58, %cmp1655.not
br i1 %or.cond, label %for.cond.cleanup, label %for.cond15.preheader.us.preheader
for.cond15.preheader.us.preheader: ; preds = %for.cond.preheader
%wide.trip.count80 = zext i32 %indvars.iv78 to i64
%wide.trip.count = zext i32 %indvars.iv71 to i64
%min.iters.check = icmp ult i32 %indvars.iv71, 8
%n.vec = and i64 %wide.trip.count, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br label %for.cond15.preheader.us
for.cond15.preheader.us: ; preds = %for.cond15.preheader.us.preheader, %for.cond15.for.cond.cleanup18_crit_edge.us
%indvars.iv73 = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvars.iv.next74, %for.cond15.for.cond.cleanup18_crit_edge.us ]
%max_match.059.us = phi i32 [ 0, %for.cond15.preheader.us.preheader ], [ %spec.select.us, %for.cond15.for.cond.cleanup18_crit_edge.us ]
br i1 %min.iters.check, label %for.body19.us.preheader, label %vector.body
vector.body: ; preds = %for.cond15.preheader.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond15.preheader.us ]
%vec.phi = phi <4 x i32> [ %13, %vector.body ], [ zeroinitializer, %for.cond15.preheader.us ]
%vec.phi82 = phi <4 x i32> [ %14, %vector.body ], [ zeroinitializer, %for.cond15.preheader.us ]
%4 = add nuw nsw i64 %index, %indvars.iv73
%5 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %4
%wide.load = load <4 x i8>, ptr %5, align 1, !tbaa !5
%6 = getelementptr inbounds i8, ptr %5, i64 4
%wide.load83 = load <4 x i8>, ptr %6, align 1, !tbaa !5
%7 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %index
%wide.load84 = load <4 x i8>, ptr %7, align 8, !tbaa !5
%8 = getelementptr inbounds i8, ptr %7, i64 4
%wide.load85 = load <4 x i8>, ptr %8, align 4, !tbaa !5
%9 = icmp eq <4 x i8> %wide.load, %wide.load84
%10 = icmp eq <4 x i8> %wide.load83, %wide.load85
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = add <4 x i32> %vec.phi, %11
%14 = add <4 x i32> %vec.phi82, %12
%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 !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %14, %13
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond15.for.cond.cleanup18_crit_edge.us, label %for.body19.us.preheader
for.body19.us.preheader: ; preds = %for.cond15.preheader.us, %middle.block
%indvars.iv67.ph = phi i64 [ 0, %for.cond15.preheader.us ], [ %n.vec, %middle.block ]
%match.056.us.ph = phi i32 [ 0, %for.cond15.preheader.us ], [ %16, %middle.block ]
br label %for.body19.us
for.body19.us: ; preds = %for.body19.us.preheader, %for.body19.us
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body19.us ], [ %indvars.iv67.ph, %for.body19.us.preheader ]
%match.056.us = phi i32 [ %spec.select54.us, %for.body19.us ], [ %match.056.us.ph, %for.body19.us.preheader ]
%17 = add nuw nsw i64 %indvars.iv67, %indvars.iv73
%arrayidx22.us = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %17
%18 = load i8, ptr %arrayidx22.us, align 1, !tbaa !5
%arrayidx25.us = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv67
%19 = load i8, ptr %arrayidx25.us, align 1, !tbaa !5
%cmp27.us = icmp eq i8 %18, %19
%inc29.us = zext i1 %cmp27.us to i32
%spec.select54.us = add nuw nsw i32 %match.056.us, %inc29.us
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%exitcond.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count
br i1 %exitcond.not, label %for.cond15.for.cond.cleanup18_crit_edge.us, label %for.body19.us, !llvm.loop !14
for.cond15.for.cond.cleanup18_crit_edge.us: ; preds = %for.body19.us, %middle.block
%spec.select54.us.lcssa = phi i32 [ %16, %middle.block ], [ %spec.select54.us, %for.body19.us ]
%spec.select.us = call i32 @llvm.smax.i32(i32 %spec.select54.us.lcssa, i32 %max_match.059.us)
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%exitcond81.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count80
br i1 %exitcond81.not, label %for.cond.cleanup, label %for.cond15.preheader.us, !llvm.loop !15
for.cond.cleanup: ; preds = %for.cond15.for.cond.cleanup18_crit_edge.us, %for.cond.preheader
%max_match.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %spec.select.us, %for.cond15.for.cond.cleanup18_crit_edge.us ]
%sub38 = sub nsw i32 %3, %max_match.0.lcssa
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub38)
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!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, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !9, !13, !12}
!15 = distinct !{!15, !9}
|
#include<stdio.h>
int main(){
char s[100];
scanf("%s", s);
for(int i=0; s[i] != 0; i++){
s[i] = 'x';
}
printf("%s", s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123360/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123360/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not8 = icmp eq i8 %0, 0
br i1 %cmp.not8, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx10 = phi ptr [ %arrayidx, %for.body ], [ %s, %entry ]
store i8 120, ptr %arrayidx10, align 1, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %1, 0
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(){
char s[103]; scanf("%s", s);
int len = strlen(s);
for(int i=0; i<len; i++) printf("x");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123403/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123403/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [103 x i8], align 16
call void @llvm.lifetime.start.p0(i64 103, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call2 to i32
%cmp6 = icmp sgt i32 %conv, 0
br i1 %cmp6, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 103, ptr nonnull %s) #5
ret i32 0
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%putchar = call i32 @putchar(i32 120)
%inc = add nuw nsw i32 %i.07, 1
%exitcond.not = icmp eq i32 %inc, %conv
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !5
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
char s[101];
scanf("%s", s);
for (int i=0; s[i]!='\0'; i++) s[i]='x';
printf("%s\n", s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123447/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123447/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not8 = icmp eq i8 %0, 0
br i1 %cmp.not8, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx10 = phi ptr [ %arrayidx, %for.body ], [ %s, %entry ]
store i8 120, ptr %arrayidx10, align 1, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %1, 0
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
char S[100+1];
scanf("%s",S);
for(int i=0;S[i]!='\0';i++){
S[i]='x';
}
printf("%s",S);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123490/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123490/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, 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.not8 = icmp eq i8 %0, 0
br i1 %cmp.not8, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %S)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %S) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx10 = phi ptr [ %arrayidx, %for.body ], [ %S, %entry ]
store i8 120, ptr %arrayidx10, align 1, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %1, 0
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
char S[100];
scanf("%s",&S);
int i;
for(i=0;i<S[i];i++){
S[i]='x';
printf("%c",S[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123533/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123533/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i8, ptr %S, align 16, !tbaa !5
%cmp13 = icmp sgt i8 %0, 0
br i1 %cmp13, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx15 = phi ptr [ %arrayidx, %for.body ], [ %S, %entry ]
store i8 120, ptr %arrayidx15, align 1, !tbaa !5
%putchar = call i32 @putchar(i32 120)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%2 = sext i8 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
int i;
char s[101];
scanf("%s",s);
for(i = 0; i < strlen(s); i++)
s[i] = 'x';
printf("%s",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123577/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123577/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%char0 = load i8, ptr %s, align 16
%cmp9.not = icmp eq i8 %char0, 0
br i1 %cmp9.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
store i8 120, ptr %arrayidx, align 1, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%cmp = icmp ugt i64 %call2, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8
for.end: ; preds = %for.body, %entry
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{ int i,j,k,p,m,t;
scanf("%d %d",&i,&j);
for(k=1;k<=i;k++)
{
for(p=1;p<=j;p++)
{
if(k%2!=0)
{
printf("#");
}
else
{m=k/2;
if(m%2==0){
if(p==1)
printf("#");
else
printf(".");
}
else
{
if(p==j)
printf("#");
else
printf(".");
}
}
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
%j = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %j)
%0 = load i32, ptr %i, align 4, !tbaa !5
%cmp.not41 = icmp slt i32 %0, 1
br i1 %cmp.not41, label %for.end26, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.end
%k.042 = phi i32 [ %inc25, %for.end ], [ 1, %entry ]
%1 = load i32, ptr %j, align 4, !tbaa !5
%cmp2.not39 = icmp slt i32 %1, 1
br i1 %cmp2.not39, label %for.end, label %for.body3.lr.ph
for.body3.lr.ph: ; preds = %for.cond1.preheader
%rem = and i32 %k.042, 1
%cmp4.not = icmp eq i32 %rem, 0
br i1 %cmp4.not, label %for.body3.lr.ph.split.us, label %for.body3
for.body3.lr.ph.split.us: ; preds = %for.body3.lr.ph
%2 = and i32 %k.042, 2
%cmp7 = icmp eq i32 %2, 0
br i1 %cmp7, label %for.inc.us.us.peel, label %for.body3.us
for.inc.us.us.peel: ; preds = %for.body3.lr.ph.split.us
%putchar37.us.us.peel = call i32 @putchar(i32 35)
%.pre = load i32, ptr %j, align 4, !tbaa !5
%cmp2.not.us.us.not.peel = icmp sgt i32 %.pre, 1
br i1 %cmp2.not.us.us.not.peel, label %for.inc.us.us, label %for.end
for.inc.us.us: ; preds = %for.inc.us.us.peel, %for.inc.us.us
%p.040.us.us = phi i32 [ %inc.us.us, %for.inc.us.us ], [ 2, %for.inc.us.us.peel ]
%putchar36.us.us = call i32 @putchar(i32 46)
%.pre46 = load i32, ptr %j, align 4, !tbaa !5
%inc.us.us = add nuw nsw i32 %p.040.us.us, 1
%cmp2.not.us.us.not = icmp slt i32 %p.040.us.us, %.pre46
br i1 %cmp2.not.us.us.not, label %for.inc.us.us, label %for.end, !llvm.loop !9
for.body3.us: ; preds = %for.body3.lr.ph.split.us, %for.body3.us
%3 = phi i32 [ %4, %for.body3.us ], [ %1, %for.body3.lr.ph.split.us ]
%p.040.us = phi i32 [ %inc.us, %for.body3.us ], [ 1, %for.body3.lr.ph.split.us ]
%cmp15.us = icmp eq i32 %p.040.us, %3
%. = select i1 %cmp15.us, i32 35, i32 46
%putchar35.us = call i32 @putchar(i32 %.)
%inc.us = add nuw nsw i32 %p.040.us, 1
%4 = load i32, ptr %j, align 4, !tbaa !5
%cmp2.not.us.not = icmp slt i32 %p.040.us, %4
br i1 %cmp2.not.us.not, label %for.body3.us, label %for.end, !llvm.loop !12
for.body3: ; preds = %for.body3.lr.ph, %for.body3
%p.040 = phi i32 [ %inc, %for.body3 ], [ 1, %for.body3.lr.ph ]
%putchar38 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %p.040, 1
%5 = load i32, ptr %j, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %p.040, %5
br i1 %cmp2.not.not, label %for.body3, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body3, %for.body3.us, %for.inc.us.us, %for.inc.us.us.peel, %for.cond1.preheader
%putchar = call i32 @putchar(i32 10)
%inc25 = add nuw nsw i32 %k.042, 1
%6 = load i32, ptr %i, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %k.042, %6
br i1 %cmp.not.not, label %for.cond1.preheader, label %for.end26, !llvm.loop !13
for.end26: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <string.h>
int main(void){
int i, len;
char S[100];
scanf("%s",S);
len = strlen(S);
for(i = 0; i < len; i++)
{
printf("x");
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123663/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123663/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6
%conv = trunc i64 %call2 to i32
%cmp6 = icmp sgt i32 %conv, 0
br i1 %cmp6, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%putchar = call i32 @putchar(i32 120)
%inc = add nuw nsw i32 %i.07, 1
%exitcond.not = icmp eq i32 %inc, %conv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !5
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main()
{
int i,len;
char a[101];
scanf("%s",a);
len=strlen(a);
for(i=0;i<len;i++){
printf("x");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123728/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123728/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%conv = trunc i64 %call2 to i32
%cmp6 = icmp sgt i32 %conv, 0
br i1 %cmp6, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%putchar = call i32 @putchar(i32 120)
%inc = add nuw nsw i32 %i.07, 1
%exitcond.not = icmp eq i32 %inc, %conv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !5
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define DB double
#define INF 1145141919810364364
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
//#define MOD 998244353
#define ERR 0.00000001
#define NUM 200010
void swap(LL* a,LL* b){LL tmp=*a;*a=*b;*b=tmp;}
void YN(int a){if(a==1)printf("Yes\n");if(a==0)printf("No\n");}
LL lpow(LL a,LL n){LL ans=pow(a,n)*10;if(ans%10<5)return ans/10;return ans/10+1;}
LL dup(LL a,LL d){if(a%d==0)return a/d;else return a/d+1;}
LL GCD(LL a,LL b){LL c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
LL LCM(LL a,LL b){return a*b/GCD(a,b);}
int lcmp(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return 1;if(*(LL*)a<*(LL*)b)return -1;return 0;}
int lcmpr(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return -1;if(*(LL*)a<*(LL*)b)return 1;return 0;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int ccmpr(const void* a,const void* b){return *(char*)b-*(char*)a;}
int scmp(const void* a,const void* b){return strcmp(*(char**)a,*(char**)b);}
int scmpr(const void* a,const void* b){return strcmp(*(char**)b,*(char**)a);}
LL mod(LL a,LL m){if(a<0)return a%m+m;else return a%m;}
LL DIV(LL a,LL d){LL m=MOD,x=1,y=0,k;while(m){k=d/m;d-=k*m;swap(&m,&d);x-=k*y;swap(&x,&y);}return mod(a*mod(x,MOD),MOD);}
LL FAC(LL a){LL i,ans=1;FOR(i,1,a+1){ans*=i;if(MOD>0&&ans>MOD)ans%=MOD;}return ans;}
LL POW(LL a,LL n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return ans;}
int main(){
LL i,ans=0;
char S[105];
scanf("%s",S);
ans=strlen(S);
FOR(i,0,ans)printf("x");
//printf("%lld\n",A,B);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123779/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123779/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"No\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 i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
store i64 %1, ptr %a, align 8, !tbaa !5
store i64 %0, ptr %b, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @YN(i32 noundef %a) local_unnamed_addr #2 {
entry:
switch i32 %a, label %if.end4 [
i32 1, label %if.end4.sink.split
i32 0, label %if.then2
]
if.then2: ; preds = %entry
br label %if.end4.sink.split
if.end4.sink.split: ; preds = %entry, %if.then2
%str.sink = phi ptr [ @str.4, %if.then2 ], [ @str, %entry ]
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
br label %if.end4
if.end4: ; preds = %if.end4.sink.split, %entry
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @lpow(i64 noundef %a, i64 noundef %n) local_unnamed_addr #3 {
entry:
%conv = sitofp i64 %a to double
%conv1 = sitofp i64 %n to double
%call = tail call double @pow(double noundef %conv, double noundef %conv1) #14
%mul = fmul double %call, 1.000000e+01
%conv2 = fptosi double %mul to i64
%rem = srem i64 %conv2, 10
%cmp = icmp sgt i64 %rem, 4
%div = sdiv i64 %conv2, 10
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @dup(i64 noundef %a, i64 noundef %d) local_unnamed_addr #5 {
entry:
%rem = srem i64 %a, %d
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %d
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @GCD(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
%cond5 = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
br label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.019 = phi i64 [ %cond, %entry ], [ %b.addr.018, %while.body ]
%b.addr.018 = phi i64 [ %cond5, %entry ], [ %rem, %while.body ]
%rem = srem i64 %a.addr.019, %b.addr.018
%cmp6.not = icmp eq i64 %rem, 0
br i1 %cmp6.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body
ret i64 %b.addr.018
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @LCM(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 {
entry:
%cond.i = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
%cond5.i = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
br label %while.body.i
while.body.i: ; preds = %while.body.i, %entry
%a.addr.019.i = phi i64 [ %cond.i, %entry ], [ %b.addr.018.i, %while.body.i ]
%b.addr.018.i = phi i64 [ %cond5.i, %entry ], [ %rem.i, %while.body.i ]
%rem.i = srem i64 %a.addr.019.i, %b.addr.018.i
%cmp6.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp6.not.i, label %GCD.exit, label %while.body.i, !llvm.loop !9
GCD.exit: ; preds = %while.body.i
%mul = mul nsw i64 %b, %a
%div = sdiv i64 %mul, %b.addr.018.i
ret i64 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @lcmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #7 {
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
%cmp1 = icmp slt 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 @lcmpr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #7 {
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
%cmp1 = icmp slt 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 @ccmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #7 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !11
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !11
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ccmpr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #7 {
entry:
%0 = load i8, ptr %b, align 1, !tbaa !11
%conv = sext i8 %0 to i32
%1 = load i8, ptr %a, align 1, !tbaa !11
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @scmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #8 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !12
%1 = load ptr, ptr %b, align 8, !tbaa !12
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #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 #9
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @scmpr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #8 {
entry:
%0 = load ptr, ptr %b, align 8, !tbaa !12
%1 = load ptr, ptr %a, align 8, !tbaa !12
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #15
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod(i64 noundef %a, i64 noundef %m) local_unnamed_addr #5 {
entry:
%cmp = icmp slt i64 %a, 0
%rem = srem i64 %a, %m
%add = select i1 %cmp, i64 %m, i64 0
%retval.0 = add nsw i64 %rem, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @DIV(i64 noundef %a, i64 noundef %d) local_unnamed_addr #10 {
entry:
br label %while.body
while.body: ; preds = %entry, %while.body
%y.018 = phi i64 [ 0, %entry ], [ %sub2, %while.body ]
%x.017 = phi i64 [ 1, %entry ], [ %y.018, %while.body ]
%m.016 = phi i64 [ 1000000007, %entry ], [ %sub.recomposed, %while.body ]
%d.addr.015 = phi i64 [ %d, %entry ], [ %m.016, %while.body ]
%div = sdiv i64 %d.addr.015, %m.016
%mul = mul nsw i64 %div, %m.016
%sub.recomposed = srem i64 %d.addr.015, %m.016
%mul1 = mul nsw i64 %div, %y.018
%sub2 = sub nsw i64 %x.017, %mul1
%tobool.not = icmp eq i64 %sub.recomposed, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body
%cmp.i = icmp slt i64 %y.018, 0
%rem.i = srem i64 %y.018, 1000000007
%add.i = select i1 %cmp.i, i64 1000000007, i64 0
%retval.0.i = add nsw i64 %add.i, %rem.i
%mul3 = mul nsw i64 %retval.0.i, %a
%cmp.i6 = icmp slt i64 %mul3, 0
%rem.i7 = srem i64 %mul3, 1000000007
%add.i8 = select i1 %cmp.i6, i64 1000000007, i64 0
%retval.0.i9 = add nsw i64 %add.i8, %rem.i7
ret i64 %retval.0.i9
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @FAC(i64 noundef %a) local_unnamed_addr #10 {
entry:
%cmp.not7 = icmp slt i64 %a, 1
br i1 %cmp.not7, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 1
%0 = icmp eq i64 %a, 1
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, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%ans.09 = phi i64 [ 1, %for.body.preheader.new ], [ %ans.1.1, %for.body ]
%i.08 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%mul = mul nsw i64 %ans.09, %i.08
%cmp1 = icmp sgt i64 %mul, 1000000007
%rem = urem i64 %mul, 1000000007
%ans.1 = select i1 %cmp1, i64 %rem, i64 %mul
%inc = add nuw i64 %i.08, 1
%mul.1 = mul nsw i64 %ans.1, %inc
%cmp1.1 = icmp sgt i64 %mul.1, 1000000007
%rem.1 = urem i64 %mul.1, 1000000007
%ans.1.1 = select i1 %cmp1.1, i64 %rem.1, i64 %mul.1
%inc.1 = add nuw i64 %i.08, 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 !15
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%ans.1.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %ans.1.1, %for.body ]
%ans.09.unr = phi i64 [ 1, %for.body.preheader ], [ %ans.1.1, %for.body ]
%i.08.unr = phi i64 [ 1, %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
%mul.epil = mul nsw i64 %ans.09.unr, %i.08.unr
%cmp1.epil = icmp sgt i64 %mul.epil, 1000000007
%rem.epil = urem i64 %mul.epil, 1000000007
%ans.1.epil = select i1 %cmp1.epil, i64 %rem.epil, i64 %mul.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%ans.0.lcssa = phi i64 [ 1, %entry ], [ %ans.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body.epil ]
ret i64 %ans.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @POW(i64 noundef %a, i64 noundef %n) local_unnamed_addr #10 {
entry:
%cmp8 = icmp sgt i64 %n, 0
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%ans.011 = phi i64 [ %ans.1, %if.end ], [ 1, %entry ]
%n.addr.010 = phi i64 [ %shr, %if.end ], [ %n, %entry ]
%a.addr.09 = phi i64 [ %rem2, %if.end ], [ %a, %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 %ans.011, %a.addr.09
%rem = srem i64 %mul, 1000000007
br label %if.end
if.end: ; preds = %if.then, %while.body
%ans.1 = phi i64 [ %rem, %if.then ], [ %ans.011, %while.body ]
%mul1 = mul nsw i64 %a.addr.09, %a.addr.09
%rem2 = urem i64 %mul1, 1000000007
%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 !16
while.end: ; preds = %if.end, %entry
%ans.0.lcssa = phi i64 [ 1, %entry ], [ %ans.1, %if.end ]
ret i64 %ans.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%S = alloca [105 x i8], align 16
call void @llvm.lifetime.start.p0(i64 105, ptr nonnull %S) #14
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %S)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #15
%cmp5 = icmp sgt i64 %call2, 0
br i1 %cmp5, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%putchar = call i32 @putchar(i32 120)
%inc = add nuw nsw i64 %i.06, 1
%exitcond.not = icmp eq i64 %inc, %call2
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !17
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 105, ptr nonnull %S) #14
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #13
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #12
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 = { 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 #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 #9 = { 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 #10 = { 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 #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 = { nofree nounwind }
attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { nounwind }
attributes #15 = { 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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
int main() {
int a, b;
int getcoin = 0;
int cnt = 2;
scanf("%d %d", &a, &b);
for(int i = 0; i < cnt; i++) {
if(a >= b) {
getcoin += a;
a--;
}
else {
getcoin += b;
b--;
}
}
printf("%d\n", getcoin);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123821/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123821/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp1.not = icmp slt i32 %a.promoted, %b.promoted
br i1 %cmp1.not, label %if.else, label %if.then
if.then: ; preds = %entry
%dec = add nsw i32 %a.promoted, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %entry
%dec3 = add nsw i32 %b.promoted, -1
store i32 %dec3, ptr %b, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%dec311 = phi i32 [ %b.promoted, %if.then ], [ %dec3, %if.else ]
%dec9 = phi i32 [ %dec, %if.then ], [ %a.promoted, %if.else ]
%.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ]
%cmp1.not.1 = icmp slt i32 %dec9, %dec311
br i1 %cmp1.not.1, label %if.else.1, label %if.then.1
if.then.1: ; preds = %for.inc
%dec.1 = add nsw i32 %dec9, -1
store i32 %dec.1, ptr %a, align 4, !tbaa !5
br label %for.inc.1
if.else.1: ; preds = %for.inc
%dec3.1 = add nsw i32 %dec311, -1
store i32 %dec3.1, ptr %b, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.else.1, %if.then.1
%.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec311, %if.else.1 ]
%getcoin.1.1 = add nsw i32 %.pn.1, %.pn
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %getcoin.1.1)
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(){
int a,b;
int p=0;
scanf("%d %d",&a,&b);
if(a>b){
p = p + a + a - 1;
}
else if(a<b){
p = p + b + b - 1;
}
else
p = p + a + b;
printf("%d",p);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123872/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123872/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%add1 = shl nsw i32 %0, 1
%sub = add nsw i32 %add1, -1
br label %if.end10
if.else: ; preds = %entry
%cmp2 = icmp slt i32 %0, %1
br i1 %cmp2, label %if.then3, label %if.else7
if.then3: ; preds = %if.else
%add5 = shl nsw i32 %1, 1
%sub6 = add nsw i32 %add5, -1
br label %if.end10
if.else7: ; preds = %if.else
%add9 = add nsw i32 %1, %0
br label %if.end10
if.end10: ; preds = %if.then3, %if.else7, %if.then
%p.0 = phi i32 [ %sub, %if.then ], [ %sub6, %if.then3 ], [ %add9, %if.else7 ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int x = 0;
int y = 0;
int a = 0;
int b = 0;
scanf("%d %d", &a, &b);
if (a == b) {
x = a + b;
}
else {
if (a > b) {
x = a;
a--;
y = a;
}
else {
x = b;
b--;
y = b;
}
}
x = x + y;
printf("%d", x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123922/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123922/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
store i32 0, ptr %b, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%add = shl nsw i32 %0, 1
br label %if.end5
if.else: ; preds = %entry
%cmp1 = icmp sgt i32 %0, %1
br i1 %cmp1, label %if.then2, label %if.else3
if.then2: ; preds = %if.else
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
br label %if.end5
if.else3: ; preds = %if.else
%dec4 = add nsw i32 %1, -1
store i32 %dec4, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then2, %if.else3, %if.then
%x.0 = phi i32 [ %add, %if.then ], [ %0, %if.then2 ], [ %1, %if.else3 ]
%y.0 = phi i32 [ 0, %if.then ], [ %dec, %if.then2 ], [ %dec4, %if.else3 ]
%add6 = add nsw i32 %y.0, %x.0
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add6)
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);
int sum = 0;
for (int i = 0; i < 2; i++) {
if (a > b) sum += a--;
else sum += b--;
}
printf("%d\n", sum);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123966/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123966/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %a.promoted, %b.promoted
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %entry
%dec = add nsw i32 %a.promoted, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %entry
%dec2 = add nsw i32 %b.promoted, -1
store i32 %dec2, ptr %b, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%dec211 = phi i32 [ %b.promoted, %if.then ], [ %dec2, %if.else ]
%dec9 = phi i32 [ %dec, %if.then ], [ %a.promoted, %if.else ]
%.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ]
%cmp1.1 = icmp sgt i32 %dec9, %dec211
br i1 %cmp1.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc
%dec2.1 = add nsw i32 %dec211, -1
store i32 %dec2.1, ptr %b, align 4, !tbaa !5
br label %for.inc.1
if.then.1: ; preds = %for.inc
%dec.1 = add nsw i32 %dec9, -1
store i32 %dec.1, ptr %a, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.else.1
%.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec211, %if.else.1 ]
%sum.1.1 = add nsw i32 %.pn.1, %.pn
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.1.1)
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a, b;
scanf("%d %d", &a, &b);
int count, i;
for(i=0; i<2; i++){
if(a>b){
count += a;
a--;
}
else{
count +=b;
b--;
}
}
printf("%d",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124008/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124008/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %a.promoted, %b.promoted
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %entry
%dec = add nsw i32 %a.promoted, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %entry
%dec3 = add nsw i32 %b.promoted, -1
store i32 %dec3, ptr %b, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%dec311 = phi i32 [ %b.promoted, %if.then ], [ %dec3, %if.else ]
%dec9 = phi i32 [ %dec, %if.then ], [ %a.promoted, %if.else ]
%cmp1.1 = icmp sgt i32 %dec9, %dec311
br i1 %cmp1.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc
%dec3.1 = add nsw i32 %dec311, -1
store i32 %dec3.1, ptr %b, align 4, !tbaa !5
br label %for.inc.1
if.then.1: ; preds = %for.inc
%dec.1 = add nsw i32 %dec9, -1
store i32 %dec.1, ptr %a, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.else.1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef undef)
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);
int coins=0;
int i;
for(i=0;i<2;i++){
if(a>b){
coins+=a;
a--;
}else{
coins+=b;
b--;
}
}
printf("%d\n",coins);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124051/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124051/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %a.promoted, %b.promoted
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %entry
%dec = add nsw i32 %a.promoted, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %entry
%dec3 = add nsw i32 %b.promoted, -1
store i32 %dec3, ptr %b, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%dec311 = phi i32 [ %b.promoted, %if.then ], [ %dec3, %if.else ]
%dec9 = phi i32 [ %dec, %if.then ], [ %a.promoted, %if.else ]
%.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ]
%cmp1.1 = icmp sgt i32 %dec9, %dec311
br i1 %cmp1.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc
%dec3.1 = add nsw i32 %dec311, -1
store i32 %dec3.1, ptr %b, align 4, !tbaa !5
br label %for.inc.1
if.then.1: ; preds = %for.inc
%dec.1 = add nsw i32 %dec9, -1
store i32 %dec.1, ptr %a, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.else.1
%.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec311, %if.else.1 ]
%coins.1.1 = add nsw i32 %.pn.1, %.pn
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %coins.1.1)
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;
int B;
int i;
int sum = 0;
scanf("%d", &A);
scanf("%d", &B);
for (i = 0; i < 2; i++){
if(A >= B){
sum += A;
A--;
}
else{
sum += B;
B--;
}
}
printf("%d\n", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124095/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124095/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%A.promoted = load i32, ptr %A, align 4, !tbaa !5
%B.promoted = load i32, ptr %B, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %A.promoted, %B.promoted
br i1 %cmp2.not, label %if.else, label %if.then
if.then: ; preds = %entry
%dec = add nsw i32 %A.promoted, -1
store i32 %dec, ptr %A, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %entry
%dec4 = add nsw i32 %B.promoted, -1
store i32 %dec4, ptr %B, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%dec412 = phi i32 [ %B.promoted, %if.then ], [ %dec4, %if.else ]
%dec10 = phi i32 [ %dec, %if.then ], [ %A.promoted, %if.else ]
%.pn = phi i32 [ %A.promoted, %if.then ], [ %B.promoted, %if.else ]
%cmp2.not.1 = icmp slt i32 %dec10, %dec412
br i1 %cmp2.not.1, label %if.else.1, label %if.then.1
if.then.1: ; preds = %for.inc
%dec.1 = add nsw i32 %dec10, -1
store i32 %dec.1, ptr %A, align 4, !tbaa !5
br label %for.inc.1
if.else.1: ; preds = %for.inc
%dec4.1 = add nsw i32 %dec412, -1
store i32 %dec4.1, ptr %B, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.else.1, %if.then.1
%.pn.1 = phi i32 [ %dec10, %if.then.1 ], [ %dec412, %if.else.1 ]
%sum.1.1 = add nsw i32 %.pn.1, %.pn
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.1.1)
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,n,i;
n=0;
scanf("%d%d",&a,&b);
for(i=0; i<=1; i++)
{
if(a>b)
{
n=n+a;
a=a-1;
}
else
{
n=n+b;
b=b-1;
}
}
printf("%d\n",n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124145/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124145/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %a.promoted, %b.promoted
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %entry
%sub = add nsw i32 %a.promoted, -1
store i32 %sub, ptr %a, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %entry
%sub3 = add nsw i32 %b.promoted, -1
store i32 %sub3, ptr %b, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%sub311 = phi i32 [ %b.promoted, %if.then ], [ %sub3, %if.else ]
%sub9 = phi i32 [ %sub, %if.then ], [ %a.promoted, %if.else ]
%.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ]
%cmp1.1 = icmp sgt i32 %sub9, %sub311
br i1 %cmp1.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc
%sub3.1 = add nsw i32 %sub311, -1
store i32 %sub3.1, ptr %b, align 4, !tbaa !5
br label %for.inc.1
if.then.1: ; preds = %for.inc
%sub.1 = add nsw i32 %sub9, -1
store i32 %sub.1, ptr %a, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.else.1
%.pn.1 = phi i32 [ %sub9, %if.then.1 ], [ %sub311, %if.else.1 ]
%n.1.1 = add nsw i32 %.pn.1, %.pn
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n.1.1)
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",&a);
scanf("%d",&b);
if(a>b) printf("%d\n",a+a-1);
else if(a==b) printf("%d\n",a+a);
else printf("%d\n",b+b-1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124189/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124189/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%add = shl nsw i32 %0, 1
%sub = add nsw i32 %add, -1
br label %if.end11
if.else: ; preds = %entry
%cmp3 = icmp eq i32 %0, %1
br i1 %cmp3, label %if.then4, label %if.else7
if.then4: ; preds = %if.else
%add5 = shl nsw i32 %0, 1
br label %if.end11
if.else7: ; preds = %if.else
%add8 = shl nsw i32 %1, 1
%sub9 = add nsw i32 %add8, -1
br label %if.end11
if.end11: ; preds = %if.then4, %if.else7, %if.then
%add5.sink = phi i32 [ %add5, %if.then4 ], [ %sub9, %if.else7 ], [ %sub, %if.then ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,i,sum=0;
scanf("%d",&a);
scanf("%d",&b);
for(i=0;i<2;i++)
{
if(a<b)
{
sum += b;
b -= 1;
}
else
{
sum += a;
a -= 1;
}
}
printf("%d",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124231/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124231/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp slt i32 %a.promoted, %b.promoted
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %entry
%sub = add nsw i32 %b.promoted, -1
store i32 %sub, ptr %b, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %entry
%sub4 = add nsw i32 %a.promoted, -1
store i32 %sub4, ptr %a, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%sub12 = phi i32 [ %sub, %if.then ], [ %b.promoted, %if.else ]
%sub410 = phi i32 [ %a.promoted, %if.then ], [ %sub4, %if.else ]
%.pn = phi i32 [ %b.promoted, %if.then ], [ %a.promoted, %if.else ]
%cmp2.1 = icmp slt i32 %sub410, %sub12
br i1 %cmp2.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc
%sub4.1 = add nsw i32 %sub410, -1
store i32 %sub4.1, ptr %a, align 4, !tbaa !5
br label %for.inc.1
if.then.1: ; preds = %for.inc
%sub.1 = add nsw i32 %sub12, -1
store i32 %sub.1, ptr %b, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.else.1
%.pn.1 = phi i32 [ %sub12, %if.then.1 ], [ %sub410, %if.else.1 ]
%sum.1.1 = add nsw i32 %.pn.1, %.pn
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.1.1)
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 argc, char const *argv[]) {
int A,B,count=0;
scanf("%d %d\n",&A,&B );
if (A > B) {
count += A;
A--;
} else {
count += B;
B--;
}
if (A > B) {
count += A;
A--;
} else {
count += B;
B--;
}
printf("%d\n",count );
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124275/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124275/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %A, align 4, !tbaa !5
br label %if.end
if.else: ; preds = %entry
%dec2 = add nsw i32 %1, -1
store i32 %dec2, ptr %B, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.else, %if.then
%2 = phi i32 [ %1, %if.then ], [ %dec2, %if.else ]
%3 = phi i32 [ %dec, %if.then ], [ %0, %if.else ]
%count.0 = phi i32 [ %0, %if.then ], [ %1, %if.else ]
%cmp3 = icmp sgt i32 %3, %2
br i1 %cmp3, label %if.then4, label %if.else7
if.then4: ; preds = %if.end
%dec6 = add nsw i32 %3, -1
store i32 %dec6, ptr %A, align 4, !tbaa !5
br label %if.end10
if.else7: ; preds = %if.end
%dec9 = add nsw i32 %2, -1
store i32 %dec9, ptr %B, align 4, !tbaa !5
br label %if.end10
if.end10: ; preds = %if.else7, %if.then4
%.pn = phi i32 [ %3, %if.then4 ], [ %2, %if.else7 ]
%count.1 = add nsw i32 %.pn, %count.0
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.1)
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=0,b=0,t=0;
scanf("%d %d",&a,&b);
if(a>b)
{
t=a-1;
if(t>b)
{
printf("%d",a+a-1);
}
else
{
printf("%d",a+b);
}
}
else
{
t=b-1;
if(t>a)
{
printf("%d",b+b-1);
}
else
{
printf("%d",a+b);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124318/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124318/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
store i32 0, ptr %b, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else7
if.then: ; preds = %entry
%sub = add nsw i32 %0, -1
%cmp1 = icmp sgt i32 %sub, %1
br i1 %cmp1, label %if.then2, label %if.else
if.then2: ; preds = %if.then
%add = shl nsw i32 %0, 1
%sub3 = add nsw i32 %add, -1
br label %if.end18
if.else: ; preds = %if.then
%add5 = add nsw i32 %1, %0
br label %if.end18
if.else7: ; preds = %entry
%sub8 = add nsw i32 %1, -1
%cmp9 = icmp sgt i32 %sub8, %0
br i1 %cmp9, label %if.then10, label %if.else14
if.then10: ; preds = %if.else7
%add11 = shl nsw i32 %1, 1
%sub12 = add nsw i32 %add11, -1
br label %if.end18
if.else14: ; preds = %if.else7
%add15 = add nsw i32 %1, %0
br label %if.end18
if.end18: ; preds = %if.then10, %if.else14, %if.then2, %if.else
%sub12.sink = phi i32 [ %sub12, %if.then10 ], [ %add15, %if.else14 ], [ %sub3, %if.then2 ], [ %add5, %if.else ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub12.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main (void){
int A;int B;
scanf("%d %d",&A,&B);
int ans;
if(A == B){
ans = A + B;
}else if(A < B){
ans = B + B - 1;
}else {
ans = A + A - 1;
}
printf("%d\n",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124361/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124361/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%add = shl nsw i32 %0, 1
br label %if.end7
if.else: ; preds = %entry
%cmp1 = icmp slt i32 %0, %1
br i1 %cmp1, label %if.then2, label %if.else4
if.then2: ; preds = %if.else
%add3 = shl nsw i32 %1, 1
%sub = add nsw i32 %add3, -1
br label %if.end7
if.else4: ; preds = %if.else
%add5 = shl nsw i32 %0, 1
%sub6 = add nsw i32 %add5, -1
br label %if.end7
if.end7: ; preds = %if.then2, %if.else4, %if.then
%ans.0 = phi i32 [ %add, %if.then ], [ %sub, %if.then2 ], [ %sub6, %if.else4 ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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);
int num;
if(a > b) num = a + a - 1;
else if(a == b) num = 2 * a;
else num = b + b - 1;
printf("%d\n",num);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124404/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124404/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%add = shl nsw i32 %0, 1
%sub = add nsw i32 %add, -1
br label %if.end6
if.else: ; preds = %entry
%cmp1 = icmp eq i32 %0, %1
br i1 %cmp1, label %if.then2, label %if.else3
if.then2: ; preds = %if.else
%mul = shl nsw i32 %0, 1
br label %if.end6
if.else3: ; preds = %if.else
%add4 = shl nsw i32 %1, 1
%sub5 = add nsw i32 %add4, -1
br label %if.end6
if.end6: ; preds = %if.then2, %if.else3, %if.then
%num.0 = phi i32 [ %sub, %if.then ], [ %mul, %if.then2 ], [ %sub5, %if.else3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num.0)
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 MAX_DATA (100)
#define LIMIT_LEN (40)
#define LIMIT_PAGE (1001)
struct word_t {
char word[LIMIT_LEN];
char pages[LIMIT_PAGE];
};
typedef struct word_t Word;
int compare_word(const void *a, const void *b) {
return strcmp(((Word*)a)->word, ((Word*)b)->word);
}
int main(void) {
Word ws[MAX_DATA] = {};
char word[LIMIT_LEN];
int num_word = 0, page, i, k;
const char *sep;
while (scanf("%s %d ", word, &page) != EOF) {
for (i = 0; i < MAX_DATA; i++) {
if (ws[i].word[0] == '\0') {
strncpy(ws[i].word, word, LIMIT_LEN-1);
ws[i].pages[page] = 1;
num_word++;
break;
} else if (!strcmp(ws[i].word, word)) {
ws[i].pages[page] = 1;
break;
}
}
}
qsort(ws, num_word, sizeof(Word), compare_word);
for (i = 0; i < num_word; i++) {
puts(ws[i].word);
sep = "";
for (k = 0; k < LIMIT_PAGE; k++) {
if (ws[i].pages[k]) {
printf("%s%d", sep, k);
sep = " ";
}
}
putchar('\n');
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124462/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124462/source.c"
target datalayout = "e-m:e-p270: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.word_t = type { [40 x i8], [1001 x i8] }
@.str = private unnamed_addr constant [7 x i8] c"%s %d \00", align 1
@.str.1 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c" \00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_word(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #8
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%ws = alloca [100 x %struct.word_t], align 16
%word = alloca [40 x i8], align 16
%page = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 104100, ptr nonnull %ws) #9
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104100) %ws, i8 0, i64 104100, i1 false)
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %word) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %page) #9
%call79 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %word, ptr noundef nonnull %page)
%cmp.not80 = icmp eq i32 %call79, -1
br i1 %cmp.not80, label %while.end.thread, label %for.cond.preheader
while.end.thread: ; preds = %entry
call void @qsort(ptr noundef nonnull %ws, i64 noundef 0, i64 noundef 1041, ptr noundef nonnull @compare_word) #9
br label %for.end60
for.cond.preheader: ; preds = %entry, %for.end
%num_word.081 = phi i32 [ %num_word.1, %for.end ], [ 0, %entry ]
br label %for.body
for.cond: ; preds = %if.else
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 100
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !5
for.body: ; preds = %for.cond.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.cond.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds [100 x %struct.word_t], ptr %ws, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%cmp4 = icmp eq i8 %0, 0
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %for.body
%call11 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %word, i64 noundef 39) #9
%1 = load i32, ptr %page, align 4, !tbaa !10
%idxprom14 = sext i32 %1 to i64
%arrayidx15 = getelementptr inbounds [100 x %struct.word_t], ptr %ws, i64 0, i64 %indvars.iv, i32 1, i64 %idxprom14
store i8 1, ptr %arrayidx15, align 1, !tbaa !7
%inc = add nsw i32 %num_word.081, 1
br label %for.end
if.else: ; preds = %for.body
%call21 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %word) #8
%tobool.not = icmp eq i32 %call21, 0
br i1 %tobool.not, label %if.then22, label %for.cond
if.then22: ; preds = %if.else
%2 = load i32, ptr %page, align 4, !tbaa !10
%idxprom26 = sext i32 %2 to i64
%arrayidx27 = getelementptr inbounds [100 x %struct.word_t], ptr %ws, i64 0, i64 %indvars.iv, i32 1, i64 %idxprom26
store i8 1, ptr %arrayidx27, align 1, !tbaa !7
br label %for.end
for.end: ; preds = %for.cond, %if.then22, %if.then
%num_word.1 = phi i32 [ %inc, %if.then ], [ %num_word.081, %if.then22 ], [ %num_word.081, %for.cond ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %word, ptr noundef nonnull %page)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12
while.end: ; preds = %for.end
%conv31 = sext i32 %num_word.1 to i64
call void @qsort(ptr noundef nonnull %ws, i64 noundef %conv31, i64 noundef 1041, ptr noundef nonnull @compare_word) #9
%cmp3384 = icmp sgt i32 %num_word.1, 0
br i1 %cmp3384, label %for.body35.preheader, label %for.end60
for.body35.preheader: ; preds = %while.end
%wide.trip.count = zext i32 %num_word.1 to i64
br label %for.body35
for.body35: ; preds = %for.body35.preheader, %for.end56
%indvars.iv95 = phi i64 [ 0, %for.body35.preheader ], [ %indvars.iv.next96, %for.end56 ]
%arrayidx37 = getelementptr inbounds [100 x %struct.word_t], ptr %ws, i64 0, i64 %indvars.iv95
%call40 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %arrayidx37)
br label %for.body44
for.body44: ; preds = %for.body35, %for.inc54
%indvars.iv91 = phi i64 [ 0, %for.body35 ], [ %indvars.iv.next92, %for.inc54 ]
%sep.083 = phi ptr [ @.str.1, %for.body35 ], [ %sep.1, %for.inc54 ]
%arrayidx49 = getelementptr inbounds [100 x %struct.word_t], ptr %ws, i64 0, i64 %indvars.iv95, i32 1, i64 %indvars.iv91
%3 = load i8, ptr %arrayidx49, align 1, !tbaa !7
%tobool50.not = icmp eq i8 %3, 0
br i1 %tobool50.not, label %for.inc54, label %if.then51
if.then51: ; preds = %for.body44
%4 = trunc i64 %indvars.iv91 to i32
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %sep.083, i32 noundef %4)
br label %for.inc54
for.inc54: ; preds = %for.body44, %if.then51
%sep.1 = phi ptr [ @.str.3, %if.then51 ], [ %sep.083, %for.body44 ]
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%exitcond94.not = icmp eq i64 %indvars.iv.next92, 1001
br i1 %exitcond94.not, label %for.end56, label %for.body44, !llvm.loop !13
for.end56: ; preds = %for.inc54
%5 = load ptr, ptr @stdout, align 8, !tbaa !14
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %5)
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%exitcond98.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count
br i1 %exitcond98.not, label %for.end60, label %for.body35, !llvm.loop !16
for.end60: ; preds = %for.end56, %while.end.thread, %while.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %page) #9
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %word) #9
call void @llvm.lifetime.end.p0(i64 104100, ptr nonnull %ws) #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) #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #6
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(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: 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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #5
attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = distinct !{!16, !6}
|
#include<stdio.h>
#include<math.h>
int A,B,i,j,k,l,c,S[200],L=200;
char R[200];
int main()
{
for(;~scanf("%d%d",&A,&B);)
{
A*=10;
for(c=0;A!=0&&c<L;c++)
{
S[c]=A/B;
if(A%B==0)break;
A=A%B*10;
}
if(c!=L)
{
for(i=0;i<=c;i++)printf("%d",S[i]);
puts("");
continue;
}
for(j=1;j<L;j++)
{
for(i=0;i<j+2;i++)
{
for(k=j+i;k<L;k++)
{
//printf("%d %d\n",S[k-j+i],S[k]);
if(S[k-j]!=S[k])break;
}
if(k==L)
{
//printf("%d %d %d\n",j,i,k);
for(l=0;l<i+j;l++)
printf("%d",S[l]);
puts("");
for(l=0;l<i+j;l++)
putchar(l<i?' ':'^');
puts("");
goto e;
}
}
}
e:;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124512/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124512/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@L = dso_local local_unnamed_addr global i32 200, align 4
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@A = dso_local global i32 0, align 4
@B = dso_local global i32 0, align 4
@c = dso_local local_unnamed_addr global i32 0, align 4
@S = dso_local local_unnamed_addr global [200 x i32] zeroinitializer, align 16
@i = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@j = dso_local local_unnamed_addr global i32 0, align 4
@k = dso_local local_unnamed_addr global i32 0, align 4
@l = dso_local local_unnamed_addr global i32 0, align 4
@R = dso_local local_unnamed_addr global [200 x i8] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call121 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @A, ptr noundef nonnull @B)
%tobool.not122 = icmp eq i32 %call121, -1
br i1 %tobool.not122, label %for.end70, label %for.body
for.body: ; preds = %entry, %for.cond.backedge
%0 = load i32, ptr @A, align 4, !tbaa !5
%mul = mul nsw i32 %0, 10
store i32 %mul, ptr @A, align 4, !tbaa !5
%1 = load i32, ptr @L, align 4
%cmp90 = icmp ne i32 %0, 0
%cmp291 = icmp sgt i32 %1, 0
%2 = select i1 %cmp90, i1 %cmp291, i1 false
br i1 %2, label %for.body3.lr.ph, label %for.end.thread142
for.body3.lr.ph: ; preds = %for.body
%3 = load i32, ptr @B, align 4, !tbaa !5
%wide.trip.count = zext i32 %1 to i64
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %if.end
%indvars.iv = phi i64 [ 0, %for.body3.lr.ph ], [ %indvars.iv.next, %if.end ]
%mul68992 = phi i32 [ %mul, %for.body3.lr.ph ], [ %mul6, %if.end ]
%div = sdiv i32 %mul68992, %3
%arrayidx = getelementptr inbounds [200 x i32], ptr @S, i64 0, i64 %indvars.iv
store i32 %div, ptr %arrayidx, align 4, !tbaa !5
%rem = srem i32 %mul68992, %3
%cmp4 = icmp eq i32 %rem, 0
br i1 %cmp4, label %for.end, label %if.end
if.end: ; preds = %for.body3
%mul6 = mul nsw i32 %rem, 10
store i32 %mul6, ptr @A, 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.thread, label %for.body3, !llvm.loop !9
for.end.thread: ; preds = %if.end
store i32 %1, ptr @c, align 4, !tbaa !5
br label %for.cond20.preheader
for.end: ; preds = %for.body3
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr @c, align 4, !tbaa !5
%cmp7.not = icmp eq i32 %1, %4
br i1 %cmp7.not, label %for.cond20.preheader, label %for.cond9.preheader
for.end.thread142: ; preds = %for.body
store i32 0, ptr @c, align 4, !tbaa !5
%cmp7.not143 = icmp eq i32 %1, 0
br i1 %cmp7.not143, label %e.loopexit, label %for.cond9.preheader.thread
for.cond9.preheader.thread: ; preds = %for.end.thread142
store i32 0, ptr @i, align 4, !tbaa !5
br label %for.body11.preheader
for.cond9.preheader: ; preds = %for.end
store i32 0, ptr @i, align 4, !tbaa !5
%cmp10.not99 = icmp slt i32 %4, 0
br i1 %cmp10.not99, label %for.end17, label %for.body11.preheader
for.body11.preheader: ; preds = %for.cond9.preheader.thread, %for.cond9.preheader
br label %for.body11
for.cond20.preheader: ; preds = %for.end.thread, %for.end
%cmp21112 = icmp sgt i32 %1, 1
br i1 %cmp21112, label %for.cond23.preheader.preheader, label %e.loopexit
for.cond23.preheader.preheader: ; preds = %for.cond20.preheader
%5 = zext i32 %1 to i64
%wide.trip.count139 = zext i32 %1 to i64
br label %for.cond23.preheader
for.body11: ; preds = %for.body11.preheader, %for.body11
%storemerge83100 = phi i32 [ %inc16, %for.body11 ], [ 0, %for.body11.preheader ]
%idxprom12 = sext i32 %storemerge83100 to i64
%arrayidx13 = getelementptr inbounds [200 x i32], ptr @S, i64 0, i64 %idxprom12
%6 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6)
%7 = load i32, ptr @i, align 4, !tbaa !5
%inc16 = add nsw i32 %7, 1
store i32 %inc16, ptr @i, align 4, !tbaa !5
%8 = load i32, ptr @c, align 4, !tbaa !5
%cmp10.not.not = icmp slt i32 %7, %8
br i1 %cmp10.not.not, label %for.body11, label %for.end17, !llvm.loop !11
for.end17: ; preds = %for.body11, %for.cond9.preheader
%9 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %9)
br label %for.cond.backedge
for.cond.backedge: ; preds = %for.end61, %e.loopexit, %for.end17
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @A, ptr noundef nonnull @B)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %for.end70, label %for.body, !llvm.loop !14
for.cond23.preheader: ; preds = %for.cond23.preheader.preheader, %for.inc67
%indvars.iv135 = phi i32 [ 3, %for.cond23.preheader.preheader ], [ %indvars.iv.next136, %for.inc67 ]
%indvars.iv127 = phi i64 [ 1, %for.cond23.preheader.preheader ], [ %indvars.iv.next128, %for.inc67 ]
%10 = trunc i64 %indvars.iv127 to i32
br label %for.body25
for.body25: ; preds = %for.cond23.preheader, %for.inc64
%indvars.iv129 = phi i64 [ %indvars.iv127, %for.cond23.preheader ], [ %indvars.iv.next130, %for.inc64 ]
%storemerge78110 = phi i32 [ 0, %for.cond23.preheader ], [ %inc65, %for.inc64 ]
%add26 = add nuw nsw i32 %storemerge78110, %10
%cmp28102 = icmp slt i32 %add26, %1
br i1 %cmp28102, label %for.body29, label %for.end39
for.body29: ; preds = %for.body25, %for.inc37
%indvars.iv131 = phi i64 [ %indvars.iv.next132, %for.inc37 ], [ %indvars.iv129, %for.body25 ]
%11 = sub nuw nsw i64 %indvars.iv131, %indvars.iv127
%arrayidx31 = getelementptr inbounds [200 x i32], ptr @S, i64 0, i64 %11
%12 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%arrayidx33 = getelementptr inbounds [200 x i32], ptr @S, i64 0, i64 %indvars.iv131
%13 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%cmp34.not = icmp eq i32 %12, %13
br i1 %cmp34.not, label %for.inc37, label %for.end39.loopexit
for.inc37: ; preds = %for.body29
%indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
%cmp28 = icmp ult i64 %indvars.iv.next132, %5
br i1 %cmp28, label %for.body29, label %for.body45.preheader, !llvm.loop !15
for.end39.loopexit: ; preds = %for.body29
%14 = trunc i64 %indvars.iv131 to i32
br label %for.end39
for.end39: ; preds = %for.end39.loopexit, %for.body25
%storemerge79.lcssa101 = phi i32 [ %add26, %for.body25 ], [ %14, %for.end39.loopexit ]
%cmp40 = icmp eq i32 %storemerge79.lcssa101, %1
br i1 %cmp40, label %for.body45.preheader, label %for.inc64
for.body45.preheader: ; preds = %for.end39, %for.inc37
store i32 %10, ptr @j, align 4, !tbaa !5
store i32 %storemerge78110, ptr @i, align 4, !tbaa !5
store i32 %1, ptr @k, align 4, !tbaa !5
store i32 0, ptr @l, align 4, !tbaa !5
br label %for.body45
for.body45: ; preds = %for.body45.preheader, %for.body45
%storemerge80117 = phi i32 [ %inc50, %for.body45 ], [ 0, %for.body45.preheader ]
%idxprom46 = sext i32 %storemerge80117 to i64
%arrayidx47 = getelementptr inbounds [200 x i32], ptr @S, i64 0, i64 %idxprom46
%15 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%call48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
%16 = load i32, ptr @l, align 4, !tbaa !5
%inc50 = add nsw i32 %16, 1
store i32 %inc50, ptr @l, align 4, !tbaa !5
%17 = load i32, ptr @i, align 4, !tbaa !5
%18 = load i32, ptr @j, align 4, !tbaa !5
%add43 = add nsw i32 %18, %17
%cmp44 = icmp slt i32 %inc50, %add43
br i1 %cmp44, label %for.body45, label %for.end51, !llvm.loop !16
for.end51: ; preds = %for.body45
%19 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i85 = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %19)
store i32 0, ptr @l, align 4, !tbaa !5
%20 = load i32, ptr @i, align 4, !tbaa !5
%21 = load i32, ptr @j, align 4, !tbaa !5
%add54118 = add nsw i32 %21, %20
%cmp55119 = icmp sgt i32 %add54118, 0
br i1 %cmp55119, label %for.body56, label %for.end61
for.body56: ; preds = %for.end51, %for.body56
%22 = phi i32 [ %25, %for.body56 ], [ %20, %for.end51 ]
%storemerge81120 = phi i32 [ %inc60, %for.body56 ], [ 0, %for.end51 ]
%cmp57 = icmp slt i32 %storemerge81120, %22
%cond = select i1 %cmp57, i32 32, i32 94
%23 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i86 = tail call noundef i32 @putc(i32 noundef %cond, ptr noundef %23)
%24 = load i32, ptr @l, align 4, !tbaa !5
%inc60 = add nsw i32 %24, 1
store i32 %inc60, ptr @l, align 4, !tbaa !5
%25 = load i32, ptr @i, align 4, !tbaa !5
%26 = load i32, ptr @j, align 4, !tbaa !5
%add54 = add nsw i32 %26, %25
%cmp55 = icmp slt i32 %inc60, %add54
br i1 %cmp55, label %for.body56, label %for.end61, !llvm.loop !17
for.end61: ; preds = %for.body56, %for.end51
%27 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i87 = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %27)
br label %for.cond.backedge
for.inc64: ; preds = %for.end39
%inc65 = add nuw i32 %storemerge78110, 1
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%exitcond137.not = icmp eq i32 %inc65, %indvars.iv135
br i1 %exitcond137.not, label %for.inc67, label %for.body25, !llvm.loop !18
for.inc67: ; preds = %for.inc64
store i32 %indvars.iv135, ptr @i, align 4, !tbaa !5
store i32 %storemerge79.lcssa101, ptr @k, align 4, !tbaa !5
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
%indvars.iv.next136 = add nuw i32 %indvars.iv135, 1
%exitcond140.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count139
br i1 %exitcond140.not, label %e.loopexit, label %for.cond23.preheader, !llvm.loop !19
e.loopexit: ; preds = %for.inc67, %for.end.thread142, %for.cond20.preheader
%storemerge77.lcssa = phi i32 [ 1, %for.cond20.preheader ], [ 1, %for.end.thread142 ], [ %1, %for.inc67 ]
store i32 %storemerge77.lcssa, ptr @j, align 4, !tbaa !5
br label %for.cond.backedge
for.end70: ; preds = %for.cond.backedge, %entry
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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
|
#include <stdio.h>
#include <string.h>
int max(int a,int b)
{
if(a>b) return a;
else return b;
}
int dp[4000][4000];
int main()
{
char a[4000],b[4000];
scanf("%s%s",a,b);
int n1=strlen(a),n2=strlen(b);
for(int i=n1;i>=0;i--)
{
for(int j=n2;j>=0;j--)
{
if(j==n2 || i==n1){ dp[i][j]=0; continue;}
if(a[i]==b[j]) dp[i][j]=1+dp[i+1][j+1];
else dp[i][j]=max(dp[i+1][j],dp[i][j+1]);
}
}
// printf("1\n");
// printf("%d\n",dp[0][0]);
char ans[3005];
int k=0;
int i=0,j=0;
while(i<n1&&j<n2)
{
if(dp[i][j]>dp[i+1][j]&&dp[i][j]>dp[i][j+1])
{
ans[k++]=a[i];
i++;
j++;
}
if(dp[i][j]==dp[i+1][j]){ i++; continue;}
if(dp[i][j]==dp[i][j+1]){ j++;continue;}
}
if(k==0)
{
printf(" ");
return 0;
}
printf("%s",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124570/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@dp = dso_local local_unnamed_addr global [4000 x [4000 x i32]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca [4000 x i8], align 16
%b = alloca [4000 x i8], align 16
%ans = alloca [3005 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #8
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %b) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #9
%conv = trunc i64 %call3 to i32
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #9
%conv6 = trunc i64 %call5 to i32
%cmp182 = icmp sgt i32 %conv, -1
%cmp9180 = icmp sgt i32 %conv6, -1
%or.cond = select i1 %cmp182, i1 %cmp9180, i1 false
br i1 %or.cond, label %for.cond8.preheader.us.preheader, label %for.cond.cleanup.thread
for.cond8.preheader.us.preheader: ; preds = %entry
%0 = and i64 %call5, 4294967295
%1 = and i64 %call3, 4294967295
%2 = mul nuw nsw i64 %1, 16000
%3 = shl i64 %call5, 2
%4 = add i64 %3, 4
%5 = and i64 %4, 17179869180
%sext = shl i64 %call3, 32
%6 = ashr exact i64 %sext, 32
%7 = add i64 %call3, 1
%wide.trip.count = and i64 %7, 4294967295
%cmp9.us189.peel.not = icmp eq i64 %0, 0
%8 = getelementptr i8, ptr @dp, i64 %2
br label %for.cond8.preheader.us
for.cond8.preheader.us: ; preds = %for.cond8.preheader.us.preheader, %for.cond8.for.cond.cleanup11_crit_edge.us
%indvars.iv206 = phi i64 [ %6, %for.cond8.preheader.us.preheader ], [ %indvars.iv.next207, %for.cond8.for.cond.cleanup11_crit_edge.us ]
%indvar = phi i64 [ 0, %for.cond8.preheader.us.preheader ], [ %indvar.next, %for.cond8.for.cond.cleanup11_crit_edge.us ]
%cmp15.us = icmp eq i64 %indvars.iv206, %1
%arrayidx20.us = getelementptr inbounds [4000 x i8], ptr %a, i64 0, i64 %indvars.iv206
%9 = add nuw nsw i64 %indvars.iv206, 1
%cmp15.fr.us = freeze i1 %cmp15.us
br i1 %cmp15.fr.us, label %for.body12.us.us.preheader, label %for.inc.us.peel
for.inc.us.peel: ; preds = %for.cond8.preheader.us
%arrayidx18.us187.peel = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %indvars.iv206, i64 %0
store i32 0, ptr %arrayidx18.us187.peel, align 4, !tbaa !5
br i1 %cmp9.us189.peel.not, label %for.cond8.for.cond.cleanup11_crit_edge.us, label %for.body12.us184.peel.next
for.body12.us184.peel.next: ; preds = %for.inc.us.peel
%10 = load i8, ptr %arrayidx20.us, align 1, !tbaa !9
br label %if.end.us
for.body12.us.us.preheader: ; preds = %for.cond8.preheader.us
%11 = mul nsw i64 %indvar, -16000
%scevgep = getelementptr i8, ptr %8, i64 %11
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %5, i1 false), !tbaa !5
br label %for.cond8.for.cond.cleanup11_crit_edge.us
if.end.us: ; preds = %for.inc.us, %for.body12.us184.peel.next
%indvars.iv.in = phi i64 [ %0, %for.body12.us184.peel.next ], [ %indvars.iv, %for.inc.us ]
%indvars.iv = add nsw i64 %indvars.iv.in, -1
%arrayidx23.us = getelementptr inbounds [4000 x i8], ptr %b, i64 0, i64 %indvars.iv
%12 = load i8, ptr %arrayidx23.us, align 1, !tbaa !9
%cmp25.us = icmp eq i8 %10, %12
br i1 %cmp25.us, label %if.then27.us, label %if.else.us
if.else.us: ; preds = %if.end.us
%arrayidx42.us = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %9, i64 %indvars.iv
%13 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5
%arrayidx47.us = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %indvars.iv206, i64 %indvars.iv.in
%14 = load i32, ptr %arrayidx47.us, align 4, !tbaa !5
%a.b.i.us = call i32 @llvm.smax.i32(i32 %13, i32 %14)
br label %for.inc.us
if.then27.us: ; preds = %if.end.us
%arrayidx32.us = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %9, i64 %indvars.iv.in
%15 = load i32, ptr %arrayidx32.us, align 4, !tbaa !5
%add33.us = add nsw i32 %15, 1
br label %for.inc.us
for.inc.us: ; preds = %if.then27.us, %if.else.us
%add33.us.sink = phi i32 [ %add33.us, %if.then27.us ], [ %a.b.i.us, %if.else.us ]
%arrayidx37.us = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %indvars.iv206, i64 %indvars.iv
store i32 %add33.us.sink, ptr %arrayidx37.us, align 4, !tbaa !5
%cmp9.us189 = icmp sgt i64 %indvars.iv.in, 1
br i1 %cmp9.us189, label %if.end.us, label %for.cond8.for.cond.cleanup11_crit_edge.us, !llvm.loop !10
for.cond8.for.cond.cleanup11_crit_edge.us: ; preds = %for.inc.us, %for.inc.us.peel, %for.body12.us.us.preheader
%indvars.iv.next207 = add nsw i64 %indvars.iv206, -1
%indvar.next = add nuw nsw i64 %indvar, 1
%exitcond.not = icmp eq i64 %indvar.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.cond8.preheader.us, !llvm.loop !13
for.cond.cleanup.thread: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 3005, ptr nonnull %ans) #8
br label %if.then123
for.cond.cleanup: ; preds = %for.cond8.for.cond.cleanup11_crit_edge.us
call void @llvm.lifetime.start.p0(i64 3005, ptr nonnull %ans) #8
%cmp59192 = icmp sgt i32 %conv, 0
%cmp61193 = icmp sgt i32 %conv6, 0
%16 = select i1 %cmp59192, i1 %cmp61193, i1 false
br i1 %16, label %while.body, label %if.then123
while.body: ; preds = %for.cond.cleanup, %while.cond.backedge
%j58.0196 = phi i32 [ %j58.0.be, %while.cond.backedge ], [ 0, %for.cond.cleanup ]
%i57.0195 = phi i32 [ %i57.0.be, %while.cond.backedge ], [ 0, %for.cond.cleanup ]
%k.0194 = phi i32 [ %k.1, %while.cond.backedge ], [ 0, %for.cond.cleanup ]
%idxprom63 = sext i32 %i57.0195 to i64
%idxprom65 = sext i32 %j58.0196 to i64
%arrayidx66 = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %idxprom63, i64 %idxprom65
%17 = load i32, ptr %arrayidx66, align 4, !tbaa !5
%add67 = add nsw i32 %i57.0195, 1
%idxprom68 = sext i32 %add67 to i64
%arrayidx71 = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %idxprom68, i64 %idxprom65
%18 = load i32, ptr %arrayidx71, align 4, !tbaa !5
%cmp72 = icmp sgt i32 %17, %18
br i1 %cmp72, label %land.lhs.true, label %if.end92
land.lhs.true: ; preds = %while.body
%add80 = add nsw i32 %j58.0196, 1
%idxprom81 = sext i32 %add80 to i64
%arrayidx82 = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %idxprom63, i64 %idxprom81
%19 = load i32, ptr %arrayidx82, align 4, !tbaa !5
%cmp83 = icmp sgt i32 %17, %19
br i1 %cmp83, label %if.then85, label %if.end92
if.then85: ; preds = %land.lhs.true
%arrayidx87 = getelementptr inbounds [4000 x i8], ptr %a, i64 0, i64 %idxprom63
%20 = load i8, ptr %arrayidx87, align 1, !tbaa !9
%inc = add nsw i32 %k.0194, 1
%idxprom88 = sext i32 %k.0194 to i64
%arrayidx89 = getelementptr inbounds [3005 x i8], ptr %ans, i64 0, i64 %idxprom88
store i8 %20, ptr %arrayidx89, align 1, !tbaa !9
%arrayidx96.phi.trans.insert = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %idxprom68, i64 %idxprom81
%.pre = load i32, ptr %arrayidx96.phi.trans.insert, align 4, !tbaa !5
%.pre211 = add nsw i32 %i57.0195, 2
%.pre212 = sext i32 %.pre211 to i64
br label %if.end92
if.end92: ; preds = %if.then85, %land.lhs.true, %while.body
%idxprom98.pre-phi = phi i64 [ %.pre212, %if.then85 ], [ %idxprom68, %land.lhs.true ], [ %idxprom68, %while.body ]
%add97.pre-phi = phi i32 [ %.pre211, %if.then85 ], [ %add67, %land.lhs.true ], [ %add67, %while.body ]
%21 = phi i32 [ %.pre, %if.then85 ], [ %17, %land.lhs.true ], [ %17, %while.body ]
%idxprom95.pre-phi = phi i64 [ %idxprom81, %if.then85 ], [ %idxprom65, %land.lhs.true ], [ %idxprom65, %while.body ]
%idxprom93.pre-phi = phi i64 [ %idxprom68, %if.then85 ], [ %idxprom63, %land.lhs.true ], [ %idxprom63, %while.body ]
%k.1 = phi i32 [ %inc, %if.then85 ], [ %k.0194, %land.lhs.true ], [ %k.0194, %while.body ]
%i57.1 = phi i32 [ %add67, %if.then85 ], [ %i57.0195, %land.lhs.true ], [ %i57.0195, %while.body ]
%j58.1 = phi i32 [ %add80, %if.then85 ], [ %j58.0196, %land.lhs.true ], [ %j58.0196, %while.body ]
%arrayidx101 = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %idxprom98.pre-phi, i64 %idxprom95.pre-phi
%22 = load i32, ptr %arrayidx101, align 4, !tbaa !5
%cmp102 = icmp eq i32 %21, %22
br i1 %cmp102, label %while.cond.backedge, label %if.end106
while.cond.backedge: ; preds = %if.end92, %if.end106
%i57.0.be = phi i32 [ %add97.pre-phi, %if.end92 ], [ %i57.1, %if.end106 ]
%j58.0.be = phi i32 [ %j58.1, %if.end92 ], [ %spec.select, %if.end106 ]
%cmp59 = icmp slt i32 %i57.0.be, %conv
%cmp61 = icmp slt i32 %j58.0.be, %conv6
%23 = select i1 %cmp59, i1 %cmp61, i1 false
br i1 %23, label %while.body, label %while.end, !llvm.loop !14
if.end106: ; preds = %if.end92
%add113 = add nsw i32 %j58.1, 1
%idxprom114 = sext i32 %add113 to i64
%arrayidx115 = getelementptr inbounds [4000 x [4000 x i32]], ptr @dp, i64 0, i64 %idxprom93.pre-phi, i64 %idxprom114
%24 = load i32, ptr %arrayidx115, align 4, !tbaa !5
%cmp116 = icmp eq i32 %21, %24
%spec.select = select i1 %cmp116, i32 %add113, i32 %j58.1
br label %while.cond.backedge
while.end: ; preds = %while.cond.backedge
%25 = icmp eq i32 %k.1, 0
br i1 %25, label %if.then123, label %if.end125
if.then123: ; preds = %for.cond.cleanup.thread, %for.cond.cleanup, %while.end
%putchar = call i32 @putchar(i32 32)
br label %cleanup
if.end125: ; preds = %while.end
%call127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %ans)
br label %cleanup
cleanup: ; preds = %if.end125, %if.then123
call void @llvm.lifetime.end.p0(i64 3005, ptr nonnull %ans) #8
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %b) #8
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { 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, !12}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
#include<assert.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")
#define charsize 100005 //10^5+5
#define PI 3.141592653589793238
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;}
void cin(ll *n){ scanf("%lld",&(*n)); }
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
double POW_d(double a, double b){double c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;}
ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;}
ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); }
void lr_lower( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); }
void lr_upper( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); }
int cmp_lower( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a>=b ? 1 : 0 ) : ( a>b ? 1 : 0 ) ; }
int cmp_upper( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a<=b ? 1 : 0 ) : ( a<b ? 1 : 0 ) ; }
// return smallest p which meets a[p]==val :1 >=:2 >:3
ll lower_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_lower(&l,&r,a[ (l+r)/2 ],val,type); return cmp_lower(a[l],val,type) ? l : cmp_lower(a[r],val,type) ? r : -1; }
// return biggest p which meets a[p]==val :1 <=:2 <:3
ll upper_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_upper(&l,&r,a[ (l+r)/2 ],val,type); return cmp_upper(a[r],val,type) ? r : cmp_upper(a[l],val,type) ? l : -1; }
// count i which meets ai==x
ll count(ll a[], int l, int r, ll x){ int p = lower_bound(a,l,r,x,1); return p==-1 ? 0 : upper_bound(a,p,r,x,1)-p+1; }
ll *factors[2] , fac_cnt=0;
ll factor_pre(ll x){ rep(i,0,2){ factors[i] = realloc( factors[i] , sizeof(ll) ); factors[i][i?fac_cnt++:fac_cnt]=i?0:2; } repp(i,3,x+1,2) rep(j,0,fac_cnt) if( !(i%factors[0][j]) ){break;} else if(POW(factors[0][j],2)>i){ rep(k,0,2){ factors[k] = realloc( factors[k] , sizeof(ll)*( fac_cnt +1 ) ); factors[k][k?fac_cnt++:fac_cnt]=k?0:i; } break; } return 0; }
ll factor(ll n, ll is_new){
rep(i,0,fac_cnt){
ll cnt=0;
rep(j,0,1){
while( ( cnt+= n %factors[0][i]==0 ? 1 : 0 ) && (n/=factors[0][i]) %factors[0][i]==0 ) continue;
}
factors[1][i]= is_new ? cnt : max2(factors[1][i],cnt);
if( factors[0][i]/**factors[0][i]*/ > n ) break;
}
return n;
}
ll judge_prime(ll n){ rep(i,0,fac_cnt){ if(n<factors[0][i]*factors[0][i] || n==factors[0][i]) break; else if(n%factors[0][i]==0) n/=n; } return n==1?0:1; }
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
int cmp_string( const void * a , const void * b ) { return strcmp( (char *)a , (char *)b ); } // qsort((void*)s,n,sizeof(s[0]),int_sort );
int cmp_char(const void * a, const void * b) { return *(char *)a - *(char *)b;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
void sort_string(int n,int size,char s[][size]){ qsort( (void*)s , n , sizeof(s[0]) , cmp_string ); }
void sort_char(char *s){ qsort( (void *)s , strlen(s) , sizeof(char) , cmp_char ); }
ll unique_string(ll n ,ll size, char s[][size]){ ll ans=1; rep(i,1,n) if( strcmp(s[i],s[i-1]) ) ans++; return ans; }
ll unique_num(ll n , ll a[]){ ll ans=1; rep(i,1,n) if( a[i]!=a[i-1] ) ans++; return ans; }
typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}
ll inv[2000005],finv[2000005],mod_fac[2000005];
void makeinv(ll n){ inv[1]=1;finv[0]=finv[1]=1; rep(i,2,n+1){ inv[i]= MOD1 - inv[MOD1%i] * (MOD1 / i) % MOD1; finv[i] = finv[i - 1] * inv[i] % MOD1; } }
void make_mod_fac(ll n, ll mod){ ll x=1; mod_fac[0]=mod_fac[1]=x; rep(i,2,n+1){ x*=i%mod; x%=mod; mod_fac[i]=x; } }
ll mod_nck(ll n, ll k, ll mod){ return mod_fac[n]*finv[k]%mod*finv[n-k]%mod; }
ll modpow(ll r,ll n){ ll t=1,s=r; while(n>0){ t = (n&1) ? t*s%MOD1 : t; s=s*s%MOD1; n>>=1; } return r?t:0; }
ll ano[10000];
int main(void){
// fgets(s,sizeof(s),stdin);
// char ;
ll n;
ll ans=0;
cin(&n);
// scanf("%s",);
factor_pre(1e3);
makeinv(1e6);
ll a[n];
ll tmp=1,mark=0;
rep(i,0,n){
cin(&a[i]);
ll piv=factor(a[i],0);
if(piv!=1){
ano[mark++]=piv;
}
}
// rep(i,0,10) printf("%lld %lld\n",factors[0][i],factors[1][i]);
rep(i,0,fac_cnt){
// if(factors[1][i]) printf("%lld %lld\n",factors[0][i],factors[1][i]);
tmp*=modpow(factors[0][i],factors[1][i]);
tmp%=MOD1;
}
if(mark){
sortdown(ano,10000);
tmp*=ano[0]; tmp%=MOD1;
rep(i,1,mark){
if(ano[i]!=ano[i-1]){
tmp*=ano[i];
tmp%=MOD1;
}
}
}
// printf("%lld\n",tmp);
rep(i,0,n){
ans+= mod_MOD1(tmp*inv[a[i]]);
// ans+= tmp/a[i];
ans%=MOD1;
}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124620/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124620/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@fac_cnt = dso_local local_unnamed_addr global i64 0, align 8
@factors = dso_local local_unnamed_addr global [2 x ptr] zeroinitializer, align 16
@inv = dso_local local_unnamed_addr global [2000005 x i64] zeroinitializer, align 16
@finv = dso_local local_unnamed_addr global [2000005 x i64] zeroinitializer, align 16
@mod_fac = dso_local local_unnamed_addr global [2000005 x i64] zeroinitializer, align 16
@ano = dso_local global [10000 x i64] zeroinitializer, align 16
@.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: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @cin(ptr noundef %n) local_unnamed_addr #2 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 {
entry:
%cmp.not = icmp sgt i64 %a, %b
%cmp1.not = icmp sgt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 {
entry:
%cmp.not = icmp slt i64 %a, %b
%cmp1.not = icmp slt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 {
entry:
%cmp4 = icmp sgt i64 %n, 0
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%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.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi7 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, 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 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8)
%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 !9
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%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.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.05.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader9, %for.body
%i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ]
%b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smin.i64(i64 %b.05, i64 %6)
%inc = add nuw nsw i64 %i.06, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 {
entry:
%cmp4 = icmp sgt i64 %n, 0
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%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.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi7 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, 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 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8)
%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 !14
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%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.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.05.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader9, %for.body
%i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ]
%b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smax.i64(i64 %b.05, i64 %6)
%inc = add nuw nsw i64 %i.06, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 {
entry:
%cmp3 = icmp sgt i64 %b, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
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 %b, -8
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%c.04.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.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.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 %c.04.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.cond.cleanup, label %for.body.epil, !llvm.loop !16
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %c.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%c.04 = 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 %c.04, %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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local double @POW_d(double noundef %a, double noundef %b) local_unnamed_addr #6 {
entry:
%cmp4 = fcmp ogt double %b, 0.000000e+00
br i1 %cmp4, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%c.0.lcssa = phi double [ 1.000000e+00, %entry ], [ %mul, %for.body ]
ret double %c.0.lcssa
for.body: ; preds = %entry, %for.body
%i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%c.05 = phi double [ %mul, %for.body ], [ 1.000000e+00, %entry ]
%mul = fmul double %c.05, %a
%inc = add nuw nsw i64 %i.06, 1
%conv = sitofp i64 %inc to double
%cmp = fcmp olt double %conv, %b
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 {
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 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i
cond.true.i: ; preds = %entry, %cond.true.i
%b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i
gcd.exit: ; preds = %cond.true.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ]
%div = sdiv i64 %a, %a.tr.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #7 {
entry:
%cmp = icmp slt i64 %n, 0
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
%n.nonneg = sub i64 0, %n
%0 = urem i64 %n.nonneg, 1000000007
%1 = add nsw i64 %0, %n
%mul = sub i64 1000000007, %1
br label %cond.end
cond.end: ; preds = %entry, %cond.true
%cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ]
%add1 = add nsw i64 %cond, %n
%rem = srem i64 %add1, 1000000007
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #7 {
entry:
%cmp = icmp slt i64 %n, 0
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
%div7 = sdiv i64 %n, %p
%add = sub i64 1, %div7
%mul = mul nsw i64 %add, %p
br label %cond.end
cond.end: ; preds = %entry, %cond.true
%cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ]
%add1 = add nsw i64 %cond, %n
%rem = srem i64 %add1, %p
ret i64 %rem
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #8 {
entry:
%tobool.not11 = icmp eq i64 %p, 0
br i1 %tobool.not11, label %cond.end, label %cond.false.preheader
cond.false.preheader: ; preds = %entry
%0 = add i64 %p, -2
br label %cond.false
cond.false: ; preds = %cond.false.preheader, %POW.exit
%indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ]
%p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ]
%accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ]
%1 = xor i64 %indvar, -1
%2 = add i64 %1, %p
%sub = add nsw i64 %p.tr13, -1
%cmp3.i = icmp sgt i64 %p.tr13, 1
br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit
for.body.i.preheader: ; preds = %cond.false
%3 = sub i64 %0, %indvar
%xtraiter = and i64 %2, 7
%4 = icmp ult i64 %3, 7
br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %2, -8
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ]
%mul.i.7 = mul i64 %c.04.i, 100000000
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !18
POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ]
%c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil
%c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ]
%mul.i.epil = mul nsw i64 %c.04.i.epil, 10
%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 %POW.exit, label %for.body.i.epil, !llvm.loop !20
POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false
%c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ]
%sub1 = sub nsw i64 %len, %p.tr13
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1
%5 = load i8, ptr %arrayidx, align 1, !tbaa !21
%conv = sext i8 %5 to i64
%sub2 = add nsw i64 %conv, -48
%mul = mul nsw i64 %sub2, %c.0.lcssa.i
%add = add nsw i64 %mul, %accumulator.tr12
%tobool.not = icmp eq i64 %sub, 0
%indvar.next = add i64 %indvar, 1
br i1 %tobool.not, label %cond.end, label %cond.false
cond.end: ; preds = %POW.exit, %entry
%accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ]
ret i64 %accumulator.tr.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @lr_lower(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 {
entry:
%cmp = icmp slt i32 %type, 3
%0 = load i32, ptr %l, align 4, !tbaa !22
%1 = load i32, ptr %r, align 4, !tbaa !22
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%cmp1 = icmp slt i64 %am, %val
%l.r = select i1 %cmp1, ptr %l, ptr %r
%cmp6.not = icmp sgt i64 %am, %val
%r.l = select i1 %cmp6.not, ptr %r, ptr %l
%l.sink = select i1 %cmp, ptr %l.r, ptr %r.l
store i32 %div, ptr %l.sink, align 4, !tbaa !22
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @lr_upper(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 {
entry:
%cmp = icmp slt i32 %type, 3
%0 = load i32, ptr %l, align 4, !tbaa !22
%1 = load i32, ptr %r, align 4, !tbaa !22
%add3 = add nsw i32 %1, %0
%div4 = sdiv i32 %add3, 2
%cmp1.not = icmp sgt i64 %am, %val
%r.l = select i1 %cmp1.not, ptr %r, ptr %l
%cmp6 = icmp slt i64 %am, %val
%l.r = select i1 %cmp6, ptr %l, ptr %r
%l.sink = select i1 %cmp, ptr %r.l, ptr %l.r
store i32 %div4, ptr %l.sink, align 4, !tbaa !22
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @cmp_lower(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 {
entry:
switch i32 %type, label %cond.false6 [
i32 1, label %cond.true
i32 2, label %cond.true3
]
cond.true: ; preds = %entry
%cmp1 = icmp eq i64 %a, %b
br label %cond.end10
cond.true3: ; preds = %entry
%cmp4.not = icmp sge i64 %a, %b
br label %cond.end10
cond.false6: ; preds = %entry
%cmp7 = icmp sgt i64 %a, %b
br label %cond.end10
cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true
%cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ]
%cond11 = zext i1 %cond11.in to i32
ret i32 %cond11
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @cmp_upper(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 {
entry:
switch i32 %type, label %cond.false6 [
i32 1, label %cond.true
i32 2, label %cond.true3
]
cond.true: ; preds = %entry
%cmp1 = icmp eq i64 %a, %b
br label %cond.end10
cond.true3: ; preds = %entry
%cmp4.not = icmp sle i64 %a, %b
br label %cond.end10
cond.false6: ; preds = %entry
%cmp7 = icmp slt i64 %a, %b
br label %cond.end10
cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true
%cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ]
%cond11 = zext i1 %cond11.in to i32
ret i32 %cond11
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 {
entry:
%sub34 = sub nsw i32 %r, %l
%cmp35 = icmp sgt i32 %sub34, 1
br i1 %cmp35, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%cmp.i = icmp slt i32 %type, 3
br i1 %cmp.i, label %while.body.us, label %while.body
while.body.us: ; preds = %while.body.lr.ph, %while.body.us
%l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ]
%r.addr.0 = phi i32 [ %spec.select51, %while.body.us ], [ %r, %while.body.lr.ph ]
%add.us = add nsw i32 %l.addr.0, %r.addr.0
%div.us = sdiv i32 %add.us, 2
%idxprom.us = sext i32 %div.us to i64
%arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us
%0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5
%cmp1.i.us = icmp slt i64 %0, %val
%spec.select = select i1 %cmp1.i.us, i32 %div.us, i32 %l.addr.0
%spec.select51 = select i1 %cmp1.i.us, i32 %r.addr.0, i32 %div.us
%sub.us = sub nsw i32 %spec.select51, %spec.select
%cmp.us = icmp sgt i32 %sub.us, 1
br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !24
while.body: ; preds = %while.body.lr.ph, %while.body
%l.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %l, %while.body.lr.ph ]
%r.addr.2 = phi i32 [ %spec.select53, %while.body ], [ %r, %while.body.lr.ph ]
%add = add nsw i32 %l.addr.2, %r.addr.2
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp6.not.i = icmp sgt i64 %1, %val
%spec.select52 = select i1 %cmp6.not.i, i32 %l.addr.2, i32 %div
%spec.select53 = select i1 %cmp6.not.i, i32 %div, i32 %r.addr.2
%sub = sub nsw i32 %spec.select53, %spec.select52
%cmp = icmp sgt i32 %sub, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !24
while.end: ; preds = %while.body, %while.body.us, %entry
%r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select51, %while.body.us ], [ %spec.select53, %while.body ]
%l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select52, %while.body ]
%idxprom1 = sext i32 %l.addr.0..lcssa to i64
%arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1
%2 = load i64, ptr %arrayidx2, align 8, !tbaa !5
switch i32 %type, label %cmp_lower.exit [
i32 1, label %cond.true.i
i32 2, label %cond.true3.i
]
cond.true.i: ; preds = %while.end
%cmp1.i17 = icmp eq i64 %2, %val
br i1 %cmp1.i17, label %cond.end9, label %cond.false.thread
cond.false.thread: ; preds = %cond.true.i
%idxprom345 = sext i32 %r.addr.0..lcssa to i64
%arrayidx446 = getelementptr inbounds i64, ptr %a, i64 %idxprom345
%3 = load i64, ptr %arrayidx446, align 8, !tbaa !5
%cmp1.i23 = icmp eq i64 %3, %val
br label %cmp_lower.exit26
cond.true3.i: ; preds = %while.end
%cmp4.not.i.not = icmp slt i64 %2, %val
br i1 %cmp4.not.i.not, label %cond.false.thread47, label %cond.end9
cond.false.thread47: ; preds = %cond.true3.i
%idxprom348 = sext i32 %r.addr.0..lcssa to i64
%arrayidx449 = getelementptr inbounds i64, ptr %a, i64 %idxprom348
%4 = load i64, ptr %arrayidx449, align 8, !tbaa !5
%cmp4.not.i19 = icmp sge i64 %4, %val
br label %cmp_lower.exit26
cmp_lower.exit: ; preds = %while.end
%cmp7.i = icmp sgt i64 %2, %val
br i1 %cmp7.i, label %cond.end9, label %cond.false
cond.false: ; preds = %cmp_lower.exit
%idxprom3 = sext i32 %r.addr.0..lcssa to i64
%arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3
%5 = load i64, ptr %arrayidx4, align 8, !tbaa !5
%cmp7.i25 = icmp sgt i64 %5, %val
br label %cmp_lower.exit26
cmp_lower.exit26: ; preds = %cond.false.thread, %cond.false.thread47, %cond.false
%cond11.in.i20 = phi i1 [ %cmp1.i23, %cond.false.thread ], [ %cmp4.not.i19, %cond.false.thread47 ], [ %cmp7.i25, %cond.false ]
%6 = sext i32 %r.addr.0..lcssa to i64
%.pre = select i1 %cond11.in.i20, i64 %6, i64 -1
br label %cond.end9
cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_lower.exit, %cmp_lower.exit26
%conv.pre-phi = phi i64 [ %idxprom1, %cmp_lower.exit ], [ %.pre, %cmp_lower.exit26 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ]
ret i64 %conv.pre-phi
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @upper_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 {
entry:
%sub33 = sub nsw i32 %r, %l
%cmp34 = icmp sgt i32 %sub33, 1
br i1 %cmp34, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%cmp.i = icmp slt i32 %type, 3
br i1 %cmp.i, label %while.body.us, label %while.body
while.body.us: ; preds = %while.body.lr.ph, %while.body.us
%l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ]
%r.addr.0 = phi i32 [ %spec.select50, %while.body.us ], [ %r, %while.body.lr.ph ]
%add.us = add nsw i32 %l.addr.0, %r.addr.0
%div.us = sdiv i32 %add.us, 2
%idxprom.us = sext i32 %div.us to i64
%arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us
%0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5
%cmp1.not.i.us = icmp sgt i64 %0, %val
%spec.select = select i1 %cmp1.not.i.us, i32 %l.addr.0, i32 %div.us
%spec.select50 = select i1 %cmp1.not.i.us, i32 %div.us, i32 %r.addr.0
%sub.us = sub nsw i32 %spec.select50, %spec.select
%cmp.us = icmp sgt i32 %sub.us, 1
br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !25
while.body: ; preds = %while.body.lr.ph, %while.body
%l.addr.2 = phi i32 [ %spec.select51, %while.body ], [ %l, %while.body.lr.ph ]
%r.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %r, %while.body.lr.ph ]
%add = add nsw i32 %l.addr.2, %r.addr.2
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp6.i = icmp slt i64 %1, %val
%spec.select51 = select i1 %cmp6.i, i32 %div, i32 %l.addr.2
%spec.select52 = select i1 %cmp6.i, i32 %r.addr.2, i32 %div
%sub = sub nsw i32 %spec.select52, %spec.select51
%cmp = icmp sgt i32 %sub, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !25
while.end: ; preds = %while.body, %while.body.us, %entry
%r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select50, %while.body.us ], [ %spec.select52, %while.body ]
%l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select51, %while.body ]
%idxprom1 = sext i32 %r.addr.0..lcssa to i64
%arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1
%2 = load i64, ptr %arrayidx2, align 8, !tbaa !5
switch i32 %type, label %cmp_upper.exit [
i32 1, label %cond.true.i
i32 2, label %cond.true3.i
]
cond.true.i: ; preds = %while.end
%cmp1.i = icmp eq i64 %2, %val
br i1 %cmp1.i, label %cond.end9, label %cond.false.thread
cond.false.thread: ; preds = %cond.true.i
%idxprom344 = sext i32 %l.addr.0..lcssa to i64
%arrayidx445 = getelementptr inbounds i64, ptr %a, i64 %idxprom344
%3 = load i64, ptr %arrayidx445, align 8, !tbaa !5
%cmp1.i22 = icmp eq i64 %3, %val
br label %cmp_upper.exit25
cond.true3.i: ; preds = %while.end
%cmp4.not.i.not = icmp sgt i64 %2, %val
br i1 %cmp4.not.i.not, label %cond.false.thread46, label %cond.end9
cond.false.thread46: ; preds = %cond.true3.i
%idxprom347 = sext i32 %l.addr.0..lcssa to i64
%arrayidx448 = getelementptr inbounds i64, ptr %a, i64 %idxprom347
%4 = load i64, ptr %arrayidx448, align 8, !tbaa !5
%cmp4.not.i18 = icmp sle i64 %4, %val
br label %cmp_upper.exit25
cmp_upper.exit: ; preds = %while.end
%cmp7.i = icmp slt i64 %2, %val
br i1 %cmp7.i, label %cond.end9, label %cond.false
cond.false: ; preds = %cmp_upper.exit
%idxprom3 = sext i32 %l.addr.0..lcssa to i64
%arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3
%5 = load i64, ptr %arrayidx4, align 8, !tbaa !5
%cmp7.i24 = icmp slt i64 %5, %val
br label %cmp_upper.exit25
cmp_upper.exit25: ; preds = %cond.false.thread, %cond.false.thread46, %cond.false
%cond11.in.i19 = phi i1 [ %cmp1.i22, %cond.false.thread ], [ %cmp4.not.i18, %cond.false.thread46 ], [ %cmp7.i24, %cond.false ]
%6 = sext i32 %l.addr.0..lcssa to i64
%.pre = select i1 %cond11.in.i19, i64 %6, i64 -1
br label %cond.end9
cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_upper.exit, %cmp_upper.exit25
%conv.pre-phi = phi i64 [ %idxprom1, %cmp_upper.exit ], [ %.pre, %cmp_upper.exit25 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ]
ret i64 %conv.pre-phi
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @count(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %x) local_unnamed_addr #8 {
entry:
%sub34.i = sub nsw i32 %r, %l
%cmp35.i = icmp sgt i32 %sub34.i, 1
br i1 %cmp35.i, label %while.body.us.i, label %while.end.i
while.body.us.i: ; preds = %entry, %while.body.us.i
%l.addr.0.i = phi i32 [ %spec.select.i, %while.body.us.i ], [ %l, %entry ]
%r.addr.0.i = phi i32 [ %spec.select51.i, %while.body.us.i ], [ %r, %entry ]
%add.us.i = add nsw i32 %r.addr.0.i, %l.addr.0.i
%div.us.i = sdiv i32 %add.us.i, 2
%idxprom.us.i = sext i32 %div.us.i to i64
%arrayidx.us.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i
%0 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5
%cmp1.i.us.i = icmp slt i64 %0, %x
%spec.select.i = select i1 %cmp1.i.us.i, i32 %div.us.i, i32 %l.addr.0.i
%spec.select51.i = select i1 %cmp1.i.us.i, i32 %r.addr.0.i, i32 %div.us.i
%sub.us.i = sub nsw i32 %spec.select51.i, %spec.select.i
%cmp.us.i = icmp sgt i32 %sub.us.i, 1
br i1 %cmp.us.i, label %while.body.us.i, label %while.end.i, !llvm.loop !24
while.end.i: ; preds = %while.body.us.i, %entry
%r.addr.0..lcssa.i = phi i32 [ %r, %entry ], [ %spec.select51.i, %while.body.us.i ]
%l.addr.0..lcssa.i = phi i32 [ %l, %entry ], [ %spec.select.i, %while.body.us.i ]
%idxprom1.i = sext i32 %l.addr.0..lcssa.i to i64
%arrayidx2.i = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i
%1 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5
%cmp1.i17.i = icmp eq i64 %1, %x
br i1 %cmp1.i17.i, label %lower_bound.exit, label %cond.false.thread.i
cond.false.thread.i: ; preds = %while.end.i
%idxprom345.i = sext i32 %r.addr.0..lcssa.i to i64
%arrayidx446.i = getelementptr inbounds i64, ptr %a, i64 %idxprom345.i
%2 = load i64, ptr %arrayidx446.i, align 8, !tbaa !5
%cmp1.i23.i = icmp eq i64 %2, %x
%.pre.i = select i1 %cmp1.i23.i, i64 %idxprom345.i, i64 -1
br label %lower_bound.exit
lower_bound.exit: ; preds = %while.end.i, %cond.false.thread.i
%conv.pre-phi.i = phi i64 [ %.pre.i, %cond.false.thread.i ], [ %idxprom1.i, %while.end.i ]
%conv = trunc i64 %conv.pre-phi.i to i32
%cmp = icmp eq i32 %conv, -1
br i1 %cmp, label %cond.end, label %cond.false
cond.false: ; preds = %lower_bound.exit
%sub33.i = sub nsw i32 %r, %conv
%cmp34.i = icmp sgt i32 %sub33.i, 1
br i1 %cmp34.i, label %while.body.us.i18, label %while.end.i9
while.body.us.i18: ; preds = %cond.false, %while.body.us.i18
%l.addr.0.i19 = phi i32 [ %spec.select.i25, %while.body.us.i18 ], [ %conv, %cond.false ]
%r.addr.0.i20 = phi i32 [ %spec.select50.i, %while.body.us.i18 ], [ %r, %cond.false ]
%add.us.i21 = add nsw i32 %r.addr.0.i20, %l.addr.0.i19
%div.us.i22 = sdiv i32 %add.us.i21, 2
%idxprom.us.i23 = sext i32 %div.us.i22 to i64
%arrayidx.us.i24 = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i23
%3 = load i64, ptr %arrayidx.us.i24, align 8, !tbaa !5
%cmp1.not.i.us.i = icmp sgt i64 %3, %x
%spec.select.i25 = select i1 %cmp1.not.i.us.i, i32 %l.addr.0.i19, i32 %div.us.i22
%spec.select50.i = select i1 %cmp1.not.i.us.i, i32 %div.us.i22, i32 %r.addr.0.i20
%sub.us.i26 = sub nsw i32 %spec.select50.i, %spec.select.i25
%cmp.us.i27 = icmp sgt i32 %sub.us.i26, 1
br i1 %cmp.us.i27, label %while.body.us.i18, label %while.end.i9, !llvm.loop !25
while.end.i9: ; preds = %while.body.us.i18, %cond.false
%r.addr.0..lcssa.i10 = phi i32 [ %r, %cond.false ], [ %spec.select50.i, %while.body.us.i18 ]
%l.addr.0..lcssa.i11 = phi i32 [ %conv, %cond.false ], [ %spec.select.i25, %while.body.us.i18 ]
%idxprom1.i12 = sext i32 %r.addr.0..lcssa.i10 to i64
%arrayidx2.i13 = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i12
%4 = load i64, ptr %arrayidx2.i13, align 8, !tbaa !5
%cmp1.i.i = icmp eq i64 %4, %x
br i1 %cmp1.i.i, label %upper_bound.exit, label %cond.false.thread.i14
cond.false.thread.i14: ; preds = %while.end.i9
%idxprom344.i = sext i32 %l.addr.0..lcssa.i11 to i64
%arrayidx445.i = getelementptr inbounds i64, ptr %a, i64 %idxprom344.i
%5 = load i64, ptr %arrayidx445.i, align 8, !tbaa !5
%cmp1.i22.i = icmp eq i64 %5, %x
%.pre.i15 = select i1 %cmp1.i22.i, i64 %idxprom344.i, i64 -1
br label %upper_bound.exit
upper_bound.exit: ; preds = %while.end.i9, %cond.false.thread.i14
%conv.pre-phi.i16 = phi i64 [ %.pre.i15, %cond.false.thread.i14 ], [ %idxprom1.i12, %while.end.i9 ]
%reass.sub = sub nsw i64 %conv.pre-phi.i16, %conv.pre-phi.i
%add = add nsw i64 %reass.sub, 1
br label %cond.end
cond.end: ; preds = %lower_bound.exit, %upper_bound.exit
%cond = phi i64 [ %add, %upper_bound.exit ], [ 0, %lower_bound.exit ]
ret i64 %cond
}
; Function Attrs: nounwind uwtable
define dso_local i64 @factor_pre(i64 noundef %x) local_unnamed_addr #10 {
cond.end.1:
%0 = load ptr, ptr @factors, align 16, !tbaa !26
%call = tail call dereferenceable_or_null(8) ptr @realloc(ptr noundef %0, i64 noundef 8) #24
store ptr %call, ptr @factors, align 16, !tbaa !26
%1 = load i64, ptr @fac_cnt, align 8, !tbaa !5
%arrayidx5 = getelementptr inbounds i64, ptr %call, i64 %1
store i64 2, ptr %arrayidx5, align 8, !tbaa !5
%2 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26
%call.1 = tail call dereferenceable_or_null(8) ptr @realloc(ptr noundef %2, i64 noundef 8) #24
store ptr %call.1, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26
%3 = load i64, ptr @fac_cnt, align 8, !tbaa !5
%inc.1 = add nsw i64 %3, 1
store i64 %inc.1, ptr @fac_cnt, align 8, !tbaa !5
%arrayidx5.1 = getelementptr inbounds i64, ptr %call.1, i64 %3
store i64 0, ptr %arrayidx5.1, align 8, !tbaa !5
%cmp9.not82 = icmp sgt i64 %x, 2
%4 = icmp sgt i64 %3, -1
%or.cond = and i1 %cmp9.not82, %4
br i1 %or.cond, label %for.cond13.preheader, label %for.cond.cleanup11
for.cond13.preheader: ; preds = %cond.end.1, %cleanup
%5 = phi i64 [ %11, %cleanup ], [ %inc.1, %cond.end.1 ]
%i7.083 = phi i64 [ %add55, %cleanup ], [ 3, %cond.end.1 ]
%cmp1479 = icmp sgt i64 %5, 0
br i1 %cmp1479, label %for.body17.lr.ph, label %cleanup
for.body17.lr.ph: ; preds = %for.cond13.preheader
%6 = load ptr, ptr @factors, align 16, !tbaa !26
br label %for.body17
for.cond.cleanup11: ; preds = %cleanup, %cond.end.1
ret i64 0
for.cond13: ; preds = %for.body.i.preheader
%inc52 = add nuw nsw i64 %j.080, 1
%exitcond.not = icmp eq i64 %inc52, %5
br i1 %exitcond.not, label %cleanup, label %for.body17, !llvm.loop !28
for.body17: ; preds = %for.body17.lr.ph, %for.cond13
%j.080 = phi i64 [ 0, %for.body17.lr.ph ], [ %inc52, %for.cond13 ]
%arrayidx18 = getelementptr inbounds i64, ptr %6, i64 %j.080
%7 = load i64, ptr %arrayidx18, align 8, !tbaa !5
%rem = srem i64 %i7.083, %7
%tobool19.not = icmp eq i64 %rem, 0
br i1 %tobool19.not, label %cleanup, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body17
%mul.i.1 = mul nsw i64 %7, %7
%cmp22 = icmp ugt i64 %mul.i.1, %i7.083
br i1 %cmp22, label %cond.end44.1, label %for.cond13
cond.end44.1: ; preds = %for.body.i.preheader
%add31 = shl i64 %5, 3
%mul = add i64 %add31, 8
%call32 = tail call ptr @realloc(ptr noundef nonnull %6, i64 noundef %mul) #24
store ptr %call32, ptr @factors, align 16, !tbaa !26
%8 = load i64, ptr @fac_cnt, align 8, !tbaa !5
%arrayidx46 = getelementptr inbounds i64, ptr %call32, i64 %8
store i64 %i7.083, ptr %arrayidx46, align 8, !tbaa !5
%9 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26
%add31.1 = shl i64 %8, 3
%mul.1 = add i64 %add31.1, 8
%call32.1 = tail call ptr @realloc(ptr noundef %9, i64 noundef %mul.1) #24
store ptr %call32.1, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26
%10 = load i64, ptr @fac_cnt, align 8, !tbaa !5
%inc42.1 = add nsw i64 %10, 1
store i64 %inc42.1, ptr @fac_cnt, align 8, !tbaa !5
%arrayidx46.1 = getelementptr inbounds i64, ptr %call32.1, i64 %10
store i64 0, ptr %arrayidx46.1, align 8, !tbaa !5
br label %cleanup
cleanup: ; preds = %for.cond13, %for.body17, %cond.end44.1, %for.cond13.preheader
%11 = phi i64 [ %inc42.1, %cond.end44.1 ], [ %5, %for.cond13.preheader ], [ %5, %for.body17 ], [ %5, %for.cond13 ]
%add55 = add nuw nsw i64 %i7.083, 2
%cmp9.not = icmp sgt i64 %add55, %x
br i1 %cmp9.not, label %for.cond.cleanup11, label %for.cond13.preheader, !llvm.loop !29
}
; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #11
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @factor(i64 noundef %n, i64 noundef %is_new) local_unnamed_addr #12 {
entry:
%0 = load i64, ptr @fac_cnt, align 8, !tbaa !5
%cmp39 = icmp sgt i64 %0, 0
br i1 %cmp39, label %for.cond1.preheader.lr.ph, label %cleanup20
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load ptr, ptr @factors, align 16, !tbaa !26
%tobool11.not = icmp eq i64 %is_new, 0
%2 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8
br i1 %tobool11.not, label %for.cond1.preheader.us, label %for.cond1.preheader
for.cond1.preheader.us: ; preds = %for.cond1.preheader.lr.ph, %for.inc.us
%i.041.us = phi i64 [ %inc19.us, %for.inc.us ], [ 0, %for.cond1.preheader.lr.ph ]
%n.addr.040.us = phi i64 [ %n.addr.3.us, %for.inc.us ], [ %n, %for.cond1.preheader.lr.ph ]
%arrayidx.us = getelementptr inbounds i64, ptr %1, i64 %i.041.us
%3 = load i64, ptr %arrayidx.us, align 8, !tbaa !5
br label %while.cond.us
while.cond.us: ; preds = %for.cond1.preheader.us, %land.rhs.us
%n.addr.2.us = phi i64 [ %div.us, %land.rhs.us ], [ %n.addr.040.us, %for.cond1.preheader.us ]
%cnt.1.us = phi i64 [ %add.us, %land.rhs.us ], [ 0, %for.cond1.preheader.us ]
%rem.us = srem i64 %n.addr.2.us, %3
%div.us = sdiv i64 %n.addr.2.us, %3
%cmp5.us = icmp eq i64 %rem.us, 0
%conv.us = zext i1 %cmp5.us to i64
%add.us = add nuw nsw i64 %cnt.1.us, %conv.us
%tobool.not.us = icmp eq i64 %add.us, 0
br i1 %tobool.not.us, label %for.inc.us, label %land.rhs.us
land.rhs.us: ; preds = %while.cond.us
%rem8.us = srem i64 %div.us, %3
%cmp9.us = icmp eq i64 %rem8.us, 0
br i1 %cmp9.us, label %while.cond.us, label %for.inc.us, !llvm.loop !31
for.inc.us: ; preds = %land.rhs.us, %while.cond.us
%n.addr.3.us = phi i64 [ %div.us, %land.rhs.us ], [ %n.addr.2.us, %while.cond.us ]
%arrayidx12.us = getelementptr inbounds i64, ptr %2, i64 %i.041.us
%4 = load i64, ptr %arrayidx12.us, align 8, !tbaa !5
%cond.i.us = tail call i64 @llvm.smax.i64(i64 %4, i64 %add.us)
store i64 %cond.i.us, ptr %arrayidx12.us, align 8, !tbaa !5
%5 = load i64, ptr %arrayidx.us, align 8, !tbaa !5
%cmp16.not.us = icmp sle i64 %5, %n.addr.3.us
%inc19.us = add nuw nsw i64 %i.041.us, 1
%6 = load i64, ptr @fac_cnt, align 8
%cmp.us = icmp slt i64 %inc19.us, %6
%or.cond = select i1 %cmp16.not.us, i1 %cmp.us, i1 false
br i1 %or.cond, label %for.cond1.preheader.us, label %cleanup20, !llvm.loop !32
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc
%i.041 = phi i64 [ %inc19, %for.inc ], [ 0, %for.cond1.preheader.lr.ph ]
%n.addr.040 = phi i64 [ %n.addr.3, %for.inc ], [ %n, %for.cond1.preheader.lr.ph ]
%arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.041
%7 = load i64, ptr %arrayidx, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %for.cond1.preheader, %land.rhs
%n.addr.2 = phi i64 [ %div, %land.rhs ], [ %n.addr.040, %for.cond1.preheader ]
%cnt.1 = phi i64 [ %add, %land.rhs ], [ 0, %for.cond1.preheader ]
%rem = srem i64 %n.addr.2, %7
%div = sdiv i64 %n.addr.2, %7
%cmp5 = icmp eq i64 %rem, 0
%conv = zext i1 %cmp5 to i64
%add = add nuw nsw i64 %cnt.1, %conv
%tobool.not = icmp eq i64 %add, 0
br i1 %tobool.not, label %for.inc, label %land.rhs
land.rhs: ; preds = %while.cond
%rem8 = srem i64 %div, %7
%cmp9 = icmp eq i64 %rem8, 0
br i1 %cmp9, label %while.cond, label %for.inc, !llvm.loop !31
for.inc: ; preds = %land.rhs, %while.cond
%n.addr.3 = phi i64 [ %div, %land.rhs ], [ %n.addr.2, %while.cond ]
%arrayidx14 = getelementptr inbounds i64, ptr %2, i64 %i.041
store i64 %add, ptr %arrayidx14, align 8, !tbaa !5
%8 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp16.not = icmp sle i64 %8, %n.addr.3
%inc19 = add nuw nsw i64 %i.041, 1
%9 = load i64, ptr @fac_cnt, align 8
%cmp = icmp slt i64 %inc19, %9
%or.cond44 = select i1 %cmp16.not, i1 %cmp, i1 false
br i1 %or.cond44, label %for.cond1.preheader, label %cleanup20, !llvm.loop !32
cleanup20: ; preds = %for.inc, %for.inc.us, %entry
%n.addr.4 = phi i64 [ %n, %entry ], [ %n.addr.3.us, %for.inc.us ], [ %n.addr.3, %for.inc ]
ret i64 %n.addr.4
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i64 @judge_prime(i64 noundef %n) local_unnamed_addr #13 {
entry:
%0 = load i64, ptr @fac_cnt, align 8, !tbaa !5
%cmp20 = icmp sgt i64 %0, 0
br i1 %cmp20, label %for.body.lr.ph, label %cleanup
for.body.lr.ph: ; preds = %entry
%1 = load ptr, ptr @factors, align 16, !tbaa !26
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.else
%i.022 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %if.else ]
%n.addr.021 = phi i64 [ %n, %for.body.lr.ph ], [ %spec.select, %if.else ]
%arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.022
%2 = load i64, ptr %arrayidx, align 8, !tbaa !5
%mul = mul nsw i64 %2, %2
%cmp2 = icmp slt i64 %n.addr.021, %mul
%cmp4 = icmp eq i64 %n.addr.021, %2
%or.cond = or i1 %cmp4, %cmp2
br i1 %or.cond, label %cleanup, label %if.else
if.else: ; preds = %for.body
%rem = srem i64 %n.addr.021, %2
%cmp6 = icmp eq i64 %rem, 0
%spec.select = select i1 %cmp6, i64 1, i64 %n.addr.021
%inc = add nuw nsw i64 %i.022, 1
%exitcond.not = icmp eq i64 %inc, %0
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !33
cleanup: ; preds = %if.else, %for.body, %entry
%n.addr.0.lcssa = phi i64 [ %n, %entry ], [ %n.addr.021, %for.body ], [ %spec.select, %if.else ]
%cmp9 = icmp ne i64 %n.addr.0.lcssa, 1
%conv = zext i1 %cmp9 to i64
ret i64 %conv
}
; 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) #14 {
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) #14 {
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: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #15 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #25
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #16
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #14 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !21
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !21
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #26
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #17
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #26
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sort_string(i32 noundef %n, i32 noundef %size, ptr noundef %s) local_unnamed_addr #2 {
entry:
%0 = zext i32 %size to i64
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %s, i64 noundef %conv, i64 noundef %0, ptr noundef nonnull @cmp_string) #26
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sort_char(ptr noundef %s) local_unnamed_addr #2 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #25
tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #26
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #16
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i64 @unique_string(i64 noundef %n, i64 noundef %size, ptr nocapture noundef readonly %s) local_unnamed_addr #18 {
entry:
%cmp8 = icmp sgt i64 %n, 1
br i1 %cmp8, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body ]
ret i64 %ans.0.lcssa
for.body: ; preds = %entry, %for.body
%i.010 = phi i64 [ %inc2, %for.body ], [ 1, %entry ]
%ans.09 = phi i64 [ %spec.select, %for.body ], [ 1, %entry ]
%0 = mul nsw i64 %i.010, %size
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %0
%sub = add nsw i64 %i.010, -1
%1 = mul nsw i64 %sub, %size
%arrayidx1 = getelementptr inbounds i8, ptr %s, i64 %1
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx1) #25
%tobool.not = icmp ne i32 %call, 0
%inc = zext i1 %tobool.not to i64
%spec.select = add nuw nsw i64 %ans.09, %inc
%inc2 = add nuw nsw i64 %i.010, 1
%exitcond.not = icmp eq i64 %inc2, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !34
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @unique_num(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #8 {
entry:
%cmp9 = icmp sgt i64 %n, 1
br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%0 = add i64 %n, -1
%min.iters.check = icmp ult i64 %n, 5
br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %0, -4
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1, i64 0>, %vector.ph ], [ %9, %vector.body ]
%vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds i64, ptr %a, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load13 = load <2 x i64>, ptr %2, align 8, !tbaa !5
%3 = getelementptr i64, ptr %1, i64 -1
%wide.load14 = load <2 x i64>, ptr %3, align 8, !tbaa !5
%4 = getelementptr i64, ptr %1, i64 1
%wide.load15 = load <2 x i64>, ptr %4, align 8, !tbaa !5
%5 = icmp ne <2 x i64> %wide.load, %wide.load14
%6 = icmp ne <2 x i64> %wide.load13, %wide.load15
%7 = zext <2 x i1> %5 to <2 x i64>
%8 = zext <2 x i1> %6 to <2 x i64>
%9 = add <2 x i64> %vec.phi, %7
%10 = add <2 x i64> %vec.phi12, %8
%index.next = add nuw i64 %index, 4
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !35
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %10, %9
%12 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %0, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16
for.body.preheader16: ; preds = %for.body.preheader, %middle.block
%i.011.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
%ans.010.ph = phi i64 [ 1, %for.body.preheader ], [ %12, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%ans.0.lcssa = phi i64 [ 1, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ]
ret i64 %ans.0.lcssa
for.body: ; preds = %for.body.preheader16, %for.body
%i.011 = phi i64 [ %inc3, %for.body ], [ %i.011.ph, %for.body.preheader16 ]
%ans.010 = phi i64 [ %spec.select, %for.body ], [ %ans.010.ph, %for.body.preheader16 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.011
%13 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx1 = getelementptr i64, ptr %arrayidx, i64 -1
%14 = load i64, ptr %arrayidx1, align 8, !tbaa !5
%cmp2.not = icmp ne i64 %13, %14
%inc = zext i1 %cmp2.not to i64
%spec.select = add nuw nsw i64 %ans.010, %inc
%inc3 = add nuw nsw i64 %i.011, 1
%exitcond.not = icmp eq i64 %inc3, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !36
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #14 {
entry:
%0 = load i64, ptr %p, align 8, !tbaa !37
%1 = load i64, ptr %q, align 8, !tbaa !37
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #14 {
entry:
%0 = load i64, ptr %q, align 8, !tbaa !37
%1 = load i64, ptr %p, align 8, !tbaa !37
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #26
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #26
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @makeinv(i64 noundef %n) local_unnamed_addr #19 {
entry:
store i64 1, ptr getelementptr inbounds ([2000005 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr getelementptr inbounds ([2000005 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr @finv, align 16, !tbaa !5
%cmp.not16 = icmp slt i64 %n, 2
br i1 %cmp.not16, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
ret void
for.body: ; preds = %entry, %for.body
%0 = phi i64 [ %rem7, %for.body ], [ 1, %entry ]
%i.017 = phi i64 [ %inc, %for.body ], [ 2, %entry ]
%rem = urem i64 1000000007, %i.017
%arrayidx = getelementptr inbounds [2000005 x i64], ptr @inv, i64 0, i64 %rem
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%div = udiv i64 1000000007, %i.017
%mul = mul nsw i64 %div, %1
%rem1 = srem i64 %mul, 1000000007
%sub = sub nsw i64 1000000007, %rem1
%arrayidx2 = getelementptr inbounds [2000005 x i64], ptr @inv, i64 0, i64 %i.017
store i64 %sub, ptr %arrayidx2, align 8, !tbaa !5
%mul6 = mul nuw nsw i64 %sub, %0
%rem7 = urem i64 %mul6, 1000000007
%arrayidx8 = getelementptr inbounds [2000005 x i64], ptr @finv, i64 0, i64 %i.017
store i64 %rem7, ptr %arrayidx8, align 8, !tbaa !5
%inc = add nuw i64 %i.017, 1
%exitcond.not = icmp eq i64 %i.017, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !39
}
; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @make_mod_fac(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #20 {
entry:
store i64 1, ptr getelementptr inbounds ([2000005 x i64], ptr @mod_fac, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr @mod_fac, align 16, !tbaa !5
%cmp.not9 = icmp slt i64 %n, 2
br i1 %cmp.not9, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = add i64 %n, -1
%xtraiter = and i64 %0, 1
%1 = icmp eq i64 %n, 2
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, -2
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%i.011.unr = phi i64 [ 2, %for.body.preheader ], [ %inc.1, %for.body ]
%x.010.unr = phi i64 [ 1, %for.body.preheader ], [ %rem1.1, %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
%rem.epil = srem i64 %i.011.unr, %mod
%mul.epil = mul nsw i64 %rem.epil, %x.010.unr
%rem1.epil = srem i64 %mul.epil, %mod
%arrayidx.epil = getelementptr inbounds [2000005 x i64], ptr @mod_fac, i64 0, i64 %i.011.unr
store i64 %rem1.epil, ptr %arrayidx.epil, align 8, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry
ret void
for.body: ; preds = %for.body, %for.body.preheader.new
%i.011 = phi i64 [ 2, %for.body.preheader.new ], [ %inc.1, %for.body ]
%x.010 = phi i64 [ 1, %for.body.preheader.new ], [ %rem1.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%rem = srem i64 %i.011, %mod
%mul = mul nsw i64 %rem, %x.010
%rem1 = srem i64 %mul, %mod
%arrayidx = getelementptr inbounds [2000005 x i64], ptr @mod_fac, i64 0, i64 %i.011
store i64 %rem1, ptr %arrayidx, align 16, !tbaa !5
%inc = or i64 %i.011, 1
%rem.1 = srem i64 %inc, %mod
%mul.1 = mul nsw i64 %rem.1, %rem1
%rem1.1 = srem i64 %mul.1, %mod
%arrayidx.1 = getelementptr inbounds [2000005 x i64], ptr @mod_fac, i64 0, i64 %inc
store i64 %rem1.1, ptr %arrayidx.1, align 8, !tbaa !5
%inc.1 = add nuw i64 %i.011, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !40
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @mod_nck(i64 noundef %n, i64 noundef %k, i64 noundef %mod) local_unnamed_addr #21 {
entry:
%arrayidx = getelementptr inbounds [2000005 x i64], ptr @mod_fac, i64 0, i64 %n
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx1 = getelementptr inbounds [2000005 x i64], ptr @finv, i64 0, i64 %k
%1 = load i64, ptr %arrayidx1, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%rem = srem i64 %mul, %mod
%sub = sub nsw i64 %n, %k
%arrayidx2 = getelementptr inbounds [2000005 x i64], ptr @finv, i64 0, i64 %sub
%2 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%mul3 = mul nsw i64 %2, %rem
%rem4 = srem i64 %mul3, %mod
ret i64 %rem4
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @modpow(i64 noundef %r, i64 noundef %n) local_unnamed_addr #6 {
entry:
%cmp15 = icmp sgt i64 %n, 0
br i1 %cmp15, label %while.body, label %while.end
while.body: ; preds = %entry, %cond.end
%s.018 = phi i64 [ %rem2, %cond.end ], [ %r, %entry ]
%t.017 = phi i64 [ %cond, %cond.end ], [ 1, %entry ]
%n.addr.016 = phi i64 [ %shr, %cond.end ], [ %n, %entry ]
%and = and i64 %n.addr.016, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.true: ; preds = %while.body
%mul = mul nsw i64 %s.018, %t.017
%rem = srem i64 %mul, 1000000007
br label %cond.end
cond.end: ; preds = %while.body, %cond.true
%cond = phi i64 [ %rem, %cond.true ], [ %t.017, %while.body ]
%mul1 = mul nsw i64 %s.018, %s.018
%rem2 = urem i64 %mul1, 1000000007
%shr = lshr i64 %n.addr.016, 1
%cmp.not = icmp ult i64 %n.addr.016, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !41
while.end: ; preds = %cond.end, %entry
%t.0.lcssa = phi i64 [ 1, %entry ], [ %cond, %cond.end ]
%tobool3.not = icmp eq i64 %r, 0
%cond7 = select i1 %tobool3.not, i64 0, i64 %t.0.lcssa
ret i64 %cond7
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #10 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #26
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call = call i64 @factor_pre(i64 noundef 1000)
store i64 1, ptr getelementptr inbounds ([2000005 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr getelementptr inbounds ([2000005 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr @finv, align 16, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.body.i, %entry
%0 = phi i64 [ %rem7.i, %for.body.i ], [ 1, %entry ]
%i.017.i = phi i64 [ %inc.i, %for.body.i ], [ 2, %entry ]
%rem.i = urem i64 1000000007, %i.017.i
%arrayidx.i = getelementptr inbounds [2000005 x i64], ptr @inv, i64 0, i64 %rem.i
%1 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%div.i = udiv i64 1000000007, %i.017.i
%mul.i = mul nsw i64 %div.i, %1
%rem1.i = srem i64 %mul.i, 1000000007
%sub.i = sub nsw i64 1000000007, %rem1.i
%arrayidx2.i = getelementptr inbounds [2000005 x i64], ptr @inv, i64 0, i64 %i.017.i
store i64 %sub.i, ptr %arrayidx2.i, align 8, !tbaa !5
%mul6.i = mul nuw nsw i64 %sub.i, %0
%rem7.i = urem i64 %mul6.i, 1000000007
%arrayidx8.i = getelementptr inbounds [2000005 x i64], ptr @finv, i64 0, i64 %i.017.i
store i64 %rem7.i, ptr %arrayidx8.i, align 8, !tbaa !5
%inc.i = add nuw nsw i64 %i.017.i, 1
%exitcond.not.i = icmp eq i64 %i.017.i, 1000000
br i1 %exitcond.not.i, label %makeinv.exit, label %for.body.i, !llvm.loop !39
makeinv.exit: ; preds = %for.body.i
%2 = load i64, ptr %n, align 8, !tbaa !5
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %2, align 16
%4 = load i64, ptr %n, align 8, !tbaa !5
%cmp83 = icmp sgt i64 %4, 0
br i1 %cmp83, label %for.body, label %makeinv.exit.for.cond7.preheader_crit_edge
makeinv.exit.for.cond7.preheader_crit_edge: ; preds = %makeinv.exit
%.pre = load i64, ptr @fac_cnt, align 8, !tbaa !5
br label %for.cond7.preheader
for.cond7.preheader: ; preds = %if.end, %makeinv.exit.for.cond7.preheader_crit_edge
%5 = phi i64 [ %.pre, %makeinv.exit.for.cond7.preheader_crit_edge ], [ %16, %if.end ]
%mark.0.lcssa = phi i64 [ 0, %makeinv.exit.for.cond7.preheader_crit_edge ], [ %mark.1, %if.end ]
%cmp886 = icmp sgt i64 %5, 0
br i1 %cmp886, label %for.body10.lr.ph, label %for.cond.cleanup9
for.body10.lr.ph: ; preds = %for.cond7.preheader
%6 = load ptr, ptr @factors, align 16, !tbaa !26
%7 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !26
br label %for.body10
for.body: ; preds = %makeinv.exit, %if.end
%i.085 = phi i64 [ %inc5, %if.end ], [ 0, %makeinv.exit ]
%mark.084 = phi i64 [ %mark.1, %if.end ], [ 0, %makeinv.exit ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.085
%call.i74 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%8 = load i64, ptr %arrayidx, align 8, !tbaa !5
%9 = load i64, ptr @fac_cnt, align 8, !tbaa !5
%cmp39.i = icmp sgt i64 %9, 0
br i1 %cmp39.i, label %for.cond1.preheader.lr.ph.i, label %factor.exit
for.cond1.preheader.lr.ph.i: ; preds = %for.body
%10 = load ptr, ptr @factors, align 16, !tbaa !26
%11 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8
br label %for.cond1.preheader.us.i
for.cond1.preheader.us.i: ; preds = %for.inc.us.i, %for.cond1.preheader.lr.ph.i
%i.041.us.i = phi i64 [ %inc19.us.i, %for.inc.us.i ], [ 0, %for.cond1.preheader.lr.ph.i ]
%n.addr.040.us.i = phi i64 [ %n.addr.3.us.i, %for.inc.us.i ], [ %8, %for.cond1.preheader.lr.ph.i ]
%arrayidx.us.i = getelementptr inbounds i64, ptr %10, i64 %i.041.us.i
%12 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5
br label %while.cond.us.i
while.cond.us.i: ; preds = %land.rhs.us.i, %for.cond1.preheader.us.i
%n.addr.2.us.i = phi i64 [ %div.us.i, %land.rhs.us.i ], [ %n.addr.040.us.i, %for.cond1.preheader.us.i ]
%cnt.1.us.i = phi i64 [ %add.us.i, %land.rhs.us.i ], [ 0, %for.cond1.preheader.us.i ]
%rem.us.i = srem i64 %n.addr.2.us.i, %12
%div.us.i = sdiv i64 %n.addr.2.us.i, %12
%cmp5.us.i = icmp eq i64 %rem.us.i, 0
%conv.us.i = zext i1 %cmp5.us.i to i64
%add.us.i = add nuw nsw i64 %cnt.1.us.i, %conv.us.i
%tobool.not.us.i = icmp eq i64 %add.us.i, 0
br i1 %tobool.not.us.i, label %for.inc.us.i, label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.cond.us.i
%rem8.us.i = srem i64 %div.us.i, %12
%cmp9.us.i = icmp eq i64 %rem8.us.i, 0
br i1 %cmp9.us.i, label %while.cond.us.i, label %for.inc.us.i, !llvm.loop !31
for.inc.us.i: ; preds = %land.rhs.us.i, %while.cond.us.i
%n.addr.3.us.i = phi i64 [ %div.us.i, %land.rhs.us.i ], [ %n.addr.2.us.i, %while.cond.us.i ]
%arrayidx12.us.i = getelementptr inbounds i64, ptr %11, i64 %i.041.us.i
%13 = load i64, ptr %arrayidx12.us.i, align 8, !tbaa !5
%cond.i.us.i = call i64 @llvm.smax.i64(i64 %13, i64 %add.us.i)
store i64 %cond.i.us.i, ptr %arrayidx12.us.i, align 8, !tbaa !5
%14 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5
%cmp16.not.us.i = icmp sle i64 %14, %n.addr.3.us.i
%inc19.us.i = add nuw nsw i64 %i.041.us.i, 1
%15 = load i64, ptr @fac_cnt, align 8
%cmp.us.i = icmp slt i64 %inc19.us.i, %15
%or.cond.i = select i1 %cmp16.not.us.i, i1 %cmp.us.i, i1 false
br i1 %or.cond.i, label %for.cond1.preheader.us.i, label %factor.exit, !llvm.loop !32
factor.exit: ; preds = %for.inc.us.i, %for.body
%16 = phi i64 [ %9, %for.body ], [ %15, %for.inc.us.i ]
%n.addr.4.i = phi i64 [ %8, %for.body ], [ %n.addr.3.us.i, %for.inc.us.i ]
%cmp3.not = icmp eq i64 %n.addr.4.i, 1
br i1 %cmp3.not, label %if.end, label %if.then
if.then: ; preds = %factor.exit
%inc = add nsw i64 %mark.084, 1
%arrayidx4 = getelementptr inbounds [10000 x i64], ptr @ano, i64 0, i64 %mark.084
store i64 %n.addr.4.i, ptr %arrayidx4, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %factor.exit
%mark.1 = phi i64 [ %inc, %if.then ], [ %mark.084, %factor.exit ]
%inc5 = add nuw nsw i64 %i.085, 1
%17 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc5, %17
br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !42
for.cond.cleanup9: ; preds = %modpow.exit, %for.cond7.preheader
%tmp.0.lcssa = phi i64 [ 1, %for.cond7.preheader ], [ %rem, %modpow.exit ]
%tobool.not = icmp eq i64 %mark.0.lcssa, 0
br i1 %tobool.not, label %if.end36, label %if.then17
for.body10: ; preds = %for.body10.lr.ph, %modpow.exit
%i6.088 = phi i64 [ 0, %for.body10.lr.ph ], [ %inc15, %modpow.exit ]
%tmp.087 = phi i64 [ 1, %for.body10.lr.ph ], [ %rem, %modpow.exit ]
%arrayidx11 = getelementptr inbounds i64, ptr %6, i64 %i6.088
%18 = load i64, ptr %arrayidx11, align 8, !tbaa !5
%arrayidx12 = getelementptr inbounds i64, ptr %7, i64 %i6.088
%19 = load i64, ptr %arrayidx12, align 8, !tbaa !5
%cmp15.i = icmp sgt i64 %19, 0
br i1 %cmp15.i, label %while.body.i, label %modpow.exit
while.body.i: ; preds = %for.body10, %cond.end.i
%s.018.i = phi i64 [ %rem2.i, %cond.end.i ], [ %18, %for.body10 ]
%t.017.i = phi i64 [ %cond.i, %cond.end.i ], [ 1, %for.body10 ]
%n.addr.016.i = phi i64 [ %shr.i, %cond.end.i ], [ %19, %for.body10 ]
%and.i = and i64 %n.addr.016.i, 1
%tobool.not.i = icmp eq i64 %and.i, 0
br i1 %tobool.not.i, label %cond.end.i, label %cond.true.i
cond.true.i: ; preds = %while.body.i
%mul.i75 = mul nsw i64 %t.017.i, %s.018.i
%rem.i76 = srem i64 %mul.i75, 1000000007
br label %cond.end.i
cond.end.i: ; preds = %cond.true.i, %while.body.i
%cond.i = phi i64 [ %rem.i76, %cond.true.i ], [ %t.017.i, %while.body.i ]
%mul1.i = mul nsw i64 %s.018.i, %s.018.i
%rem2.i = urem i64 %mul1.i, 1000000007
%shr.i = lshr i64 %n.addr.016.i, 1
%cmp.not.i = icmp ult i64 %n.addr.016.i, 2
br i1 %cmp.not.i, label %modpow.exit, label %while.body.i, !llvm.loop !41
modpow.exit: ; preds = %cond.end.i, %for.body10
%t.0.lcssa.i = phi i64 [ 1, %for.body10 ], [ %cond.i, %cond.end.i ]
%tobool3.not.i = icmp eq i64 %18, 0
%cond7.i = select i1 %tobool3.not.i, i64 0, i64 %t.0.lcssa.i
%mul = mul nsw i64 %cond7.i, %tmp.087
%rem = srem i64 %mul, 1000000007
%inc15 = add nuw nsw i64 %i6.088, 1
%exitcond.not = icmp eq i64 %inc15, %5
br i1 %exitcond.not, label %for.cond.cleanup9, label %for.body10, !llvm.loop !43
if.then17: ; preds = %for.cond.cleanup9
call void @qsort(ptr noundef nonnull @ano, i64 noundef 10000, i64 noundef 8, ptr noundef nonnull @downll) #26
%20 = load i64, ptr @ano, align 16, !tbaa !5
%mul18 = mul nsw i64 %20, %tmp.0.lcssa
%rem19 = srem i64 %mul18, 1000000007
%cmp2290 = icmp sgt i64 %mark.0.lcssa, 1
br i1 %cmp2290, label %for.body24.preheader, label %if.end36
for.body24.preheader: ; preds = %if.then17
%21 = add i64 %mark.0.lcssa, -1
%xtraiter = and i64 %21, 1
%22 = icmp eq i64 %mark.0.lcssa, 2
br i1 %22, label %if.end36.loopexit.unr-lcssa, label %for.body24.preheader.new
for.body24.preheader.new: ; preds = %for.body24.preheader
%unroll_iter = and i64 %21, -2
br label %for.body24
for.body24: ; preds = %for.inc33.1, %for.body24.preheader.new
%23 = phi i64 [ %20, %for.body24.preheader.new ], [ %25, %for.inc33.1 ]
%i20.092 = phi i64 [ 1, %for.body24.preheader.new ], [ %inc34.1, %for.inc33.1 ]
%tmp.191 = phi i64 [ %rem19, %for.body24.preheader.new ], [ %tmp.2.1, %for.inc33.1 ]
%niter = phi i64 [ 0, %for.body24.preheader.new ], [ %niter.next.1, %for.inc33.1 ]
%arrayidx25 = getelementptr inbounds [10000 x i64], ptr @ano, i64 0, i64 %i20.092
%24 = load i64, ptr %arrayidx25, align 8, !tbaa !5
%cmp27.not = icmp eq i64 %24, %23
br i1 %cmp27.not, label %for.inc33, label %if.then28
if.then28: ; preds = %for.body24
%mul30 = mul nsw i64 %24, %tmp.191
%rem31 = srem i64 %mul30, 1000000007
br label %for.inc33
for.inc33: ; preds = %for.body24, %if.then28
%tmp.2 = phi i64 [ %rem31, %if.then28 ], [ %tmp.191, %for.body24 ]
%inc34 = add nuw nsw i64 %i20.092, 1
%arrayidx25.1 = getelementptr inbounds [10000 x i64], ptr @ano, i64 0, i64 %inc34
%25 = load i64, ptr %arrayidx25.1, align 8, !tbaa !5
%cmp27.not.1 = icmp eq i64 %25, %24
br i1 %cmp27.not.1, label %for.inc33.1, label %if.then28.1
if.then28.1: ; preds = %for.inc33
%mul30.1 = mul nsw i64 %25, %tmp.2
%rem31.1 = srem i64 %mul30.1, 1000000007
br label %for.inc33.1
for.inc33.1: ; preds = %if.then28.1, %for.inc33
%tmp.2.1 = phi i64 [ %rem31.1, %if.then28.1 ], [ %tmp.2, %for.inc33 ]
%inc34.1 = add nuw nsw i64 %i20.092, 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 %if.end36.loopexit.unr-lcssa, label %for.body24, !llvm.loop !44
if.end36.loopexit.unr-lcssa: ; preds = %for.inc33.1, %for.body24.preheader
%tmp.2.lcssa.ph = phi i64 [ undef, %for.body24.preheader ], [ %tmp.2.1, %for.inc33.1 ]
%.unr = phi i64 [ %20, %for.body24.preheader ], [ %25, %for.inc33.1 ]
%i20.092.unr = phi i64 [ 1, %for.body24.preheader ], [ %inc34.1, %for.inc33.1 ]
%tmp.191.unr = phi i64 [ %rem19, %for.body24.preheader ], [ %tmp.2.1, %for.inc33.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %if.end36, label %for.body24.epil
for.body24.epil: ; preds = %if.end36.loopexit.unr-lcssa
%arrayidx25.epil = getelementptr inbounds [10000 x i64], ptr @ano, i64 0, i64 %i20.092.unr
%26 = load i64, ptr %arrayidx25.epil, align 8, !tbaa !5
%cmp27.not.epil = icmp eq i64 %26, %.unr
br i1 %cmp27.not.epil, label %if.end36, label %if.then28.epil
if.then28.epil: ; preds = %for.body24.epil
%mul30.epil = mul nsw i64 %26, %tmp.191.unr
%rem31.epil = srem i64 %mul30.epil, 1000000007
br label %if.end36
if.end36: ; preds = %if.end36.loopexit.unr-lcssa, %if.then28.epil, %for.body24.epil, %if.then17, %for.cond.cleanup9
%tmp.3 = phi i64 [ %tmp.0.lcssa, %for.cond.cleanup9 ], [ %rem19, %if.then17 ], [ %tmp.2.lcssa.ph, %if.end36.loopexit.unr-lcssa ], [ %rem31.epil, %if.then28.epil ], [ %tmp.191.unr, %for.body24.epil ]
%27 = load i64, ptr %n, align 8, !tbaa !5
%cmp3994 = icmp sgt i64 %27, 0
br i1 %cmp3994, label %for.body41, label %for.cond.cleanup40
for.cond.cleanup40: ; preds = %mod_MOD1.exit, %if.end36
%ans.0.lcssa = phi i64 [ 0, %if.end36 ], [ %rem46, %mod_MOD1.exit ]
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #26
ret i32 0
for.body41: ; preds = %if.end36, %mod_MOD1.exit
%i37.096 = phi i64 [ %inc48, %mod_MOD1.exit ], [ 0, %if.end36 ]
%ans.095 = phi i64 [ %rem46, %mod_MOD1.exit ], [ 0, %if.end36 ]
%arrayidx42 = getelementptr inbounds i64, ptr %vla, i64 %i37.096
%28 = load i64, ptr %arrayidx42, align 8, !tbaa !5
%arrayidx43 = getelementptr inbounds [2000005 x i64], ptr @inv, i64 0, i64 %28
%29 = load i64, ptr %arrayidx43, align 8, !tbaa !5
%mul44 = mul nsw i64 %29, %tmp.3
%cmp.i = icmp slt i64 %mul44, 0
br i1 %cmp.i, label %cond.true.i80, label %mod_MOD1.exit
cond.true.i80: ; preds = %for.body41
%n.nonneg.i = sub i64 0, %mul44
%30 = urem i64 %n.nonneg.i, 1000000007
%31 = add nsw i64 %mul44, %30
%mul.i81 = sub i64 1000000007, %31
br label %mod_MOD1.exit
mod_MOD1.exit: ; preds = %for.body41, %cond.true.i80
%cond.i78 = phi i64 [ %mul.i81, %cond.true.i80 ], [ 0, %for.body41 ]
%add1.i = add nsw i64 %cond.i78, %mul44
%rem.i79 = srem i64 %add1.i, 1000000007
%add = add nsw i64 %rem.i79, %ans.095
%rem46 = srem i64 %add, 1000000007
%inc48 = add nuw nsw i64 %i37.096, 1
%exitcond99.not = icmp eq i64 %inc48, %27
br i1 %exitcond99.not, label %for.cond.cleanup40, label %for.body41, !llvm.loop !45
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #22
; 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) #22
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #23
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 = { 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 #5 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 #9 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 #12 = { 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 #13 = { 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 #14 = { 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 #15 = { 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 #16 = { 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 #17 = { 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 #18 = { 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 #19 = { 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 #20 = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #21 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #22 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #23 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #24 = { nounwind allocsize(1) }
attributes #25 = { nounwind willreturn memory(read) }
attributes #26 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !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, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !17}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"int", !7, i64 0}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = !{!27, !27, i64 0}
!27 = !{!"any pointer", !7, i64 0}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10, !30}
!30 = !{!"llvm.loop.unswitch.partial.disable"}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !10, !11, !12}
!36 = distinct !{!36, !10, !12, !11}
!37 = !{!38, !6, i64 0}
!38 = !{!"", !6, i64 0, !6, i64 8}
!39 = distinct !{!39, !10}
!40 = distinct !{!40, !10}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !10}
!43 = distinct !{!43, !10}
!44 = distinct !{!44, !10}
!45 = distinct !{!45, !10}
|
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
void swap(int *xs, int front, int back)
{
int temp = xs[front];
xs[front] = xs[back];
xs[back] = temp;
}
bool isSwap(int nowBibs, int nextBibs, int baton)
{
return (nowBibs % baton) > (nextBibs % baton);
}
void printIntArray(int *arr, int num)
{
for (int i = 0; i < num; i++)
{
printf("%d\n", arr[i]);
}
}
void batonRelay(int *arr, int num, int baton)
{
for (int i = 0; i < num - 1; i++)
{
if (isSwap(arr[i], arr[i + 1], baton))
{
swap(arr, i, i + 1);
}
}
}
int main()
{
int nm[2];
scanf("%d"
"%d",
&nm[0], &nm[1]);
int studentNum = nm[0];
int batonNum = nm[1];
int students[studentNum];
for (int i = 0; i < studentNum; i++)
{
scanf("%d", &students[i]);
}
for (int bi = 0; bi < batonNum; bi++)
{
batonRelay(students, studentNum, bi + 1);
}
printIntArray(students, studentNum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124664/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124664/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %xs, i32 noundef %front, i32 noundef %back) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %front to i64
%arrayidx = getelementptr inbounds i32, ptr %xs, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %back to i64
%arrayidx2 = getelementptr inbounds i32, ptr %xs, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
store i32 %0, ptr %arrayidx2, 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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isSwap(i32 noundef %nowBibs, i32 noundef %nextBibs, i32 noundef %baton) local_unnamed_addr #2 {
entry:
%rem = srem i32 %nowBibs, %baton
%rem1 = srem i32 %nextBibs, %baton
%cmp = icmp sgt i32 %rem, %rem1
ret i1 %cmp
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printIntArray(ptr nocapture noundef readonly %arr, i32 noundef %num) local_unnamed_addr #3 {
entry:
%cmp3 = icmp sgt i32 %num, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %num to i64
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
ret void
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 %arr, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, 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.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @batonRelay(ptr nocapture noundef %arr, i32 noundef %num, i32 noundef %baton) local_unnamed_addr #5 {
entry:
%cmp11 = icmp sgt i32 %num, 1
br i1 %cmp11, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %num, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %arr, align 4, !tbaa !5
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
ret void
for.body: ; preds = %for.body.preheader, %for.inc
%0 = phi i32 [ %.pre, %for.body.preheader ], [ %3, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv.next
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%rem.i = srem i32 %0, %baton
%rem1.i = srem i32 %1, %baton
%cmp.i = icmp sgt i32 %rem.i, %rem1.i
br i1 %cmp.i, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%3 = phi i32 [ %1, %for.body ], [ %2, %if.then ]
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%nm = alloca [2 x i32], align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %nm) #7
%arrayidx1 = getelementptr inbounds [2 x i32], ptr %nm, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %nm, ptr noundef nonnull %arrayidx1)
%0 = load i32, ptr %nm, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%2 = zext i32 %0 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %2, align 16
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body, %entry
%cmp729 = icmp sgt i32 %1, 0
br i1 %cmp729, label %for.body9.lr.ph, label %for.cond.cleanup8
for.body9.lr.ph: ; preds = %for.cond6.preheader
%cmp11.i = icmp sgt i32 %0, 1
%sub.i = add nsw i32 %0, -1
%wide.trip.count.i21 = zext i32 %sub.i to i64
br i1 %cmp11.i, label %for.body9.us, label %for.cond.cleanup8
for.body9.us: ; preds = %for.body9.lr.ph, %batonRelay.exit.loopexit.us
%bi.030.us = phi i32 [ %add.us, %batonRelay.exit.loopexit.us ], [ 0, %for.body9.lr.ph ]
%add.us = add nuw nsw i32 %bi.030.us, 1
%.pre.i.us = load i32, ptr %vla, align 16, !tbaa !5
br label %for.body.i22.us
for.body.i22.us: ; preds = %for.inc.i.us, %for.body9.us
%4 = phi i32 [ %.pre.i.us, %for.body9.us ], [ %7, %for.inc.i.us ]
%indvars.iv.i23.us = phi i64 [ 0, %for.body9.us ], [ %indvars.iv.next.i24.us, %for.inc.i.us ]
%indvars.iv.next.i24.us = add nuw nsw i64 %indvars.iv.i23.us, 1
%arrayidx2.i.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.i24.us
%5 = load i32, ptr %arrayidx2.i.us, align 4, !tbaa !5
%rem.i.i.us = srem i32 %4, %add.us
%rem1.i.i.us = srem i32 %5, %add.us
%cmp.i.i.us = icmp sgt i32 %rem.i.i.us, %rem1.i.i.us
br i1 %cmp.i.i.us, label %if.then.i.us, label %for.inc.i.us
if.then.i.us: ; preds = %for.body.i22.us
%arrayidx.i26.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i23.us
%6 = load i32, ptr %arrayidx.i26.us, align 4, !tbaa !5
store i32 %5, ptr %arrayidx.i26.us, align 4, !tbaa !5
store i32 %6, ptr %arrayidx2.i.us, align 4, !tbaa !5
br label %for.inc.i.us
for.inc.i.us: ; preds = %if.then.i.us, %for.body.i22.us
%7 = phi i32 [ %5, %for.body.i22.us ], [ %6, %if.then.i.us ]
%exitcond.not.i25.us = icmp eq i64 %indvars.iv.next.i24.us, %wide.trip.count.i21
br i1 %exitcond.not.i25.us, label %batonRelay.exit.loopexit.us, label %for.body.i22.us, !llvm.loop !11
batonRelay.exit.loopexit.us: ; preds = %for.inc.i.us
%exitcond33.not = icmp eq i32 %add.us, %1
br i1 %exitcond33.not, label %for.cond.cleanup8, label %for.body9.us, !llvm.loop !12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx4 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %2
br i1 %exitcond.not, label %for.cond6.preheader, label %for.body, !llvm.loop !13
for.cond.cleanup8: ; preds = %batonRelay.exit.loopexit.us, %for.body9.lr.ph, %for.cond6.preheader
br i1 %cmp27, label %for.body.i, label %printIntArray.exit
for.body.i: ; preds = %for.cond.cleanup8, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %for.cond.cleanup8 ]
%arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%8 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %2
br i1 %exitcond.not.i, label %printIntArray.exit, label %for.body.i, !llvm.loop !9
printIntArray.exit: ; preds = %for.body.i, %for.cond.cleanup8
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %nm) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6
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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree norecurse 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 #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int a[1005];
int b[1005];
int c[1005];
int dist[105][105];
int min(int x,int y){
if(x<y){return x;}
else{return y;}
}
int main(){
int N,M;
scanf("%d %d",&N,&M);
int i,j,k;
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(i==j){dist[i][j]=0;}
else{dist[i][j]=1<<25;}
}
}
for(i=0;i<M;i++){
scanf("%d %d %d",&a[i],&b[i],&c[i]);
a[i]--;
b[i]--;
dist[a[i]][b[i]]=c[i];
dist[b[i]][a[i]]=c[i];
}
for(k=0;k<N;k++){
for(i=0;i<N;i++){
for(j=0;j<N;j++){
dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
}
}
}
int ans=0;
for(i=0;i<M;i++){
if(dist[a[i]][b[i]]<c[i]){ans++;}
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124707/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124707/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@dist = dso_local local_unnamed_addr global [105 x [105 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@a = dso_local global [1005 x i32] zeroinitializer, align 16
@b = dso_local global [1005 x i32] zeroinitializer, align 16
@c = dso_local global [1005 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%x.y = tail call i32 @llvm.smin.i32(i32 %x, i32 %y)
ret i32 %x.y
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%M = 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 %M) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp150 = icmp sgt i32 %0, 0
br i1 %cmp150, label %for.cond1.preheader.us.preheader, label %for.cond14.preheader
for.cond1.preheader.us.preheader: ; preds = %entry
%wide.trip.count169 = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
%n.vec = and i64 %wide.trip.count169, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count169
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc11_crit_edge.us
%indvars.iv166 = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next167, %for.cond1.for.inc11_crit_edge.us ]
br i1 %min.iters.check, label %for.body3.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond1.preheader.us
%broadcast.splatinsert = insertelement <4 x i64> poison, i64 %indvars.iv166, i64 0
%broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
%1 = icmp eq <4 x i64> %broadcast.splat, %vec.ind
%2 = icmp eq <4 x i64> %broadcast.splat, %step.add
%3 = select <4 x i1> %1, <4 x i32> zeroinitializer, <4 x i32> <i32 33554432, i32 33554432, i32 33554432, i32 33554432>
%4 = select <4 x i1> %2, <4 x i32> zeroinitializer, <4 x i32> <i32 33554432, i32 33554432, i32 33554432, i32 33554432>
%5 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv166, i64 %index
store <4 x i32> %3, ptr %5, align 4
%6 = getelementptr inbounds i32, ptr %5, i64 4
store <4 x i32> %4, ptr %6, align 4
%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
br i1 %cmp.n, label %for.cond1.for.inc11_crit_edge.us, label %for.body3.us.preheader
for.body3.us.preheader: ; preds = %for.cond1.preheader.us, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.cond1.preheader.us ], [ %n.vec, %middle.block ]
br label %for.body3.us
for.body3.us: ; preds = %for.body3.us.preheader, %for.body3.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.us ], [ %indvars.iv.ph, %for.body3.us.preheader ]
%cmp4.us = icmp eq i64 %indvars.iv166, %indvars.iv
%spec.select195 = select i1 %cmp4.us, i32 0, i32 33554432
%8 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv166, i64 %indvars.iv
store i32 %spec.select195, ptr %8, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count169
br i1 %exitcond.not, label %for.cond1.for.inc11_crit_edge.us, label %for.body3.us, !llvm.loop !13
for.cond1.for.inc11_crit_edge.us: ; preds = %for.body3.us, %middle.block
%indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
%exitcond170.not = icmp eq i64 %indvars.iv.next167, %wide.trip.count169
br i1 %exitcond170.not, label %for.cond14.preheader, label %for.cond1.preheader.us, !llvm.loop !14
for.cond14.preheader: ; preds = %for.cond1.for.inc11_crit_edge.us, %entry
%9 = load i32, ptr %M, align 4, !tbaa !5
%cmp15152 = icmp sgt i32 %9, 0
br i1 %cmp15152, label %for.body16, label %for.cond52.preheader
for.cond52.preheader.loopexit: ; preds = %for.body16
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond52.preheader
for.cond52.preheader: ; preds = %for.cond52.preheader.loopexit, %for.cond14.preheader
%10 = phi i32 [ %0, %for.cond14.preheader ], [ %.pre, %for.cond52.preheader.loopexit ]
%.lcssa = phi i32 [ %9, %for.cond14.preheader ], [ %43, %for.cond52.preheader.loopexit ]
%cmp53158 = icmp sgt i32 %10, 0
br i1 %cmp53158, label %for.cond55.preheader.us.preheader, label %for.cond87.preheader
for.cond55.preheader.us.preheader: ; preds = %for.cond52.preheader
%wide.trip.count187 = zext i32 %10 to i64
%11 = shl nuw nsw i64 %wide.trip.count187, 2
%12 = getelementptr i8, ptr @dist, i64 %11
%min.iters.check208 = icmp ult i32 %10, 12
%13 = getelementptr i8, ptr @dist, i64 %11
%n.vec211 = and i64 %wide.trip.count187, 4294967288
%cmp.n213 = icmp eq i64 %n.vec211, %wide.trip.count187
%xtraiter = and i64 %wide.trip.count187, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%14 = sub nsw i64 0, %wide.trip.count187
br label %for.cond55.preheader.us
for.cond55.preheader.us: ; preds = %for.cond55.preheader.us.preheader, %for.cond55.for.inc84_crit_edge.split.us.us
%indvars.iv184 = phi i64 [ 0, %for.cond55.preheader.us.preheader ], [ %indvars.iv.next185, %for.cond55.for.inc84_crit_edge.split.us.us ]
%15 = shl nuw nsw i64 %indvars.iv184, 2
%16 = mul nuw nsw i64 %indvars.iv184, 420
%scevgep201 = getelementptr i8, ptr @dist, i64 %16
%scevgep202 = getelementptr i8, ptr %12, i64 %16
%gep = getelementptr i8, ptr getelementptr (i8, ptr @dist, i64 4), i64 %15
%17 = getelementptr i8, ptr @dist, i64 %15
%bound0 = icmp ugt ptr %gep, @dist
%bound1 = icmp ult ptr %17, %13
%found.conflict = and i1 %bound0, %bound1
br label %for.cond58.preheader.us.us
for.cond58.preheader.us.us: ; preds = %for.cond58.for.inc81_crit_edge.us.us, %for.cond55.preheader.us
%indvars.iv179 = phi i64 [ %indvars.iv.next180, %for.cond58.for.inc81_crit_edge.us.us ], [ 0, %for.cond55.preheader.us ]
%arrayidx68.us.us = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv179, i64 %indvars.iv184
br i1 %min.iters.check208, label %for.body60.us.us.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.cond58.preheader.us.us
%18 = mul nuw nsw i64 %indvars.iv179, 420
%scevgep198 = getelementptr i8, ptr %13, i64 %18
%scevgep = getelementptr i8, ptr @dist, i64 %18
%bound0203 = icmp ult ptr %scevgep, %scevgep202
%bound1204 = icmp ult ptr %scevgep201, %scevgep198
%found.conflict205 = and i1 %bound0203, %bound1204
%conflict.rdx = or i1 %found.conflict, %found.conflict205
br i1 %conflict.rdx, label %for.body60.us.us.preheader, label %vector.ph209
vector.ph209: ; preds = %vector.memcheck
%19 = load i32, ptr %arrayidx68.us.us, align 4, !tbaa !5, !alias.scope !15
%broadcast.splatinsert221 = insertelement <4 x i32> poison, i32 %19, i64 0
%broadcast.splat222 = shufflevector <4 x i32> %broadcast.splatinsert221, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body214
vector.body214: ; preds = %vector.body214, %vector.ph209
%index215 = phi i64 [ 0, %vector.ph209 ], [ %index.next223, %vector.body214 ]
%20 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv179, i64 %index215
%wide.load = load <4 x i32>, ptr %20, align 4, !tbaa !5, !alias.scope !18, !noalias !20
%21 = getelementptr inbounds i32, ptr %20, i64 4
%wide.load216 = load <4 x i32>, ptr %21, align 4, !tbaa !5, !alias.scope !18, !noalias !20
%22 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv184, i64 %index215
%wide.load217 = load <4 x i32>, ptr %22, align 4, !tbaa !5, !alias.scope !22
%23 = getelementptr inbounds i32, ptr %22, i64 4
%wide.load218 = load <4 x i32>, ptr %23, align 4, !tbaa !5, !alias.scope !22
%24 = add nsw <4 x i32> %wide.load217, %broadcast.splat222
%25 = add nsw <4 x i32> %wide.load218, %broadcast.splat222
%26 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %24)
%27 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load216, <4 x i32> %25)
store <4 x i32> %26, ptr %20, align 4, !tbaa !5, !alias.scope !18, !noalias !20
store <4 x i32> %27, ptr %21, align 4, !tbaa !5, !alias.scope !18, !noalias !20
%index.next223 = add nuw i64 %index215, 8
%28 = icmp eq i64 %index.next223, %n.vec211
br i1 %28, label %middle.block206, label %vector.body214, !llvm.loop !23
middle.block206: ; preds = %vector.body214
br i1 %cmp.n213, label %for.cond58.for.inc81_crit_edge.us.us, label %for.body60.us.us.preheader
for.body60.us.us.preheader: ; preds = %vector.memcheck, %for.cond58.preheader.us.us, %middle.block206
%indvars.iv174.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.cond58.preheader.us.us ], [ %n.vec211, %middle.block206 ]
br i1 %lcmp.mod.not, label %for.body60.us.us.prol.loopexit, label %for.body60.us.us.prol
for.body60.us.us.prol: ; preds = %for.body60.us.us.preheader
%arrayidx64.us.us.prol = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv179, i64 %indvars.iv174.ph
%29 = load i32, ptr %arrayidx64.us.us.prol, align 4, !tbaa !5
%30 = load i32, ptr %arrayidx68.us.us, align 4, !tbaa !5
%arrayidx72.us.us.prol = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv184, i64 %indvars.iv174.ph
%31 = load i32, ptr %arrayidx72.us.us.prol, align 4, !tbaa !5
%add.us.us.prol = add nsw i32 %31, %30
%x.y.i.us.us.prol = call i32 @llvm.smin.i32(i32 %29, i32 %add.us.us.prol)
store i32 %x.y.i.us.us.prol, ptr %arrayidx64.us.us.prol, align 4, !tbaa !5
%indvars.iv.next175.prol = or i64 %indvars.iv174.ph, 1
br label %for.body60.us.us.prol.loopexit
for.body60.us.us.prol.loopexit: ; preds = %for.body60.us.us.prol, %for.body60.us.us.preheader
%indvars.iv174.unr = phi i64 [ %indvars.iv174.ph, %for.body60.us.us.preheader ], [ %indvars.iv.next175.prol, %for.body60.us.us.prol ]
%32 = xor i64 %indvars.iv174.ph, %14
%33 = icmp eq i64 %32, -1
br i1 %33, label %for.cond58.for.inc81_crit_edge.us.us, label %for.body60.us.us
for.body60.us.us: ; preds = %for.body60.us.us.prol.loopexit, %for.body60.us.us
%indvars.iv174 = phi i64 [ %indvars.iv.next175.1, %for.body60.us.us ], [ %indvars.iv174.unr, %for.body60.us.us.prol.loopexit ]
%arrayidx64.us.us = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv179, i64 %indvars.iv174
%34 = load i32, ptr %arrayidx64.us.us, align 4, !tbaa !5
%35 = load i32, ptr %arrayidx68.us.us, align 4, !tbaa !5
%arrayidx72.us.us = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv184, i64 %indvars.iv174
%36 = load i32, ptr %arrayidx72.us.us, align 4, !tbaa !5
%add.us.us = add nsw i32 %36, %35
%x.y.i.us.us = call i32 @llvm.smin.i32(i32 %34, i32 %add.us.us)
store i32 %x.y.i.us.us, ptr %arrayidx64.us.us, align 4, !tbaa !5
%indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1
%arrayidx64.us.us.1 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv179, i64 %indvars.iv.next175
%37 = load i32, ptr %arrayidx64.us.us.1, align 4, !tbaa !5
%38 = load i32, ptr %arrayidx68.us.us, align 4, !tbaa !5
%arrayidx72.us.us.1 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %indvars.iv184, i64 %indvars.iv.next175
%39 = load i32, ptr %arrayidx72.us.us.1, align 4, !tbaa !5
%add.us.us.1 = add nsw i32 %39, %38
%x.y.i.us.us.1 = call i32 @llvm.smin.i32(i32 %37, i32 %add.us.us.1)
store i32 %x.y.i.us.us.1, ptr %arrayidx64.us.us.1, align 4, !tbaa !5
%indvars.iv.next175.1 = add nuw nsw i64 %indvars.iv174, 2
%exitcond178.not.1 = icmp eq i64 %indvars.iv.next175.1, %wide.trip.count187
br i1 %exitcond178.not.1, label %for.cond58.for.inc81_crit_edge.us.us, label %for.body60.us.us, !llvm.loop !24
for.cond58.for.inc81_crit_edge.us.us: ; preds = %for.body60.us.us.prol.loopexit, %for.body60.us.us, %middle.block206
%indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
%exitcond183.not = icmp eq i64 %indvars.iv.next180, %wide.trip.count187
br i1 %exitcond183.not, label %for.cond55.for.inc84_crit_edge.split.us.us, label %for.cond58.preheader.us.us, !llvm.loop !25
for.cond55.for.inc84_crit_edge.split.us.us: ; preds = %for.cond58.for.inc81_crit_edge.us.us
%indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
%exitcond188.not = icmp eq i64 %indvars.iv.next185, %wide.trip.count187
br i1 %exitcond188.not, label %for.cond87.preheader, label %for.cond55.preheader.us, !llvm.loop !26
for.body16: ; preds = %for.cond14.preheader, %for.body16
%indvars.iv171 = phi i64 [ %indvars.iv.next172, %for.body16 ], [ 0, %for.cond14.preheader ]
%arrayidx18 = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv171
%arrayidx20 = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv171
%arrayidx22 = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv171
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx18, ptr noundef nonnull %arrayidx20, ptr noundef nonnull %arrayidx22)
%40 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%dec = add nsw i32 %40, -1
store i32 %dec, ptr %arrayidx18, align 4, !tbaa !5
%41 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%dec28 = add nsw i32 %41, -1
store i32 %dec28, ptr %arrayidx20, align 4, !tbaa !5
%42 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%idxprom33 = sext i32 %dec to i64
%idxprom37 = sext i32 %dec28 to i64
%arrayidx38 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %idxprom33, i64 %idxprom37
store i32 %42, ptr %arrayidx38, align 4, !tbaa !5
%arrayidx48 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %idxprom37, i64 %idxprom33
store i32 %42, ptr %arrayidx48, align 4, !tbaa !5
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%43 = load i32, ptr %M, align 4, !tbaa !5
%44 = sext i32 %43 to i64
%cmp15 = icmp slt i64 %indvars.iv.next172, %44
br i1 %cmp15, label %for.body16, label %for.cond52.preheader.loopexit, !llvm.loop !27
for.cond87.preheader: ; preds = %for.cond55.for.inc84_crit_edge.split.us.us, %for.cond52.preheader
%cmp88160 = icmp sgt i32 %.lcssa, 0
br i1 %cmp88160, label %for.body89.preheader, label %for.end106
for.body89.preheader: ; preds = %for.cond87.preheader
%wide.trip.count192 = zext i32 %.lcssa to i64
%xtraiter225 = and i64 %wide.trip.count192, 1
%45 = icmp eq i32 %.lcssa, 1
br i1 %45, label %for.end106.loopexit.unr-lcssa, label %for.body89.preheader.new
for.body89.preheader.new: ; preds = %for.body89.preheader
%unroll_iter = and i64 %wide.trip.count192, 4294967294
br label %for.body89
for.body89: ; preds = %for.body89, %for.body89.preheader.new
%indvars.iv189 = phi i64 [ 0, %for.body89.preheader.new ], [ %indvars.iv.next190.1, %for.body89 ]
%ans.0162 = phi i32 [ 0, %for.body89.preheader.new ], [ %spec.select.1, %for.body89 ]
%niter = phi i64 [ 0, %for.body89.preheader.new ], [ %niter.next.1, %for.body89 ]
%arrayidx91 = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv189
%46 = load i32, ptr %arrayidx91, align 8, !tbaa !5
%idxprom92 = sext i32 %46 to i64
%arrayidx95 = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv189
%47 = load i32, ptr %arrayidx95, align 8, !tbaa !5
%idxprom96 = sext i32 %47 to i64
%arrayidx97 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %idxprom92, i64 %idxprom96
%48 = load i32, ptr %arrayidx97, align 4, !tbaa !5
%arrayidx99 = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv189
%49 = load i32, ptr %arrayidx99, align 8, !tbaa !5
%cmp100 = icmp slt i32 %48, %49
%inc102 = zext i1 %cmp100 to i32
%spec.select = add nuw nsw i32 %ans.0162, %inc102
%indvars.iv.next190 = or i64 %indvars.iv189, 1
%arrayidx91.1 = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv.next190
%50 = load i32, ptr %arrayidx91.1, align 4, !tbaa !5
%idxprom92.1 = sext i32 %50 to i64
%arrayidx95.1 = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv.next190
%51 = load i32, ptr %arrayidx95.1, align 4, !tbaa !5
%idxprom96.1 = sext i32 %51 to i64
%arrayidx97.1 = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %idxprom92.1, i64 %idxprom96.1
%52 = load i32, ptr %arrayidx97.1, align 4, !tbaa !5
%arrayidx99.1 = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv.next190
%53 = load i32, ptr %arrayidx99.1, align 4, !tbaa !5
%cmp100.1 = icmp slt i32 %52, %53
%inc102.1 = zext i1 %cmp100.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc102.1
%indvars.iv.next190.1 = add nuw nsw i64 %indvars.iv189, 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.end106.loopexit.unr-lcssa, label %for.body89, !llvm.loop !28
for.end106.loopexit.unr-lcssa: ; preds = %for.body89, %for.body89.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body89.preheader ], [ %spec.select.1, %for.body89 ]
%indvars.iv189.unr = phi i64 [ 0, %for.body89.preheader ], [ %indvars.iv.next190.1, %for.body89 ]
%ans.0162.unr = phi i32 [ 0, %for.body89.preheader ], [ %spec.select.1, %for.body89 ]
%lcmp.mod226.not = icmp eq i64 %xtraiter225, 0
br i1 %lcmp.mod226.not, label %for.end106, label %for.body89.epil
for.body89.epil: ; preds = %for.end106.loopexit.unr-lcssa
%arrayidx91.epil = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv189.unr
%54 = load i32, ptr %arrayidx91.epil, align 4, !tbaa !5
%idxprom92.epil = sext i32 %54 to i64
%arrayidx95.epil = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv189.unr
%55 = load i32, ptr %arrayidx95.epil, align 4, !tbaa !5
%idxprom96.epil = sext i32 %55 to i64
%arrayidx97.epil = getelementptr inbounds [105 x [105 x i32]], ptr @dist, i64 0, i64 %idxprom92.epil, i64 %idxprom96.epil
%56 = load i32, ptr %arrayidx97.epil, align 4, !tbaa !5
%arrayidx99.epil = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv189.unr
%57 = load i32, ptr %arrayidx99.epil, align 4, !tbaa !5
%cmp100.epil = icmp slt i32 %56, %57
%inc102.epil = zext i1 %cmp100.epil to i32
%spec.select.epil = add nuw nsw i32 %ans.0162.unr, %inc102.epil
br label %for.end106
for.end106: ; preds = %for.body89.epil, %for.end106.loopexit.unr-lcssa, %for.cond87.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond87.preheader ], [ %spec.select.lcssa.ph, %for.end106.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body89.epil ]
%call107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !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 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = !{!16, !21}
!21 = distinct !{!21, !17}
!22 = !{!21}
!23 = distinct !{!23, !10, !11, !12}
!24 = distinct !{!24, !10, !11}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.