Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
#include<string.h>
int main(void)
{
int n,sum=0,i,a[22]={0},b[22]={0},c[22]={0};
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<=n;i++)
{
scanf("%d",&b[i]);
}
for(i=1;i<n;i++)
scanf("%d",&c[i]);
for(i=0;i<n;i++)
{
sum+=b[a[i]];
if(a[i]+1==a[i+1])
sum += c[a[i]];
}
printf("%d\n",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273935/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273935/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [22 x i32], align 16
%b = alloca [22 x i32], align 16
%c = alloca [22 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %a) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(88) %a, i8 0, i64 88, i1 false)
call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %b) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(88) %b, i8 0, i64 88, i1 false)
call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %c) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(88) %c, i8 0, i64 88, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp59 = icmp sgt i32 %0, 0
br i1 %cmp59, label %for.body, label %for.end41
for.cond2.preheader: ; preds = %for.body
%cmp3.not61 = icmp slt i32 %1, 1
br i1 %cmp3.not61, label %for.end41, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [22 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond11.preheader: ; preds = %for.body4
%cmp1263 = icmp sgt i32 %3, 1
br i1 %cmp1263, label %for.body13, label %for.cond20.preheader
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body4 ], [ 1, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [22 x i32], ptr %b, i64 0, i64 %indvars.iv71
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6)
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv71, %4
br i1 %cmp3.not.not, label %for.body4, label %for.cond11.preheader, !llvm.loop !11
for.cond20.preheader: ; preds = %for.body13, %for.cond11.preheader
%.lcssa = phi i32 [ %3, %for.cond11.preheader ], [ %6, %for.body13 ]
%cmp2165 = icmp sgt i32 %.lcssa, 0
br i1 %cmp2165, label %for.body22.preheader, label %for.end41
for.body22.preheader: ; preds = %for.cond20.preheader
%wide.trip.count = zext i32 %.lcssa to i64
%.pre = load i32, ptr %a, align 16, !tbaa !5
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %.lcssa, 1
br i1 %5, label %for.end41.loopexit.unr-lcssa, label %for.body22.preheader.new
for.body22.preheader.new: ; preds = %for.body22.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body22
for.body13: ; preds = %for.cond11.preheader, %for.body13
%indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body13 ], [ 1, %for.cond11.preheader ]
%arrayidx15 = getelementptr inbounds [22 x i32], ptr %c, i64 0, i64 %indvars.iv74
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx15)
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp12 = icmp slt i64 %indvars.iv.next75, %7
br i1 %cmp12, label %for.body13, label %for.cond20.preheader, !llvm.loop !12
for.body22: ; preds = %for.inc39.1, %for.body22.preheader.new
%8 = phi i32 [ %.pre, %for.body22.preheader.new ], [ %13, %for.inc39.1 ]
%indvars.iv77 = phi i64 [ 0, %for.body22.preheader.new ], [ %indvars.iv.next78.1, %for.inc39.1 ]
%sum.066 = phi i32 [ 0, %for.body22.preheader.new ], [ %sum.1.1, %for.inc39.1 ]
%niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.1, %for.inc39.1 ]
%idxprom25 = sext i32 %8 to i64
%arrayidx26 = getelementptr inbounds [22 x i32], ptr %b, i64 0, i64 %idxprom25
%9 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%add = add nsw i32 %9, %sum.066
%add29 = add nsw i32 %8, 1
%indvars.iv.next78 = or i64 %indvars.iv77, 1
%arrayidx32 = getelementptr inbounds [22 x i32], ptr %a, i64 0, i64 %indvars.iv.next78
%10 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%cmp33 = icmp eq i32 %add29, %10
br i1 %cmp33, label %if.then, label %for.inc39
if.then: ; preds = %for.body22
%arrayidx37 = getelementptr inbounds [22 x i32], ptr %c, i64 0, i64 %idxprom25
%11 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%add38 = add nsw i32 %11, %add
br label %for.inc39
for.inc39: ; preds = %for.body22, %if.then
%sum.1 = phi i32 [ %add38, %if.then ], [ %add, %for.body22 ]
%idxprom25.1 = sext i32 %10 to i64
%arrayidx26.1 = getelementptr inbounds [22 x i32], ptr %b, i64 0, i64 %idxprom25.1
%12 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5
%add.1 = add nsw i32 %12, %sum.1
%add29.1 = add nsw i32 %10, 1
%indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2
%arrayidx32.1 = getelementptr inbounds [22 x i32], ptr %a, i64 0, i64 %indvars.iv.next78.1
%13 = load i32, ptr %arrayidx32.1, align 8, !tbaa !5
%cmp33.1 = icmp eq i32 %add29.1, %13
br i1 %cmp33.1, label %if.then.1, label %for.inc39.1
if.then.1: ; preds = %for.inc39
%arrayidx37.1 = getelementptr inbounds [22 x i32], ptr %c, i64 0, i64 %idxprom25.1
%14 = load i32, ptr %arrayidx37.1, align 4, !tbaa !5
%add38.1 = add nsw i32 %14, %add.1
br label %for.inc39.1
for.inc39.1: ; preds = %if.then.1, %for.inc39
%sum.1.1 = phi i32 [ %add38.1, %if.then.1 ], [ %add.1, %for.inc39 ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end41.loopexit.unr-lcssa.loopexit, label %for.body22, !llvm.loop !13
for.end41.loopexit.unr-lcssa.loopexit: ; preds = %for.inc39.1
%15 = add nuw nsw i64 %indvars.iv77, 3
br label %for.end41.loopexit.unr-lcssa
for.end41.loopexit.unr-lcssa: ; preds = %for.end41.loopexit.unr-lcssa.loopexit, %for.body22.preheader
%sum.1.lcssa.ph = phi i32 [ undef, %for.body22.preheader ], [ %sum.1.1, %for.end41.loopexit.unr-lcssa.loopexit ]
%.unr = phi i32 [ %.pre, %for.body22.preheader ], [ %13, %for.end41.loopexit.unr-lcssa.loopexit ]
%indvars.iv77.unr = phi i64 [ 1, %for.body22.preheader ], [ %15, %for.end41.loopexit.unr-lcssa.loopexit ]
%sum.066.unr = phi i32 [ 0, %for.body22.preheader ], [ %sum.1.1, %for.end41.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end41, label %for.body22.epil
for.body22.epil: ; preds = %for.end41.loopexit.unr-lcssa
%idxprom25.epil = sext i32 %.unr to i64
%arrayidx26.epil = getelementptr inbounds [22 x i32], ptr %b, i64 0, i64 %idxprom25.epil
%16 = load i32, ptr %arrayidx26.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %16, %sum.066.unr
%add29.epil = add nsw i32 %.unr, 1
%arrayidx32.epil = getelementptr inbounds [22 x i32], ptr %a, i64 0, i64 %indvars.iv77.unr
%17 = load i32, ptr %arrayidx32.epil, align 4, !tbaa !5
%cmp33.epil = icmp eq i32 %add29.epil, %17
br i1 %cmp33.epil, label %if.then.epil, label %for.end41
if.then.epil: ; preds = %for.body22.epil
%arrayidx37.epil = getelementptr inbounds [22 x i32], ptr %c, i64 0, i64 %idxprom25.epil
%18 = load i32, ptr %arrayidx37.epil, align 4, !tbaa !5
%add38.epil = add nsw i32 %18, %add.epil
br label %for.end41
for.end41: ; preds = %for.end41.loopexit.unr-lcssa, %if.then.epil, %for.body22.epil, %for.cond2.preheader, %entry, %for.cond20.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond20.preheader ], [ 0, %entry ], [ 0, %for.cond2.preheader ], [ %sum.1.lcssa.ph, %for.end41.loopexit.unr-lcssa ], [ %add38.epil, %if.then.epil ], [ %add.epil, %for.body22.epil ]
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main () {
int N;
int A[21] = {0};
int B[51] = {0};
int C[51] = {0};
int i;
int n;
int ans = 0;
//入力
scanf ("%d", &N);
for (i = 0; i < N; i++) {
scanf ("%d", &A[i]);
}
for (i = 0; i < N; i++) {
scanf ("%d", &B[i]);
}
for (i = 0; i < N - 1; i++) {
scanf ("%d", &C[i]);
}
//計算
for (i = 0; i < N; i++) {
n = A[i];
ans += B[n - 1];
if (A [i + 1] - A[i] == 1) {
ans += C[n - 1];
}
}
printf ("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273986/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273986/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [21 x i32], align 16
%B = alloca [51 x i32], align 16
%C = alloca [51 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %A) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(84) %A, i8 0, i64 84, i1 false)
call void @llvm.lifetime.start.p0(i64 204, ptr nonnull %B) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(204) %B, i8 0, i64 204, i1 false)
call void @llvm.lifetime.start.p0(i64 204, ptr nonnull %C) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(204) %C, i8 0, i64 204, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp59 = icmp sgt i32 %0, 0
br i1 %cmp59, label %for.body, label %for.end41
for.cond2.preheader: ; preds = %for.body
%cmp361 = icmp sgt i32 %1, 0
br i1 %cmp361, label %for.body4, label %for.end41
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [21 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond11.preheader: ; preds = %for.body4
%cmp1264 = icmp sgt i32 %3, 1
br i1 %cmp1264, label %for.body13, label %for.cond20.preheader
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [51 x i32], ptr %B, i64 0, i64 %indvars.iv72
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6)
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp3 = icmp slt i64 %indvars.iv.next73, %4
br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11
for.cond20.preheader: ; preds = %for.body13, %for.cond11.preheader
%.lcssa = phi i32 [ %3, %for.cond11.preheader ], [ %6, %for.body13 ]
%cmp2166 = icmp sgt i32 %.lcssa, 0
br i1 %cmp2166, label %for.body22.preheader, label %for.end41
for.body22.preheader: ; preds = %for.cond20.preheader
%wide.trip.count = zext i32 %.lcssa to i64
%.pre = load i32, ptr %A, align 16, !tbaa !5
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %.lcssa, 1
br i1 %5, label %for.end41.loopexit.unr-lcssa, label %for.body22.preheader.new
for.body22.preheader.new: ; preds = %for.body22.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body22
for.body13: ; preds = %for.cond11.preheader, %for.body13
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body13 ], [ 0, %for.cond11.preheader ]
%arrayidx15 = getelementptr inbounds [51 x i32], ptr %C, i64 0, i64 %indvars.iv75
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx15)
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %6, -1
%7 = sext i32 %sub to i64
%cmp12 = icmp slt i64 %indvars.iv.next76, %7
br i1 %cmp12, label %for.body13, label %for.cond20.preheader, !llvm.loop !12
for.body22: ; preds = %for.inc39.1, %for.body22.preheader.new
%8 = phi i32 [ %.pre, %for.body22.preheader.new ], [ %13, %for.inc39.1 ]
%indvars.iv78 = phi i64 [ 0, %for.body22.preheader.new ], [ %indvars.iv.next79.1, %for.inc39.1 ]
%ans.068 = phi i32 [ 0, %for.body22.preheader.new ], [ %ans.1.1, %for.inc39.1 ]
%niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.1, %for.inc39.1 ]
%sub25 = add nsw i32 %8, -1
%idxprom26 = sext i32 %sub25 to i64
%arrayidx27 = getelementptr inbounds [51 x i32], ptr %B, i64 0, i64 %idxprom26
%9 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%add = add nsw i32 %9, %ans.068
%indvars.iv.next79 = or i64 %indvars.iv78, 1
%arrayidx30 = getelementptr inbounds [21 x i32], ptr %A, i64 0, i64 %indvars.iv.next79
%10 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%sub33 = sub nsw i32 %10, %8
%cmp34 = icmp eq i32 %sub33, 1
br i1 %cmp34, label %if.then, label %for.inc39
if.then: ; preds = %for.body22
%arrayidx37 = getelementptr inbounds [51 x i32], ptr %C, i64 0, i64 %idxprom26
%11 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%add38 = add nsw i32 %11, %add
br label %for.inc39
for.inc39: ; preds = %for.body22, %if.then
%ans.1 = phi i32 [ %add38, %if.then ], [ %add, %for.body22 ]
%sub25.1 = add nsw i32 %10, -1
%idxprom26.1 = sext i32 %sub25.1 to i64
%arrayidx27.1 = getelementptr inbounds [51 x i32], ptr %B, i64 0, i64 %idxprom26.1
%12 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5
%add.1 = add nsw i32 %12, %ans.1
%indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2
%arrayidx30.1 = getelementptr inbounds [21 x i32], ptr %A, i64 0, i64 %indvars.iv.next79.1
%13 = load i32, ptr %arrayidx30.1, align 8, !tbaa !5
%sub33.1 = sub nsw i32 %13, %10
%cmp34.1 = icmp eq i32 %sub33.1, 1
br i1 %cmp34.1, label %if.then.1, label %for.inc39.1
if.then.1: ; preds = %for.inc39
%arrayidx37.1 = getelementptr inbounds [51 x i32], ptr %C, i64 0, i64 %idxprom26.1
%14 = load i32, ptr %arrayidx37.1, align 4, !tbaa !5
%add38.1 = add nsw i32 %14, %add.1
br label %for.inc39.1
for.inc39.1: ; preds = %if.then.1, %for.inc39
%ans.1.1 = phi i32 [ %add38.1, %if.then.1 ], [ %add.1, %for.inc39 ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end41.loopexit.unr-lcssa.loopexit, label %for.body22, !llvm.loop !13
for.end41.loopexit.unr-lcssa.loopexit: ; preds = %for.inc39.1
%15 = add nuw nsw i64 %indvars.iv78, 3
br label %for.end41.loopexit.unr-lcssa
for.end41.loopexit.unr-lcssa: ; preds = %for.end41.loopexit.unr-lcssa.loopexit, %for.body22.preheader
%ans.1.lcssa.ph = phi i32 [ undef, %for.body22.preheader ], [ %ans.1.1, %for.end41.loopexit.unr-lcssa.loopexit ]
%.unr = phi i32 [ %.pre, %for.body22.preheader ], [ %13, %for.end41.loopexit.unr-lcssa.loopexit ]
%indvars.iv78.unr = phi i64 [ 1, %for.body22.preheader ], [ %15, %for.end41.loopexit.unr-lcssa.loopexit ]
%ans.068.unr = phi i32 [ 0, %for.body22.preheader ], [ %ans.1.1, %for.end41.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end41, label %for.body22.epil
for.body22.epil: ; preds = %for.end41.loopexit.unr-lcssa
%sub25.epil = add nsw i32 %.unr, -1
%idxprom26.epil = sext i32 %sub25.epil to i64
%arrayidx27.epil = getelementptr inbounds [51 x i32], ptr %B, i64 0, i64 %idxprom26.epil
%16 = load i32, ptr %arrayidx27.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %16, %ans.068.unr
%arrayidx30.epil = getelementptr inbounds [21 x i32], ptr %A, i64 0, i64 %indvars.iv78.unr
%17 = load i32, ptr %arrayidx30.epil, align 4, !tbaa !5
%sub33.epil = sub nsw i32 %17, %.unr
%cmp34.epil = icmp eq i32 %sub33.epil, 1
br i1 %cmp34.epil, label %if.then.epil, label %for.end41
if.then.epil: ; preds = %for.body22.epil
%arrayidx37.epil = getelementptr inbounds [51 x i32], ptr %C, i64 0, i64 %idxprom26.epil
%18 = load i32, ptr %arrayidx37.epil, align 4, !tbaa !5
%add38.epil = add nsw i32 %18, %add.epil
br label %for.end41
for.end41: ; preds = %for.end41.loopexit.unr-lcssa, %if.then.epil, %for.body22.epil, %for.cond2.preheader, %entry, %for.cond20.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond20.preheader ], [ 0, %entry ], [ 0, %for.cond2.preheader ], [ %ans.1.lcssa.ph, %for.end41.loopexit.unr-lcssa ], [ %add38.epil, %if.then.epil ], [ %add.epil, %for.body22.epil ]
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 204, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 204, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void){
int N,ans=0,rm=0;
scanf("%d",&N);
int A[N],B[N],C[N-1];
for(int i=0;i<N;i++){
scanf("%d",&A[i]);
}
for(int i=0;i<N;i++){
scanf("%d",&B[i]);
}
for(int i=0;i<N-1;i++){
scanf("%d",&C[i]);
}
for(int i=0;i<N;i++){
if(A[i]==A[i+1]-1){
rm=A[i]-1;
ans+=C[rm];
}
ans+=B[i];
}
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274028/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274028/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%sub = add nsw i32 %3, -1
%5 = zext i32 %sub to i64
%vla2 = alloca i32, i64 %5, align 16
%cmp64 = icmp sgt i32 %3, 0
br i1 %cmp64, label %for.body, label %for.cond.cleanup30
for.cond5.preheader: ; preds = %for.body
%cmp666 = icmp sgt i32 %6, 0
br i1 %cmp666, label %for.body8, label %for.cond.cleanup30
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call3 = 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
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9
for.cond16.preheader: ; preds = %for.body8
%cmp1869 = icmp sgt i32 %8, 1
br i1 %cmp1869, label %for.body20, label %for.cond28.preheader
for.body8: ; preds = %for.cond5.preheader, %for.body8
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body8 ], [ 0, %for.cond5.preheader ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv77
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10)
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%8 = load i32, ptr %N, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp6 = icmp slt i64 %indvars.iv.next78, %9
br i1 %cmp6, label %for.body8, label %for.cond16.preheader, !llvm.loop !11
for.cond28.preheader: ; preds = %for.body20, %for.cond16.preheader
%.lcssa = phi i32 [ %8, %for.cond16.preheader ], [ %11, %for.body20 ]
%cmp2971 = icmp sgt i32 %.lcssa, 0
br i1 %cmp2971, label %for.body31.preheader, label %for.cond.cleanup30
for.body31.preheader: ; preds = %for.cond28.preheader
%wide.trip.count = zext i32 %.lcssa to i64
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%xtraiter = and i64 %wide.trip.count, 1
%10 = icmp eq i32 %.lcssa, 1
br i1 %10, label %for.cond.cleanup30.loopexit.unr-lcssa, label %for.body31.preheader.new
for.body31.preheader.new: ; preds = %for.body31.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body31
for.body20: ; preds = %for.cond16.preheader, %for.body20
%indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body20 ], [ 0, %for.cond16.preheader ]
%arrayidx22 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv80
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx22)
%indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
%11 = load i32, ptr %N, align 4, !tbaa !5
%sub17 = add nsw i32 %11, -1
%12 = sext i32 %sub17 to i64
%cmp18 = icmp slt i64 %indvars.iv.next81, %12
br i1 %cmp18, label %for.body20, label %for.cond28.preheader, !llvm.loop !12
for.cond.cleanup30.loopexit.unr-lcssa: ; preds = %if.end.1, %for.body31.preheader
%add46.lcssa.ph = phi i32 [ undef, %for.body31.preheader ], [ %add46.1, %if.end.1 ]
%.unr = phi i32 [ %.pre, %for.body31.preheader ], [ %21, %if.end.1 ]
%indvars.iv83.unr = phi i64 [ 0, %for.body31.preheader ], [ %indvars.iv.next84.1, %if.end.1 ]
%ans.072.unr = phi i32 [ 0, %for.body31.preheader ], [ %add46.1, %if.end.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup30, label %for.body31.epil
for.body31.epil: ; preds = %for.cond.cleanup30.loopexit.unr-lcssa
%13 = getelementptr i32, ptr %vla, i64 %indvars.iv83.unr
%arrayidx35.epil = getelementptr i32, ptr %13, i64 1
%14 = load i32, ptr %arrayidx35.epil, align 4, !tbaa !5
%sub36.epil = add nsw i32 %14, -1
%cmp37.epil = icmp eq i32 %.unr, %sub36.epil
br i1 %cmp37.epil, label %if.then.epil, label %if.end.epil
if.then.epil: ; preds = %for.body31.epil
%sub40.epil = add nsw i32 %.unr, -1
%idxprom41.epil = sext i32 %sub40.epil to i64
%arrayidx42.epil = getelementptr inbounds i32, ptr %vla2, i64 %idxprom41.epil
%15 = load i32, ptr %arrayidx42.epil, align 4, !tbaa !5
%add43.epil = add nsw i32 %15, %ans.072.unr
br label %if.end.epil
if.end.epil: ; preds = %if.then.epil, %for.body31.epil
%ans.1.epil = phi i32 [ %add43.epil, %if.then.epil ], [ %ans.072.unr, %for.body31.epil ]
%arrayidx45.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv83.unr
%16 = load i32, ptr %arrayidx45.epil, align 4, !tbaa !5
%add46.epil = add nsw i32 %16, %ans.1.epil
br label %for.cond.cleanup30
for.cond.cleanup30: ; preds = %if.end.epil, %for.cond.cleanup30.loopexit.unr-lcssa, %for.cond5.preheader, %entry, %for.cond28.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond28.preheader ], [ 0, %entry ], [ 0, %for.cond5.preheader ], [ %add46.lcssa.ph, %for.cond.cleanup30.loopexit.unr-lcssa ], [ %add46.epil, %if.end.epil ]
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
for.body31: ; preds = %if.end.1, %for.body31.preheader.new
%17 = phi i32 [ %.pre, %for.body31.preheader.new ], [ %21, %if.end.1 ]
%indvars.iv83 = phi i64 [ 0, %for.body31.preheader.new ], [ %indvars.iv.next84.1, %if.end.1 ]
%ans.072 = phi i32 [ 0, %for.body31.preheader.new ], [ %add46.1, %if.end.1 ]
%niter = phi i64 [ 0, %for.body31.preheader.new ], [ %niter.next.1, %if.end.1 ]
%indvars.iv.next84 = or i64 %indvars.iv83, 1
%arrayidx35 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next84
%18 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%sub36 = add nsw i32 %18, -1
%cmp37 = icmp eq i32 %17, %sub36
br i1 %cmp37, label %if.then, label %if.end
if.then: ; preds = %for.body31
%sub40 = add nsw i32 %17, -1
%idxprom41 = sext i32 %sub40 to i64
%arrayidx42 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom41
%19 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%add43 = add nsw i32 %19, %ans.072
br label %if.end
if.end: ; preds = %if.then, %for.body31
%ans.1 = phi i32 [ %add43, %if.then ], [ %ans.072, %for.body31 ]
%arrayidx45 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv83
%20 = load i32, ptr %arrayidx45, align 8, !tbaa !5
%add46 = add nsw i32 %20, %ans.1
%indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2
%arrayidx35.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next84.1
%21 = load i32, ptr %arrayidx35.1, align 8, !tbaa !5
%sub36.1 = add nsw i32 %21, -1
%cmp37.1 = icmp eq i32 %18, %sub36.1
br i1 %cmp37.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %if.end
%sub40.1 = add nsw i32 %18, -1
%idxprom41.1 = sext i32 %sub40.1 to i64
%arrayidx42.1 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom41.1
%22 = load i32, ptr %arrayidx42.1, align 4, !tbaa !5
%add43.1 = add nsw i32 %22, %add46
br label %if.end.1
if.end.1: ; preds = %if.then.1, %if.end
%ans.1.1 = phi i32 [ %add43.1, %if.then.1 ], [ %add46, %if.end ]
%arrayidx45.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next84
%23 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5
%add46.1 = add nsw i32 %23, %ans.1.1
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup30.loopexit.unr-lcssa, label %for.body31, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void){
int n;
scanf("%d",&n);
int i,j;
int A[100];
int B[100];
int C[100];
int count=0;
for(int i=0;i<n;i++){
scanf("%d",&j);
A[i]=j;
}
for(int i=0;i<n;i++){
scanf("%d",&j);
B[i]=j;
}
for(int i=0;i<n-1;i++){
scanf("%d",&j);
C[i]=j;
}
j=1000000;
for(int i=0;i<n;i++){
count+=B[i];
if(A[i]==j+1){
count+=C[j-1];
}
j=A[i];
}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274071/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%j = alloca i32, align 4
%A = alloca [100 x i32], align 16
%B = alloca [100 x i32], align 16
%C = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %C) #3
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp58 = icmp sgt i32 %0, 0
br i1 %cmp58, label %for.body, label %for.cond.cleanup17.thread
for.cond4.preheader: ; preds = %for.body
%cmp560 = icmp sgt i32 %2, 0
br i1 %cmp560, label %for.body7, label %for.cond.cleanup17.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j)
%1 = load i32, ptr %j, align 4, !tbaa !5
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond.cleanup17.thread: ; preds = %entry, %for.cond4.preheader
store i32 1000000, ptr %j, align 4, !tbaa !5
br label %for.cond.cleanup28
for.cond15.preheader: ; preds = %for.body7
%cmp1663 = icmp sgt i32 %5, 1
br i1 %cmp1663, label %for.body18, label %for.cond.cleanup17
for.body7: ; preds = %for.cond4.preheader, %for.body7
%indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body7 ], [ 0, %for.cond4.preheader ]
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j)
%4 = load i32, ptr %j, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv73
store i32 %4, ptr %arrayidx10, align 4, !tbaa !5
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp5 = icmp slt i64 %indvars.iv.next74, %6
br i1 %cmp5, label %for.body7, label %for.cond15.preheader, !llvm.loop !11
for.cond.cleanup17: ; preds = %for.body18, %for.cond15.preheader
%.lcssa = phi i32 [ %5, %for.cond15.preheader ], [ %9, %for.body18 ]
store i32 1000000, ptr %j, align 4, !tbaa !5
%cmp2765 = icmp sgt i32 %.lcssa, 0
br i1 %cmp2765, label %for.body29.preheader, label %for.cond.cleanup28
for.body29.preheader: ; preds = %for.cond.cleanup17
%wide.trip.count = zext i32 %.lcssa to i64
%xtraiter = and i64 %wide.trip.count, 1
%7 = icmp eq i32 %.lcssa, 1
br i1 %7, label %for.cond26.for.cond.cleanup28_crit_edge.unr-lcssa, label %for.body29.preheader.new
for.body29.preheader.new: ; preds = %for.body29.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body29
for.body18: ; preds = %for.cond15.preheader, %for.body18
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body18 ], [ 0, %for.cond15.preheader ]
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j)
%8 = load i32, ptr %j, align 4, !tbaa !5
%arrayidx21 = getelementptr inbounds [100 x i32], ptr %C, i64 0, i64 %indvars.iv76
store i32 %8, ptr %arrayidx21, align 4, !tbaa !5
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %9, -1
%10 = sext i32 %sub to i64
%cmp16 = icmp slt i64 %indvars.iv.next77, %10
br i1 %cmp16, label %for.body18, label %for.cond.cleanup17, !llvm.loop !12
for.cond26.for.cond.cleanup28_crit_edge.unr-lcssa: ; preds = %if.end.1, %for.body29.preheader
%count.1.lcssa.ph = phi i32 [ undef, %for.body29.preheader ], [ %count.1.1, %if.end.1 ]
%.lcssa94.ph = phi i32 [ undef, %for.body29.preheader ], [ %19, %if.end.1 ]
%indvars.iv79.unr = phi i64 [ 0, %for.body29.preheader ], [ %indvars.iv.next80.1, %if.end.1 ]
%count.066.unr = phi i32 [ 0, %for.body29.preheader ], [ %count.1.1, %if.end.1 ]
%.unr = phi i32 [ 1000000, %for.body29.preheader ], [ %19, %if.end.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond26.for.cond.cleanup28_crit_edge, label %for.body29.epil
for.body29.epil: ; preds = %for.cond26.for.cond.cleanup28_crit_edge.unr-lcssa
%arrayidx31.epil = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv79.unr
%11 = load i32, ptr %arrayidx31.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %11, %count.066.unr
%arrayidx33.epil = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv79.unr
%12 = load i32, ptr %arrayidx33.epil, align 4, !tbaa !5
%add34.epil = add nsw i32 %.unr, 1
%cmp35.epil = icmp eq i32 %12, %add34.epil
br i1 %cmp35.epil, label %if.then.epil, label %for.cond26.for.cond.cleanup28_crit_edge
if.then.epil: ; preds = %for.body29.epil
%sub36.epil = add nsw i32 %.unr, -1
%idxprom37.epil = sext i32 %sub36.epil to i64
%arrayidx38.epil = getelementptr inbounds [100 x i32], ptr %C, i64 0, i64 %idxprom37.epil
%13 = load i32, ptr %arrayidx38.epil, align 4, !tbaa !5
%add39.epil = add nsw i32 %13, %add.epil
br label %for.cond26.for.cond.cleanup28_crit_edge
for.cond26.for.cond.cleanup28_crit_edge: ; preds = %for.body29.epil, %if.then.epil, %for.cond26.for.cond.cleanup28_crit_edge.unr-lcssa
%count.1.lcssa = phi i32 [ %count.1.lcssa.ph, %for.cond26.for.cond.cleanup28_crit_edge.unr-lcssa ], [ %add39.epil, %if.then.epil ], [ %add.epil, %for.body29.epil ]
%.lcssa94 = phi i32 [ %.lcssa94.ph, %for.cond26.for.cond.cleanup28_crit_edge.unr-lcssa ], [ %12, %if.then.epil ], [ %12, %for.body29.epil ]
store i32 %.lcssa94, ptr %j, align 4, !tbaa !5
br label %for.cond.cleanup28
for.cond.cleanup28: ; preds = %for.cond.cleanup17.thread, %for.cond26.for.cond.cleanup28_crit_edge, %for.cond.cleanup17
%count.0.lcssa = phi i32 [ %count.1.lcssa, %for.cond26.for.cond.cleanup28_crit_edge ], [ 0, %for.cond.cleanup17 ], [ 0, %for.cond.cleanup17.thread ]
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
for.body29: ; preds = %if.end.1, %for.body29.preheader.new
%indvars.iv79 = phi i64 [ 0, %for.body29.preheader.new ], [ %indvars.iv.next80.1, %if.end.1 ]
%count.066 = phi i32 [ 0, %for.body29.preheader.new ], [ %count.1.1, %if.end.1 ]
%14 = phi i32 [ 1000000, %for.body29.preheader.new ], [ %19, %if.end.1 ]
%niter = phi i64 [ 0, %for.body29.preheader.new ], [ %niter.next.1, %if.end.1 ]
%arrayidx31 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv79
%15 = load i32, ptr %arrayidx31, align 8, !tbaa !5
%add = add nsw i32 %15, %count.066
%arrayidx33 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv79
%16 = load i32, ptr %arrayidx33, align 8, !tbaa !5
%add34 = add nsw i32 %14, 1
%cmp35 = icmp eq i32 %16, %add34
br i1 %cmp35, label %if.then, label %if.end
if.then: ; preds = %for.body29
%sub36 = add nsw i32 %14, -1
%idxprom37 = sext i32 %sub36 to i64
%arrayidx38 = getelementptr inbounds [100 x i32], ptr %C, i64 0, i64 %idxprom37
%17 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%add39 = add nsw i32 %17, %add
br label %if.end
if.end: ; preds = %if.then, %for.body29
%count.1 = phi i32 [ %add39, %if.then ], [ %add, %for.body29 ]
%indvars.iv.next80 = or i64 %indvars.iv79, 1
%arrayidx31.1 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv.next80
%18 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5
%add.1 = add nsw i32 %18, %count.1
%arrayidx33.1 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next80
%19 = load i32, ptr %arrayidx33.1, align 4, !tbaa !5
%add34.1 = add nsw i32 %16, 1
%cmp35.1 = icmp eq i32 %19, %add34.1
br i1 %cmp35.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %if.end
%sub36.1 = add nsw i32 %16, -1
%idxprom37.1 = sext i32 %sub36.1 to i64
%arrayidx38.1 = getelementptr inbounds [100 x i32], ptr %C, i64 0, i64 %idxprom37.1
%20 = load i32, ptr %arrayidx38.1, align 4, !tbaa !5
%add39.1 = add nsw i32 %20, %add.1
br label %if.end.1
if.end.1: ; preds = %if.then.1, %if.end
%count.1.1 = phi i32 [ %add39.1, %if.then.1 ], [ %add.1, %if.end ]
%indvars.iv.next80.1 = add nuw nsw i64 %indvars.iv79, 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.cond26.for.cond.cleanup28_crit_edge.unr-lcssa, label %for.body29, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define max(a, b) (((a) > (b)) ? (a) : (b)) /* 2個の値の最大値 */
#define min(a, b) (((a) < (b)) ? (a) : (b)) /* 2個の値の最小値 */
#define ENTER printf("\n") /* 改行プリント */
int DBG = 1; /* デバッグプリント 提出時は0 */
/* main *************************************************************/
int main()
{
int a[30],b,c[30],i,j,k,n,m,x,y,ans = 0;
char str[256];
scanf("%d", &n);
a[0] = -1;
for(i=1;i<=n;i++) scanf("%d", &a[i]);
for(i=1;i<=n;i++) {
scanf("%d", &b);
ans += b;
}
for(i=1;i<n;i++) scanf("%d", &c[i]);
for(i=1;i<=n;i++) {
if (a[i] == (a[i-1] + 1)) {
ans += c[a[i-1]];
}
}
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274114/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274114/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@DBG = dso_local local_unnamed_addr global i32 1, align 4
@.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 [30 x i32], align 16
%b = alloca i32, align 4
%c = alloca [30 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
store i32 -1, ptr %a, align 16, !tbaa !5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not52 = icmp slt i32 %0, 1
br i1 %cmp.not52, label %for.end36, label %for.body
for.cond3.preheader: ; preds = %for.body
%cmp4.not54 = icmp slt i32 %1, 1
br i1 %cmp4.not54, label %for.end36, label %for.body5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx1 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond10.preheader: ; preds = %for.body5
%cmp1157 = icmp sgt i32 %4, 1
br i1 %cmp1157, label %for.body12, label %for.cond19.preheader
for.body5: ; preds = %for.cond3.preheader, %for.body5
%i.156 = phi i32 [ %inc8, %for.body5 ], [ 1, %for.cond3.preheader ]
%ans.055 = phi i32 [ %add, %for.body5 ], [ 0, %for.cond3.preheader ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%3 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %3, %ans.055
%inc8 = add nuw nsw i32 %i.156, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %i.156, %4
br i1 %cmp4.not.not, label %for.body5, label %for.cond10.preheader, !llvm.loop !11
for.cond19.preheader: ; preds = %for.body12, %for.cond10.preheader
%.lcssa = phi i32 [ %4, %for.cond10.preheader ], [ %8, %for.body12 ]
%cmp20.not60 = icmp slt i32 %.lcssa, 1
br i1 %cmp20.not60, label %for.end36, label %for.body21.preheader
for.body21.preheader: ; preds = %for.cond19.preheader
%5 = add i32 %.lcssa, 1
%wide.trip.count = zext i32 %5 to i64
%.pre = load i32, ptr %a, align 16, !tbaa !5
%6 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %6, 1
%7 = icmp eq i32 %5, 2
br i1 %7, label %for.end36.loopexit.unr-lcssa, label %for.body21.preheader.new
for.body21.preheader.new: ; preds = %for.body21.preheader
%unroll_iter = and i64 %6, -2
br label %for.body21
for.body12: ; preds = %for.cond10.preheader, %for.body12
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.body12 ], [ 1, %for.cond10.preheader ]
%arrayidx14 = getelementptr inbounds [30 x i32], ptr %c, i64 0, i64 %indvars.iv66
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx14)
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp11 = icmp slt i64 %indvars.iv.next67, %9
br i1 %cmp11, label %for.body12, label %for.cond19.preheader, !llvm.loop !12
for.body21: ; preds = %for.inc34.1, %for.body21.preheader.new
%10 = phi i32 [ %.pre, %for.body21.preheader.new ], [ %13, %for.inc34.1 ]
%indvars.iv69 = phi i64 [ 1, %for.body21.preheader.new ], [ %indvars.iv.next70.1, %for.inc34.1 ]
%ans.161 = phi i32 [ %add, %for.body21.preheader.new ], [ %ans.2.1, %for.inc34.1 ]
%niter = phi i64 [ 0, %for.body21.preheader.new ], [ %niter.next.1, %for.inc34.1 ]
%arrayidx23 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv69
%11 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%add26 = add nsw i32 %10, 1
%cmp27 = icmp eq i32 %11, %add26
br i1 %cmp27, label %if.then, label %for.inc34
if.then: ; preds = %for.body21
%idxprom31 = sext i32 %10 to i64
%arrayidx32 = getelementptr inbounds [30 x i32], ptr %c, i64 0, i64 %idxprom31
%12 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%add33 = add nsw i32 %12, %ans.161
br label %for.inc34
for.inc34: ; preds = %for.body21, %if.then
%ans.2 = phi i32 [ %add33, %if.then ], [ %ans.161, %for.body21 ]
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%arrayidx23.1 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv.next70
%13 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%add26.1 = add nsw i32 %11, 1
%cmp27.1 = icmp eq i32 %13, %add26.1
br i1 %cmp27.1, label %if.then.1, label %for.inc34.1
if.then.1: ; preds = %for.inc34
%idxprom31.1 = sext i32 %11 to i64
%arrayidx32.1 = getelementptr inbounds [30 x i32], ptr %c, i64 0, i64 %idxprom31.1
%14 = load i32, ptr %arrayidx32.1, align 4, !tbaa !5
%add33.1 = add nsw i32 %14, %ans.2
br label %for.inc34.1
for.inc34.1: ; preds = %if.then.1, %for.inc34
%ans.2.1 = phi i32 [ %add33.1, %if.then.1 ], [ %ans.2, %for.inc34 ]
%indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 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.end36.loopexit.unr-lcssa, label %for.body21, !llvm.loop !13
for.end36.loopexit.unr-lcssa: ; preds = %for.inc34.1, %for.body21.preheader
%ans.2.lcssa.ph = phi i32 [ undef, %for.body21.preheader ], [ %ans.2.1, %for.inc34.1 ]
%.unr = phi i32 [ %.pre, %for.body21.preheader ], [ %13, %for.inc34.1 ]
%indvars.iv69.unr = phi i64 [ 1, %for.body21.preheader ], [ %indvars.iv.next70.1, %for.inc34.1 ]
%ans.161.unr = phi i32 [ %add, %for.body21.preheader ], [ %ans.2.1, %for.inc34.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end36, label %for.body21.epil
for.body21.epil: ; preds = %for.end36.loopexit.unr-lcssa
%arrayidx23.epil = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv69.unr
%15 = load i32, ptr %arrayidx23.epil, align 4, !tbaa !5
%add26.epil = add nsw i32 %.unr, 1
%cmp27.epil = icmp eq i32 %15, %add26.epil
br i1 %cmp27.epil, label %if.then.epil, label %for.end36
if.then.epil: ; preds = %for.body21.epil
%idxprom31.epil = sext i32 %.unr to i64
%arrayidx32.epil = getelementptr inbounds [30 x i32], ptr %c, i64 0, i64 %idxprom31.epil
%16 = load i32, ptr %arrayidx32.epil, align 4, !tbaa !5
%add33.epil = add nsw i32 %16, %ans.161.unr
br label %for.end36
for.end36: ; preds = %for.end36.loopexit.unr-lcssa, %if.then.epil, %for.body21.epil, %for.cond3.preheader, %entry, %for.cond19.preheader
%ans.1.lcssa = phi i32 [ %add, %for.cond19.preheader ], [ 0, %entry ], [ 0, %for.cond3.preheader ], [ %ans.2.lcssa.ph, %for.end36.loopexit.unr-lcssa ], [ %add33.epil, %if.then.epil ], [ %ans.161.unr, %for.body21.epil ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define INF 1000000000
int n,m,c,s,g;
int map[100][100];
int temp_map[100][100];
typedef struct {
int x,y,d,c;
} rosen_t;
rosen_t rosen[10000];
int p[20];
int q[20][50];
int r[20][50];
int calc_untin(int c,int dist) {
int untin=0;
int nowdist=0;
int nowkukan=0;
while(1) {
if(nowkukan>=p[c]-1 || dist<=q[c][nowkukan]) {
return untin+(dist-nowdist)*r[c][nowkukan];
} else {
untin+=(q[c][nowkukan]-nowdist)*r[c][nowkukan];
nowdist=q[c][nowkukan];
nowkukan++;
}
}
}
int main(void) {
while(scanf("%d%d%d%d%d",&n,&m,&c,&s,&g)==5 && (n|m|c|s|g)!=0) {
int i,j,k,rs;
s--;g--;
for(i=0;i<m;i++) {
scanf("%d%d%d%d",
&rosen[i].x,&rosen[i].y,&rosen[i].d,&rosen[i].c);
rosen[i].x--;rosen[i].y--;rosen[i].c--;
}
for(i=0;i<c;i++)scanf("%d",&p[i]);
for(i=0;i<c;i++) {
for(j=0;j<p[i]-1;j++)scanf("%d",&q[i][j]);
for(j=0;j<p[i];j++)scanf("%d",&r[i][j]);
}
for(i=0;i<n;i++) {
for(j=0;j<n;j++)map[i][j]=(i==j?0:INF);
}
for(rs=0;rs<c;rs++) {
for(i=0;i<n;i++) {
for(j=0;j<n;j++)temp_map[i][j]=(i==j?0:INF);
}
for(i=0;i<m;i++) {
if(rosen[i].c==rs && temp_map[rosen[i].x][rosen[i].y]>rosen[i].d) {
temp_map[rosen[i].x][rosen[i].y]=rosen[i].d;
temp_map[rosen[i].y][rosen[i].x]=rosen[i].d;
}
}
for(k=0;k<n;k++) {
for(i=0;i<n;i++) {
for(j=0;j<n;j++) {
if(temp_map[i][j]>temp_map[i][k]+temp_map[k][j]) {
temp_map[i][j]=temp_map[i][k]+temp_map[k][j];
}
}
}
}
for(i=0;i<n;i++) {
for(j=0;j<n;j++) {
if(temp_map[i][j]<INF) {
int now_untin=calc_untin(rs,temp_map[i][j]);
if(map[i][j]>now_untin)map[i][j]=now_untin;
}
}
}
}
for(k=0;k<n;k++) {
for(i=0;i<n;i++) {
for(j=0;j<n;j++) {
if(map[i][j]>map[i][k]+map[k][j]) {
map[i][j]=map[i][k]+map[k][j];
}
}
}
}
printf("%d\n",map[s][g]<INF?map[s][g]:-1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274158/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274158/source.c"
target datalayout = "e-m:e-p270: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.rosen_t = type { i32, i32, i32, i32 }
@p = dso_local global [20 x i32] zeroinitializer, align 16
@q = dso_local global [20 x [50 x i32]] zeroinitializer, align 16
@r = dso_local global [20 x [50 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1
@n = dso_local global i32 0, align 4
@m = dso_local global i32 0, align 4
@c = dso_local global i32 0, align 4
@s = dso_local global i32 0, align 4
@g = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@rosen = dso_local global [10000 x %struct.rosen_t] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@map = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@temp_map = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @calc_untin(i32 noundef %c, i32 noundef %dist) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %c to i64
%arrayidx = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub = add i32 %0, -1
%cmp.not40 = icmp sgt i32 %0, 1
br i1 %cmp.not40, label %lor.lhs.false.preheader, label %if.then
lor.lhs.false.preheader: ; preds = %entry
%wide.trip.count = zext i32 %sub to i64
br label %lor.lhs.false
lor.lhs.false: ; preds = %lor.lhs.false.preheader, %if.else
%indvars.iv = phi i64 [ 0, %lor.lhs.false.preheader ], [ %indvars.iv.next, %if.else ]
%nowdist.042 = phi i32 [ 0, %lor.lhs.false.preheader ], [ %1, %if.else ]
%untin.041 = phi i32 [ 0, %lor.lhs.false.preheader ], [ %add21, %if.else ]
%arrayidx4 = getelementptr inbounds [20 x [50 x i32]], ptr @q, i64 0, i64 %idxprom, i64 %indvars.iv
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5.not = icmp slt i32 %1, %dist
br i1 %cmp5.not, label %if.else, label %if.then.loopexit.split.loop.exit
if.then.loopexit.split.loop.exit: ; preds = %lor.lhs.false
%2 = trunc i64 %indvars.iv to i32
br label %if.then.loopexit
if.then.loopexit: ; preds = %if.else, %if.then.loopexit.split.loop.exit
%untin.0.lcssa.ph = phi i32 [ %untin.041, %if.then.loopexit.split.loop.exit ], [ %add21, %if.else ]
%nowdist.0.lcssa.ph = phi i32 [ %nowdist.042, %if.then.loopexit.split.loop.exit ], [ %1, %if.else ]
%nowkukan.0.lcssa.ph = phi i32 [ %2, %if.then.loopexit.split.loop.exit ], [ %sub, %if.else ]
%3 = zext i32 %nowkukan.0.lcssa.ph to i64
br label %if.then
if.then: ; preds = %if.then.loopexit, %entry
%untin.0.lcssa = phi i32 [ 0, %entry ], [ %untin.0.lcssa.ph, %if.then.loopexit ]
%nowdist.0.lcssa = phi i32 [ 0, %entry ], [ %nowdist.0.lcssa.ph, %if.then.loopexit ]
%nowkukan.0.lcssa = phi i64 [ 0, %entry ], [ %3, %if.then.loopexit ]
%sub6 = sub nsw i32 %dist, %nowdist.0.lcssa
%arrayidx10 = getelementptr inbounds [20 x [50 x i32]], ptr @r, i64 0, i64 %idxprom, i64 %nowkukan.0.lcssa
%4 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%mul = mul nsw i32 %4, %sub6
%add = add nsw i32 %mul, %untin.0.lcssa
ret i32 %add
if.else: ; preds = %lor.lhs.false
%sub15 = sub nsw i32 %1, %nowdist.042
%arrayidx19 = getelementptr inbounds [20 x [50 x i32]], ptr @r, i64 0, i64 %idxprom, i64 %indvars.iv
%5 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%mul20 = mul nsw i32 %5, %sub15
%add21 = add nsw i32 %mul20, %untin.041
%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.then.loopexit, label %lor.lhs.false
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call447 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @c, ptr noundef nonnull @s, ptr noundef nonnull @g)
%cmp448 = icmp eq i32 %call447, 5
br i1 %cmp448, label %land.rhs, label %while.end
land.rhs: ; preds = %entry, %for.end285
%0 = load i32, ptr @n, align 4, !tbaa !5
%1 = load i32, ptr @m, align 4, !tbaa !5
%or = or i32 %1, %0
%2 = load i32, ptr @c, align 4, !tbaa !5
%or1 = or i32 %or, %2
%3 = load i32, ptr @s, align 4, !tbaa !5
%4 = load i32, ptr @g, align 4, !tbaa !5
%5 = or i32 %or1, %3
%or3 = or i32 %5, %4
%cmp4.not = icmp eq i32 %or3, 0
br i1 %cmp4.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%dec = add nsw i32 %3, -1
store i32 %dec, ptr @s, align 4, !tbaa !5
%dec5 = add nsw i32 %4, -1
store i32 %dec5, ptr @g, align 4, !tbaa !5
%cmp6406 = icmp sgt i32 %1, 0
br i1 %cmp6406, label %for.body, label %for.cond26.preheader
for.cond26.preheader.loopexit: ; preds = %for.body
%.pre = load i32, ptr @c, align 4, !tbaa !5
br label %for.cond26.preheader
for.cond26.preheader: ; preds = %for.cond26.preheader.loopexit, %while.body
%6 = phi i32 [ %.pre, %for.cond26.preheader.loopexit ], [ %2, %while.body ]
%cmp27408 = icmp sgt i32 %6, 0
br i1 %cmp27408, label %for.body28, label %for.cond67.preheader
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [10000 x %struct.rosen_t], ptr @rosen, i64 0, i64 %indvars.iv
%y = getelementptr inbounds [10000 x %struct.rosen_t], ptr @rosen, i64 0, i64 %indvars.iv, i32 1
%d = getelementptr inbounds [10000 x %struct.rosen_t], ptr @rosen, i64 0, i64 %indvars.iv, i32 2
%c = getelementptr inbounds [10000 x %struct.rosen_t], ptr @rosen, i64 0, i64 %indvars.iv, i32 3
%call13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %y, ptr noundef nonnull %d, ptr noundef nonnull %c)
%7 = load <2 x i32>, ptr %arrayidx, align 16, !tbaa !5
%8 = add nsw <2 x i32> %7, <i32 -1, i32 -1>
store <2 x i32> %8, ptr %arrayidx, align 16, !tbaa !5
%9 = load i32, ptr %c, align 4, !tbaa !9
%dec25 = add nsw i32 %9, -1
store i32 %dec25, ptr %c, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr @m, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp6 = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp6, label %for.body, label %for.cond26.preheader.loopexit, !llvm.loop !11
for.cond35.preheader: ; preds = %for.body28
%cmp36416 = icmp sgt i32 %12, 0
br i1 %cmp36416, label %for.cond38.preheader, label %for.cond67.preheader
for.body28: ; preds = %for.cond26.preheader, %for.body28
%indvars.iv456 = phi i64 [ %indvars.iv.next457, %for.body28 ], [ 0, %for.cond26.preheader ]
%arrayidx30 = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %indvars.iv456
%call31 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx30)
%indvars.iv.next457 = add nuw nsw i64 %indvars.iv456, 1
%12 = load i32, ptr @c, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp27 = icmp slt i64 %indvars.iv.next457, %13
br i1 %cmp27, label %for.body28, label %for.cond35.preheader, !llvm.loop !13
for.cond67.preheader: ; preds = %for.inc64, %for.cond26.preheader, %for.cond35.preheader
%.lcssa = phi i32 [ %12, %for.cond35.preheader ], [ %6, %for.cond26.preheader ], [ %28, %for.inc64 ]
%14 = load i32, ptr @n, align 4, !tbaa !5
%cmp68420 = icmp sgt i32 %14, 0
br i1 %cmp68420, label %for.cond70.preheader.us.preheader, label %for.cond84.preheader
for.cond70.preheader.us.preheader: ; preds = %for.cond67.preheader
%wide.trip.count474 = zext i32 %14 to i64
%min.iters.check642 = icmp ult i32 %14, 8
%n.vec645 = and i64 %wide.trip.count474, 4294967288
%cmp.n647 = icmp eq i64 %n.vec645, %wide.trip.count474
br label %for.cond70.preheader.us
for.cond70.preheader.us: ; preds = %for.cond70.preheader.us.preheader, %for.cond70.for.inc81_crit_edge.us
%indvars.iv471 = phi i64 [ 0, %for.cond70.preheader.us.preheader ], [ %indvars.iv.next472, %for.cond70.for.inc81_crit_edge.us ]
br i1 %min.iters.check642, label %for.body72.us.preheader, label %vector.ph643
vector.ph643: ; preds = %for.cond70.preheader.us
%broadcast.splatinsert654 = insertelement <4 x i64> poison, i64 %indvars.iv471, i64 0
%broadcast.splat655 = shufflevector <4 x i64> %broadcast.splatinsert654, <4 x i64> poison, <4 x i32> zeroinitializer
br label %vector.body648
vector.body648: ; preds = %vector.body648, %vector.ph643
%index649 = phi i64 [ 0, %vector.ph643 ], [ %index.next656, %vector.body648 ]
%vec.ind650 = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph643 ], [ %vec.ind.next653, %vector.body648 ]
%step.add651 = add <4 x i64> %vec.ind650, <i64 4, i64 4, i64 4, i64 4>
%15 = icmp eq <4 x i64> %broadcast.splat655, %vec.ind650
%16 = icmp eq <4 x i64> %broadcast.splat655, %step.add651
%17 = select <4 x i1> %15, <4 x i32> zeroinitializer, <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>
%18 = select <4 x i1> %16, <4 x i32> zeroinitializer, <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>
%19 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv471, i64 %index649
store <4 x i32> %17, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %18, ptr %20, align 16, !tbaa !5
%index.next656 = add nuw i64 %index649, 8
%vec.ind.next653 = add <4 x i64> %vec.ind650, <i64 8, i64 8, i64 8, i64 8>
%21 = icmp eq i64 %index.next656, %n.vec645
br i1 %21, label %middle.block640, label %vector.body648, !llvm.loop !14
middle.block640: ; preds = %vector.body648
br i1 %cmp.n647, label %for.cond70.for.inc81_crit_edge.us, label %for.body72.us.preheader
for.body72.us.preheader: ; preds = %for.cond70.preheader.us, %middle.block640
%indvars.iv468.ph = phi i64 [ 0, %for.cond70.preheader.us ], [ %n.vec645, %middle.block640 ]
br label %for.body72.us
for.body72.us: ; preds = %for.body72.us.preheader, %for.body72.us
%indvars.iv468 = phi i64 [ %indvars.iv.next469, %for.body72.us ], [ %indvars.iv468.ph, %for.body72.us.preheader ]
%cmp73.us = icmp eq i64 %indvars.iv471, %indvars.iv468
%cond.us = select i1 %cmp73.us, i32 0, i32 1000000000
%arrayidx77.us = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv471, i64 %indvars.iv468
store i32 %cond.us, ptr %arrayidx77.us, align 4, !tbaa !5
%indvars.iv.next469 = add nuw nsw i64 %indvars.iv468, 1
%exitcond.not = icmp eq i64 %indvars.iv.next469, %wide.trip.count474
br i1 %exitcond.not, label %for.cond70.for.inc81_crit_edge.us, label %for.body72.us, !llvm.loop !17
for.cond70.for.inc81_crit_edge.us: ; preds = %for.body72.us, %middle.block640
%indvars.iv.next472 = add nuw nsw i64 %indvars.iv471, 1
%exitcond475.not = icmp eq i64 %indvars.iv.next472, %wide.trip.count474
br i1 %exitcond475.not, label %for.cond84.preheader, label %for.cond70.preheader.us, !llvm.loop !18
for.cond38.preheader: ; preds = %for.cond35.preheader, %for.inc64
%indvars.iv465 = phi i64 [ %indvars.iv.next466, %for.inc64 ], [ 0, %for.cond35.preheader ]
%arrayidx40 = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %indvars.iv465
%22 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%cmp41411 = icmp sgt i32 %22, 1
br i1 %cmp41411, label %for.body42, label %for.cond51.preheader
for.cond51.preheader: ; preds = %for.body42, %for.cond38.preheader
%23 = phi i32 [ %22, %for.cond38.preheader ], [ %24, %for.body42 ]
%cmp54414 = icmp sgt i32 %23, 0
br i1 %cmp54414, label %for.body55, label %for.inc64
for.body42: ; preds = %for.cond38.preheader, %for.body42
%indvars.iv459 = phi i64 [ %indvars.iv.next460, %for.body42 ], [ 0, %for.cond38.preheader ]
%arrayidx46 = getelementptr inbounds [20 x [50 x i32]], ptr @q, i64 0, i64 %indvars.iv465, i64 %indvars.iv459
%call47 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx46)
%indvars.iv.next460 = add nuw nsw i64 %indvars.iv459, 1
%24 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%sub = add nsw i32 %24, -1
%25 = sext i32 %sub to i64
%cmp41 = icmp slt i64 %indvars.iv.next460, %25
br i1 %cmp41, label %for.body42, label %for.cond51.preheader, !llvm.loop !19
for.body55: ; preds = %for.cond51.preheader, %for.body55
%indvars.iv462 = phi i64 [ %indvars.iv.next463, %for.body55 ], [ 0, %for.cond51.preheader ]
%arrayidx59 = getelementptr inbounds [20 x [50 x i32]], ptr @r, i64 0, i64 %indvars.iv465, i64 %indvars.iv462
%call60 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx59)
%indvars.iv.next463 = add nuw nsw i64 %indvars.iv462, 1
%26 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%27 = sext i32 %26 to i64
%cmp54 = icmp slt i64 %indvars.iv.next463, %27
br i1 %cmp54, label %for.body55, label %for.inc64, !llvm.loop !20
for.inc64: ; preds = %for.body55, %for.cond51.preheader
%indvars.iv.next466 = add nuw nsw i64 %indvars.iv465, 1
%28 = load i32, ptr @c, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp36 = icmp slt i64 %indvars.iv.next466, %29
br i1 %cmp36, label %for.cond38.preheader, label %for.cond67.preheader, !llvm.loop !21
for.cond84.preheader: ; preds = %for.cond70.for.inc81_crit_edge.us, %for.cond67.preheader
%cmp85439 = icmp sgt i32 %.lcssa, 0
br i1 %cmp85439, label %for.cond87.preheader.lr.ph, label %for.cond239.preheader
for.cond87.preheader.lr.ph: ; preds = %for.cond84.preheader
%30 = load i32, ptr @m, align 4, !tbaa !5
%cmp106427 = icmp sgt i32 %30, 0
%wide.trip.count519 = zext i32 %.lcssa to i64
%wide.trip.count484 = zext i32 %14 to i64
%wide.trip.count489 = zext i32 %30 to i64
%wide.trip.count504 = zext i32 %14 to i64
%wide.trip.count514 = zext i32 %14 to i64
%31 = shl nuw nsw i64 %wide.trip.count484, 2
%min.iters.check630 = icmp ult i32 %14, 8
%n.vec633 = and i64 %wide.trip.count484, 4294967288
%cmp.n635 = icmp eq i64 %n.vec633, %wide.trip.count484
%32 = getelementptr i8, ptr @temp_map, i64 %31
%min.iters.check597 = icmp ult i32 %14, 12
%33 = getelementptr i8, ptr @temp_map, i64 %31
%n.vec600 = and i64 %wide.trip.count484, 4294967288
%cmp.n602 = icmp eq i64 %n.vec600, %wide.trip.count484
%xtraiter = and i64 %wide.trip.count484, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%34 = sub nsw i64 0, %wide.trip.count484
br label %for.cond87.preheader
for.cond239.preheader: ; preds = %for.inc236, %for.cond84.preheader
br i1 %cmp68420, label %for.cond242.preheader.us.preheader, label %for.end285
for.cond242.preheader.us.preheader: ; preds = %for.cond239.preheader
%wide.trip.count534 = zext i32 %14 to i64
%35 = shl nuw nsw i64 %wide.trip.count534, 2
%36 = getelementptr i8, ptr @map, i64 %35
%min.iters.check = icmp ult i32 %14, 12
%37 = getelementptr i8, ptr @map, i64 %35
%n.vec = and i64 %wide.trip.count534, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count534
%xtraiter665 = and i64 %wide.trip.count534, 1
%lcmp.mod666.not = icmp eq i64 %xtraiter665, 0
%38 = sub nsw i64 0, %wide.trip.count534
br label %for.cond242.preheader.us
for.cond242.preheader.us: ; preds = %for.cond242.preheader.us.preheader, %for.cond242.for.inc283_crit_edge.split.us.us
%indvars.iv531 = phi i64 [ 0, %for.cond242.preheader.us.preheader ], [ %indvars.iv.next532, %for.cond242.for.inc283_crit_edge.split.us.us ]
%39 = shl nuw nsw i64 %indvars.iv531, 2
%40 = mul nuw nsw i64 %indvars.iv531, 400
%scevgep557 = getelementptr i8, ptr @map, i64 %40
%scevgep558 = getelementptr i8, ptr %36, i64 %40
%gep675 = getelementptr i8, ptr getelementptr (i8, ptr @map, i64 4), i64 %39
%41 = getelementptr i8, ptr @map, i64 %39
%bound0 = icmp ugt ptr %gep675, @map
%bound1 = icmp ult ptr %41, %37
%found.conflict = and i1 %bound0, %bound1
br label %for.cond245.preheader.us.us
for.cond245.preheader.us.us: ; preds = %for.cond245.for.inc280_crit_edge.us.us, %for.cond242.preheader.us
%indvars.iv526 = phi i64 [ %indvars.iv.next527, %for.cond245.for.inc280_crit_edge.us.us ], [ 0, %for.cond242.preheader.us ]
%arrayidx255.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %indvars.iv531
br i1 %min.iters.check, label %for.body247.us.us.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.cond245.preheader.us.us
%42 = mul nuw nsw i64 %indvars.iv526, 400
%scevgep554 = getelementptr i8, ptr %37, i64 %42
%scevgep = getelementptr i8, ptr @map, i64 %42
%bound0559 = icmp ult ptr %scevgep, %scevgep558
%bound1560 = icmp ult ptr %scevgep557, %scevgep554
%found.conflict561 = and i1 %bound0559, %bound1560
%conflict.rdx = or i1 %found.conflict, %found.conflict561
br i1 %conflict.rdx, label %for.body247.us.us.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%43 = load i32, ptr %arrayidx255.us.us, align 4, !tbaa !5, !alias.scope !22
%broadcast.splatinsert565 = insertelement <4 x i32> poison, i32 %43, i64 0
%broadcast.splat566 = shufflevector <4 x i32> %broadcast.splatinsert565, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %pred.store.continue580, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue580 ]
%44 = or i64 %index, 4
%45 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %index
%wide.load = load <4 x i32>, ptr %45, align 16, !tbaa !5, !alias.scope !25, !noalias !27
%46 = getelementptr inbounds i32, ptr %45, i64 4
%wide.load562 = load <4 x i32>, ptr %46, align 16, !tbaa !5, !alias.scope !25, !noalias !27
%47 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv531, i64 %index
%wide.load563 = load <4 x i32>, ptr %47, align 16, !tbaa !5, !alias.scope !29
%48 = getelementptr inbounds i32, ptr %47, i64 4
%wide.load564 = load <4 x i32>, ptr %48, align 16, !tbaa !5, !alias.scope !29
%49 = add nsw <4 x i32> %wide.load563, %broadcast.splat566
%50 = add nsw <4 x i32> %wide.load564, %broadcast.splat566
%51 = icmp sgt <4 x i32> %wide.load, %49
%52 = icmp sgt <4 x i32> %wide.load562, %50
%53 = extractelement <4 x i1> %51, i64 0
br i1 %53, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%54 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %index
%55 = extractelement <4 x i32> %49, i64 0
store i32 %55, ptr %54, align 16, !tbaa !5, !alias.scope !25, !noalias !27
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%56 = extractelement <4 x i1> %51, i64 1
br i1 %56, label %pred.store.if567, label %pred.store.continue568
pred.store.if567: ; preds = %pred.store.continue
%57 = or i64 %index, 1
%58 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %57
%59 = extractelement <4 x i32> %49, i64 1
store i32 %59, ptr %58, align 4, !tbaa !5, !alias.scope !25, !noalias !27
br label %pred.store.continue568
pred.store.continue568: ; preds = %pred.store.if567, %pred.store.continue
%60 = extractelement <4 x i1> %51, i64 2
br i1 %60, label %pred.store.if569, label %pred.store.continue570
pred.store.if569: ; preds = %pred.store.continue568
%61 = or i64 %index, 2
%62 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %61
%63 = extractelement <4 x i32> %49, i64 2
store i32 %63, ptr %62, align 8, !tbaa !5, !alias.scope !25, !noalias !27
br label %pred.store.continue570
pred.store.continue570: ; preds = %pred.store.if569, %pred.store.continue568
%64 = extractelement <4 x i1> %51, i64 3
br i1 %64, label %pred.store.if571, label %pred.store.continue572
pred.store.if571: ; preds = %pred.store.continue570
%65 = or i64 %index, 3
%66 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %65
%67 = extractelement <4 x i32> %49, i64 3
store i32 %67, ptr %66, align 4, !tbaa !5, !alias.scope !25, !noalias !27
br label %pred.store.continue572
pred.store.continue572: ; preds = %pred.store.if571, %pred.store.continue570
%68 = extractelement <4 x i1> %52, i64 0
br i1 %68, label %pred.store.if573, label %pred.store.continue574
pred.store.if573: ; preds = %pred.store.continue572
%69 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %44
%70 = extractelement <4 x i32> %50, i64 0
store i32 %70, ptr %69, align 16, !tbaa !5, !alias.scope !25, !noalias !27
br label %pred.store.continue574
pred.store.continue574: ; preds = %pred.store.if573, %pred.store.continue572
%71 = extractelement <4 x i1> %52, i64 1
br i1 %71, label %pred.store.if575, label %pred.store.continue576
pred.store.if575: ; preds = %pred.store.continue574
%72 = or i64 %index, 5
%73 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %72
%74 = extractelement <4 x i32> %50, i64 1
store i32 %74, ptr %73, align 4, !tbaa !5, !alias.scope !25, !noalias !27
br label %pred.store.continue576
pred.store.continue576: ; preds = %pred.store.if575, %pred.store.continue574
%75 = extractelement <4 x i1> %52, i64 2
br i1 %75, label %pred.store.if577, label %pred.store.continue578
pred.store.if577: ; preds = %pred.store.continue576
%76 = or i64 %index, 6
%77 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %76
%78 = extractelement <4 x i32> %50, i64 2
store i32 %78, ptr %77, align 8, !tbaa !5, !alias.scope !25, !noalias !27
br label %pred.store.continue578
pred.store.continue578: ; preds = %pred.store.if577, %pred.store.continue576
%79 = extractelement <4 x i1> %52, i64 3
br i1 %79, label %pred.store.if579, label %pred.store.continue580
pred.store.if579: ; preds = %pred.store.continue578
%80 = or i64 %index, 7
%81 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %80
%82 = extractelement <4 x i32> %50, i64 3
store i32 %82, ptr %81, align 4, !tbaa !5, !alias.scope !25, !noalias !27
br label %pred.store.continue580
pred.store.continue580: ; preds = %pred.store.if579, %pred.store.continue578
%index.next = add nuw i64 %index, 8
%83 = icmp eq i64 %index.next, %n.vec
br i1 %83, label %middle.block, label %vector.body, !llvm.loop !30
middle.block: ; preds = %pred.store.continue580
br i1 %cmp.n, label %for.cond245.for.inc280_crit_edge.us.us, label %for.body247.us.us.preheader
for.body247.us.us.preheader: ; preds = %vector.memcheck, %for.cond245.preheader.us.us, %middle.block
%indvars.iv521.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.cond245.preheader.us.us ], [ %n.vec, %middle.block ]
br i1 %lcmp.mod666.not, label %for.body247.us.us.prol.loopexit, label %for.body247.us.us.prol
for.body247.us.us.prol: ; preds = %for.body247.us.us.preheader
%arrayidx251.us.us.prol = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %indvars.iv521.ph
%84 = load i32, ptr %arrayidx251.us.us.prol, align 16, !tbaa !5
%85 = load i32, ptr %arrayidx255.us.us, align 4, !tbaa !5
%arrayidx259.us.us.prol = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv531, i64 %indvars.iv521.ph
%86 = load i32, ptr %arrayidx259.us.us.prol, align 16, !tbaa !5
%add260.us.us.prol = add nsw i32 %86, %85
%cmp261.us.us.prol = icmp sgt i32 %84, %add260.us.us.prol
br i1 %cmp261.us.us.prol, label %if.then262.us.us.prol, label %for.inc277.us.us.prol
if.then262.us.us.prol: ; preds = %for.body247.us.us.prol
store i32 %add260.us.us.prol, ptr %arrayidx251.us.us.prol, align 16, !tbaa !5
br label %for.inc277.us.us.prol
for.inc277.us.us.prol: ; preds = %if.then262.us.us.prol, %for.body247.us.us.prol
%indvars.iv.next522.prol = or i64 %indvars.iv521.ph, 1
br label %for.body247.us.us.prol.loopexit
for.body247.us.us.prol.loopexit: ; preds = %for.inc277.us.us.prol, %for.body247.us.us.preheader
%indvars.iv521.unr = phi i64 [ %indvars.iv521.ph, %for.body247.us.us.preheader ], [ %indvars.iv.next522.prol, %for.inc277.us.us.prol ]
%87 = xor i64 %indvars.iv521.ph, %38
%88 = icmp eq i64 %87, -1
br i1 %88, label %for.cond245.for.inc280_crit_edge.us.us, label %for.body247.us.us
for.body247.us.us: ; preds = %for.body247.us.us.prol.loopexit, %for.inc277.us.us.1
%indvars.iv521 = phi i64 [ %indvars.iv.next522.1, %for.inc277.us.us.1 ], [ %indvars.iv521.unr, %for.body247.us.us.prol.loopexit ]
%arrayidx251.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %indvars.iv521
%89 = load i32, ptr %arrayidx251.us.us, align 4, !tbaa !5
%90 = load i32, ptr %arrayidx255.us.us, align 4, !tbaa !5
%arrayidx259.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv531, i64 %indvars.iv521
%91 = load i32, ptr %arrayidx259.us.us, align 4, !tbaa !5
%add260.us.us = add nsw i32 %91, %90
%cmp261.us.us = icmp sgt i32 %89, %add260.us.us
br i1 %cmp261.us.us, label %if.then262.us.us, label %for.inc277.us.us
if.then262.us.us: ; preds = %for.body247.us.us
store i32 %add260.us.us, ptr %arrayidx251.us.us, align 4, !tbaa !5
br label %for.inc277.us.us
for.inc277.us.us: ; preds = %if.then262.us.us, %for.body247.us.us
%indvars.iv.next522 = add nuw nsw i64 %indvars.iv521, 1
%arrayidx251.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv526, i64 %indvars.iv.next522
%92 = load i32, ptr %arrayidx251.us.us.1, align 4, !tbaa !5
%93 = load i32, ptr %arrayidx255.us.us, align 4, !tbaa !5
%arrayidx259.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv531, i64 %indvars.iv.next522
%94 = load i32, ptr %arrayidx259.us.us.1, align 4, !tbaa !5
%add260.us.us.1 = add nsw i32 %94, %93
%cmp261.us.us.1 = icmp sgt i32 %92, %add260.us.us.1
br i1 %cmp261.us.us.1, label %if.then262.us.us.1, label %for.inc277.us.us.1
if.then262.us.us.1: ; preds = %for.inc277.us.us
store i32 %add260.us.us.1, ptr %arrayidx251.us.us.1, align 4, !tbaa !5
br label %for.inc277.us.us.1
for.inc277.us.us.1: ; preds = %if.then262.us.us.1, %for.inc277.us.us
%indvars.iv.next522.1 = add nuw nsw i64 %indvars.iv521, 2
%exitcond525.not.1 = icmp eq i64 %indvars.iv.next522.1, %wide.trip.count534
br i1 %exitcond525.not.1, label %for.cond245.for.inc280_crit_edge.us.us, label %for.body247.us.us, !llvm.loop !31
for.cond245.for.inc280_crit_edge.us.us: ; preds = %for.body247.us.us.prol.loopexit, %for.inc277.us.us.1, %middle.block
%indvars.iv.next527 = add nuw nsw i64 %indvars.iv526, 1
%exitcond530.not = icmp eq i64 %indvars.iv.next527, %wide.trip.count534
br i1 %exitcond530.not, label %for.cond242.for.inc283_crit_edge.split.us.us, label %for.cond245.preheader.us.us, !llvm.loop !32
for.cond242.for.inc283_crit_edge.split.us.us: ; preds = %for.cond245.for.inc280_crit_edge.us.us
%indvars.iv.next532 = add nuw nsw i64 %indvars.iv531, 1
%exitcond535.not = icmp eq i64 %indvars.iv.next532, %wide.trip.count534
br i1 %exitcond535.not, label %for.end285, label %for.cond242.preheader.us, !llvm.loop !33
for.cond87.preheader: ; preds = %for.cond87.preheader.lr.ph, %for.inc236
%indvars.iv516 = phi i64 [ 0, %for.cond87.preheader.lr.ph ], [ %indvars.iv.next517, %for.inc236 ]
br i1 %cmp68420, label %for.cond90.preheader.us, label %for.cond105.preheader
for.cond90.preheader.us: ; preds = %for.cond87.preheader, %for.cond90.for.inc102_crit_edge.us
%indvars.iv481 = phi i64 [ %indvars.iv.next482, %for.cond90.for.inc102_crit_edge.us ], [ 0, %for.cond87.preheader ]
br i1 %min.iters.check630, label %for.body92.us.preheader, label %vector.ph631
vector.ph631: ; preds = %for.cond90.preheader.us
%broadcast.splatinsert = insertelement <4 x i64> poison, i64 %indvars.iv481, i64 0
%broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
br label %vector.body636
vector.body636: ; preds = %vector.body636, %vector.ph631
%index637 = phi i64 [ 0, %vector.ph631 ], [ %index.next639, %vector.body636 ]
%vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph631 ], [ %vec.ind.next, %vector.body636 ]
%step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
%95 = icmp eq <4 x i64> %broadcast.splat, %vec.ind
%96 = icmp eq <4 x i64> %broadcast.splat, %step.add
%97 = select <4 x i1> %95, <4 x i32> zeroinitializer, <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>
%98 = select <4 x i1> %96, <4 x i32> zeroinitializer, <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>
%99 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv481, i64 %index637
store <4 x i32> %97, ptr %99, align 16, !tbaa !5
%100 = getelementptr inbounds i32, ptr %99, i64 4
store <4 x i32> %98, ptr %100, align 16, !tbaa !5
%index.next639 = add nuw i64 %index637, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%101 = icmp eq i64 %index.next639, %n.vec633
br i1 %101, label %middle.block628, label %vector.body636, !llvm.loop !34
middle.block628: ; preds = %vector.body636
br i1 %cmp.n635, label %for.cond90.for.inc102_crit_edge.us, label %for.body92.us.preheader
for.body92.us.preheader: ; preds = %for.cond90.preheader.us, %middle.block628
%indvars.iv476.ph = phi i64 [ 0, %for.cond90.preheader.us ], [ %n.vec633, %middle.block628 ]
br label %for.body92.us
for.body92.us: ; preds = %for.body92.us.preheader, %for.body92.us
%indvars.iv476 = phi i64 [ %indvars.iv.next477, %for.body92.us ], [ %indvars.iv476.ph, %for.body92.us.preheader ]
%cmp93.us = icmp eq i64 %indvars.iv481, %indvars.iv476
%cond94.us = select i1 %cmp93.us, i32 0, i32 1000000000
%arrayidx98.us = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv481, i64 %indvars.iv476
store i32 %cond94.us, ptr %arrayidx98.us, align 4, !tbaa !5
%indvars.iv.next477 = add nuw nsw i64 %indvars.iv476, 1
%exitcond480.not = icmp eq i64 %indvars.iv.next477, %wide.trip.count484
br i1 %exitcond480.not, label %for.cond90.for.inc102_crit_edge.us, label %for.body92.us, !llvm.loop !35
for.cond90.for.inc102_crit_edge.us: ; preds = %for.body92.us, %middle.block628
%indvars.iv.next482 = add nuw nsw i64 %indvars.iv481, 1
%exitcond485.not = icmp eq i64 %indvars.iv.next482, %wide.trip.count484
br i1 %exitcond485.not, label %for.cond105.preheader, label %for.cond90.preheader.us, !llvm.loop !36
for.cond105.preheader: ; preds = %for.cond90.for.inc102_crit_edge.us, %for.cond87.preheader
br i1 %cmp106427, label %for.body107, label %for.cond155.preheader
for.cond155.preheader: ; preds = %for.inc152, %for.cond105.preheader
br i1 %cmp68420, label %for.cond158.preheader.us, label %for.inc236
for.cond158.preheader.us: ; preds = %for.cond155.preheader, %for.cond158.for.inc198_crit_edge.split.us.us
%indvars.iv501 = phi i64 [ %indvars.iv.next502, %for.cond158.for.inc198_crit_edge.split.us.us ], [ 0, %for.cond155.preheader ]
%102 = shl nuw nsw i64 %indvars.iv501, 2
%103 = mul nuw nsw i64 %indvars.iv501, 400
%scevgep586 = getelementptr i8, ptr @temp_map, i64 %103
%scevgep587 = getelementptr i8, ptr %32, i64 %103
%gep = getelementptr i8, ptr getelementptr (i8, ptr @temp_map, i64 4), i64 %102
%104 = getelementptr i8, ptr @temp_map, i64 %102
%bound0588 = icmp ugt ptr %gep, @temp_map
%bound1589 = icmp ult ptr %104, %33
%found.conflict590 = and i1 %bound0588, %bound1589
br label %for.cond161.preheader.us.us
for.cond161.preheader.us.us: ; preds = %for.cond161.for.inc195_crit_edge.us.us, %for.cond158.preheader.us
%indvars.iv496 = phi i64 [ %indvars.iv.next497, %for.cond161.for.inc195_crit_edge.us.us ], [ 0, %for.cond158.preheader.us ]
%arrayidx171.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %indvars.iv501
br i1 %min.iters.check597, label %for.body163.us.us.preheader, label %vector.memcheck581
vector.memcheck581: ; preds = %for.cond161.preheader.us.us
%105 = mul nuw nsw i64 %indvars.iv496, 400
%scevgep583 = getelementptr i8, ptr %33, i64 %105
%scevgep582 = getelementptr i8, ptr @temp_map, i64 %105
%bound0591 = icmp ult ptr %scevgep582, %scevgep587
%bound1592 = icmp ult ptr %scevgep586, %scevgep583
%found.conflict593 = and i1 %bound0591, %bound1592
%conflict.rdx594 = or i1 %found.conflict590, %found.conflict593
br i1 %conflict.rdx594, label %for.body163.us.us.preheader, label %vector.ph598
vector.ph598: ; preds = %vector.memcheck581
%106 = load i32, ptr %arrayidx171.us.us, align 4, !tbaa !5, !alias.scope !37
%broadcast.splatinsert609 = insertelement <4 x i32> poison, i32 %106, i64 0
%broadcast.splat610 = shufflevector <4 x i32> %broadcast.splatinsert609, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body603
vector.body603: ; preds = %pred.store.continue626, %vector.ph598
%index604 = phi i64 [ 0, %vector.ph598 ], [ %index.next627, %pred.store.continue626 ]
%107 = or i64 %index604, 4
%108 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %index604
%wide.load605 = load <4 x i32>, ptr %108, align 16, !tbaa !5, !alias.scope !40, !noalias !42
%109 = getelementptr inbounds i32, ptr %108, i64 4
%wide.load606 = load <4 x i32>, ptr %109, align 16, !tbaa !5, !alias.scope !40, !noalias !42
%110 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv501, i64 %index604
%wide.load607 = load <4 x i32>, ptr %110, align 16, !tbaa !5, !alias.scope !44
%111 = getelementptr inbounds i32, ptr %110, i64 4
%wide.load608 = load <4 x i32>, ptr %111, align 16, !tbaa !5, !alias.scope !44
%112 = add nsw <4 x i32> %wide.load607, %broadcast.splat610
%113 = add nsw <4 x i32> %wide.load608, %broadcast.splat610
%114 = icmp sgt <4 x i32> %wide.load605, %112
%115 = icmp sgt <4 x i32> %wide.load606, %113
%116 = extractelement <4 x i1> %114, i64 0
br i1 %116, label %pred.store.if611, label %pred.store.continue612
pred.store.if611: ; preds = %vector.body603
%117 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %index604
%118 = extractelement <4 x i32> %112, i64 0
store i32 %118, ptr %117, align 16, !tbaa !5, !alias.scope !40, !noalias !42
br label %pred.store.continue612
pred.store.continue612: ; preds = %pred.store.if611, %vector.body603
%119 = extractelement <4 x i1> %114, i64 1
br i1 %119, label %pred.store.if613, label %pred.store.continue614
pred.store.if613: ; preds = %pred.store.continue612
%120 = or i64 %index604, 1
%121 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %120
%122 = extractelement <4 x i32> %112, i64 1
store i32 %122, ptr %121, align 4, !tbaa !5, !alias.scope !40, !noalias !42
br label %pred.store.continue614
pred.store.continue614: ; preds = %pred.store.if613, %pred.store.continue612
%123 = extractelement <4 x i1> %114, i64 2
br i1 %123, label %pred.store.if615, label %pred.store.continue616
pred.store.if615: ; preds = %pred.store.continue614
%124 = or i64 %index604, 2
%125 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %124
%126 = extractelement <4 x i32> %112, i64 2
store i32 %126, ptr %125, align 8, !tbaa !5, !alias.scope !40, !noalias !42
br label %pred.store.continue616
pred.store.continue616: ; preds = %pred.store.if615, %pred.store.continue614
%127 = extractelement <4 x i1> %114, i64 3
br i1 %127, label %pred.store.if617, label %pred.store.continue618
pred.store.if617: ; preds = %pred.store.continue616
%128 = or i64 %index604, 3
%129 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %128
%130 = extractelement <4 x i32> %112, i64 3
store i32 %130, ptr %129, align 4, !tbaa !5, !alias.scope !40, !noalias !42
br label %pred.store.continue618
pred.store.continue618: ; preds = %pred.store.if617, %pred.store.continue616
%131 = extractelement <4 x i1> %115, i64 0
br i1 %131, label %pred.store.if619, label %pred.store.continue620
pred.store.if619: ; preds = %pred.store.continue618
%132 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %107
%133 = extractelement <4 x i32> %113, i64 0
store i32 %133, ptr %132, align 16, !tbaa !5, !alias.scope !40, !noalias !42
br label %pred.store.continue620
pred.store.continue620: ; preds = %pred.store.if619, %pred.store.continue618
%134 = extractelement <4 x i1> %115, i64 1
br i1 %134, label %pred.store.if621, label %pred.store.continue622
pred.store.if621: ; preds = %pred.store.continue620
%135 = or i64 %index604, 5
%136 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %135
%137 = extractelement <4 x i32> %113, i64 1
store i32 %137, ptr %136, align 4, !tbaa !5, !alias.scope !40, !noalias !42
br label %pred.store.continue622
pred.store.continue622: ; preds = %pred.store.if621, %pred.store.continue620
%138 = extractelement <4 x i1> %115, i64 2
br i1 %138, label %pred.store.if623, label %pred.store.continue624
pred.store.if623: ; preds = %pred.store.continue622
%139 = or i64 %index604, 6
%140 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %139
%141 = extractelement <4 x i32> %113, i64 2
store i32 %141, ptr %140, align 8, !tbaa !5, !alias.scope !40, !noalias !42
br label %pred.store.continue624
pred.store.continue624: ; preds = %pred.store.if623, %pred.store.continue622
%142 = extractelement <4 x i1> %115, i64 3
br i1 %142, label %pred.store.if625, label %pred.store.continue626
pred.store.if625: ; preds = %pred.store.continue624
%143 = or i64 %index604, 7
%144 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %143
%145 = extractelement <4 x i32> %113, i64 3
store i32 %145, ptr %144, align 4, !tbaa !5, !alias.scope !40, !noalias !42
br label %pred.store.continue626
pred.store.continue626: ; preds = %pred.store.if625, %pred.store.continue624
%index.next627 = add nuw i64 %index604, 8
%146 = icmp eq i64 %index.next627, %n.vec600
br i1 %146, label %middle.block595, label %vector.body603, !llvm.loop !45
middle.block595: ; preds = %pred.store.continue626
br i1 %cmp.n602, label %for.cond161.for.inc195_crit_edge.us.us, label %for.body163.us.us.preheader
for.body163.us.us.preheader: ; preds = %vector.memcheck581, %for.cond161.preheader.us.us, %middle.block595
%indvars.iv491.ph = phi i64 [ 0, %vector.memcheck581 ], [ 0, %for.cond161.preheader.us.us ], [ %n.vec600, %middle.block595 ]
br i1 %lcmp.mod.not, label %for.body163.us.us.prol.loopexit, label %for.body163.us.us.prol
for.body163.us.us.prol: ; preds = %for.body163.us.us.preheader
%arrayidx167.us.us.prol = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %indvars.iv491.ph
%147 = load i32, ptr %arrayidx167.us.us.prol, align 16, !tbaa !5
%148 = load i32, ptr %arrayidx171.us.us, align 4, !tbaa !5
%arrayidx175.us.us.prol = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv501, i64 %indvars.iv491.ph
%149 = load i32, ptr %arrayidx175.us.us.prol, align 16, !tbaa !5
%add.us.us.prol = add nsw i32 %149, %148
%cmp176.us.us.prol = icmp sgt i32 %147, %add.us.us.prol
br i1 %cmp176.us.us.prol, label %if.then177.us.us.prol, label %for.inc192.us.us.prol
if.then177.us.us.prol: ; preds = %for.body163.us.us.prol
store i32 %add.us.us.prol, ptr %arrayidx167.us.us.prol, align 16, !tbaa !5
br label %for.inc192.us.us.prol
for.inc192.us.us.prol: ; preds = %if.then177.us.us.prol, %for.body163.us.us.prol
%indvars.iv.next492.prol = or i64 %indvars.iv491.ph, 1
br label %for.body163.us.us.prol.loopexit
for.body163.us.us.prol.loopexit: ; preds = %for.inc192.us.us.prol, %for.body163.us.us.preheader
%indvars.iv491.unr = phi i64 [ %indvars.iv491.ph, %for.body163.us.us.preheader ], [ %indvars.iv.next492.prol, %for.inc192.us.us.prol ]
%150 = xor i64 %indvars.iv491.ph, %34
%151 = icmp eq i64 %150, -1
br i1 %151, label %for.cond161.for.inc195_crit_edge.us.us, label %for.body163.us.us
for.body163.us.us: ; preds = %for.body163.us.us.prol.loopexit, %for.inc192.us.us.1
%indvars.iv491 = phi i64 [ %indvars.iv.next492.1, %for.inc192.us.us.1 ], [ %indvars.iv491.unr, %for.body163.us.us.prol.loopexit ]
%arrayidx167.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %indvars.iv491
%152 = load i32, ptr %arrayidx167.us.us, align 4, !tbaa !5
%153 = load i32, ptr %arrayidx171.us.us, align 4, !tbaa !5
%arrayidx175.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv501, i64 %indvars.iv491
%154 = load i32, ptr %arrayidx175.us.us, align 4, !tbaa !5
%add.us.us = add nsw i32 %154, %153
%cmp176.us.us = icmp sgt i32 %152, %add.us.us
br i1 %cmp176.us.us, label %if.then177.us.us, label %for.inc192.us.us
if.then177.us.us: ; preds = %for.body163.us.us
store i32 %add.us.us, ptr %arrayidx167.us.us, align 4, !tbaa !5
br label %for.inc192.us.us
for.inc192.us.us: ; preds = %if.then177.us.us, %for.body163.us.us
%indvars.iv.next492 = add nuw nsw i64 %indvars.iv491, 1
%arrayidx167.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv496, i64 %indvars.iv.next492
%155 = load i32, ptr %arrayidx167.us.us.1, align 4, !tbaa !5
%156 = load i32, ptr %arrayidx171.us.us, align 4, !tbaa !5
%arrayidx175.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv501, i64 %indvars.iv.next492
%157 = load i32, ptr %arrayidx175.us.us.1, align 4, !tbaa !5
%add.us.us.1 = add nsw i32 %157, %156
%cmp176.us.us.1 = icmp sgt i32 %155, %add.us.us.1
br i1 %cmp176.us.us.1, label %if.then177.us.us.1, label %for.inc192.us.us.1
if.then177.us.us.1: ; preds = %for.inc192.us.us
store i32 %add.us.us.1, ptr %arrayidx167.us.us.1, align 4, !tbaa !5
br label %for.inc192.us.us.1
for.inc192.us.us.1: ; preds = %if.then177.us.us.1, %for.inc192.us.us
%indvars.iv.next492.1 = add nuw nsw i64 %indvars.iv491, 2
%exitcond495.not.1 = icmp eq i64 %indvars.iv.next492.1, %wide.trip.count504
br i1 %exitcond495.not.1, label %for.cond161.for.inc195_crit_edge.us.us, label %for.body163.us.us, !llvm.loop !46
for.cond161.for.inc195_crit_edge.us.us: ; preds = %for.body163.us.us.prol.loopexit, %for.inc192.us.us.1, %middle.block595
%indvars.iv.next497 = add nuw nsw i64 %indvars.iv496, 1
%exitcond500.not = icmp eq i64 %indvars.iv.next497, %wide.trip.count504
br i1 %exitcond500.not, label %for.cond158.for.inc198_crit_edge.split.us.us, label %for.cond161.preheader.us.us, !llvm.loop !47
for.cond158.for.inc198_crit_edge.split.us.us: ; preds = %for.cond161.for.inc195_crit_edge.us.us
%indvars.iv.next502 = add nuw nsw i64 %indvars.iv501, 1
%exitcond505.not = icmp eq i64 %indvars.iv.next502, %wide.trip.count504
br i1 %exitcond505.not, label %for.cond201.preheader, label %for.cond158.preheader.us, !llvm.loop !48
for.body107: ; preds = %for.cond105.preheader, %for.inc152
%indvars.iv486 = phi i64 [ %indvars.iv.next487, %for.inc152 ], [ 0, %for.cond105.preheader ]
%c110 = getelementptr inbounds [10000 x %struct.rosen_t], ptr @rosen, i64 0, i64 %indvars.iv486, i32 3
%158 = load i32, ptr %c110, align 4, !tbaa !9
%159 = zext i32 %158 to i64
%cmp111 = icmp eq i64 %indvars.iv516, %159
br i1 %cmp111, label %land.lhs.true, label %for.inc152
land.lhs.true: ; preds = %for.body107
%arrayidx109 = getelementptr inbounds [10000 x %struct.rosen_t], ptr @rosen, i64 0, i64 %indvars.iv486
%160 = load i32, ptr %arrayidx109, align 16, !tbaa !49
%idxprom115 = sext i32 %160 to i64
%y119 = getelementptr inbounds [10000 x %struct.rosen_t], ptr @rosen, i64 0, i64 %indvars.iv486, i32 1
%161 = load i32, ptr %y119, align 4, !tbaa !50
%idxprom120 = sext i32 %161 to i64
%arrayidx121 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %idxprom115, i64 %idxprom120
%162 = load i32, ptr %arrayidx121, align 4, !tbaa !5
%d124 = getelementptr inbounds [10000 x %struct.rosen_t], ptr @rosen, i64 0, i64 %indvars.iv486, i32 2
%163 = load i32, ptr %d124, align 8, !tbaa !51
%cmp125 = icmp sgt i32 %162, %163
br i1 %cmp125, label %if.then, label %for.inc152
if.then: ; preds = %land.lhs.true
store i32 %163, ptr %arrayidx121, align 4, !tbaa !5
%arrayidx151 = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %idxprom120, i64 %idxprom115
store i32 %163, ptr %arrayidx151, align 4, !tbaa !5
br label %for.inc152
for.inc152: ; preds = %for.body107, %land.lhs.true, %if.then
%indvars.iv.next487 = add nuw nsw i64 %indvars.iv486, 1
%exitcond490.not = icmp eq i64 %indvars.iv.next487, %wide.trip.count489
br i1 %exitcond490.not, label %for.cond155.preheader, label %for.body107, !llvm.loop !52
for.cond201.preheader: ; preds = %for.cond158.for.inc198_crit_edge.split.us.us
br i1 %cmp68420, label %for.cond204.preheader.lr.ph, label %for.inc236
for.cond204.preheader.lr.ph: ; preds = %for.cond201.preheader
%arrayidx.i = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %indvars.iv516
br label %for.cond204.preheader.us
for.cond204.preheader.us: ; preds = %for.cond204.for.inc233_crit_edge.us, %for.cond204.preheader.lr.ph
%indvars.iv511 = phi i64 [ %indvars.iv.next512, %for.cond204.for.inc233_crit_edge.us ], [ 0, %for.cond204.preheader.lr.ph ]
br label %for.body206.us
for.body206.us: ; preds = %for.cond204.preheader.us, %for.inc230.us
%indvars.iv506 = phi i64 [ 0, %for.cond204.preheader.us ], [ %indvars.iv.next507, %for.inc230.us ]
%arrayidx210.us = getelementptr inbounds [100 x [100 x i32]], ptr @temp_map, i64 0, i64 %indvars.iv511, i64 %indvars.iv506
%164 = load i32, ptr %arrayidx210.us, align 4, !tbaa !5
%cmp211.us = icmp slt i32 %164, 1000000000
br i1 %cmp211.us, label %if.then212.us, label %for.inc230.us
if.then212.us: ; preds = %for.body206.us
%165 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.not40.i.us = icmp sgt i32 %165, 1
br i1 %cmp.not40.i.us, label %lor.lhs.false.preheader.i.us, label %calc_untin.exit.us
lor.lhs.false.preheader.i.us: ; preds = %if.then212.us
%sub.i.us = add nsw i32 %165, -1
%wide.trip.count.i.us = zext i32 %sub.i.us to i64
br label %lor.lhs.false.i.us
lor.lhs.false.i.us: ; preds = %if.else.i.us, %lor.lhs.false.preheader.i.us
%indvars.iv.i.us = phi i64 [ 0, %lor.lhs.false.preheader.i.us ], [ %indvars.iv.next.i.us, %if.else.i.us ]
%nowdist.042.i.us = phi i32 [ 0, %lor.lhs.false.preheader.i.us ], [ %166, %if.else.i.us ]
%untin.041.i.us = phi i32 [ 0, %lor.lhs.false.preheader.i.us ], [ %add21.i.us, %if.else.i.us ]
%arrayidx4.i.us = getelementptr inbounds [20 x [50 x i32]], ptr @q, i64 0, i64 %indvars.iv516, i64 %indvars.iv.i.us
%166 = load i32, ptr %arrayidx4.i.us, align 4, !tbaa !5
%cmp5.not.i.us = icmp slt i32 %166, %164
br i1 %cmp5.not.i.us, label %if.else.i.us, label %if.then.loopexit.split.loop.exit.i.us
if.then.loopexit.split.loop.exit.i.us: ; preds = %lor.lhs.false.i.us
%.pre536 = and i64 %indvars.iv.i.us, 4294967295
br label %calc_untin.exit.us
if.else.i.us: ; preds = %lor.lhs.false.i.us
%sub15.i.us = sub nsw i32 %166, %nowdist.042.i.us
%arrayidx19.i.us = getelementptr inbounds [20 x [50 x i32]], ptr @r, i64 0, i64 %indvars.iv516, i64 %indvars.iv.i.us
%167 = load i32, ptr %arrayidx19.i.us, align 4, !tbaa !5
%mul20.i.us = mul nsw i32 %167, %sub15.i.us
%add21.i.us = add nsw i32 %mul20.i.us, %untin.041.i.us
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i.us
br i1 %exitcond.not.i.us, label %calc_untin.exit.us, label %lor.lhs.false.i.us
calc_untin.exit.us: ; preds = %if.else.i.us, %if.then.loopexit.split.loop.exit.i.us, %if.then212.us
%untin.0.lcssa.i.us = phi i32 [ 0, %if.then212.us ], [ %untin.041.i.us, %if.then.loopexit.split.loop.exit.i.us ], [ %add21.i.us, %if.else.i.us ]
%nowdist.0.lcssa.i.us = phi i32 [ 0, %if.then212.us ], [ %nowdist.042.i.us, %if.then.loopexit.split.loop.exit.i.us ], [ %166, %if.else.i.us ]
%nowkukan.0.lcssa.i.us = phi i64 [ 0, %if.then212.us ], [ %.pre536, %if.then.loopexit.split.loop.exit.i.us ], [ %wide.trip.count.i.us, %if.else.i.us ]
%sub6.i.us = sub nsw i32 %164, %nowdist.0.lcssa.i.us
%arrayidx10.i.us = getelementptr inbounds [20 x [50 x i32]], ptr @r, i64 0, i64 %indvars.iv516, i64 %nowkukan.0.lcssa.i.us
%168 = load i32, ptr %arrayidx10.i.us, align 4, !tbaa !5
%mul.i.us = mul nsw i32 %168, %sub6.i.us
%add.i.us = add nsw i32 %mul.i.us, %untin.0.lcssa.i.us
%arrayidx221.us = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %indvars.iv511, i64 %indvars.iv506
%169 = load i32, ptr %arrayidx221.us, align 4, !tbaa !5
%cmp222.us = icmp sgt i32 %169, %add.i.us
br i1 %cmp222.us, label %if.then223.us, label %for.inc230.us
if.then223.us: ; preds = %calc_untin.exit.us
store i32 %add.i.us, ptr %arrayidx221.us, align 4, !tbaa !5
br label %for.inc230.us
for.inc230.us: ; preds = %if.then223.us, %calc_untin.exit.us, %for.body206.us
%indvars.iv.next507 = add nuw nsw i64 %indvars.iv506, 1
%exitcond510.not = icmp eq i64 %indvars.iv.next507, %wide.trip.count514
br i1 %exitcond510.not, label %for.cond204.for.inc233_crit_edge.us, label %for.body206.us, !llvm.loop !53
for.cond204.for.inc233_crit_edge.us: ; preds = %for.inc230.us
%indvars.iv.next512 = add nuw nsw i64 %indvars.iv511, 1
%exitcond515.not = icmp eq i64 %indvars.iv.next512, %wide.trip.count514
br i1 %exitcond515.not, label %for.inc236, label %for.cond204.preheader.us, !llvm.loop !54
for.inc236: ; preds = %for.cond204.for.inc233_crit_edge.us, %for.cond155.preheader, %for.cond201.preheader
%indvars.iv.next517 = add nuw nsw i64 %indvars.iv516, 1
%exitcond520.not = icmp eq i64 %indvars.iv.next517, %wide.trip.count519
br i1 %exitcond520.not, label %for.cond239.preheader, label %for.cond87.preheader, !llvm.loop !55
for.end285: ; preds = %for.cond242.for.inc283_crit_edge.split.us.us, %for.cond239.preheader
%170 = load i32, ptr @s, align 4, !tbaa !5
%idxprom286 = sext i32 %170 to i64
%171 = load i32, ptr @g, align 4, !tbaa !5
%idxprom288 = sext i32 %171 to i64
%arrayidx289 = getelementptr inbounds [100 x [100 x i32]], ptr @map, i64 0, i64 %idxprom286, i64 %idxprom288
%172 = load i32, ptr %arrayidx289, align 4, !tbaa !5
%cmp290 = icmp slt i32 %172, 1000000000
%spec.select = select i1 %cmp290, i32 %172, i32 -1
%call296 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %spec.select)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @c, ptr noundef nonnull @s, ptr noundef nonnull @g)
%cmp = icmp eq i32 %call, 5
br i1 %cmp, label %land.rhs, label %while.end, !llvm.loop !56
while.end: ; preds = %land.rhs, %for.end285, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 12}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12, !16, !15}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = !{!23, !28}
!28 = distinct !{!28, !24}
!29 = !{!28}
!30 = distinct !{!30, !12, !15, !16}
!31 = distinct !{!31, !12, !15}
!32 = distinct !{!32, !12}
!33 = distinct !{!33, !12}
!34 = distinct !{!34, !12, !15, !16}
!35 = distinct !{!35, !12, !16, !15}
!36 = distinct !{!36, !12}
!37 = !{!38}
!38 = distinct !{!38, !39}
!39 = distinct !{!39, !"LVerDomain"}
!40 = !{!41}
!41 = distinct !{!41, !39}
!42 = !{!38, !43}
!43 = distinct !{!43, !39}
!44 = !{!43}
!45 = distinct !{!45, !12, !15, !16}
!46 = distinct !{!46, !12, !15}
!47 = distinct !{!47, !12}
!48 = distinct !{!48, !12}
!49 = !{!10, !6, i64 0}
!50 = !{!10, !6, i64 4}
!51 = !{!10, !6, i64 8}
!52 = distinct !{!52, !12}
!53 = distinct !{!53, !12}
!54 = distinct !{!54, !12}
!55 = distinct !{!55, !12}
!56 = distinct !{!56, !12}
|
#include <stdio.h>
int main(void)
{
int a, b, n, s, i;
while (scanf("%d %d %d", &a, &b, &n) != EOF){
s = 0;
for (i = 0; i < n; i++){
a *= 10;
s += (a / b) % 10;
a %= b;
}
printf("%d\n", s);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274200/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274200/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n)
%cmp.not12 = icmp eq i32 %call11, -1
br i1 %cmp.not12, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %for.cond.preheader
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%i.010 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%s.09 = phi i32 [ 0, %for.body.lr.ph ], [ %add, %for.body ]
%rem268 = phi i32 [ %a.promoted, %for.body.lr.ph ], [ %rem2, %for.body ]
%mul = mul nsw i32 %rem268, 10
%div = sdiv i32 %mul, %1
%rem = srem i32 %div, 10
%add = add nsw i32 %rem, %s.09
%rem2 = srem i32 %mul, %1
%inc = add nuw nsw i32 %i.010, 1
%exitcond.not = icmp eq i32 %inc, %0
br i1 %exitcond.not, label %for.cond.for.end_crit_edge, label %for.body, !llvm.loop !9
for.cond.for.end_crit_edge: ; preds = %for.body
store i32 %rem2, ptr %a, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %for.cond.preheader
%s.0.lcssa = phi i32 [ %add, %for.cond.for.end_crit_edge ], [ 0, %for.cond.preheader ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
int main(void){
char div[100];
long double a,b;
int ans,i,n;
while(scanf("%Lf %Lf %d",&a,&b,&n)!=EOF){
sprintf(div,"%.*Lf",n+1,a/b-floorl(a/b));
for(ans=0,i=0;i<n;i++){
ans+=div[i+2]-'0';
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274259/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274259/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%Lf %Lf %d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%.*Lf\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:
%div = alloca [100 x i8], align 16
%a = alloca x86_fp80, align 16
%b = alloca x86_fp80, align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %div) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n)
%cmp.not16 = icmp eq i32 %call15, -1
br i1 %cmp.not16, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = load x86_fp80, ptr %a, align 16, !tbaa !9
%2 = load x86_fp80, ptr %b, align 16, !tbaa !9
%div1 = fdiv x86_fp80 %1, %2
%3 = call x86_fp80 @llvm.floor.f80(x86_fp80 %div1)
%sub = fsub x86_fp80 %div1, %3
%call3 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %div, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add, x86_fp80 noundef %sub) #5
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp412 = icmp sgt i32 %4, 0
br i1 %cmp412, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%wide.trip.count = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.body.preheader21, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%vec.phi19 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%5 = or i64 %index, 2
%6 = getelementptr inbounds [100 x i8], ptr %div, i64 0, i64 %5
%wide.load = load <4 x i8>, ptr %6, align 2, !tbaa !11
%7 = getelementptr inbounds i8, ptr %6, i64 4
%wide.load20 = load <4 x i8>, ptr %7, align 2, !tbaa !11
%8 = sext <4 x i8> %wide.load to <4 x i32>
%9 = sext <4 x i8> %wide.load20 to <4 x i32>
%10 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48>
%11 = add <4 x i32> %vec.phi19, <i32 -48, i32 -48, i32 -48, i32 -48>
%12 = add <4 x i32> %10, %8
%13 = add <4 x i32> %11, %9
%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 !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %13, %12
%15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
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 ]
%ans.013.ph = phi i32 [ 0, %for.body.preheader ], [ %15, %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 ]
%ans.013 = phi i32 [ %add7, %for.body ], [ %ans.013.ph, %for.body.preheader21 ]
%16 = add nuw nsw i64 %indvars.iv, 2
%arrayidx = getelementptr inbounds [100 x i8], ptr %div, i64 0, i64 %16
%17 = load i8, ptr %arrayidx, align 1, !tbaa !11
%conv = sext i8 %17 to i32
%sub6 = add i32 %ans.013, -48
%add7 = add i32 %sub6, %conv
%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 !16
for.end: ; preds = %for.body, %middle.block, %while.body
%ans.0.lcssa = phi i32 [ 0, %while.body ], [ %15, %middle.block ], [ %add7, %for.body ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !17
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %div) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.floor.f80(x86_fp80) #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.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 speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"long double", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13, !14, !15}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !13, !15, !14}
!17 = distinct !{!17, !13}
|
#include<stdio.h>
typedef struct{
int num;
double time;
}data;
void bsort(data *n,int N)
{
int i,k,x;
double w;
for(k=0;k<N;k++){
for(i=0;i<N-1;i++)
if(n[i].time>n[i+1].time){
x=n[i].num;
n[i].num=n[i+1].num;
n[i+1].num=x;
w=n[i].time;
n[i].time=n[i+1].time;
n[i+1].time=w;
}
}
return;
}
int main(void)
{
int i,k,count=0;
data n[3][8],judge[18];
for(k=0;k<3;k++){
for(i=0;i<8;i++){
scanf("%d%lf",&n[k][i].num,&n[k][i].time);
}
}
for(i=0;i<3;i++)bsort(n[i],8);
for(i=0;i<3;i++)
for(k=2;k<8;k++)
judge[count++]=n[i][k];
bsort(judge,18);
for(i=0;i<3;i++)
for(k=0;k<2;k++)
printf("%d %.2f\n",n[i][k].num,n[i][k].time);
for(i=0;i<2;i++)printf("%d %.2f\n",judge[i].num,judge[i].time);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274309/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274309/source.c"
target datalayout = "e-m:e-p270: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.data = type { i32, double }
@.str = private unnamed_addr constant [6 x i8] c"%d%lf\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %.2f\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @bsort(ptr nocapture noundef %n, i32 noundef %N) local_unnamed_addr #0 {
entry:
%or.cond = icmp slt i32 %N, 2
br i1 %or.cond, label %for.end37, label %for.cond1.preheader.us.preheader
for.cond1.preheader.us.preheader: ; preds = %entry
%sub = add nsw i32 %N, -1
%wide.trip.count = zext i32 %sub to i64
%time.us.phi.trans.insert = getelementptr inbounds %struct.data, ptr %n, i64 0, i32 1
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc35_crit_edge.us
%k.063.us = phi i32 [ %inc36.us, %for.cond1.for.inc35_crit_edge.us ], [ 0, %for.cond1.preheader.us.preheader ]
%.pre = load double, ptr %time.us.phi.trans.insert, align 8, !tbaa !5
br label %for.body3.us
for.body3.us: ; preds = %for.cond1.preheader.us, %for.inc.us
%0 = phi double [ %.pre, %for.cond1.preheader.us ], [ %4, %for.inc.us ]
%indvars.iv = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next, %for.inc.us ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%time6.us = getelementptr inbounds %struct.data, ptr %n, i64 %indvars.iv.next, i32 1
%1 = load double, ptr %time6.us, align 8, !tbaa !5
%cmp7.us = fcmp ogt double %0, %1
br i1 %cmp7.us, label %if.then.us, label %for.inc.us
if.then.us: ; preds = %for.body3.us
%time.us = getelementptr inbounds %struct.data, ptr %n, i64 %indvars.iv, i32 1
%arrayidx5.us = getelementptr inbounds %struct.data, ptr %n, i64 %indvars.iv.next
%arrayidx.us = getelementptr inbounds %struct.data, ptr %n, i64 %indvars.iv
%2 = load i32, ptr %arrayidx.us, align 8, !tbaa !11
%3 = load i32, ptr %arrayidx5.us, align 8, !tbaa !11
store i32 %3, ptr %arrayidx.us, align 8, !tbaa !11
store i32 %2, ptr %arrayidx5.us, align 8, !tbaa !11
store double %1, ptr %time.us, align 8, !tbaa !5
store double %0, ptr %time6.us, align 8, !tbaa !5
br label %for.inc.us
for.inc.us: ; preds = %if.then.us, %for.body3.us
%4 = phi double [ %0, %if.then.us ], [ %1, %for.body3.us ]
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.for.inc35_crit_edge.us, label %for.body3.us, !llvm.loop !12
for.cond1.for.inc35_crit_edge.us: ; preds = %for.inc.us
%inc36.us = add nuw nsw i32 %k.063.us, 1
%exitcond66.not = icmp eq i32 %inc36.us, %N
br i1 %exitcond66.not, label %for.end37, label %for.cond1.preheader.us, !llvm.loop !14
for.end37: ; preds = %for.cond1.for.inc35_crit_edge.us, %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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca [3 x [8 x %struct.data]], align 16
%judge = alloca [18 x %struct.data], align 16
call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %judge) #5
%time = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 0, i32 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %time)
%arrayidx5.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 1
%time.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 1, i32 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1, ptr noundef nonnull %time.1)
%arrayidx5.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 2
%time.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 2, i32 1
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2, ptr noundef nonnull %time.2)
%arrayidx5.3 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 3
%time.3 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 3, i32 1
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3, ptr noundef nonnull %time.3)
%arrayidx5.4 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 4
%time.4 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 4, i32 1
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4, ptr noundef nonnull %time.4)
%arrayidx5.5 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 5
%time.5 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 5, i32 1
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5, ptr noundef nonnull %time.5)
%arrayidx5.6 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 6
%time.6 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 6, i32 1
%call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.6, ptr noundef nonnull %time.6)
%arrayidx5.7 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 7
%time.7 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 0, i64 7, i32 1
%call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.7, ptr noundef nonnull %time.7)
%arrayidx5.1135 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 0
%time.1136 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 0, i32 1
%call.1137 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1135, ptr noundef nonnull %time.1136)
%arrayidx5.1.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 1
%time.1.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 1, i32 1
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.1, ptr noundef nonnull %time.1.1)
%arrayidx5.2.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 2
%time.2.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 2, i32 1
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.1, ptr noundef nonnull %time.2.1)
%arrayidx5.3.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 3
%time.3.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 3, i32 1
%call.3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3.1, ptr noundef nonnull %time.3.1)
%arrayidx5.4.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 4
%time.4.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 4, i32 1
%call.4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4.1, ptr noundef nonnull %time.4.1)
%arrayidx5.5.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 5
%time.5.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 5, i32 1
%call.5.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5.1, ptr noundef nonnull %time.5.1)
%arrayidx5.6.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 6
%time.6.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 6, i32 1
%call.6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.6.1, ptr noundef nonnull %time.6.1)
%arrayidx5.7.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 7
%time.7.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 7, i32 1
%call.7.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.7.1, ptr noundef nonnull %time.7.1)
%arrayidx5.2138 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 0
%time.2139 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 0, i32 1
%call.2140 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2138, ptr noundef nonnull %time.2139)
%arrayidx5.1.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 1
%time.1.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 1, i32 1
%call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.2, ptr noundef nonnull %time.1.2)
%arrayidx5.2.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 2
%time.2.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 2, i32 1
%call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.2, ptr noundef nonnull %time.2.2)
%arrayidx5.3.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 3
%time.3.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 3, i32 1
%call.3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3.2, ptr noundef nonnull %time.3.2)
%arrayidx5.4.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 4
%time.4.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 4, i32 1
%call.4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4.2, ptr noundef nonnull %time.4.2)
%arrayidx5.5.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 5
%time.5.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 5, i32 1
%call.5.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5.2, ptr noundef nonnull %time.5.2)
%arrayidx5.6.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 6
%time.6.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 6, i32 1
%call.6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.6.2, ptr noundef nonnull %time.6.2)
%arrayidx5.7.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 7
%time.7.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 7, i32 1
%call.7.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.7.2, ptr noundef nonnull %time.7.2)
%.pre.i.pre = load double, ptr %time, align 8, !tbaa !5
%.pre = load double, ptr %time.1, align 8, !tbaa !5
%n.promoted = load i32, ptr %n, align 16, !tbaa !11
%arrayidx5.1.promoted = load i32, ptr %arrayidx5.1, align 16, !tbaa !11
%time.2.promoted = load double, ptr %time.2, align 8, !tbaa !5
%arrayidx5.2.promoted = load i32, ptr %arrayidx5.2, align 16, !tbaa !11
%time.3.promoted = load double, ptr %time.3, align 8, !tbaa !5
%arrayidx5.3.promoted = load i32, ptr %arrayidx5.3, align 16, !tbaa !11
%time.4.promoted = load double, ptr %time.4, align 8, !tbaa !5
%arrayidx5.4.promoted = load i32, ptr %arrayidx5.4, align 16, !tbaa !11
%time.5.promoted = load double, ptr %time.5, align 8, !tbaa !5
%arrayidx5.5.promoted = load i32, ptr %arrayidx5.5, align 16, !tbaa !11
%time.6.promoted = load double, ptr %time.6, align 8, !tbaa !5
%arrayidx5.6.promoted = load i32, ptr %arrayidx5.6, align 16, !tbaa !11
%time.7.promoted = load double, ptr %time.7, align 8, !tbaa !5
%arrayidx5.7.promoted = load i32, ptr %arrayidx5.7, align 16, !tbaa !11
br label %for.cond1.preheader.us.i
for.cond1.preheader.us.i: ; preds = %for.inc.us.i.6, %entry
%0 = phi i32 [ %39, %for.inc.us.i.6 ], [ %arrayidx5.7.promoted, %entry ]
%1 = phi double [ %40, %for.inc.us.i.6 ], [ %time.7.promoted, %entry ]
%2 = phi i32 [ %41, %for.inc.us.i.6 ], [ %arrayidx5.6.promoted, %entry ]
%3 = phi double [ %42, %for.inc.us.i.6 ], [ %time.6.promoted, %entry ]
%4 = phi i32 [ %37, %for.inc.us.i.6 ], [ %arrayidx5.5.promoted, %entry ]
%5 = phi double [ %38, %for.inc.us.i.6 ], [ %time.5.promoted, %entry ]
%6 = phi i32 [ %33, %for.inc.us.i.6 ], [ %arrayidx5.4.promoted, %entry ]
%7 = phi double [ %34, %for.inc.us.i.6 ], [ %time.4.promoted, %entry ]
%8 = phi i32 [ %29, %for.inc.us.i.6 ], [ %arrayidx5.3.promoted, %entry ]
%9 = phi double [ %30, %for.inc.us.i.6 ], [ %time.3.promoted, %entry ]
%10 = phi i32 [ %25, %for.inc.us.i.6 ], [ %arrayidx5.2.promoted, %entry ]
%11 = phi double [ %26, %for.inc.us.i.6 ], [ %time.2.promoted, %entry ]
%12 = phi i32 [ %21, %for.inc.us.i.6 ], [ %arrayidx5.1.promoted, %entry ]
%13 = phi i32 [ %16, %for.inc.us.i.6 ], [ %n.promoted, %entry ]
%14 = phi double [ %22, %for.inc.us.i.6 ], [ %.pre, %entry ]
%.pre.i = phi double [ %18, %for.inc.us.i.6 ], [ %.pre.i.pre, %entry ]
%k.063.us.i = phi i32 [ %inc36.us.i, %for.inc.us.i.6 ], [ 0, %entry ]
%cmp7.us.i = fcmp ogt double %.pre.i, %14
br i1 %cmp7.us.i, label %if.then.us.i, label %for.inc.us.i
if.then.us.i: ; preds = %for.cond1.preheader.us.i
store i32 %12, ptr %n, align 16, !tbaa !11
store i32 %13, ptr %arrayidx5.1, align 16, !tbaa !11
store double %14, ptr %time, align 8, !tbaa !5
store double %.pre.i, ptr %time.1, align 8, !tbaa !5
br label %for.inc.us.i
for.inc.us.i: ; preds = %if.then.us.i, %for.cond1.preheader.us.i
%15 = phi i32 [ %13, %if.then.us.i ], [ %12, %for.cond1.preheader.us.i ]
%16 = phi i32 [ %12, %if.then.us.i ], [ %13, %for.cond1.preheader.us.i ]
%17 = phi double [ %.pre.i, %if.then.us.i ], [ %14, %for.cond1.preheader.us.i ]
%18 = phi double [ %14, %if.then.us.i ], [ %.pre.i, %for.cond1.preheader.us.i ]
%cmp7.us.i.1 = fcmp ogt double %17, %11
br i1 %cmp7.us.i.1, label %if.then.us.i.1, label %for.inc.us.i.1
if.then.us.i.1: ; preds = %for.inc.us.i
store i32 %10, ptr %arrayidx5.1, align 16, !tbaa !11
store i32 %15, ptr %arrayidx5.2, align 16, !tbaa !11
store double %11, ptr %time.1, align 8, !tbaa !5
store double %17, ptr %time.2, align 8, !tbaa !5
br label %for.inc.us.i.1
for.inc.us.i.1: ; preds = %if.then.us.i.1, %for.inc.us.i
%19 = phi i32 [ %15, %if.then.us.i.1 ], [ %10, %for.inc.us.i ]
%20 = phi double [ %17, %if.then.us.i.1 ], [ %11, %for.inc.us.i ]
%21 = phi i32 [ %10, %if.then.us.i.1 ], [ %15, %for.inc.us.i ]
%22 = phi double [ %11, %if.then.us.i.1 ], [ %17, %for.inc.us.i ]
%cmp7.us.i.2 = fcmp ogt double %20, %9
br i1 %cmp7.us.i.2, label %if.then.us.i.2, label %for.inc.us.i.2
if.then.us.i.2: ; preds = %for.inc.us.i.1
store i32 %8, ptr %arrayidx5.2, align 16, !tbaa !11
store i32 %19, ptr %arrayidx5.3, align 16, !tbaa !11
store double %9, ptr %time.2, align 8, !tbaa !5
store double %20, ptr %time.3, align 8, !tbaa !5
br label %for.inc.us.i.2
for.inc.us.i.2: ; preds = %if.then.us.i.2, %for.inc.us.i.1
%23 = phi i32 [ %19, %if.then.us.i.2 ], [ %8, %for.inc.us.i.1 ]
%24 = phi double [ %20, %if.then.us.i.2 ], [ %9, %for.inc.us.i.1 ]
%25 = phi i32 [ %8, %if.then.us.i.2 ], [ %19, %for.inc.us.i.1 ]
%26 = phi double [ %9, %if.then.us.i.2 ], [ %20, %for.inc.us.i.1 ]
%cmp7.us.i.3 = fcmp ogt double %24, %7
br i1 %cmp7.us.i.3, label %if.then.us.i.3, label %for.inc.us.i.3
if.then.us.i.3: ; preds = %for.inc.us.i.2
store i32 %6, ptr %arrayidx5.3, align 16, !tbaa !11
store i32 %23, ptr %arrayidx5.4, align 16, !tbaa !11
store double %7, ptr %time.3, align 8, !tbaa !5
store double %24, ptr %time.4, align 8, !tbaa !5
br label %for.inc.us.i.3
for.inc.us.i.3: ; preds = %if.then.us.i.3, %for.inc.us.i.2
%27 = phi i32 [ %23, %if.then.us.i.3 ], [ %6, %for.inc.us.i.2 ]
%28 = phi double [ %24, %if.then.us.i.3 ], [ %7, %for.inc.us.i.2 ]
%29 = phi i32 [ %6, %if.then.us.i.3 ], [ %23, %for.inc.us.i.2 ]
%30 = phi double [ %7, %if.then.us.i.3 ], [ %24, %for.inc.us.i.2 ]
%cmp7.us.i.4 = fcmp ogt double %28, %5
br i1 %cmp7.us.i.4, label %if.then.us.i.4, label %for.inc.us.i.4
if.then.us.i.4: ; preds = %for.inc.us.i.3
store i32 %4, ptr %arrayidx5.4, align 16, !tbaa !11
store i32 %27, ptr %arrayidx5.5, align 16, !tbaa !11
store double %5, ptr %time.4, align 8, !tbaa !5
store double %28, ptr %time.5, align 8, !tbaa !5
br label %for.inc.us.i.4
for.inc.us.i.4: ; preds = %if.then.us.i.4, %for.inc.us.i.3
%31 = phi i32 [ %27, %if.then.us.i.4 ], [ %4, %for.inc.us.i.3 ]
%32 = phi double [ %28, %if.then.us.i.4 ], [ %5, %for.inc.us.i.3 ]
%33 = phi i32 [ %4, %if.then.us.i.4 ], [ %27, %for.inc.us.i.3 ]
%34 = phi double [ %5, %if.then.us.i.4 ], [ %28, %for.inc.us.i.3 ]
%cmp7.us.i.5 = fcmp ogt double %32, %3
br i1 %cmp7.us.i.5, label %if.then.us.i.5, label %for.inc.us.i.5
if.then.us.i.5: ; preds = %for.inc.us.i.4
store i32 %2, ptr %arrayidx5.5, align 16, !tbaa !11
store i32 %31, ptr %arrayidx5.6, align 16, !tbaa !11
store double %3, ptr %time.5, align 8, !tbaa !5
store double %32, ptr %time.6, align 8, !tbaa !5
br label %for.inc.us.i.5
for.inc.us.i.5: ; preds = %if.then.us.i.5, %for.inc.us.i.4
%35 = phi i32 [ %31, %if.then.us.i.5 ], [ %2, %for.inc.us.i.4 ]
%36 = phi double [ %32, %if.then.us.i.5 ], [ %3, %for.inc.us.i.4 ]
%37 = phi i32 [ %2, %if.then.us.i.5 ], [ %31, %for.inc.us.i.4 ]
%38 = phi double [ %3, %if.then.us.i.5 ], [ %32, %for.inc.us.i.4 ]
%cmp7.us.i.6 = fcmp ogt double %36, %1
br i1 %cmp7.us.i.6, label %if.then.us.i.6, label %for.inc.us.i.6
if.then.us.i.6: ; preds = %for.inc.us.i.5
store i32 %0, ptr %arrayidx5.6, align 16, !tbaa !11
store i32 %35, ptr %arrayidx5.7, align 16, !tbaa !11
store double %1, ptr %time.6, align 8, !tbaa !5
store double %36, ptr %time.7, align 8, !tbaa !5
br label %for.inc.us.i.6
for.inc.us.i.6: ; preds = %if.then.us.i.6, %for.inc.us.i.5
%39 = phi i32 [ %35, %if.then.us.i.6 ], [ %0, %for.inc.us.i.5 ]
%40 = phi double [ %36, %if.then.us.i.6 ], [ %1, %for.inc.us.i.5 ]
%41 = phi i32 [ %0, %if.then.us.i.6 ], [ %35, %for.inc.us.i.5 ]
%42 = phi double [ %1, %if.then.us.i.6 ], [ %36, %for.inc.us.i.5 ]
%inc36.us.i = add nuw nsw i32 %k.063.us.i, 1
%exitcond66.not.i = icmp eq i32 %inc36.us.i, 8
br i1 %exitcond66.not.i, label %bsort.exit, label %for.cond1.preheader.us.i, !llvm.loop !14
bsort.exit: ; preds = %for.inc.us.i.6
%time.us.phi.trans.insert.i.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 0, i32 1
%.pre.i.1.pre = load double, ptr %time.us.phi.trans.insert.i.1, align 8, !tbaa !5
%time6.us.i.1142.phi.trans.insert = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 1, i32 1
%.pre173 = load double, ptr %time6.us.i.1142.phi.trans.insert, align 8, !tbaa !5
%arrayidx5.us.i.1145 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 1
%time6.us.i.1.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 2, i32 1
%arrayidx5.us.i.1.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 2
%arrayidx.us.i.1.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 1
%time6.us.i.2.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 3, i32 1
%arrayidx5.us.i.2.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 3
%arrayidx.us.i.2.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 2
%time6.us.i.3.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 4, i32 1
%arrayidx5.us.i.3.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 4
%arrayidx.us.i.3.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 3
%time6.us.i.4.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 5, i32 1
%arrayidx5.us.i.4.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 5
%arrayidx.us.i.4.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 4
%time6.us.i.5.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 6, i32 1
%arrayidx5.us.i.5.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 6
%arrayidx.us.i.5.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 5
%time6.us.i.6.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 7, i32 1
%arrayidx5.us.i.6.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 7
%arrayidx.us.i.6.1 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 1, i64 6
%arrayidx5.1135.promoted = load i32, ptr %arrayidx5.1135, align 16, !tbaa !11
%arrayidx5.us.i.1145.promoted = load i32, ptr %arrayidx5.us.i.1145, align 16, !tbaa !11
%time6.us.i.1.1.promoted = load double, ptr %time6.us.i.1.1, align 8, !tbaa !5
%arrayidx5.us.i.1.1.promoted = load i32, ptr %arrayidx5.us.i.1.1, align 16, !tbaa !11
%time6.us.i.2.1.promoted = load double, ptr %time6.us.i.2.1, align 8, !tbaa !5
%arrayidx5.us.i.2.1.promoted = load i32, ptr %arrayidx5.us.i.2.1, align 16, !tbaa !11
%time6.us.i.3.1.promoted = load double, ptr %time6.us.i.3.1, align 8, !tbaa !5
%arrayidx5.us.i.3.1.promoted = load i32, ptr %arrayidx5.us.i.3.1, align 16, !tbaa !11
%time6.us.i.4.1.promoted = load double, ptr %time6.us.i.4.1, align 8, !tbaa !5
%arrayidx5.us.i.4.1.promoted = load i32, ptr %arrayidx5.us.i.4.1, align 16, !tbaa !11
%time6.us.i.5.1.promoted = load double, ptr %time6.us.i.5.1, align 8, !tbaa !5
%arrayidx5.us.i.5.1.promoted = load i32, ptr %arrayidx5.us.i.5.1, align 16, !tbaa !11
%time6.us.i.6.1.promoted = load double, ptr %time6.us.i.6.1, align 8, !tbaa !5
%arrayidx5.us.i.6.1.promoted = load i32, ptr %arrayidx5.us.i.6.1, align 16, !tbaa !11
br label %for.cond1.preheader.us.i.1
for.cond1.preheader.us.i.1: ; preds = %for.inc.us.i.6.1, %bsort.exit
%43 = phi i32 [ %81, %for.inc.us.i.6.1 ], [ %arrayidx5.us.i.6.1.promoted, %bsort.exit ]
%44 = phi double [ %82, %for.inc.us.i.6.1 ], [ %time6.us.i.6.1.promoted, %bsort.exit ]
%45 = phi i32 [ %83, %for.inc.us.i.6.1 ], [ %arrayidx5.us.i.5.1.promoted, %bsort.exit ]
%46 = phi double [ %84, %for.inc.us.i.6.1 ], [ %time6.us.i.5.1.promoted, %bsort.exit ]
%47 = phi i32 [ %79, %for.inc.us.i.6.1 ], [ %arrayidx5.us.i.4.1.promoted, %bsort.exit ]
%48 = phi double [ %80, %for.inc.us.i.6.1 ], [ %time6.us.i.4.1.promoted, %bsort.exit ]
%49 = phi i32 [ %75, %for.inc.us.i.6.1 ], [ %arrayidx5.us.i.3.1.promoted, %bsort.exit ]
%50 = phi double [ %76, %for.inc.us.i.6.1 ], [ %time6.us.i.3.1.promoted, %bsort.exit ]
%51 = phi i32 [ %71, %for.inc.us.i.6.1 ], [ %arrayidx5.us.i.2.1.promoted, %bsort.exit ]
%52 = phi double [ %72, %for.inc.us.i.6.1 ], [ %time6.us.i.2.1.promoted, %bsort.exit ]
%53 = phi i32 [ %67, %for.inc.us.i.6.1 ], [ %arrayidx5.us.i.1.1.promoted, %bsort.exit ]
%54 = phi double [ %68, %for.inc.us.i.6.1 ], [ %time6.us.i.1.1.promoted, %bsort.exit ]
%55 = phi i32 [ %63, %for.inc.us.i.6.1 ], [ %arrayidx5.us.i.1145.promoted, %bsort.exit ]
%56 = phi i32 [ %59, %for.inc.us.i.6.1 ], [ %arrayidx5.1135.promoted, %bsort.exit ]
%57 = phi double [ %64, %for.inc.us.i.6.1 ], [ %.pre173, %bsort.exit ]
%.pre.i.1 = phi double [ %.pre.i.1171, %for.inc.us.i.6.1 ], [ %.pre.i.1.pre, %bsort.exit ]
%k.063.us.i.1 = phi i32 [ %inc36.us.i.1, %for.inc.us.i.6.1 ], [ 0, %bsort.exit ]
%cmp7.us.i.1143 = fcmp ogt double %.pre.i.1, %57
br i1 %cmp7.us.i.1143, label %if.then.us.i.1146, label %for.inc.us.i.1147
if.then.us.i.1146: ; preds = %for.cond1.preheader.us.i.1
store i32 %55, ptr %arrayidx5.1135, align 16, !tbaa !11
store i32 %56, ptr %arrayidx5.us.i.1145, align 16, !tbaa !11
store double %57, ptr %time.us.phi.trans.insert.i.1, align 8, !tbaa !5
store double %.pre.i.1, ptr %time6.us.i.1142.phi.trans.insert, align 8, !tbaa !5
br label %for.inc.us.i.1147
for.inc.us.i.1147: ; preds = %if.then.us.i.1146, %for.cond1.preheader.us.i.1
%58 = phi i32 [ %56, %if.then.us.i.1146 ], [ %55, %for.cond1.preheader.us.i.1 ]
%59 = phi i32 [ %55, %if.then.us.i.1146 ], [ %56, %for.cond1.preheader.us.i.1 ]
%60 = phi double [ %.pre.i.1, %if.then.us.i.1146 ], [ %57, %for.cond1.preheader.us.i.1 ]
%.pre.i.1171 = phi double [ %57, %if.then.us.i.1146 ], [ %.pre.i.1, %for.cond1.preheader.us.i.1 ]
%cmp7.us.i.1.1 = fcmp ogt double %60, %54
br i1 %cmp7.us.i.1.1, label %if.then.us.i.1.1, label %for.inc.us.i.1.1
if.then.us.i.1.1: ; preds = %for.inc.us.i.1147
store i32 %53, ptr %arrayidx.us.i.1.1, align 16, !tbaa !11
store i32 %58, ptr %arrayidx5.us.i.1.1, align 16, !tbaa !11
store double %54, ptr %time6.us.i.1142.phi.trans.insert, align 8, !tbaa !5
store double %60, ptr %time6.us.i.1.1, align 8, !tbaa !5
br label %for.inc.us.i.1.1
for.inc.us.i.1.1: ; preds = %if.then.us.i.1.1, %for.inc.us.i.1147
%61 = phi i32 [ %58, %if.then.us.i.1.1 ], [ %53, %for.inc.us.i.1147 ]
%62 = phi double [ %60, %if.then.us.i.1.1 ], [ %54, %for.inc.us.i.1147 ]
%63 = phi i32 [ %53, %if.then.us.i.1.1 ], [ %58, %for.inc.us.i.1147 ]
%64 = phi double [ %54, %if.then.us.i.1.1 ], [ %60, %for.inc.us.i.1147 ]
%cmp7.us.i.2.1 = fcmp ogt double %62, %52
br i1 %cmp7.us.i.2.1, label %if.then.us.i.2.1, label %for.inc.us.i.2.1
if.then.us.i.2.1: ; preds = %for.inc.us.i.1.1
store i32 %51, ptr %arrayidx.us.i.2.1, align 16, !tbaa !11
store i32 %61, ptr %arrayidx5.us.i.2.1, align 16, !tbaa !11
store double %52, ptr %time6.us.i.1.1, align 8, !tbaa !5
store double %62, ptr %time6.us.i.2.1, align 8, !tbaa !5
br label %for.inc.us.i.2.1
for.inc.us.i.2.1: ; preds = %if.then.us.i.2.1, %for.inc.us.i.1.1
%65 = phi i32 [ %61, %if.then.us.i.2.1 ], [ %51, %for.inc.us.i.1.1 ]
%66 = phi double [ %62, %if.then.us.i.2.1 ], [ %52, %for.inc.us.i.1.1 ]
%67 = phi i32 [ %51, %if.then.us.i.2.1 ], [ %61, %for.inc.us.i.1.1 ]
%68 = phi double [ %52, %if.then.us.i.2.1 ], [ %62, %for.inc.us.i.1.1 ]
%cmp7.us.i.3.1 = fcmp ogt double %66, %50
br i1 %cmp7.us.i.3.1, label %if.then.us.i.3.1, label %for.inc.us.i.3.1
if.then.us.i.3.1: ; preds = %for.inc.us.i.2.1
store i32 %49, ptr %arrayidx.us.i.3.1, align 16, !tbaa !11
store i32 %65, ptr %arrayidx5.us.i.3.1, align 16, !tbaa !11
store double %50, ptr %time6.us.i.2.1, align 8, !tbaa !5
store double %66, ptr %time6.us.i.3.1, align 8, !tbaa !5
br label %for.inc.us.i.3.1
for.inc.us.i.3.1: ; preds = %if.then.us.i.3.1, %for.inc.us.i.2.1
%69 = phi i32 [ %65, %if.then.us.i.3.1 ], [ %49, %for.inc.us.i.2.1 ]
%70 = phi double [ %66, %if.then.us.i.3.1 ], [ %50, %for.inc.us.i.2.1 ]
%71 = phi i32 [ %49, %if.then.us.i.3.1 ], [ %65, %for.inc.us.i.2.1 ]
%72 = phi double [ %50, %if.then.us.i.3.1 ], [ %66, %for.inc.us.i.2.1 ]
%cmp7.us.i.4.1 = fcmp ogt double %70, %48
br i1 %cmp7.us.i.4.1, label %if.then.us.i.4.1, label %for.inc.us.i.4.1
if.then.us.i.4.1: ; preds = %for.inc.us.i.3.1
store i32 %47, ptr %arrayidx.us.i.4.1, align 16, !tbaa !11
store i32 %69, ptr %arrayidx5.us.i.4.1, align 16, !tbaa !11
store double %48, ptr %time6.us.i.3.1, align 8, !tbaa !5
store double %70, ptr %time6.us.i.4.1, align 8, !tbaa !5
br label %for.inc.us.i.4.1
for.inc.us.i.4.1: ; preds = %if.then.us.i.4.1, %for.inc.us.i.3.1
%73 = phi i32 [ %69, %if.then.us.i.4.1 ], [ %47, %for.inc.us.i.3.1 ]
%74 = phi double [ %70, %if.then.us.i.4.1 ], [ %48, %for.inc.us.i.3.1 ]
%75 = phi i32 [ %47, %if.then.us.i.4.1 ], [ %69, %for.inc.us.i.3.1 ]
%76 = phi double [ %48, %if.then.us.i.4.1 ], [ %70, %for.inc.us.i.3.1 ]
%cmp7.us.i.5.1 = fcmp ogt double %74, %46
br i1 %cmp7.us.i.5.1, label %if.then.us.i.5.1, label %for.inc.us.i.5.1
if.then.us.i.5.1: ; preds = %for.inc.us.i.4.1
store i32 %45, ptr %arrayidx.us.i.5.1, align 16, !tbaa !11
store i32 %73, ptr %arrayidx5.us.i.5.1, align 16, !tbaa !11
store double %46, ptr %time6.us.i.4.1, align 8, !tbaa !5
store double %74, ptr %time6.us.i.5.1, align 8, !tbaa !5
br label %for.inc.us.i.5.1
for.inc.us.i.5.1: ; preds = %if.then.us.i.5.1, %for.inc.us.i.4.1
%77 = phi i32 [ %73, %if.then.us.i.5.1 ], [ %45, %for.inc.us.i.4.1 ]
%78 = phi double [ %74, %if.then.us.i.5.1 ], [ %46, %for.inc.us.i.4.1 ]
%79 = phi i32 [ %45, %if.then.us.i.5.1 ], [ %73, %for.inc.us.i.4.1 ]
%80 = phi double [ %46, %if.then.us.i.5.1 ], [ %74, %for.inc.us.i.4.1 ]
%cmp7.us.i.6.1 = fcmp ogt double %78, %44
br i1 %cmp7.us.i.6.1, label %if.then.us.i.6.1, label %for.inc.us.i.6.1
if.then.us.i.6.1: ; preds = %for.inc.us.i.5.1
store i32 %43, ptr %arrayidx.us.i.6.1, align 16, !tbaa !11
store i32 %77, ptr %arrayidx5.us.i.6.1, align 16, !tbaa !11
store double %44, ptr %time6.us.i.5.1, align 8, !tbaa !5
store double %78, ptr %time6.us.i.6.1, align 8, !tbaa !5
br label %for.inc.us.i.6.1
for.inc.us.i.6.1: ; preds = %if.then.us.i.6.1, %for.inc.us.i.5.1
%81 = phi i32 [ %77, %if.then.us.i.6.1 ], [ %43, %for.inc.us.i.5.1 ]
%82 = phi double [ %78, %if.then.us.i.6.1 ], [ %44, %for.inc.us.i.5.1 ]
%83 = phi i32 [ %43, %if.then.us.i.6.1 ], [ %77, %for.inc.us.i.5.1 ]
%84 = phi double [ %44, %if.then.us.i.6.1 ], [ %78, %for.inc.us.i.5.1 ]
%inc36.us.i.1 = add nuw nsw i32 %k.063.us.i.1, 1
%exitcond66.not.i.1 = icmp eq i32 %inc36.us.i.1, 8
br i1 %exitcond66.not.i.1, label %bsort.exit.1, label %for.cond1.preheader.us.i.1, !llvm.loop !14
bsort.exit.1: ; preds = %for.inc.us.i.6.1
%time.us.phi.trans.insert.i.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 0, i32 1
%.pre.i.2.pre = load double, ptr %time.us.phi.trans.insert.i.2, align 8, !tbaa !5
%time6.us.i.2148.phi.trans.insert = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 1, i32 1
%.pre176 = load double, ptr %time6.us.i.2148.phi.trans.insert, align 8, !tbaa !5
%arrayidx5.us.i.2151 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 1
%time6.us.i.1.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 2, i32 1
%arrayidx5.us.i.1.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 2
%arrayidx.us.i.1.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 1
%time6.us.i.2.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 3, i32 1
%arrayidx5.us.i.2.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 3
%arrayidx.us.i.2.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 2
%time6.us.i.3.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 4, i32 1
%arrayidx5.us.i.3.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 4
%arrayidx.us.i.3.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 3
%time6.us.i.4.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 5, i32 1
%arrayidx5.us.i.4.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 5
%arrayidx.us.i.4.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 4
%time6.us.i.5.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 6, i32 1
%arrayidx5.us.i.5.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 6
%arrayidx.us.i.5.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 5
%time6.us.i.6.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 7, i32 1
%arrayidx5.us.i.6.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 7
%arrayidx.us.i.6.2 = getelementptr inbounds [3 x [8 x %struct.data]], ptr %n, i64 0, i64 2, i64 6
%arrayidx5.2138.promoted = load i32, ptr %arrayidx5.2138, align 16, !tbaa !11
%arrayidx5.us.i.2151.promoted = load i32, ptr %arrayidx5.us.i.2151, align 16, !tbaa !11
%time6.us.i.1.2.promoted = load double, ptr %time6.us.i.1.2, align 8, !tbaa !5
%arrayidx5.us.i.1.2.promoted = load i32, ptr %arrayidx5.us.i.1.2, align 16, !tbaa !11
%time6.us.i.2.2.promoted = load double, ptr %time6.us.i.2.2, align 8, !tbaa !5
%arrayidx5.us.i.2.2.promoted = load i32, ptr %arrayidx5.us.i.2.2, align 16, !tbaa !11
%time6.us.i.3.2.promoted = load double, ptr %time6.us.i.3.2, align 8, !tbaa !5
%arrayidx5.us.i.3.2.promoted = load i32, ptr %arrayidx5.us.i.3.2, align 16, !tbaa !11
%time6.us.i.4.2.promoted = load double, ptr %time6.us.i.4.2, align 8, !tbaa !5
%arrayidx5.us.i.4.2.promoted = load i32, ptr %arrayidx5.us.i.4.2, align 16, !tbaa !11
%time6.us.i.5.2.promoted = load double, ptr %time6.us.i.5.2, align 8, !tbaa !5
%arrayidx5.us.i.5.2.promoted = load i32, ptr %arrayidx5.us.i.5.2, align 16, !tbaa !11
%time6.us.i.6.2.promoted = load double, ptr %time6.us.i.6.2, align 8, !tbaa !5
%arrayidx5.us.i.6.2.promoted = load i32, ptr %arrayidx5.us.i.6.2, align 16, !tbaa !11
br label %for.cond1.preheader.us.i.2
for.cond1.preheader.us.i.2: ; preds = %for.inc.us.i.6.2, %bsort.exit.1
%85 = phi i32 [ %123, %for.inc.us.i.6.2 ], [ %arrayidx5.us.i.6.2.promoted, %bsort.exit.1 ]
%86 = phi double [ %124, %for.inc.us.i.6.2 ], [ %time6.us.i.6.2.promoted, %bsort.exit.1 ]
%87 = phi i32 [ %125, %for.inc.us.i.6.2 ], [ %arrayidx5.us.i.5.2.promoted, %bsort.exit.1 ]
%88 = phi double [ %126, %for.inc.us.i.6.2 ], [ %time6.us.i.5.2.promoted, %bsort.exit.1 ]
%89 = phi i32 [ %121, %for.inc.us.i.6.2 ], [ %arrayidx5.us.i.4.2.promoted, %bsort.exit.1 ]
%90 = phi double [ %122, %for.inc.us.i.6.2 ], [ %time6.us.i.4.2.promoted, %bsort.exit.1 ]
%91 = phi i32 [ %117, %for.inc.us.i.6.2 ], [ %arrayidx5.us.i.3.2.promoted, %bsort.exit.1 ]
%92 = phi double [ %118, %for.inc.us.i.6.2 ], [ %time6.us.i.3.2.promoted, %bsort.exit.1 ]
%93 = phi i32 [ %113, %for.inc.us.i.6.2 ], [ %arrayidx5.us.i.2.2.promoted, %bsort.exit.1 ]
%94 = phi double [ %114, %for.inc.us.i.6.2 ], [ %time6.us.i.2.2.promoted, %bsort.exit.1 ]
%95 = phi i32 [ %109, %for.inc.us.i.6.2 ], [ %arrayidx5.us.i.1.2.promoted, %bsort.exit.1 ]
%96 = phi double [ %110, %for.inc.us.i.6.2 ], [ %time6.us.i.1.2.promoted, %bsort.exit.1 ]
%97 = phi i32 [ %105, %for.inc.us.i.6.2 ], [ %arrayidx5.us.i.2151.promoted, %bsort.exit.1 ]
%98 = phi i32 [ %101, %for.inc.us.i.6.2 ], [ %arrayidx5.2138.promoted, %bsort.exit.1 ]
%99 = phi double [ %106, %for.inc.us.i.6.2 ], [ %.pre176, %bsort.exit.1 ]
%.pre.i.2 = phi double [ %.pre.i.2174, %for.inc.us.i.6.2 ], [ %.pre.i.2.pre, %bsort.exit.1 ]
%k.063.us.i.2 = phi i32 [ %inc36.us.i.2, %for.inc.us.i.6.2 ], [ 0, %bsort.exit.1 ]
%cmp7.us.i.2149 = fcmp ogt double %.pre.i.2, %99
br i1 %cmp7.us.i.2149, label %if.then.us.i.2152, label %for.inc.us.i.2153
if.then.us.i.2152: ; preds = %for.cond1.preheader.us.i.2
store i32 %97, ptr %arrayidx5.2138, align 16, !tbaa !11
store i32 %98, ptr %arrayidx5.us.i.2151, align 16, !tbaa !11
store double %99, ptr %time.us.phi.trans.insert.i.2, align 8, !tbaa !5
store double %.pre.i.2, ptr %time6.us.i.2148.phi.trans.insert, align 8, !tbaa !5
br label %for.inc.us.i.2153
for.inc.us.i.2153: ; preds = %if.then.us.i.2152, %for.cond1.preheader.us.i.2
%100 = phi i32 [ %98, %if.then.us.i.2152 ], [ %97, %for.cond1.preheader.us.i.2 ]
%101 = phi i32 [ %97, %if.then.us.i.2152 ], [ %98, %for.cond1.preheader.us.i.2 ]
%102 = phi double [ %.pre.i.2, %if.then.us.i.2152 ], [ %99, %for.cond1.preheader.us.i.2 ]
%.pre.i.2174 = phi double [ %99, %if.then.us.i.2152 ], [ %.pre.i.2, %for.cond1.preheader.us.i.2 ]
%cmp7.us.i.1.2 = fcmp ogt double %102, %96
br i1 %cmp7.us.i.1.2, label %if.then.us.i.1.2, label %for.inc.us.i.1.2
if.then.us.i.1.2: ; preds = %for.inc.us.i.2153
store i32 %95, ptr %arrayidx.us.i.1.2, align 16, !tbaa !11
store i32 %100, ptr %arrayidx5.us.i.1.2, align 16, !tbaa !11
store double %96, ptr %time6.us.i.2148.phi.trans.insert, align 8, !tbaa !5
store double %102, ptr %time6.us.i.1.2, align 8, !tbaa !5
br label %for.inc.us.i.1.2
for.inc.us.i.1.2: ; preds = %if.then.us.i.1.2, %for.inc.us.i.2153
%103 = phi i32 [ %100, %if.then.us.i.1.2 ], [ %95, %for.inc.us.i.2153 ]
%104 = phi double [ %102, %if.then.us.i.1.2 ], [ %96, %for.inc.us.i.2153 ]
%105 = phi i32 [ %95, %if.then.us.i.1.2 ], [ %100, %for.inc.us.i.2153 ]
%106 = phi double [ %96, %if.then.us.i.1.2 ], [ %102, %for.inc.us.i.2153 ]
%cmp7.us.i.2.2 = fcmp ogt double %104, %94
br i1 %cmp7.us.i.2.2, label %if.then.us.i.2.2, label %for.inc.us.i.2.2
if.then.us.i.2.2: ; preds = %for.inc.us.i.1.2
store i32 %93, ptr %arrayidx.us.i.2.2, align 16, !tbaa !11
store i32 %103, ptr %arrayidx5.us.i.2.2, align 16, !tbaa !11
store double %94, ptr %time6.us.i.1.2, align 8, !tbaa !5
store double %104, ptr %time6.us.i.2.2, align 8, !tbaa !5
br label %for.inc.us.i.2.2
for.inc.us.i.2.2: ; preds = %if.then.us.i.2.2, %for.inc.us.i.1.2
%107 = phi i32 [ %103, %if.then.us.i.2.2 ], [ %93, %for.inc.us.i.1.2 ]
%108 = phi double [ %104, %if.then.us.i.2.2 ], [ %94, %for.inc.us.i.1.2 ]
%109 = phi i32 [ %93, %if.then.us.i.2.2 ], [ %103, %for.inc.us.i.1.2 ]
%110 = phi double [ %94, %if.then.us.i.2.2 ], [ %104, %for.inc.us.i.1.2 ]
%cmp7.us.i.3.2 = fcmp ogt double %108, %92
br i1 %cmp7.us.i.3.2, label %if.then.us.i.3.2, label %for.inc.us.i.3.2
if.then.us.i.3.2: ; preds = %for.inc.us.i.2.2
store i32 %91, ptr %arrayidx.us.i.3.2, align 16, !tbaa !11
store i32 %107, ptr %arrayidx5.us.i.3.2, align 16, !tbaa !11
store double %92, ptr %time6.us.i.2.2, align 8, !tbaa !5
store double %108, ptr %time6.us.i.3.2, align 8, !tbaa !5
br label %for.inc.us.i.3.2
for.inc.us.i.3.2: ; preds = %if.then.us.i.3.2, %for.inc.us.i.2.2
%111 = phi i32 [ %107, %if.then.us.i.3.2 ], [ %91, %for.inc.us.i.2.2 ]
%112 = phi double [ %108, %if.then.us.i.3.2 ], [ %92, %for.inc.us.i.2.2 ]
%113 = phi i32 [ %91, %if.then.us.i.3.2 ], [ %107, %for.inc.us.i.2.2 ]
%114 = phi double [ %92, %if.then.us.i.3.2 ], [ %108, %for.inc.us.i.2.2 ]
%cmp7.us.i.4.2 = fcmp ogt double %112, %90
br i1 %cmp7.us.i.4.2, label %if.then.us.i.4.2, label %for.inc.us.i.4.2
if.then.us.i.4.2: ; preds = %for.inc.us.i.3.2
store i32 %89, ptr %arrayidx.us.i.4.2, align 16, !tbaa !11
store i32 %111, ptr %arrayidx5.us.i.4.2, align 16, !tbaa !11
store double %90, ptr %time6.us.i.3.2, align 8, !tbaa !5
store double %112, ptr %time6.us.i.4.2, align 8, !tbaa !5
br label %for.inc.us.i.4.2
for.inc.us.i.4.2: ; preds = %if.then.us.i.4.2, %for.inc.us.i.3.2
%115 = phi i32 [ %111, %if.then.us.i.4.2 ], [ %89, %for.inc.us.i.3.2 ]
%116 = phi double [ %112, %if.then.us.i.4.2 ], [ %90, %for.inc.us.i.3.2 ]
%117 = phi i32 [ %89, %if.then.us.i.4.2 ], [ %111, %for.inc.us.i.3.2 ]
%118 = phi double [ %90, %if.then.us.i.4.2 ], [ %112, %for.inc.us.i.3.2 ]
%cmp7.us.i.5.2 = fcmp ogt double %116, %88
br i1 %cmp7.us.i.5.2, label %if.then.us.i.5.2, label %for.inc.us.i.5.2
if.then.us.i.5.2: ; preds = %for.inc.us.i.4.2
store i32 %87, ptr %arrayidx.us.i.5.2, align 16, !tbaa !11
store i32 %115, ptr %arrayidx5.us.i.5.2, align 16, !tbaa !11
store double %88, ptr %time6.us.i.4.2, align 8, !tbaa !5
store double %116, ptr %time6.us.i.5.2, align 8, !tbaa !5
br label %for.inc.us.i.5.2
for.inc.us.i.5.2: ; preds = %if.then.us.i.5.2, %for.inc.us.i.4.2
%119 = phi i32 [ %115, %if.then.us.i.5.2 ], [ %87, %for.inc.us.i.4.2 ]
%120 = phi double [ %116, %if.then.us.i.5.2 ], [ %88, %for.inc.us.i.4.2 ]
%121 = phi i32 [ %87, %if.then.us.i.5.2 ], [ %115, %for.inc.us.i.4.2 ]
%122 = phi double [ %88, %if.then.us.i.5.2 ], [ %116, %for.inc.us.i.4.2 ]
%cmp7.us.i.6.2 = fcmp ogt double %120, %86
br i1 %cmp7.us.i.6.2, label %if.then.us.i.6.2, label %for.inc.us.i.6.2
if.then.us.i.6.2: ; preds = %for.inc.us.i.5.2
store i32 %85, ptr %arrayidx.us.i.6.2, align 16, !tbaa !11
store i32 %119, ptr %arrayidx5.us.i.6.2, align 16, !tbaa !11
store double %86, ptr %time6.us.i.5.2, align 8, !tbaa !5
store double %120, ptr %time6.us.i.6.2, align 8, !tbaa !5
br label %for.inc.us.i.6.2
for.inc.us.i.6.2: ; preds = %if.then.us.i.6.2, %for.inc.us.i.5.2
%123 = phi i32 [ %119, %if.then.us.i.6.2 ], [ %85, %for.inc.us.i.5.2 ]
%124 = phi double [ %120, %if.then.us.i.6.2 ], [ %86, %for.inc.us.i.5.2 ]
%125 = phi i32 [ %85, %if.then.us.i.6.2 ], [ %119, %for.inc.us.i.5.2 ]
%126 = phi double [ %86, %if.then.us.i.6.2 ], [ %120, %for.inc.us.i.5.2 ]
%inc36.us.i.2 = add nuw nsw i32 %k.063.us.i.2, 1
%exitcond66.not.i.2 = icmp eq i32 %inc36.us.i.2, 8
br i1 %exitcond66.not.i.2, label %bsort.exit.2, label %for.cond1.preheader.us.i.2, !llvm.loop !14
bsort.exit.2: ; preds = %for.inc.us.i.6.2
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(96) %judge, ptr noundef nonnull align 16 dereferenceable(96) %arrayidx5.2, i64 96, i1 false)
%scevgep.1 = getelementptr inbounds i8, ptr %judge, i64 96
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(96) %scevgep.1, ptr noundef nonnull align 16 dereferenceable(96) %arrayidx5.2.1, i64 96, i1 false)
%scevgep.2 = getelementptr inbounds i8, ptr %judge, i64 192
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(96) %scevgep.2, ptr noundef nonnull align 16 dereferenceable(96) %arrayidx5.2.2, i64 96, i1 false)
%time.us.phi.trans.insert.i104 = getelementptr inbounds %struct.data, ptr %judge, i64 0, i32 1
br label %for.cond1.preheader.us.i105
for.cond1.preheader.us.i105: ; preds = %for.cond1.for.inc35_crit_edge.us.i115, %bsort.exit.2
%k.063.us.i106 = phi i32 [ %inc36.us.i116, %for.cond1.for.inc35_crit_edge.us.i115 ], [ 0, %bsort.exit.2 ]
%.pre.i107 = load double, ptr %time.us.phi.trans.insert.i104, align 8, !tbaa !5
br label %for.body3.us.i108
for.body3.us.i108: ; preds = %for.inc.us.i113, %for.cond1.preheader.us.i105
%127 = phi double [ %.pre.i107, %for.cond1.preheader.us.i105 ], [ %131, %for.inc.us.i113 ]
%indvars.iv.i109 = phi i64 [ 0, %for.cond1.preheader.us.i105 ], [ %indvars.iv.next.i110, %for.inc.us.i113 ]
%indvars.iv.next.i110 = add nuw nsw i64 %indvars.iv.i109, 1
%time6.us.i111 = getelementptr inbounds %struct.data, ptr %judge, i64 %indvars.iv.next.i110, i32 1
%128 = load double, ptr %time6.us.i111, align 8, !tbaa !5
%cmp7.us.i112 = fcmp ogt double %127, %128
br i1 %cmp7.us.i112, label %if.then.us.i118, label %for.inc.us.i113
if.then.us.i118: ; preds = %for.body3.us.i108
%time.us.i119 = getelementptr inbounds %struct.data, ptr %judge, i64 %indvars.iv.i109, i32 1
%arrayidx5.us.i120 = getelementptr inbounds %struct.data, ptr %judge, i64 %indvars.iv.next.i110
%arrayidx.us.i121 = getelementptr inbounds %struct.data, ptr %judge, i64 %indvars.iv.i109
%129 = load i32, ptr %arrayidx.us.i121, align 16, !tbaa !11
%130 = load i32, ptr %arrayidx5.us.i120, align 16, !tbaa !11
store i32 %130, ptr %arrayidx.us.i121, align 16, !tbaa !11
store i32 %129, ptr %arrayidx5.us.i120, align 16, !tbaa !11
store double %128, ptr %time.us.i119, align 8, !tbaa !5
store double %127, ptr %time6.us.i111, align 8, !tbaa !5
br label %for.inc.us.i113
for.inc.us.i113: ; preds = %if.then.us.i118, %for.body3.us.i108
%131 = phi double [ %127, %if.then.us.i118 ], [ %128, %for.body3.us.i108 ]
%exitcond.not.i114 = icmp eq i64 %indvars.iv.next.i110, 17
br i1 %exitcond.not.i114, label %for.cond1.for.inc35_crit_edge.us.i115, label %for.body3.us.i108, !llvm.loop !12
for.cond1.for.inc35_crit_edge.us.i115: ; preds = %for.inc.us.i113
%inc36.us.i116 = add nuw nsw i32 %k.063.us.i106, 1
%exitcond66.not.i117 = icmp eq i32 %inc36.us.i116, 18
br i1 %exitcond66.not.i117, label %for.cond44.preheader.preheader, label %for.cond1.preheader.us.i105, !llvm.loop !14
for.cond44.preheader.preheader: ; preds = %for.cond1.for.inc35_crit_edge.us.i115
%132 = load i32, ptr %n, align 16, !tbaa !11
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %132, double noundef %18)
%133 = load i32, ptr %arrayidx5.1, align 16, !tbaa !11
%134 = load double, ptr %time.1, align 8, !tbaa !5
%call57.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %133, double noundef %134)
%135 = load i32, ptr %arrayidx5.1135, align 16, !tbaa !11
%136 = load double, ptr %time.1136, align 8, !tbaa !5
%call57.1167 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %135, double noundef %136)
%137 = load i32, ptr %arrayidx5.1.1, align 16, !tbaa !11
%138 = load double, ptr %time.1.1, align 8, !tbaa !5
%call57.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %137, double noundef %138)
%139 = load i32, ptr %arrayidx5.2138, align 16, !tbaa !11
%140 = load double, ptr %time.2139, align 8, !tbaa !5
%call57.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %139, double noundef %140)
%141 = load i32, ptr %arrayidx5.1.2, align 16, !tbaa !11
%142 = load double, ptr %time.1.2, align 8, !tbaa !5
%call57.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %141, double noundef %142)
%143 = load i32, ptr %judge, align 16, !tbaa !11
%144 = load double, ptr %time.us.phi.trans.insert.i104, align 8, !tbaa !5
%call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %143, double noundef %144)
%arrayidx68.1 = getelementptr inbounds [18 x %struct.data], ptr %judge, i64 0, i64 1
%145 = load i32, ptr %arrayidx68.1, align 16, !tbaa !11
%time72.1 = getelementptr inbounds [18 x %struct.data], ptr %judge, i64 0, i64 1, i32 1
%146 = load double, ptr %time72.1, align 8, !tbaa !5
%call73.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %145, double noundef %146)
call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %judge) #5
call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 8}
!6 = !{!"", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
|
// Aizu Vol-2 0238: Time to Study
// 2017.8.7
#include <stdio.h>
int main()
{
int t, n, s, f;
int i, sm;
while (1) {
scanf("%d", &t);
if (t == 0) break;
scanf("%d", &n);
for (sm = i = 0; i < n; i++) {
scanf("%d%d", &s, &f);
sm += f - s;
}
if (sm >= t) puts("OK");
else printf("%d\n", t - sm);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274352/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274352/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"OK\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
%s = alloca i32, align 4
%f = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp17 = icmp eq i32 %0, 0
br i1 %cmp17, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end9
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp213 = icmp sgt i32 %1, 0
br i1 %cmp213, label %for.body, label %for.end
for.body: ; preds = %if.end, %for.body
%sm.015 = phi i32 [ %add, %for.body ], [ 0, %if.end ]
%i.014 = phi i32 [ %inc, %for.body ], [ 0, %if.end ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %f)
%2 = load i32, ptr %f, align 4, !tbaa !5
%3 = load i32, ptr %s, align 4, !tbaa !5
%sub = add i32 %2, %sm.015
%add = sub i32 %sub, %3
%inc = add nuw nsw i32 %i.014, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc, %4
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %if.end
%sm.0.lcssa = phi i32 [ 0, %if.end ], [ %add, %for.body ]
%5 = load i32, ptr %t, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %sm.0.lcssa, %5
br i1 %cmp4.not, label %if.else, label %if.then5
if.then5: ; preds = %for.end
%call6 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end9
if.else: ; preds = %for.end
%sub7 = sub nsw i32 %5, %sm.0.lcssa
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub7)
br label %if.end9
if.end9: ; preds = %if.else, %if.then5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%6 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %if.end9, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<time.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define INI(n) scanf("%d",&n)
#define INL(n) scanf("%lld",&n)
#define INF 10000000000
#define mod 1000000007
#define X 100000
#define N 20
#define M 46
typedef long long int ll;
ll finv[X];
ll fac[X];
ll inv[X];
ll usort(const void *a, const void *b){return *(ll*)a-*(ll*)b;}
ll dsort(const void *a, const void *b){return *(ll*)b-*(ll*)a;}
ll ssort(const void *a, const void *b){return strcmp((char*)a,(char*)b);}
void Iswap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
void Fswap(double *a,double *b){
double t=*a;
*a=*b;
*b=t;
}
void Lswap(ll *a,ll *b){
ll t=*a;
*a=*b;
*b=t;
}
ll min(ll a,ll b){
if(a>b)return b;
return a;
}
ll max(ll a,ll b){
if(a>b)return a;
return b;
}
ll z(ll a){return max(a,-a);}
ll gcd(ll a,ll b){if(!b){return a;}else{return gcd(b,a%b);}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll kt(ll a){
ll sum=0;
while(a){
a/=10;
sum++;
}
return sum;
}
ll ks(ll a){
ll sum=0;
while(a){
sum+=a%10;
a/=10;
}
return sum;
}
void nCrReady(){
fac[0]=fac[1]=1;
finv[0]=finv[1]=1;
inv[1]=1;
for (ll i=2;i<X;i++){
fac[i]=fac[i-1]*i%mod;
inv[i]=mod-inv[mod%i]*(mod/i)%mod;
finv[i]=finv[i-1]*inv[i]%mod;
}
}
ll nCr(ll n,ll k){return fac[n]*(finv[k]*finv[n-k]%mod)%mod;}
ll modpow(ll a,ll n){
ll res=1;
while(n>0){
if(n&1)res=res*a%mod;
a=a*a%mod;
n>>=1;
}
return res;
}
int main(void){
ll a;
INL(a);
int ans=0;
ll i=100;
while(1){
ans++;
i+=i/100;
if(i>=a)break;
}
PRN(ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274396/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274396/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@fac = dso_local local_unnamed_addr global [100000 x i64] zeroinitializer, align 16
@finv = dso_local local_unnamed_addr global [100000 x i64] zeroinitializer, align 16
@inv = dso_local local_unnamed_addr global [100000 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i64 @usort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
ret i64 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i64 @dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
ret i64 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i64 @ssort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #12
%conv = sext i32 %call to i64
ret i64 %conv
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @Iswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !9
%1 = load i32, ptr %b, align 4, !tbaa !9
store i32 %1, ptr %a, align 4, !tbaa !9
store i32 %0, ptr %b, align 4, !tbaa !9
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @Fswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !11
%1 = load double, ptr %b, align 8, !tbaa !11
store double %1, ptr %a, align 8, !tbaa !11
store double %0, ptr %b, align 8, !tbaa !11
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @Lswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 {
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 nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 {
entry:
%b.a = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %b.a
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @z(i64 noundef %a) local_unnamed_addr #5 {
entry:
%a.b.i = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %a.b.i
}
; 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 %return, label %if.else
if.else: ; preds = %entry, %if.else
%b.tr6 = phi i64 [ %rem, %if.else ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %if.else ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %return, label %if.else
return: ; preds = %if.else, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %if.else ]
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 %if.else.i
if.else.i: ; preds = %entry, %if.else.i
%b.tr6.i = phi i64 [ %rem.i, %if.else.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %if.else.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 %if.else.i
gcd.exit: ; preds = %if.else.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %if.else.i ]
%mul = mul nsw i64 %b, %a
%div = sdiv i64 %mul, %a.tr.lcssa.i
ret i64 %div
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @kt(i64 noundef %a) local_unnamed_addr #6 {
entry:
%tobool.not3 = icmp eq i64 %a, 0
br i1 %tobool.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%sum.05 = phi i64 [ %inc, %while.body ], [ 0, %entry ]
%a.addr.04 = phi i64 [ %div, %while.body ], [ %a, %entry ]
%div = sdiv i64 %a.addr.04, 10
%inc = add nuw nsw i64 %sum.05, 1
%a.addr.04.off = add i64 %a.addr.04, 9
%tobool.not = icmp ult i64 %a.addr.04.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %while.body, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %inc, %while.body ]
ret i64 %sum.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @ks(i64 noundef %a) local_unnamed_addr #6 {
entry:
%tobool.not4 = icmp eq i64 %a, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%sum.06 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%a.addr.05 = phi i64 [ %div, %while.body ], [ %a, %entry ]
%rem = srem i64 %a.addr.05, 10
%add = add nsw i64 %sum.06, %rem
%div = sdiv i64 %a.addr.05, 10
%a.addr.05.off = add i64 %a.addr.05, 9
%tobool.not = icmp ult i64 %a.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %sum.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @nCrReady() local_unnamed_addr #7 {
entry:
store i64 1, ptr getelementptr inbounds ([100000 x i64], ptr @fac, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr @fac, align 16, !tbaa !5
store i64 1, ptr getelementptr inbounds ([100000 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !5
store i64 1, ptr @finv, align 16, !tbaa !5
store i64 1, ptr getelementptr inbounds ([100000 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5
br label %for.body
for.cond.cleanup: ; preds = %for.body
ret void
for.body: ; preds = %entry, %for.body
%0 = phi i64 [ 1, %entry ], [ %rem12, %for.body ]
%1 = phi i64 [ 1, %entry ], [ %rem, %for.body ]
%i.026 = phi i64 [ 2, %entry ], [ %inc, %for.body ]
%mul = mul nsw i64 %1, %i.026
%rem = srem i64 %mul, 1000000007
%arrayidx1 = getelementptr inbounds [100000 x i64], ptr @fac, i64 0, i64 %i.026
store i64 %rem, ptr %arrayidx1, align 8, !tbaa !5
%rem2.rhs.trunc = trunc i64 %i.026 to i32
%rem224 = urem i32 1000000007, %rem2.rhs.trunc
%rem2.zext = zext i32 %rem224 to i64
%arrayidx3 = getelementptr inbounds [100000 x i64], ptr @inv, i64 0, i64 %rem2.zext
%2 = load i64, ptr %arrayidx3, align 8, !tbaa !5
%div25 = udiv i32 1000000007, %rem2.rhs.trunc
%div.zext = zext i32 %div25 to i64
%mul4 = mul nsw i64 %2, %div.zext
%rem5 = srem i64 %mul4, 1000000007
%sub6 = sub nsw i64 1000000007, %rem5
%arrayidx7 = getelementptr inbounds [100000 x i64], ptr @inv, i64 0, i64 %i.026
store i64 %sub6, ptr %arrayidx7, align 8, !tbaa !5
%mul11 = mul nuw nsw i64 %sub6, %0
%rem12 = urem i64 %mul11, 1000000007
%arrayidx13 = getelementptr inbounds [100000 x i64], ptr @finv, i64 0, i64 %i.026
store i64 %rem12, ptr %arrayidx13, align 8, !tbaa !5
%inc = add nuw nsw i64 %i.026, 1
%exitcond.not = icmp eq i64 %inc, 100000
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !16
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @nCr(i64 noundef %n, i64 noundef %k) local_unnamed_addr #8 {
entry:
%arrayidx = getelementptr inbounds [100000 x i64], ptr @fac, i64 0, i64 %n
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx1 = getelementptr inbounds [100000 x i64], ptr @finv, i64 0, i64 %k
%1 = load i64, ptr %arrayidx1, align 8, !tbaa !5
%sub = sub nsw i64 %n, %k
%arrayidx2 = getelementptr inbounds [100000 x i64], ptr @finv, i64 0, i64 %sub
%2 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%mul = mul nsw i64 %2, %1
%rem = srem i64 %mul, 1000000007
%mul3 = mul nsw i64 %rem, %0
%rem4 = srem i64 %mul3, 1000000007
ret i64 %rem4
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @modpow(i64 noundef %a, i64 noundef %n) local_unnamed_addr #6 {
entry:
%cmp8 = icmp sgt i64 %n, 0
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%res.011 = phi i64 [ %res.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 %res.011, %a.addr.09
%rem = srem i64 %mul, 1000000007
br label %if.end
if.end: ; preds = %if.then, %while.body
%res.1 = phi i64 [ %rem, %if.then ], [ %res.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 !17
while.end: ; preds = %if.end, %entry
%res.0.lcssa = phi i64 [ 1, %entry ], [ %res.1, %if.end ]
ret i64 %res.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #9 {
entry:
%a = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i64, ptr %a, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%ans.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ]
%i.0 = phi i64 [ 100, %entry ], [ %add, %while.cond ]
%inc = add nuw nsw i32 %ans.0, 1
%div = sdiv i64 %i.0, 100
%add = add nsw i64 %div, %i.0
%cmp.not = icmp slt i64 %add, %0
br i1 %cmp.not, label %while.cond, label %while.end
while.end: ; preds = %while.cond
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #13
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 i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
attributes #0 = { mustprogress nofree 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(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 #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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
|
#include <stdio.h>
#include <math.h>
int main(){
long long int X;
long long int A=100LL;
scanf("%lld",&X);
int c=0;
while(A<X){
A+=A/100L;
c++;
}
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274439/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274439/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%0 = load i64, ptr %X, align 8, !tbaa !5
%cmp5 = icmp sgt i64 %0, 100
br i1 %cmp5, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%c.07 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%A.06 = phi i64 [ %add, %while.body ], [ 100, %entry ]
%div = sdiv i64 %A.06, 100
%add = add nsw i64 %div, %A.06
%inc = add nuw nsw i32 %c.07, 1
%cmp = icmp slt i64 %add, %0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%c.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <ctype.h>
#include <string.h>
int main() {
long int X;
int i=0;
long long int m = 100;
scanf("%ld", &X);
while (1) {
if (m >= X) {
break;
}
m += m /100;
i = i + 1;
}
printf("%d", i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274482/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274482/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%0 = load i64, ptr %X, align 8, !tbaa !5
%cmp.not6 = icmp sgt i64 %0, 100
br i1 %cmp.not6, label %if.end, label %while.end
if.end: ; preds = %entry, %if.end
%m.08 = phi i64 [ %add, %if.end ], [ 100, %entry ]
%i.07 = phi i32 [ %add1, %if.end ], [ 0, %entry ]
%div = sdiv i64 %m.08, 100
%add = add nsw i64 %div, %m.08
%add1 = add nuw nsw i32 %i.07, 1
%cmp.not = icmp slt i64 %add, %0
br i1 %cmp.not, label %if.end, label %while.end
while.end: ; preds = %if.end, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ %add1, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
long long x,a[5000];
scanf("%lld",&x);
a[0]=100;
for(int i=1;i>0;i++){
a[i]=a[i-1]+(a[i-1]-(a[i-1]%100))/100;
if(a[i]>=x){printf("%d",i);return 0;}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274525/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274525/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%1 = phi i64 [ %add, %for.cond ], [ 100, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 1, %entry ]
%div = sdiv i64 %1, 100
%add = add nsw i64 %div, %1
%cmp13.not = icmp slt i64 %add, %0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp13.not, label %for.cond, label %if.then, !llvm.loop !9
if.then: ; preds = %for.cond
%2 = trunc i64 %indvars.iv to i32
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
long long int x,i,m=0,n=100;
scanf("%lld", &x);
while(n<x){
n=n*1.01;
m++;
}
printf("%lld",m);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274569/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274569/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
%cmp5 = icmp sgt i64 %0, 100
br i1 %cmp5, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%n.07 = phi i64 [ %conv1, %while.body ], [ 100, %entry ]
%m.06 = phi i64 [ %inc, %while.body ], [ 0, %entry ]
%conv = sitofp i64 %n.07 to double
%mul = fmul double %conv, 1.010000e+00
%conv1 = fptosi double %mul to i64
%inc = add nuw nsw i64 %m.06, 1
%cmp = icmp sgt i64 %0, %conv1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%m.0.lcssa = phi i64 [ 0, %entry ], [ %inc, %while.body ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %m.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"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 i=1;
long long int st=100,x;
scanf("%lld",&x);
while(i<3800){
st*=1.01;
if(st>=x){
printf("%d",i);
return 0;
}else{
i++;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274611/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274611/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %if.else.3, %entry
%st.012 = phi i64 [ 100, %entry ], [ %conv1.3, %if.else.3 ]
%i.011 = phi i32 [ 1, %entry ], [ %inc.3, %if.else.3 ]
%conv = sitofp i64 %st.012 to double
%mul = fmul double %conv, 1.010000e+00
%conv1 = fptosi double %mul to i64
%cmp2.not = icmp sgt i64 %0, %conv1
br i1 %cmp2.not, label %if.else, label %if.then
if.then.split.loop.exit17: ; preds = %if.else.1
%inc.1.le = add nuw nsw i32 %i.011, 2
br label %if.then
if.then.split.loop.exit19: ; preds = %if.else
%inc.le = add nuw nsw i32 %i.011, 1
br label %if.then
if.then: ; preds = %while.body, %while.body.3, %if.then.split.loop.exit19, %if.then.split.loop.exit17
%i.011.lcssa = phi i32 [ %inc.1.le, %if.then.split.loop.exit17 ], [ %inc.le, %if.then.split.loop.exit19 ], [ %inc.2, %while.body.3 ], [ %i.011, %while.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.011.lcssa)
br label %cleanup
if.else: ; preds = %while.body
%conv.1 = sitofp i64 %conv1 to double
%mul.1 = fmul double %conv.1, 1.010000e+00
%conv1.1 = fptosi double %mul.1 to i64
%cmp2.not.1 = icmp sgt i64 %0, %conv1.1
br i1 %cmp2.not.1, label %if.else.1, label %if.then.split.loop.exit19
if.else.1: ; preds = %if.else
%conv.2 = sitofp i64 %conv1.1 to double
%mul.2 = fmul double %conv.2, 1.010000e+00
%conv1.2 = fptosi double %mul.2 to i64
%cmp2.not.2 = icmp sgt i64 %0, %conv1.2
br i1 %cmp2.not.2, label %if.else.2, label %if.then.split.loop.exit17
if.else.2: ; preds = %if.else.1
%inc.2 = add nuw nsw i32 %i.011, 3
%exitcond.not.2 = icmp eq i32 %inc.2, 3800
br i1 %exitcond.not.2, label %cleanup, label %while.body.3, !llvm.loop !9
while.body.3: ; preds = %if.else.2
%conv.3 = sitofp i64 %conv1.2 to double
%mul.3 = fmul double %conv.3, 1.010000e+00
%conv1.3 = fptosi double %mul.3 to i64
%cmp2.not.3 = icmp sgt i64 %0, %conv1.3
br i1 %cmp2.not.3, label %if.else.3, label %if.then
if.else.3: ; preds = %while.body.3
%inc.3 = add nuw nsw i32 %i.011, 4
br label %while.body
cleanup: ; preds = %if.else.2, %if.then
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"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) {
unsigned long long int X, ret;
unsigned short i;
scanf("%llu%*c", &X);
ret = 100;
for (i = 0; ret < X; i++) {
ret += ret * 0.01;
}
printf("%hu\n", i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274655/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274655/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%llu%*c\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%hu\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%0 = load i64, ptr %X, align 8, !tbaa !5
%cmp8 = icmp ugt i64 %0, 100
br i1 %cmp8, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.010 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
%ret.09 = phi i64 [ %conv2, %for.body ], [ 100, %entry ]
%conv = uitofp i64 %ret.09 to double
%1 = call double @llvm.fmuladd.f64(double %conv, double 1.000000e-02, double %conv)
%conv2 = fptoui double %1 to i64
%inc = add i16 %i.010, 1
%cmp = icmp ugt i64 %0, %conv2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%2 = zext i16 %inc to i32
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ %2, %for.end.loopexit ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
long x, b;
int cnt = 0;
scanf("%ld", &x);
b = 100;
do {
b = b + (b / 100);
cnt++;
} while (b < x);
printf("%d", cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274699/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274699/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
br label %do.body
do.body: ; preds = %do.body, %entry
%b.0 = phi i64 [ 100, %entry ], [ %add, %do.body ]
%cnt.0 = phi i32 [ 0, %entry ], [ %inc, %do.body ]
%div = sdiv i64 %b.0, 100
%add = add nsw i64 %div, %b.0
%inc = add nuw nsw i32 %cnt.0, 1
%cmp = icmp slt i64 %add, %0
br i1 %cmp, label %do.body, label %do.end, !llvm.loop !9
do.end: ; preds = %do.body
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define lop(i, n) for(i=0; i<n; i++)
int main()
{
long long int x, y=100, cnt=0;
scanf("%lld", &x);
while(y<x){
y=y+y/100;
cnt++;
}
printf("%lld", cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274749/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274749/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
%cmp5 = icmp sgt i64 %0, 100
br i1 %cmp5, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%cnt.07 = phi i64 [ %inc, %while.body ], [ 0, %entry ]
%y.06 = phi i64 [ %add, %while.body ], [ 100, %entry ]
%div = sdiv i64 %y.06, 100
%add = add nsw i64 %div, %y.06
%inc = add nuw nsw i64 %cnt.07, 1
%cmp = icmp slt i64 %add, %0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%cnt.0.lcssa = phi i64 [ 0, %entry ], [ %inc, %while.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdbool.h>
int main(void) {
long X;
int y = 0;
scanf("%ld", &X);
for(long m = 100; m < X; y++, m*=1.01) {
}
printf("%d\n", y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274792/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274792/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%0 = load i64, ptr %X, align 8, !tbaa !5
%cmp5 = icmp sgt i64 %0, 100
br i1 %cmp5, label %for.inc, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
%y.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #3
ret i32 0
for.inc: ; preds = %entry, %for.inc
%m.07 = phi i64 [ %conv1, %for.inc ], [ 100, %entry ]
%y.06 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%inc = add nuw nsw i32 %y.06, 1
%conv = sitofp i64 %m.07 to double
%mul = fmul double %conv, 1.010000e+00
%conv1 = fptosi double %mul to i64
%cmp = icmp sgt i64 %0, %conv1
br i1 %cmp, label %for.inc, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#define P 1000000007
int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}
int compw(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return *(int*)b-*(int*)a;}
uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint_fast32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){
char c=getchar();
while(c==' '||c=='\n'||c=='\r'||c=='\t') c=getchar();
uint32_t len=0;
while(c!=' '&&c!='\n'&&c!='\r'&&c!='\t'){ *s++=c; len++; c=getchar(); }
*s='\0';
return len;
}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}
char s[100001];
int main(void){
int n=nextstr(s);
int k=nextpint();
for(int i=0; i<n; i++){
int n='{'-s[i];
if(n!=26 && n<=k){
k-=n;
s[i]='a';
}
}
s[n-1]=(s[n-1]-'a'+k)%26+'a';
puts(s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274842/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274842/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@s = dso_local global [100001 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%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 @compw(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%conv = zext i1 %cmp to i32
%cmp1 = icmp slt i32 %0, %1
%conv2.neg = sext i1 %cmp1 to i32
%sub = add nsw i32 %conv2.neg, %conv
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @nextpint() local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i = tail call i32 @getc(ptr noundef %0)
%sext30 = shl i32 %call.i, 24
%1 = add i32 %sext30, -956301313
%2 = icmp ult i32 %1, -150994945
br i1 %2, label %while.body, label %while.body15.preheader
while.body: ; preds = %entry, %while.body
%3 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i28 = tail call i32 @getc(ptr noundef %3)
%sext = shl i32 %call.i28, 24
%4 = add i32 %sext, -956301313
%5 = icmp ult i32 %4, -150994945
br i1 %5, label %while.body, label %while.body15.preheader, !llvm.loop !11
while.body15.preheader: ; preds = %while.body, %entry
%c.1.in32.ph = phi i32 [ %call.i, %entry ], [ %call.i28, %while.body ]
br label %while.body15
while.body15: ; preds = %while.body15.preheader, %while.body15
%x.033 = phi i64 [ %sub, %while.body15 ], [ 0, %while.body15.preheader ]
%c.1.in32 = phi i32 [ %call.i29, %while.body15 ], [ %c.1.in32.ph, %while.body15.preheader ]
%c.1 = zext i32 %c.1.in32 to i64
%mul = mul i64 %x.033, 10
%sext27 = shl i64 %c.1, 56
%conv16 = ashr exact i64 %sext27, 56
%add = add i64 %mul, -48
%sub = add i64 %add, %conv16
%6 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i29 = tail call i32 @getc(ptr noundef %6)
%sext26 = shl i32 %call.i29, 24
%7 = add i32 %sext26, -788529153
%8 = icmp ult i32 %7, 184549375
br i1 %8, label %while.body15, label %while.end19.loopexit, !llvm.loop !13
while.end19.loopexit: ; preds = %while.body15
%9 = trunc i64 %sub to i32
ret i32 %9
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @nextstr(ptr nocapture noundef writeonly %s) local_unnamed_addr #1 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i50 = tail call i32 @getc(ptr noundef %0)
%1 = and i32 %call.i50, 251
%2 = icmp eq i32 %1, 9
br i1 %2, label %while.cond.backedge, label %switch.early.test
switch.early.test: ; preds = %while.cond
%sext = shl i32 %call.i50, 24
switch i32 %sext, label %switch.early.test49 [
i32 536870912, label %while.cond.backedge
i32 167772160, label %while.cond.backedge
]
while.cond.backedge: ; preds = %switch.early.test, %switch.early.test, %while.cond
br label %while.cond, !llvm.loop !14
switch.early.test49: ; preds = %switch.early.test, %while.body29
%len.055 = phi i32 [ %inc, %while.body29 ], [ 0, %switch.early.test ]
%c.1.in54 = phi i32 [ %call.i51, %while.body29 ], [ %call.i50, %switch.early.test ]
%s.addr.053 = phi ptr [ %incdec.ptr, %while.body29 ], [ %s, %switch.early.test ]
%sext48 = shl i32 %c.1.in54, 24
switch i32 %sext48, label %while.body29 [
i32 536870912, label %while.end32
i32 167772160, label %while.end32
]
while.body29: ; preds = %switch.early.test49
%c.1 = trunc i32 %c.1.in54 to i8
%incdec.ptr = getelementptr inbounds i8, ptr %s.addr.053, i64 1
store i8 %c.1, ptr %s.addr.053, align 1, !tbaa !15
%inc = add i32 %len.055, 1
%3 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i51 = tail call i32 @getc(ptr noundef %3)
%4 = and i32 %call.i51, 251
%.not = icmp eq i32 %4, 9
br i1 %.not, label %while.end32, label %switch.early.test49, !llvm.loop !16
while.end32: ; preds = %while.body29, %switch.early.test49, %switch.early.test49
%s.addr.0.lcssa.ph = phi ptr [ %incdec.ptr, %while.body29 ], [ %s.addr.053, %switch.early.test49 ], [ %s.addr.053, %switch.early.test49 ]
%len.0.lcssa.ph = phi i32 [ %inc, %while.body29 ], [ %len.055, %switch.early.test49 ], [ %len.055, %switch.early.test49 ]
store i8 0, ptr %s.addr.0.lcssa.ph, align 1, !tbaa !15
ret i32 %len.0.lcssa.ph
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i.backedge, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i50.i = tail call i32 @getc(ptr noundef %0)
%1 = and i32 %call.i50.i, 251
%2 = icmp eq i32 %1, 9
br i1 %2, label %while.cond.i.backedge, label %switch.early.test.i
switch.early.test.i: ; preds = %while.cond.i
%sext.i = shl i32 %call.i50.i, 24
switch i32 %sext.i, label %switch.early.test49.i [
i32 536870912, label %while.cond.i.backedge
i32 167772160, label %while.cond.i.backedge
]
while.cond.i.backedge: ; preds = %switch.early.test.i, %switch.early.test.i, %while.cond.i
br label %while.cond.i, !llvm.loop !14
switch.early.test49.i: ; preds = %switch.early.test.i, %while.body29.i
%len.055.i = phi i32 [ %inc.i, %while.body29.i ], [ 0, %switch.early.test.i ]
%c.1.in54.i = phi i32 [ %call.i51.i, %while.body29.i ], [ %call.i50.i, %switch.early.test.i ]
%s.addr.053.i = phi ptr [ %incdec.ptr.i, %while.body29.i ], [ @s, %switch.early.test.i ]
%sext48.i = shl i32 %c.1.in54.i, 24
switch i32 %sext48.i, label %while.body29.i [
i32 536870912, label %nextstr.exit
i32 167772160, label %nextstr.exit
]
while.body29.i: ; preds = %switch.early.test49.i
%c.1.i = trunc i32 %c.1.in54.i to i8
%incdec.ptr.i = getelementptr inbounds i8, ptr %s.addr.053.i, i64 1
store i8 %c.1.i, ptr %s.addr.053.i, align 1, !tbaa !15
%inc.i = add i32 %len.055.i, 1
%3 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i51.i = tail call i32 @getc(ptr noundef %3)
%4 = and i32 %call.i51.i, 251
%.not.i = icmp eq i32 %4, 9
br i1 %.not.i, label %nextstr.exit, label %switch.early.test49.i, !llvm.loop !16
nextstr.exit: ; preds = %switch.early.test49.i, %switch.early.test49.i, %while.body29.i
%s.addr.0.lcssa.ph.i = phi ptr [ %incdec.ptr.i, %while.body29.i ], [ %s.addr.053.i, %switch.early.test49.i ], [ %s.addr.053.i, %switch.early.test49.i ]
%len.0.lcssa.ph.i = phi i32 [ %inc.i, %while.body29.i ], [ %len.055.i, %switch.early.test49.i ], [ %len.055.i, %switch.early.test49.i ]
store i8 0, ptr %s.addr.0.lcssa.ph.i, align 1, !tbaa !15
%5 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i.i = tail call i32 @getc(ptr noundef %5)
%sext30.i = shl i32 %call.i.i, 24
%6 = add i32 %sext30.i, -956301313
%7 = icmp ult i32 %6, -150994945
br i1 %7, label %while.body.i31, label %while.body15.i.preheader
while.body.i31: ; preds = %nextstr.exit, %while.body.i31
%8 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i28.i = tail call i32 @getc(ptr noundef %8)
%sext.i32 = shl i32 %call.i28.i, 24
%9 = add i32 %sext.i32, -956301313
%10 = icmp ult i32 %9, -150994945
br i1 %10, label %while.body.i31, label %while.body15.i.preheader, !llvm.loop !11
while.body15.i.preheader: ; preds = %while.body.i31, %nextstr.exit
%c.1.in32.i.ph = phi i32 [ %call.i.i, %nextstr.exit ], [ %call.i28.i, %while.body.i31 ]
br label %while.body15.i
while.body15.i: ; preds = %while.body15.i.preheader, %while.body15.i
%x.033.i = phi i64 [ %sub.i, %while.body15.i ], [ 0, %while.body15.i.preheader ]
%c.1.in32.i = phi i32 [ %call.i29.i, %while.body15.i ], [ %c.1.in32.i.ph, %while.body15.i.preheader ]
%c.1.i30 = zext i32 %c.1.in32.i to i64
%mul.i = mul i64 %x.033.i, 10
%sext27.i = shl i64 %c.1.i30, 56
%conv16.i = ashr exact i64 %sext27.i, 56
%add.i = add i64 %mul.i, -48
%sub.i = add i64 %add.i, %conv16.i
%11 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i29.i = tail call i32 @getc(ptr noundef %11)
%sext26.i = shl i32 %call.i29.i, 24
%12 = add i32 %sext26.i, -788529153
%13 = icmp ult i32 %12, 184549375
br i1 %13, label %while.body15.i, label %nextpint.exit, !llvm.loop !13
nextpint.exit: ; preds = %while.body15.i
%14 = trunc i64 %sub.i to i32
%cmp33 = icmp sgt i32 %len.0.lcssa.ph.i, 0
br i1 %cmp33, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %nextpint.exit
%wide.trip.count = zext i32 %len.0.lcssa.ph.i to i64
%xtraiter = and i64 %wide.trip.count, 1
%15 = icmp eq i32 %len.0.lcssa.ph.i, 1
br i1 %15, label %for.cond.cleanup.loopexit.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.cond.cleanup.loopexit.unr-lcssa: ; preds = %if.end.1, %for.body.preheader
%k.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %k.1.1, %if.end.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %if.end.1 ]
%k.035.unr = phi i32 [ %14, %for.body.preheader ], [ %k.1.1, %if.end.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %indvars.iv.unr
%16 = load i8, ptr %arrayidx.epil, align 1, !tbaa !15
%conv.epil = sext i8 %16 to i32
%sub.epil = sub nsw i32 123, %conv.epil
%cmp3.not.epil = icmp eq i8 %16, 97
%cmp5.not.epil = icmp sgt i32 %sub.epil, %k.035.unr
%or.cond.epil = select i1 %cmp3.not.epil, i1 true, i1 %cmp5.not.epil
br i1 %or.cond.epil, label %for.cond.cleanup, label %if.then.epil
if.then.epil: ; preds = %for.body.epil
%sub7.epil = sub nsw i32 %k.035.unr, %sub.epil
store i8 97, ptr %arrayidx.epil, align 1, !tbaa !15
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %nextpint.exit
%k.0.lcssa = phi i32 [ %14, %nextpint.exit ], [ %k.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %sub7.epil, %if.then.epil ], [ %k.035.unr, %for.body.epil ]
%sub10 = add nsw i32 %len.0.lcssa.ph.i, -1
%idxprom11 = sext i32 %sub10 to i64
%arrayidx12 = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %idxprom11
%17 = load i8, ptr %arrayidx12, align 1, !tbaa !15
%conv13 = sext i8 %17 to i32
%sub14 = add i32 %k.0.lcssa, -97
%add = add i32 %sub14, %conv13
%rem = srem i32 %add, 26
%18 = trunc i32 %rem to i8
%conv16 = add nsw i8 %18, 97
store i8 %conv16, ptr %arrayidx12, align 1, !tbaa !15
%call20 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @s)
ret i32 0
for.body: ; preds = %if.end.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %if.end.1 ]
%k.035 = phi i32 [ %14, %for.body.preheader.new ], [ %k.1.1, %if.end.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %if.end.1 ]
%arrayidx = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %indvars.iv
%19 = load i8, ptr %arrayidx, align 2, !tbaa !15
%conv = sext i8 %19 to i32
%sub = sub nsw i32 123, %conv
%cmp3.not = icmp eq i8 %19, 97
%cmp5.not = icmp sgt i32 %sub, %k.035
%or.cond = select i1 %cmp3.not, i1 true, i1 %cmp5.not
br i1 %or.cond, label %if.end, label %if.then
if.then: ; preds = %for.body
%sub7 = sub nsw i32 %k.035, %sub
store i8 97, ptr %arrayidx, align 2, !tbaa !15
br label %if.end
if.end: ; preds = %if.then, %for.body
%k.1 = phi i32 [ %sub7, %if.then ], [ %k.035, %for.body ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %indvars.iv.next
%20 = load i8, ptr %arrayidx.1, align 1, !tbaa !15
%conv.1 = sext i8 %20 to i32
%sub.1 = sub nsw i32 123, %conv.1
%cmp3.not.1 = icmp eq i8 %20, 97
%cmp5.not.1 = icmp sgt i32 %sub.1, %k.1
%or.cond.1 = select i1 %cmp3.not.1, i1 true, i1 %cmp5.not.1
br i1 %or.cond.1, label %if.end.1, label %if.then.1
if.then.1: ; preds = %if.end
%sub7.1 = sub nsw i32 %k.1, %sub.1
store i8 97, ptr %arrayidx.1, align 1, !tbaa !15
br label %if.end.1
if.end.1: ; preds = %if.then.1, %if.end
%k.1.1 = phi i32 [ %sub7.1, %if.then.1 ], [ %k.1, %if.end ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !17
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
|
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
void seiri(int n);
int judge(int n);
char S[6];
int main(){
int n;
scanf("%s",S);
n=strlen(S);
if(atoi(S)==10000)printf("9999\n");
else if(n==1){
printf("%s\n",S);
}
else seiri(n);
return 0;
}
void seiri(int n){
int i,flag=0,SS=0,ii=1,S1=0,S2=0;
for(i = 0; i < n/2;i++){
if(S[i]!=S[n-i-1])flag=1;
}
if(flag==0){
printf("%s\n",S);
return;
}
else{
for(i=n-1;i>=0;i--){
SS+=(S[i]-'0')*ii;
ii*=10;
}
//printf("%d\n",SS);
for(i = SS ;;i++){
if(judge(i) == 1)break;
S1++;
}
for(i = SS ;; i--){
if(judge(i) == 1)break;
S2++;
}
if(S1 < S2)printf("%d\n",SS+S1);
else printf("%d\n",SS-S2);
}
}
int judge(int SS){
if(SS>9 && SS<100){
if(SS%10==SS/10)return 1;
else return 0;
}
if(SS>99 && SS<1000){
if(SS%10==SS/100)return 1;
else return 0;
}
if(SS>999 && SS<10000){
if(SS%10==SS/1000 && (SS/100)%10 == (SS/10)%10)return 1;
else return 0;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274886/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274886/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] zeroinitializer, align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [5 x i8] c"9999\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @S)
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @S) #6
%conv = trunc i64 %call1 to i32
%call.i = tail call i64 @strtol(ptr nocapture noundef nonnull @S, ptr noundef null, i32 noundef 10) #7
%0 = and i64 %call.i, 4294967295
%cmp = icmp eq i64 %0, 10000
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts12 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end10
if.else: ; preds = %entry
%cmp5 = icmp eq i32 %conv, 1
br i1 %cmp5, label %if.then7, label %if.else9
if.then7: ; preds = %if.else
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @S)
br label %if.end10
if.else9: ; preds = %if.else
tail call void @seiri(i32 noundef %conv)
br label %if.end10
if.end10: ; preds = %if.then7, %if.else9, %if.then
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @seiri(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp120 = icmp sgt i32 %n, 1
br i1 %cmp120, label %for.body.preheader, label %if.then9
for.body.preheader: ; preds = %entry
%div134135 = lshr i32 %n, 1
%wide.trip.count = zext i32 %div134135 to i64
%min.iters.check = icmp ult i32 %n, 24
br i1 %min.iters.check, label %for.body.preheader145, label %vector.scevcheck
vector.scevcheck: ; preds = %for.body.preheader
%0 = add nsw i64 %wide.trip.count, -1
%1 = add i32 %n, -1
%2 = trunc i64 %0 to i32
%3 = sub i32 %1, %2
%4 = icmp sgt i32 %3, %1
%5 = icmp ugt i64 %0, 4294967295
%6 = or i1 %4, %5
br i1 %6, label %for.body.preheader145, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %wide.trip.count, 2147483640
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%offset.idx = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%vec.phi137 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%7 = trunc i64 %offset.idx to i32
%8 = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %offset.idx
%wide.load = load <4 x i8>, ptr %8, align 1, !tbaa !5
%9 = getelementptr inbounds i8, ptr %8, i64 4
%wide.load138 = load <4 x i8>, ptr %9, align 1, !tbaa !5
%10 = xor i32 %7, -1
%11 = add i32 %10, %n
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %12
%14 = getelementptr inbounds i8, ptr %13, i64 -3
%wide.load139 = load <4 x i8>, ptr %14, align 1, !tbaa !5
%reverse = shufflevector <4 x i8> %wide.load139, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%15 = getelementptr inbounds i8, ptr %13, i64 -7
%wide.load140 = load <4 x i8>, ptr %15, align 1, !tbaa !5
%reverse141 = shufflevector <4 x i8> %wide.load140, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%16 = icmp eq <4 x i8> %wide.load, %reverse
%17 = icmp eq <4 x i8> %wide.load138, %reverse141
%18 = select <4 x i1> %16, <4 x i32> %vec.phi, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%19 = select <4 x i1> %17, <4 x i32> %vec.phi137, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%index.next = add nuw i64 %offset.idx, 8
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%rdx.select.cmp.not = icmp ne <4 x i32> %18, zeroinitializer
%rdx.select.cmp142144 = icmp ne <4 x i32> %19, zeroinitializer
%rdx.select.cmp142 = select <4 x i1> %rdx.select.cmp.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp142144
%21 = bitcast <4 x i1> %rdx.select.cmp142 to i4
%.not = icmp ne i4 %21, 0
%rdx.select143 = zext i1 %.not to i32
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader145
for.body.preheader145: ; preds = %vector.scevcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%flag.0122.ph = phi i32 [ 0, %vector.scevcheck ], [ 0, %for.body.preheader ], [ %rdx.select143, %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.preheader145
%arrayidx.prol = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %indvars.iv.ph
%22 = load i8, ptr %arrayidx.prol, align 1, !tbaa !5
%23 = trunc i64 %indvars.iv.ph to i32
%24 = xor i32 %23, -1
%sub1.prol = add i32 %24, %n
%idxprom2.prol = sext i32 %sub1.prol to i64
%arrayidx3.prol = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %idxprom2.prol
%25 = load i8, ptr %arrayidx3.prol, align 1, !tbaa !5
%cmp5.not.prol = icmp eq i8 %22, %25
%spec.select.prol = select i1 %cmp5.not.prol, i32 %flag.0122.ph, i32 1
%indvars.iv.next.prol = or i64 %indvars.iv.ph, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader145
%spec.select.lcssa146.unr = phi i32 [ undef, %for.body.preheader145 ], [ %spec.select.prol, %for.body.prol ]
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader145 ], [ %indvars.iv.next.prol, %for.body.prol ]
%flag.0122.unr = phi i32 [ %flag.0122.ph, %for.body.preheader145 ], [ %spec.select.prol, %for.body.prol ]
%26 = sub nsw i64 0, %wide.trip.count
%27 = xor i64 %indvars.iv.ph, %26
%28 = icmp eq i64 %27, -1
br i1 %28, 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 ]
%flag.0122 = phi i32 [ %spec.select.1, %for.body ], [ %flag.0122.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %indvars.iv
%29 = load i8, ptr %arrayidx, align 1, !tbaa !5
%30 = trunc i64 %indvars.iv to i32
%31 = xor i32 %30, -1
%sub1 = add i32 %31, %n
%idxprom2 = sext i32 %sub1 to i64
%arrayidx3 = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %idxprom2
%32 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%cmp5.not = icmp eq i8 %29, %32
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %indvars.iv.next
%33 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%34 = trunc i64 %indvars.iv.next to i32
%35 = xor i32 %34, -1
%sub1.1 = add i32 %35, %n
%idxprom2.1 = sext i32 %sub1.1 to i64
%arrayidx3.1 = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %idxprom2.1
%36 = load i8, ptr %arrayidx3.1, align 1, !tbaa !5
%cmp5.not.1 = icmp eq i8 %33, %36
%37 = select i1 %cmp5.not.1, i1 %cmp5.not, i1 false
%spec.select.1 = select i1 %37, i32 %flag.0122, i32 1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block
%spec.select.lcssa = phi i32 [ %rdx.select143, %middle.block ], [ %spec.select.lcssa146.unr, %for.body.prol.loopexit ], [ %spec.select.1, %for.body ]
%38 = icmp eq i32 %spec.select.lcssa, 0
br i1 %38, label %if.then9, label %for.cond11.preheader
for.cond11.preheader: ; preds = %for.end
%cmp12123 = icmp sgt i32 %n, 0
br i1 %cmp12123, label %for.body14.preheader, label %for.cond22.preheader
for.body14.preheader: ; preds = %for.cond11.preheader
%39 = zext i32 %n to i64
%xtraiter148 = and i64 %39, 1
%40 = icmp eq i32 %n, 1
br i1 %40, label %for.cond22.preheader.loopexit.unr-lcssa, label %for.body14.preheader.new
for.body14.preheader.new: ; preds = %for.body14.preheader
%unroll_iter = and i64 %39, 4294967294
br label %for.body14
if.then9: ; preds = %entry, %for.end
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @S)
br label %cleanup
for.cond22.preheader.loopexit.unr-lcssa: ; preds = %for.body14, %for.body14.preheader
%add.lcssa.ph = phi i32 [ undef, %for.body14.preheader ], [ %add.1, %for.body14 ]
%indvars.iv129.unr = phi i64 [ %39, %for.body14.preheader ], [ %indvars.iv.next130.1, %for.body14 ]
%ii.0126.unr = phi i32 [ 1, %for.body14.preheader ], [ %mul19.1, %for.body14 ]
%SS.0125.unr = phi i32 [ 0, %for.body14.preheader ], [ %add.1, %for.body14 ]
%lcmp.mod149.not = icmp eq i64 %xtraiter148, 0
br i1 %lcmp.mod149.not, label %for.cond22.preheader, label %for.body14.epil
for.body14.epil: ; preds = %for.cond22.preheader.loopexit.unr-lcssa
%indvars.iv.next130.epil = add i64 %indvars.iv129.unr, 4294967295
%idxprom15.epil = and i64 %indvars.iv.next130.epil, 4294967295
%arrayidx16.epil = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %idxprom15.epil
%41 = load i8, ptr %arrayidx16.epil, align 1, !tbaa !5
%conv17.epil = sext i8 %41 to i32
%sub18.epil = add nsw i32 %conv17.epil, -48
%mul.epil = mul nsw i32 %sub18.epil, %ii.0126.unr
%add.epil = add nsw i32 %mul.epil, %SS.0125.unr
br label %for.cond22.preheader
for.cond22.preheader: ; preds = %for.body14.epil, %for.cond22.preheader.loopexit.unr-lcssa, %for.cond11.preheader
%SS.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ %add.lcssa.ph, %for.cond22.preheader.loopexit.unr-lcssa ], [ %add.epil, %for.body14.epil ]
br label %for.cond22
for.body14: ; preds = %for.body14, %for.body14.preheader.new
%indvars.iv129 = phi i64 [ %39, %for.body14.preheader.new ], [ %indvars.iv.next130.1, %for.body14 ]
%ii.0126 = phi i32 [ 1, %for.body14.preheader.new ], [ %mul19.1, %for.body14 ]
%SS.0125 = phi i32 [ 0, %for.body14.preheader.new ], [ %add.1, %for.body14 ]
%niter = phi i64 [ 0, %for.body14.preheader.new ], [ %niter.next.1, %for.body14 ]
%indvars.iv.next130 = add i64 %indvars.iv129, 4294967295
%idxprom15 = and i64 %indvars.iv.next130, 4294967295
%arrayidx16 = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %idxprom15
%42 = load i8, ptr %arrayidx16, align 1, !tbaa !5
%conv17 = sext i8 %42 to i32
%sub18 = add nsw i32 %conv17, -48
%mul = mul nsw i32 %sub18, %ii.0126
%add = add nsw i32 %mul, %SS.0125
%mul19 = mul nsw i32 %ii.0126, 10
%indvars.iv.next130.1 = add nsw i64 %indvars.iv129, -2
%idxprom15.1 = and i64 %indvars.iv.next130.1, 4294967295
%arrayidx16.1 = getelementptr inbounds [6 x i8], ptr @S, i64 0, i64 %idxprom15.1
%43 = load i8, ptr %arrayidx16.1, align 1, !tbaa !5
%conv17.1 = sext i8 %43 to i32
%sub18.1 = add nsw i32 %conv17.1, -48
%mul.1 = mul nsw i32 %sub18.1, %mul19
%add.1 = add nsw i32 %mul.1, %add
%mul19.1 = mul i32 %ii.0126, 100
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1.not, label %for.cond22.preheader.loopexit.unr-lcssa, label %for.body14, !llvm.loop !13
for.cond22: ; preds = %for.cond22.preheader, %if.end27
%i.2 = phi i32 [ %inc30, %if.end27 ], [ %SS.0.lcssa, %for.cond22.preheader ]
%S1.0 = phi i32 [ %inc28, %if.end27 ], [ 0, %for.cond22.preheader ]
%44 = add i32 %i.2, -10
%or.cond.i = icmp ult i32 %44, 90
br i1 %or.cond.i, label %if.then.i, label %if.end.i
if.then.i: ; preds = %for.cond22
%rem.lhs.trunc.i = trunc i32 %i.2 to i8
%rem46.i = urem i8 %rem.lhs.trunc.i, 10
%div47.i = udiv i8 %rem.lhs.trunc.i, 10
%cmp2.i = icmp eq i8 %rem46.i, %div47.i
br i1 %cmp2.i, label %for.cond32.preheader, label %if.end27
if.end.i: ; preds = %for.cond22
%45 = add i32 %i.2, -100
%or.cond30.i = icmp ult i32 %45, 900
br i1 %or.cond30.i, label %judge.exit, label %if.end13.i
if.end13.i: ; preds = %if.end.i
%46 = add i32 %i.2, -1000
%or.cond31.i = icmp ult i32 %46, 9000
br i1 %or.cond31.i, label %if.then17.i, label %for.cond32.preheader
if.then17.i: ; preds = %if.end13.i
%rem18.lhs.trunc.i = trunc i32 %i.2 to i16
%rem1850.i = urem i16 %rem18.lhs.trunc.i, 10
%div2454.i = udiv i16 %rem18.lhs.trunc.i, 10
%div1951.i = udiv i16 %rem18.lhs.trunc.i, 1000
%cmp20.i = icmp eq i16 %rem1850.i, %div1951.i
br i1 %cmp20.i, label %land.lhs.true21.i, label %if.end27
land.lhs.true21.i: ; preds = %if.then17.i
%div2252.i = udiv i16 %rem18.lhs.trunc.i, 100
%rem23.lhs.trunc.i = trunc i16 %div2252.i to i8
%rem2353.i = urem i8 %rem23.lhs.trunc.i, 10
%rem2555.i = urem i16 %div2454.i, 10
%47 = zext i8 %rem2353.i to i16
%cmp26.i = icmp eq i16 %rem2555.i, %47
br i1 %cmp26.i, label %for.cond32.preheader, label %if.end27
for.cond32.preheader: ; preds = %if.end13.i, %if.then.i, %judge.exit, %land.lhs.true21.i
br label %for.cond32
judge.exit: ; preds = %if.end.i
%rem8.lhs.trunc.i = trunc i32 %i.2 to i16
%rem848.i = urem i16 %rem8.lhs.trunc.i, 10
%div949.i = udiv i16 %rem8.lhs.trunc.i, 100
%cmp10.i = icmp eq i16 %rem848.i, %div949.i
br i1 %cmp10.i, label %for.cond32.preheader, label %if.end27
if.end27: ; preds = %if.then.i, %land.lhs.true21.i, %if.then17.i, %judge.exit
%inc28 = add nuw nsw i32 %S1.0, 1
%inc30 = add nsw i32 %i.2, 1
br label %for.cond22
for.cond32: ; preds = %for.cond32.preheader, %if.end37
%i.3 = phi i32 [ %dec40, %if.end37 ], [ %SS.0.lcssa, %for.cond32.preheader ]
%S2.0 = phi i32 [ %inc38, %if.end37 ], [ 0, %for.cond32.preheader ]
%48 = add i32 %i.3, -10
%or.cond.i78 = icmp ult i32 %48, 90
br i1 %or.cond.i78, label %if.then.i103, label %if.end.i79
if.then.i103: ; preds = %for.cond32
%rem.lhs.trunc.i104 = trunc i32 %i.3 to i8
%rem46.i105 = urem i8 %rem.lhs.trunc.i104, 10
%div47.i106 = udiv i8 %rem.lhs.trunc.i104, 10
%cmp2.i107 = icmp eq i8 %rem46.i105, %div47.i106
br i1 %cmp2.i107, label %for.end41, label %if.end37
if.end.i79: ; preds = %for.cond32
%49 = add i32 %i.3, -100
%or.cond30.i80 = icmp ult i32 %49, 900
br i1 %or.cond30.i80, label %judge.exit109, label %if.end13.i81
if.end13.i81: ; preds = %if.end.i79
%50 = add i32 %i.3, -1000
%or.cond31.i82 = icmp ult i32 %50, 9000
br i1 %or.cond31.i82, label %if.then17.i84, label %for.end41
if.then17.i84: ; preds = %if.end13.i81
%rem18.lhs.trunc.i85 = trunc i32 %i.3 to i16
%rem1850.i86 = urem i16 %rem18.lhs.trunc.i85, 10
%div2454.i94 = udiv i16 %rem18.lhs.trunc.i85, 10
%div1951.i87 = udiv i16 %rem18.lhs.trunc.i85, 1000
%cmp20.i88 = icmp eq i16 %rem1850.i86, %div1951.i87
br i1 %cmp20.i88, label %land.lhs.true21.i90, label %if.end37
land.lhs.true21.i90: ; preds = %if.then17.i84
%div2252.i91 = udiv i16 %rem18.lhs.trunc.i85, 100
%rem23.lhs.trunc.i92 = trunc i16 %div2252.i91 to i8
%rem2353.i93 = urem i8 %rem23.lhs.trunc.i92, 10
%rem2555.i95 = urem i16 %div2454.i94, 10
%51 = zext i8 %rem2353.i93 to i16
%cmp26.i96 = icmp eq i16 %rem2555.i95, %51
br i1 %cmp26.i96, label %for.end41, label %if.end37
judge.exit109: ; preds = %if.end.i79
%rem8.lhs.trunc.i98 = trunc i32 %i.3 to i16
%rem848.i99 = urem i16 %rem8.lhs.trunc.i98, 10
%div949.i100 = udiv i16 %rem8.lhs.trunc.i98, 100
%cmp10.i101 = icmp eq i16 %rem848.i99, %div949.i100
br i1 %cmp10.i101, label %for.end41, label %if.end37
if.end37: ; preds = %if.then.i103, %land.lhs.true21.i90, %if.then17.i84, %judge.exit109
%inc38 = add nuw nsw i32 %S2.0, 1
%dec40 = add nsw i32 %i.3, -1
br label %for.cond32
for.end41: ; preds = %if.then.i103, %land.lhs.true21.i90, %if.end13.i81, %judge.exit109
%cmp42 = icmp ult i32 %S1.0, %S2.0
br i1 %cmp42, label %if.then44, label %if.else47
if.then44: ; preds = %for.end41
%add45 = add nsw i32 %S1.0, %SS.0.lcssa
%call46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add45)
br label %cleanup
if.else47: ; preds = %for.end41
%sub48 = sub nsw i32 %SS.0.lcssa, %S2.0
%call49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub48)
br label %cleanup
cleanup: ; preds = %if.else47, %if.then44, %if.then9
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @judge(i32 noundef %SS) local_unnamed_addr #3 {
entry:
%0 = add i32 %SS, -10
%or.cond = icmp ult i32 %0, 90
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %entry
%rem.lhs.trunc = trunc i32 %SS to i8
%rem46 = urem i8 %rem.lhs.trunc, 10
%div47 = udiv i8 %rem.lhs.trunc, 10
%cmp2 = icmp eq i8 %rem46, %div47
%. = zext i1 %cmp2 to i32
br label %if.end29
if.end: ; preds = %entry
%1 = add i32 %SS, -100
%or.cond30 = icmp ult i32 %1, 900
br i1 %or.cond30, label %if.then7, label %if.end13
if.then7: ; preds = %if.end
%rem8.lhs.trunc = trunc i32 %SS to i16
%rem848 = urem i16 %rem8.lhs.trunc, 10
%div949 = udiv i16 %rem8.lhs.trunc, 100
%cmp10 = icmp eq i16 %rem848, %div949
%.45 = zext i1 %cmp10 to i32
br label %if.end29
if.end13: ; preds = %if.end
%2 = add i32 %SS, -1000
%or.cond31 = icmp ult i32 %2, 9000
br i1 %or.cond31, label %if.then17, label %if.end29
if.then17: ; preds = %if.end13
%rem18.lhs.trunc = trunc i32 %SS to i16
%rem1850 = urem i16 %rem18.lhs.trunc, 10
%div2454 = udiv i16 %rem18.lhs.trunc, 10
%div1951 = udiv i16 %rem18.lhs.trunc, 1000
%cmp20 = icmp eq i16 %rem1850, %div1951
br i1 %cmp20, label %land.lhs.true21, label %if.else28
land.lhs.true21: ; preds = %if.then17
%div2252 = udiv i16 %rem18.lhs.trunc, 100
%rem23.lhs.trunc = trunc i16 %div2252 to i8
%rem2353 = urem i8 %rem23.lhs.trunc, 10
%rem2555 = urem i16 %div2454, 10
%3 = zext i8 %rem2353 to i16
%cmp26 = icmp eq i16 %rem2555, %3
br i1 %cmp26, label %if.end29, label %if.else28
if.else28: ; preds = %land.lhs.true21, %if.then17
br label %if.end29
if.end29: ; preds = %land.lhs.true21, %if.then7, %if.then, %if.else28, %if.end13
%retval.0 = phi i32 [ 0, %if.else28 ], [ undef, %if.end13 ], [ %., %if.then ], [ %.45, %if.then7 ], [ 1, %land.lhs.true21 ]
ret i32 %retval.0
}
; 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn 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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree 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 = { nounwind willreturn memory(read) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !10}
!13 = distinct !{!13, !9}
|
#include <stdio.h>
#include <stdlib.h>
int compare(const void* a, const void* b)
{
return (*(int*)a - *(int*)b);
}
int a[2000000];
int main(void)
{
int n;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%d", &a[i]);
}
qsort(a, n, sizeof(int), compare);
printf("%d", a[0]);
for (i = 1; i < n; i++){
printf(" %d", a[i]);
}
printf("\n");
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_274936/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_274936/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@a = dso_local global [2000000 x i32] zeroinitializer, align 16
@.str.1 = 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 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [2000000 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull @a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #6
%3 = load i32, ptr @a, align 16, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp421 = icmp sgt i32 %4, 1
br i1 %cmp421, label %for.body6, label %for.end12
for.body6: ; preds = %for.end, %for.body6
%indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.body6 ], [ 1, %for.end ]
%arrayidx8 = getelementptr inbounds [2000000 x i32], ptr @a, i64 0, i64 %indvars.iv25
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
%indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next26, %7
br i1 %cmp4, label %for.body6, label %for.end12, !llvm.loop !11
for.end12: ; preds = %for.body6, %for.end
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: 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 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
long long ab[100005];
struct p{
long long g,r,rc;
} a[400000];
long long gcd (long long a,long long b )
{
long long c;
while ( a != 0 ) {
c = a; a = b%a; b = c;
}
return b;
}
int main() {
long long n,m,p,q,t,g,i,j,k,b,c,rc,r;
scanf("%lld",&n);
i=131071;
for(i=1;i<=n;++i){
scanf("%lld",&ab[i]);
a[131071+i].g=ab[i];
a[131071+i].r=ab[i];
a[131071+i].rc=1;
}
for(i=n+1;i<=131072;++i){
a[131071+i].g=0;;
a[131071+i].r=10000000000000;
a[131071+i].rc=0;
}
for(i=131071;i>0;--i){
a[i].g=gcd(a[2*i].g,a[2*i+1].g);
if(a[2*i].r==a[2*i+1].r){ a[i].r=a[2*i].r;a[i].rc=a[2*i].rc+a[2*i+1].rc;}
else if(a[2*i].r<a[2*i+1].r) { a[i].r=a[2*i].r;a[i].rc=a[2*i].rc;}
else { a[i].r=a[2*i+1].r;a[i].rc=a[2*i+1].rc;}
}
scanf("%lld",&t);
while(t--){
scanf("%lld %lld",&j,&k);
p=131071+j;q=131071+k;
g=0;
rc=0;
r=1000000000000000;
while(p>0&&q>0&&p<=q){
if(p==q){
g=gcd(g,a[p].g);
if(r>a[p].r){ r=a[p].r,rc=a[p].rc;}
else if(r==a[p].r){ rc+=a[p].rc;}
break;
}
if(p%2!=0){
if(q%2==0){
g=gcd(g,gcd(a[p].g,a[q].g));
if(r>a[p].r){ r=a[p].r,rc=a[p].rc;}
else if(r==a[p].r){ rc+=a[p].rc;}
if(r>a[q].r){ r=a[q].r,rc=a[q].rc;}
else if(r==a[q].r){ rc+=a[q].rc;}
p=p/2 +1;q=q/2 -1;
}else{
g=gcd(g,a[p].g);
if(r>a[p].r){ r=a[p].r,rc=a[p].rc;}
else if(r==a[p].r){ rc+=a[p].rc;}
p=p/2+1; q=q/2;
}
}else{
if(q%2==0){
g=gcd(g,a[q].g);
if(r>a[q].r){ r=a[q].r,rc=a[q].rc;}
else if(r==a[q].r){ rc+=a[q].rc;}
p=p/2; q=q/2 -1;
}else{
p=p/2;q=q/2;
}
}
}
if(r==g) printf("%lld\n",k-j+1-rc);
else printf("%lld\n",k-j+1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27500/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27500/source.c"
target datalayout = "e-m:e-p270: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.p = type { i64, i64, i64 }
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@ab = dso_local global [100005 x i64] zeroinitializer, align 16
@a = dso_local local_unnamed_addr global [400000 x %struct.p] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp eq i64 %a, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %rem, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %a.addr.06, %while.body ], [ %b, %entry ]
%rem = srem i64 %b.addr.05, %a.addr.06
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%b.addr.0.lcssa = phi i64 [ %b, %entry ], [ %a.addr.06, %while.body ]
ret i64 %b.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
%t = alloca i64, align 8
%j = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %j) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !7
%cmp.not417 = icmp slt i64 %0, 1
br i1 %cmp.not417, label %for.body15.preheader, label %for.body
for.cond13.preheader: ; preds = %for.body
%cmp14419 = icmp slt i64 %3, 131072
br i1 %cmp14419, label %for.body15.preheader, label %for.body30.preheader
for.body15.preheader: ; preds = %entry, %for.cond13.preheader
%i.1.in420.ph = phi i64 [ %0, %entry ], [ %3, %for.cond13.preheader ]
%xtraiter = and i64 %i.1.in420.ph, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body15.prol.loopexit, label %for.body15.prol
for.body15.prol: ; preds = %for.body15.preheader
%i.1.prol = add i64 %i.1.in420.ph, 1
%add16.prol = add nsw i64 %i.1.in420.ph, 131072
%arrayidx17.prol = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16.prol
store i64 0, ptr %arrayidx17.prol, align 8, !tbaa !11
%r21.prol = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16.prol, i32 1
store i64 10000000000000, ptr %r21.prol, align 8, !tbaa !13
%rc24.prol = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16.prol, i32 2
store i64 0, ptr %rc24.prol, align 8, !tbaa !14
br label %for.body15.prol.loopexit
for.body15.prol.loopexit: ; preds = %for.body15.prol, %for.body15.preheader
%i.1.in420.unr = phi i64 [ %i.1.in420.ph, %for.body15.preheader ], [ %i.1.prol, %for.body15.prol ]
%1 = icmp eq i64 %i.1.in420.ph, 131071
br i1 %1, label %for.body30.preheader, label %for.body15
for.body: ; preds = %entry, %for.body
%i.0418 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100005 x i64], ptr @ab, i64 0, i64 %i.0418
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i64, ptr %arrayidx, align 8, !tbaa !7
%add = add nuw nsw i64 %i.0418, 131071
%arrayidx3 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add
store i64 %2, ptr %arrayidx3, align 8, !tbaa !11
%r8 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add, i32 1
store i64 %2, ptr %r8, align 8, !tbaa !13
%rc11 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add, i32 2
store i64 1, ptr %rc11, align 8, !tbaa !14
%inc = add nuw nsw i64 %i.0418, 1
%3 = load i64, ptr %n, align 8, !tbaa !7
%cmp.not.not = icmp slt i64 %i.0418, %3
br i1 %cmp.not.not, label %for.body, label %for.cond13.preheader, !llvm.loop !15
for.body15: ; preds = %for.body15.prol.loopexit, %for.body15
%i.1.in420 = phi i64 [ %i.1.1, %for.body15 ], [ %i.1.in420.unr, %for.body15.prol.loopexit ]
%add16 = add nsw i64 %i.1.in420, 131072
%arrayidx17 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16
store i64 0, ptr %arrayidx17, align 8, !tbaa !11
%r21 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16, i32 1
store i64 10000000000000, ptr %r21, align 8, !tbaa !13
%rc24 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16, i32 2
store i64 0, ptr %rc24, align 8, !tbaa !14
%i.1.1 = add i64 %i.1.in420, 2
%add16.1 = add i64 %i.1.in420, 131073
%arrayidx17.1 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16.1
store i64 0, ptr %arrayidx17.1, align 8, !tbaa !11
%r21.1 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16.1, i32 1
store i64 10000000000000, ptr %r21.1, align 8, !tbaa !13
%rc24.1 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add16.1, i32 2
store i64 0, ptr %rc24.1, align 8, !tbaa !14
%exitcond.not.1 = icmp eq i64 %i.1.1, 131072
br i1 %exitcond.not.1, label %for.body30.preheader, label %for.body15, !llvm.loop !16
for.body30.preheader: ; preds = %for.body15.prol.loopexit, %for.body15, %for.cond13.preheader
br label %for.body30
for.body30: ; preds = %for.body30.preheader, %for.inc96
%i.2421 = phi i64 [ %dec, %for.inc96 ], [ 131071, %for.body30.preheader ]
%mul = shl nuw nsw i64 %i.2421, 1
%arrayidx31 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %mul
%4 = load i64, ptr %arrayidx31, align 16, !tbaa !11
%add34 = or i64 %mul, 1
%arrayidx35 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add34
%5 = load i64, ptr %arrayidx35, align 8, !tbaa !11
%cmp.not4.i = icmp eq i64 %4, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %for.body30, %while.body.i
%a.addr.06.i = phi i64 [ %rem.i, %while.body.i ], [ %4, %for.body30 ]
%b.addr.05.i = phi i64 [ %a.addr.06.i, %while.body.i ], [ %5, %for.body30 ]
%rem.i = srem i64 %b.addr.05.i, %a.addr.06.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %for.body30
%b.addr.0.lcssa.i = phi i64 [ %5, %for.body30 ], [ %a.addr.06.i, %while.body.i ]
%arrayidx38 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %i.2421
store i64 %b.addr.0.lcssa.i, ptr %arrayidx38, align 8, !tbaa !11
%r42 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %mul, i32 1
%6 = load i64, ptr %r42, align 8, !tbaa !13
%r46 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add34, i32 1
%7 = load i64, ptr %r46, align 16, !tbaa !13
%cmp47 = icmp eq i64 %6, %7
br i1 %cmp47, label %if.then, label %if.else
if.then: ; preds = %gcd.exit
%r52 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %i.2421, i32 1
store i64 %6, ptr %r52, align 8, !tbaa !13
%rc55 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %mul, i32 2
%8 = load i64, ptr %rc55, align 16, !tbaa !14
%rc59 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add34, i32 2
%9 = load i64, ptr %rc59, align 8, !tbaa !14
%add60 = add nsw i64 %9, %8
%rc62 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %i.2421, i32 2
store i64 %add60, ptr %rc62, align 8, !tbaa !14
br label %for.inc96
if.else: ; preds = %gcd.exit
%cmp70 = icmp slt i64 %6, %7
%r76 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %i.2421, i32 1
%rc81 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %i.2421, i32 2
br i1 %cmp70, label %if.then71, label %if.else82
if.then71: ; preds = %if.else
store i64 %6, ptr %r76, align 8, !tbaa !13
%rc79 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %mul, i32 2
%10 = load i64, ptr %rc79, align 16, !tbaa !14
store i64 %10, ptr %rc81, align 8, !tbaa !14
br label %for.inc96
if.else82: ; preds = %if.else
store i64 %7, ptr %r76, align 8, !tbaa !13
%rc92 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %add34, i32 2
%11 = load i64, ptr %rc92, align 8, !tbaa !14
store i64 %11, ptr %rc81, align 8, !tbaa !14
br label %for.inc96
for.inc96: ; preds = %if.then, %if.else82, %if.then71
%dec = add nsw i64 %i.2421, -1
%cmp29 = icmp ugt i64 %i.2421, 1
br i1 %cmp29, label %for.body30, label %for.end97, !llvm.loop !17
for.end97: ; preds = %for.inc96
%call98 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%12 = load i64, ptr %t, align 8, !tbaa !7
%dec99435 = add nsw i64 %12, -1
store i64 %dec99435, ptr %t, align 8, !tbaa !7
%tobool.not436 = icmp eq i64 %12, 0
br i1 %tobool.not436, label %while.end251, label %while.body
while.body: ; preds = %for.end97, %if.end250
%call100 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %j, ptr noundef nonnull %k)
%13 = load i64, ptr %j, align 8, !tbaa !7
%14 = load i64, ptr %k, align 8, !tbaa !7
%cmp104422 = icmp slt i64 %13, -131070
%cmp105423 = icmp slt i64 %14, -131070
%or.cond.not411424 = select i1 %cmp104422, i1 true, i1 %cmp105423
%cmp106.not425 = icmp sgt i64 %13, %14
%or.cond370426 = select i1 %or.cond.not411424, i1 true, i1 %cmp106.not425
br i1 %or.cond370426, label %if.else246, label %while.body107.preheader
while.body107.preheader: ; preds = %while.body
%add102 = add nsw i64 %14, 131071
%add101 = add nsw i64 %13, 131071
br label %while.body107
while.body107: ; preds = %while.body107.preheader, %if.end239
%r.0431 = phi i64 [ %r.5, %if.end239 ], [ 1000000000000000, %while.body107.preheader ]
%rc.0430 = phi i64 [ %rc.5, %if.end239 ], [ 0, %while.body107.preheader ]
%p.0429 = phi i64 [ %p.1, %if.end239 ], [ %add101, %while.body107.preheader ]
%q.0428 = phi i64 [ %q.1, %if.end239 ], [ %add102, %while.body107.preheader ]
%g.0427 = phi i64 [ %g.1, %if.end239 ], [ 0, %while.body107.preheader ]
%cmp108 = icmp eq i64 %p.0429, %q.0428
br i1 %cmp108, label %if.then109, label %if.end131
if.then109: ; preds = %while.body107
%arrayidx110 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429
%15 = load i64, ptr %arrayidx110, align 8, !tbaa !11
%cmp.not4.i371 = icmp eq i64 %g.0427, 0
br i1 %cmp.not4.i371, label %gcd.exit378, label %while.body.i372
while.body.i372: ; preds = %if.then109, %while.body.i372
%a.addr.06.i373 = phi i64 [ %rem.i375, %while.body.i372 ], [ %g.0427, %if.then109 ]
%b.addr.05.i374 = phi i64 [ %a.addr.06.i373, %while.body.i372 ], [ %15, %if.then109 ]
%rem.i375 = srem i64 %b.addr.05.i374, %a.addr.06.i373
%cmp.not.i376 = icmp eq i64 %rem.i375, 0
br i1 %cmp.not.i376, label %gcd.exit378, label %while.body.i372, !llvm.loop !5
gcd.exit378: ; preds = %while.body.i372, %if.then109
%b.addr.0.lcssa.i377 = phi i64 [ %15, %if.then109 ], [ %a.addr.06.i373, %while.body.i372 ]
%r114 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 1
%16 = load i64, ptr %r114, align 8, !tbaa !13
%cmp115 = icmp sgt i64 %r.0431, %16
br i1 %cmp115, label %if.then116, label %if.else121
if.then116: ; preds = %gcd.exit378
%rc120 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 2
%17 = load i64, ptr %rc120, align 8, !tbaa !14
br label %while.end
if.else121: ; preds = %gcd.exit378
%cmp124 = icmp eq i64 %r.0431, %16
br i1 %cmp124, label %if.then125, label %while.end
if.then125: ; preds = %if.else121
%rc127 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 2
%18 = load i64, ptr %rc127, align 8, !tbaa !14
%add128 = add nsw i64 %18, %rc.0430
br label %while.end
if.end131: ; preds = %while.body107
%rem = and i64 %p.0429, 1
%cmp132.not = icmp eq i64 %rem, 0
%rem208 = and i64 %q.0428, 1
%cmp209 = icmp eq i64 %rem208, 0
br i1 %cmp132.not, label %if.else207, label %if.then133
if.then133: ; preds = %if.end131
%arrayidx137 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429
%19 = load i64, ptr %arrayidx137, align 8, !tbaa !11
br i1 %cmp209, label %if.then136, label %if.else181
if.then136: ; preds = %if.then133
%arrayidx139 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %q.0428
%20 = load i64, ptr %arrayidx139, align 8, !tbaa !11
%cmp.not4.i379 = icmp eq i64 %19, 0
br i1 %cmp.not4.i379, label %gcd.exit386, label %while.body.i380
while.body.i380: ; preds = %if.then136, %while.body.i380
%a.addr.06.i381 = phi i64 [ %rem.i383, %while.body.i380 ], [ %19, %if.then136 ]
%b.addr.05.i382 = phi i64 [ %a.addr.06.i381, %while.body.i380 ], [ %20, %if.then136 ]
%rem.i383 = srem i64 %b.addr.05.i382, %a.addr.06.i381
%cmp.not.i384 = icmp eq i64 %rem.i383, 0
br i1 %cmp.not.i384, label %gcd.exit386, label %while.body.i380, !llvm.loop !5
gcd.exit386: ; preds = %while.body.i380, %if.then136
%b.addr.0.lcssa.i385 = phi i64 [ %20, %if.then136 ], [ %a.addr.06.i381, %while.body.i380 ]
%cmp.not4.i387 = icmp eq i64 %g.0427, 0
br i1 %cmp.not4.i387, label %gcd.exit394, label %while.body.i388
while.body.i388: ; preds = %gcd.exit386, %while.body.i388
%a.addr.06.i389 = phi i64 [ %rem.i391, %while.body.i388 ], [ %g.0427, %gcd.exit386 ]
%b.addr.05.i390 = phi i64 [ %a.addr.06.i389, %while.body.i388 ], [ %b.addr.0.lcssa.i385, %gcd.exit386 ]
%rem.i391 = srem i64 %b.addr.05.i390, %a.addr.06.i389
%cmp.not.i392 = icmp eq i64 %rem.i391, 0
br i1 %cmp.not.i392, label %gcd.exit394, label %while.body.i388, !llvm.loop !5
gcd.exit394: ; preds = %while.body.i388, %gcd.exit386
%b.addr.0.lcssa.i393 = phi i64 [ %b.addr.0.lcssa.i385, %gcd.exit386 ], [ %a.addr.06.i389, %while.body.i388 ]
%r144 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 1
%21 = load i64, ptr %r144, align 8, !tbaa !13
%cmp145 = icmp sgt i64 %r.0431, %21
br i1 %cmp145, label %if.then146, label %if.else151
if.then146: ; preds = %gcd.exit394
%rc150 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 2
%22 = load i64, ptr %rc150, align 8, !tbaa !14
br label %if.end160
if.else151: ; preds = %gcd.exit394
%cmp154 = icmp eq i64 %r.0431, %21
br i1 %cmp154, label %if.then155, label %if.end160
if.then155: ; preds = %if.else151
%rc157 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 2
%23 = load i64, ptr %rc157, align 8, !tbaa !14
%add158 = add nsw i64 %23, %rc.0430
br label %if.end160
if.end160: ; preds = %if.else151, %if.then155, %if.then146
%rc.1 = phi i64 [ %22, %if.then146 ], [ %add158, %if.then155 ], [ %rc.0430, %if.else151 ]
%r.1 = phi i64 [ %21, %if.then146 ], [ %r.0431, %if.then155 ], [ %r.0431, %if.else151 ]
%r162 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %q.0428, i32 1
%24 = load i64, ptr %r162, align 8, !tbaa !13
%cmp163 = icmp sgt i64 %r.1, %24
br i1 %cmp163, label %if.then164, label %if.else169
if.then164: ; preds = %if.end160
%rc168 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %q.0428, i32 2
%25 = load i64, ptr %rc168, align 8, !tbaa !14
br label %if.end178
if.else169: ; preds = %if.end160
%cmp172 = icmp eq i64 %r.1, %24
br i1 %cmp172, label %if.then173, label %if.end178
if.then173: ; preds = %if.else169
%rc175 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %q.0428, i32 2
%26 = load i64, ptr %rc175, align 8, !tbaa !14
%add176 = add nsw i64 %26, %rc.1
br label %if.end178
if.end178: ; preds = %if.else169, %if.then173, %if.then164
%rc.2 = phi i64 [ %25, %if.then164 ], [ %add176, %if.then173 ], [ %rc.1, %if.else169 ]
%r.2 = phi i64 [ %24, %if.then164 ], [ %r.1, %if.then173 ], [ %r.1, %if.else169 ]
%div368 = lshr i64 %p.0429, 1
%add179 = add nuw nsw i64 %div368, 1
%div180369 = lshr i64 %q.0428, 1
%sub = add nsw i64 %div180369, -1
br label %if.end239
if.else181: ; preds = %if.then133
%cmp.not4.i395 = icmp eq i64 %g.0427, 0
br i1 %cmp.not4.i395, label %gcd.exit402, label %while.body.i396
while.body.i396: ; preds = %if.else181, %while.body.i396
%a.addr.06.i397 = phi i64 [ %rem.i399, %while.body.i396 ], [ %g.0427, %if.else181 ]
%b.addr.05.i398 = phi i64 [ %a.addr.06.i397, %while.body.i396 ], [ %19, %if.else181 ]
%rem.i399 = srem i64 %b.addr.05.i398, %a.addr.06.i397
%cmp.not.i400 = icmp eq i64 %rem.i399, 0
br i1 %cmp.not.i400, label %gcd.exit402, label %while.body.i396, !llvm.loop !5
gcd.exit402: ; preds = %while.body.i396, %if.else181
%b.addr.0.lcssa.i401 = phi i64 [ %19, %if.else181 ], [ %a.addr.06.i397, %while.body.i396 ]
%r186 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 1
%27 = load i64, ptr %r186, align 8, !tbaa !13
%cmp187 = icmp sgt i64 %r.0431, %27
br i1 %cmp187, label %if.then188, label %if.else193
if.then188: ; preds = %gcd.exit402
%rc192 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 2
%28 = load i64, ptr %rc192, align 8, !tbaa !14
br label %if.end202
if.else193: ; preds = %gcd.exit402
%cmp196 = icmp eq i64 %r.0431, %27
br i1 %cmp196, label %if.then197, label %if.end202
if.then197: ; preds = %if.else193
%rc199 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %p.0429, i32 2
%29 = load i64, ptr %rc199, align 8, !tbaa !14
%add200 = add nsw i64 %29, %rc.0430
br label %if.end202
if.end202: ; preds = %if.else193, %if.then197, %if.then188
%rc.3 = phi i64 [ %28, %if.then188 ], [ %add200, %if.then197 ], [ %rc.0430, %if.else193 ]
%r.3 = phi i64 [ %27, %if.then188 ], [ %r.0431, %if.then197 ], [ %r.0431, %if.else193 ]
%div203366 = lshr i64 %p.0429, 1
%add204 = add nuw nsw i64 %div203366, 1
%div205367 = lshr i64 %q.0428, 1
br label %if.end239
if.else207: ; preds = %if.end131
br i1 %cmp209, label %if.then210, label %if.else235
if.then210: ; preds = %if.else207
%arrayidx211 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %q.0428
%30 = load i64, ptr %arrayidx211, align 8, !tbaa !11
%cmp.not4.i403 = icmp eq i64 %g.0427, 0
br i1 %cmp.not4.i403, label %gcd.exit410, label %while.body.i404
while.body.i404: ; preds = %if.then210, %while.body.i404
%a.addr.06.i405 = phi i64 [ %rem.i407, %while.body.i404 ], [ %g.0427, %if.then210 ]
%b.addr.05.i406 = phi i64 [ %a.addr.06.i405, %while.body.i404 ], [ %30, %if.then210 ]
%rem.i407 = srem i64 %b.addr.05.i406, %a.addr.06.i405
%cmp.not.i408 = icmp eq i64 %rem.i407, 0
br i1 %cmp.not.i408, label %gcd.exit410, label %while.body.i404, !llvm.loop !5
gcd.exit410: ; preds = %while.body.i404, %if.then210
%b.addr.0.lcssa.i409 = phi i64 [ %30, %if.then210 ], [ %a.addr.06.i405, %while.body.i404 ]
%r215 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %q.0428, i32 1
%31 = load i64, ptr %r215, align 8, !tbaa !13
%cmp216 = icmp sgt i64 %r.0431, %31
br i1 %cmp216, label %if.then217, label %if.else222
if.then217: ; preds = %gcd.exit410
%rc221 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %q.0428, i32 2
%32 = load i64, ptr %rc221, align 8, !tbaa !14
br label %if.end231
if.else222: ; preds = %gcd.exit410
%cmp225 = icmp eq i64 %r.0431, %31
br i1 %cmp225, label %if.then226, label %if.end231
if.then226: ; preds = %if.else222
%rc228 = getelementptr inbounds [400000 x %struct.p], ptr @a, i64 0, i64 %q.0428, i32 2
%33 = load i64, ptr %rc228, align 8, !tbaa !14
%add229 = add nsw i64 %33, %rc.0430
br label %if.end231
if.end231: ; preds = %if.else222, %if.then226, %if.then217
%rc.4 = phi i64 [ %32, %if.then217 ], [ %add229, %if.then226 ], [ %rc.0430, %if.else222 ]
%r.4 = phi i64 [ %31, %if.then217 ], [ %r.0431, %if.then226 ], [ %r.0431, %if.else222 ]
%div232364 = lshr i64 %p.0429, 1
%div233365 = lshr i64 %q.0428, 1
%sub234 = add nsw i64 %div233365, -1
br label %if.end239
if.else235: ; preds = %if.else207
%div236362 = lshr i64 %p.0429, 1
%div237363 = lshr i64 %q.0428, 1
br label %if.end239
if.end239: ; preds = %if.end231, %if.else235, %if.end178, %if.end202
%g.1 = phi i64 [ %b.addr.0.lcssa.i393, %if.end178 ], [ %b.addr.0.lcssa.i401, %if.end202 ], [ %b.addr.0.lcssa.i409, %if.end231 ], [ %g.0427, %if.else235 ]
%q.1 = phi i64 [ %sub, %if.end178 ], [ %div205367, %if.end202 ], [ %sub234, %if.end231 ], [ %div237363, %if.else235 ]
%p.1 = phi i64 [ %add179, %if.end178 ], [ %add204, %if.end202 ], [ %div232364, %if.end231 ], [ %div236362, %if.else235 ]
%rc.5 = phi i64 [ %rc.2, %if.end178 ], [ %rc.3, %if.end202 ], [ %rc.4, %if.end231 ], [ %rc.0430, %if.else235 ]
%r.5 = phi i64 [ %r.2, %if.end178 ], [ %r.3, %if.end202 ], [ %r.4, %if.end231 ], [ %r.0431, %if.else235 ]
%cmp104 = icmp eq i64 %p.1, 0
%cmp105 = icmp slt i64 %q.1, 1
%or.cond.not411 = select i1 %cmp104, i1 true, i1 %cmp105
%cmp106.not = icmp sgt i64 %p.1, %q.1
%or.cond370 = select i1 %or.cond.not411, i1 true, i1 %cmp106.not
br i1 %or.cond370, label %while.end, label %while.body107, !llvm.loop !18
while.end: ; preds = %if.end239, %if.then116, %if.then125, %if.else121
%g.2 = phi i64 [ %b.addr.0.lcssa.i377, %if.then116 ], [ %b.addr.0.lcssa.i377, %if.then125 ], [ %b.addr.0.lcssa.i377, %if.else121 ], [ %g.1, %if.end239 ]
%rc.6 = phi i64 [ %17, %if.then116 ], [ %add128, %if.then125 ], [ %rc.0430, %if.else121 ], [ %rc.5, %if.end239 ]
%r.6 = phi i64 [ %16, %if.then116 ], [ %r.0431, %if.then125 ], [ %r.0431, %if.else121 ], [ %r.5, %if.end239 ]
%cmp240 = icmp eq i64 %r.6, %g.2
br i1 %cmp240, label %if.then241, label %if.else246
if.then241: ; preds = %while.end
%34 = add i64 %14, 1
%35 = add i64 %13, %rc.6
%sub244 = sub i64 %34, %35
br label %if.end250
if.else246: ; preds = %while.body, %while.end
%reass.sub = sub i64 %14, %13
%add248 = add i64 %reass.sub, 1
br label %if.end250
if.end250: ; preds = %if.else246, %if.then241
%add248.sink = phi i64 [ %add248, %if.else246 ], [ %sub244, %if.then241 ]
%call249 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add248.sink)
%36 = load i64, ptr %t, align 8, !tbaa !7
%dec99 = add nsw i64 %36, -1
store i64 %dec99, ptr %t, align 8, !tbaa !7
%tobool.not = icmp eq i64 %36, 0
br i1 %tobool.not, label %while.end251, label %while.body, !llvm.loop !19
while.end251: ; preds = %if.end250, %for.end97
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %j) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !8, i64 0}
!12 = !{!"p", !8, i64 0, !8, i64 8, !8, i64 16}
!13 = !{!12, !8, i64 8}
!14 = !{!12, !8, i64 16}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6}
|
#include <stdio.h>
void quickSort( int *, int );
void quickSort_body( int *, int, int );
int median( int, int, int );
void insertionSort( int *, int );
int n, data[ 1000000 ];
int main( void ) {
int i;
scanf( "%d", &n );
for ( i = n; i--; scanf( "%d", data + i ) ) ;
quickSort( data, n );
for ( i = 0; i < n - 1; i++ )
printf( "%d ", data[ i ] );
printf( "%d\n", data[ n - 1 ] );
return 0;
}
void quickSort( int *data, int n ) {
quickSort_body( data, 0, n - 1 );
}
void quickSort_body( int *data, int l, int r ) {
if ( l < r ) {
int i = l, j = r, tmp;
int pivot = median( data[ i ], data[ ( i + j ) / 2 ], data[ j ] );
while ( 1 ) {
while ( data[ i ] < pivot )
i++;
while ( pivot < data [ j ] )
j--;
if ( i >= j )
break;
tmp = data[ i ];
data[ i ] = data[ j ];
data[ j ] = tmp;
i++;
j--;
}
if ( i - l < 20 )
insertionSort( data + l, i - l );
else
quickSort_body( data, l, i - 1 );
if ( r - j < 20 )
insertionSort( data + j + 1, r - j );
else
quickSort_body( data, j + 1, r );
}
}
int median( int x, int y, int z ) {
if ( x < y )
if ( y < z )
return y;
else
if ( z < x )
return x;
else
return z;
else
if ( z < y )
return y;
else
if ( x < z )
return x;
else
return z;
}
void insertionSort( int *data, int n ) {
int i, j, tmp;
for ( i = 1; i < n; i++ ) {
tmp = data[ i ];
if ( data[ i - 1 ] > tmp ) {
j = i;
do {
data[ j ] = data[ j - 1 ];
j--;
} while ( j > 0 && data[ j - 1 ] > tmp );
data[ j ] = tmp;
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275043/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275043/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@data = dso_local global [1000000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%tobool.not15 = icmp eq i32 %0, 0
br i1 %tobool.not15, label %for.end.thread, label %for.inc.preheader
for.end.thread: ; preds = %entry
tail call void @quickSort_body(ptr noundef nonnull @data, i32 noundef 0, i32 noundef -1)
br label %for.end.for.end6_crit_edge
for.inc.preheader: ; preds = %entry
%1 = sext i32 %0 to i64
br label %for.inc
for.inc: ; preds = %for.inc.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.inc.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%add.ptr = getelementptr inbounds i32, ptr @data, i64 %indvars.iv.next
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%2 = and i64 %indvars.iv.next, 4294967295
%tobool.not = icmp eq i64 %2, 0
br i1 %tobool.not, label %for.end, label %for.inc, !llvm.loop !9
for.end: ; preds = %for.inc
%.pre = load i32, ptr @n, align 4, !tbaa !5
%sub.i = add nsw i32 %.pre, -1
tail call void @quickSort_body(ptr noundef nonnull @data, i32 noundef 0, i32 noundef %sub.i)
%cmp18 = icmp sgt i32 %.pre, 1
br i1 %cmp18, label %for.body3, label %for.end.for.end6_crit_edge
for.end.for.end6_crit_edge: ; preds = %for.end.thread, %for.end
%sub.i28 = phi i32 [ -1, %for.end.thread ], [ %sub.i, %for.end ]
%.pre25 = sext i32 %sub.i28 to i64
br label %for.end6
for.body3: ; preds = %for.end, %for.body3
%indvars.iv22 = phi i64 [ %indvars.iv.next23, %for.body3 ], [ 0, %for.end ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr @data, i64 0, i64 %indvars.iv22
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%indvars.iv.next23 = add nuw nsw i64 %indvars.iv22, 1
%4 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
%5 = sext i32 %sub to i64
%cmp = icmp slt i64 %indvars.iv.next23, %5
br i1 %cmp, label %for.body3, label %for.end6, !llvm.loop !11
for.end6: ; preds = %for.body3, %for.end.for.end6_crit_edge
%idxprom8.pre-phi = phi i64 [ %.pre25, %for.end.for.end6_crit_edge ], [ %5, %for.body3 ]
%arrayidx9 = getelementptr inbounds [1000000 x i32], ptr @data, i64 0, i64 %idxprom8.pre-phi
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%call10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %data, i32 noundef %n) local_unnamed_addr #2 {
entry:
%sub = add nsw i32 %n, -1
tail call void @quickSort_body(ptr noundef %data, i32 noundef 0, i32 noundef %sub)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort_body(ptr nocapture noundef %data, i32 noundef %l, i32 noundef %r) local_unnamed_addr #2 {
entry:
%cmp116 = icmp slt i32 %l, %r
br i1 %cmp116, label %if.then.lr.ph, label %if.end44
if.then.lr.ph: ; preds = %entry
%idxprom3 = sext i32 %r to i64
%arrayidx4 = getelementptr inbounds i32, ptr %data, i64 %idxprom3
br label %if.then
tailrecurse: ; preds = %if.end33
%add42 = add nsw i32 %8, 1
%cmp = icmp slt i32 %add42, %r
br i1 %cmp, label %if.then, label %if.end44
if.then: ; preds = %if.then.lr.ph, %tailrecurse
%l.tr117 = phi i32 [ %l, %if.then.lr.ph ], [ %add42, %tailrecurse ]
%idxprom = sext i32 %l.tr117 to i64
%arrayidx = getelementptr inbounds i32, ptr %data, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %l.tr117, %r
%div = sdiv i32 %add, 2
%idxprom1 = sext i32 %div to i64
%arrayidx2 = getelementptr inbounds i32, ptr %data, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp.i = icmp slt i32 %0, %1
br i1 %cmp.i, label %if.then.i, label %if.else6.i
if.then.i: ; preds = %if.then
%cmp1.i = icmp slt i32 %1, %2
br i1 %cmp1.i, label %median.exit, label %if.else.i
if.else.i: ; preds = %if.then.i
%x.z.i = tail call i32 @llvm.smax.i32(i32 %2, i32 %0)
br label %median.exit
if.else6.i: ; preds = %if.then
%cmp7.i = icmp slt i32 %2, %1
br i1 %cmp7.i, label %median.exit, label %if.else9.i
if.else9.i: ; preds = %if.else6.i
%x.z26.i = tail call i32 @llvm.smin.i32(i32 %0, i32 %2)
br label %median.exit
median.exit: ; preds = %if.then.i, %if.else.i, %if.else6.i, %if.else9.i
%retval.0.i = phi i32 [ %1, %if.then.i ], [ %x.z.i, %if.else.i ], [ %1, %if.else6.i ], [ %x.z26.i, %if.else9.i ]
br label %while.cond
while.cond: ; preds = %if.end, %median.exit
%j.0 = phi i32 [ %r, %median.exit ], [ %dec27, %if.end ]
%i.0 = phi i32 [ %l.tr117, %median.exit ], [ %inc26, %if.end ]
%3 = sext i32 %i.0 to i64
br label %while.cond5
while.cond5: ; preds = %while.cond5, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond5 ], [ %3, %while.cond ]
%arrayidx7 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8 = icmp slt i32 %4, %retval.0.i
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp8, label %while.cond5, label %while.cond10.preheader, !llvm.loop !12
while.cond10.preheader: ; preds = %while.cond5
%arrayidx7.le = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
%5 = trunc i64 %indvars.iv to i32
%6 = sext i32 %j.0 to i64
br label %while.cond10
while.cond10: ; preds = %while.cond10, %while.cond10.preheader
%indvars.iv123 = phi i64 [ %indvars.iv.next124, %while.cond10 ], [ %6, %while.cond10.preheader ]
%arrayidx12 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv123
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp slt i32 %retval.0.i, %7
%indvars.iv.next124 = add i64 %indvars.iv123, -1
br i1 %cmp13, label %while.cond10, label %while.end15, !llvm.loop !13
while.end15: ; preds = %while.cond10
%arrayidx12.le = getelementptr inbounds i32, ptr %data, i64 %indvars.iv123
%8 = trunc i64 %indvars.iv123 to i32
%cmp16.not = icmp slt i32 %5, %8
br i1 %cmp16.not, label %if.end, label %while.end28
if.end: ; preds = %while.end15
store i32 %7, ptr %arrayidx7.le, align 4, !tbaa !5
store i32 %4, ptr %arrayidx12.le, align 4, !tbaa !5
%inc26 = add nsw i32 %5, 1
%dec27 = add nsw i32 %8, -1
br label %while.cond
while.end28: ; preds = %while.end15
%sub = sub nsw i32 %5, %l.tr117
%cmp29 = icmp slt i32 %sub, 20
br i1 %cmp29, label %if.then30, label %if.else
if.then30: ; preds = %while.end28
%cmp32.i = icmp sgt i32 %sub, 1
br i1 %cmp32.i, label %for.body.preheader.i, label %if.end33
for.body.preheader.i: ; preds = %if.then30
%wide.trip.count.i = zext i32 %sub to i64
%invariant.gep.i = getelementptr i32, ptr %arrayidx, i64 -1
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i
%10 = load i32, ptr %gep.i, align 4, !tbaa !5
%cmp3.i = icmp sgt i32 %10, %9
br i1 %cmp3.i, label %do.body.i, label %for.inc.i
do.body.i: ; preds = %for.body.i, %land.rhs.i
%indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %land.rhs.i ], [ %indvars.iv.i, %for.body.i ]
%indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1
%arrayidx6.i = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv.next35.i
%11 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
%arrayidx8.i = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv34.i
store i32 %11, ptr %arrayidx8.i, align 4, !tbaa !5
%cmp9.i = icmp sgt i64 %indvars.iv34.i, 1
br i1 %cmp9.i, label %land.rhs.i, label %do.end.i
land.rhs.i: ; preds = %do.body.i
%12 = add nuw i64 %indvars.iv34.i, 4294967294
%idxprom11.i = and i64 %12, 4294967295
%arrayidx12.i = getelementptr inbounds i32, ptr %arrayidx, i64 %idxprom11.i
%13 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5
%cmp13.i = icmp sgt i32 %13, %9
br i1 %cmp13.i, label %do.body.i, label %do.end.i, !llvm.loop !14
do.end.i: ; preds = %land.rhs.i, %do.body.i
%idxprom5.lcssa.i = phi i64 [ 0, %do.body.i ], [ %indvars.iv.next35.i, %land.rhs.i ]
%arrayidx6.le.i = getelementptr inbounds i32, ptr %arrayidx, i64 %idxprom5.lcssa.i
store i32 %9, ptr %arrayidx6.le.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %do.end.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %if.end33, label %for.body.i, !llvm.loop !15
if.else: ; preds = %while.end28
%sub32 = add nsw i32 %5, -1
tail call void @quickSort_body(ptr noundef nonnull %data, i32 noundef %l.tr117, i32 noundef %sub32)
br label %if.end33
if.end33: ; preds = %for.inc.i, %if.then30, %if.else
%sub34 = sub nsw i32 %r, %8
%cmp35 = icmp slt i32 %sub34, 20
br i1 %cmp35, label %if.then36, label %tailrecurse
if.then36: ; preds = %if.end33
%add.ptr39 = getelementptr inbounds i32, ptr %arrayidx12.le, i64 1
%cmp32.i88 = icmp sgt i32 %sub34, 1
br i1 %cmp32.i88, label %for.body.preheader.i89, label %if.end44
for.body.preheader.i89: ; preds = %if.then36
%wide.trip.count.i90 = zext i32 %sub34 to i64
br label %for.body.i92
for.body.i92: ; preds = %for.inc.i97, %for.body.preheader.i89
%indvars.iv.i93 = phi i64 [ 1, %for.body.preheader.i89 ], [ %indvars.iv.next.i98, %for.inc.i97 ]
%arrayidx.i94 = getelementptr inbounds i32, ptr %add.ptr39, i64 %indvars.iv.i93
%14 = load i32, ptr %arrayidx.i94, align 4, !tbaa !5
%gep.i95 = getelementptr i32, ptr %arrayidx12.le, i64 %indvars.iv.i93
%15 = load i32, ptr %gep.i95, align 4, !tbaa !5
%cmp3.i96 = icmp sgt i32 %15, %14
br i1 %cmp3.i96, label %do.body.i100, label %for.inc.i97
do.body.i100: ; preds = %for.body.i92, %land.rhs.i109
%indvars.iv34.i101 = phi i64 [ %indvars.iv.next35.i102, %land.rhs.i109 ], [ %indvars.iv.i93, %for.body.i92 ]
%arrayidx6.i103 = getelementptr inbounds i32, ptr %arrayidx12.le, i64 %indvars.iv34.i101
%16 = load i32, ptr %arrayidx6.i103, align 4, !tbaa !5
%arrayidx8.i104 = getelementptr inbounds i32, ptr %add.ptr39, i64 %indvars.iv34.i101
store i32 %16, ptr %arrayidx8.i104, align 4, !tbaa !5
%cmp9.i105 = icmp sgt i64 %indvars.iv34.i101, 1
br i1 %cmp9.i105, label %land.rhs.i109, label %do.end.i106
land.rhs.i109: ; preds = %do.body.i100
%indvars.iv.next35.i102 = add nsw i64 %indvars.iv34.i101, -1
%17 = add nuw i64 %indvars.iv34.i101, 4294967294
%idxprom11.i110 = and i64 %17, 4294967295
%arrayidx12.i111 = getelementptr inbounds i32, ptr %add.ptr39, i64 %idxprom11.i110
%18 = load i32, ptr %arrayidx12.i111, align 4, !tbaa !5
%cmp13.i112 = icmp sgt i32 %18, %14
br i1 %cmp13.i112, label %do.body.i100, label %do.end.i106, !llvm.loop !14
do.end.i106: ; preds = %land.rhs.i109, %do.body.i100
%idxprom5.lcssa.i107 = phi i64 [ 0, %do.body.i100 ], [ %indvars.iv.next35.i102, %land.rhs.i109 ]
%arrayidx6.le.i108 = getelementptr inbounds i32, ptr %add.ptr39, i64 %idxprom5.lcssa.i107
store i32 %14, ptr %arrayidx6.le.i108, align 4, !tbaa !5
br label %for.inc.i97
for.inc.i97: ; preds = %do.end.i106, %for.body.i92
%indvars.iv.next.i98 = add nuw nsw i64 %indvars.iv.i93, 1
%exitcond.not.i99 = icmp eq i64 %indvars.iv.next.i98, %wide.trip.count.i90
br i1 %exitcond.not.i99, label %if.end44, label %for.body.i92, !llvm.loop !15
if.end44: ; preds = %tailrecurse, %for.inc.i97, %entry, %if.then36
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @median(i32 noundef %x, i32 noundef %y, i32 noundef %z) local_unnamed_addr #3 {
entry:
%cmp = icmp slt i32 %x, %y
br i1 %cmp, label %if.then, label %if.else6
if.then: ; preds = %entry
%cmp1 = icmp slt i32 %y, %z
br i1 %cmp1, label %return, label %if.else
if.else: ; preds = %if.then
%x.z = tail call i32 @llvm.smax.i32(i32 %z, i32 %x)
br label %return
if.else6: ; preds = %entry
%cmp7 = icmp slt i32 %z, %y
br i1 %cmp7, label %return, label %if.else9
if.else9: ; preds = %if.else6
%x.z26 = tail call i32 @llvm.smin.i32(i32 %x, i32 %z)
br label %return
return: ; preds = %if.else9, %if.else6, %if.else, %if.then
%retval.0 = phi i32 [ %y, %if.then ], [ %x.z, %if.else ], [ %y, %if.else6 ], [ %x.z26, %if.else9 ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @insertionSort(ptr nocapture noundef %data, i32 noundef %n) local_unnamed_addr #4 {
entry:
%cmp32 = icmp sgt i32 %n, 1
br i1 %cmp32, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%invariant.gep = getelementptr i32, ptr %data, i64 -1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%1 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %1, %0
br i1 %cmp3, label %do.body, label %for.inc
do.body: ; preds = %for.body, %land.rhs
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %land.rhs ], [ %indvars.iv, %for.body ]
%indvars.iv.next35 = add nsw i64 %indvars.iv34, -1
%arrayidx6 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.next35
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%arrayidx8 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv34
store i32 %2, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp sgt i64 %indvars.iv34, 1
br i1 %cmp9, label %land.rhs, label %do.end
land.rhs: ; preds = %do.body
%3 = add nuw i64 %indvars.iv34, 4294967294
%idxprom11 = and i64 %3, 4294967295
%arrayidx12 = getelementptr inbounds i32, ptr %data, i64 %idxprom11
%4 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %4, %0
br i1 %cmp13, label %do.body, label %do.end, !llvm.loop !14
do.end: ; preds = %do.body, %land.rhs
%idxprom5.lcssa = phi i64 [ 0, %do.body ], [ %indvars.iv.next35, %land.rhs ]
%arrayidx6.le = getelementptr inbounds i32, ptr %data, i64 %idxprom5.lcssa
store i32 %0, ptr %arrayidx6.le, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %do.end
%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 !15
for.end: ; preds = %for.inc, %entry
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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(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 #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
#include<stdlib.h>
#define N 1000000
int sort(const void*a,const void*b)
{
return (*(int*)a-*(int*)b);
}
int main(){
int n,i;
static int a[N];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
qsort(a,n,sizeof(int),sort);
for(i=0;i<n-1;i++){
printf("%d ",a[i]);
}
printf("%d\n",a[n-1]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275100/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275100/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@main.a = internal global [1000000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr @main.a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull @main.a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @sort) #5
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp324 = icmp sgt i32 %3, 1
br i1 %cmp324, label %for.body5, label %for.end.for.end11_crit_edge
for.end.for.end11_crit_edge: ; preds = %for.end
%sub23 = add nsw i32 %3, -1
%.pre33 = sext i32 %sub23 to i64
br label %for.end11
for.body5: ; preds = %for.end, %for.body5
%indvars.iv30 = phi i64 [ %indvars.iv.next31, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [1000000 x i32], ptr @main.a, i64 0, i64 %indvars.iv30
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = sext i32 %sub to i64
%cmp3 = icmp slt i64 %indvars.iv.next31, %6
br i1 %cmp3, label %for.body5, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.body5, %for.end.for.end11_crit_edge
%idxprom13.pre-phi = phi i64 [ %.pre33, %for.end.for.end11_crit_edge ], [ %6, %for.body5 ]
%arrayidx14 = getelementptr inbounds [1000000 x i32], ptr @main.a, i64 0, i64 %idxprom13.pre-phi
%7 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int PN(int A,int B){
int i;
int a,b,c,d,f,e;
int count=0;
for(i=A;i<=B;i++){
a=i/1000;
b=i/100;
c=i-b*100;
d=c/10;
f=c-10*d;
e=10*f+d;
if(a==e){
count++;
}
}
return count;
}
int main(){
int A,B;
scanf("%d%d",&A,&B);
printf("%d",PN(A,B));
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275144/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275144/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @PN(i32 noundef %A, i32 noundef %B) local_unnamed_addr #0 {
entry:
%cmp.not16 = icmp sgt i32 %A, %B
br i1 %cmp.not16, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = add i32 %B, 1
%1 = add i32 %A, 1
%smax = tail call i32 @llvm.smax.i32(i32 %0, i32 %1)
%2 = sub i32 %smax, %A
%min.iters.check = icmp ult i32 %2, 8
br i1 %min.iters.check, label %for.body.preheader21, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %2, -8
%ind.end = add i32 %n.vec, %A
%.splatinsert = insertelement <4 x i32> poison, i32 %A, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
%vec.phi19 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%3 = sdiv <4 x i32> %vec.ind, <i32 1000, i32 1000, i32 1000, i32 1000>
%4 = sdiv <4 x i32> %step.add, <i32 1000, i32 1000, i32 1000, i32 1000>
%5 = srem <4 x i32> %vec.ind, <i32 100, i32 100, i32 100, i32 100>
%6 = srem <4 x i32> %step.add, <i32 100, i32 100, i32 100, i32 100>
%7 = trunc <4 x i32> %5 to <4 x i8>
%8 = trunc <4 x i32> %6 to <4 x i8>
%9 = sdiv <4 x i8> %7, <i8 10, i8 10, i8 10, i8 10>
%10 = sdiv <4 x i8> %8, <i8 10, i8 10, i8 10, i8 10>
%11 = sext <4 x i8> %9 to <4 x i32>
%12 = sext <4 x i8> %10 to <4 x i32>
%13 = mul nsw <4 x i32> %11, <i32 -10, i32 -10, i32 -10, i32 -10>
%14 = mul nsw <4 x i32> %12, <i32 -10, i32 -10, i32 -10, i32 -10>
%15 = add nsw <4 x i32> %13, %5
%16 = add nsw <4 x i32> %14, %6
%17 = mul nsw <4 x i32> %15, <i32 10, i32 10, i32 10, i32 10>
%18 = mul nsw <4 x i32> %16, <i32 10, i32 10, i32 10, i32 10>
%19 = add nsw <4 x i32> %17, %11
%20 = add nsw <4 x i32> %18, %12
%21 = icmp eq <4 x i32> %3, %19
%22 = icmp eq <4 x i32> %4, %20
%23 = zext <4 x i1> %21 to <4 x i32>
%24 = zext <4 x i1> %22 to <4 x i32>
%25 = add <4 x i32> %vec.phi, %23
%26 = add <4 x i32> %vec.phi19, %24
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%27 = icmp eq i32 %index.next, %n.vec
br i1 %27, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %26, %25
%28 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %2, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader21
for.body.preheader21: ; preds = %for.body.preheader, %middle.block
%count.018.ph = phi i32 [ 0, %for.body.preheader ], [ %28, %middle.block ]
%i.017.ph = phi i32 [ %A, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader21, %for.body
%count.018 = phi i32 [ %spec.select, %for.body ], [ %count.018.ph, %for.body.preheader21 ]
%i.017 = phi i32 [ %inc7, %for.body ], [ %i.017.ph, %for.body.preheader21 ]
%div = sdiv i32 %i.017, 1000
%29 = srem i32 %i.017, 100
%div2.lhs.trunc = trunc i32 %29 to i8
%div215 = sdiv i8 %div2.lhs.trunc, 10
%div2.sext = sext i8 %div215 to i32
%mul3.neg = mul nsw i32 %div2.sext, -10
%sub4 = add nsw i32 %mul3.neg, %29
%mul5 = mul nsw i32 %sub4, 10
%add = add nsw i32 %mul5, %div2.sext
%cmp6 = icmp eq i32 %div, %add
%inc = zext i1 %cmp6 to i32
%spec.select = add nuw nsw i32 %count.018, %inc
%inc7 = add i32 %i.017, 1
%cmp.not = icmp sgt i32 %inc7, %B
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %middle.block, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %28, %middle.block ], [ %spec.select, %for.body ]
ret i32 %count.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%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
%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 !10
%1 = load i32, ptr %B, align 4, !tbaa !10
%cmp.not16.i = icmp sgt i32 %0, %1
br i1 %cmp.not16.i, label %PN.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%2 = add i32 %0, 1
%3 = add i32 %1, 1
%smax = call i32 @llvm.smax.i32(i32 %2, i32 %3)
%4 = sub i32 %smax, %0
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.body.i.preheader5, label %vector.ph
vector.ph: ; preds = %for.body.i.preheader
%n.vec = and i32 %4, -8
%ind.end = add i32 %0, %n.vec
%.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ]
%vec.phi3 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %28, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%5 = sdiv <4 x i32> %vec.ind, <i32 1000, i32 1000, i32 1000, i32 1000>
%6 = sdiv <4 x i32> %step.add, <i32 1000, i32 1000, i32 1000, i32 1000>
%7 = srem <4 x i32> %vec.ind, <i32 100, i32 100, i32 100, i32 100>
%8 = srem <4 x i32> %step.add, <i32 100, i32 100, i32 100, i32 100>
%9 = trunc <4 x i32> %7 to <4 x i8>
%10 = trunc <4 x i32> %8 to <4 x i8>
%11 = sdiv <4 x i8> %9, <i8 10, i8 10, i8 10, i8 10>
%12 = sdiv <4 x i8> %10, <i8 10, i8 10, i8 10, i8 10>
%13 = sext <4 x i8> %11 to <4 x i32>
%14 = sext <4 x i8> %12 to <4 x i32>
%15 = mul nsw <4 x i32> %13, <i32 -10, i32 -10, i32 -10, i32 -10>
%16 = mul nsw <4 x i32> %14, <i32 -10, i32 -10, i32 -10, i32 -10>
%17 = add nsw <4 x i32> %15, %7
%18 = add nsw <4 x i32> %16, %8
%19 = mul nsw <4 x i32> %17, <i32 10, i32 10, i32 10, i32 10>
%20 = mul nsw <4 x i32> %18, <i32 10, i32 10, i32 10, i32 10>
%21 = add nsw <4 x i32> %19, %13
%22 = add nsw <4 x i32> %20, %14
%23 = icmp eq <4 x i32> %5, %21
%24 = icmp eq <4 x i32> %6, %22
%25 = zext <4 x i1> %23 to <4 x i32>
%26 = zext <4 x i1> %24 to <4 x i32>
%27 = add <4 x i32> %vec.phi, %25
%28 = add <4 x i32> %vec.phi3, %26
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%29 = icmp eq i32 %index.next, %n.vec
br i1 %29, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %28, %27
%30 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %4, %n.vec
br i1 %cmp.n, label %PN.exit, label %for.body.i.preheader5
for.body.i.preheader5: ; preds = %for.body.i.preheader, %middle.block
%count.018.i.ph = phi i32 [ 0, %for.body.i.preheader ], [ %30, %middle.block ]
%i.017.i.ph = phi i32 [ %0, %for.body.i.preheader ], [ %ind.end, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader5, %for.body.i
%count.018.i = phi i32 [ %spec.select.i, %for.body.i ], [ %count.018.i.ph, %for.body.i.preheader5 ]
%i.017.i = phi i32 [ %inc7.i, %for.body.i ], [ %i.017.i.ph, %for.body.i.preheader5 ]
%div.i = sdiv i32 %i.017.i, 1000
%31 = srem i32 %i.017.i, 100
%div2.lhs.trunc.i = trunc i32 %31 to i8
%div215.i = sdiv i8 %div2.lhs.trunc.i, 10
%div2.sext.i = sext i8 %div215.i to i32
%mul3.neg.i = mul nsw i32 %div2.sext.i, -10
%sub4.i = add nsw i32 %mul3.neg.i, %31
%mul5.i = mul nsw i32 %sub4.i, 10
%add.i = add nsw i32 %mul5.i, %div2.sext.i
%cmp6.i = icmp eq i32 %div.i, %add.i
%inc.i = zext i1 %cmp6.i to i32
%spec.select.i = add nuw nsw i32 %count.018.i, %inc.i
%inc7.i = add i32 %i.017.i, 1
%cmp.not.i = icmp sgt i32 %inc7.i, %1
br i1 %cmp.not.i, label %PN.exit, label %for.body.i, !llvm.loop !15
PN.exit: ; preds = %for.body.i, %middle.block, %entry
%count.0.lcssa.i = phi i32 [ 0, %entry ], [ %30, %middle.block ], [ %spec.select.i, %for.body.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa.i)
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !6, !8, !7}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C/C++ TBAA"}
!14 = distinct !{!14, !6, !7, !8}
!15 = distinct !{!15, !6, !8, !7}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll powll(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)
#define in(a) scanf("%lld", &(a))
#define in2(a,b) scanf("%lld %lld",&(a),&(b))
#define in3(a,b,c) scanf("%lld %lld %lld",&(a),&(b),&(c))
#define ind(a) scanf("%lf", &(a))
#define ins(a) scanf("%s", (a))
#define inc(a) scanf("%c", &(a))
#define put(a) printf("%lld\n", (a))
#define putd(a) printf("%.15f\n", (a))
// puts(a) printf("%s\n", a) 文字はこっち
//your code here!
int main(void){
ll A, B, ans=0;
in2(A,B);
char s[6];
rep(i, B-A+1){
ll x=A+i;
rep(j, 5){
s[4-j] = '0' + x%10;
x /= 10;
}
if(s[0]==s[4] && s[1]==s[3]) ans++;
}
put(ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275188/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275188/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @powll(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
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 ]
%r.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
%r.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.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 %r.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 !5
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%r.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 %r.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 !7
}
; 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 i64, align 8
%B = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i64, ptr %B, align 8, !tbaa !9
%1 = load i64, ptr %A, align 8, !tbaa !9
%cmp.not33 = icmp slt i64 %0, %1
br i1 %cmp.not33, label %for.cond.cleanup, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%2 = add i64 %0, 1
%3 = sub i64 %2, %1
br label %for.body
for.cond.cleanup: ; preds = %if.end, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.1, %if.end ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #4
ret i32 0
for.body: ; preds = %for.body.lr.ph, %if.end
%i.035 = phi i64 [ 0, %for.body.lr.ph ], [ %inc22, %if.end ]
%ans.034 = phi i64 [ 0, %for.body.lr.ph ], [ %ans.1, %if.end ]
%add1 = add nsw i64 %1, %i.035
%rem = srem i64 %add1, 10
%div = sdiv i64 %add1, 10
%4 = trunc i64 %rem to i8
%div.3 = sdiv i64 %add1, 10000
%rem.4 = srem i64 %div.3, 10
%5 = trunc i64 %rem.4 to i8
%cmp12 = icmp eq i8 %5, %4
br i1 %cmp12, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.body
%div.2 = sdiv i64 %add1, 1000
%rem.3 = srem i64 %div.2, 10
%6 = trunc i64 %rem.3 to i8
%rem.1 = srem i64 %div, 10
%7 = trunc i64 %rem.1 to i8
%cmp18 = icmp eq i8 %6, %7
%inc20 = zext i1 %cmp18 to i64
%spec.select = add nsw i64 %ans.034, %inc20
br label %if.end
if.end: ; preds = %land.lhs.true, %for.body
%ans.1 = phi i64 [ %ans.034, %for.body ], [ %spec.select, %land.lhs.true ]
%inc22 = add nuw i64 %i.035, 1
%exitcond.not = icmp eq i64 %inc22, %3
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; 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.unroll.disable"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C/C++ TBAA"}
!13 = distinct !{!13, !8}
|
# include <stdio.h>
int main(){
int a, b;
scanf("%d %d", &a, &b);
int a_flg, b_flg;
a_flg = (a/100) * 100
+ ((a/1000)%10) * 10
+ (a/10000) - a >= 0;
b_flg = (b/100) * 100
+ ((b/1000)%10) * 10
+ (b/10000) - b <= 0;
printf("%d\n",b/100-a/100-1+a_flg+b_flg);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275230/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275230/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%div = sdiv i32 %0, 100
%mul = mul nsw i32 %div, 100
%div1 = sdiv i32 %0, 1000
%rem = srem i32 %div1, 10
%mul2 = mul nsw i32 %rem, 10
%div3 = sdiv i32 %0, 10000
%add = add i32 %mul, %div3
%add4 = add i32 %add, %mul2
%cmp = icmp sge i32 %add4, %0
%conv = zext i1 %cmp to i32
%1 = load i32, ptr %b, align 4, !tbaa !5
%div5 = sdiv i32 %1, 100
%mul6 = mul nsw i32 %div5, 100
%div7 = sdiv i32 %1, 1000
%rem8 = srem i32 %div7, 10
%mul9 = mul nsw i32 %rem8, 10
%div11 = sdiv i32 %1, 10000
%add10 = add i32 %mul6, %div11
%add12 = add i32 %add10, %mul9
%cmp14 = icmp sle i32 %add12, %1
%conv15 = zext i1 %cmp14 to i32
%2 = xor i32 %div, -1
%sub19 = add nsw i32 %div5, %2
%add20 = add nsw i32 %sub19, %conv
%add21 = add nsw i32 %add20, %conv15
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add21)
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 a,b;
int x=0;
char s[6];
int i;
scanf("%d%d",&a,&b);
for(i=a;i<=b;i++){
sprintf(s,"%d",i);
if(s[0]==s[4]&&s[1]==s[3]){
x++;
}
}
printf("%d\n",x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275289/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275289/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; 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
%s = alloca [6 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %s) #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.not17 = icmp sgt i32 %0, %1
br i1 %cmp.not17, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%arrayidx2 = getelementptr inbounds [6 x i8], ptr %s, i64 0, i64 4
%arrayidx6 = getelementptr inbounds [6 x i8], ptr %s, i64 0, i64 1
%arrayidx8 = getelementptr inbounds [6 x i8], ptr %s, i64 0, i64 3
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%i.019 = phi i32 [ %0, %for.body.lr.ph ], [ %inc12, %for.inc ]
%x.018 = phi i32 [ 0, %for.body.lr.ph ], [ %x.1, %for.inc ]
%call1 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.019) #3
%2 = load i8, ptr %s, align 1, !tbaa !9
%3 = load i8, ptr %arrayidx2, align 1, !tbaa !9
%cmp4 = icmp eq i8 %2, %3
br i1 %cmp4, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%4 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%5 = load i8, ptr %arrayidx8, align 1, !tbaa !9
%cmp10 = icmp eq i8 %4, %5
%inc = zext i1 %cmp10 to i32
%spec.select = add nsw i32 %x.018, %inc
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body
%x.1 = phi i32 [ %x.018, %for.body ], [ %spec.select, %land.lhs.true ]
%inc12 = add nsw i32 %i.019, 1
%6 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.019, %6
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.inc, %entry
%x.0.lcssa = phi i32 [ 0, %entry ], [ %x.1, %for.inc ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %x.0.lcssa)
call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 @sprintf(ptr noalias nocapture noundef writeonly, 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n,h,i,max,cnt=1;
scanf("%d %d",&n,&h);
max=h;
for(i=1;i<n;i++){
scanf("%d",&h);
if(max<=h){
cnt++;
max=h;
}
}
printf("%d",cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275331/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275331/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%h = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %h)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 1
br i1 %cmp8, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = load i32, ptr %h, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%cnt.011 = phi i32 [ %spec.select7, %for.body ], [ 1, %for.body.preheader ]
%max.010 = phi i32 [ %spec.select, %for.body ], [ %1, %for.body.preheader ]
%i.09 = phi i32 [ %inc3, %for.body ], [ 1, %for.body.preheader ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h)
%2 = load i32, ptr %h, align 4, !tbaa !5
%cmp2.not = icmp sle i32 %max.010, %2
%spec.select = call i32 @llvm.smax.i32(i32 %max.010, i32 %2)
%inc = zext i1 %cmp2.not to i32
%spec.select7 = add nuw nsw i32 %cnt.011, %inc
%inc3 = add nuw nsw i32 %i.09, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc3, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%cnt.0.lcssa = phi i32 [ 1, %entry ], [ %spec.select7, %for.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int a=0;
int b=0;
int c=0;
int e=1;
int f=0;
scanf("%d",&a);
int d[a];
for(b=0;b<a;b++){
scanf("%d",&d[b]);
}
f=d[0];
for(c=1;c<a;c++){
if(f==d[c]){
e++;
}else
if(f<d[c]){
f=d[c];
e++;
}
}
printf("%d\n",e);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275375/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275375/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
store i32 0, ptr %a, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, 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 %a, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %3, 0
br i1 %cmp32, label %for.body, label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %a, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%cmp434 = icmp sgt i32 %4, 1
br i1 %cmp434, label %for.body5.preheader, label %for.end20
for.body5.preheader: ; preds = %for.end
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
%6 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %6, 1
%7 = icmp eq i32 %4, 2
br i1 %7, label %for.end20.loopexit.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %6, -2
%invariant.gep = getelementptr i32, ptr %vla, i64 1
br label %for.body5
for.body5: ; preds = %for.inc18.1, %for.body5.preheader.new
%indvars.iv41 = phi i64 [ 1, %for.body5.preheader.new ], [ %indvars.iv.next42.1, %for.inc18.1 ]
%f.036 = phi i32 [ %.pre, %for.body5.preheader.new ], [ %f.1.1, %for.inc18.1 ]
%e.035 = phi i32 [ 1, %for.body5.preheader.new ], [ %e.1.1, %for.inc18.1 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.inc18.1 ]
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv41
%8 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8 = icmp eq i32 %f.036, %8
br i1 %cmp8, label %if.then, label %if.else
if.then: ; preds = %for.body5
%inc9 = add nsw i32 %e.035, 1
br label %for.inc18
if.else: ; preds = %for.body5
%cmp12 = icmp slt i32 %f.036, %8
%inc16 = zext i1 %cmp12 to i32
%spec.select = add nsw i32 %e.035, %inc16
%spec.select31 = call i32 @llvm.smax.i32(i32 %f.036, i32 %8)
br label %for.inc18
for.inc18: ; preds = %if.else, %if.then
%e.1 = phi i32 [ %inc9, %if.then ], [ %spec.select, %if.else ]
%f.1 = phi i32 [ %f.036, %if.then ], [ %spec.select31, %if.else ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv41
%9 = load i32, ptr %gep, align 4, !tbaa !5
%cmp8.1 = icmp eq i32 %f.1, %9
br i1 %cmp8.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc18
%cmp12.1 = icmp slt i32 %f.1, %9
%inc16.1 = zext i1 %cmp12.1 to i32
%spec.select.1 = add nsw i32 %e.1, %inc16.1
%spec.select31.1 = call i32 @llvm.smax.i32(i32 %f.1, i32 %9)
br label %for.inc18.1
if.then.1: ; preds = %for.inc18
%inc9.1 = add nsw i32 %e.1, 1
br label %for.inc18.1
for.inc18.1: ; preds = %if.then.1, %if.else.1
%e.1.1 = phi i32 [ %inc9.1, %if.then.1 ], [ %spec.select.1, %if.else.1 ]
%f.1.1 = phi i32 [ %f.1, %if.then.1 ], [ %spec.select31.1, %if.else.1 ]
%indvars.iv.next42.1 = add nuw nsw i64 %indvars.iv41, 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.end20.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11
for.end20.loopexit.unr-lcssa: ; preds = %for.inc18.1, %for.body5.preheader
%e.1.lcssa.ph = phi i32 [ undef, %for.body5.preheader ], [ %e.1.1, %for.inc18.1 ]
%indvars.iv41.unr = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next42.1, %for.inc18.1 ]
%f.036.unr = phi i32 [ %.pre, %for.body5.preheader ], [ %f.1.1, %for.inc18.1 ]
%e.035.unr = phi i32 [ 1, %for.body5.preheader ], [ %e.1.1, %for.inc18.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end20, label %for.body5.epil
for.body5.epil: ; preds = %for.end20.loopexit.unr-lcssa
%arrayidx7.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv41.unr
%10 = load i32, ptr %arrayidx7.epil, align 4, !tbaa !5
%cmp8.epil = icmp eq i32 %f.036.unr, %10
%inc9.epil = add nsw i32 %e.035.unr, 1
%cmp12.epil = icmp slt i32 %f.036.unr, %10
%inc16.epil = zext i1 %cmp12.epil to i32
%spec.select.epil = add nsw i32 %e.035.unr, %inc16.epil
%e.1.epil = select i1 %cmp8.epil, i32 %inc9.epil, i32 %spec.select.epil
br label %for.end20
for.end20: ; preds = %for.body5.epil, %for.end20.loopexit.unr-lcssa, %entry, %for.end
%e.0.lcssa = phi i32 [ 1, %for.end ], [ 1, %entry ], [ %e.1.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %e.1.epil, %for.body5.epil ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %e.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main()
{
int n, i, m, count, count2=1;
scanf("%d", &n);
int h[n];
for(i=0; i<n; i++)
{
scanf("%d", &h[i]);
}
for(i=1; i<n; i++)
{
count=0;
for(m=0; m<i; m++)
{
if(h[i]>=h[m])
{
count++;
}
else
{
break;
}
}
if(count==i)
{
count2++;
}
}
printf("%d\n", count2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275418/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275418/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %3, 0
br i1 %cmp36, label %for.body, label %for.end23
for.cond2.preheader: ; preds = %for.body
%cmp340 = icmp sgt i32 %6, 1
br i1 %cmp340, label %for.cond5.preheader.preheader, label %for.end23
for.cond5.preheader.preheader: ; preds = %for.cond2.preheader
%wide.trip.count54 = zext i32 %6 to i64
%4 = add nsw i64 %wide.trip.count54, -1
%xtraiter = and i64 %4, 1
%5 = icmp eq i32 %6, 2
br i1 %5, label %for.end23.loopexit.unr-lcssa, label %for.cond5.preheader.preheader.new
for.cond5.preheader.preheader.new: ; preds = %for.cond5.preheader.preheader
%unroll_iter = and i64 %4, -2
br label %for.cond5.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond5.preheader: ; preds = %for.end16.1, %for.cond5.preheader.preheader.new
%indvars.iv51 = phi i64 [ 1, %for.cond5.preheader.preheader.new ], [ %indvars.iv.next52.1, %for.end16.1 ]
%count2.041 = phi i32 [ 1, %for.cond5.preheader.preheader.new ], [ %spec.select.1, %for.end16.1 ]
%niter = phi i64 [ 0, %for.cond5.preheader.preheader.new ], [ %niter.next.1, %for.end16.1 ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv51
%8 = load i32, ptr %arrayidx9, align 4, !tbaa !5
br label %for.body7
for.body7: ; preds = %for.cond5.preheader, %if.then
%indvars.iv46 = phi i64 [ 0, %for.cond5.preheader ], [ %indvars.iv.next47, %if.then ]
%arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv46
%9 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12.not = icmp slt i32 %8, %9
br i1 %cmp12.not, label %for.end16, label %if.then
if.then: ; preds = %for.body7
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%exitcond.not = icmp eq i64 %indvars.iv.next47, %indvars.iv51
br i1 %exitcond.not, label %for.end16, label %for.body7, !llvm.loop !11
for.end16: ; preds = %for.body7, %if.then
%count.0.lcssa.in = phi i64 [ %indvars.iv46, %for.body7 ], [ %indvars.iv51, %if.then ]
%10 = and i64 %count.0.lcssa.in, 4294967295
%cmp17 = icmp eq i64 %10, %indvars.iv51
%inc19 = zext i1 %cmp17 to i32
%spec.select = add nuw nsw i32 %count2.041, %inc19
%indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
%arrayidx9.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next52
%11 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
br label %for.body7.1
for.body7.1: ; preds = %if.then.1, %for.end16
%indvars.iv46.1 = phi i64 [ 0, %for.end16 ], [ %indvars.iv.next47.1, %if.then.1 ]
%arrayidx11.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv46.1
%12 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%cmp12.not.1 = icmp slt i32 %11, %12
br i1 %cmp12.not.1, label %for.end16.1, label %if.then.1
if.then.1: ; preds = %for.body7.1
%indvars.iv.next47.1 = add nuw nsw i64 %indvars.iv46.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv46.1, %indvars.iv51
br i1 %exitcond.not.1, label %for.end16.1, label %for.body7.1, !llvm.loop !11
for.end16.1: ; preds = %if.then.1, %for.body7.1
%count.0.lcssa.in.1 = phi i64 [ %indvars.iv46.1, %for.body7.1 ], [ %indvars.iv.next52, %if.then.1 ]
%13 = and i64 %count.0.lcssa.in.1, 4294967295
%cmp17.1 = icmp eq i64 %13, %indvars.iv.next52
%inc19.1 = zext i1 %cmp17.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc19.1
%indvars.iv.next52.1 = add nuw nsw i64 %indvars.iv51, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end23.loopexit.unr-lcssa, label %for.cond5.preheader, !llvm.loop !12
for.end23.loopexit.unr-lcssa: ; preds = %for.end16.1, %for.cond5.preheader.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.preheader ], [ %spec.select.1, %for.end16.1 ]
%indvars.iv51.unr = phi i64 [ 1, %for.cond5.preheader.preheader ], [ %indvars.iv.next52.1, %for.end16.1 ]
%count2.041.unr = phi i32 [ 1, %for.cond5.preheader.preheader ], [ %spec.select.1, %for.end16.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end23, label %for.cond5.preheader.epil
for.cond5.preheader.epil: ; preds = %for.end23.loopexit.unr-lcssa
%arrayidx9.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv51.unr
%14 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5
br label %for.body7.epil
for.body7.epil: ; preds = %if.then.epil, %for.cond5.preheader.epil
%indvars.iv46.epil = phi i64 [ 0, %for.cond5.preheader.epil ], [ %indvars.iv.next47.epil, %if.then.epil ]
%arrayidx11.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv46.epil
%15 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%cmp12.not.epil = icmp slt i32 %14, %15
br i1 %cmp12.not.epil, label %for.end16.epil, label %if.then.epil
if.then.epil: ; preds = %for.body7.epil
%indvars.iv.next47.epil = add nuw nsw i64 %indvars.iv46.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next47.epil, %indvars.iv51.unr
br i1 %exitcond.not.epil, label %for.end16.epil, label %for.body7.epil, !llvm.loop !11
for.end16.epil: ; preds = %if.then.epil, %for.body7.epil
%count.0.lcssa.in.epil = phi i64 [ %indvars.iv46.epil, %for.body7.epil ], [ %indvars.iv51.unr, %if.then.epil ]
%16 = and i64 %count.0.lcssa.in.epil, 4294967295
%cmp17.epil = icmp eq i64 %16, %indvars.iv51.unr
%inc19.epil = zext i1 %cmp17.epil to i32
%spec.select.epil = add nuw nsw i32 %count2.041.unr, %inc19.epil
br label %for.end23
for.end23: ; preds = %for.end16.epil, %for.end23.loopexit.unr-lcssa, %entry, %for.cond2.preheader
%count2.0.lcssa = phi i32 [ 1, %for.cond2.preheader ], [ 1, %entry ], [ %spec.select.lcssa.ph, %for.end23.loopexit.unr-lcssa ], [ %spec.select.epil, %for.end16.epil ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count2.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(){
int N;
int H[20];
int i,j;
scanf("%d",&N);
for(i=0; i<N; i++){
scanf("%d",&H[i]);
}
int count = 1;
int judge = 0;
for(i=1; i<N; i++){
for(j=i-1; j>=0; j--){
if(H[i]>=H[j]){judge++;}
}
if(judge==i){count++;}
judge=0;
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275461/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275461/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%H = alloca [20 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %H) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %0, 0
br i1 %cmp36, label %for.body, label %for.end22
for.cond2.preheader: ; preds = %for.body
%cmp340 = icmp sgt i32 %1, 1
br i1 %cmp340, label %for.cond5.preheader.preheader, label %for.end22
for.cond5.preheader.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %1 to i64
br label %for.cond5.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i32], ptr %H, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.end15
%indvar = phi i64 [ 0, %for.cond5.preheader.preheader ], [ %indvar.next, %for.end15 ]
%indvars.iv46 = phi i64 [ 1, %for.cond5.preheader.preheader ], [ %indvars.iv.next47, %for.end15 ]
%count.042 = phi i32 [ 1, %for.cond5.preheader.preheader ], [ %spec.select35, %for.end15 ]
%arrayidx9 = getelementptr inbounds [20 x i32], ptr %H, i64 0, i64 %indvars.iv46
%3 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%min.iters.check = icmp ult i64 %indvars.iv46, 12
%4 = icmp ugt i64 %indvar, 4294967295
%or.cond = select i1 %min.iters.check, i1 true, i1 %4
br i1 %or.cond, label %for.body7.preheader, label %vector.ph
vector.ph: ; preds = %for.cond5.preheader
%n.vec = and i64 %indvars.iv46, 9223372036854775800
%ind.end = and i64 %indvars.iv46, 7
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %3, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi55 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%5 = xor i64 %index, -1
%6 = add i64 %indvars.iv46, %5
%7 = and i64 %6, 4294967295
%8 = getelementptr inbounds [20 x i32], ptr %H, i64 0, i64 %7
%9 = getelementptr inbounds i32, ptr %8, i64 -3
%wide.load = load <4 x i32>, ptr %9, align 4, !tbaa !5
%reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%10 = getelementptr inbounds i32, ptr %8, i64 -7
%wide.load56 = load <4 x i32>, ptr %10, align 4, !tbaa !5
%reverse57 = shufflevector <4 x i32> %wide.load56, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%11 = icmp sge <4 x i32> %broadcast.splat, %reverse
%12 = icmp sge <4 x i32> %broadcast.splat, %reverse57
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = add <4 x i32> %vec.phi, %13
%16 = add <4 x i32> %vec.phi55, %14
%index.next = add nuw i64 %index, 8
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %16, %15
%18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %indvars.iv46, %n.vec
br i1 %cmp.n, label %for.end15, label %for.body7.preheader
for.body7.preheader: ; preds = %for.cond5.preheader, %middle.block
%indvars.iv48.ph = phi i64 [ %indvars.iv46, %for.cond5.preheader ], [ %ind.end, %middle.block ]
%judge.139.ph = phi i32 [ 0, %for.cond5.preheader ], [ %18, %middle.block ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader, %for.body7
%indvars.iv48 = phi i64 [ %indvars.iv.next49, %for.body7 ], [ %indvars.iv48.ph, %for.body7.preheader ]
%judge.139 = phi i32 [ %spec.select, %for.body7 ], [ %judge.139.ph, %for.body7.preheader ]
%indvars.iv.next49 = add nsw i64 %indvars.iv48, -1
%idxprom10 = and i64 %indvars.iv.next49, 4294967295
%arrayidx11 = getelementptr inbounds [20 x i32], ptr %H, i64 0, i64 %idxprom10
%19 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12.not = icmp sge i32 %3, %19
%inc13 = zext i1 %cmp12.not to i32
%spec.select = add nuw nsw i32 %judge.139, %inc13
%20 = icmp sgt i64 %indvars.iv48, 1
br i1 %20, label %for.body7, label %for.end15, !llvm.loop !14
for.end15: ; preds = %for.body7, %middle.block
%spec.select.lcssa = phi i32 [ %18, %middle.block ], [ %spec.select, %for.body7 ]
%21 = zext i32 %spec.select.lcssa to i64
%cmp16 = icmp eq i64 %indvars.iv46, %21
%inc18 = zext i1 %cmp16 to i32
%spec.select35 = add nuw nsw i32 %count.042, %inc18
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%exitcond.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count
%indvar.next = add i64 %indvar, 1
br i1 %exitcond.not, label %for.end22, label %for.cond5.preheader, !llvm.loop !15
for.end22: ; preds = %for.end15, %entry, %for.cond2.preheader
%count.0.lcssa = phi i32 [ 1, %for.cond2.preheader ], [ 1, %entry ], [ %spec.select35, %for.end15 ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void){
int n;
scanf("%d", &n);
int h[n];
for(int i = 0;i < n;i++){
scanf("%d", &h[i]);
}
int count = n;
for(int i = 1;i < n;i++){
int j = 0;
while(j < i){
if(h[j]>h[i]){
count--;
break;
}
j++;
}
}
printf("%d\n", count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275504/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275504/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp26 = icmp sgt i32 %3, 0
br i1 %cmp26, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp429 = icmp sgt i32 %6, 1
br i1 %cmp429, label %while.cond.preheader.preheader, label %for.cond.cleanup5
while.cond.preheader.preheader: ; preds = %for.cond3.preheader
%wide.trip.count41 = zext i32 %6 to i64
%4 = add nsw i64 %wide.trip.count41, -1
%xtraiter = and i64 %4, 1
%5 = icmp eq i32 %6, 2
br i1 %5, label %for.cond.cleanup5.loopexit.unr-lcssa, label %while.cond.preheader.preheader.new
while.cond.preheader.preheader.new: ; preds = %while.cond.preheader.preheader
%unroll_iter = and i64 %4, -2
%invariant.gep = getelementptr i32, ptr %vla, i64 1
br label %while.cond.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
while.cond.preheader: ; preds = %while.end.1, %while.cond.preheader.preheader.new
%indvars.iv38 = phi i64 [ 1, %while.cond.preheader.preheader.new ], [ %indvars.iv.next39.1, %while.end.1 ]
%count.030 = phi i32 [ %6, %while.cond.preheader.preheader.new ], [ %count.1.1, %while.end.1 ]
%niter = phi i64 [ 0, %while.cond.preheader.preheader.new ], [ %niter.next.1, %while.end.1 ]
%arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv38
%8 = load i32, ptr %arrayidx11, align 4, !tbaa !5
br label %while.body
for.cond.cleanup5.loopexit.unr-lcssa: ; preds = %while.end.1, %while.cond.preheader.preheader
%count.1.lcssa.ph = phi i32 [ undef, %while.cond.preheader.preheader ], [ %count.1.1, %while.end.1 ]
%indvars.iv38.unr = phi i64 [ 1, %while.cond.preheader.preheader ], [ %indvars.iv.next39.1, %while.end.1 ]
%count.030.unr = phi i32 [ %6, %while.cond.preheader.preheader ], [ %count.1.1, %while.end.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup5, label %while.cond.preheader.epil
while.cond.preheader.epil: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa
%arrayidx11.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv38.unr
%9 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
br label %while.body.epil
while.body.epil: ; preds = %while.cond.epil, %while.cond.preheader.epil
%indvars.iv35.epil = phi i64 [ 0, %while.cond.preheader.epil ], [ %indvars.iv.next36.epil, %while.cond.epil ]
%arrayidx9.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv35.epil
%10 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5
%cmp12.epil = icmp sgt i32 %10, %9
br i1 %cmp12.epil, label %if.then.epil, label %while.cond.epil
while.cond.epil: ; preds = %while.body.epil
%indvars.iv.next36.epil = add nuw nsw i64 %indvars.iv35.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next36.epil, %indvars.iv38.unr
br i1 %exitcond.not.epil, label %for.cond.cleanup5, label %while.body.epil, !llvm.loop !11
if.then.epil: ; preds = %while.body.epil
%dec.epil = add nsw i32 %count.030.unr, -1
br label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %for.cond.cleanup5.loopexit.unr-lcssa, %while.cond.epil, %if.then.epil, %entry, %for.cond3.preheader
%count.0.lcssa = phi i32 [ %6, %for.cond3.preheader ], [ %3, %entry ], [ %count.1.lcssa.ph, %for.cond.cleanup5.loopexit.unr-lcssa ], [ %dec.epil, %if.then.epil ], [ %count.030.unr, %while.cond.epil ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
while.cond: ; preds = %while.body
%indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
%exitcond.not = icmp eq i64 %indvars.iv.next36, %indvars.iv38
br i1 %exitcond.not, label %while.end, label %while.body, !llvm.loop !11
while.body: ; preds = %while.cond.preheader, %while.cond
%indvars.iv35 = phi i64 [ 0, %while.cond.preheader ], [ %indvars.iv.next36, %while.cond ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv35
%11 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %11, %8
br i1 %cmp12, label %if.then, label %while.cond
if.then: ; preds = %while.body
%dec = add nsw i32 %count.030, -1
br label %while.end
while.end: ; preds = %while.cond, %if.then
%count.1 = phi i32 [ %dec, %if.then ], [ %count.030, %while.cond ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv38
%12 = load i32, ptr %gep, align 4, !tbaa !5
br label %while.body.1
while.body.1: ; preds = %while.cond.1, %while.end
%indvars.iv35.1 = phi i64 [ 0, %while.end ], [ %indvars.iv.next36.1, %while.cond.1 ]
%arrayidx9.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv35.1
%13 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%cmp12.1 = icmp sgt i32 %13, %12
br i1 %cmp12.1, label %if.then.1, label %while.cond.1
while.cond.1: ; preds = %while.body.1
%indvars.iv.next36.1 = add nuw nsw i64 %indvars.iv35.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv35.1, %indvars.iv38
br i1 %exitcond.not.1, label %while.end.1, label %while.body.1, !llvm.loop !11
if.then.1: ; preds = %while.body.1
%dec.1 = add nsw i32 %count.1, -1
br label %while.end.1
while.end.1: ; preds = %while.cond.1, %if.then.1
%count.1.1 = phi i32 [ %dec.1, %if.then.1 ], [ %count.1, %while.cond.1 ]
%indvars.iv.next39.1 = add nuw nsw i64 %indvars.iv38, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup5.loopexit.unr-lcssa, label %while.cond.preheader, !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
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main (){
int a[105];
int b[105];
int N,temp,i,j,ng;
int count = 0;
scanf("%d",&N);
for(j = 0;j < N;j++){
scanf("%d",&a[j]);
}
temp = a[0];
for(i = 0;i < N;i++){
if(temp <= a[i]){
b[count] = a[i];
count++;
}
}
b[count] = 1000;
for(j = 0;j < count;j++){
if(temp > b[j]){
ng++;
}else if(temp < b[j]){
temp = b[j];
}
}
if(count > ng){
count = count - ng;
printf("%d",count);
}else{
printf("1");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275548/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275548/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [105 x i32], align 16
%b = alloca [105 x i32], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body, label %if.else41
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%.pre = load i32, ptr %a, align 16, !tbaa !5
%cmp467 = icmp sgt i32 %1, 0
br i1 %cmp467, label %for.body5.preheader, label %if.else41
for.body5.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %1 to i64
%xtraiter = and i64 %wide.trip.count, 1
%3 = icmp eq i32 %1, 1
br i1 %3, label %for.end16.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body5
for.body5: ; preds = %for.inc14.1, %for.body5.preheader.new
%indvars.iv78 = phi i64 [ 0, %for.body5.preheader.new ], [ %indvars.iv.next79.1, %for.inc14.1 ]
%count.069 = phi i32 [ 0, %for.body5.preheader.new ], [ %count.1.1, %for.inc14.1 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.inc14.1 ]
%arrayidx7 = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %indvars.iv78
%4 = load i32, ptr %arrayidx7, align 8, !tbaa !5
%cmp8.not = icmp sgt i32 %.pre, %4
br i1 %cmp8.not, label %for.inc14, label %if.then
if.then: ; preds = %for.body5
%idxprom11 = sext i32 %count.069 to i64
%arrayidx12 = getelementptr inbounds [105 x i32], ptr %b, i64 0, i64 %idxprom11
store i32 %4, ptr %arrayidx12, align 4, !tbaa !5
%inc13 = add nsw i32 %count.069, 1
br label %for.inc14
for.inc14: ; preds = %for.body5, %if.then
%count.1 = phi i32 [ %inc13, %if.then ], [ %count.069, %for.body5 ]
%indvars.iv.next79 = or i64 %indvars.iv78, 1
%arrayidx7.1 = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %indvars.iv.next79
%5 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5
%cmp8.not.1 = icmp sgt i32 %.pre, %5
br i1 %cmp8.not.1, label %for.inc14.1, label %if.then.1
if.then.1: ; preds = %for.inc14
%idxprom11.1 = sext i32 %count.1 to i64
%arrayidx12.1 = getelementptr inbounds [105 x i32], ptr %b, i64 0, i64 %idxprom11.1
store i32 %5, ptr %arrayidx12.1, align 4, !tbaa !5
%inc13.1 = add nsw i32 %count.1, 1
br label %for.inc14.1
for.inc14.1: ; preds = %if.then.1, %for.inc14
%count.1.1 = phi i32 [ %inc13.1, %if.then.1 ], [ %count.1, %for.inc14 ]
%indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 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.end16.unr-lcssa, label %for.body5, !llvm.loop !11
for.end16.unr-lcssa: ; preds = %for.inc14.1, %for.body5.preheader
%count.1.lcssa.ph = phi i32 [ undef, %for.body5.preheader ], [ %count.1.1, %for.inc14.1 ]
%indvars.iv78.unr = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next79.1, %for.inc14.1 ]
%count.069.unr = phi i32 [ 0, %for.body5.preheader ], [ %count.1.1, %for.inc14.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end16, label %for.body5.epil
for.body5.epil: ; preds = %for.end16.unr-lcssa
%arrayidx7.epil = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %indvars.iv78.unr
%6 = load i32, ptr %arrayidx7.epil, align 4, !tbaa !5
%cmp8.not.epil = icmp sgt i32 %.pre, %6
br i1 %cmp8.not.epil, label %for.end16, label %if.then.epil
if.then.epil: ; preds = %for.body5.epil
%idxprom11.epil = sext i32 %count.069.unr to i64
%arrayidx12.epil = getelementptr inbounds [105 x i32], ptr %b, i64 0, i64 %idxprom11.epil
store i32 %6, ptr %arrayidx12.epil, align 4, !tbaa !5
%inc13.epil = add nsw i32 %count.069.unr, 1
br label %for.end16
for.end16: ; preds = %for.body5.epil, %if.then.epil, %for.end16.unr-lcssa
%count.1.lcssa = phi i32 [ %count.1.lcssa.ph, %for.end16.unr-lcssa ], [ %inc13.epil, %if.then.epil ], [ %count.069.unr, %for.body5.epil ]
%idxprom17 = sext i32 %count.1.lcssa to i64
%arrayidx18 = getelementptr inbounds [105 x i32], ptr %b, i64 0, i64 %idxprom17
store i32 1000, ptr %arrayidx18, align 4, !tbaa !5
%cmp2071 = icmp sgt i32 %count.1.lcssa, 0
br i1 %cmp2071, label %for.body21.preheader, label %if.else41
for.body21.preheader: ; preds = %for.end16
%wide.trip.count84 = zext i32 %count.1.lcssa to i64
%xtraiter97 = and i64 %wide.trip.count84, 1
%7 = icmp eq i32 %count.1.lcssa, 1
br i1 %7, label %for.end37.unr-lcssa, label %for.body21.preheader.new
for.body21.preheader.new: ; preds = %for.body21.preheader
%unroll_iter100 = and i64 %wide.trip.count84, 4294967294
br label %for.body21
for.body21: ; preds = %for.body21, %for.body21.preheader.new
%indvars.iv81 = phi i64 [ 0, %for.body21.preheader.new ], [ %indvars.iv.next82.1, %for.body21 ]
%ng.074 = phi i32 [ undef, %for.body21.preheader.new ], [ %ng.1.1, %for.body21 ]
%temp.072 = phi i32 [ %.pre, %for.body21.preheader.new ], [ %spec.select.1, %for.body21 ]
%niter101 = phi i64 [ 0, %for.body21.preheader.new ], [ %niter101.next.1, %for.body21 ]
%arrayidx23 = getelementptr inbounds [105 x i32], ptr %b, i64 0, i64 %indvars.iv81
%8 = load i32, ptr %arrayidx23, align 8, !tbaa !5
%cmp24 = icmp sgt i32 %temp.072, %8
%spec.select = call i32 @llvm.smax.i32(i32 %temp.072, i32 %8)
%inc26 = zext i1 %cmp24 to i32
%ng.1 = add nsw i32 %ng.074, %inc26
%indvars.iv.next82 = or i64 %indvars.iv81, 1
%arrayidx23.1 = getelementptr inbounds [105 x i32], ptr %b, i64 0, i64 %indvars.iv.next82
%9 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%cmp24.1 = icmp sgt i32 %spec.select, %9
%spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %9)
%inc26.1 = zext i1 %cmp24.1 to i32
%ng.1.1 = add nsw i32 %ng.1, %inc26.1
%indvars.iv.next82.1 = add nuw nsw i64 %indvars.iv81, 2
%niter101.next.1 = add i64 %niter101, 2
%niter101.ncmp.1 = icmp eq i64 %niter101.next.1, %unroll_iter100
br i1 %niter101.ncmp.1, label %for.end37.unr-lcssa, label %for.body21, !llvm.loop !12
for.end37.unr-lcssa: ; preds = %for.body21, %for.body21.preheader
%indvars.iv81.unr = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next82.1, %for.body21 ]
%ng.074.unr = phi i32 [ undef, %for.body21.preheader ], [ %ng.1.1, %for.body21 ]
%temp.072.unr = phi i32 [ %.pre, %for.body21.preheader ], [ %spec.select.1, %for.body21 ]
%lcmp.mod98.not = icmp eq i64 %xtraiter97, 0
br i1 %lcmp.mod98.not, label %for.end37, label %for.body21.epil
for.body21.epil: ; preds = %for.end37.unr-lcssa
%arrayidx23.epil = getelementptr inbounds [105 x i32], ptr %b, i64 0, i64 %indvars.iv81.unr
%10 = load i32, ptr %arrayidx23.epil, align 4, !tbaa !5
%cmp24.epil = icmp sgt i32 %temp.072.unr, %10
%inc26.epil = zext i1 %cmp24.epil to i32
%ng.1.epil = add nsw i32 %ng.074.unr, %inc26.epil
br label %for.end37
for.end37: ; preds = %for.end37.unr-lcssa, %for.body21.epil
%ng.1.lcssa = phi i32 [ %ng.074.unr, %for.end37.unr-lcssa ], [ %ng.1.epil, %for.body21.epil ]
%cmp38 = icmp sgt i32 %count.1.lcssa, %ng.1.lcssa
br i1 %cmp38, label %if.then39, label %if.else41
if.then39: ; preds = %for.end37
%sub = sub nsw i32 %count.1.lcssa, %ng.1.lcssa
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
br label %if.end43
if.else41: ; preds = %entry, %for.end, %for.end16, %for.end37
%putchar = call i32 @putchar(i32 49)
br label %if.end43
if.end43: ; preds = %if.else41, %if.then39
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int num_visvle_buildings(int n,int h[]){
int i;
int cnt=0;
int high = 0;
for(i=0;i<n;++i){
if(high<=h[i]){
high = h[i];
cnt += 1;
}
}
return cnt;
}
int main(void){
int n;
scanf("%d",&n);
int h[n];
int i;
for(i=0;i<n;i++){
scanf("%d",&h[i]);
}
printf("%d",num_visvle_buildings(n,h));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275591/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275591/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @num_visvle_buildings(i32 noundef %n, ptr nocapture noundef readonly %h) local_unnamed_addr #0 {
entry:
%cmp10 = icmp sgt i32 %n, 0
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %n, 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 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%high.013 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select9.1, %for.body ]
%cnt.012 = 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 i32, ptr %h, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1.not = icmp sle i32 %high.013, %1
%add = zext i1 %cmp1.not to i32
%spec.select = add nuw nsw i32 %cnt.012, %add
%spec.select9 = tail call i32 @llvm.smax.i32(i32 %high.013, i32 %1)
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %h, i64 %indvars.iv.next
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp1.not.1 = icmp sle i32 %spec.select9, %2
%add.1 = zext i1 %cmp1.not.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %add.1
%spec.select9.1 = tail call i32 @llvm.smax.i32(i32 %spec.select9, i32 %2)
%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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%high.013.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select9.1, %for.body ]
%cnt.012.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds i32, ptr %h, i64 %indvars.iv.unr
%3 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%cmp1.not.epil = icmp sle i32 %high.013.unr, %3
%add.epil = zext i1 %cmp1.not.epil to i32
%spec.select.epil = add nuw nsw i32 %cnt.012.unr, %add.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
ret i32 %cnt.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %3, 0
br i1 %cmp6, label %for.body, label %num_visvle_buildings.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%cmp10.i = icmp sgt i32 %4, 0
br i1 %cmp10.i, label %for.body.preheader.i, label %num_visvle_buildings.exit
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count.i, 1
%6 = icmp eq i32 %4, 1
br i1 %6, label %num_visvle_buildings.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i64 %wide.trip.count.i, 4294967294
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.body.i ]
%high.013.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %spec.select9.i.1, %for.body.i ]
%cnt.012.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %spec.select.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx.i, align 8, !tbaa !5
%cmp1.not.i = icmp sle i32 %high.013.i, %7
%add.i = zext i1 %cmp1.not.i to i32
%spec.select.i = add nuw nsw i32 %cnt.012.i, %add.i
%spec.select9.i = call i32 @llvm.smax.i32(i32 %high.013.i, i32 %7)
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5
%cmp1.not.i.1 = icmp sle i32 %spec.select9.i, %8
%add.i.1 = zext i1 %cmp1.not.i.1 to i32
%spec.select.i.1 = add nuw nsw i32 %spec.select.i, %add.i.1
%spec.select9.i.1 = call i32 @llvm.smax.i32(i32 %spec.select9.i, i32 %8)
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %num_visvle_buildings.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !9
num_visvle_buildings.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i
%spec.select.i.lcssa.ph = phi i32 [ undef, %for.body.preheader.i ], [ %spec.select.i.1, %for.body.i ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.body.i ]
%high.013.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %spec.select9.i.1, %for.body.i ]
%cnt.012.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %spec.select.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %num_visvle_buildings.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %num_visvle_buildings.exit.loopexit.unr-lcssa
%arrayidx.i.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i.unr
%9 = load i32, ptr %arrayidx.i.epil, align 4, !tbaa !5
%cmp1.not.i.epil = icmp sle i32 %high.013.i.unr, %9
%add.i.epil = zext i1 %cmp1.not.i.epil to i32
%spec.select.i.epil = add nuw nsw i32 %cnt.012.i.unr, %add.i.epil
br label %num_visvle_buildings.exit
num_visvle_buildings.exit: ; preds = %for.body.i.epil, %num_visvle_buildings.exit.loopexit.unr-lcssa, %entry, %for.end
%cnt.0.lcssa.i = phi i32 [ 0, %for.end ], [ 0, %entry ], [ %spec.select.i.lcssa.ph, %num_visvle_buildings.exit.loopexit.unr-lcssa ], [ %spec.select.i.epil, %for.body.i.epil ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cnt.0.lcssa.i)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int N;
int H;
int highest=-1;
int count=0;
scanf("%d",&N);
for(int i=0; i<N; i++){
scanf("%d",&H);
if(highest<=H){
count++;
highest = H;
}
}
printf("%d\n",count );
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275634/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275634/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%H = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select7, %for.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.011 = phi i32 [ %inc3, %for.body ], [ 0, %entry ]
%count.010 = phi i32 [ %spec.select7, %for.body ], [ 0, %entry ]
%highest.09 = phi i32 [ %spec.select, %for.body ], [ -1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H)
%1 = load i32, ptr %H, align 4, !tbaa !5
%cmp2.not = icmp sle i32 %highest.09, %1
%spec.select = call i32 @llvm.smax.i32(i32 %highest.09, i32 %1)
%inc = zext i1 %cmp2.not to i32
%spec.select7 = add nuw nsw i32 %count.010, %inc
%inc3 = add nuw nsw i32 %i.011, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc3, %2
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int compare_int(const void *a, const void *b)
{
return *(int*)a - *(int*)b;
// return *(long long*)a - *(long long*)b;
}
// qsort(A, b, sizeof(int), compare_int);
int main()
{
// int a, b, c, d, e, X, Y;
int a, b, c, d, e,f;
// double c;
// long long A[1000001]={};
int A[2000001]={};
int B[2000001]={};
int ans[100003]={};
int sum[100003]={};
int cnt_flag[100003]={};
int L[1003]={};
// long long a, b, c, d, X, Y;
// long long d, X, Y;
long long JPY;
double BTC;
char s[200001]={};
char t[200001]={};
char u[200001]={};
// int N, M;
// int A[1000000001]={};
// long long C[101]={};
int i,j,k;
int flag=0;
// int flag[10000003]={};
int tmp=0;
// int min=1000000;
int min=10;
int len=0;
int cnt=0;
int cnt0=0;
int cnt1=0;
int num=0;
// double ans=0.0;
// long long ans=0;
int max=0;
// int sum=0;
// char alp[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
// a=0;
// scanf("%lld %lld", &a, &b);
scanf("%d", &a);
cnt=1;
scanf("%d", &max);
for(i=1;i<a;i++){
scanf("%d", &A[i]);
if(A[i]>=max){
max=A[i];
cnt++;
}
}
printf("%d\n", cnt);
/*
*/
// printf("%s\n",s);
// else
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275685/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275685/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%A = alloca [2000001 x i32], align 16
%max = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8000004, ptr nonnull %A) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000004) %A, i8 0, i64 8000004, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %max) #5
store i32 0, ptr %max, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %max)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %0, 1
br i1 %cmp15, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%cnt.016 = phi i32 [ %cnt.1, %for.inc ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [2000001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %max, align 4, !tbaa !5
%cmp5.not = icmp slt i32 %1, %2
br i1 %cmp5.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
store i32 %1, ptr %max, align 4, !tbaa !5
%inc = add nsw i32 %cnt.016, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%cnt.1 = phi i32 [ %inc, %if.then ], [ %cnt.016, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %a, 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.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%cnt.0.lcssa = phi i32 [ 1, %entry ], [ %cnt.1, %for.inc ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %max) #5
call void @llvm.lifetime.end.p0(i64 8000004, ptr nonnull %A) #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) #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__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) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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>
#include <math.h>
#include <limits.h>
#define REP(i,n) for(i=0;i<n;i++)
int iin() {
int i;
scanf("%d", &i);
return i;
}
long long llin() {
long long i;
scanf("%lld", &i);
return i;
}
double din() {
double i;
scanf("%lf", &i);
return i;
}
char cin() {
char c;
scanf("%c", &c);
return c;
}
void stin(char *s) {
scanf("%s", s);
}
void iout(int i) {
printf("%d\n", i);
}
void llout(long long i) {
printf("%lld\n", i);
}
void dout(double i) {
printf("%lf\n", i);
}
void cout(char c) {
printf("%c\n", c);
}
void stout(char *s) {
printf("%s\n", s);
}
int main() {
int N = iin();
int H, max = 0, count = 0, i;
REP(i,N) {
H = iin();
if (max <= H) {
count++;
max = H;
}
}
iout(count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275728/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275728/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.5 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.6 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.7 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1
@.str.8 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @iin() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #5
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 uwtable
define dso_local i64 @llin() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #5
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @din() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #5
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local signext i8 @cin() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !13
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #5
ret i8 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @stin(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @iout(i32 noundef %i) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %i)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @llout(i64 noundef %i) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %i)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @dout(double noundef %i) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %i)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @cout(i8 noundef signext %c) local_unnamed_addr #0 {
entry:
%conv = sext i8 %c to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %conv)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @stout(ptr nocapture noundef readonly %s) local_unnamed_addr #0 {
entry:
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i.i8 = alloca i32, align 4
%i.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #5
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i)
%0 = load i32, ptr %i.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc3, %for.body ], [ 0, %entry ]
%count.013 = phi i32 [ %spec.select7, %for.body ], [ 0, %entry ]
%max.012 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i8) #5
%call.i9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i8)
%1 = load i32, ptr %i.i8, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i8) #5
%cmp2.not = icmp sle i32 %max.012, %1
%spec.select = call i32 @llvm.smax.i32(i32 %max.012, i32 %1)
%inc = zext i1 %cmp2.not to i32
%spec.select7 = add nuw nsw i32 %count.013, %inc
%inc3 = add nuw nsw i32 %i.014, 1
%exitcond.not = icmp eq i32 %inc3, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14
for.end: ; preds = %for.body, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select7, %for.body ]
%call.i10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %count.0.lcssa)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int w,h,i,j,t,r,x[2550],y[2550],c,nx,ny,k;
int X[8]={0,1,1,1,0,-1,-1,-1};
int Y[8]={1,1,0,-1,-1,-1,0,1};
while(scanf("%d %d",&w,&h),w||h){
int m[52][52]={0};
for(i=c=0;i<h;i++){
for(j=0;j<w;j++){
scanf("%d",&m[i+1][j+1]);
}
}
for(i=1;i<=h;i++){
for(j=1;j<=w;j++){
if(!m[i][j])continue;
y[0 ]=i;
x[t=0]=j;
m[i][j]=0;
c++;
for(r=1;r-t;t++){
for(k=0;k<8;k++){
nx=x[t]+X[k];
ny=y[t]+Y[k];
if(!m[ny][nx])continue;
y[r ]=ny;
x[r++]=nx;
m[ny][nx]=0;
}
}
/*for(k=0;k<w*h;k++){
if(k%w==0)printf("\n");
printf("%d ",m[k/w+1][k%w+1]);
}printf("\n");//*/
}
}
printf("%d\n",c);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275771/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275771/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%h = alloca i32, align 4
%x = alloca [2550 x i32], align 16
%y = alloca [2550 x i32], align 16
%m = alloca [52 x [52 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 10200, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 10200, ptr nonnull %y) #4
%call119 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h)
%0 = load i32, ptr %w, align 4, !tbaa !5
%tobool120 = icmp ne i32 %0, 0
%1 = load i32, ptr %h, align 4
%tobool1121 = icmp ne i32 %1, 0
%2 = select i1 %tobool120, i1 true, i1 %tobool1121
br i1 %2, label %while.body, label %while.end
while.body: ; preds = %entry, %for.end73
%3 = phi i32 [ %42, %for.end73 ], [ %0, %entry ]
%4 = phi i32 [ %43, %for.end73 ], [ %1, %entry ]
call void @llvm.lifetime.start.p0(i64 10816, ptr nonnull %m) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10816) %m, i8 0, i64 10816, i1 false)
%cmp104 = icmp sgt i32 %4, 0
%5 = icmp sgt i32 %3, 0
%or.cond = and i1 %cmp104, %5
br i1 %or.cond, label %for.cond2.preheader, label %for.end73
for.cond12.preheader: ; preds = %for.inc9
%cmp13.not114 = icmp slt i32 %13, 1
%cmp16.not110 = icmp slt i32 %14, 1
%or.cond183 = or i1 %cmp13.not114, %cmp16.not110
br i1 %or.cond183, label %for.end73, label %for.cond15.preheader.preheader
for.cond15.preheader.preheader: ; preds = %for.cond12.preheader
%6 = add nuw i32 %14, 1
%7 = add nuw i32 %13, 1
%wide.trip.count142 = zext i32 %7 to i64
%wide.trip.count = zext i32 %6 to i64
br label %for.cond15.preheader
for.cond2.preheader: ; preds = %while.body, %for.inc9
%8 = phi i32 [ %13, %for.inc9 ], [ %4, %while.body ]
%9 = phi i32 [ %14, %for.inc9 ], [ %3, %while.body ]
%indvars.iv126 = phi i64 [ %10, %for.inc9 ], [ 0, %while.body ]
%cmp3102 = icmp sgt i32 %9, 0
%10 = add nuw nsw i64 %indvars.iv126, 1
br i1 %cmp3102, label %for.body4, label %for.inc9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond2.preheader ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx7 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %10, i64 %indvars.iv.next
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%11 = load i32, ptr %w, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp3, label %for.body4, label %for.inc9.loopexit, !llvm.loop !9
for.inc9.loopexit: ; preds = %for.body4
%.pre = load i32, ptr %h, align 4, !tbaa !5
br label %for.inc9
for.inc9: ; preds = %for.cond2.preheader, %for.inc9.loopexit
%13 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %8, %for.cond2.preheader ]
%14 = phi i32 [ %11, %for.inc9.loopexit ], [ %9, %for.cond2.preheader ]
%15 = sext i32 %13 to i64
%cmp = icmp slt i64 %10, %15
br i1 %cmp, label %for.cond2.preheader, label %for.cond12.preheader, !llvm.loop !11
for.cond15.preheader: ; preds = %for.cond15.preheader.preheader, %for.cond15.for.inc71_crit_edge
%indvars.iv139 = phi i64 [ 1, %for.cond15.preheader.preheader ], [ %indvars.iv.next140, %for.cond15.for.inc71_crit_edge ]
%c.0115 = phi i32 [ 0, %for.cond15.preheader.preheader ], [ %c.2, %for.cond15.for.inc71_crit_edge ]
%16 = trunc i64 %indvars.iv139 to i32
br label %for.body17
for.body17: ; preds = %for.cond15.preheader, %for.inc68
%indvars.iv136 = phi i64 [ 1, %for.cond15.preheader ], [ %indvars.iv.next137, %for.inc68 ]
%c.1111 = phi i32 [ %c.0115, %for.cond15.preheader ], [ %c.2, %for.inc68 ]
%arrayidx21 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %indvars.iv139, i64 %indvars.iv136
%17 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%tobool22.not = icmp eq i32 %17, 0
br i1 %tobool22.not, label %for.inc68, label %if.end
if.end: ; preds = %for.body17
store i32 %16, ptr %y, align 16, !tbaa !5
%18 = trunc i64 %indvars.iv136 to i32
store i32 %18, ptr %x, align 16, !tbaa !5
store i32 0, ptr %arrayidx21, align 4, !tbaa !5
br label %for.cond33.preheader
for.cond33.preheader: ; preds = %if.end, %for.inc62.7
%indvars.iv133 = phi i64 [ 0, %if.end ], [ %indvars.iv.next134, %for.inc62.7 ]
%r.0109 = phi i32 [ 1, %if.end ], [ %r.2.7, %for.inc62.7 ]
%arrayidx37 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %indvars.iv133
%arrayidx42 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %indvars.iv133
%19 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%add45 = add nsw i32 %20, 1
%idxprom46 = sext i32 %add45 to i64
%idxprom48 = sext i32 %19 to i64
%arrayidx49 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %idxprom46, i64 %idxprom48
%21 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%tobool50.not = icmp eq i32 %21, 0
br i1 %tobool50.not, label %for.inc62, label %if.end52
if.end52: ; preds = %for.cond33.preheader
%idxprom53 = sext i32 %r.0109 to i64
%arrayidx54 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %idxprom53
store i32 %add45, ptr %arrayidx54, align 4, !tbaa !5
%inc55 = add nsw i32 %r.0109, 1
%arrayidx57 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %idxprom53
store i32 %19, ptr %arrayidx57, align 4, !tbaa !5
store i32 0, ptr %arrayidx49, align 4, !tbaa !5
%.pre144 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%.pre145 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%.pre158 = add nsw i32 %.pre145, 1
%.pre159 = sext i32 %.pre158 to i64
br label %for.inc62
for.inc62: ; preds = %for.cond33.preheader, %if.end52
%idxprom46.1.pre-phi = phi i64 [ %idxprom46, %for.cond33.preheader ], [ %.pre159, %if.end52 ]
%add45.1.pre-phi = phi i32 [ %add45, %for.cond33.preheader ], [ %.pre158, %if.end52 ]
%22 = phi i32 [ %20, %for.cond33.preheader ], [ %.pre145, %if.end52 ]
%23 = phi i32 [ %19, %for.cond33.preheader ], [ %.pre144, %if.end52 ]
%r.2 = phi i32 [ %r.0109, %for.cond33.preheader ], [ %inc55, %if.end52 ]
%add40.1 = add nsw i32 %23, 1
%idxprom48.1 = sext i32 %add40.1 to i64
%arrayidx49.1 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %idxprom46.1.pre-phi, i64 %idxprom48.1
%24 = load i32, ptr %arrayidx49.1, align 4, !tbaa !5
%tobool50.not.1 = icmp eq i32 %24, 0
br i1 %tobool50.not.1, label %for.inc62.1, label %if.end52.1
if.end52.1: ; preds = %for.inc62
%idxprom53.1 = sext i32 %r.2 to i64
%arrayidx54.1 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %idxprom53.1
store i32 %add45.1.pre-phi, ptr %arrayidx54.1, align 4, !tbaa !5
%inc55.1 = add nsw i32 %r.2, 1
%arrayidx57.1 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %idxprom53.1
store i32 %add40.1, ptr %arrayidx57.1, align 4, !tbaa !5
store i32 0, ptr %arrayidx49.1, align 4, !tbaa !5
%.pre146 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%.pre147 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%.pre160 = add nsw i32 %.pre146, 1
%.pre161 = sext i32 %.pre160 to i64
br label %for.inc62.1
for.inc62.1: ; preds = %if.end52.1, %for.inc62
%idxprom48.2.pre-phi = phi i64 [ %.pre161, %if.end52.1 ], [ %idxprom48.1, %for.inc62 ]
%add40.2.pre-phi = phi i32 [ %.pre160, %if.end52.1 ], [ %add40.1, %for.inc62 ]
%25 = phi i32 [ %.pre147, %if.end52.1 ], [ %22, %for.inc62 ]
%26 = phi i32 [ %.pre146, %if.end52.1 ], [ %23, %for.inc62 ]
%r.2.1 = phi i32 [ %inc55.1, %if.end52.1 ], [ %r.2, %for.inc62 ]
%idxprom46.2 = sext i32 %25 to i64
%arrayidx49.2 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %idxprom46.2, i64 %idxprom48.2.pre-phi
%27 = load i32, ptr %arrayidx49.2, align 4, !tbaa !5
%tobool50.not.2 = icmp eq i32 %27, 0
br i1 %tobool50.not.2, label %for.inc62.2, label %if.end52.2
if.end52.2: ; preds = %for.inc62.1
%idxprom53.2 = sext i32 %r.2.1 to i64
%arrayidx54.2 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %idxprom53.2
store i32 %25, ptr %arrayidx54.2, align 4, !tbaa !5
%inc55.2 = add nsw i32 %r.2.1, 1
%arrayidx57.2 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %idxprom53.2
store i32 %add40.2.pre-phi, ptr %arrayidx57.2, align 4, !tbaa !5
store i32 0, ptr %arrayidx49.2, align 4, !tbaa !5
%.pre148 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%.pre149 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%.pre162 = add nsw i32 %.pre148, 1
%.pre163 = sext i32 %.pre162 to i64
br label %for.inc62.2
for.inc62.2: ; preds = %if.end52.2, %for.inc62.1
%idxprom48.3.pre-phi = phi i64 [ %.pre163, %if.end52.2 ], [ %idxprom48.2.pre-phi, %for.inc62.1 ]
%add40.3.pre-phi = phi i32 [ %.pre162, %if.end52.2 ], [ %add40.2.pre-phi, %for.inc62.1 ]
%28 = phi i32 [ %.pre149, %if.end52.2 ], [ %25, %for.inc62.1 ]
%29 = phi i32 [ %.pre148, %if.end52.2 ], [ %26, %for.inc62.1 ]
%r.2.2 = phi i32 [ %inc55.2, %if.end52.2 ], [ %r.2.1, %for.inc62.1 ]
%add45.3 = add nsw i32 %28, -1
%idxprom46.3 = sext i32 %add45.3 to i64
%arrayidx49.3 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %idxprom46.3, i64 %idxprom48.3.pre-phi
%30 = load i32, ptr %arrayidx49.3, align 4, !tbaa !5
%tobool50.not.3 = icmp eq i32 %30, 0
br i1 %tobool50.not.3, label %for.inc62.3, label %if.end52.3
if.end52.3: ; preds = %for.inc62.2
%idxprom53.3 = sext i32 %r.2.2 to i64
%arrayidx54.3 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %idxprom53.3
store i32 %add45.3, ptr %arrayidx54.3, align 4, !tbaa !5
%inc55.3 = add nsw i32 %r.2.2, 1
%arrayidx57.3 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %idxprom53.3
store i32 %add40.3.pre-phi, ptr %arrayidx57.3, align 4, !tbaa !5
store i32 0, ptr %arrayidx49.3, align 4, !tbaa !5
%.pre150 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%.pre151 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%.pre164 = add nsw i32 %.pre151, -1
%.pre165 = sext i32 %.pre164 to i64
br label %for.inc62.3
for.inc62.3: ; preds = %if.end52.3, %for.inc62.2
%idxprom46.4.pre-phi = phi i64 [ %.pre165, %if.end52.3 ], [ %idxprom46.3, %for.inc62.2 ]
%add45.4.pre-phi = phi i32 [ %.pre164, %if.end52.3 ], [ %add45.3, %for.inc62.2 ]
%31 = phi i32 [ %.pre151, %if.end52.3 ], [ %28, %for.inc62.2 ]
%32 = phi i32 [ %.pre150, %if.end52.3 ], [ %29, %for.inc62.2 ]
%r.2.3 = phi i32 [ %inc55.3, %if.end52.3 ], [ %r.2.2, %for.inc62.2 ]
%idxprom48.4 = sext i32 %32 to i64
%arrayidx49.4 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %idxprom46.4.pre-phi, i64 %idxprom48.4
%33 = load i32, ptr %arrayidx49.4, align 4, !tbaa !5
%tobool50.not.4 = icmp eq i32 %33, 0
br i1 %tobool50.not.4, label %for.inc62.4, label %if.end52.4
if.end52.4: ; preds = %for.inc62.3
%idxprom53.4 = sext i32 %r.2.3 to i64
%arrayidx54.4 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %idxprom53.4
store i32 %add45.4.pre-phi, ptr %arrayidx54.4, align 4, !tbaa !5
%inc55.4 = add nsw i32 %r.2.3, 1
%arrayidx57.4 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %idxprom53.4
store i32 %32, ptr %arrayidx57.4, align 4, !tbaa !5
store i32 0, ptr %arrayidx49.4, align 4, !tbaa !5
%.pre152 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%.pre153 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%.pre166 = add nsw i32 %.pre153, -1
%.pre167 = sext i32 %.pre166 to i64
br label %for.inc62.4
for.inc62.4: ; preds = %if.end52.4, %for.inc62.3
%idxprom46.5.pre-phi = phi i64 [ %.pre167, %if.end52.4 ], [ %idxprom46.4.pre-phi, %for.inc62.3 ]
%add45.5.pre-phi = phi i32 [ %.pre166, %if.end52.4 ], [ %add45.4.pre-phi, %for.inc62.3 ]
%34 = phi i32 [ %.pre153, %if.end52.4 ], [ %31, %for.inc62.3 ]
%35 = phi i32 [ %.pre152, %if.end52.4 ], [ %32, %for.inc62.3 ]
%r.2.4 = phi i32 [ %inc55.4, %if.end52.4 ], [ %r.2.3, %for.inc62.3 ]
%add40.5 = add nsw i32 %35, -1
%idxprom48.5 = sext i32 %add40.5 to i64
%arrayidx49.5 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %idxprom46.5.pre-phi, i64 %idxprom48.5
%36 = load i32, ptr %arrayidx49.5, align 4, !tbaa !5
%tobool50.not.5 = icmp eq i32 %36, 0
br i1 %tobool50.not.5, label %for.inc62.5, label %if.end52.5
if.end52.5: ; preds = %for.inc62.4
%idxprom53.5 = sext i32 %r.2.4 to i64
%arrayidx54.5 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %idxprom53.5
store i32 %add45.5.pre-phi, ptr %arrayidx54.5, align 4, !tbaa !5
%inc55.5 = add nsw i32 %r.2.4, 1
%arrayidx57.5 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %idxprom53.5
store i32 %add40.5, ptr %arrayidx57.5, align 4, !tbaa !5
store i32 0, ptr %arrayidx49.5, align 4, !tbaa !5
%.pre154 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%.pre155 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%.pre168 = add nsw i32 %.pre154, -1
%.pre169 = sext i32 %.pre168 to i64
br label %for.inc62.5
for.inc62.5: ; preds = %if.end52.5, %for.inc62.4
%idxprom48.6.pre-phi = phi i64 [ %.pre169, %if.end52.5 ], [ %idxprom48.5, %for.inc62.4 ]
%add40.6.pre-phi = phi i32 [ %.pre168, %if.end52.5 ], [ %add40.5, %for.inc62.4 ]
%37 = phi i32 [ %.pre155, %if.end52.5 ], [ %34, %for.inc62.4 ]
%r.2.5 = phi i32 [ %inc55.5, %if.end52.5 ], [ %r.2.4, %for.inc62.4 ]
%idxprom46.6 = sext i32 %37 to i64
%arrayidx49.6 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %idxprom46.6, i64 %idxprom48.6.pre-phi
%38 = load i32, ptr %arrayidx49.6, align 4, !tbaa !5
%tobool50.not.6 = icmp eq i32 %38, 0
br i1 %tobool50.not.6, label %for.inc62.6, label %if.end52.6
if.end52.6: ; preds = %for.inc62.5
%idxprom53.6 = sext i32 %r.2.5 to i64
%arrayidx54.6 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %idxprom53.6
store i32 %37, ptr %arrayidx54.6, align 4, !tbaa !5
%inc55.6 = add nsw i32 %r.2.5, 1
%arrayidx57.6 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %idxprom53.6
store i32 %add40.6.pre-phi, ptr %arrayidx57.6, align 4, !tbaa !5
store i32 0, ptr %arrayidx49.6, align 4, !tbaa !5
%.pre156 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%.pre157 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%.pre170 = add nsw i32 %.pre156, -1
%.pre171 = sext i32 %.pre170 to i64
br label %for.inc62.6
for.inc62.6: ; preds = %if.end52.6, %for.inc62.5
%idxprom48.7.pre-phi = phi i64 [ %.pre171, %if.end52.6 ], [ %idxprom48.6.pre-phi, %for.inc62.5 ]
%add40.7.pre-phi = phi i32 [ %.pre170, %if.end52.6 ], [ %add40.6.pre-phi, %for.inc62.5 ]
%39 = phi i32 [ %.pre157, %if.end52.6 ], [ %37, %for.inc62.5 ]
%r.2.6 = phi i32 [ %inc55.6, %if.end52.6 ], [ %r.2.5, %for.inc62.5 ]
%add45.7 = add nsw i32 %39, 1
%idxprom46.7 = sext i32 %add45.7 to i64
%arrayidx49.7 = getelementptr inbounds [52 x [52 x i32]], ptr %m, i64 0, i64 %idxprom46.7, i64 %idxprom48.7.pre-phi
%40 = load i32, ptr %arrayidx49.7, align 4, !tbaa !5
%tobool50.not.7 = icmp eq i32 %40, 0
br i1 %tobool50.not.7, label %for.inc62.7, label %if.end52.7
if.end52.7: ; preds = %for.inc62.6
%idxprom53.7 = sext i32 %r.2.6 to i64
%arrayidx54.7 = getelementptr inbounds [2550 x i32], ptr %y, i64 0, i64 %idxprom53.7
store i32 %add45.7, ptr %arrayidx54.7, align 4, !tbaa !5
%inc55.7 = add nsw i32 %r.2.6, 1
%arrayidx57.7 = getelementptr inbounds [2550 x i32], ptr %x, i64 0, i64 %idxprom53.7
store i32 %add40.7.pre-phi, ptr %arrayidx57.7, align 4, !tbaa !5
store i32 0, ptr %arrayidx49.7, align 4, !tbaa !5
br label %for.inc62.7
for.inc62.7: ; preds = %if.end52.7, %for.inc62.6
%r.2.7 = phi i32 [ %inc55.7, %if.end52.7 ], [ %r.2.6, %for.inc62.6 ]
%indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
%41 = zext i32 %r.2.7 to i64
%tobool31.not = icmp eq i64 %indvars.iv.next134, %41
br i1 %tobool31.not, label %for.inc68.loopexit, label %for.cond33.preheader, !llvm.loop !13
for.inc68.loopexit: ; preds = %for.inc62.7
%inc29 = add nsw i32 %c.1111, 1
br label %for.inc68
for.inc68: ; preds = %for.inc68.loopexit, %for.body17
%c.2 = phi i32 [ %c.1111, %for.body17 ], [ %inc29, %for.inc68.loopexit ]
%indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
%exitcond.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count
br i1 %exitcond.not, label %for.cond15.for.inc71_crit_edge, label %for.body17, !llvm.loop !14
for.cond15.for.inc71_crit_edge: ; preds = %for.inc68
%indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
%exitcond143.not = icmp eq i64 %indvars.iv.next140, %wide.trip.count142
br i1 %exitcond143.not, label %for.end73, label %for.cond15.preheader, !llvm.loop !15
for.end73: ; preds = %for.cond15.for.inc71_crit_edge, %while.body, %for.cond12.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %while.body ], [ %c.2, %for.cond15.for.inc71_crit_edge ]
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 10816, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h)
%42 = load i32, ptr %w, align 4, !tbaa !5
%tobool = icmp ne i32 %42, 0
%43 = load i32, ptr %h, align 4
%tobool1 = icmp ne i32 %43, 0
%44 = select i1 %tobool, i1 true, i1 %tobool1
br i1 %44, label %while.body, label %while.end, !llvm.loop !16
while.end: ; preds = %for.end73, %entry
call void @llvm.lifetime.end.p0(i64 10200, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 10200, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
int M[50][50];
void visit(int i, int j, int x, int y){
M[i][j] = 0;
if(M[i][j+1] == 1 && j+1<x){
visit(i,j+1,x ,y);
// M[i][j+1]=0;
}
if(M[i+1][j+1] == 1&& j+1<x && i+1<y){
visit(i+1,j+1,x,y);
// M[i+1][j+1]=0;
}
if(M[i+1][j] == 1 && i+1<y){
visit(i+1,j, x, y);
// M[i+1][j]=0;
}
if(M[i+1][j-1] == 1&& i+1<y && j-1>=0){
visit(i+1,j-1,x, y);
// M[i+1][j-1]=0;
}
if(M[i][j-1] == 1 && j-1>=0){
visit(i,j-1, x,y);
// M[i][j-1]=0;
}
if(M[i-1][j-1] == 1 && i-1>=0 && j-1>=0){
visit(i-1,j-1, x, y);
// M[i-1][j-1]=0;
}
if(M[i-1][j] == 1 && i-1>=0){
visit(i-1,j, x, y);
// M[i-1][j]=0;
}
if(M[i-1][j+1] == 1 && i-1>=0 && j+1<x){
visit(i-1,j+1, x, y);
//M[i-1][j-1]=0;
}
}
int main(void){
int x, y, a, b, is;
while(1){
is = 0;
scanf("%d %d", &x, &y);
if(x==0 && y==0)break;
for(a=0; a<y; a++){
for(b=0; b<x; b++){
scanf("%d", &M[a][b]);
}
}
for(a=0; a<y; a++){
for(b=0; b<x; b++){
if(M[a][b]==1){
is++;
visit(a,b,x,y);
}
}
}
printf("%d\n", is);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275821/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275821/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@M = dso_local global [50 x [50 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @visit(i32 noundef %i, i32 noundef %j, i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%0 = sext i32 %i to i64
%1 = sext i32 %y to i64
%2 = sext i32 %j to i64
%3 = sext i32 %x to i64
br label %tailrecurse
tailrecurse: ; preds = %if.end95, %entry
%indvars.iv189 = phi i64 [ %indvars.iv.next190, %if.end95 ], [ %2, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end95 ], [ %0, %entry ]
%arrayidx2 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 %indvars.iv189
store i32 0, ptr %arrayidx2, align 4, !tbaa !5
%indvars.iv.next190 = add nsw i64 %indvars.iv189, 1
%arrayidx6 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 %indvars.iv.next190
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 1
%cmp8 = icmp slt i64 %indvars.iv.next190, %3
%or.cond = and i1 %cmp8, %cmp
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %tailrecurse
%5 = trunc i64 %indvars.iv to i32
%6 = trunc i64 %indvars.iv.next190 to i32
tail call void @visit(i32 noundef %5, i32 noundef %6, i32 noundef %x, i32 noundef %y)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%7 = add nsw i64 %indvars.iv, 1
%arrayidx15 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %7, i64 %indvars.iv.next190
%8 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp eq i32 %8, 1
%or.cond177 = and i1 %cmp8, %cmp16
%cmp22 = icmp slt i64 %7, %1
%or.cond178 = and i1 %cmp22, %or.cond177
br i1 %or.cond178, label %if.then23, label %if.end26
if.then23: ; preds = %if.end
%9 = trunc i64 %7 to i32
%10 = trunc i64 %indvars.iv.next190 to i32
tail call void @visit(i32 noundef %9, i32 noundef %10, i32 noundef %x, i32 noundef %y)
br label %if.end26
if.end26: ; preds = %if.then23, %if.end
%arrayidx31 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %7, i64 %indvars.iv189
%11 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32 = icmp eq i32 %11, 1
%or.cond179 = and i1 %cmp22, %cmp32
br i1 %or.cond179, label %if.then36, label %if.end38
if.then36: ; preds = %if.end26
%12 = trunc i64 %7 to i32
%13 = trunc i64 %indvars.iv189 to i32
tail call void @visit(i32 noundef %12, i32 noundef %13, i32 noundef %x, i32 noundef %y)
br label %if.end38
if.end38: ; preds = %if.then36, %if.end26
%14 = add nsw i64 %indvars.iv189, -1
%arrayidx43 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %7, i64 %14
%15 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%cmp44 = icmp eq i32 %15, 1
%or.cond180 = and i1 %cmp22, %cmp44
%cmp50 = icmp sgt i64 %indvars.iv189, 0
%or.cond181 = and i1 %cmp50, %or.cond180
br i1 %or.cond181, label %if.then51, label %if.end54
if.then51: ; preds = %if.end38
%16 = trunc i64 %7 to i32
%17 = trunc i64 %14 to i32
tail call void @visit(i32 noundef %16, i32 noundef %17, i32 noundef %x, i32 noundef %y)
br label %if.end54
if.end54: ; preds = %if.then51, %if.end38
%arrayidx59 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 %14
%18 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%cmp60 = icmp eq i32 %18, 1
%or.cond182 = and i1 %cmp50, %cmp60
br i1 %or.cond182, label %if.then64, label %if.end66
if.then64: ; preds = %if.end54
%19 = trunc i64 %indvars.iv to i32
%20 = trunc i64 %14 to i32
tail call void @visit(i32 noundef %19, i32 noundef %20, i32 noundef %x, i32 noundef %y)
br label %if.end66
if.end66: ; preds = %if.then64, %if.end54
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx72 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %indvars.iv.next, i64 %14
%21 = load i32, ptr %arrayidx72, align 4, !tbaa !5
%cmp73 = icmp eq i32 %21, 1
%cmp76 = icmp sgt i64 %indvars.iv, 0
%or.cond183 = and i1 %cmp76, %cmp73
%or.cond184 = and i1 %cmp50, %or.cond183
br i1 %or.cond184, label %if.then80, label %if.end83
if.then80: ; preds = %if.end66
%22 = trunc i64 %indvars.iv.next to i32
%23 = trunc i64 %14 to i32
tail call void @visit(i32 noundef %22, i32 noundef %23, i32 noundef %x, i32 noundef %y)
br label %if.end83
if.end83: ; preds = %if.then80, %if.end66
%arrayidx88 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %indvars.iv.next, i64 %indvars.iv189
%24 = load i32, ptr %arrayidx88, align 4, !tbaa !5
%cmp89 = icmp eq i32 %24, 1
%or.cond185 = and i1 %cmp76, %cmp89
br i1 %or.cond185, label %if.then93, label %if.end95
if.then93: ; preds = %if.end83
%25 = trunc i64 %indvars.iv.next to i32
%26 = trunc i64 %indvars.iv189 to i32
tail call void @visit(i32 noundef %25, i32 noundef %26, i32 noundef %x, i32 noundef %y)
br label %if.end95
if.end95: ; preds = %if.then93, %if.end83
%arrayidx101 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next190
%27 = load i32, ptr %arrayidx101, align 4, !tbaa !5
%cmp102 = icmp eq i32 %27, 1
%or.cond186 = and i1 %cmp76, %cmp102
%or.cond187 = and i1 %cmp8, %or.cond186
br i1 %or.cond187, label %tailrecurse, label %if.end112
if.end112: ; preds = %if.end95
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call57 = 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
%cmp58 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp159 = icmp eq i32 %1, 0
%or.cond60 = select i1 %cmp58, i1 %cmp159, i1 false
br i1 %or.cond60, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end31
%2 = phi i32 [ %28, %for.end31 ], [ %0, %entry ]
%3 = phi i32 [ %29, %for.end31 ], [ %1, %entry ]
%cmp248 = icmp sgt i32 %3, 0
%4 = icmp sgt i32 %2, 0
%or.cond81 = and i1 %cmp248, %4
br i1 %or.cond81, label %for.cond3.preheader, label %for.end31
for.cond12.preheader: ; preds = %for.inc9
%cmp1353 = icmp sgt i32 %10, 0
%5 = icmp sgt i32 %11, 0
%or.cond82 = and i1 %cmp1353, %5
br i1 %or.cond82, label %for.cond15.preheader, label %for.end31
for.cond3.preheader: ; preds = %for.cond.preheader, %for.inc9
%6 = phi i32 [ %10, %for.inc9 ], [ %3, %for.cond.preheader ]
%7 = phi i32 [ %11, %for.inc9 ], [ %2, %for.cond.preheader ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.inc9 ], [ 0, %for.cond.preheader ]
%cmp446 = icmp sgt i32 %7, 0
br i1 %cmp446, label %for.body5, label %for.inc9
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %indvars.iv64, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %x, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp4, label %for.body5, label %for.inc9.loopexit, !llvm.loop !9
for.inc9.loopexit: ; preds = %for.body5
%.pre = load i32, ptr %y, align 4, !tbaa !5
br label %for.inc9
for.inc9: ; preds = %for.inc9.loopexit, %for.cond3.preheader
%10 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %6, %for.cond3.preheader ]
%11 = phi i32 [ %8, %for.inc9.loopexit ], [ %7, %for.cond3.preheader ]
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%12 = sext i32 %10 to i64
%cmp2 = icmp slt i64 %indvars.iv.next65, %12
br i1 %cmp2, label %for.cond3.preheader, label %for.cond12.preheader, !llvm.loop !11
for.cond15.preheader: ; preds = %for.cond12.preheader, %for.inc29
%13 = phi i32 [ %24, %for.inc29 ], [ %10, %for.cond12.preheader ]
%14 = phi i32 [ %25, %for.inc29 ], [ %11, %for.cond12.preheader ]
%15 = phi i32 [ %26, %for.inc29 ], [ %11, %for.cond12.preheader ]
%indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.inc29 ], [ 0, %for.cond12.preheader ]
%is.055 = phi i32 [ %is.1.lcssa, %for.inc29 ], [ 0, %for.cond12.preheader ]
%cmp1650 = icmp sgt i32 %15, 0
br i1 %cmp1650, label %for.body17.lr.ph, label %for.inc29
for.body17.lr.ph: ; preds = %for.cond15.preheader
%16 = trunc i64 %indvars.iv70 to i32
br label %for.body17
for.body17: ; preds = %for.body17.lr.ph, %for.inc26
%17 = phi i32 [ %14, %for.body17.lr.ph ], [ %22, %for.inc26 ]
%indvars.iv67 = phi i64 [ 0, %for.body17.lr.ph ], [ %indvars.iv.next68, %for.inc26 ]
%18 = phi i32 [ %15, %for.body17.lr.ph ], [ %22, %for.inc26 ]
%is.152 = phi i32 [ %is.055, %for.body17.lr.ph ], [ %is.2, %for.inc26 ]
%arrayidx21 = getelementptr inbounds [50 x [50 x i32]], ptr @M, i64 0, i64 %indvars.iv70, i64 %indvars.iv67
%19 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp eq i32 %19, 1
br i1 %cmp22, label %if.then23, label %for.inc26
if.then23: ; preds = %for.body17
%inc24 = add nsw i32 %is.152, 1
%20 = load i32, ptr %y, align 4, !tbaa !5
%21 = trunc i64 %indvars.iv67 to i32
call void @visit(i32 noundef %16, i32 noundef %21, i32 noundef %18, i32 noundef %20)
%.pre73 = load i32, ptr %x, align 4, !tbaa !5
br label %for.inc26
for.inc26: ; preds = %for.body17, %if.then23
%22 = phi i32 [ %.pre73, %if.then23 ], [ %17, %for.body17 ]
%is.2 = phi i32 [ %inc24, %if.then23 ], [ %is.152, %for.body17 ]
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%23 = sext i32 %22 to i64
%cmp16 = icmp slt i64 %indvars.iv.next68, %23
br i1 %cmp16, label %for.body17, label %for.inc29.loopexit, !llvm.loop !13
for.inc29.loopexit: ; preds = %for.inc26
%.pre74 = load i32, ptr %y, align 4, !tbaa !5
br label %for.inc29
for.inc29: ; preds = %for.inc29.loopexit, %for.cond15.preheader
%24 = phi i32 [ %13, %for.cond15.preheader ], [ %.pre74, %for.inc29.loopexit ]
%25 = phi i32 [ %14, %for.cond15.preheader ], [ %22, %for.inc29.loopexit ]
%26 = phi i32 [ %15, %for.cond15.preheader ], [ %22, %for.inc29.loopexit ]
%is.1.lcssa = phi i32 [ %is.055, %for.cond15.preheader ], [ %is.2, %for.inc29.loopexit ]
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%27 = sext i32 %24 to i64
%cmp13 = icmp slt i64 %indvars.iv.next71, %27
br i1 %cmp13, label %for.cond15.preheader, label %for.end31, !llvm.loop !14
for.end31: ; preds = %for.inc29, %for.cond.preheader, %for.cond12.preheader
%is.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.cond.preheader ], [ %is.1.lcssa, %for.inc29 ]
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %is.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%28 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %28, 0
%29 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %29, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end31, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12}
|
#include <stdio.h>
#define NUM_LIMIT (1<<10)
#define OP_ADD (-1)
#define OP_SUB (-2)
#define OP_MUL (-3)
#define OP_KAKKO (-4)
int stack_num;
int stack[100];
int rp_num;
int rp[100];
int rp_compile(const char* statement) {
const char* now;
int expectOperator=0;
int nownumber;
stack_num=0;
rp_num=0;
for(now=statement;*now;now++) {
switch(*now) {
case '+':
if(!expectOperator)return 0;
while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
rp[rp_num++]=stack[--stack_num];
}
stack[stack_num++]=OP_ADD;
expectOperator=0;
break;
case '-':
if(!expectOperator)return 0;
while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
rp[rp_num++]=stack[--stack_num];
}
stack[stack_num++]=OP_SUB;
expectOperator=0;
break;
case '*':
if(!expectOperator)return 0;
while(stack_num>0 && stack[stack_num-1]==OP_MUL) {
rp[rp_num++]=stack[--stack_num];
}
stack[stack_num++]=OP_MUL;
expectOperator=0;
break;
case '(':
if(expectOperator)return 0;
stack[stack_num++]=OP_KAKKO;
expectOperator=0;
break;
case ')':
if(!expectOperator)return 0;
if(stack_num<=0 || stack[stack_num-1]==OP_KAKKO)return 0;
while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
rp[rp_num++]=stack[--stack_num];
}
if(stack_num>0)stack_num--; else return 0;
expectOperator=1;
break;
case '0':
case '1':
if(expectOperator)return 0;
nownumber=0;
for(;*now=='0' || *now=='1';now++) {
nownumber=nownumber*2+(*now)-'0';
if(nownumber>=NUM_LIMIT)return 0;
}
now--;
expectOperator=1;
rp[rp_num++]=nownumber;
break;
}
}
while(stack_num>0) {
stack_num--;
if(stack[stack_num]==OP_KAKKO)return 0;
rp[rp_num++]=stack[stack_num];
}
return 1;
}
int rp_calc(void) {
int i;
stack_num=0;
for(i=0;i<rp_num;i++) {
switch(rp[i]) {
case OP_ADD:
if(stack_num<2)return -1;
stack[stack_num-2]+=stack[stack_num-1];
if(stack[stack_num-2]>=NUM_LIMIT)return -1;
stack_num--;
break;
case OP_SUB:
if(stack_num<2)return -1;
stack[stack_num-2]-=stack[stack_num-1];
if(stack[stack_num-2]<0)return -1;
stack_num--;
break;
case OP_MUL:
if(stack_num<2)return -1;
stack[stack_num-2]*=stack[stack_num-1];
if(stack[stack_num-2]>=NUM_LIMIT)return -1;
stack_num--;
break;
default:
stack[stack_num++]=rp[i];
break;
}
}
if(stack_num!=1)return -1;
return stack[0];
}
int main(void) {
char input[200];
const char* mozi="01+-*()";
int pos[5]={150,150,150,150,150};
int i,j;
int posnum;
int search_max;
int result;
scanf("%s",input);
posnum=0;
search_max=1;
for(i=0;input[i];i++) {
if(input[i]=='.') {
pos[posnum++]=i;
search_max*=7;
}
}
result=-1;
for(i=0;i<search_max;i++) {
int temp=i;
for(j=0;j<posnum;j++) {
input[pos[j]]=mozi[temp%7];
temp/=7;
}
if(!rp_compile(input))continue;
temp=rp_calc();
if(temp>result)result=temp;
}
printf("%d\n",result);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275872/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275872/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stack_num = dso_local local_unnamed_addr global i32 0, align 4
@rp_num = dso_local local_unnamed_addr global i32 0, align 4
@stack = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@rp = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [8 x i8] c"01+-*()\00", align 1
@__const.main.pos = private unnamed_addr constant [5 x i32] [i32 150, i32 150, i32 150, i32 150, i32 150], align 16
@.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(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @rp_compile(ptr nocapture noundef readonly %statement) local_unnamed_addr #0 {
entry:
store i32 0, ptr @stack_num, align 4, !tbaa !5
store i32 0, ptr @rp_num, align 4, !tbaa !5
%0 = load i8, ptr %statement, align 1, !tbaa !9
%tobool.not232 = icmp eq i8 %0, 0
br i1 %tobool.not232, label %cleanup, label %for.body
while.cond130.preheader: ; preds = %for.inc127
%cmp131239 = icmp sgt i32 %stack_num.promoted206226, 0
br i1 %cmp131239, label %while.body133.preheader, label %cleanup
while.body133.preheader: ; preds = %while.cond130.preheader
%1 = sext i32 %rp_num.promoted295 to i64
%2 = zext i32 %stack_num.promoted206226 to i64
br label %while.body133
for.body: ; preds = %entry, %for.inc127
%rp_num.promoted296 = phi i32 [ %rp_num.promoted295, %for.inc127 ], [ 0, %entry ]
%3 = phi i8 [ %43, %for.inc127 ], [ %0, %entry ]
%expectOperator.0236 = phi i32 [ %expectOperator.1, %for.inc127 ], [ 0, %entry ]
%now.0235 = phi ptr [ %incdec.ptr128, %for.inc127 ], [ %statement, %entry ]
%rp_num.promoted208224234 = phi i32 [ %rp_num.promoted208223, %for.inc127 ], [ 0, %entry ]
%stack_num.promoted206227233 = phi i32 [ %stack_num.promoted206226, %for.inc127 ], [ 0, %entry ]
%conv = sext i8 %3 to i32
switch i32 %conv, label %for.inc127 [
i32 43, label %sw.bb
i32 45, label %sw.bb12
i32 42, label %sw.bb37
i32 40, label %sw.bb62
i32 41, label %sw.bb69
i32 48, label %sw.bb105
i32 49, label %sw.bb105
]
sw.bb: ; preds = %for.body
%tobool1.not = icmp eq i32 %expectOperator.0236, 0
br i1 %tobool1.not, label %cleanup, label %while.cond.preheader
while.cond.preheader: ; preds = %sw.bb
%cmp210 = icmp sgt i32 %stack_num.promoted206227233, 0
br i1 %cmp210, label %land.rhs.preheader, label %while.end
land.rhs.preheader: ; preds = %while.cond.preheader
%4 = sext i32 %rp_num.promoted208224234 to i64
%5 = zext i32 %stack_num.promoted206227233 to i64
%6 = add i32 %stack_num.promoted206227233, %rp_num.promoted208224234
%indvars.iv.next273366 = add nsw i64 %5, -1
%idxprom367 = and i64 %indvars.iv.next273366, 4294967295
%arrayidx368 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom367
%7 = load i32, ptr %arrayidx368, align 4, !tbaa !5
%cmp3.not369 = icmp eq i32 %7, -4
br i1 %cmp3.not369, label %while.end.loopexit.split.loop.exit315, label %while.body
land.rhs: ; preds = %while.body
%indvars.iv.next273 = add nsw i64 %indvars.iv.next273372, -1
%idxprom = and i64 %indvars.iv.next273, 4294967295
%arrayidx = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom
%8 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp3.not = icmp eq i32 %8, -4
br i1 %cmp3.not, label %while.end.loopexit.split.loop.exit315.loopexit, label %while.body, !llvm.loop !10
while.body: ; preds = %land.rhs.preheader, %land.rhs
%9 = phi i32 [ %8, %land.rhs ], [ %7, %land.rhs.preheader ]
%indvars.iv.next273372 = phi i64 [ %indvars.iv.next273, %land.rhs ], [ %indvars.iv.next273366, %land.rhs.preheader ]
%indvars.iv270371 = phi i64 [ %indvars.iv.next271, %land.rhs ], [ %4, %land.rhs.preheader ]
%indvars.iv272370 = phi i64 [ %indvars.iv.next273372, %land.rhs ], [ %5, %land.rhs.preheader ]
%indvars.iv.next271 = add nsw i64 %indvars.iv270371, 1
%10 = trunc i64 %indvars.iv.next271 to i32
%arrayidx8 = getelementptr inbounds [100 x i32], ptr @rp, i64 0, i64 %indvars.iv270371
store i32 %9, ptr %arrayidx8, align 4, !tbaa !5
%cmp = icmp ugt i64 %indvars.iv272370, 1
br i1 %cmp, label %land.rhs, label %while.end.loopexit, !llvm.loop !10
while.end.loopexit.split.loop.exit315.loopexit: ; preds = %land.rhs
store i32 %10, ptr @rp_num, align 4, !tbaa !5
br label %while.end.loopexit.split.loop.exit315
while.end.loopexit.split.loop.exit315: ; preds = %while.end.loopexit.split.loop.exit315.loopexit, %land.rhs.preheader
%rp_num.promoted294.lcssa = phi i32 [ %rp_num.promoted296, %land.rhs.preheader ], [ %10, %while.end.loopexit.split.loop.exit315.loopexit ]
%indvars.iv272.lcssa = phi i64 [ %5, %land.rhs.preheader ], [ %indvars.iv.next273372, %while.end.loopexit.split.loop.exit315.loopexit ]
%indvars.iv270.lcssa = phi i64 [ %4, %land.rhs.preheader ], [ %indvars.iv.next271, %while.end.loopexit.split.loop.exit315.loopexit ]
%11 = trunc i64 %indvars.iv270.lcssa to i32
%12 = trunc i64 %indvars.iv272.lcssa to i32
br label %while.end
while.end.loopexit: ; preds = %while.body
store i32 %10, ptr @rp_num, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.end.loopexit, %while.end.loopexit.split.loop.exit315, %while.cond.preheader
%rp_num.promoted292 = phi i32 [ %rp_num.promoted296, %while.cond.preheader ], [ %rp_num.promoted294.lcssa, %while.end.loopexit.split.loop.exit315 ], [ %10, %while.end.loopexit ]
%rp_num.promoted208221 = phi i32 [ %rp_num.promoted208224234, %while.cond.preheader ], [ %11, %while.end.loopexit.split.loop.exit315 ], [ %6, %while.end.loopexit ]
%.lcssa178 = phi i32 [ %stack_num.promoted206227233, %while.cond.preheader ], [ %12, %while.end.loopexit.split.loop.exit315 ], [ 0, %while.end.loopexit ]
%inc9 = add nsw i32 %.lcssa178, 1
store i32 %inc9, ptr @stack_num, align 4, !tbaa !5
%idxprom10 = sext i32 %.lcssa178 to i64
%arrayidx11 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom10
store i32 -1, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc127
sw.bb12: ; preds = %for.body
%tobool13.not = icmp eq i32 %expectOperator.0236, 0
br i1 %tobool13.not, label %cleanup, label %while.cond16.preheader
while.cond16.preheader: ; preds = %sw.bb12
%cmp17201 = icmp sgt i32 %stack_num.promoted206227233, 0
br i1 %cmp17201, label %land.rhs19.preheader, label %while.end33
land.rhs19.preheader: ; preds = %while.cond16.preheader
%13 = sext i32 %rp_num.promoted208224234 to i64
%14 = zext i32 %stack_num.promoted206227233 to i64
%15 = add i32 %stack_num.promoted206227233, %rp_num.promoted208224234
%indvars.iv.next266356 = add nsw i64 %14, -1
%idxprom21357 = and i64 %indvars.iv.next266356, 4294967295
%arrayidx22358 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom21357
%16 = load i32, ptr %arrayidx22358, align 4, !tbaa !5
%cmp23.not359 = icmp eq i32 %16, -4
br i1 %cmp23.not359, label %while.end33.loopexit.split.loop.exit311, label %while.body26
land.rhs19: ; preds = %while.body26
%indvars.iv.next266 = add nsw i64 %indvars.iv.next266362, -1
%idxprom21 = and i64 %indvars.iv.next266, 4294967295
%arrayidx22 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom21
%17 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.not = icmp eq i32 %17, -4
br i1 %cmp23.not, label %while.end33.loopexit.split.loop.exit311.loopexit, label %while.body26, !llvm.loop !12
while.body26: ; preds = %land.rhs19.preheader, %land.rhs19
%18 = phi i32 [ %17, %land.rhs19 ], [ %16, %land.rhs19.preheader ]
%indvars.iv.next266362 = phi i64 [ %indvars.iv.next266, %land.rhs19 ], [ %indvars.iv.next266356, %land.rhs19.preheader ]
%indvars.iv263361 = phi i64 [ %indvars.iv.next264, %land.rhs19 ], [ %13, %land.rhs19.preheader ]
%indvars.iv265360 = phi i64 [ %indvars.iv.next266362, %land.rhs19 ], [ %14, %land.rhs19.preheader ]
%indvars.iv.next264 = add nsw i64 %indvars.iv263361, 1
%19 = trunc i64 %indvars.iv.next264 to i32
%arrayidx32 = getelementptr inbounds [100 x i32], ptr @rp, i64 0, i64 %indvars.iv263361
store i32 %18, ptr %arrayidx32, align 4, !tbaa !5
%cmp17 = icmp ugt i64 %indvars.iv265360, 1
br i1 %cmp17, label %land.rhs19, label %while.end33.loopexit, !llvm.loop !12
while.end33.loopexit.split.loop.exit311.loopexit: ; preds = %land.rhs19
store i32 %19, ptr @rp_num, align 4, !tbaa !5
br label %while.end33.loopexit.split.loop.exit311
while.end33.loopexit.split.loop.exit311: ; preds = %while.end33.loopexit.split.loop.exit311.loopexit, %land.rhs19.preheader
%rp_num.promoted291.lcssa = phi i32 [ %rp_num.promoted296, %land.rhs19.preheader ], [ %19, %while.end33.loopexit.split.loop.exit311.loopexit ]
%indvars.iv265.lcssa = phi i64 [ %14, %land.rhs19.preheader ], [ %indvars.iv.next266362, %while.end33.loopexit.split.loop.exit311.loopexit ]
%indvars.iv263.lcssa = phi i64 [ %13, %land.rhs19.preheader ], [ %indvars.iv.next264, %while.end33.loopexit.split.loop.exit311.loopexit ]
%20 = trunc i64 %indvars.iv263.lcssa to i32
%21 = trunc i64 %indvars.iv265.lcssa to i32
br label %while.end33
while.end33.loopexit: ; preds = %while.body26
store i32 %19, ptr @rp_num, align 4, !tbaa !5
br label %while.end33
while.end33: ; preds = %while.end33.loopexit, %while.end33.loopexit.split.loop.exit311, %while.cond16.preheader
%rp_num.promoted289 = phi i32 [ %rp_num.promoted296, %while.cond16.preheader ], [ %rp_num.promoted291.lcssa, %while.end33.loopexit.split.loop.exit311 ], [ %19, %while.end33.loopexit ]
%rp_num.promoted208219 = phi i32 [ %rp_num.promoted208224234, %while.cond16.preheader ], [ %20, %while.end33.loopexit.split.loop.exit311 ], [ %15, %while.end33.loopexit ]
%.lcssa177 = phi i32 [ %stack_num.promoted206227233, %while.cond16.preheader ], [ %21, %while.end33.loopexit.split.loop.exit311 ], [ 0, %while.end33.loopexit ]
%inc34 = add nsw i32 %.lcssa177, 1
store i32 %inc34, ptr @stack_num, align 4, !tbaa !5
%idxprom35 = sext i32 %.lcssa177 to i64
%arrayidx36 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom35
store i32 -2, ptr %arrayidx36, align 4, !tbaa !5
br label %for.inc127
sw.bb37: ; preds = %for.body
%tobool38.not = icmp eq i32 %expectOperator.0236, 0
br i1 %tobool38.not, label %cleanup, label %while.cond41.preheader
while.cond41.preheader: ; preds = %sw.bb37
%cmp42192 = icmp sgt i32 %stack_num.promoted206227233, 0
br i1 %cmp42192, label %land.rhs44.preheader, label %while.end58
land.rhs44.preheader: ; preds = %while.cond41.preheader
%22 = sext i32 %rp_num.promoted208224234 to i64
%23 = zext i32 %stack_num.promoted206227233 to i64
%24 = add i32 %stack_num.promoted206227233, %rp_num.promoted208224234
%indvars.iv.next259346 = add nsw i64 %23, -1
%idxprom46347 = and i64 %indvars.iv.next259346, 4294967295
%arrayidx47348 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom46347
%25 = load i32, ptr %arrayidx47348, align 4, !tbaa !5
%cmp48349 = icmp eq i32 %25, -3
br i1 %cmp48349, label %while.body51, label %while.end58.loopexit.split.loop.exit307
land.rhs44: ; preds = %while.body51
%indvars.iv.next259 = add nsw i64 %indvars.iv.next259352, -1
%idxprom46 = and i64 %indvars.iv.next259, 4294967295
%arrayidx47 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom46
%26 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%cmp48 = icmp eq i32 %26, -3
br i1 %cmp48, label %while.body51, label %while.end58.loopexit.split.loop.exit307.loopexit, !llvm.loop !13
while.body51: ; preds = %land.rhs44.preheader, %land.rhs44
%indvars.iv.next259352 = phi i64 [ %indvars.iv.next259, %land.rhs44 ], [ %indvars.iv.next259346, %land.rhs44.preheader ]
%indvars.iv256351 = phi i64 [ %indvars.iv.next257, %land.rhs44 ], [ %22, %land.rhs44.preheader ]
%indvars.iv258350 = phi i64 [ %indvars.iv.next259352, %land.rhs44 ], [ %23, %land.rhs44.preheader ]
%indvars.iv.next257 = add nsw i64 %indvars.iv256351, 1
%27 = trunc i64 %indvars.iv.next257 to i32
%arrayidx57 = getelementptr inbounds [100 x i32], ptr @rp, i64 0, i64 %indvars.iv256351
store i32 -3, ptr %arrayidx57, align 4, !tbaa !5
%cmp42 = icmp ugt i64 %indvars.iv258350, 1
br i1 %cmp42, label %land.rhs44, label %while.end58.loopexit, !llvm.loop !13
while.end58.loopexit.split.loop.exit307.loopexit: ; preds = %land.rhs44
store i32 %27, ptr @rp_num, align 4, !tbaa !5
br label %while.end58.loopexit.split.loop.exit307
while.end58.loopexit.split.loop.exit307: ; preds = %while.end58.loopexit.split.loop.exit307.loopexit, %land.rhs44.preheader
%rp_num.promoted288.lcssa = phi i32 [ %rp_num.promoted296, %land.rhs44.preheader ], [ %27, %while.end58.loopexit.split.loop.exit307.loopexit ]
%indvars.iv258.lcssa = phi i64 [ %23, %land.rhs44.preheader ], [ %indvars.iv.next259352, %while.end58.loopexit.split.loop.exit307.loopexit ]
%indvars.iv256.lcssa = phi i64 [ %22, %land.rhs44.preheader ], [ %indvars.iv.next257, %while.end58.loopexit.split.loop.exit307.loopexit ]
%28 = trunc i64 %indvars.iv256.lcssa to i32
%29 = trunc i64 %indvars.iv258.lcssa to i32
br label %while.end58
while.end58.loopexit: ; preds = %while.body51
store i32 %27, ptr @rp_num, align 4, !tbaa !5
br label %while.end58
while.end58: ; preds = %while.end58.loopexit, %while.end58.loopexit.split.loop.exit307, %while.cond41.preheader
%rp_num.promoted286 = phi i32 [ %rp_num.promoted296, %while.cond41.preheader ], [ %rp_num.promoted288.lcssa, %while.end58.loopexit.split.loop.exit307 ], [ %27, %while.end58.loopexit ]
%rp_num.promoted208217 = phi i32 [ %rp_num.promoted208224234, %while.cond41.preheader ], [ %28, %while.end58.loopexit.split.loop.exit307 ], [ %24, %while.end58.loopexit ]
%.lcssa = phi i32 [ %stack_num.promoted206227233, %while.cond41.preheader ], [ %29, %while.end58.loopexit.split.loop.exit307 ], [ 0, %while.end58.loopexit ]
%inc59 = add nsw i32 %.lcssa, 1
store i32 %inc59, ptr @stack_num, align 4, !tbaa !5
%idxprom60 = sext i32 %.lcssa to i64
%arrayidx61 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom60
store i32 -3, ptr %arrayidx61, align 4, !tbaa !5
br label %for.inc127
sw.bb62: ; preds = %for.body
%tobool63.not = icmp eq i32 %expectOperator.0236, 0
br i1 %tobool63.not, label %if.end65, label %cleanup
if.end65: ; preds = %sw.bb62
%inc66 = add nsw i32 %stack_num.promoted206227233, 1
store i32 %inc66, ptr @stack_num, align 4, !tbaa !5
%idxprom67 = sext i32 %stack_num.promoted206227233 to i64
%arrayidx68 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom67
store i32 -4, ptr %arrayidx68, align 4, !tbaa !5
br label %for.inc127
sw.bb69: ; preds = %for.body
%tobool70.not = icmp eq i32 %expectOperator.0236, 0
%cmp73 = icmp slt i32 %stack_num.promoted206227233, 1
%or.cond = select i1 %tobool70.not, i1 true, i1 %cmp73
br i1 %or.cond, label %cleanup, label %lor.lhs.false
lor.lhs.false: ; preds = %sw.bb69
%sub75 = add nsw i32 %stack_num.promoted206227233, -1
%idxprom76 = zext i32 %sub75 to i64
%arrayidx77 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom76
%30 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%cmp78.not = icmp eq i32 %30, -4
br i1 %cmp78.not, label %cleanup, label %land.rhs85.preheader
land.rhs85.preheader: ; preds = %lor.lhs.false
%31 = sext i32 %rp_num.promoted208224234 to i64
%32 = zext i32 %stack_num.promoted206227233 to i64
%indvars.iv.next252337 = add nsw i64 %32, -1
%idxprom87338 = and i64 %indvars.iv.next252337, 4294967295
%arrayidx88339 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom87338
%33 = load i32, ptr %arrayidx88339, align 4, !tbaa !5
%cmp89.not340 = icmp eq i32 %33, -4
br i1 %cmp89.not340, label %if.then102, label %while.body92
land.rhs85: ; preds = %while.body92
%indvars.iv.next252 = add nsw i64 %indvars.iv.next252343, -1
%idxprom87 = and i64 %indvars.iv.next252, 4294967295
%arrayidx88 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom87
%34 = load i32, ptr %arrayidx88, align 4, !tbaa !5
%cmp89.not = icmp eq i32 %34, -4
br i1 %cmp89.not, label %if.then102.loopexit, label %while.body92, !llvm.loop !14
while.body92: ; preds = %land.rhs85.preheader, %land.rhs85
%35 = phi i32 [ %34, %land.rhs85 ], [ %33, %land.rhs85.preheader ]
%indvars.iv.next252343 = phi i64 [ %indvars.iv.next252, %land.rhs85 ], [ %indvars.iv.next252337, %land.rhs85.preheader ]
%indvars.iv342 = phi i64 [ %indvars.iv.next, %land.rhs85 ], [ %31, %land.rhs85.preheader ]
%indvars.iv251341 = phi i64 [ %indvars.iv.next252343, %land.rhs85 ], [ %32, %land.rhs85.preheader ]
%indvars254 = trunc i64 %indvars.iv.next252343 to i32
%indvars.iv.next = add nsw i64 %indvars.iv342, 1
%36 = trunc i64 %indvars.iv.next to i32
%arrayidx98 = getelementptr inbounds [100 x i32], ptr @rp, i64 0, i64 %indvars.iv342
store i32 %35, ptr %arrayidx98, align 4, !tbaa !5
%cmp83 = icmp ugt i64 %indvars.iv251341, 1
br i1 %cmp83, label %land.rhs85, label %cleanup.loopexit, !llvm.loop !14
if.then102.loopexit: ; preds = %land.rhs85
store i32 %indvars254, ptr @stack_num, align 4, !tbaa !5
store i32 %36, ptr @rp_num, align 4, !tbaa !5
br label %if.then102
if.then102: ; preds = %if.then102.loopexit, %land.rhs85.preheader
%rp_num.promoted285.lcssa = phi i32 [ %rp_num.promoted296, %land.rhs85.preheader ], [ %36, %if.then102.loopexit ]
%indvars.iv251.lcssa = phi i64 [ %32, %land.rhs85.preheader ], [ %indvars.iv.next252343, %if.then102.loopexit ]
%indvars.iv.lcssa = phi i64 [ %31, %land.rhs85.preheader ], [ %indvars.iv.next, %if.then102.loopexit ]
%37 = trunc i64 %indvars.iv251.lcssa to i32
%38 = trunc i64 %indvars.iv.lcssa to i32
%dec103 = add nsw i32 %37, -1
store i32 %dec103, ptr @stack_num, align 4, !tbaa !5
br label %for.inc127
sw.bb105: ; preds = %for.body, %for.body
%tobool106.not = icmp eq i32 %expectOperator.0236, 0
br i1 %tobool106.not, label %for.cond109.preheader, label %cleanup
for.cond109.preheader: ; preds = %sw.bb105
%39 = and i8 %3, -2
%switch179 = icmp eq i8 %39, 48
br i1 %switch179, label %for.body116, label %for.end
for.body116: ; preds = %for.cond109.preheader, %for.inc
%40 = phi i8 [ %41, %for.inc ], [ %3, %for.cond109.preheader ]
%nownumber.0181 = phi i32 [ %sub118, %for.inc ], [ 0, %for.cond109.preheader ]
%now.1180 = phi ptr [ %incdec.ptr, %for.inc ], [ %now.0235, %for.cond109.preheader ]
%mul = shl nsw i32 %nownumber.0181, 1
%conv117 = zext i8 %40 to i32
%add = add nsw i32 %mul, %conv117
%cmp119 = icmp sgt i32 %add, 1071
br i1 %cmp119, label %cleanup, label %for.inc
for.inc: ; preds = %for.body116
%sub118 = add nsw i32 %add, -48
%incdec.ptr = getelementptr inbounds i8, ptr %now.1180, i64 1
%41 = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%42 = and i8 %41, -2
%switch = icmp eq i8 %42, 48
br i1 %switch, label %for.body116, label %for.end, !llvm.loop !15
for.end: ; preds = %for.inc, %for.cond109.preheader
%now.1.lcssa = phi ptr [ %now.0235, %for.cond109.preheader ], [ %incdec.ptr, %for.inc ]
%nownumber.0.lcssa = phi i32 [ 0, %for.cond109.preheader ], [ %sub118, %for.inc ]
%incdec.ptr123 = getelementptr inbounds i8, ptr %now.1.lcssa, i64 -1
%inc124 = add nsw i32 %rp_num.promoted208224234, 1
store i32 %inc124, ptr @rp_num, align 4, !tbaa !5
%idxprom125 = sext i32 %rp_num.promoted208224234 to i64
%arrayidx126 = getelementptr inbounds [100 x i32], ptr @rp, i64 0, i64 %idxprom125
store i32 %nownumber.0.lcssa, ptr %arrayidx126, align 4, !tbaa !5
br label %for.inc127
for.inc127: ; preds = %while.end, %while.end33, %while.end58, %if.end65, %if.then102, %for.end, %for.body
%rp_num.promoted295 = phi i32 [ %rp_num.promoted296, %for.body ], [ %inc124, %for.end ], [ %rp_num.promoted285.lcssa, %if.then102 ], [ %rp_num.promoted296, %if.end65 ], [ %rp_num.promoted286, %while.end58 ], [ %rp_num.promoted289, %while.end33 ], [ %rp_num.promoted292, %while.end ]
%stack_num.promoted206226 = phi i32 [ %stack_num.promoted206227233, %for.body ], [ %stack_num.promoted206227233, %for.end ], [ %dec103, %if.then102 ], [ %inc66, %if.end65 ], [ %inc59, %while.end58 ], [ %inc34, %while.end33 ], [ %inc9, %while.end ]
%rp_num.promoted208223 = phi i32 [ %rp_num.promoted208224234, %for.body ], [ %inc124, %for.end ], [ %38, %if.then102 ], [ %rp_num.promoted208224234, %if.end65 ], [ %rp_num.promoted208217, %while.end58 ], [ %rp_num.promoted208219, %while.end33 ], [ %rp_num.promoted208221, %while.end ]
%now.2 = phi ptr [ %now.0235, %for.body ], [ %incdec.ptr123, %for.end ], [ %now.0235, %if.then102 ], [ %now.0235, %if.end65 ], [ %now.0235, %while.end58 ], [ %now.0235, %while.end33 ], [ %now.0235, %while.end ]
%expectOperator.1 = phi i32 [ %expectOperator.0236, %for.body ], [ 1, %for.end ], [ 1, %if.then102 ], [ 0, %if.end65 ], [ 0, %while.end58 ], [ 0, %while.end33 ], [ 0, %while.end ]
%incdec.ptr128 = getelementptr inbounds i8, ptr %now.2, i64 1
%43 = load i8, ptr %incdec.ptr128, align 1, !tbaa !9
%tobool.not = icmp eq i8 %43, 0
br i1 %tobool.not, label %while.cond130.preheader, label %for.body, !llvm.loop !16
while.body133: ; preds = %while.body133.preheader, %if.end140
%indvars.iv279 = phi i64 [ %1, %while.body133.preheader ], [ %indvars.iv.next280, %if.end140 ]
%indvars.iv277 = phi i64 [ %2, %while.body133.preheader ], [ %indvars.iv.next278, %if.end140 ]
%indvars.iv.next278 = add nsw i64 %indvars.iv277, -1
%idxprom135 = and i64 %indvars.iv.next278, 4294967295
%arrayidx136 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom135
%44 = load i32, ptr %arrayidx136, align 4, !tbaa !5
%cmp137 = icmp eq i32 %44, -4
br i1 %cmp137, label %while.body133.cleanup.loopexit_crit_edge, label %if.end140
if.end140: ; preds = %while.body133
%indvars.iv.next280 = add nsw i64 %indvars.iv279, 1
%45 = trunc i64 %indvars.iv.next280 to i32
store i32 %45, ptr @rp_num, align 4, !tbaa !5
%arrayidx145 = getelementptr inbounds [100 x i32], ptr @rp, i64 0, i64 %indvars.iv279
store i32 %44, ptr %arrayidx145, align 4, !tbaa !5
%cmp131 = icmp ugt i64 %indvars.iv277, 1
br i1 %cmp131, label %while.body133, label %cleanup.sink.split, !llvm.loop !17
while.body133.cleanup.loopexit_crit_edge: ; preds = %while.body133
%indvars = trunc i64 %indvars.iv.next278 to i32
br label %cleanup.sink.split
cleanup.sink.split: ; preds = %if.end140, %while.body133.cleanup.loopexit_crit_edge
%indvars.sink = phi i32 [ %indvars, %while.body133.cleanup.loopexit_crit_edge ], [ 0, %if.end140 ]
%retval.0.ph = phi i32 [ 0, %while.body133.cleanup.loopexit_crit_edge ], [ 1, %if.end140 ]
store i32 %indvars.sink, ptr @stack_num, align 4, !tbaa !5
br label %cleanup
cleanup.loopexit: ; preds = %while.body92
store i32 %indvars254, ptr @stack_num, align 4, !tbaa !5
store i32 %36, ptr @rp_num, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %sw.bb105, %lor.lhs.false, %sw.bb69, %sw.bb62, %sw.bb37, %sw.bb12, %sw.bb, %for.body116, %cleanup.loopexit, %cleanup.sink.split, %entry, %while.cond130.preheader
%retval.0 = phi i32 [ 1, %while.cond130.preheader ], [ 1, %entry ], [ %retval.0.ph, %cleanup.sink.split ], [ 0, %cleanup.loopexit ], [ 0, %for.body116 ], [ 0, %sw.bb ], [ 0, %sw.bb12 ], [ 0, %sw.bb37 ], [ 0, %sw.bb62 ], [ 0, %sw.bb69 ], [ 0, %lor.lhs.false ], [ 0, %sw.bb105 ]
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 norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @rp_calc() local_unnamed_addr #2 {
entry:
store i32 0, ptr @stack_num, align 4, !tbaa !5
%0 = load i32, ptr @rp_num, align 4, !tbaa !5
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%inc6164 = phi i32 [ 0, %for.body.preheader ], [ %inc62.fr, %for.inc ]
%arrayidx = getelementptr inbounds [100 x i32], ptr @rp, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
switch i32 %1, label %sw.default [
i32 -1, label %sw.bb
i32 -2, label %sw.bb13
i32 -3, label %sw.bb31
]
sw.bb: ; preds = %for.body
%cmp1 = icmp slt i32 %inc6164, 2
br i1 %cmp1, label %cleanup, label %if.end
if.end: ; preds = %sw.bb
%sub = add nsw i32 %inc6164, -1
%idxprom2 = zext i32 %sub to i64
%arrayidx3 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom2
%2 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%sub4 = add nsw i32 %inc6164, -2
%idxprom5 = zext i32 %sub4 to i64
%arrayidx6 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom5
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %3, %2
store i32 %add, ptr %arrayidx6, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %add, 1023
br i1 %cmp10, label %cleanup, label %if.end12
if.end12: ; preds = %if.end
store i32 %sub, ptr @stack_num, align 4, !tbaa !5
br label %for.inc
sw.bb13: ; preds = %for.body
%cmp14 = icmp slt i32 %inc6164, 2
br i1 %cmp14, label %cleanup, label %if.end16
if.end16: ; preds = %sw.bb13
%sub17 = add nsw i32 %inc6164, -1
%idxprom18 = zext i32 %sub17 to i64
%arrayidx19 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom18
%4 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%sub20 = add nsw i32 %inc6164, -2
%idxprom21 = zext i32 %sub20 to i64
%arrayidx22 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom21
%5 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%sub23 = sub nsw i32 %5, %4
store i32 %sub23, ptr %arrayidx22, align 4, !tbaa !5
%cmp27 = icmp slt i32 %sub23, 0
br i1 %cmp27, label %cleanup, label %if.end29
if.end29: ; preds = %if.end16
store i32 %sub17, ptr @stack_num, align 4, !tbaa !5
br label %for.inc
sw.bb31: ; preds = %for.body
%cmp32 = icmp slt i32 %inc6164, 2
br i1 %cmp32, label %cleanup, label %if.end34
if.end34: ; preds = %sw.bb31
%sub35 = add nsw i32 %inc6164, -1
%idxprom36 = zext i32 %sub35 to i64
%arrayidx37 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom36
%6 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%sub38 = add nsw i32 %inc6164, -2
%idxprom39 = zext i32 %sub38 to i64
%arrayidx40 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom39
%7 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%mul = mul nsw i32 %7, %6
store i32 %mul, ptr %arrayidx40, align 4, !tbaa !5
%cmp44 = icmp sgt i32 %mul, 1023
br i1 %cmp44, label %cleanup, label %if.end46
if.end46: ; preds = %if.end34
store i32 %sub35, ptr @stack_num, align 4, !tbaa !5
br label %for.inc
sw.default: ; preds = %for.body
%inc = add nsw i32 %inc6164, 1
store i32 %inc, ptr @stack_num, align 4, !tbaa !5
%idxprom50 = sext i32 %inc6164 to i64
%arrayidx51 = getelementptr inbounds [100 x i32], ptr @stack, i64 0, i64 %idxprom50
store i32 %1, ptr %arrayidx51, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end12, %if.end29, %if.end46, %sw.default
%inc62 = phi i32 [ %sub, %if.end12 ], [ %sub17, %if.end29 ], [ %sub35, %if.end46 ], [ %inc, %sw.default ]
%inc62.fr = freeze i32 %inc62
%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 !18
for.end: ; preds = %for.inc
%8 = icmp eq i32 %inc62.fr, 1
%9 = load i32, ptr @stack, align 16
%spec.select = select i1 %8, i32 %9, i32 -1
br label %cleanup
cleanup: ; preds = %if.end34, %sw.bb31, %if.end16, %sw.bb13, %if.end, %sw.bb, %for.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ %spec.select, %for.end ], [ -1, %sw.bb ], [ -1, %if.end ], [ -1, %sw.bb13 ], [ -1, %if.end16 ], [ -1, %sw.bb31 ], [ -1, %if.end34 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%input = alloca [200 x i8], align 16
%pos = alloca [5 x i32], align 16
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %input) #7
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %pos) #7
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %pos, ptr noundef nonnull align 16 dereferenceable(20) @__const.main.pos, i64 20, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %input)
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%posnum.0 = phi i32 [ %posnum.1, %for.inc ], [ 0, %entry ]
%search_max.0 = phi i32 [ %search_max.1, %for.inc ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [200 x i8], ptr %input, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !9
switch i8 %0, label %for.inc [
i8 0, label %for.cond7.preheader
i8 46, label %if.then
]
for.cond7.preheader: ; preds = %for.cond
%cmp863 = icmp sgt i32 %search_max.0, 0
br i1 %cmp863, label %for.cond11.preheader.lr.ph, label %for.end36
for.cond11.preheader.lr.ph: ; preds = %for.cond7.preheader
%cmp1260 = icmp sgt i32 %posnum.0, 0
br i1 %cmp1260, label %for.cond11.preheader.us.preheader, label %for.cond11.preheader
for.cond11.preheader.us.preheader: ; preds = %for.cond11.preheader.lr.ph
%wide.trip.count = zext i32 %posnum.0 to i64
br label %for.cond11.preheader.us
for.cond11.preheader.us: ; preds = %for.cond11.preheader.us.preheader, %cleanup.us
%result.065.us = phi i32 [ %result.2.us, %cleanup.us ], [ -1, %for.cond11.preheader.us.preheader ]
%i.164.us = phi i32 [ %inc35.us, %cleanup.us ], [ 0, %for.cond11.preheader.us.preheader ]
br label %for.body14.us
if.end28.us: ; preds = %for.cond11.for.end23_crit_edge.us
%call29.us = call i32 @rp_calc()
%spec.select.us = call i32 @llvm.smax.i32(i32 %call29.us, i32 %result.065.us)
br label %cleanup.us
cleanup.us: ; preds = %if.end28.us, %for.cond11.for.end23_crit_edge.us
%result.2.us = phi i32 [ %spec.select.us, %if.end28.us ], [ %result.065.us, %for.cond11.for.end23_crit_edge.us ]
%inc35.us = add nuw nsw i32 %i.164.us, 1
%exitcond72.not = icmp eq i32 %inc35.us, %search_max.0
br i1 %exitcond72.not, label %for.end36, label %for.cond11.preheader.us, !llvm.loop !19
for.body14.us: ; preds = %for.cond11.preheader.us, %for.body14.us
%indvars.iv68 = phi i64 [ 0, %for.cond11.preheader.us ], [ %indvars.iv.next69, %for.body14.us ]
%temp.062.us = phi i32 [ %i.164.us, %for.cond11.preheader.us ], [ %div.us, %for.body14.us ]
%rem.us = srem i32 %temp.062.us, 7
%idxprom15.us = sext i32 %rem.us to i64
%arrayidx16.us = getelementptr inbounds i8, ptr @.str, i64 %idxprom15.us
%1 = load i8, ptr %arrayidx16.us, align 1, !tbaa !9
%arrayidx18.us = getelementptr inbounds [5 x i32], ptr %pos, i64 0, i64 %indvars.iv68
%2 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5
%idxprom19.us = sext i32 %2 to i64
%arrayidx20.us = getelementptr inbounds [200 x i8], ptr %input, i64 0, i64 %idxprom19.us
store i8 %1, ptr %arrayidx20.us, align 1, !tbaa !9
%div.us = sdiv i32 %temp.062.us, 7
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond71.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count
br i1 %exitcond71.not, label %for.cond11.for.end23_crit_edge.us, label %for.body14.us, !llvm.loop !20
for.cond11.for.end23_crit_edge.us: ; preds = %for.body14.us
%call25.us = call i32 @rp_compile(ptr noundef nonnull %input), !range !21
%tobool26.not.us = icmp eq i32 %call25.us, 0
br i1 %tobool26.not.us, label %cleanup.us, label %if.end28.us
if.then: ; preds = %for.cond
%inc = add nsw i32 %posnum.0, 1
%idxprom4 = sext i32 %posnum.0 to i64
%arrayidx5 = getelementptr inbounds [5 x i32], ptr %pos, i64 0, i64 %idxprom4
%3 = trunc i64 %indvars.iv to i32
store i32 %3, ptr %arrayidx5, align 4, !tbaa !5
%mul = mul nsw i32 %search_max.0, 7
br label %for.inc
for.inc: ; preds = %for.cond, %if.then
%posnum.1 = phi i32 [ %inc, %if.then ], [ %posnum.0, %for.cond ]
%search_max.1 = phi i32 [ %mul, %if.then ], [ %search_max.0, %for.cond ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !22
for.cond11.preheader: ; preds = %for.cond11.preheader.lr.ph, %cleanup
%result.065 = phi i32 [ %result.2, %cleanup ], [ -1, %for.cond11.preheader.lr.ph ]
%i.164 = phi i32 [ %inc35, %cleanup ], [ 0, %for.cond11.preheader.lr.ph ]
%call25 = call i32 @rp_compile(ptr noundef nonnull %input), !range !21
%tobool26.not = icmp eq i32 %call25, 0
br i1 %tobool26.not, label %cleanup, label %if.end28
if.end28: ; preds = %for.cond11.preheader
%call29 = call i32 @rp_calc()
%spec.select = call i32 @llvm.smax.i32(i32 %call29, i32 %result.065)
br label %cleanup
cleanup: ; preds = %for.cond11.preheader, %if.end28
%result.2 = phi i32 [ %spec.select, %if.end28 ], [ %result.065, %for.cond11.preheader ]
%inc35 = add nuw nsw i32 %i.164, 1
%exitcond.not = icmp eq i32 %inc35, %search_max.0
br i1 %exitcond.not, label %for.end36, label %for.cond11.preheader, !llvm.loop !19
for.end36: ; preds = %cleanup, %cleanup.us, %for.cond7.preheader
%result.0.lcssa = phi i32 [ -1, %for.cond7.preheader ], [ %result.2.us, %cleanup.us ], [ %result.2, %cleanup ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %result.0.lcssa)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %pos) #7
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %input) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 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 }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
!20 = distinct !{!20, !11}
!21 = !{i32 0, i32 2}
!22 = distinct !{!22, !11}
|
#include <stdio.h>
#include<math.h>
int main(void){
int q;
double x;
while(1){
scanf("%d", &q);
if(q == -1) break;
x = q / 2.0;
while(fabs(x * x * x - q) >= 0.00001 * q){
x = x - (x * x * x - q) / (3 * x * x);
}
printf("%f\n", x);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275915/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275915/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp31 = icmp eq i32 %0, -1
br i1 %cmp31, label %while.end17, label %if.end
if.end: ; preds = %entry, %while.end
%1 = phi i32 [ %7, %while.end ], [ %0, %entry ]
%conv = sitofp i32 %1 to double
%div = fmul double %conv, 5.000000e-01
%neg = fneg double %conv
%mul5 = fmul double %conv, 1.000000e-05
%mul27 = fmul double %div, %div
%2 = call double @llvm.fmuladd.f64(double %mul27, double %div, double %neg)
%3 = call double @llvm.fabs.f64(double %2)
%cmp628 = fcmp ult double %3, %mul5
br i1 %cmp628, label %while.end, label %while.body8
while.body8: ; preds = %if.end, %while.body8
%4 = phi double [ %5, %while.body8 ], [ %2, %if.end ]
%x.029 = phi double [ %sub, %while.body8 ], [ %div, %if.end ]
%mul13 = fmul double %x.029, 3.000000e+00
%mul14 = fmul double %x.029, %mul13
%div15 = fdiv double %4, %mul14
%sub = fsub double %x.029, %div15
%mul = fmul double %sub, %sub
%5 = call double @llvm.fmuladd.f64(double %mul, double %sub, double %neg)
%6 = call double @llvm.fabs.f64(double %5)
%cmp6 = fcmp ult double %6, %mul5
br i1 %cmp6, label %while.end, label %while.body8, !llvm.loop !9
while.end: ; preds = %while.body8, %if.end
%x.0.lcssa = phi double [ %div, %if.end ], [ %sub, %while.body8 ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %x.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%7 = load i32, ptr %q, align 4, !tbaa !5
%cmp = icmp eq i32 %7, -1
br i1 %cmp, label %while.end17, label %if.end
while.end17: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int n;
double ans, limit;
while (1) {
scanf("%d", &n);
if (n == -1) break;
limit = 0.00001 * n;
ans = n/2.0;
while (1) {
ans = ans - (ans * ans * ans - n) / (3 * ans * ans);
if (ans * ans * ans - n < limit) break;
}
printf("%f\n", ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_275959/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_275959/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp eq i32 %0, -1
br i1 %cmp30, label %while.end19, label %if.end
if.end: ; preds = %entry, %while.end
%1 = phi i32 [ %4, %while.end ], [ %0, %entry ]
%conv = sitofp i32 %1 to double
%mul = fmul double %conv, 1.000000e-05
%div = fmul double %conv, 5.000000e-01
%neg = fneg double %conv
br label %while.cond2
while.cond2: ; preds = %while.cond2, %if.end
%ans.0 = phi double [ %div, %if.end ], [ %sub, %while.cond2 ]
%mul4 = fmul double %ans.0, %ans.0
%2 = call double @llvm.fmuladd.f64(double %mul4, double %ans.0, double %neg)
%mul7 = fmul double %ans.0, 3.000000e+00
%mul8 = fmul double %ans.0, %mul7
%div9 = fdiv double %2, %mul8
%sub = fsub double %ans.0, %div9
%mul10 = fmul double %sub, %sub
%3 = call double @llvm.fmuladd.f64(double %mul10, double %sub, double %neg)
%cmp14 = fcmp olt double %3, %mul
br i1 %cmp14, label %while.end, label %while.cond2
while.end: ; preds = %while.cond2
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sub)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %4, -1
br i1 %cmp, label %while.end19, label %if.end
while.end19: ; preds = %while.end, %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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
long a, b, i;
while(scanf("%ld %ld", &a, &b) != EOF){
if(a>b){
long tmp=a;
a=b;
b=tmp;
}
long max = 1;
for(i=2; i<=a; i++) {
if(a%i==0 && b%i==0) max=i;
}
printf("%ld\n", max);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276008/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276008/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%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.end, label %while.body
while.body: ; preds = %entry, %for.end
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8
%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 [ %0, %if.then ], [ %1, %while.body ]
%3 = phi i64 [ %1, %if.then ], [ %0, %while.body ]
%cmp2.not15 = icmp slt i64 %3, 2
br i1 %cmp2.not15, label %for.end, label %for.body
for.body: ; preds = %if.end, %for.inc
%max.017 = phi i64 [ %max.1, %for.inc ], [ 1, %if.end ]
%i.016 = phi i64 [ %inc, %for.inc ], [ 2, %if.end ]
%rem = srem i64 %3, %i.016
%cmp3 = icmp eq i64 %rem, 0
br i1 %cmp3, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%rem4 = srem i64 %2, %i.016
%cmp5 = icmp eq i64 %rem4, 0
%spec.select = select i1 %cmp5, i64 %i.016, i64 %max.017
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body
%max.1 = phi i64 [ %max.017, %for.body ], [ %spec.select, %land.lhs.true ]
%inc = add nuw i64 %i.016, 1
%exitcond.not = icmp eq i64 %i.016, %3
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc, %if.end
%max.0.lcssa = phi i64 [ 1, %if.end ], [ %max.1, %for.inc ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %max.0.lcssa)
%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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int x, y, a, b, stock;
while(scanf("%d %d",&a,&b) != EOF){
if(a < b){
x = b;
y = a;
}else{
x = a;
y = b;
}
while(y != 0){
x %= y;
stock = x;
x = y;
y = stock;
}
printf("%d\n",x);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276051/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276051/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not18 = icmp eq i32 %call17, -1
br i1 %cmp.not18, label %while.end6, label %while.body
while.body: ; preds = %entry, %while.end
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%. = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%.13 = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%cmp3.not14 = icmp eq i32 %., 0
br i1 %cmp3.not14, label %while.end, label %while.body4
while.body4: ; preds = %while.body, %while.body4
%x.116 = phi i32 [ %y.115, %while.body4 ], [ %.13, %while.body ]
%y.115 = phi i32 [ %rem, %while.body4 ], [ %., %while.body ]
%rem = srem i32 %x.116, %y.115
%cmp3.not = icmp eq i32 %rem, 0
br i1 %cmp3.not, label %while.end, label %while.body4, !llvm.loop !9
while.end: ; preds = %while.body4, %while.body
%x.1.lcssa = phi i32 [ %.13, %while.body ], [ %y.115, %while.body4 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.1.lcssa)
%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 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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}
|
// AOJ 1327: One-Dimensional Cellular Automaton
// 2017.10.25 bal4u@uu
#include <stdio.h>
#include <string.h>
int s[2][52];
int d[32][52][52];
int main()
{
int n, m, a, b, c, t;
int i, j, k, l, k1, k2;
while (scanf("%d%d%d%d%d%d", &n, &m, &a, &b, &c, &t) && n > 0) {
memset(d, 0, sizeof(d));
for (i = 1; i <= n; i++) scanf("%d", &s[0][i]);
for (i = 1; i <= n; i++) d[0][i][i+1] = a, d[0][i][i] = b, d[0][i][i-1] = c;
for (k = 1; (1<<k) <= t; k++) for (i = 1; i <= n; i++) for (j = 1; j <= n; j++) {
for (l = 1; l <= n; l++) d[k][i][j] += d[k-1][i][l] * d[k-1][l][j];
d[k][i][j] %= m;
}
for (k1 = 0, k2 = 1, k = 0; (1<<k) <= t; k++) if (t & (1<<k)) {
memset(s[k2], 0, sizeof(s[k2]));
for (i = 1; i <= n; i++) for (j = 1; j <= n; j++) s[k2][j] += s[k1][i] * d[k][i][j];
for (i = 1; i <= n; i++) s[k2][i] %= m;
k1 = k2, k2 = !k2;
}
printf("%d", s[k1][1]);
for (i = 2; i <= n; i++) printf(" %d", s[k1][i]);
putchar('\n');
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276116/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276116/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1
@d = dso_local local_unnamed_addr global [32 x [52 x [52 x i32]]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@s = dso_local global [2 x [52 x i32]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call219 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %t)
%tobool220 = icmp ne i32 %call219, 0
%0 = load i32, ptr %n, align 4
%cmp221 = icmp sgt i32 %0, 0
%1 = select i1 %tobool220, i1 %cmp221, i1 false
br i1 %1, label %for.body.preheader, label %while.end
for.body.preheader: ; preds = %entry, %for.end137
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(346112) @d, i8 0, i64 346112, i1 false)
br label %for.body
for.cond3.preheader: ; preds = %for.body
%cmp4.not193 = icmp slt i32 %9, 1
br i1 %cmp4.not193, label %for.cond21.preheader.thread, label %for.body5.lr.ph
for.body5.lr.ph: ; preds = %for.cond3.preheader
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%4 = load i32, ptr %c, align 4, !tbaa !5
%5 = add nuw i32 %9, 1
%wide.trip.count = zext i32 %5 to i64
%6 = add nsw i64 %wide.trip.count, -1
%7 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %for.cond21.preheader.unr-lcssa, label %for.body5.lr.ph.new
for.body5.lr.ph.new: ; preds = %for.body5.lr.ph
%unroll_iter = and i64 %6, -2
br label %for.body5
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds [52 x i32], ptr @s, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp1.not.not = icmp slt i64 %indvars.iv, %10
br i1 %cmp1.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond21.preheader.unr-lcssa: ; preds = %for.body5, %for.body5.lr.ph
%indvars.iv225.unr = phi i64 [ 1, %for.body5.lr.ph ], [ %indvars.iv.next226.1, %for.body5 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond21.preheader, label %for.body5.epil
for.body5.epil: ; preds = %for.cond21.preheader.unr-lcssa
%indvars.iv.next226.epil = add nuw nsw i64 %indvars.iv225.unr, 1
%arrayidx9.epil = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv225.unr, i64 %indvars.iv.next226.epil
store i32 %2, ptr %arrayidx9.epil, align 4, !tbaa !5
%arrayidx13.epil = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv225.unr, i64 %indvars.iv225.unr
store i32 %3, ptr %arrayidx13.epil, align 4, !tbaa !5
%11 = add nsw i64 %indvars.iv225.unr, -1
%arrayidx17.epil = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv225.unr, i64 %11
store i32 %4, ptr %arrayidx17.epil, align 4, !tbaa !5
br label %for.cond21.preheader
for.cond21.preheader: ; preds = %for.cond21.preheader.unr-lcssa, %for.body5.epil
%12 = load i32, ptr %t, align 4, !tbaa !5
%cmp22.not201 = icmp slt i32 %12, 2
br i1 %cmp22.not201, label %for.cond72.preheader, label %for.cond24.preheader.lr.ph
for.cond21.preheader.thread: ; preds = %for.cond3.preheader
%13 = load i32, ptr %t, align 4, !tbaa !5
%cmp22.not201269 = icmp slt i32 %13, 2
br i1 %cmp22.not201269, label %for.cond72.preheader, label %for.body75.lr.ph
for.cond24.preheader.lr.ph: ; preds = %for.cond21.preheader
%14 = load i32, ptr %m, align 4
br i1 %cmp4.not193, label %for.body75.lr.ph, label %for.cond24.preheader.preheader
for.cond24.preheader.preheader: ; preds = %for.cond24.preheader.lr.ph
%15 = add nuw i32 %9, 1
%wide.trip.count242 = zext i32 %15 to i64
%xtraiter271 = and i64 %6, 1
%16 = icmp eq i64 %7, 0
%unroll_iter274 = and i64 %6, -2
%lcmp.mod272.not = icmp eq i64 %xtraiter271, 0
br label %for.cond24.preheader
for.body5: ; preds = %for.body5, %for.body5.lr.ph.new
%indvars.iv225 = phi i64 [ 1, %for.body5.lr.ph.new ], [ %indvars.iv.next226.1, %for.body5 ]
%niter = phi i64 [ 0, %for.body5.lr.ph.new ], [ %niter.next.1, %for.body5 ]
%indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1
%arrayidx9 = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv225, i64 %indvars.iv.next226
store i32 %2, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv225, i64 %indvars.iv225
store i32 %3, ptr %arrayidx13, align 4, !tbaa !5
%17 = add nsw i64 %indvars.iv225, -1
%arrayidx17 = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv225, i64 %17
store i32 %4, ptr %arrayidx17, align 4, !tbaa !5
%indvars.iv.next226.1 = add nuw nsw i64 %indvars.iv225, 2
%arrayidx9.1 = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv.next226, i64 %indvars.iv.next226.1
store i32 %2, ptr %arrayidx9.1, align 4, !tbaa !5
%arrayidx13.1 = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv.next226, i64 %indvars.iv.next226
store i32 %3, ptr %arrayidx13.1, align 4, !tbaa !5
%arrayidx17.1 = getelementptr inbounds [52 x [52 x i32]], ptr @d, i64 0, i64 %indvars.iv.next226, i64 %indvars.iv225
store i32 %4, ptr %arrayidx17.1, align 4, !tbaa !5
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond21.preheader.unr-lcssa, label %for.body5, !llvm.loop !11
for.cond72.preheader: ; preds = %for.cond24.for.inc69_crit_edge.split, %for.cond21.preheader.thread, %for.cond21.preheader
%18 = phi i32 [ %13, %for.cond21.preheader.thread ], [ %12, %for.cond21.preheader ], [ %12, %for.cond24.for.inc69_crit_edge.split ]
%cmp74.not210 = icmp slt i32 %18, 1
br i1 %cmp74.not210, label %for.end122, label %for.body75.lr.ph
for.body75.lr.ph: ; preds = %for.cond21.preheader.thread, %for.cond24.preheader.lr.ph, %for.cond72.preheader
%19 = phi i32 [ %18, %for.cond72.preheader ], [ %12, %for.cond24.preheader.lr.ph ], [ %13, %for.cond21.preheader.thread ]
%20 = load i32, ptr %m, align 4
%21 = add i32 %9, 1
%wide.trip.count256 = zext i32 %21 to i64
%22 = add nsw i64 %wide.trip.count256, -1
%23 = add nsw i64 %wide.trip.count256, -2
%xtraiter276 = and i64 %22, 1
%24 = icmp eq i64 %23, 0
%unroll_iter278 = and i64 %22, -2
%lcmp.mod277.not = icmp eq i64 %xtraiter276, 0
%xtraiter280 = and i64 %22, 1
%25 = icmp eq i64 %23, 0
%unroll_iter282 = and i64 %22, -2
%lcmp.mod281.not = icmp eq i64 %xtraiter280, 0
br label %for.body75
for.cond24.preheader: ; preds = %for.cond24.preheader.preheader, %for.cond24.for.inc69_crit_edge.split
%indvars.iv244 = phi i64 [ 1, %for.cond24.preheader.preheader ], [ %indvars.iv.next245, %for.cond24.for.inc69_crit_edge.split ]
%26 = add nsw i64 %indvars.iv244, -1
br label %for.cond27.preheader
for.cond27.preheader: ; preds = %for.cond24.preheader, %for.cond27.for.inc66_crit_edge.split
%indvars.iv239 = phi i64 [ 1, %for.cond24.preheader ], [ %indvars.iv.next240, %for.cond27.for.inc66_crit_edge.split ]
br label %for.cond30.preheader
for.cond30.preheader: ; preds = %for.cond27.preheader, %for.cond30.for.end56_crit_edge
%indvars.iv234 = phi i64 [ 1, %for.cond27.preheader ], [ %indvars.iv.next235, %for.cond30.for.end56_crit_edge ]
%arrayidx52 = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %indvars.iv244, i64 %indvars.iv239, i64 %indvars.iv234
%arrayidx52.promoted = load i32, ptr %arrayidx52, align 4, !tbaa !5
br i1 %16, label %for.cond30.for.end56_crit_edge.unr-lcssa, label %for.body32
for.body32: ; preds = %for.cond30.preheader, %for.body32
%indvars.iv229 = phi i64 [ %indvars.iv.next230.1, %for.body32 ], [ 1, %for.cond30.preheader ]
%27 = phi i32 [ %add53.1, %for.body32 ], [ %arrayidx52.promoted, %for.cond30.preheader ]
%niter275 = phi i64 [ %niter275.next.1, %for.body32 ], [ 0, %for.cond30.preheader ]
%arrayidx39 = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %26, i64 %indvars.iv239, i64 %indvars.iv229
%28 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%arrayidx46 = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %26, i64 %indvars.iv229, i64 %indvars.iv234
%29 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%mul = mul nsw i32 %29, %28
%add53 = add nsw i32 %27, %mul
store i32 %add53, ptr %arrayidx52, align 4, !tbaa !5
%indvars.iv.next230 = add nuw nsw i64 %indvars.iv229, 1
%arrayidx39.1 = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %26, i64 %indvars.iv239, i64 %indvars.iv.next230
%30 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5
%arrayidx46.1 = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %26, i64 %indvars.iv.next230, i64 %indvars.iv234
%31 = load i32, ptr %arrayidx46.1, align 4, !tbaa !5
%mul.1 = mul nsw i32 %31, %30
%add53.1 = add nsw i32 %add53, %mul.1
store i32 %add53.1, ptr %arrayidx52, align 4, !tbaa !5
%indvars.iv.next230.1 = add nuw nsw i64 %indvars.iv229, 2
%niter275.next.1 = add i64 %niter275, 2
%niter275.ncmp.1 = icmp eq i64 %niter275.next.1, %unroll_iter274
br i1 %niter275.ncmp.1, label %for.cond30.for.end56_crit_edge.unr-lcssa, label %for.body32, !llvm.loop !12
for.cond30.for.end56_crit_edge.unr-lcssa: ; preds = %for.body32, %for.cond30.preheader
%add53.lcssa.ph = phi i32 [ undef, %for.cond30.preheader ], [ %add53.1, %for.body32 ]
%indvars.iv229.unr = phi i64 [ 1, %for.cond30.preheader ], [ %indvars.iv.next230.1, %for.body32 ]
%.unr = phi i32 [ %arrayidx52.promoted, %for.cond30.preheader ], [ %add53.1, %for.body32 ]
br i1 %lcmp.mod272.not, label %for.cond30.for.end56_crit_edge, label %for.body32.epil
for.body32.epil: ; preds = %for.cond30.for.end56_crit_edge.unr-lcssa
%arrayidx39.epil = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %26, i64 %indvars.iv239, i64 %indvars.iv229.unr
%32 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5
%arrayidx46.epil = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %26, i64 %indvars.iv229.unr, i64 %indvars.iv234
%33 = load i32, ptr %arrayidx46.epil, align 4, !tbaa !5
%mul.epil = mul nsw i32 %33, %32
%add53.epil = add nsw i32 %.unr, %mul.epil
store i32 %add53.epil, ptr %arrayidx52, align 4, !tbaa !5
br label %for.cond30.for.end56_crit_edge
for.cond30.for.end56_crit_edge: ; preds = %for.cond30.for.end56_crit_edge.unr-lcssa, %for.body32.epil
%add53.lcssa = phi i32 [ %add53.lcssa.ph, %for.cond30.for.end56_crit_edge.unr-lcssa ], [ %add53.epil, %for.body32.epil ]
%rem = srem i32 %add53.lcssa, %14
store i32 %rem, ptr %arrayidx52, align 4, !tbaa !5
%indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
%exitcond238.not = icmp eq i64 %indvars.iv.next235, %wide.trip.count242
br i1 %exitcond238.not, label %for.cond27.for.inc66_crit_edge.split, label %for.cond30.preheader, !llvm.loop !13
for.cond27.for.inc66_crit_edge.split: ; preds = %for.cond30.for.end56_crit_edge
%indvars.iv.next240 = add nuw nsw i64 %indvars.iv239, 1
%exitcond243.not = icmp eq i64 %indvars.iv.next240, %wide.trip.count242
br i1 %exitcond243.not, label %for.cond24.for.inc69_crit_edge.split, label %for.cond27.preheader, !llvm.loop !14
for.cond24.for.inc69_crit_edge.split: ; preds = %for.cond27.for.inc66_crit_edge.split
%indvars.iv.next245 = add nuw i64 %indvars.iv244, 1
%34 = trunc i64 %indvars.iv244 to i32
%shl = shl i32 2, %34
%cmp22.not = icmp sgt i32 %shl, %12
br i1 %cmp22.not, label %for.cond72.preheader, label %for.cond24.preheader, !llvm.loop !15
for.body75: ; preds = %for.body75.lr.ph, %for.inc120
%indvars.iv263 = phi i64 [ 0, %for.body75.lr.ph ], [ %indvars.iv.next264, %for.inc120 ]
%shl73215 = phi i32 [ 1, %for.body75.lr.ph ], [ %shl73, %for.inc120 ]
%k2.0214 = phi i32 [ 1, %for.body75.lr.ph ], [ %k2.1, %for.inc120 ]
%k1.0213 = phi i32 [ 0, %for.body75.lr.ph ], [ %k1.1, %for.inc120 ]
%and = and i32 %shl73215, %19
%tobool77.not = icmp eq i32 %and, 0
br i1 %tobool77.not, label %for.inc120, label %if.then
if.then: ; preds = %for.body75
%idxprom78 = zext i32 %k2.0214 to i64
%arrayidx79 = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom78
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %arrayidx79, i8 0, i64 208, i1 false)
br i1 %cmp4.not193, label %for.end118, label %for.cond83.preheader.lr.ph
for.cond83.preheader.lr.ph: ; preds = %if.then
%idxprom86 = zext i32 %k1.0213 to i64
br label %for.cond83.preheader
for.cond108.preheader: ; preds = %for.cond83.for.inc105_crit_edge
br i1 %cmp4.not193, label %for.end118, label %for.body110.preheader
for.body110.preheader: ; preds = %for.cond108.preheader
br i1 %25, label %for.end118.loopexit.unr-lcssa, label %for.body110
for.cond83.preheader: ; preds = %for.cond83.preheader.lr.ph, %for.cond83.for.inc105_crit_edge
%indvars.iv253 = phi i64 [ 1, %for.cond83.preheader.lr.ph ], [ %indvars.iv.next254, %for.cond83.for.inc105_crit_edge ]
%arrayidx89 = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom86, i64 %indvars.iv253
br i1 %24, label %for.cond83.for.inc105_crit_edge.unr-lcssa, label %for.body85
for.body85: ; preds = %for.cond83.preheader, %for.body85
%indvars.iv248 = phi i64 [ %indvars.iv.next249.1, %for.body85 ], [ 1, %for.cond83.preheader ]
%niter279 = phi i64 [ %niter279.next.1, %for.body85 ], [ 0, %for.cond83.preheader ]
%35 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%arrayidx95 = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %indvars.iv263, i64 %indvars.iv253, i64 %indvars.iv248
%36 = load i32, ptr %arrayidx95, align 4, !tbaa !5
%mul96 = mul nsw i32 %36, %35
%arrayidx100 = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom78, i64 %indvars.iv248
%37 = load i32, ptr %arrayidx100, align 4, !tbaa !5
%add101 = add nsw i32 %37, %mul96
store i32 %add101, ptr %arrayidx100, align 4, !tbaa !5
%indvars.iv.next249 = add nuw nsw i64 %indvars.iv248, 1
%38 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%arrayidx95.1 = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %indvars.iv263, i64 %indvars.iv253, i64 %indvars.iv.next249
%39 = load i32, ptr %arrayidx95.1, align 4, !tbaa !5
%mul96.1 = mul nsw i32 %39, %38
%arrayidx100.1 = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom78, i64 %indvars.iv.next249
%40 = load i32, ptr %arrayidx100.1, align 4, !tbaa !5
%add101.1 = add nsw i32 %40, %mul96.1
store i32 %add101.1, ptr %arrayidx100.1, align 4, !tbaa !5
%indvars.iv.next249.1 = add nuw nsw i64 %indvars.iv248, 2
%niter279.next.1 = add i64 %niter279, 2
%niter279.ncmp.1 = icmp eq i64 %niter279.next.1, %unroll_iter278
br i1 %niter279.ncmp.1, label %for.cond83.for.inc105_crit_edge.unr-lcssa, label %for.body85, !llvm.loop !16
for.cond83.for.inc105_crit_edge.unr-lcssa: ; preds = %for.body85, %for.cond83.preheader
%indvars.iv248.unr = phi i64 [ 1, %for.cond83.preheader ], [ %indvars.iv.next249.1, %for.body85 ]
br i1 %lcmp.mod277.not, label %for.cond83.for.inc105_crit_edge, label %for.body85.epil
for.body85.epil: ; preds = %for.cond83.for.inc105_crit_edge.unr-lcssa
%41 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%arrayidx95.epil = getelementptr inbounds [32 x [52 x [52 x i32]]], ptr @d, i64 0, i64 %indvars.iv263, i64 %indvars.iv253, i64 %indvars.iv248.unr
%42 = load i32, ptr %arrayidx95.epil, align 4, !tbaa !5
%mul96.epil = mul nsw i32 %42, %41
%arrayidx100.epil = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom78, i64 %indvars.iv248.unr
%43 = load i32, ptr %arrayidx100.epil, align 4, !tbaa !5
%add101.epil = add nsw i32 %43, %mul96.epil
store i32 %add101.epil, ptr %arrayidx100.epil, align 4, !tbaa !5
br label %for.cond83.for.inc105_crit_edge
for.cond83.for.inc105_crit_edge: ; preds = %for.cond83.for.inc105_crit_edge.unr-lcssa, %for.body85.epil
%indvars.iv.next254 = add nuw nsw i64 %indvars.iv253, 1
%exitcond257.not = icmp eq i64 %indvars.iv.next254, %wide.trip.count256
br i1 %exitcond257.not, label %for.cond108.preheader, label %for.cond83.preheader, !llvm.loop !17
for.body110: ; preds = %for.body110.preheader, %for.body110
%indvars.iv258 = phi i64 [ %indvars.iv.next259.1, %for.body110 ], [ 1, %for.body110.preheader ]
%niter283 = phi i64 [ %niter283.next.1, %for.body110 ], [ 0, %for.body110.preheader ]
%arrayidx114 = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom78, i64 %indvars.iv258
%44 = load i32, ptr %arrayidx114, align 4, !tbaa !5
%rem115 = srem i32 %44, %20
store i32 %rem115, ptr %arrayidx114, align 4, !tbaa !5
%indvars.iv.next259 = add nuw nsw i64 %indvars.iv258, 1
%arrayidx114.1 = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom78, i64 %indvars.iv.next259
%45 = load i32, ptr %arrayidx114.1, align 4, !tbaa !5
%rem115.1 = srem i32 %45, %20
store i32 %rem115.1, ptr %arrayidx114.1, align 4, !tbaa !5
%indvars.iv.next259.1 = add nuw nsw i64 %indvars.iv258, 2
%niter283.next.1 = add i64 %niter283, 2
%niter283.ncmp.1 = icmp eq i64 %niter283.next.1, %unroll_iter282
br i1 %niter283.ncmp.1, label %for.end118.loopexit.unr-lcssa, label %for.body110, !llvm.loop !18
for.end118.loopexit.unr-lcssa: ; preds = %for.body110, %for.body110.preheader
%indvars.iv258.unr = phi i64 [ 1, %for.body110.preheader ], [ %indvars.iv.next259.1, %for.body110 ]
br i1 %lcmp.mod281.not, label %for.end118, label %for.body110.epil
for.body110.epil: ; preds = %for.end118.loopexit.unr-lcssa
%arrayidx114.epil = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom78, i64 %indvars.iv258.unr
%46 = load i32, ptr %arrayidx114.epil, align 4, !tbaa !5
%rem115.epil = srem i32 %46, %20
store i32 %rem115.epil, ptr %arrayidx114.epil, align 4, !tbaa !5
br label %for.end118
for.end118: ; preds = %for.body110.epil, %for.end118.loopexit.unr-lcssa, %if.then, %for.cond108.preheader
%tobool119.not = icmp eq i32 %k2.0214, 0
%lnot.ext = zext i1 %tobool119.not to i32
br label %for.inc120
for.inc120: ; preds = %for.body75, %for.end118
%k1.1 = phi i32 [ %k2.0214, %for.end118 ], [ %k1.0213, %for.body75 ]
%k2.1 = phi i32 [ %lnot.ext, %for.end118 ], [ %k2.0214, %for.body75 ]
%indvars.iv.next264 = add nuw i64 %indvars.iv263, 1
%47 = trunc i64 %indvars.iv263 to i32
%shl73 = shl i32 2, %47
%cmp74.not = icmp sgt i32 %shl73, %19
br i1 %cmp74.not, label %for.end122, label %for.body75, !llvm.loop !19
for.end122: ; preds = %for.inc120, %for.cond72.preheader
%k1.0.lcssa = phi i32 [ 0, %for.cond72.preheader ], [ %k1.1, %for.inc120 ]
%idxprom123 = zext i32 %k1.0.lcssa to i64
%arrayidx125 = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom123, i64 1
%48 = load i32, ptr %arrayidx125, align 4, !tbaa !5
%call126 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %48)
%49 = load i32, ptr %n, align 4, !tbaa !5
%cmp128.not217 = icmp slt i32 %49, 2
br i1 %cmp128.not217, label %for.end137, label %for.body129
for.body129: ; preds = %for.end122, %for.body129
%indvars.iv266 = phi i64 [ %indvars.iv.next267, %for.body129 ], [ 2, %for.end122 ]
%arrayidx133 = getelementptr inbounds [2 x [52 x i32]], ptr @s, i64 0, i64 %idxprom123, i64 %indvars.iv266
%50 = load i32, ptr %arrayidx133, align 4, !tbaa !5
%call134 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %50)
%indvars.iv.next267 = add nuw nsw i64 %indvars.iv266, 1
%51 = load i32, ptr %n, align 4, !tbaa !5
%52 = sext i32 %51 to i64
%cmp128.not.not = icmp slt i64 %indvars.iv266, %52
br i1 %cmp128.not.not, label %for.body129, label %for.end137, !llvm.loop !20
for.end137: ; preds = %for.body129, %for.end122
%53 = load ptr, ptr @stdout, align 8, !tbaa !21
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %53)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %t)
%tobool = icmp ne i32 %call, 0
%54 = load i32, ptr %n, align 4
%cmp = icmp sgt i32 %54, 0
%55 = select i1 %tobool, i1 %cmp, i1 false
br i1 %55, label %for.body.preheader, label %while.end, !llvm.loop !23
while.end: ; preds = %for.end137, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!22, !22, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = distinct !{!23, !10}
|
#include <stdio.h>
int main(void)
{
int c=0;
char s;
for(int i=0;i<3;i++){
scanf("%c",&s);
if(s=='1')c++;
}
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276167/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276167/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.1 = private unnamed_addr constant [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 i8, align 1
call void @llvm.lifetime.start.p0(i64 1, 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
%cmp1 = icmp eq i8 %0, 49
%inc = zext i1 %cmp1 to i32
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%1 = load i8, ptr %s, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 49
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %inc, %inc.1
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%2 = load i8, ptr %s, align 1, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 49
%inc.2 = zext i1 %cmp1.2 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.2)
call void @llvm.lifetime.end.p0(i64 1, 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: 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"}
|
#include <stdio.h>
short no_of_parties;
short sum = 0 ;
int main() {
scanf("%hd", &no_of_parties);
short members[no_of_parties];
for (short i = 0; i < no_of_parties; i++) {
scanf("%hd", &members[i]);
sum += members[i] ;
}
short coal = members[0] ;
short count = 0;
short cpart[no_of_parties] ;
for(short i = 1 ; i < no_of_parties ; i++) {
if(members[0] >= 2*members[i]) {
cpart[count] = i+1 ;
count++ ;
coal += members[i] ;
}
if(coal > sum/2) {
printf("%d\n", count+1) ;
printf("1 ") ;
for(short i = 0 ; i < count ; i++) {
printf("%d ", cpart[i]) ;
}
return 0 ;
}
}
printf("0");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27621/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27621/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@sum = dso_local local_unnamed_addr global i16 0, align 2
@.str = private unnamed_addr constant [4 x i8] c"%hd\00", align 1
@no_of_parties = dso_local global i16 0, align 2
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"1 \00", align 1
@.str.3 = 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:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @no_of_parties)
%0 = load i16, ptr @no_of_parties, align 2, !tbaa !5
%1 = zext i16 %0 to i64
%vla = alloca i16, i64 %1, align 16
%cmp83 = icmp sgt i16 %0, 0
br i1 %cmp83, label %for.body, label %for.end65
for.cond.cleanup: ; preds = %for.body
%.pre = zext i16 %8 to i64
%2 = icmp sgt i16 %8, 1
%vla10 = alloca i16, i64 %.pre, align 16
br i1 %2, label %for.body18.lr.ph, label %for.end65
for.body18.lr.ph: ; preds = %for.cond.cleanup
%3 = load i16, ptr %vla, align 16, !tbaa !5
%conv20 = sext i16 %3 to i32
%4 = load i16, ptr @sum, align 2, !tbaa !5
%5 = sdiv i16 %4, 2
br label %for.body18
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i16, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%6 = load i16, ptr %arrayidx, align 2, !tbaa !5
%7 = load i16, ptr @sum, align 2, !tbaa !5
%add = add i16 %7, %6
store i16 %add, ptr @sum, align 2, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i16, ptr @no_of_parties, align 2, !tbaa !5
%9 = sext i16 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond12: ; preds = %if.end
%indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
%exitcond.not = icmp eq i64 %indvars.iv.next95, %.pre
br i1 %exitcond.not, label %for.end65, label %for.body18, !llvm.loop !11
for.body18: ; preds = %for.body18.lr.ph, %for.cond12
%indvars.iv94 = phi i64 [ 1, %for.body18.lr.ph ], [ %indvars.iv.next95, %for.cond12 ]
%count.087 = phi i16 [ 0, %for.body18.lr.ph ], [ %count.1, %for.cond12 ]
%coal.086 = phi i16 [ %3, %for.body18.lr.ph ], [ %coal.1, %for.cond12 ]
%arrayidx22 = getelementptr inbounds i16, ptr %vla, i64 %indvars.iv94
%10 = load i16, ptr %arrayidx22, align 2, !tbaa !5
%conv23 = sext i16 %10 to i32
%mul = shl nsw i32 %conv23, 1
%cmp24.not = icmp sgt i32 %mul, %conv20
br i1 %cmp24.not, label %if.end, label %if.then
if.then: ; preds = %for.body18
%idxprom29 = sext i16 %count.087 to i64
%arrayidx30 = getelementptr inbounds i16, ptr %vla10, i64 %idxprom29
%11 = trunc i64 %indvars.iv94 to i16
%12 = add i16 %11, 1
store i16 %12, ptr %arrayidx30, align 2, !tbaa !5
%inc31 = add i16 %count.087, 1
%add36 = add i16 %10, %coal.086
br label %if.end
if.end: ; preds = %if.then, %for.body18
%coal.1 = phi i16 [ %add36, %if.then ], [ %coal.086, %for.body18 ]
%count.1 = phi i16 [ %inc31, %if.then ], [ %count.087, %for.body18 ]
%cmp40 = icmp sgt i16 %coal.1, %5
br i1 %cmp40, label %if.then42, label %for.cond12
if.then42: ; preds = %if.end
%conv43 = sext i16 %count.1 to i32
%add44 = add nsw i32 %conv43, 1
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add44)
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%cmp5189 = icmp sgt i16 %count.1, 0
br i1 %cmp5189, label %for.body54.preheader, label %cleanup67
for.body54.preheader: ; preds = %if.then42
%wide.trip.count101 = zext i16 %count.1 to i64
br label %for.body54
for.body54: ; preds = %for.body54.preheader, %for.body54
%indvars.iv98 = phi i64 [ 0, %for.body54.preheader ], [ %indvars.iv.next99, %for.body54 ]
%arrayidx56 = getelementptr inbounds i16, ptr %vla10, i64 %indvars.iv98
%13 = load i16, ptr %arrayidx56, align 2, !tbaa !5
%conv57 = sext i16 %13 to i32
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %conv57)
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
br i1 %exitcond102.not, label %cleanup67, label %for.body54, !llvm.loop !12
for.end65: ; preds = %for.cond12, %entry, %for.cond.cleanup
%putchar = call i32 @putchar(i32 48)
br label %cleanup67
cleanup67: ; preds = %for.body54, %if.then42, %for.end65
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 @putchar(i32 noundef) 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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void)
{
char a, b, c;
int sum;
scanf("%c%c%c", &a, &b, &c);
sum = (a - 48) + (b - 48) + (c - 48);
printf("%d", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276260/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276260/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c%c%c\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 i8, align 1
%b = alloca i8, align 1
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !5
%conv1 = sext i8 %1 to i32
%2 = load i8, ptr %c, align 1, !tbaa !5
%conv3 = sext i8 %2 to i32
%sub2 = add nsw i32 %conv, -144
%sub4 = add nsw i32 %sub2, %conv1
%add5 = add nsw i32 %sub4, %conv3
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#define pai 3.1415926535
int main(void) {
char s1, s2, s3;
scanf("%c%c%c", &s1, &s2, &s3);
int count = 0;
if (s1 == '1') {
count++;
}
if (s2 == '1') {
count++;
}
if (s3 == '1') {
count++;
}
printf("%d", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276303/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276303/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c%c%c\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:
%s1 = alloca i8, align 1
%s2 = alloca i8, align 1
%s3 = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s1) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s2) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3)
%0 = load i8, ptr %s1, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 49
%spec.select = zext i1 %cmp to i32
%1 = load i8, ptr %s2, align 1, !tbaa !5
%cmp3 = icmp eq i8 %1, 49
%inc6 = select i1 %cmp, i32 2, i32 1
%count.1 = select i1 %cmp3, i32 %inc6, i32 %spec.select
%2 = load i8, ptr %s3, align 1, !tbaa !5
%cmp9 = icmp eq i8 %2, 49
%inc12 = zext i1 %cmp9 to i32
%count.2 = add nuw nsw i32 %count.1, %inc12
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.2)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s3) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s2) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int sum=0;
char s[4]={'\0'};
scanf("%s",s);
for(int i=0;i<3;i++){
if(s[i]=='1'){
sum++;
}
}
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276347/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276347/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
store i32 0, ptr %s, align 4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 4, !tbaa !5
%cmp1 = icmp eq i8 %0, 49
%inc = zext i1 %cmp1 to i32
%arrayidx.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 49
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %inc, %inc.1
%arrayidx.2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 49
%inc.2 = zext i1 %cmp1.2 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.2)
call void @llvm.lifetime.end.p0(i64 4, 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: 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"}
|
#include <stdio.h>
int main(){
char s[3];
int c=0,i=0;
scanf("%s",s);
for(;i<3;i++)c+=s[i]=='1';
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276390/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276390/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp1 = icmp eq i8 %0, 49
%conv2 = zext i1 %cmp1 to i32
%arrayidx.1 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 49
%conv2.1 = zext i1 %cmp1.1 to i32
%add.1 = add nuw nsw i32 %conv2, %conv2.1
%arrayidx.2 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 49
%conv2.2 = zext i1 %cmp1.2 to i32
%add.2 = add nuw nsw i32 %add.1, %conv2.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.2)
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>
int main(){
char s[3];
scanf("%s",s);
int i,c = 0;
for (i=0;i<3;i++){
if(s[i] == '1'){
c++;
}
}
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276448/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276448/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp1 = icmp eq i8 %0, 49
%inc = zext i1 %cmp1 to i32
%arrayidx.1 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 49
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %inc, %inc.1
%arrayidx.2 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 49
%inc.2 = zext i1 %cmp1.2 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.2)
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>
int main(void){
char s[3];
int count = 0;
scanf("%s",&s);
if (s[0] == '1'){count++;}
if (s[1] == '1'){count++;}
if (s[2] == '1'){count++;}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276491/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276491/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%cmp = icmp eq i8 %0, 49
%spec.select = zext i1 %cmp to i32
%arrayidx2 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp4 = icmp eq i8 %1, 49
%inc7 = select i1 %cmp, i32 2, i32 1
%count.1 = select i1 %cmp4, i32 %inc7, i32 %spec.select
%arrayidx9 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%cmp11 = icmp eq i8 %2, 49
%inc14 = zext i1 %cmp11 to i32
%count.2 = add nuw nsw i32 %count.1, %inc14
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.2)
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>
int main(void)
{
int s1;
int s2;
int s3;
int nyu;
int bee;
bee = 0;
scanf("%d",&nyu);
s1 = nyu % 10;
s2 = (nyu % 100 - s1) / 10;
s3 = (nyu - s1 - (s2 * 10)) / 100;
if((s1 == 1 || s1 == 0) && (s2 == 1 || s2 == 0) && (s1 == 1 || s1 == 0)){
if(s1 == 1){
bee++;
}
if(s2 == 1){
bee++;
}
if(s3 == 1){
bee++;
}
printf("%d",bee);
}
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276534/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276534/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%nyu = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nyu) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %nyu)
%0 = load i32, ptr %nyu, align 4, !tbaa !5
%rem = srem i32 %0, 10
%rem1 = srem i32 %0, 100
%sub = sub nsw i32 %rem1, %rem
%sub.fr = freeze i32 %sub
%or.cond = icmp ult i32 %rem, 2
%1 = add i32 %sub.fr, 9
%or.cond25 = icmp ult i32 %1, 29
%or.cond40 = and i1 %or.cond, %or.cond25
br i1 %or.cond40, label %if.then, label %if.end24
if.then: ; preds = %entry
%cmp = icmp eq i32 %rem, 1
%.lhs.trunc = trunc i32 %sub.fr to i8
%2 = srem i8 %.lhs.trunc, 10
%.sext = sext i8 %2 to i32
%sub.off = add nsw i32 %sub.fr, -10
%cmp6 = icmp ult i32 %sub.off, 10
%spec.select = zext i1 %cmp to i32
%inc17 = select i1 %cmp, i32 2, i32 1
%bee.1 = select i1 %cmp6, i32 %inc17, i32 %spec.select
%mul.neg = add i32 %0, -100
%3 = add nsw i32 %rem, %sub.fr
%sub3 = sub i32 %mul.neg, %3
%sub3.off = add i32 %sub3, %.sext
%cmp19 = icmp ult i32 %sub3.off, 100
%inc21 = zext i1 %cmp19 to i32
%bee.2 = add nuw nsw i32 %bee.1, %inc21
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %bee.2)
br label %if.end24
if.end24: ; preds = %entry, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nyu) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int n=0;
char s1[1],s2[1],s3[1];
scanf("%s",&s1[1]);
scanf("%s",&s2[1]);
scanf("%s",&s3[1]);
if(s1[1]=='1') n+=1;
if(s2[1]=='1') n+=1;
if(s3[1]=='1') n+=1;
printf("%d",n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276578/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276578/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s1 = alloca [1 x i8], align 1
%s2 = alloca [1 x i8], align 1
%s3 = alloca [1 x i8], align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s1) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s2) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s3) #3
%arrayidx = getelementptr inbounds [1 x i8], ptr %s1, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%arrayidx1 = getelementptr inbounds [1 x i8], ptr %s2, i64 0, i64 1
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1)
%arrayidx3 = getelementptr inbounds [1 x i8], ptr %s3, i64 0, i64 1
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx3)
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 49
%spec.select = zext i1 %cmp to i32
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp9 = icmp eq i8 %1, 49
%add12 = select i1 %cmp, i32 2, i32 1
%n.1 = select i1 %cmp9, i32 %add12, i32 %spec.select
%2 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%cmp16 = icmp eq i8 %2, 49
%add19 = zext i1 %cmp16 to i32
%n.2 = add nuw nsw i32 %n.1, %add19
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n.2)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s3) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s2) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
char s[10];
scanf("%s", s);
printf("%d\n", (s[0]-'0')+(s[1]-'0')+(s[2]-'0'));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276628/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276628/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, 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
%conv = sext i8 %0 to i32
%arrayidx1 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%conv2 = sext i8 %1 to i32
%arrayidx4 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%conv5 = sext i8 %2 to i32
%sub3 = add nsw i32 %conv, -144
%sub6 = add nsw i32 %sub3, %conv2
%add7 = add nsw i32 %sub6, %conv5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add7)
call void @llvm.lifetime.end.p0(i64 10, 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<math.h>
#include<stdlib.h>
int main(void){
int n,get[100000],i,j,t=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&get[i]);
}
for(i=1;i<=100;i++){
int count=0;
for(j=1;j<=n;j++){
if(i<=get[j]){
count++;
}
}
if(i<=count){
t++;
}
}
printf("%d\n",t);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276671/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276671/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%get = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %get) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not34 = icmp slt i32 %0, 1
br i1 %cmp.not34, label %for.end21, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp6.not36 = icmp slt i32 %3, 1
br i1 %cmp6.not36, label %for.end21, label %for.cond5.preheader.preheader
for.cond5.preheader.preheader: ; preds = %for.cond2.preheader
%1 = add nuw i32 %3, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %3, 8
%n.vec = and i64 %2, -8
%ind.end = or i64 %n.vec, 1
%cmp.n = icmp eq i64 %2, %n.vec
br label %for.cond5.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %get, 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.not.not = icmp slt i64 %indvars.iv, %4
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.cond5.for.end14_crit_edge
%t.041 = phi i32 [ %spec.select33, %for.cond5.for.end14_crit_edge ], [ 0, %for.cond5.preheader.preheader ]
%i.140 = phi i32 [ %inc20, %for.cond5.for.end14_crit_edge ], [ 1, %for.cond5.preheader.preheader ]
br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph
vector.ph: ; preds = %for.cond5.preheader
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %i.140, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%vec.phi51 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%offset.idx = or i64 %index, 1
%5 = getelementptr inbounds [100000 x i32], ptr %get, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load52 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = icmp sle <4 x i32> %broadcast.splat, %wide.load
%8 = icmp sle <4 x i32> %broadcast.splat, %wide.load52
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = zext <4 x i1> %8 to <4 x i32>
%11 = add <4 x i32> %vec.phi, %9
%12 = add <4 x i32> %vec.phi51, %10
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %12, %11
%14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond5.for.end14_crit_edge, label %for.body7.preheader
for.body7.preheader: ; preds = %for.cond5.preheader, %middle.block
%indvars.iv45.ph = phi i64 [ 1, %for.cond5.preheader ], [ %ind.end, %middle.block ]
%count.038.ph = phi i32 [ 0, %for.cond5.preheader ], [ %14, %middle.block ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader, %for.body7
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.body7 ], [ %indvars.iv45.ph, %for.body7.preheader ]
%count.038 = phi i32 [ %spec.select, %for.body7 ], [ %count.038.ph, %for.body7.preheader ]
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr %get, i64 0, i64 %indvars.iv45
%15 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10.not = icmp sle i32 %i.140, %15
%inc11 = zext i1 %cmp10.not to i32
%spec.select = add nuw nsw i32 %count.038, %inc11
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count
br i1 %exitcond.not, label %for.cond5.for.end14_crit_edge, label %for.body7, !llvm.loop !14
for.cond5.for.end14_crit_edge: ; preds = %for.body7, %middle.block
%spec.select.lcssa = phi i32 [ %14, %middle.block ], [ %spec.select, %for.body7 ]
%cmp15.not = icmp ule i32 %i.140, %spec.select.lcssa
%inc17 = zext i1 %cmp15.not to i32
%spec.select33 = add nuw nsw i32 %t.041, %inc17
%inc20 = add nuw nsw i32 %i.140, 1
%exitcond48.not = icmp eq i32 %inc20, 101
br i1 %exitcond48.not, label %for.end21, label %for.cond5.preheader, !llvm.loop !15
for.end21: ; preds = %for.cond5.for.end14_crit_edge, %entry, %for.cond2.preheader
%.us-phi = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %spec.select33, %for.cond5.for.end14_crit_edge ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %get) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main()
{
int a,b,c,s = 0,cun=0,week=0;
scanf("%d%d%d\n",&a,&b,&c);
while (1) {
cun++;
week++;
s+=a;
if(week==7){
s+=b;
week=0;
}
if(s>=c){
printf("%d\n",cun);
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276714/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276714/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d%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() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4
%2 = load i32, ptr %c, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%s.0 = phi i32 [ 0, %entry ], [ %s.1, %while.cond ]
%cun.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ]
%week.0 = phi i32 [ 0, %entry ], [ %week.1, %while.cond ]
%inc = add nuw nsw i32 %cun.0, 1
%inc1 = add nsw i32 %week.0, 1
%add = add nsw i32 %0, %s.0
%cmp = icmp eq i32 %inc1, 7
%add2 = select i1 %cmp, i32 %1, i32 0
%s.1 = add nsw i32 %add, %add2
%week.1 = select i1 %cmp, i32 0, i32 %inc1
%cmp3.not = icmp slt i32 %s.1, %2
br i1 %cmp3.not, label %while.cond, label %if.then4
if.then4: ; preds = %while.cond
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,c,i,n;
scanf("%d %d %d",&a,&b,&c);
i=0;
n=0;
while(1){
if(n>=c){
break;
}
i=i+1;
n=n+a;
if(i%7==0){
n=n+b;
}
}
printf("%d\n",i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276758/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276758/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %c, align 4, !tbaa !5
%cmp.not11 = icmp sgt i32 %0, 0
br i1 %cmp.not11, label %if.end.lr.ph, label %while.end
if.end.lr.ph: ; preds = %entry
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4
br label %if.end
if.end: ; preds = %if.end.lr.ph, %if.end
%n.013 = phi i32 [ 0, %if.end.lr.ph ], [ %n.1, %if.end ]
%i.012 = phi i32 [ 0, %if.end.lr.ph ], [ %add, %if.end ]
%add = add nuw nsw i32 %i.012, 1
%add1 = add nsw i32 %1, %n.013
%rem = urem i32 %add, 7
%cmp2 = icmp eq i32 %rem, 0
%add4 = select i1 %cmp2, i32 %2, i32 0
%n.1 = add nsw i32 %add1, %add4
%cmp.not = icmp slt i32 %n.1, %0
br i1 %cmp.not, label %if.end, label %while.end
while.end: ; preds = %if.end, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ %add, %if.end ]
%call6 = 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 %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,m,i,src,dest,count=0;
scanf("%d %d",&n,&m);
int arrh[n+1];
int arr[n+1];
for(i=0;i<=n;++i)
{
arr[i]=0;
}
for(i=1;i<=n;++i)
{
scanf("%d",&arrh[i]);
}
for(i=0;i<m;++i)
{
scanf("%d %d",&src,&dest);
if(arr[src]==0 || arr[src]<arrh[dest])
arr[src]=arrh[dest];
if(arr[dest]==0 || arr[dest]<arrh[src])
arr[dest]=arrh[src];
}
for(i=1;i<=n;++i)
{
if(arrh[i]>arr[i])
count++;
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276800/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276800/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%src = alloca i32, align 4
%dest = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %src) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %dest) #6
%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
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%add1 = add i32 %3, 1
%4 = zext i32 %add1 to i64
%vla2 = alloca i32, i64 %4, align 16
%cmp.not74 = icmp slt i32 %3, 0
br i1 %cmp.not74, label %for.cond12.preheader, label %for.cond3.preheader
for.cond3.preheader: ; preds = %entry
%5 = shl nuw nsw i64 %4, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla2, i8 0, i64 %5, i1 false), !tbaa !5
%cmp4.not76 = icmp eq i32 %3, 0
br i1 %cmp4.not76, label %for.cond12.preheader, label %for.body5
for.cond12.preheader: ; preds = %for.body5, %entry, %for.cond3.preheader
%6 = phi i32 [ 0, %for.cond3.preheader ], [ %3, %entry ], [ %8, %for.body5 ]
%7 = load i32, ptr %m, align 4, !tbaa !5
%cmp1378 = icmp sgt i32 %7, 0
br i1 %cmp1378, label %for.body14, label %for.cond46.preheader
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 1, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp4.not.not = icmp slt i64 %indvars.iv, %9
br i1 %cmp4.not.not, label %for.body5, label %for.cond12.preheader, !llvm.loop !9
for.cond46.preheader.loopexit: ; preds = %for.body14
%.pre90 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond46.preheader
for.cond46.preheader: ; preds = %for.cond46.preheader.loopexit, %for.cond12.preheader
%10 = phi i32 [ %.pre90, %for.cond46.preheader.loopexit ], [ %6, %for.cond12.preheader ]
%cmp47.not80 = icmp slt i32 %10, 1
br i1 %cmp47.not80, label %for.end59, label %for.body48.preheader
for.body48.preheader: ; preds = %for.cond46.preheader
%11 = add nuw i32 %10, 1
%wide.trip.count = zext i32 %11 to i64
%12 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %10, 8
br i1 %min.iters.check, label %for.body48.preheader98, label %vector.ph
vector.ph: ; preds = %for.body48.preheader
%n.vec = and i64 %12, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%vec.phi94 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
%offset.idx = or i64 %index, 1
%13 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %13, align 4, !tbaa !5
%14 = getelementptr inbounds i32, ptr %13, i64 4
%wide.load95 = load <4 x i32>, ptr %14, align 4, !tbaa !5
%15 = getelementptr inbounds i32, ptr %vla2, i64 %offset.idx
%wide.load96 = load <4 x i32>, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 4
%wide.load97 = load <4 x i32>, ptr %16, align 4, !tbaa !5
%17 = icmp sgt <4 x i32> %wide.load, %wide.load96
%18 = icmp sgt <4 x i32> %wide.load95, %wide.load97
%19 = zext <4 x i1> %17 to <4 x i32>
%20 = zext <4 x i1> %18 to <4 x i32>
%21 = add <4 x i32> %vec.phi, %19
%22 = add <4 x i32> %vec.phi94, %20
%index.next = add nuw i64 %index, 8
%23 = icmp eq i64 %index.next, %n.vec
br i1 %23, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %22, %21
%24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %12, %n.vec
br i1 %cmp.n, label %for.end59, label %for.body48.preheader98
for.body48.preheader98: ; preds = %for.body48.preheader, %middle.block
%indvars.iv85.ph = phi i64 [ 1, %for.body48.preheader ], [ %ind.end, %middle.block ]
%count.081.ph = phi i32 [ 0, %for.body48.preheader ], [ %24, %middle.block ]
br label %for.body48
for.body14: ; preds = %for.cond12.preheader, %for.body14
%i.279 = phi i32 [ %inc44, %for.body14 ], [ 0, %for.cond12.preheader ]
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %src, ptr noundef nonnull %dest)
%25 = load i32, ptr %src, align 4, !tbaa !5
%idxprom16 = sext i32 %25 to i64
%arrayidx17 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom16
%26 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp eq i32 %26, 0
%.pre = load i32, ptr %dest, align 4, !tbaa !5
%idxprom24.phi.trans.insert = sext i32 %.pre to i64
%arrayidx25.phi.trans.insert = getelementptr inbounds i32, ptr %vla, i64 %idxprom24.phi.trans.insert
%.pre88 = load i32, ptr %arrayidx25.phi.trans.insert, align 4, !tbaa !5
%cmp23 = icmp slt i32 %26, %.pre88
%or.cond = select i1 %cmp18, i1 true, i1 %cmp23
%spec.store.select = select i1 %or.cond, i32 %.pre88, i32 %26
store i32 %spec.store.select, ptr %arrayidx17, align 4
%arrayidx29 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom24.phi.trans.insert
%27 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp eq i32 %27, 0
%arrayidx39.phi.trans.insert = getelementptr inbounds i32, ptr %vla, i64 %idxprom16
%.pre89 = load i32, ptr %arrayidx39.phi.trans.insert, align 4, !tbaa !5
%cmp36 = icmp slt i32 %27, %.pre89
%or.cond92 = select i1 %cmp30, i1 true, i1 %cmp36
%spec.store.select93 = select i1 %or.cond92, i32 %.pre89, i32 %27
store i32 %spec.store.select93, ptr %arrayidx29, align 4
%inc44 = add nuw nsw i32 %i.279, 1
%28 = load i32, ptr %m, align 4, !tbaa !5
%cmp13 = icmp slt i32 %inc44, %28
br i1 %cmp13, label %for.body14, label %for.cond46.preheader.loopexit, !llvm.loop !14
for.body48: ; preds = %for.body48.preheader98, %for.body48
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.body48 ], [ %indvars.iv85.ph, %for.body48.preheader98 ]
%count.081 = phi i32 [ %spec.select, %for.body48 ], [ %count.081.ph, %for.body48.preheader98 ]
%arrayidx50 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv85
%29 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%arrayidx52 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv85
%30 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%cmp53 = icmp sgt i32 %29, %30
%inc55 = zext i1 %cmp53 to i32
%spec.select = add nuw nsw i32 %count.081, %inc55
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count
br i1 %exitcond.not, label %for.end59, label %for.body48, !llvm.loop !15
for.end59: ; preds = %for.body48, %middle.block, %for.cond46.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond46.preheader ], [ %24, %middle.block ], [ %spec.select, %for.body48 ]
%call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %dest) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %src) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #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) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13, !12}
|
#include<stdio.h>
#include<math.h>
int main(void){
int N, M, H[100100] , A ,B;
int i, j , k[100100]={} ,sum=0 ;
int Am[100100]={}, Bm[100100]={};
scanf("%d%d" ,&N ,&M);
for( i= 1 ; i<=N ; i++){
scanf("%d" ,&H[i]);
};
for( j=1 ; j<=M ; j++){
scanf("%d%d" ,&A ,&B);
if(H[A]>=H[B]){
k[B]=1;
};
if(H[B]>=H[A]){
k[A]=1;
}
};
for(i=1 ;i<=N ; i++){
if(k[i]){}else{
sum++;
};
};
printf("%d", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276851/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276851/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%H = alloca [100100 x i32], align 16
%A = alloca i32, align 4
%B = alloca i32, align 4
%k = alloca [100100 x i32], align 16
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 void @llvm.lifetime.start.p0(i64 400400, ptr nonnull %H) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 400400, ptr nonnull %k) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400400) %k, i8 0, i64 400400, i1 false)
%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
%cmp.not44 = icmp slt i32 %0, 1
br i1 %cmp.not44, label %for.cond2.preheader, label %for.body
for.cond2.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %M, align 4, !tbaa !5
%cmp3.not46 = icmp slt i32 %2, 1
br i1 %cmp3.not46, label %for.cond25.preheader, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100100 x i32], ptr %H, 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
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %4
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond25.preheader.loopexit: ; preds = %for.inc22
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond25.preheader
for.cond25.preheader: ; preds = %for.cond25.preheader.loopexit, %for.cond2.preheader
%5 = phi i32 [ %.pre, %for.cond25.preheader.loopexit ], [ %1, %for.cond2.preheader ]
%cmp26.not48 = icmp slt i32 %5, 1
br i1 %cmp26.not48, label %for.end35, label %for.body27.preheader
for.body27.preheader: ; preds = %for.cond25.preheader
%6 = add nuw i32 %5, 1
%wide.trip.count = zext i32 %6 to i64
%7 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body27.preheader57, label %vector.ph
vector.ph: ; preds = %for.body27.preheader
%n.vec = and i64 %7, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%vec.phi55 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%offset.idx = or i64 %index, 1
%8 = getelementptr inbounds [100100 x i32], ptr %k, 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.load56 = load <4 x i32>, ptr %9, align 4, !tbaa !5
%10 = icmp eq <4 x i32> %wide.load, zeroinitializer
%11 = icmp eq <4 x i32> %wide.load56, zeroinitializer
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = add <4 x i32> %vec.phi, %12
%15 = add <4 x i32> %vec.phi55, %13
%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 !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %15, %14
%17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %7, %n.vec
br i1 %cmp.n, label %for.end35, label %for.body27.preheader57
for.body27.preheader57: ; preds = %for.body27.preheader, %middle.block
%indvars.iv52.ph = phi i64 [ 1, %for.body27.preheader ], [ %ind.end, %middle.block ]
%sum.050.ph = phi i32 [ 0, %for.body27.preheader ], [ %17, %middle.block ]
br label %for.body27
for.body4: ; preds = %for.cond2.preheader, %for.inc22
%j.047 = phi i32 [ %inc23, %for.inc22 ], [ 1, %for.cond2.preheader ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%18 = load i32, ptr %A, align 4, !tbaa !5
%idxprom6 = sext i32 %18 to i64
%arrayidx7 = getelementptr inbounds [100100 x i32], ptr %H, i64 0, i64 %idxprom6
%19 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%20 = load i32, ptr %B, align 4, !tbaa !5
%idxprom8 = sext i32 %20 to i64
%arrayidx9 = getelementptr inbounds [100100 x i32], ptr %H, i64 0, i64 %idxprom8
%21 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10.not = icmp slt i32 %19, %21
br i1 %cmp10.not, label %if.end, label %if.then
if.then: ; preds = %for.body4
%arrayidx12 = getelementptr inbounds [100100 x i32], ptr %k, i64 0, i64 %idxprom8
store i32 1, ptr %arrayidx12, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body4
%cmp17.not = icmp slt i32 %21, %19
br i1 %cmp17.not, label %for.inc22, label %if.then18
if.then18: ; preds = %if.end
%arrayidx20 = getelementptr inbounds [100100 x i32], ptr %k, i64 0, i64 %idxprom6
store i32 1, ptr %arrayidx20, align 4, !tbaa !5
br label %for.inc22
for.inc22: ; preds = %if.end, %if.then18
%inc23 = add nuw nsw i32 %j.047, 1
%22 = load i32, ptr %M, align 4, !tbaa !5
%cmp3.not.not = icmp slt i32 %j.047, %22
br i1 %cmp3.not.not, label %for.body4, label %for.cond25.preheader.loopexit, !llvm.loop !14
for.body27: ; preds = %for.body27.preheader57, %for.body27
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body27 ], [ %indvars.iv52.ph, %for.body27.preheader57 ]
%sum.050 = phi i32 [ %spec.select, %for.body27 ], [ %sum.050.ph, %for.body27.preheader57 ]
%arrayidx29 = getelementptr inbounds [100100 x i32], ptr %k, i64 0, i64 %indvars.iv52
%23 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%tobool.not = icmp eq i32 %23, 0
%inc31 = zext i1 %tobool.not to i32
%spec.select = add nuw nsw i32 %sum.050, %inc31
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%exitcond.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count
br i1 %exitcond.not, label %for.end35, label %for.body27, !llvm.loop !15
for.end35: ; preds = %for.body27, %middle.block, %for.cond25.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond25.preheader ], [ %17, %middle.block ], [ %spec.select, %for.body27 ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400400, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 400400, ptr nonnull %H) #5
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) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 = !{!"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}
!15 = distinct !{!15, !10, !13, !12}
|
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int N,M,i,j,H[100001],A[100001],B[100001],max,res[100001]={},sum=0;
// res[i]=0 2は良い展望台
scanf("%d %d",&N,&M);
for(i=1;i<=N;i++)
{
scanf("%d",&H[i]);
}
for(i=1;i<=M;i++)
{
scanf("%d %d",&A[i],&B[i]);
if(H[A[i]]>H[B[i]])
{
res[B[i]]=1;
}
else if(H[B[i]]>H[A[i]])
{
res[A[i]]=1;
}
else
{
res[A[i]]=1;
res[B[i]]=1;
}
}
for(i=1;i<=N;i++)
{
if(res[i]==0)
{
//printf("%d\n",i);
sum++;
}
}
printf("%d",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276895/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276895/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%H = alloca [100001 x i32], align 16
%A = alloca [100001 x i32], align 16
%B = alloca [100001 x i32], align 16
%res = alloca [100001 x i32], align 16
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 void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %H) #5
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %res) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %res, i8 0, i64 400004, i1 false)
%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
%cmp.not82 = icmp slt i32 %0, 1
br i1 %cmp.not82, label %for.cond2.preheader, label %for.body
for.cond2.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %M, align 4, !tbaa !5
%cmp3.not84 = icmp slt i32 %2, 1
br i1 %cmp3.not84, label %for.cond50.preheader, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %H, 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
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %4
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond50.preheader.loopexit: ; preds = %for.inc47
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond50.preheader
for.cond50.preheader: ; preds = %for.cond50.preheader.loopexit, %for.cond2.preheader
%5 = phi i32 [ %.pre, %for.cond50.preheader.loopexit ], [ %1, %for.cond2.preheader ]
%cmp51.not86 = icmp slt i32 %5, 1
br i1 %cmp51.not86, label %for.end61, label %for.body52.preheader
for.body52.preheader: ; preds = %for.cond50.preheader
%6 = add nuw i32 %5, 1
%wide.trip.count = zext i32 %6 to i64
%7 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body52.preheader98, label %vector.ph
vector.ph: ; preds = %for.body52.preheader
%n.vec = and i64 %7, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%vec.phi96 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%offset.idx = or i64 %index, 1
%8 = getelementptr inbounds [100001 x i32], ptr %res, 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.load97 = load <4 x i32>, ptr %9, align 4, !tbaa !5
%10 = icmp eq <4 x i32> %wide.load, zeroinitializer
%11 = icmp eq <4 x i32> %wide.load97, zeroinitializer
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = add <4 x i32> %vec.phi, %12
%15 = add <4 x i32> %vec.phi96, %13
%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 !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %15, %14
%17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %7, %n.vec
br i1 %cmp.n, label %for.end61, label %for.body52.preheader98
for.body52.preheader98: ; preds = %for.body52.preheader, %middle.block
%indvars.iv93.ph = phi i64 [ 1, %for.body52.preheader ], [ %ind.end, %middle.block ]
%sum.088.ph = phi i32 [ 0, %for.body52.preheader ], [ %17, %middle.block ]
br label %for.body52
for.body4: ; preds = %for.cond2.preheader, %for.inc47
%indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.inc47 ], [ 1, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv90
%arrayidx8 = getelementptr inbounds [100001 x i32], ptr %B, i64 0, i64 %indvars.iv90
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx8)
%18 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%idxprom12 = sext i32 %18 to i64
%arrayidx13 = getelementptr inbounds [100001 x i32], ptr %H, i64 0, i64 %idxprom12
%19 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%idxprom16 = sext i32 %20 to i64
%arrayidx17 = getelementptr inbounds [100001 x i32], ptr %H, i64 0, i64 %idxprom16
%21 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %19, %21
br i1 %cmp18, label %for.inc47.sink.split, label %if.else
if.else: ; preds = %for.body4
%cmp31 = icmp sgt i32 %21, %19
%arrayidx36 = getelementptr inbounds [100001 x i32], ptr %res, i64 0, i64 %idxprom12
store i32 1, ptr %arrayidx36, align 4, !tbaa !5
br i1 %cmp31, label %for.inc47, label %for.inc47.sink.split
for.inc47.sink.split: ; preds = %if.else, %for.body4
%arrayidx22 = getelementptr inbounds [100001 x i32], ptr %res, i64 0, i64 %idxprom16
store i32 1, ptr %arrayidx22, align 4, !tbaa !5
br label %for.inc47
for.inc47: ; preds = %for.inc47.sink.split, %if.else
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%22 = load i32, ptr %M, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv90, %23
br i1 %cmp3.not.not, label %for.body4, label %for.cond50.preheader.loopexit, !llvm.loop !14
for.body52: ; preds = %for.body52.preheader98, %for.body52
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body52 ], [ %indvars.iv93.ph, %for.body52.preheader98 ]
%sum.088 = phi i32 [ %spec.select, %for.body52 ], [ %sum.088.ph, %for.body52.preheader98 ]
%arrayidx54 = getelementptr inbounds [100001 x i32], ptr %res, i64 0, i64 %indvars.iv93
%24 = load i32, ptr %arrayidx54, align 4, !tbaa !5
%cmp55 = icmp eq i32 %24, 0
%inc57 = zext i1 %cmp55 to i32
%spec.select = add nuw nsw i32 %sum.088, %inc57
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%exitcond.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count
br i1 %exitcond.not, label %for.end61, label %for.body52, !llvm.loop !15
for.end61: ; preds = %for.body52, %middle.block, %for.cond50.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond50.preheader ], [ %17, %middle.block ], [ %spec.select, %for.body52 ]
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %res) #5
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %H) #5
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) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 = !{!"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}
!15 = distinct !{!15, !10, !13, !12}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{
int n,m;
int h[100000];
int j[100000]={};
int i,a,b,c=0;
scanf("%d %d",&n,&m);
for(i=0;i<n;i++)
{
scanf("%d",&h[i]);
}
for(i=0;i<m;i++)
{
scanf("%d %d",&a,&b);
if(h[a-1]<=h[b-1]) j[a-1]=1;
if(h[a-1]>=h[b-1]) j[b-1]=1;
}
for(i=0;i<n;i++)
{
if(j[i]==0) c++;
}
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276938/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276938/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%h = alloca [100000 x i32], align 16
%j = alloca [100000 x i32], align 16
%a = alloca i32, align 4
%b = 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 void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %j) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) %j, i8 0, i64 400000, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call = 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
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp353 = icmp sgt i32 %2, 0
br i1 %cmp353, label %for.body4, label %for.cond30.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %h, 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
%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.cond2.preheader, !llvm.loop !9
for.cond30.preheader.loopexit: ; preds = %for.inc27
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond30.preheader
for.cond30.preheader: ; preds = %for.cond30.preheader.loopexit, %for.cond2.preheader
%5 = phi i32 [ %.pre, %for.cond30.preheader.loopexit ], [ %1, %for.cond2.preheader ]
%cmp3155 = icmp sgt i32 %5, 0
br i1 %cmp3155, label %for.body32.preheader, label %for.end41
for.body32.preheader: ; preds = %for.cond30.preheader
%wide.trip.count = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body32.preheader64, label %vector.ph
vector.ph: ; preds = %for.body32.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 ], [ %12, %vector.body ]
%vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%6 = getelementptr inbounds [100000 x i32], ptr %j, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load63 = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = icmp eq <4 x i32> %wide.load, zeroinitializer
%9 = icmp eq <4 x i32> %wide.load63, zeroinitializer
%10 = zext <4 x i1> %8 to <4 x i32>
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = add <4 x i32> %vec.phi, %10
%13 = add <4 x i32> %vec.phi62, %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 !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %13, %12
%15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end41, label %for.body32.preheader64
for.body32.preheader64: ; preds = %for.body32.preheader, %middle.block
%indvars.iv59.ph = phi i64 [ 0, %for.body32.preheader ], [ %n.vec, %middle.block ]
%c.057.ph = phi i32 [ 0, %for.body32.preheader ], [ %15, %middle.block ]
br label %for.body32
for.body4: ; preds = %for.cond2.preheader, %for.inc27
%i.154 = phi i32 [ %inc28, %for.inc27 ], [ 0, %for.cond2.preheader ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%16 = load i32, ptr %a, align 4, !tbaa !5
%sub = add nsw i32 %16, -1
%idxprom6 = sext i32 %sub to i64
%arrayidx7 = getelementptr inbounds [100000 x i32], ptr %h, i64 0, i64 %idxprom6
%17 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%18 = load i32, ptr %b, align 4, !tbaa !5
%sub8 = add nsw i32 %18, -1
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds [100000 x i32], ptr %h, i64 0, i64 %idxprom9
%19 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not = icmp sgt i32 %17, %19
br i1 %cmp11.not, label %if.end, label %if.then
if.then: ; preds = %for.body4
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr %j, i64 0, i64 %idxprom6
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body4
%cmp21.not = icmp slt i32 %17, %19
br i1 %cmp21.not, label %for.inc27, label %if.then22
if.then22: ; preds = %if.end
%arrayidx25 = getelementptr inbounds [100000 x i32], ptr %j, i64 0, i64 %idxprom9
store i32 1, ptr %arrayidx25, align 4, !tbaa !5
br label %for.inc27
for.inc27: ; preds = %if.end, %if.then22
%inc28 = add nuw nsw i32 %i.154, 1
%20 = load i32, ptr %m, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc28, %20
br i1 %cmp3, label %for.body4, label %for.cond30.preheader.loopexit, !llvm.loop !14
for.body32: ; preds = %for.body32.preheader64, %for.body32
%indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.body32 ], [ %indvars.iv59.ph, %for.body32.preheader64 ]
%c.057 = phi i32 [ %spec.select, %for.body32 ], [ %c.057.ph, %for.body32.preheader64 ]
%arrayidx34 = getelementptr inbounds [100000 x i32], ptr %j, i64 0, i64 %indvars.iv59
%21 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%cmp35 = icmp eq i32 %21, 0
%inc37 = zext i1 %cmp35 to i32
%spec.select = add nuw nsw i32 %c.057, %inc37
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
br i1 %exitcond.not, label %for.end41, label %for.body32, !llvm.loop !15
for.end41: ; preds = %for.body32, %middle.block, %for.cond30.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond30.preheader ], [ %15, %middle.block ], [ %spec.select, %for.body32 ]
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %j) #5
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %h) #5
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) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 = !{!"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}
!15 = distinct !{!15, !10, !13, !12}
|
#include <stdio.h>
int main(void){
long n,m;
scanf("%ld %ld", &n, &m);
long h[n];
for (long i = 0; i < n; i++) {
scanf("%ld", &h[i]);
}
long a[m],b[m];
for (long i = 0; i < m; i++) {
scanf("%ld %ld", &a[i], &b[i]);
}
int check[n];
for (long i = 0; i < n; i++) {
check[i] = 1;
}
for (long i = 0; i < m; i++) {
if (h[a[i]-1] >= h[b[i]-1]) {
check[b[i]-1] = 0;
}
if (h[a[i]-1] <= h[b[i]-1]) {
check[a[i]-1] = 0;
}
}
long count = 0;
for (long i = 0; i < n; i++) {
if (check[i] == 1) {
count++;
}
}
printf("%ld\n", count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_276981/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_276981/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp85 = icmp sgt i64 %2, 0
br i1 %cmp85, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%3 = phi i64 [ %2, %entry ], [ %5, %for.body ]
%4 = load i64, ptr %m, align 8, !tbaa !5
%vla2 = alloca i64, i64 %4, align 16
%vla3 = alloca i64, i64 %4, align 16
%cmp687 = icmp sgt i64 %4, 0
br i1 %cmp687, label %for.body8, label %for.cond.cleanup7
for.body: ; preds = %entry, %for.body
%i.086 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.086
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.086, 1
%5 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup7.loopexit: ; preds = %for.body8
%.pre = load i64, ptr %n, align 8, !tbaa !5
br label %for.cond.cleanup7
for.cond.cleanup7: ; preds = %for.cond.cleanup7.loopexit, %for.cond.cleanup
%6 = phi i64 [ %3, %for.cond.cleanup ], [ %.pre, %for.cond.cleanup7.loopexit ]
%.lcssa = phi i64 [ %4, %for.cond.cleanup ], [ %10, %for.cond.cleanup7.loopexit ]
%vla15 = alloca i32, i64 %6, align 16
%cmp1889 = icmp sgt i64 %6, 0
br i1 %cmp1889, label %for.body20.preheader, label %for.cond26.preheader
for.body20.preheader: ; preds = %for.cond.cleanup7
%min.iters.check = icmp ult i64 %6, 8
br i1 %min.iters.check, label %for.body20.preheader124, label %vector.ph
vector.ph: ; preds = %for.body20.preheader
%n.vec = and i64 %6, -8
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%7 = getelementptr inbounds i32, ptr %vla15, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %7, align 16, !tbaa !11
%8 = getelementptr inbounds i32, ptr %7, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 16, !tbaa !11
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %6, %n.vec
br i1 %cmp.n, label %for.cond26.preheader, label %for.body20.preheader124
for.body20.preheader124: ; preds = %for.body20.preheader, %middle.block
%i16.090.ph = phi i64 [ 0, %for.body20.preheader ], [ %n.vec, %middle.block ]
br label %for.body20
for.body8: ; preds = %for.cond.cleanup, %for.body8
%i4.088 = phi i64 [ %inc13, %for.body8 ], [ 0, %for.cond.cleanup ]
%arrayidx9 = getelementptr inbounds i64, ptr %vla2, i64 %i4.088
%arrayidx10 = getelementptr inbounds i64, ptr %vla3, i64 %i4.088
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9, ptr noundef nonnull %arrayidx10)
%inc13 = add nuw nsw i64 %i4.088, 1
%10 = load i64, ptr %m, align 8, !tbaa !5
%cmp6 = icmp slt i64 %inc13, %10
br i1 %cmp6, label %for.body8, label %for.cond.cleanup7.loopexit, !llvm.loop !16
for.cond26.preheader: ; preds = %for.body20, %middle.block, %for.cond.cleanup7
%invariant.gep = getelementptr i64, ptr %vla, i64 -1
%cmp2793 = icmp sgt i64 %.lcssa, 0
br i1 %cmp2793, label %for.body29.preheader, label %for.cond55.preheader
for.body29.preheader: ; preds = %for.cond26.preheader
%invariant.gep104 = getelementptr i32, ptr %vla15, i64 -1
br label %for.body29
for.body20: ; preds = %for.body20.preheader124, %for.body20
%i16.090 = phi i64 [ %inc23, %for.body20 ], [ %i16.090.ph, %for.body20.preheader124 ]
%arrayidx21 = getelementptr inbounds i32, ptr %vla15, i64 %i16.090
store i32 1, ptr %arrayidx21, align 4, !tbaa !11
%inc23 = add nuw nsw i64 %i16.090, 1
%exitcond.not = icmp eq i64 %inc23, %6
br i1 %exitcond.not, label %for.cond26.preheader, label %for.body20, !llvm.loop !17
for.cond55.preheader: ; preds = %for.inc51, %for.cond26.preheader
br i1 %cmp1889, label %for.body58.preheader, label %for.cond.cleanup57
for.body58.preheader: ; preds = %for.cond55.preheader
%min.iters.check110 = icmp ult i64 %6, 4
br i1 %min.iters.check110, label %for.body58.preheader121, label %vector.ph111
vector.ph111: ; preds = %for.body58.preheader
%n.vec113 = and i64 %6, -4
br label %vector.body116
vector.body116: ; preds = %vector.body116, %vector.ph111
%index117 = phi i64 [ 0, %vector.ph111 ], [ %index.next120, %vector.body116 ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph111 ], [ %17, %vector.body116 ]
%vec.phi118 = phi <2 x i64> [ zeroinitializer, %vector.ph111 ], [ %18, %vector.body116 ]
%11 = getelementptr inbounds i32, ptr %vla15, i64 %index117
%wide.load = load <2 x i32>, ptr %11, align 16, !tbaa !11
%12 = getelementptr inbounds i32, ptr %11, i64 2
%wide.load119 = load <2 x i32>, ptr %12, align 8, !tbaa !11
%13 = icmp eq <2 x i32> %wide.load, <i32 1, i32 1>
%14 = icmp eq <2 x i32> %wide.load119, <i32 1, i32 1>
%15 = zext <2 x i1> %13 to <2 x i64>
%16 = zext <2 x i1> %14 to <2 x i64>
%17 = add <2 x i64> %vec.phi, %15
%18 = add <2 x i64> %vec.phi118, %16
%index.next120 = add nuw i64 %index117, 4
%19 = icmp eq i64 %index.next120, %n.vec113
br i1 %19, label %middle.block108, label %vector.body116, !llvm.loop !18
middle.block108: ; preds = %vector.body116
%bin.rdx = add <2 x i64> %18, %17
%20 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n115 = icmp eq i64 %6, %n.vec113
br i1 %cmp.n115, label %for.cond.cleanup57, label %for.body58.preheader121
for.body58.preheader121: ; preds = %for.body58.preheader, %middle.block108
%i54.097.ph = phi i64 [ 0, %for.body58.preheader ], [ %n.vec113, %middle.block108 ]
%count.096.ph = phi i64 [ 0, %for.body58.preheader ], [ %20, %middle.block108 ]
br label %for.body58
for.body29: ; preds = %for.body29.preheader, %for.inc51
%i25.094 = phi i64 [ %inc52, %for.inc51 ], [ 0, %for.body29.preheader ]
%arrayidx30 = getelementptr inbounds i64, ptr %vla2, i64 %i25.094
%21 = load i64, ptr %arrayidx30, align 8, !tbaa !5
%gep = getelementptr i64, ptr %invariant.gep, i64 %21
%22 = load i64, ptr %gep, align 8, !tbaa !5
%arrayidx32 = getelementptr inbounds i64, ptr %vla3, i64 %i25.094
%23 = load i64, ptr %arrayidx32, align 8, !tbaa !5
%sub33 = add nsw i64 %23, -1
%arrayidx34 = getelementptr inbounds i64, ptr %vla, i64 %sub33
%24 = load i64, ptr %arrayidx34, align 8, !tbaa !5
%cmp35.not = icmp slt i64 %22, %24
br i1 %cmp35.not, label %if.end, label %if.then
if.then: ; preds = %for.body29
%arrayidx38 = getelementptr inbounds i32, ptr %vla15, i64 %sub33
store i32 0, ptr %arrayidx38, align 4, !tbaa !11
br label %if.end
if.end: ; preds = %if.then, %for.body29
%cmp45.not = icmp sgt i64 %22, %24
br i1 %cmp45.not, label %for.inc51, label %if.then46
if.then46: ; preds = %if.end
%gep105 = getelementptr i32, ptr %invariant.gep104, i64 %21
store i32 0, ptr %gep105, align 4, !tbaa !11
br label %for.inc51
for.inc51: ; preds = %if.end, %if.then46
%inc52 = add nuw nsw i64 %i25.094, 1
%exitcond100.not = icmp eq i64 %inc52, %.lcssa
br i1 %exitcond100.not, label %for.cond55.preheader, label %for.body29, !llvm.loop !19
for.cond.cleanup57: ; preds = %for.body58, %middle.block108, %for.cond55.preheader
%count.0.lcssa = phi i64 [ 0, %for.cond55.preheader ], [ %20, %middle.block108 ], [ %spec.select, %for.body58 ]
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.0.lcssa)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
for.body58: ; preds = %for.body58.preheader121, %for.body58
%i54.097 = phi i64 [ %inc65, %for.body58 ], [ %i54.097.ph, %for.body58.preheader121 ]
%count.096 = phi i64 [ %spec.select, %for.body58 ], [ %count.096.ph, %for.body58.preheader121 ]
%arrayidx59 = getelementptr inbounds i32, ptr %vla15, i64 %i54.097
%25 = load i32, ptr %arrayidx59, align 4, !tbaa !11
%cmp60 = icmp eq i32 %25, 1
%inc62 = zext i1 %cmp60 to i64
%spec.select = add nuw nsw i64 %count.096, %inc62
%inc65 = add nuw nsw i64 %i54.097, 1
%exitcond101.not = icmp eq i64 %inc65, %6
br i1 %exitcond101.not, label %for.cond.cleanup57, label %for.body58, !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: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15, !14}
!18 = distinct !{!18, !10, !14, !15}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !15, !14}
|
#include "stdio.h"
int main()
{
int n;
while(~scanf("%d",&n))
{
printf("ABC%d\n",n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277232/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277232/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ABC%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool.not3 = icmp eq i32 %call2, -1
br i1 %tobool.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %n, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
int main(void){
uint32_t n, m;
scanf("%"SCNu32"%"SCNu32, &n, &m);
for(uint32_t i=m/2; i>0; i--){
printf("%"PRIu32" %"PRIu32"\n", i, m-i+1);
}
for(uint32_t i=(m+1)/2; i>0; i--){
printf("%"PRIu32" %"PRIu32"\n", m+i, m*2-i+2);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%u%u\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%u %u\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp.not24 = icmp ult i32 %0, 2
br i1 %cmp.not24, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%div22 = lshr i32 %0, 1
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
%.pre = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%1 = phi i32 [ %.pre, %for.cond.cleanup.loopexit ], [ %0, %entry ]
%add3 = add i32 %1, 1
%cmp6.not26 = icmp ult i32 %add3, 2
br i1 %cmp6.not26, label %for.cond.cleanup7, label %for.body8.preheader
for.body8.preheader: ; preds = %for.cond.cleanup
%div423 = lshr i32 %add3, 1
br label %for.body8
for.body: ; preds = %for.body.preheader, %for.body
%i.025 = phi i32 [ %dec, %for.body ], [ %div22, %for.body.preheader ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%reass.sub = sub i32 %2, %i.025
%add = add i32 %reass.sub, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.025, i32 noundef %add)
%dec = add nsw i32 %i.025, -1
%cmp.not = icmp eq i32 %dec, 0
br i1 %cmp.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !9
for.cond.cleanup7: ; preds = %for.body8, %for.cond.cleanup
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
for.body8: ; preds = %for.body8.preheader, %for.body8
%i2.027 = phi i32 [ %dec14, %for.body8 ], [ %div423, %for.body8.preheader ]
%3 = load i32, ptr %m, align 4, !tbaa !5
%add9 = add i32 %3, %i2.027
%mul = shl i32 %3, 1
%reass.sub28 = sub i32 %mul, %i2.027
%add11 = add i32 %reass.sub28, 2
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add9, i32 noundef %add11)
%dec14 = add nsw i32 %i2.027, -1
%cmp6.not = icmp eq i32 %dec14, 0
br i1 %cmp6.not, label %for.cond.cleanup7, label %for.body8, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct f{char n[21];int m[9],t;double x;}f;
f F[50];
int N,i,j;
int c(const void *a,const void *b)
{
if((*(f*)a).x==(*(f*)b).x)
return strcmp((*(f*)a).n,(*(f*)b).n);
return (*(f*)a).x-(*(f*)b).x>0?-1:1;
}
int main()
{
for(;scanf("%d\n",&N),N;)
{
for(i=0;i<N;i++)
{
scanf("%s",F[i].n);
for(j=0;j<9;j++)
scanf("%d",&F[i].m[j]);
F[i].t=(F[i].m[4]+F[i].m[5])*F[i].m[8];
F[i].t+=F[i].m[1]+F[i].m[2]+F[i].m[3];
F[i].x=((double)(F[i].m[6]*F[i].m[7]*F[i].m[8]-F[i].m[0])/F[i].t);
}
qsort(F,N,sizeof(f),c);
for(i=0;i<N;i++)
puts(F[i].n);
puts("#");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277405/source.c"
target datalayout = "e-m:e-p270: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.f = type { [21 x i8], [9 x i32], i32, double }
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@N = dso_local global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@F = dso_local global [50 x %struct.f] zeroinitializer, align 16
@j = dso_local local_unnamed_addr global i32 0, align 4
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"#\00", align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @c(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%x = getelementptr inbounds %struct.f, ptr %a, i64 0, i32 3
%0 = load double, ptr %x, align 8, !tbaa !5
%x1 = getelementptr inbounds %struct.f, ptr %b, i64 0, i32 3
%1 = load double, ptr %x1, align 8, !tbaa !5
%cmp = fcmp oeq double %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #5
br label %return
if.end: ; preds = %entry
%sub = fsub double %0, %1
%cmp6 = fcmp ogt double %sub, 0.000000e+00
%cond = select i1 %cmp6, i32 -1, i32 1
br label %return
return: ; preds = %if.end, %if.then
%retval.0 = phi i32 [ %call, %if.then ], [ %cond, %if.end ]
ret i32 %retval.0
}
; 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:
%call96 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%0 = load i32, ptr @N, align 4, !tbaa !11
%tobool.not97 = icmp eq i32 %0, 0
br i1 %tobool.not97, label %for.end85, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.end83
%1 = phi i32 [ %18, %for.end83 ], [ %0, %entry ]
store i32 0, ptr @i, align 4, !tbaa !11
%cmp92 = icmp sgt i32 %1, 0
br i1 %cmp92, label %for.body2, label %for.end70
for.body2: ; preds = %for.cond1.preheader, %for.end
%storemerge93 = phi i32 [ %inc69, %for.end ], [ 0, %for.cond1.preheader ]
%idxprom = sext i32 %storemerge93 to i64
%arrayidx = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
store i32 0, ptr @j, align 4, !tbaa !11
br label %for.body6
for.body6: ; preds = %for.body2, %for.body6
%storemerge9091 = phi i32 [ 0, %for.body2 ], [ %inc, %for.body6 ]
%2 = load i32, ptr @i, align 4, !tbaa !11
%idxprom7 = sext i32 %2 to i64
%idxprom9 = sext i32 %storemerge9091 to i64
%arrayidx10 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom7, i32 1, i64 %idxprom9
%call11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx10)
%3 = load i32, ptr @j, align 4, !tbaa !11
%inc = add nsw i32 %3, 1
store i32 %inc, ptr @j, align 4, !tbaa !11
%cmp5 = icmp slt i32 %3, 8
br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body6
%4 = load i32, ptr @i, align 4, !tbaa !11
%idxprom12 = sext i32 %4 to i64
%arrayidx15 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1, i64 4
%5 = load i32, ptr %arrayidx15, align 8, !tbaa !11
%arrayidx19 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1, i64 5
%6 = load i32, ptr %arrayidx19, align 4, !tbaa !11
%add = add nsw i32 %6, %5
%arrayidx23 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1, i64 8
%7 = load i32, ptr %arrayidx23, align 8, !tbaa !11
%mul = mul nsw i32 %add, %7
%t = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 2
%arrayidx29 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1, i64 1
%8 = load i32, ptr %arrayidx29, align 4, !tbaa !11
%arrayidx33 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1, i64 2
%9 = load i32, ptr %arrayidx33, align 8, !tbaa !11
%arrayidx38 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1, i64 3
%10 = load i32, ptr %arrayidx38, align 4, !tbaa !11
%add34 = add i32 %8, %mul
%add39 = add i32 %add34, %9
%add43 = add i32 %add39, %10
store i32 %add43, ptr %t, align 4, !tbaa !14
%m46 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1
%arrayidx47 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1, i64 6
%11 = load i32, ptr %arrayidx47, align 8, !tbaa !11
%arrayidx51 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 1, i64 7
%12 = load i32, ptr %arrayidx51, align 4, !tbaa !11
%mul52 = mul i32 %11, %7
%mul57 = mul i32 %mul52, %12
%13 = load i32, ptr %m46, align 8, !tbaa !11
%sub = sub nsw i32 %mul57, %13
%conv = sitofp i32 %sub to double
%conv65 = sitofp i32 %add43 to double
%div = fdiv double %conv, %conv65
%x = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom12, i32 3
store double %div, ptr %x, align 8, !tbaa !5
%inc69 = add nsw i32 %4, 1
store i32 %inc69, ptr @i, align 4, !tbaa !11
%14 = load i32, ptr @N, align 4, !tbaa !11
%cmp = icmp slt i32 %inc69, %14
br i1 %cmp, label %for.body2, label %for.end70, !llvm.loop !15
for.end70: ; preds = %for.end, %for.cond1.preheader
%.lcssa = phi i32 [ %1, %for.cond1.preheader ], [ %14, %for.end ]
%conv71 = sext i32 %.lcssa to i64
tail call void @qsort(ptr noundef nonnull @F, i64 noundef %conv71, i64 noundef 72, ptr noundef nonnull @c) #6
store i32 0, ptr @i, align 4, !tbaa !11
%15 = load i32, ptr @N, align 4, !tbaa !11
%cmp7394 = icmp sgt i32 %15, 0
br i1 %cmp7394, label %for.body75, label %for.end83
for.body75: ; preds = %for.end70, %for.body75
%storemerge8995 = phi i32 [ %inc82, %for.body75 ], [ 0, %for.end70 ]
%idxprom76 = sext i32 %storemerge8995 to i64
%arrayidx77 = getelementptr inbounds [50 x %struct.f], ptr @F, i64 0, i64 %idxprom76
%call80 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %arrayidx77)
%16 = load i32, ptr @i, align 4, !tbaa !11
%inc82 = add nsw i32 %16, 1
store i32 %inc82, ptr @i, align 4, !tbaa !11
%17 = load i32, ptr @N, align 4, !tbaa !11
%cmp73 = icmp slt i32 %inc82, %17
br i1 %cmp73, label %for.body75, label %for.end83, !llvm.loop !16
for.end83: ; preds = %for.body75, %for.end70
%call84 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%18 = load i32, ptr @N, align 4, !tbaa !11
%tobool.not = icmp eq i32 %18, 0
br i1 %tobool.not, label %for.end85, label %for.cond1.preheader, !llvm.loop !17
for.end85: ; preds = %for.end83, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind willreturn memory(read) }
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, !10, i64 64}
!6 = !{!"f", !7, i64 0, !7, i64 24, !9, i64 60, !10, i64 64}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!9, !9, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!6, !9, i64 60}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
int main(){
int N,M,S=0;
scanf("%d %d",&N,&M);
int F[200000];
for(int i=0;i<=N;i++)
F[i]=0;
int L,R;
for(int i=1;i<=M;i++){
scanf("%d %d",&L,&R);
F[L]++;
F[R+1]--;
}
for(int i=1;i<=N;i++){
F[i]+=F[i-1];
if(F[i]==M) S++;
}
printf("%d\n",S);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277470/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277470/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%F = alloca [200000 x i32], align 16
%L = alloca i32, align 4
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %F) #4
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not41 = icmp slt i32 %0, 0
br i1 %cmp.not41, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 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) %F, i8 0, i64 %3, i1 false), !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #4
%4 = load i32, ptr %M, align 4, !tbaa !5
%cmp3.not43 = icmp slt i32 %4, 1
br i1 %cmp3.not43, label %for.cond16.preheader, label %for.body5
for.cond16.preheader.loopexit: ; preds = %for.body5
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond16.preheader.loopexit, %for.cond.cleanup
%5 = phi i32 [ %0, %for.cond.cleanup ], [ %.pre, %for.cond16.preheader.loopexit ]
%.lcssa = phi i32 [ %4, %for.cond.cleanup ], [ %12, %for.cond16.preheader.loopexit ]
%cmp17.not45 = icmp slt i32 %5, 1
br i1 %cmp17.not45, label %for.cond.cleanup18, label %for.body19.preheader
for.body19.preheader: ; preds = %for.cond16.preheader
%.pre53 = load i32, ptr %F, align 16, !tbaa !5
%6 = zext i32 %5 to i64
%xtraiter = and i64 %6, 1
%7 = icmp eq i32 %5, 1
br i1 %7, label %for.cond.cleanup18.loopexit.unr-lcssa, label %for.body19.preheader.new
for.body19.preheader.new: ; preds = %for.body19.preheader
%unroll_iter = and i64 %6, 4294967294
br label %for.body19
for.body5: ; preds = %for.cond.cleanup, %for.body5
%i1.044 = phi i32 [ %inc13, %for.body5 ], [ 1, %for.cond.cleanup ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L, ptr noundef nonnull %R)
%8 = load i32, ptr %L, align 4, !tbaa !5
%idxprom7 = sext i32 %8 to i64
%arrayidx8 = getelementptr inbounds [200000 x i32], ptr %F, i64 0, i64 %idxprom7
%9 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%inc9 = add nsw i32 %9, 1
store i32 %inc9, ptr %arrayidx8, align 4, !tbaa !5
%10 = load i32, ptr %R, align 4, !tbaa !5
%add = add nsw i32 %10, 1
%idxprom10 = sext i32 %add to i64
%arrayidx11 = getelementptr inbounds [200000 x i32], ptr %F, i64 0, i64 %idxprom10
%11 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%dec = add nsw i32 %11, -1
store i32 %dec, ptr %arrayidx11, align 4, !tbaa !5
%inc13 = add nuw nsw i32 %i1.044, 1
%12 = load i32, ptr %M, align 4, !tbaa !5
%cmp3.not.not = icmp slt i32 %i1.044, %12
br i1 %cmp3.not.not, label %for.body5, label %for.cond16.preheader.loopexit, !llvm.loop !9
for.cond.cleanup18.loopexit.unr-lcssa: ; preds = %for.body19, %for.body19.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body19.preheader ], [ %spec.select.1, %for.body19 ]
%.unr = phi i32 [ %.pre53, %for.body19.preheader ], [ %add24.1, %for.body19 ]
%indvars.iv.unr = phi i64 [ 1, %for.body19.preheader ], [ %indvars.iv.next.1, %for.body19 ]
%S.046.unr = phi i32 [ 0, %for.body19.preheader ], [ %spec.select.1, %for.body19 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup18, label %for.body19.epil
for.body19.epil: ; preds = %for.cond.cleanup18.loopexit.unr-lcssa
%arrayidx23.epil = getelementptr inbounds [200000 x i32], ptr %F, i64 0, i64 %indvars.iv.unr
%13 = load i32, ptr %arrayidx23.epil, align 4, !tbaa !5
%add24.epil = add nsw i32 %13, %.unr
store i32 %add24.epil, ptr %arrayidx23.epil, align 4, !tbaa !5
%cmp27.epil = icmp eq i32 %add24.epil, %.lcssa
%inc28.epil = zext i1 %cmp27.epil to i32
%spec.select.epil = add nuw nsw i32 %S.046.unr, %inc28.epil
br label %for.cond.cleanup18
for.cond.cleanup18: ; preds = %for.body19.epil, %for.cond.cleanup18.loopexit.unr-lcssa, %for.cond16.preheader
%S.0.lcssa = phi i32 [ 0, %for.cond16.preheader ], [ %spec.select.lcssa.ph, %for.cond.cleanup18.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body19.epil ]
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %S.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #4
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %F) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
for.body19: ; preds = %for.body19, %for.body19.preheader.new
%14 = phi i32 [ %.pre53, %for.body19.preheader.new ], [ %add24.1, %for.body19 ]
%indvars.iv = phi i64 [ 1, %for.body19.preheader.new ], [ %indvars.iv.next.1, %for.body19 ]
%S.046 = phi i32 [ 0, %for.body19.preheader.new ], [ %spec.select.1, %for.body19 ]
%niter = phi i64 [ 0, %for.body19.preheader.new ], [ %niter.next.1, %for.body19 ]
%arrayidx23 = getelementptr inbounds [200000 x i32], ptr %F, i64 0, i64 %indvars.iv
%15 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%add24 = add nsw i32 %15, %14
store i32 %add24, ptr %arrayidx23, align 4, !tbaa !5
%cmp27 = icmp eq i32 %add24, %.lcssa
%inc28 = zext i1 %cmp27 to i32
%spec.select = add nuw nsw i32 %S.046, %inc28
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx23.1 = getelementptr inbounds [200000 x i32], ptr %F, i64 0, i64 %indvars.iv.next
%16 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%add24.1 = add nsw i32 %16, %add24
store i32 %add24.1, ptr %arrayidx23.1, align 4, !tbaa !5
%cmp27.1 = icmp eq i32 %add24.1, %.lcssa
%inc28.1 = zext i1 %cmp27.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc28.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup18.loopexit.unr-lcssa, label %for.body19, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int N, M;
int horieyui[114514];
int main(void) {
int i;
int toyosakiaki = 0;
if (scanf("%d%d", &N, &M) != 2) return 1;
for (i = 0; i < M; i++) {
int L, R;
if (scanf("%d%d", &L, &R) != 2) return 1;
horieyui[L]++;
horieyui[R + 1]--;
}
for (i = 1; i <= N; i++) horieyui[i] += horieyui[i - 1];
for (i = 1; i <= N; i++) {
if (horieyui[i] >= M) toyosakiaki++;
}
printf("%d\n", toyosakiaki);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277513/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277513/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@N = dso_local global i32 0, align 4
@M = dso_local global i32 0, align 4
@horieyui = dso_local local_unnamed_addr global [114514 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca i32, align 4
%R = alloca i32, align 4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @M)
%cmp.not = icmp eq i32 %call, 2
br i1 %cmp.not, label %for.cond.preheader, label %cleanup34
for.cond.preheader: ; preds = %entry
%0 = load i32, ptr @M, align 4, !tbaa !5
%cmp149 = icmp sgt i32 %0, 0
br i1 %cmp149, label %for.body, label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.inc, %for.cond.preheader
%.lcssa47 = phi i32 [ %0, %for.cond.preheader ], [ %10, %for.inc ]
%1 = load i32, ptr @N, align 4, !tbaa !5
%cmp11.not51 = icmp slt i32 %1, 1
br i1 %cmp11.not51, label %for.end32, label %for.body12.preheader
for.body12.preheader: ; preds = %for.cond10.preheader
%2 = add nuw i32 %1, 1
%wide.trip.count = zext i32 %2 to i64
%.pre = load i32, ptr @horieyui, align 16, !tbaa !5
%3 = add nsw i64 %wide.trip.count, -1
%4 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %3, 3
%5 = icmp ult i64 %4, 3
br i1 %5, label %for.cond21.preheader.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %3, -4
br label %for.body12
for.body: ; preds = %for.cond.preheader, %for.inc
%i.050 = phi i32 [ %inc9, %for.inc ], [ 0, %for.cond.preheader ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #4
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L, ptr noundef nonnull %R)
%cmp3.not = icmp eq i32 %call2, 2
br i1 %cmp3.not, label %for.inc, label %cleanup
cleanup: ; preds = %for.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #4
br label %cleanup34
for.inc: ; preds = %for.body
%6 = load i32, ptr %L, align 4, !tbaa !5
%idxprom = sext i32 %6 to i64
%arrayidx = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %idxprom
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %7, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%8 = load i32, ptr %R, align 4, !tbaa !5
%add = add nsw i32 %8, 1
%idxprom6 = sext i32 %add to i64
%arrayidx7 = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %idxprom6
%9 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%dec = add nsw i32 %9, -1
store i32 %dec, ptr %arrayidx7, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #4
%inc9 = add nuw nsw i32 %i.050, 1
%10 = load i32, ptr @M, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc9, %10
br i1 %cmp1, label %for.body, label %for.cond10.preheader, !llvm.loop !9
for.cond21.preheader.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%.unr = phi i32 [ %.pre, %for.body12.preheader ], [ %add17.3, %for.body12 ]
%indvars.iv.unr = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next.3, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond21.preheader, label %for.body12.epil
for.body12.epil: ; preds = %for.cond21.preheader.unr-lcssa, %for.body12.epil
%11 = phi i32 [ %add17.epil, %for.body12.epil ], [ %.unr, %for.cond21.preheader.unr-lcssa ]
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body12.epil ], [ %indvars.iv.unr, %for.cond21.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body12.epil ], [ 0, %for.cond21.preheader.unr-lcssa ]
%arrayidx16.epil = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %indvars.iv.epil
%12 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
%add17.epil = add nsw i32 %12, %11
store i32 %add17.epil, ptr %arrayidx16.epil, align 4, !tbaa !5
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond21.preheader, label %for.body12.epil, !llvm.loop !11
for.cond21.preheader: ; preds = %for.body12.epil, %for.cond21.preheader.unr-lcssa
br i1 %cmp11.not51, label %for.end32, label %for.body23.preheader
for.body23.preheader: ; preds = %for.cond21.preheader
%13 = add nuw i32 %1, 1
%wide.trip.count63 = zext i32 %13 to i64
%14 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body23.preheader67, label %vector.ph
vector.ph: ; preds = %for.body23.preheader
%n.vec = and i64 %14, -8
%ind.end = or i64 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.lcssa47, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%vec.phi65 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
%offset.idx = or i64 %index, 1
%15 = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 4
%wide.load66 = load <4 x i32>, ptr %16, align 4, !tbaa !5
%17 = icmp sge <4 x i32> %wide.load, %broadcast.splat
%18 = icmp sge <4 x i32> %wide.load66, %broadcast.splat
%19 = zext <4 x i1> %17 to <4 x i32>
%20 = zext <4 x i1> %18 to <4 x i32>
%21 = add <4 x i32> %vec.phi, %19
%22 = add <4 x i32> %vec.phi65, %20
%index.next = add nuw i64 %index, 8
%23 = icmp eq i64 %index.next, %n.vec
br i1 %23, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %22, %21
%24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %14, %n.vec
br i1 %cmp.n, label %for.end32, label %for.body23.preheader67
for.body23.preheader67: ; preds = %for.body23.preheader, %middle.block
%indvars.iv60.ph = phi i64 [ 1, %for.body23.preheader ], [ %ind.end, %middle.block ]
%toyosakiaki.056.ph = phi i32 [ 0, %for.body23.preheader ], [ %24, %middle.block ]
br label %for.body23
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%25 = phi i32 [ %.pre, %for.body12.preheader.new ], [ %add17.3, %for.body12 ]
%indvars.iv = phi i64 [ 1, %for.body12.preheader.new ], [ %indvars.iv.next.3, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.3, %for.body12 ]
%arrayidx16 = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %indvars.iv
%26 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%add17 = add nsw i32 %26, %25
store i32 %add17, ptr %arrayidx16, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx16.1 = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %indvars.iv.next
%27 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
%add17.1 = add nsw i32 %27, %add17
store i32 %add17.1, ptr %arrayidx16.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx16.2 = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %indvars.iv.next.1
%28 = load i32, ptr %arrayidx16.2, align 4, !tbaa !5
%add17.2 = add nsw i32 %28, %add17.1
store i32 %add17.2, ptr %arrayidx16.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx16.3 = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %indvars.iv.next.2
%29 = load i32, ptr %arrayidx16.3, align 4, !tbaa !5
%add17.3 = add nsw i32 %29, %add17.2
store i32 %add17.3, ptr %arrayidx16.3, align 4, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond21.preheader.unr-lcssa, label %for.body12, !llvm.loop !16
for.body23: ; preds = %for.body23.preheader67, %for.body23
%indvars.iv60 = phi i64 [ %indvars.iv.next61, %for.body23 ], [ %indvars.iv60.ph, %for.body23.preheader67 ]
%toyosakiaki.056 = phi i32 [ %spec.select, %for.body23 ], [ %toyosakiaki.056.ph, %for.body23.preheader67 ]
%arrayidx25 = getelementptr inbounds [114514 x i32], ptr @horieyui, i64 0, i64 %indvars.iv60
%30 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp26.not = icmp sge i32 %30, %.lcssa47
%inc28 = zext i1 %cmp26.not to i32
%spec.select = add nuw nsw i32 %toyosakiaki.056, %inc28
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%exitcond64.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count63
br i1 %exitcond64.not, label %for.end32, label %for.body23, !llvm.loop !17
for.end32: ; preds = %for.body23, %middle.block, %for.cond10.preheader, %for.cond21.preheader
%toyosakiaki.0.lcssa = phi i32 [ 0, %for.cond21.preheader ], [ 0, %for.cond10.preheader ], [ %24, %middle.block ], [ %spec.select, %for.body23 ]
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %toyosakiaki.0.lcssa)
br label %cleanup34
cleanup34: ; preds = %cleanup, %entry, %for.end32
%retval.2 = phi i32 [ 1, %cleanup ], [ 0, %for.end32 ], [ 1, %entry ]
ret i32 %retval.2
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15, !14}
|
#include<stdio.h>
int main(void){
unsigned long n,m;
scanf("%ld %ld", &n, &m);
unsigned long l[n], r[m], min=1, max=n, num=n;
for(long i=0; i<m; i++){
scanf("%ld %ld", &l[i], &r[i]);
if(l[i]>min) min = l[i];
if(r[i]<max) max = r[i];
if(min > max) break;
}
if(min > max) num = 0;
else num = max - min +1;
printf("%ld\n", num);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277557/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277557/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %m, align 8, !tbaa !5
%vla1 = alloca i64, i64 %2, align 16
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp39.not = icmp eq i64 %2, 0
br i1 %cmp39.not, label %cleanup, label %for.body
for.cond: ; preds = %for.body
%inc = add nuw nsw i64 %i.042, 1
%4 = load i64, ptr %m, align 8, !tbaa !5
%cmp = icmp ult i64 %inc, %4
br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
%i.042 = phi i64 [ %inc, %for.cond ], [ 0, %entry ]
%max.041 = phi i64 [ %max.1, %for.cond ], [ %3, %entry ]
%min.040 = phi i64 [ %spec.select, %for.cond ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.042
%arrayidx2 = getelementptr inbounds i64, ptr %vla1, i64 %i.042
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%5 = load i64, ptr %arrayidx, align 8, !tbaa !5
%spec.select = call i64 @llvm.umax.i64(i64 %5, i64 %min.040)
%6 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%max.1 = call i64 @llvm.umin.i64(i64 %6, i64 %max.041)
%cmp12 = icmp ugt i64 %spec.select, %max.1
br i1 %cmp12, label %cleanup, label %for.cond
cleanup: ; preds = %for.cond, %for.body, %entry
%min.2 = phi i64 [ 1, %entry ], [ %spec.select, %for.body ], [ %spec.select, %for.cond ]
%max.2 = phi i64 [ %3, %entry ], [ %max.1, %for.body ], [ %max.1, %for.cond ]
%cmp15 = icmp ugt i64 %min.2, %max.2
%reass.sub = sub i64 %max.2, %min.2
%add = add i64 %reass.sub, 1
%num.0 = select i1 %cmp15, i64 0, i64 %add
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %num.0)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int n,m,l[100000],r[100000],i,b=0,c=1000000;
scanf("%d %d",&n,&m);
for(i=1;i<=m;i++){
scanf("%d %d",&l[i],&r[i]);
if(b<l[i])b=l[i];
if(c>r[i])c=r[i];
}
if(c-b>=0)printf("%d",c-b+1);
else printf("0");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277607/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277607/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%l = alloca [100000 x i32], align 16
%r = alloca [100000 x i32], align 16
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 void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %l) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %r) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp.not34 = icmp slt i32 %0, 1
br i1 %cmp.not34, label %if.then17, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%c.037 = phi i32 [ %c.1, %for.body ], [ 1000000, %entry ]
%b.036 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %l, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr %r, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %b.036, i32 %1)
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%c.1 = call i32 @llvm.smin.i32(i32 %c.037, i32 %2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %m, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %4
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%5 = sub nsw i32 %c.1, %spec.select
%cmp16 = icmp sgt i32 %5, -1
br i1 %cmp16, label %if.then17, label %if.else
if.then17: ; preds = %entry, %for.end
%sub42 = phi i32 [ %5, %for.end ], [ 1000000, %entry ]
%add = add nuw nsw i32 %sub42, 1
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
br label %if.end21
if.else: ; preds = %for.end
%putchar = call i32 @putchar(i32 48)
br label %if.end21
if.end21: ; preds = %if.else, %if.then17
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %l) #5
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) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))
#define REP(i,n) for(i=0;i<n;i++)
int gcd(int a,int b);
int main(void)
{
int n,m;
scanf("%d%d",&n,&m);
//int a[100001]
int min=0,max=100000;
int i;
int l,r;
//
REP(i,m)
{
scanf("%d%d",&l,&r);
if(min<=l) min = l;
if(max>=r) max = r;
}
if(max-min+1<0) printf("0");
else printf("%d",max-min+1);
return 0;
}
int gcd(int a,int b)
{
int max,min,tmp;
max = MAX(a,b);
min = MIN(a,b);
if(max%min==0) return min;
else
{
tmp = min;
min = max%min;
max = tmp;
return gcd(max,min);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277650/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277650/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %if.else
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%max.021 = phi i32 [ %max.1, %for.body ], [ 100000, %entry ]
%min.020 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%1 = load i32, ptr %l, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %min.020, i32 %1)
%2 = load i32, ptr %r, align 4, !tbaa !5
%max.1 = call i32 @llvm.smin.i32(i32 %max.021, i32 %2)
%inc = add nuw nsw i32 %i.022, 1
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%4 = sub nsw i32 %max.1, %spec.select
%cmp6 = icmp slt i32 %4, -1
br i1 %cmp6, label %if.then7, label %if.else
if.then7: ; preds = %for.end
%putchar = call i32 @putchar(i32 48)
br label %if.end12
if.else: ; preds = %entry, %for.end
%sub26 = phi i32 [ %4, %for.end ], [ 100000, %entry ]
%add = add nsw i32 %sub26, 1
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end12
if.end12: ; preds = %if.else, %if.then7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #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) #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 nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i32 [ %a, %entry ], [ %cond5, %tailrecurse ]
%b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ]
%cond = tail call i32 @llvm.smax.i32(i32 %a.tr, i32 %b.tr)
%cond5 = tail call i32 @llvm.smin.i32(i32 %a.tr, i32 %b.tr)
%rem = srem i32 %cond, %cond5
%cmp6 = icmp eq i32 %rem, 0
br i1 %cmp6, label %cleanup, label %tailrecurse
cleanup: ; preds = %tailrecurse
ret i32 %cond5
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#define max(a,b) ((a)>(b)?(a):(b))
int main(){
int n,m,i,lr[100000][2],ans=0;
int imo[100000]={0};
scanf("%d%d",&n,&m);
for(i=0;i<m;i++){
scanf("%d%d",&lr[i][0],&lr[i][1]);
imo[lr[i][0]-1]++;
imo[lr[i][1]]--;
}
for(i=1;i<n+1;i++)imo[i]+=imo[i-1];
for(i=0;i<n;i++){
if(m==imo[i])ans++;
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277694/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277694/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%lr = alloca [100000 x [2 x i32]], align 16
%imo = alloca [100000 x i32], align 16
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 void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %lr) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %imo) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) %imo, i8 0, i64 400000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp54 = icmp sgt i32 %0, 0
br i1 %cmp54, label %for.body, label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.body, %entry
%.lcssa53 = phi i32 [ %0, %entry ], [ %10, %for.body ]
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp18.not56 = icmp slt i32 %1, 1
br i1 %cmp18.not56, label %for.end38, label %for.body19.preheader
for.body19.preheader: ; preds = %for.cond17.preheader
%2 = add nuw i32 %1, 1
%wide.trip.count = zext i32 %2 to i64
%.pre = load i32, ptr %imo, align 16, !tbaa !5
%3 = add nsw i64 %wide.trip.count, -1
%4 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %3, 3
%5 = icmp ult i64 %4, 3
br i1 %5, label %for.cond29.preheader.unr-lcssa, label %for.body19.preheader.new
for.body19.preheader.new: ; preds = %for.body19.preheader
%unroll_iter = and i64 %3, -4
br label %for.body19
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x [2 x i32]], ptr %lr, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [100000 x [2 x i32]], ptr %lr, i64 0, i64 %indvars.iv, i64 1
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%6 = load i32, ptr %arrayidx, align 8, !tbaa !5
%sub = add nsw i32 %6, -1
%idxprom9 = sext i32 %sub to i64
%arrayidx10 = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %idxprom9
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%inc = add nsw i32 %7, 1
store i32 %inc, ptr %arrayidx10, align 4, !tbaa !5
%8 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%idxprom14 = sext i32 %8 to i64
%arrayidx15 = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %idxprom14
%9 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%dec = add nsw i32 %9, -1
store i32 %dec, ptr %arrayidx15, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %m, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.cond17.preheader, !llvm.loop !9
for.cond29.preheader.unr-lcssa: ; preds = %for.body19, %for.body19.preheader
%.unr = phi i32 [ %.pre, %for.body19.preheader ], [ %add25.3, %for.body19 ]
%indvars.iv64.unr = phi i64 [ 1, %for.body19.preheader ], [ %indvars.iv.next65.3, %for.body19 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond29.preheader, label %for.body19.epil
for.body19.epil: ; preds = %for.cond29.preheader.unr-lcssa, %for.body19.epil
%12 = phi i32 [ %add25.epil, %for.body19.epil ], [ %.unr, %for.cond29.preheader.unr-lcssa ]
%indvars.iv64.epil = phi i64 [ %indvars.iv.next65.epil, %for.body19.epil ], [ %indvars.iv64.unr, %for.cond29.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body19.epil ], [ 0, %for.cond29.preheader.unr-lcssa ]
%arrayidx24.epil = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %indvars.iv64.epil
%13 = load i32, ptr %arrayidx24.epil, align 4, !tbaa !5
%add25.epil = add nsw i32 %13, %12
store i32 %add25.epil, ptr %arrayidx24.epil, align 4, !tbaa !5
%indvars.iv.next65.epil = add nuw nsw i64 %indvars.iv64.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.cond29.preheader, label %for.body19.epil, !llvm.loop !11
for.cond29.preheader: ; preds = %for.body19.epil, %for.cond29.preheader.unr-lcssa
%cmp3059 = icmp sgt i32 %1, 0
br i1 %cmp3059, label %for.body31.preheader, label %for.end38
for.body31.preheader: ; preds = %for.cond29.preheader
%wide.trip.count71 = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body31.preheader76, label %vector.ph
vector.ph: ; preds = %for.body31.preheader
%n.vec = and i64 %wide.trip.count71, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.lcssa53, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
%vec.phi74 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%14 = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %14, align 16, !tbaa !5
%15 = getelementptr inbounds i32, ptr %14, i64 4
%wide.load75 = load <4 x i32>, ptr %15, align 16, !tbaa !5
%16 = icmp eq <4 x i32> %broadcast.splat, %wide.load
%17 = icmp eq <4 x i32> %broadcast.splat, %wide.load75
%18 = zext <4 x i1> %16 to <4 x i32>
%19 = zext <4 x i1> %17 to <4 x i32>
%20 = add <4 x i32> %vec.phi, %18
%21 = add <4 x i32> %vec.phi74, %19
%index.next = add nuw i64 %index, 8
%22 = icmp eq i64 %index.next, %n.vec
br i1 %22, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %21, %20
%23 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count71
br i1 %cmp.n, label %for.end38, label %for.body31.preheader76
for.body31.preheader76: ; preds = %for.body31.preheader, %middle.block
%indvars.iv68.ph = phi i64 [ 0, %for.body31.preheader ], [ %n.vec, %middle.block ]
%ans.061.ph = phi i32 [ 0, %for.body31.preheader ], [ %23, %middle.block ]
br label %for.body31
for.body19: ; preds = %for.body19, %for.body19.preheader.new
%24 = phi i32 [ %.pre, %for.body19.preheader.new ], [ %add25.3, %for.body19 ]
%indvars.iv64 = phi i64 [ 1, %for.body19.preheader.new ], [ %indvars.iv.next65.3, %for.body19 ]
%niter = phi i64 [ 0, %for.body19.preheader.new ], [ %niter.next.3, %for.body19 ]
%arrayidx24 = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %indvars.iv64
%25 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%add25 = add nsw i32 %25, %24
store i32 %add25, ptr %arrayidx24, align 4, !tbaa !5
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%arrayidx24.1 = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %indvars.iv.next65
%26 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5
%add25.1 = add nsw i32 %26, %add25
store i32 %add25.1, ptr %arrayidx24.1, align 4, !tbaa !5
%indvars.iv.next65.1 = add nuw nsw i64 %indvars.iv64, 2
%arrayidx24.2 = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %indvars.iv.next65.1
%27 = load i32, ptr %arrayidx24.2, align 4, !tbaa !5
%add25.2 = add nsw i32 %27, %add25.1
store i32 %add25.2, ptr %arrayidx24.2, align 4, !tbaa !5
%indvars.iv.next65.2 = add nuw nsw i64 %indvars.iv64, 3
%arrayidx24.3 = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %indvars.iv.next65.2
%28 = load i32, ptr %arrayidx24.3, align 4, !tbaa !5
%add25.3 = add nsw i32 %28, %add25.2
store i32 %add25.3, ptr %arrayidx24.3, align 4, !tbaa !5
%indvars.iv.next65.3 = add nuw nsw i64 %indvars.iv64, 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.cond29.preheader.unr-lcssa, label %for.body19, !llvm.loop !16
for.body31: ; preds = %for.body31.preheader76, %for.body31
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.body31 ], [ %indvars.iv68.ph, %for.body31.preheader76 ]
%ans.061 = phi i32 [ %spec.select, %for.body31 ], [ %ans.061.ph, %for.body31.preheader76 ]
%arrayidx33 = getelementptr inbounds [100000 x i32], ptr %imo, i64 0, i64 %indvars.iv68
%29 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%cmp34 = icmp eq i32 %.lcssa53, %29
%inc35 = zext i1 %cmp34 to i32
%spec.select = add nuw nsw i32 %ans.061, %inc35
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond72.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count71
br i1 %exitcond72.not, label %for.end38, label %for.body31, !llvm.loop !17
for.end38: ; preds = %for.body31, %middle.block, %for.cond17.preheader, %for.cond29.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond29.preheader ], [ 0, %for.cond17.preheader ], [ %23, %middle.block ], [ %spec.select, %for.body31 ]
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %imo) #5
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %lr) #5
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) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15, !14}
|
#include <stdio.h>
#include <stdlib.h>
#define HASH 1000003
typedef struct List {
struct List *next;
char *s;
int l;
} list;
long long div_mod(long long x, long long y, long long z)
{
if (x % y == 0) return x / y;
else return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y;
}
long long pow_mod(int n, int k)
{
if (k == 0 || n == 1) return 1;
int i;
long long N;
for (i = 1, N = n; i * 2 <= k; i *= 2) N = N * N % HASH;
return N * pow_mod(n, k - i) % HASH;
}
int hash_string(char* s)
{
int i, x = 0;
for (i = 0; s[i] != 0; i++) x = ((x << 5) + s[i] - 'a') % HASH;
return x;
}
int lex_smaller(char* s1, char* s2)
{
int i;
for (i = 0; s1[i] != 0 && s2[i] != 0; i++) {
if (s1[i] < s2[i]) return 1;
else if (s1[i] > s2[i]) return -1;
}
if (s1[i] == s2[i]) return 0;
else if (s1[i] == 0) return 1;
else return -1;
}
int main()
{
int i, j, l[200001], N;
char *S[200001], T[1000001];
scanf("%d", &N);
for (i = 1; i <= N; i++) {
scanf("%s", T);
for (l[i] = 0; T[l[i]] != 0; l[i]++);
S[i] = (char*)malloc(sizeof(char) * (l[i] + 1));
for (j = 0; j <= l[i]; j++) S[i][j] = T[j];
}
int h, H;
list *p, *hash[HASH], d[200001];
for (i = 1; i <= N; i++) {
h = hash_string(S[i]);
d[i].s = S[i];
d[i].l = l[i];
d[i].next = hash[h];
hash[h] = &(d[i]);
}
int k, dp[26];
long long ans = 0, tmp;
for (i = 1; i <= N; i++) {
if (l[i] <= 1) continue;
for (j = 0; j <= l[i]; j++) T[j] = S[i][j];
h = hash_string(&(T[2]));
tmp = pow_mod(32, l[i] - 2);
for (j = 0; j < 26; j++) dp[j] = 0;
dp[S[i][0] - 'a'] = 1;
for (j = 1; j < l[i]; j++) {
dp[S[i][j] - 'a'] = 1;
for (k = 0; k < 26; k++) {
if (dp[k] == 0) continue;
T[j] = 'a' + k;
H = (tmp * k + h) % HASH;
for (p = hash[H]; p != NULL; p = p->next) if (p->l == l[i] - j && lex_smaller(&(T[j]), p->s) == 0) break;
if (p != NULL) ans++;
}
tmp = div_mod(tmp, 32, HASH);
h = ((h - tmp * (S[i][j+1] - 'a')) % HASH + HASH) % HASH;
}
}
printf("%lld\n", ans);
fflush(stdout);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277751/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277751/source.c"
target datalayout = "e-m:e-p270: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.List = type { ptr, ptr, i32 }
@.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 [6 x i8] c"%lld\0A\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @div_mod(i64 noundef %x, i64 noundef %y, i64 noundef %z) local_unnamed_addr #0 {
entry:
%rem = srem i64 %x, %y
%div1 = sdiv i64 %x, %y
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %return, label %if.else
if.else: ; preds = %entry
%add = add nsw i64 %div1, 1
%mul = mul nsw i64 %add, %y
%sub = sub nsw i64 %mul, %x
%rem2 = srem i64 %z, %y
%call = tail call i64 @div_mod(i64 noundef %sub, i64 noundef %rem2, i64 noundef %y)
%mul3 = mul nsw i64 %call, %z
%add4 = add nsw i64 %mul3, %x
br label %return
return: ; preds = %entry, %if.else
%x.pn = phi i64 [ %add4, %if.else ], [ %x, %entry ]
%retval.0 = sdiv i64 %x.pn, %y
ret i64 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @pow_mod(i32 noundef %n, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %k, 0
%cmp1 = icmp eq i32 %n, 1
%or.cond = or i1 %cmp1, %cmp
br i1 %or.cond, label %common.ret20, label %if.end
if.end: ; preds = %entry
%conv = sext i32 %n to i64
%cmp2.not16 = icmp slt i32 %k, 2
br i1 %cmp2.not16, label %for.end, label %for.body
for.body: ; preds = %if.end, %for.body
%mul18 = phi i32 [ %mul, %for.body ], [ 2, %if.end ]
%N.017 = phi i64 [ %rem, %for.body ], [ %conv, %if.end ]
%mul4 = mul nsw i64 %N.017, %N.017
%rem = urem i64 %mul4, 1000003
%mul = shl nsw i32 %mul18, 1
%cmp2.not = icmp sgt i32 %mul, %k
br i1 %cmp2.not, label %for.end, label %for.body, !llvm.loop !5
common.ret20: ; preds = %entry, %for.end
%common.ret20.op = phi i64 [ %rem7, %for.end ], [ 1, %entry ]
ret i64 %common.ret20.op
for.end: ; preds = %for.body, %if.end
%i.0.lcssa = phi i32 [ 1, %if.end ], [ %mul18, %for.body ]
%N.0.lcssa = phi i64 [ %conv, %if.end ], [ %rem, %for.body ]
%sub = sub nsw i32 %k, %i.0.lcssa
%call = tail call i64 @pow_mod(i32 noundef %n, i32 noundef %sub), !range !7
%mul6 = mul nsw i64 %call, %N.0.lcssa
%rem7 = srem i64 %mul6, 1000003
br label %common.ret20
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @hash_string(ptr nocapture noundef readonly %s) local_unnamed_addr #2 {
entry:
%0 = load i8, ptr %s, align 1, !tbaa !8
%cmp.not9 = icmp eq i8 %0, 0
br i1 %cmp.not9, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%1 = phi i8 [ %2, %for.body ], [ %0, %entry ]
%x.011 = phi i32 [ %rem, %for.body ], [ 0, %entry ]
%conv = sext i8 %1 to i32
%shl = shl nsw i32 %x.011, 5
%add = add nsw i32 %shl, -97
%sub = add nsw i32 %add, %conv
%rem = srem i32 %sub, 1000003
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !8
%cmp.not = icmp eq i8 %2, 0
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%x.0.lcssa = phi i32 [ 0, %entry ], [ %rem, %for.body ]
ret i32 %x.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @lex_smaller(ptr nocapture noundef readonly %s1, ptr nocapture noundef readonly %s2) local_unnamed_addr #2 {
entry:
%0 = load i8, ptr %s1, align 1, !tbaa !8
%cmp.not60 = icmp eq i8 %0, 0
br i1 %cmp.not60, label %for.end, label %land.rhs
for.cond: ; preds = %if.else
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %s1, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !8
%cmp.not = icmp eq i8 %1, 0
br i1 %cmp.not, label %for.end, label %land.rhs, !llvm.loop !12
land.rhs: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%2 = phi i8 [ %1, %for.cond ], [ %0, %entry ]
%arrayidx3 = getelementptr inbounds i8, ptr %s2, i64 %indvars.iv
%3 = load i8, ptr %arrayidx3, align 1, !tbaa !8
%cmp5.not = icmp eq i8 %3, 0
br i1 %cmp5.not, label %for.end, label %for.body
for.body: ; preds = %land.rhs
%cmp13 = icmp slt i8 %2, %3
br i1 %cmp13, label %cleanup, label %if.else
if.else: ; preds = %for.body
%cmp21 = icmp sgt i8 %2, %3
br i1 %cmp21, label %cleanup, label %for.cond
for.end: ; preds = %land.rhs, %for.cond, %entry
%idxprom.lcssa = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond ], [ %indvars.iv, %land.rhs ]
%.lcssa = phi i8 [ 0, %entry ], [ 0, %for.cond ], [ %2, %land.rhs ]
%. = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ -1, %land.rhs ]
%arrayidx29 = getelementptr inbounds i8, ptr %s2, i64 %idxprom.lcssa
%4 = load i8, ptr %arrayidx29, align 1, !tbaa !8
%cmp31 = icmp eq i8 %.lcssa, %4
%spec.select = select i1 %cmp31, i32 0, i32 %.
br label %cleanup
cleanup: ; preds = %if.else, %for.body, %for.end
%retval.0 = phi i32 [ %spec.select, %for.end ], [ -1, %if.else ], [ 1, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%l = alloca [200001 x i32], align 16
%N = alloca i32, align 4
%S = alloca [200001 x ptr], align 16
%T = alloca [1000001 x i8], align 16
%T343 = ptrtoint ptr %T to i64
%hash = alloca [1000003 x ptr], align 16
%d = alloca [200001 x %struct.List], align 16
%dp = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %l) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #8
call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %S) #8
call void @llvm.lifetime.start.p0(i64 1000001, ptr nonnull %T) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !13
%cmp.not277 = icmp slt i32 %0, 1
br i1 %cmp.not277, label %for.end35.thread, label %for.body
for.end35.thread: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 8000024, ptr nonnull %hash) #8
call void @llvm.lifetime.start.p0(i64 4800024, ptr nonnull %d) #8
br label %for.end62.thread
for.body: ; preds = %entry, %for.end
%indvars.iv306 = phi i64 [ %indvars.iv.next307, %for.end ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %T)
br label %for.cond2
for.cond2: ; preds = %for.cond2, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond2 ], [ 0, %for.body ]
%arrayidx6 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx6, align 1, !tbaa !8
%cmp7.not = icmp eq i8 %1, 0
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp7.not, label %for.end, label %for.cond2, !llvm.loop !15
for.end: ; preds = %for.cond2
%arrayidx = getelementptr inbounds [200001 x i32], ptr %l, i64 0, i64 %indvars.iv306
%2 = trunc i64 %indvars.iv to i32
store i32 %2, ptr %arrayidx, align 4, !tbaa !13
%add = add i64 %indvars.iv, 1
%conv14 = and i64 %add, 4294967295
%call15 = call noalias ptr @malloc(i64 noundef %conv14) #9
%arrayidx17 = getelementptr inbounds [200001 x ptr], ptr %S, i64 0, i64 %indvars.iv306
store ptr %call15, ptr %arrayidx17, align 8, !tbaa !16
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %call15, ptr nonnull align 16 %T, i64 %indvars.iv.next, i1 false), !tbaa !8
%indvars.iv.next307 = add nuw nsw i64 %indvars.iv306, 1
%3 = load i32, ptr %N, align 4, !tbaa !13
%4 = sext i32 %3 to i64
%cmp.not.not = icmp slt i64 %indvars.iv306, %4
br i1 %cmp.not.not, label %for.body, label %for.end35, !llvm.loop !18
for.end35: ; preds = %for.end
call void @llvm.lifetime.start.p0(i64 8000024, ptr nonnull %hash) #8
call void @llvm.lifetime.start.p0(i64 4800024, ptr nonnull %d) #8
%cmp37.not279 = icmp slt i32 %3, 1
br i1 %cmp37.not279, label %for.end62.thread, label %for.body39.preheader
for.body39.preheader: ; preds = %for.end35
%5 = add nuw i32 %3, 1
%wide.trip.count = zext i32 %5 to i64
br label %for.body39
for.body39: ; preds = %for.body39.preheader, %hash_string.exit
%indvars.iv309 = phi i64 [ 1, %for.body39.preheader ], [ %indvars.iv.next310, %hash_string.exit ]
%arrayidx41 = getelementptr inbounds [200001 x ptr], ptr %S, i64 0, i64 %indvars.iv309
%6 = load ptr, ptr %arrayidx41, align 8, !tbaa !16
%7 = load i8, ptr %6, align 1, !tbaa !8
%cmp.not9.i = icmp eq i8 %7, 0
br i1 %cmp.not9.i, label %hash_string.exit, label %for.body.i
for.body.i: ; preds = %for.body39, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %for.body39 ]
%8 = phi i8 [ %9, %for.body.i ], [ %7, %for.body39 ]
%x.011.i = phi i32 [ %rem.i, %for.body.i ], [ 0, %for.body39 ]
%conv.i = sext i8 %8 to i32
%shl.i = shl nsw i32 %x.011.i, 5
%add.i = add nsw i32 %conv.i, -97
%sub.i = add nsw i32 %add.i, %shl.i
%rem.i = srem i32 %sub.i, 1000003
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds i8, ptr %6, i64 %indvars.iv.next.i
%9 = load i8, ptr %arrayidx.i, align 1, !tbaa !8
%cmp.not.i = icmp eq i8 %9, 0
br i1 %cmp.not.i, label %hash_string.exit, label %for.body.i, !llvm.loop !11
hash_string.exit: ; preds = %for.body.i, %for.body39
%x.0.lcssa.i = phi i32 [ 0, %for.body39 ], [ %rem.i, %for.body.i ]
%arrayidx46 = getelementptr inbounds [200001 x %struct.List], ptr %d, i64 0, i64 %indvars.iv309
%s = getelementptr inbounds [200001 x %struct.List], ptr %d, i64 0, i64 %indvars.iv309, i32 1
store ptr %6, ptr %s, align 8, !tbaa !19
%arrayidx48 = getelementptr inbounds [200001 x i32], ptr %l, i64 0, i64 %indvars.iv309
%10 = load i32, ptr %arrayidx48, align 4, !tbaa !13
%l51 = getelementptr inbounds [200001 x %struct.List], ptr %d, i64 0, i64 %indvars.iv309, i32 2
store i32 %10, ptr %l51, align 8, !tbaa !21
%idxprom52 = sext i32 %x.0.lcssa.i to i64
%arrayidx53 = getelementptr inbounds [1000003 x ptr], ptr %hash, i64 0, i64 %idxprom52
%11 = load ptr, ptr %arrayidx53, align 8, !tbaa !16
store ptr %11, ptr %arrayidx46, align 8, !tbaa !22
store ptr %arrayidx46, ptr %arrayidx53, align 8, !tbaa !16
%indvars.iv.next310 = add nuw nsw i64 %indvars.iv309, 1
%exitcond.not = icmp eq i64 %indvars.iv.next310, %wide.trip.count
br i1 %exitcond.not, label %for.end62, label %for.body39, !llvm.loop !23
for.end62.thread: ; preds = %for.end35.thread, %for.end35
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %dp) #8
br label %for.end192
for.end62: ; preds = %hash_string.exit
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %dp) #8
br i1 %cmp37.not279, label %for.end192, label %for.body66.lr.ph
for.body66.lr.ph: ; preds = %for.end62
%arrayidx86 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 2
%12 = add nuw i32 %3, 1
%wide.trip.count332 = zext i32 %12 to i64
br label %for.body66
for.body66: ; preds = %for.body66.lr.ph, %for.inc190
%indvars.iv329 = phi i64 [ 1, %for.body66.lr.ph ], [ %indvars.iv.next330, %for.inc190 ]
%ans.0299 = phi i64 [ 0, %for.body66.lr.ph ], [ %ans.4, %for.inc190 ]
%arrayidx68 = getelementptr inbounds [200001 x i32], ptr %l, i64 0, i64 %indvars.iv329
%13 = load i32, ptr %arrayidx68, align 4, !tbaa !13
%cmp69 = icmp slt i32 %13, 2
br i1 %cmp69, label %for.inc190, label %iter.check
iter.check: ; preds = %for.body66
%arrayidx78 = getelementptr inbounds [200001 x ptr], ptr %S, i64 0, i64 %indvars.iv329
%14 = load ptr, ptr %arrayidx78, align 8, !tbaa !16
%15 = add i32 %13, 1
%wide.trip.count315 = zext i32 %15 to i64
%min.iters.check = icmp ult i32 %13, 7
%16 = ptrtoint ptr %14 to i64
%17 = sub i64 %T343, %16
%diff.check = icmp ult i64 %17, 32
%or.cond353 = select i1 %min.iters.check, i1 true, i1 %diff.check
br i1 %or.cond353, label %for.body76.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check344 = icmp ult i32 %13, 31
br i1 %min.iters.check344, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %wide.trip.count315, 4294967264
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%18 = getelementptr inbounds i8, ptr %14, i64 %index
%wide.load = load <16 x i8>, ptr %18, align 1, !tbaa !8
%19 = getelementptr inbounds i8, ptr %18, i64 16
%wide.load345 = load <16 x i8>, ptr %19, align 1, !tbaa !8
%20 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %index
store <16 x i8> %wide.load, ptr %20, align 16, !tbaa !8
%21 = getelementptr inbounds i8, ptr %20, i64 16
store <16 x i8> %wide.load345, ptr %21, align 16, !tbaa !8
%index.next = add nuw i64 %index, 32
%22 = icmp eq i64 %index.next, %n.vec
br i1 %22, label %middle.block, label %vector.body, !llvm.loop !24
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count315
br i1 %cmp.n, label %for.end85, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%n.vec.remaining = and i64 %wide.trip.count315, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body76.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.vec347 = and i64 %wide.trip.count315, 4294967288
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index349 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next351, %vec.epilog.vector.body ]
%23 = getelementptr inbounds i8, ptr %14, i64 %index349
%wide.load350 = load <8 x i8>, ptr %23, align 1, !tbaa !8
%24 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %index349
store <8 x i8> %wide.load350, ptr %24, align 8, !tbaa !8
%index.next351 = add nuw i64 %index349, 8
%25 = icmp eq i64 %index.next351, %n.vec347
br i1 %25, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !27
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n348 = icmp eq i64 %n.vec347, %wide.trip.count315
br i1 %cmp.n348, label %for.end85, label %for.body76.preheader
for.body76.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv312.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec347, %vec.epilog.middle.block ]
%26 = xor i64 %indvars.iv312.ph, -1
%27 = add nsw i64 %26, %wide.trip.count315
%xtraiter = and i64 %wide.trip.count315, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body76.prol.loopexit, label %for.body76.prol
for.body76.prol: ; preds = %for.body76.preheader, %for.body76.prol
%indvars.iv312.prol = phi i64 [ %indvars.iv.next313.prol, %for.body76.prol ], [ %indvars.iv312.ph, %for.body76.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body76.prol ], [ 0, %for.body76.preheader ]
%arrayidx80.prol = getelementptr inbounds i8, ptr %14, i64 %indvars.iv312.prol
%28 = load i8, ptr %arrayidx80.prol, align 1, !tbaa !8
%arrayidx82.prol = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %indvars.iv312.prol
store i8 %28, ptr %arrayidx82.prol, align 1, !tbaa !8
%indvars.iv.next313.prol = add nuw nsw i64 %indvars.iv312.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.body76.prol.loopexit, label %for.body76.prol, !llvm.loop !28
for.body76.prol.loopexit: ; preds = %for.body76.prol, %for.body76.preheader
%indvars.iv312.unr = phi i64 [ %indvars.iv312.ph, %for.body76.preheader ], [ %indvars.iv.next313.prol, %for.body76.prol ]
%29 = icmp ult i64 %27, 3
br i1 %29, label %for.end85, label %for.body76
for.body76: ; preds = %for.body76.prol.loopexit, %for.body76
%indvars.iv312 = phi i64 [ %indvars.iv.next313.3, %for.body76 ], [ %indvars.iv312.unr, %for.body76.prol.loopexit ]
%arrayidx80 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv312
%30 = load i8, ptr %arrayidx80, align 1, !tbaa !8
%arrayidx82 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %indvars.iv312
store i8 %30, ptr %arrayidx82, align 1, !tbaa !8
%indvars.iv.next313 = add nuw nsw i64 %indvars.iv312, 1
%arrayidx80.1 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv.next313
%31 = load i8, ptr %arrayidx80.1, align 1, !tbaa !8
%arrayidx82.1 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %indvars.iv.next313
store i8 %31, ptr %arrayidx82.1, align 1, !tbaa !8
%indvars.iv.next313.1 = add nuw nsw i64 %indvars.iv312, 2
%arrayidx80.2 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv.next313.1
%32 = load i8, ptr %arrayidx80.2, align 1, !tbaa !8
%arrayidx82.2 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %indvars.iv.next313.1
store i8 %32, ptr %arrayidx82.2, align 1, !tbaa !8
%indvars.iv.next313.2 = add nuw nsw i64 %indvars.iv312, 3
%arrayidx80.3 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv.next313.2
%33 = load i8, ptr %arrayidx80.3, align 1, !tbaa !8
%arrayidx82.3 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %indvars.iv.next313.2
store i8 %33, ptr %arrayidx82.3, align 1, !tbaa !8
%indvars.iv.next313.3 = add nuw nsw i64 %indvars.iv312, 4
%exitcond316.not.3 = icmp eq i64 %indvars.iv.next313.3, %wide.trip.count315
br i1 %exitcond316.not.3, label %for.end85, label %for.body76, !llvm.loop !30
for.end85: ; preds = %for.body76.prol.loopexit, %for.body76, %vec.epilog.middle.block, %middle.block
%34 = load i8, ptr %arrayidx86, align 2, !tbaa !8
%cmp.not9.i254 = icmp eq i8 %34, 0
br i1 %cmp.not9.i254, label %hash_string.exit267, label %for.body.i255
for.body.i255: ; preds = %for.end85, %for.body.i255
%indvars.iv.i256 = phi i64 [ %indvars.iv.next.i263, %for.body.i255 ], [ 0, %for.end85 ]
%35 = phi i8 [ %36, %for.body.i255 ], [ %34, %for.end85 ]
%x.011.i257 = phi i32 [ %rem.i262, %for.body.i255 ], [ 0, %for.end85 ]
%conv.i258 = sext i8 %35 to i32
%shl.i259 = shl nsw i32 %x.011.i257, 5
%add.i260 = add nsw i32 %conv.i258, -97
%sub.i261 = add nsw i32 %add.i260, %shl.i259
%rem.i262 = srem i32 %sub.i261, 1000003
%indvars.iv.next.i263 = add nuw nsw i64 %indvars.iv.i256, 1
%arrayidx.i264 = getelementptr inbounds i8, ptr %arrayidx86, i64 %indvars.iv.next.i263
%36 = load i8, ptr %arrayidx.i264, align 1, !tbaa !8
%cmp.not.i265 = icmp eq i8 %36, 0
br i1 %cmp.not.i265, label %hash_string.exit267, label %for.body.i255, !llvm.loop !11
hash_string.exit267: ; preds = %for.body.i255, %for.end85
%x.0.lcssa.i266 = phi i32 [ 0, %for.end85 ], [ %rem.i262, %for.body.i255 ]
%sub = add nsw i32 %13, -2
%call90 = call i64 @pow_mod(i32 noundef 32, i32 noundef %sub), !range !7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %dp, i8 0, i64 104, i1 false), !tbaa !13
%37 = load i8, ptr %14, align 1, !tbaa !8
%conv103 = sext i8 %37 to i64
%sub104 = add nsw i64 %conv103, -97
%arrayidx106 = getelementptr inbounds [26 x i32], ptr %dp, i64 0, i64 %sub104
store i32 1, ptr %arrayidx106, align 4, !tbaa !13
%cmp110291 = icmp sgt i32 %13, 1
br i1 %cmp110291, label %for.body112.preheader, label %for.inc190
for.body112.preheader: ; preds = %hash_string.exit267
%wide.trip.count327 = zext i32 %13 to i64
%arrayidx116.phi.trans.insert = getelementptr inbounds i8, ptr %14, i64 1
%.pre = load i8, ptr %arrayidx116.phi.trans.insert, align 1, !tbaa !8
br label %for.body112
for.body112: ; preds = %for.body112.preheader, %for.end170
%38 = phi i8 [ %.pre, %for.body112.preheader ], [ %46, %for.end170 ]
%indvars.iv324 = phi i64 [ 1, %for.body112.preheader ], [ %indvars.iv.next325, %for.end170 ]
%tmp.0295 = phi i64 [ %call90, %for.body112.preheader ], [ %call171, %for.end170 ]
%ans.1294 = phi i64 [ %ans.0299, %for.body112.preheader ], [ %ans.3, %for.end170 ]
%h.0293 = phi i32 [ %x.0.lcssa.i266, %for.body112.preheader ], [ %conv186, %for.end170 ]
%indvars326 = trunc i64 %indvars.iv324 to i32
%conv117 = sext i8 %38 to i64
%sub118 = add nsw i64 %conv117, -97
%arrayidx120 = getelementptr inbounds [26 x i32], ptr %dp, i64 0, i64 %sub118
store i32 1, ptr %arrayidx120, align 4, !tbaa !13
%arrayidx134 = getelementptr inbounds [1000001 x i8], ptr %T, i64 0, i64 %indvars.iv324
%conv137 = sext i32 %h.0293 to i64
%sub149 = sub nsw i32 %13, %indvars326
br label %for.body124
for.body124: ; preds = %for.body112, %for.inc168
%indvars.iv320 = phi i64 [ 0, %for.body112 ], [ %indvars.iv.next321, %for.inc168 ]
%ans.2290 = phi i64 [ %ans.1294, %for.body112 ], [ %ans.3, %for.inc168 ]
%arrayidx126 = getelementptr inbounds [26 x i32], ptr %dp, i64 0, i64 %indvars.iv320
%39 = load i32, ptr %arrayidx126, align 4, !tbaa !13
%cmp127 = icmp eq i32 %39, 0
br i1 %cmp127, label %for.inc168, label %if.end130
if.end130: ; preds = %for.body124
%40 = trunc i64 %indvars.iv320 to i8
%conv132 = add nuw nsw i8 %40, 97
store i8 %conv132, ptr %arrayidx134, align 1, !tbaa !8
%mul136 = mul nsw i64 %tmp.0295, %indvars.iv320
%add138 = add nsw i64 %mul136, %conv137
%rem = srem i64 %add138, 1000003
%arrayidx141 = getelementptr inbounds [1000003 x ptr], ptr %hash, i64 0, i64 %rem
%p.0283 = load ptr, ptr %arrayidx141, align 8, !tbaa !16
%cmp143.not284.not = icmp eq ptr %p.0283, null
br i1 %cmp143.not284.not, label %for.end162, label %for.body145
for.body145: ; preds = %if.end130, %for.inc160
%p.0285 = phi ptr [ %p.0, %for.inc160 ], [ %p.0283, %if.end130 ]
%l146 = getelementptr inbounds %struct.List, ptr %p.0285, i64 0, i32 2
%41 = load i32, ptr %l146, align 8, !tbaa !21
%cmp150 = icmp eq i32 %41, %sub149
br i1 %cmp150, label %land.lhs.true, label %for.inc160
land.lhs.true: ; preds = %for.body145
%s154 = getelementptr inbounds %struct.List, ptr %p.0285, i64 0, i32 1
%42 = load ptr, ptr %s154, align 8, !tbaa !19
br label %land.rhs.i
for.cond.i: ; preds = %land.rhs.i
%indvars.iv.next.i270 = add nuw i64 %indvars.iv.i268, 1
%arrayidx.i271 = getelementptr inbounds i8, ptr %arrayidx134, i64 %indvars.iv.next.i270
%43 = load i8, ptr %arrayidx.i271, align 1, !tbaa !8
%cmp.not.i272 = icmp eq i8 %43, 0
br i1 %cmp.not.i272, label %for.end.i, label %land.rhs.i, !llvm.loop !12
land.rhs.i: ; preds = %land.lhs.true, %for.cond.i
%indvars.iv.i268 = phi i64 [ %indvars.iv.next.i270, %for.cond.i ], [ 0, %land.lhs.true ]
%44 = phi i8 [ %43, %for.cond.i ], [ %conv132, %land.lhs.true ]
%arrayidx3.i = getelementptr inbounds i8, ptr %42, i64 %indvars.iv.i268
%45 = load i8, ptr %arrayidx3.i, align 1, !tbaa !8
%cmp5.not.i = icmp ne i8 %45, 0
%or.cond.not = icmp eq i8 %44, %45
%or.cond = select i1 %cmp5.not.i, i1 %or.cond.not, i1 false
br i1 %or.cond, label %for.cond.i, label %for.inc160
for.end.i: ; preds = %for.cond.i
%arrayidx29.i.phi.trans.insert = getelementptr inbounds i8, ptr %42, i64 %indvars.iv.next.i270
%.pre334 = load i8, ptr %arrayidx29.i.phi.trans.insert, align 1, !tbaa !8
%cmp31.i = icmp eq i8 %.pre334, 0
br i1 %cmp31.i, label %for.end162, label %for.inc160
for.inc160: ; preds = %land.rhs.i, %for.end.i, %for.body145
%p.0 = load ptr, ptr %p.0285, align 8, !tbaa !16
%cmp143.not.not = icmp eq ptr %p.0, null
br i1 %cmp143.not.not, label %for.end162, label %for.body145, !llvm.loop !31
for.end162: ; preds = %for.inc160, %for.end.i, %if.end130
%cmp143.not.lcssa = phi i64 [ 0, %if.end130 ], [ 1, %for.end.i ], [ 0, %for.inc160 ]
%spec.select = add nsw i64 %ans.2290, %cmp143.not.lcssa
br label %for.inc168
for.inc168: ; preds = %for.end162, %for.body124
%ans.3 = phi i64 [ %ans.2290, %for.body124 ], [ %spec.select, %for.end162 ]
%indvars.iv.next321 = add nuw nsw i64 %indvars.iv320, 1
%exitcond323.not = icmp eq i64 %indvars.iv.next321, 26
br i1 %exitcond323.not, label %for.end170, label %for.body124, !llvm.loop !32
for.end170: ; preds = %for.inc168
%call171 = call i64 @div_mod(i64 noundef %tmp.0295, i64 noundef 32, i64 noundef 1000003)
%indvars.iv.next325 = add nuw nsw i64 %indvars.iv324, 1
%arrayidx177 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv.next325
%46 = load i8, ptr %arrayidx177, align 1, !tbaa !8
%conv178 = sext i8 %46 to i64
%sub179 = add nsw i64 %conv178, -97
%mul181 = mul nsw i64 %sub179, %call171
%sub182 = sub nsw i64 %conv137, %mul181
%sub182.fr = freeze i64 %sub182
%rem183 = srem i64 %sub182.fr, 1000003
%add184 = add nsw i64 %rem183, 1000003
%rem185.cmp = icmp ugt i64 %rem183, -1000004
%rem185 = select i1 %rem185.cmp, i64 %add184, i64 %rem183
%conv186 = trunc i64 %rem185 to i32
%exitcond328.not = icmp eq i64 %indvars.iv.next325, %wide.trip.count327
br i1 %exitcond328.not, label %for.inc190, label %for.body112, !llvm.loop !33
for.inc190: ; preds = %for.end170, %hash_string.exit267, %for.body66
%ans.4 = phi i64 [ %ans.0299, %for.body66 ], [ %ans.0299, %hash_string.exit267 ], [ %ans.3, %for.end170 ]
%indvars.iv.next330 = add nuw nsw i64 %indvars.iv329, 1
%exitcond333.not = icmp eq i64 %indvars.iv.next330, %wide.trip.count332
br i1 %exitcond333.not, label %for.end192, label %for.body66, !llvm.loop !34
for.end192: ; preds = %for.inc190, %for.end62.thread, %for.end62
%ans.0.lcssa = phi i64 [ 0, %for.end62 ], [ 0, %for.end62.thread ], [ %ans.4, %for.inc190 ]
%call193 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
%47 = load ptr, ptr @stdout, align 8, !tbaa !16
%call194 = call i32 @fflush(ptr noundef %47)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %dp) #8
call void @llvm.lifetime.end.p0(i64 4800024, ptr nonnull %d) #8
call void @llvm.lifetime.end.p0(i64 8000024, ptr nonnull %hash) #8
call void @llvm.lifetime.end.p0(i64 1000001, ptr nonnull %T) #8
call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #8
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %l) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 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 @fflush(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{i64 -1000002, i64 1000003}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !9, i64 0}
!15 = distinct !{!15, !6}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !9, i64 0}
!18 = distinct !{!18, !6}
!19 = !{!20, !17, i64 8}
!20 = !{!"List", !17, i64 0, !17, i64 8, !14, i64 16}
!21 = !{!20, !14, i64 16}
!22 = !{!20, !17, i64 0}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6, !25, !26}
!25 = !{!"llvm.loop.isvectorized", i32 1}
!26 = !{!"llvm.loop.unroll.runtime.disable"}
!27 = distinct !{!27, !6, !25, !26}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.unroll.disable"}
!30 = distinct !{!30, !6, !25}
!31 = distinct !{!31, !6}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !6}
|
#include <stdio.h>
int main(){
int n;
int i, j;
int p[10001] = {};
p[0] = p[1] = 1;
for(i = 2 ;i < 10001 ; i++){
if(p[i] != 1)
for(j = 2 * i ; j < 10001 ; j += i){
p[j] = 1;
}
}
while(1){
scanf("%d",&n);
if( n == 0 ){
break;
}
for(i = n ; i >= 0 ; i--)
if(p[i] != 1 && p[i - 2] != 1){
break;
}
printf("%d %d\n", i - 2, i);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277795/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277795/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%p = alloca [10001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %p) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40004) %p, i8 0, i64 40004, i1 false)
%arrayidx = getelementptr inbounds [10001 x i32], ptr %p, i64 0, i64 1
store i32 1, ptr %arrayidx, align 4, !tbaa !5
store i32 1, ptr %p, align 16, !tbaa !5
br label %for.body
while.cond.preheader: ; preds = %for.inc9
%call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp1149 = icmp eq i32 %0, 0
br i1 %cmp1149, label %while.end, label %for.cond14.preheader
for.body: ; preds = %entry, %for.inc9
%indvars.iv50 = phi i64 [ 2, %entry ], [ %indvars.iv.next51, %for.inc9 ]
%indvars.iv = phi i64 [ 4, %entry ], [ %indvars.iv.next, %for.inc9 ]
%arrayidx2 = getelementptr inbounds [10001 x i32], ptr %p, i64 0, i64 %indvars.iv50
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp ne i32 %1, 1
%cmp541 = icmp ult i64 %indvars.iv50, 5001
%or.cond = and i1 %cmp3.not, %cmp541
br i1 %or.cond, label %for.body6, label %for.inc9
for.body6: ; preds = %for.body, %for.body6
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body6 ], [ %indvars.iv, %for.body ]
%arrayidx8 = getelementptr inbounds [10001 x i32], ptr %p, i64 0, i64 %indvars.iv52
store i32 1, ptr %arrayidx8, align 4, !tbaa !5
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, %indvars.iv50
%cmp5 = icmp ult i64 %indvars.iv.next53, 10001
br i1 %cmp5, label %for.body6, label %for.inc9, !llvm.loop !9
for.inc9: ; preds = %for.body6, %for.body
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
%exitcond.not = icmp eq i64 %indvars.iv.next51, 10001
br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !11
for.cond14.preheader: ; preds = %while.cond.preheader, %for.end26
%2 = phi i32 [ %8, %for.end26 ], [ %0, %while.cond.preheader ]
%cmp1545 = icmp sgt i32 %2, -1
br i1 %cmp1545, label %for.body16.preheader, label %for.end26
for.body16.preheader: ; preds = %for.cond14.preheader
%3 = zext i32 %2 to i64
br label %for.body16
for.body16: ; preds = %for.body16.preheader, %for.inc25
%indvars.iv56 = phi i64 [ %3, %for.body16.preheader ], [ %indvars.iv.next57, %for.inc25 ]
%arrayidx18 = getelementptr inbounds [10001 x i32], ptr %p, i64 0, i64 %indvars.iv56
%4 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%cmp19.not = icmp eq i32 %4, 1
br i1 %cmp19.not, label %for.inc25, label %land.lhs.true
land.lhs.true: ; preds = %for.body16
%5 = add nsw i64 %indvars.iv56, -2
%arrayidx21 = getelementptr inbounds [10001 x i32], ptr %p, i64 0, i64 %5
%6 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not = icmp eq i32 %6, 1
br i1 %cmp22.not, label %for.inc25, label %for.end26.loopexit.split.loop.exit
for.inc25: ; preds = %for.body16, %land.lhs.true
%indvars.iv.next57 = add nsw i64 %indvars.iv56, -1
%cmp15 = icmp sgt i64 %indvars.iv56, 0
br i1 %cmp15, label %for.body16, label %for.end26, !llvm.loop !12
for.end26.loopexit.split.loop.exit: ; preds = %land.lhs.true
%7 = trunc i64 %indvars.iv56 to i32
br label %for.end26
for.end26: ; preds = %for.inc25, %for.end26.loopexit.split.loop.exit, %for.cond14.preheader
%i.1.lcssa = phi i32 [ %2, %for.cond14.preheader ], [ %7, %for.end26.loopexit.split.loop.exit ], [ -1, %for.inc25 ]
%sub27 = add nsw i32 %i.1.lcssa, -2
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub27, i32 noundef %i.1.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp eq i32 %8, 0
br i1 %cmp11, label %while.end, label %for.cond14.preheader
while.end: ; preds = %for.end26, %while.cond.preheader
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<string.h>
int main(){
const int MAX_V=10000;
int prime[MAX_V+1];
int i,k,v,n,p1,q1;
for(i=2;i<=MAX_V;i++){
prime[i]=1;
}
for(i=2;i*i<=MAX_V;i++){
if(prime[i]){
for(k=2*i;k<=MAX_V;k+=i){
prime[k]=0;
}
}
}
prime[0]=0;
prime[1]=0;
while(1){
scanf("%d",&v);
if(v==0)break;
if(prime[v]==0){
while(1){
v--;
if(prime[v]==1)break;
}
}
p1=v;
q1=v;
for(i=v-1;i>0;i--){
if(prime[i]==1)q1=i;
if(p1-q1==2){
printf("%d %d\n",q1,p1);
break;
}else{
p1=q1;
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277838/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277838/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%v = alloca i32, align 4
%vla68 = alloca [10001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #3
br label %vector.body
vector.body: ; preds = %vector.body.1, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.3, %vector.body.1 ]
%offset.idx = or i64 %index, 2
%0 = getelementptr inbounds i32, ptr %vla68, i64 %offset.idx
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %1, align 8, !tbaa !5
%2 = icmp eq i64 %index, 9984
br i1 %2, label %for.body, label %vector.body.1, !llvm.loop !9
vector.body.1: ; preds = %vector.body
%offset.idx.1 = or i64 %index, 10
%3 = getelementptr inbounds i32, ptr %vla68, i64 %offset.idx.1
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 8, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %4, align 8, !tbaa !5
%offset.idx.2 = or i64 %index, 18
%5 = getelementptr inbounds i32, ptr %vla68, i64 %offset.idx.2
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %5, align 8, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %6, align 8, !tbaa !5
%offset.idx.3 = or i64 %index, 26
%7 = getelementptr inbounds i32, ptr %vla68, i64 %offset.idx.3
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %7, align 8, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 8, !tbaa !5
%index.next.3 = add nuw nsw i64 %index, 32
br label %vector.body
for.body: ; preds = %vector.body
%arrayidx = getelementptr inbounds i32, ptr %vla68, i64 9994
store i32 1, ptr %arrayidx, align 8, !tbaa !5
%arrayidx.1 = getelementptr inbounds i32, ptr %vla68, i64 9995
store i32 1, ptr %arrayidx.1, align 4, !tbaa !5
%arrayidx.2 = getelementptr inbounds i32, ptr %vla68, i64 9996
store i32 1, ptr %arrayidx.2, align 16, !tbaa !5
%arrayidx.3 = getelementptr inbounds i32, ptr %vla68, i64 9997
store i32 1, ptr %arrayidx.3, align 4, !tbaa !5
%arrayidx.4 = getelementptr inbounds i32, ptr %vla68, i64 9998
store i32 1, ptr %arrayidx.4, align 8, !tbaa !5
%arrayidx.5 = getelementptr inbounds i32, ptr %vla68, i64 9999
store i32 1, ptr %arrayidx.5, align 4, !tbaa !5
%arrayidx.6 = getelementptr inbounds i32, ptr %vla68, i64 10000
store i32 1, ptr %arrayidx.6, align 16, !tbaa !5
br label %for.body3
for.body3: ; preds = %for.inc14.1, %for.body
%indvars.iv81 = phi i64 [ 2, %for.body ], [ %indvars.iv.next82.1, %for.inc14.1 ]
%indvars.iv79 = phi i64 [ 4, %for.body ], [ %indvars.iv.next80.1, %for.inc14.1 ]
%arrayidx5 = getelementptr inbounds i32, ptr %vla68, i64 %indvars.iv81
%9 = load i32, ptr %arrayidx5, align 8, !tbaa !5
%tobool.not.not = icmp eq i32 %9, 0
br i1 %tobool.not.not, label %for.inc14, label %for.body9
for.body9: ; preds = %for.body3, %for.body9
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body9 ], [ %indvars.iv79, %for.body3 ]
%arrayidx11 = getelementptr inbounds i32, ptr %vla68, i64 %indvars.iv83
store i32 0, ptr %arrayidx11, align 8, !tbaa !5
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, %indvars.iv81
%cmp8 = icmp ult i64 %indvars.iv.next84, 10001
br i1 %cmp8, label %for.body9, label %for.inc14, !llvm.loop !13
for.inc14: ; preds = %for.body9, %for.body3
%indvars.iv.next82 = or i64 %indvars.iv81, 1
%indvars.iv.next80 = or i64 %indvars.iv79, 2
%exitcond87.not = icmp eq i64 %indvars.iv.next82, 101
br i1 %exitcond87.not, label %for.end16, label %for.body3.1, !llvm.loop !14
for.body3.1: ; preds = %for.inc14
%arrayidx5.1 = getelementptr inbounds i32, ptr %vla68, i64 %indvars.iv.next82
%10 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%tobool.not.not.1 = icmp eq i32 %10, 0
br i1 %tobool.not.not.1, label %for.inc14.1, label %for.body9.1
for.body9.1: ; preds = %for.body3.1, %for.body9.1
%indvars.iv83.1 = phi i64 [ %indvars.iv.next84.1, %for.body9.1 ], [ %indvars.iv.next80, %for.body3.1 ]
%arrayidx11.1 = getelementptr inbounds i32, ptr %vla68, i64 %indvars.iv83.1
store i32 0, ptr %arrayidx11.1, align 4, !tbaa !5
%indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83.1, %indvars.iv.next82
%cmp8.1 = icmp ult i64 %indvars.iv.next84.1, 10001
br i1 %cmp8.1, label %for.body9.1, label %for.inc14.1, !llvm.loop !13
for.inc14.1: ; preds = %for.body9.1, %for.body3.1
%indvars.iv.next82.1 = add nuw nsw i64 %indvars.iv81, 2
%indvars.iv.next80.1 = add nuw nsw i64 %indvars.iv79, 4
br label %for.body3
for.end16: ; preds = %for.inc14
store i32 0, ptr %vla68, align 16, !tbaa !5
%arrayidx18 = getelementptr inbounds i32, ptr %vla68, i64 1
store i32 0, ptr %arrayidx18, align 4, !tbaa !5
%call75 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%11 = load i32, ptr %v, align 4, !tbaa !5
%cmp1976 = icmp eq i32 %11, 0
br i1 %cmp1976, label %while.end50, label %if.end21
if.end21: ; preds = %for.end16, %for.end49
%v.promoted = phi i32 [ %19, %for.end49 ], [ %11, %for.end16 ]
%idxprom22 = sext i32 %v.promoted to i64
%arrayidx23 = getelementptr inbounds i32, ptr %vla68, i64 %idxprom22
%12 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp eq i32 %12, 0
br i1 %cmp24, label %while.cond26, label %if.end33
while.cond26: ; preds = %if.end21, %while.cond26
%indvars.iv88 = phi i64 [ %indvars.iv.next89, %while.cond26 ], [ %idxprom22, %if.end21 ]
%indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
%arrayidx29 = getelementptr inbounds i32, ptr %vla68, i64 %indvars.iv.next89
%13 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp eq i32 %13, 1
br i1 %cmp30, label %if.end33.loopexit, label %while.cond26
if.end33.loopexit: ; preds = %while.cond26
%14 = trunc i64 %indvars.iv.next89 to i32
store i32 %14, ptr %v, align 4, !tbaa !5
br label %if.end33
if.end33: ; preds = %if.end33.loopexit, %if.end21
%15 = phi i32 [ %14, %if.end33.loopexit ], [ %v.promoted, %if.end21 ]
%16 = zext i32 %15 to i64
br label %for.cond34
for.cond34: ; preds = %for.body36, %if.end33
%indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body36 ], [ %16, %if.end33 ]
%q1.0 = phi i32 [ %spec.select, %for.body36 ], [ %15, %if.end33 ]
%17 = trunc i64 %indvars.iv91 to i32
%cmp35 = icmp sgt i32 %17, 1
br i1 %cmp35, label %for.body36, label %for.end49
for.body36: ; preds = %for.cond34
%indvars.iv.next92 = add nsw i64 %indvars.iv91, -1
%indvars = trunc i64 %indvars.iv.next92 to i32
%idxprom37 = and i64 %indvars.iv.next92, 4294967295
%arrayidx38 = getelementptr inbounds i32, ptr %vla68, i64 %idxprom37
%18 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%cmp39 = icmp eq i32 %18, 1
%spec.select = select i1 %cmp39, i32 %indvars, i32 %q1.0
%sub42 = sub nsw i32 %q1.0, %spec.select
%cmp43 = icmp eq i32 %sub42, 2
br i1 %cmp43, label %if.then44, label %for.cond34, !llvm.loop !15
if.then44: ; preds = %for.body36
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select, i32 noundef %q1.0)
br label %for.end49
for.end49: ; preds = %for.cond34, %if.then44
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%19 = load i32, ptr %v, align 4, !tbaa !5
%cmp19 = icmp eq i32 %19, 0
br i1 %cmp19, label %while.end50, label %if.end21
while.end50: ; preds = %for.end49, %for.end16
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int isprime(int n){
for(int i = 2; i * i <= n; i++){
if(n % i == 0) return 0;
}
return 1;
}
int main(){
int n, p1 = 0,i;
while (1) {
scanf("%d", &n);
if(n==0) break;
for(i = n; i >=2; i--){
if(isprime(i - 2)&& isprime(i)/*&&p1<i*/){
printf("%d %d\n", i - 2, i);
break;
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277881/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277881/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @isprime(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not6 = icmp slt i32 %n, 4
br i1 %cmp.not6, label %cleanup, label %for.body
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %i.07, 1
%mul = mul nsw i32 %inc, %inc
%cmp.not = icmp sgt i32 %mul, %n
br i1 %cmp.not, label %cleanup.loopexit, label %for.body, !llvm.loop !5
for.body: ; preds = %entry, %for.cond
%i.07 = phi i32 [ %inc, %for.cond ], [ 2, %entry ]
%rem = srem i32 %n, %i.07
%cmp1 = icmp ne i32 %rem, 0
br i1 %cmp1, label %for.cond, label %cleanup.loopexit
cleanup.loopexit: ; preds = %for.body, %for.cond
%0 = zext i1 %cmp1 to i32
br label %cleanup
cleanup: ; preds = %cleanup.loopexit, %entry
%cmp.not.lcssa = phi i32 [ 1, %entry ], [ %0, %cleanup.loopexit ]
ret i32 %cmp.not.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !7
%cmp44 = icmp eq i32 %0, 0
br i1 %cmp44, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %2, %for.end ], [ %0, %entry ]
%cmp141 = icmp sgt i32 %1, 1
br i1 %cmp141, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.inc
%i.042 = phi i32 [ %dec, %for.inc ], [ %1, %for.cond.preheader ]
%sub = add nsw i32 %i.042, -2
%cmp.not6.i = icmp ult i32 %sub, 4
br i1 %cmp.not6.i, label %land.lhs.true, label %for.body.i
for.cond.i: ; preds = %for.body.i
%inc.i = add nuw nsw i32 %i.07.i, 1
%mul.i = mul nsw i32 %inc.i, %inc.i
%cmp.not.i = icmp sgt i32 %mul.i, %sub
br i1 %cmp.not.i, label %land.lhs.true, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.body, %for.cond.i
%i.07.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %for.body ]
%rem.i = srem i32 %sub, %i.07.i
%cmp1.i.not = icmp eq i32 %rem.i, 0
br i1 %cmp1.i.not, label %for.inc, label %for.cond.i
land.lhs.true: ; preds = %for.cond.i, %for.body
%cmp.not6.i14 = icmp slt i32 %i.042, 4
br i1 %cmp.not6.i14, label %if.then5, label %for.body.i15
for.cond.i21: ; preds = %for.body.i15
%inc.i22 = add nuw nsw i32 %i.07.i16, 1
%mul.i23 = mul nsw i32 %inc.i22, %inc.i22
%cmp.not.i24 = icmp sgt i32 %mul.i23, %i.042
br i1 %cmp.not.i24, label %if.then5, label %for.body.i15, !llvm.loop !5
for.body.i15: ; preds = %land.lhs.true, %for.cond.i21
%i.07.i16 = phi i32 [ %inc.i22, %for.cond.i21 ], [ 2, %land.lhs.true ]
%rem.i17 = srem i32 %i.042, %i.07.i16
%cmp1.i18.not = icmp eq i32 %rem.i17, 0
br i1 %cmp1.i18.not, label %for.inc, label %for.cond.i21
if.then5: ; preds = %land.lhs.true, %for.cond.i21
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub, i32 noundef %i.042)
br label %for.end
for.inc: ; preds = %for.body.i, %for.body.i15
%dec = add nsw i32 %i.042, -1
%cmp1 = icmp sgt i32 %i.042, 2
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %for.cond.preheader, %if.then5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%2 = load i32, ptr %n, align 4, !tbaa !7
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include <stdio.h>
int isprime(int n){
for(int i = 2 ; i*i<=n ;i++){
if(n%i==0)return 0;
}
return 1;
}
int main(){
int number[10000+2]={0};
int n ,i , fir ,sec;
for(i=2 ; i<10000 ;i++){
number[i] = isprime(i);
}
while(scanf("%d" ,&n)){
if(n==0)break;
fir = 0 ,sec = 0;
for(i=n ;i>3 ;i--){
if(number[i] && number[i-2]){
fir = i-2;
sec = i;
break;
}
}
printf("%d %d\n" ,fir ,sec);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277924/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277924/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @isprime(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not6 = icmp slt i32 %n, 4
br i1 %cmp.not6, label %cleanup, label %for.body
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %i.07, 1
%mul = mul nsw i32 %inc, %inc
%cmp.not = icmp sgt i32 %mul, %n
br i1 %cmp.not, label %cleanup.loopexit, label %for.body, !llvm.loop !5
for.body: ; preds = %entry, %for.cond
%i.07 = phi i32 [ %inc, %for.cond ], [ 2, %entry ]
%rem = srem i32 %n, %i.07
%cmp1 = icmp ne i32 %rem, 0
br i1 %cmp1, label %for.cond, label %cleanup.loopexit
cleanup.loopexit: ; preds = %for.body, %for.cond
%0 = zext i1 %cmp1 to i32
br label %cleanup
cleanup: ; preds = %cleanup.loopexit, %entry
%cmp.not.lcssa = phi i32 [ 1, %entry ], [ %0, %cleanup.loopexit ]
ret i32 %cmp.not.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%number = alloca [10002 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40008, ptr nonnull %number) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40008) %number, i8 0, i64 40008, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
br label %for.body
while.cond.preheader: ; preds = %isprime.exit
%call134 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool35 = icmp eq i32 %call134, 0
%0 = load i32, ptr %n, align 4
%cmp236 = icmp eq i32 %0, 0
%or.cond37 = select i1 %tobool35, i1 true, i1 %cmp236
br i1 %or.cond37, label %while.end, label %for.cond3.preheader
for.body: ; preds = %entry, %isprime.exit
%indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %isprime.exit ]
%cmp.not6.i = icmp ult i64 %indvars.iv, 4
br i1 %cmp.not6.i, label %isprime.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body
%1 = trunc i64 %indvars.iv to i32
br label %for.body.i
for.cond.i: ; preds = %for.body.i
%inc.i = add nuw nsw i32 %i.07.i, 1
%mul.i = mul nsw i32 %inc.i, %inc.i
%2 = zext i32 %mul.i to i64
%cmp.not.i = icmp ult i64 %indvars.iv, %2
br i1 %cmp.not.i, label %cleanup.loopexit.i, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.body.i.preheader, %for.cond.i
%i.07.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %for.body.i.preheader ]
%rem.i = urem i32 %1, %i.07.i
%cmp1.i.not = icmp ne i32 %rem.i, 0
br i1 %cmp1.i.not, label %for.cond.i, label %cleanup.loopexit.i
cleanup.loopexit.i: ; preds = %for.body.i, %for.cond.i
%3 = zext i1 %cmp1.i.not to i32
br label %isprime.exit
isprime.exit: ; preds = %for.body, %cleanup.loopexit.i
%cmp.not.lcssa.i = phi i32 [ 1, %for.body ], [ %3, %cleanup.loopexit.i ]
%arrayidx = getelementptr inbounds [10002 x i32], ptr %number, i64 0, i64 %indvars.iv
store i32 %cmp.not.lcssa.i, ptr %arrayidx, align 4, !tbaa !7
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 10000
br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !11
for.cond3.preheader: ; preds = %while.cond.preheader, %for.end16
%4 = phi i32 [ %8, %for.end16 ], [ %0, %while.cond.preheader ]
%cmp429 = icmp sgt i32 %4, 3
br i1 %cmp429, label %for.body5.preheader, label %for.end16
for.body5.preheader: ; preds = %for.cond3.preheader
%5 = zext i32 %4 to i64
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.inc15
%indvars.iv39 = phi i64 [ %5, %for.body5.preheader ], [ %indvars.iv.next40, %for.inc15 ]
%arrayidx7 = getelementptr inbounds [10002 x i32], ptr %number, i64 0, i64 %indvars.iv39
%6 = load i32, ptr %arrayidx7, align 4, !tbaa !7
%tobool8.not = icmp eq i32 %6, 0
br i1 %tobool8.not, label %for.inc15, label %land.lhs.true
land.lhs.true: ; preds = %for.body5
%indvars41 = trunc i64 %indvars.iv39 to i32
%sub = add nsw i32 %indvars41, -2
%idxprom9 = zext i32 %sub to i64
%arrayidx10 = getelementptr inbounds [10002 x i32], ptr %number, i64 0, i64 %idxprom9
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !7
%tobool11.not = icmp eq i32 %7, 0
br i1 %tobool11.not, label %for.inc15, label %for.end16
for.inc15: ; preds = %for.body5, %land.lhs.true
%indvars.iv.next40 = add nsw i64 %indvars.iv39, -1
%cmp4 = icmp sgt i64 %indvars.iv39, 4
br i1 %cmp4, label %for.body5, label %for.end16, !llvm.loop !12
for.end16: ; preds = %for.inc15, %land.lhs.true, %for.cond3.preheader
%fir.0 = phi i32 [ 0, %for.cond3.preheader ], [ %sub, %land.lhs.true ], [ 0, %for.inc15 ]
%sec.0 = phi i32 [ 0, %for.cond3.preheader ], [ %indvars41, %land.lhs.true ], [ 0, %for.inc15 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %fir.0, i32 noundef %sec.0)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool = icmp eq i32 %call1, 0
%8 = load i32, ptr %n, align 4
%cmp2 = icmp eq i32 %8, 0
%or.cond = select i1 %tobool, i1 true, i1 %cmp2
br i1 %or.cond, label %while.end, label %for.cond3.preheader, !llvm.loop !13
while.end: ; preds = %for.end16, %while.cond.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 40008, ptr nonnull %number) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
|
#include<stdio.h>
#include<math.h>
int sos(int);
int main(){
int i,j,p,q,n;
while(1){
scanf("%d",&n);
if(n==0){break;}
for(i=n-2;i>=2;i--){
p=sos(i);
q=sos(i+2);
if(p!=0&&q!=0){
break;
}
}
printf("%d %d\n",p,q);
}
return 0;
}
int sos(int x){
int i;
for(i=2;i<=sqrt(x);i++){
if(x%i==0){
return 0;
}
}
return x;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_277968/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_277968/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp40 = icmp eq i32 %0, 0
br i1 %cmp40, label %while.end, label %if.end
if.end: ; preds = %entry, %for.end
%1 = phi i32 [ %2, %for.end ], [ %0, %entry ]
%q.042 = phi i32 [ %q.2, %for.end ], [ undef, %entry ]
%p.041 = phi i32 [ %p.2, %for.end ], [ undef, %entry ]
%cmp133 = icmp sgt i32 %1, 3
br i1 %cmp133, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %if.end
%sub = add nsw i32 %1, -2
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%i.034 = phi i32 [ %dec, %for.inc ], [ %sub, %for.body.preheader ]
%conv1.i = sitofp i32 %i.034 to double
%call9.i = call double @sqrt(double noundef %conv1.i) #5
%cmp10.i = fcmp ult double %call9.i, 2.000000e+00
br i1 %cmp10.i, label %sos.exit, label %for.body.i
for.cond.i: ; preds = %for.body.i
%inc.i = add nuw nsw i32 %i.011.i, 1
%conv.i = sitofp i32 %inc.i to double
%call.i = call double @sqrt(double noundef %conv1.i) #5
%cmp.i = fcmp ult double %call.i, %conv.i
br i1 %cmp.i, label %sos.exit, label %for.body.i, !llvm.loop !9
for.body.i: ; preds = %for.body, %for.cond.i
%i.011.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %for.body ]
%rem.i = srem i32 %i.034, %i.011.i
%cmp3.i = icmp eq i32 %rem.i, 0
br i1 %cmp3.i, label %sos.exit, label %for.cond.i
sos.exit: ; preds = %for.cond.i, %for.body.i, %for.body
%retval.0.i = phi i32 [ %i.034, %for.body ], [ 0, %for.body.i ], [ %i.034, %for.cond.i ]
%add = add nuw nsw i32 %i.034, 2
%conv1.i14 = sitofp i32 %add to double
%call9.i15 = call double @sqrt(double noundef %conv1.i14) #5
%cmp10.i16 = fcmp ult double %call9.i15, 2.000000e+00
br i1 %cmp10.i16, label %sos.exit27, label %for.body.i17
for.cond.i21: ; preds = %for.body.i17
%inc.i22 = add nuw nsw i32 %i.011.i18, 1
%conv.i23 = sitofp i32 %inc.i22 to double
%call.i24 = call double @sqrt(double noundef %conv1.i14) #5
%cmp.i25 = fcmp ult double %call.i24, %conv.i23
br i1 %cmp.i25, label %sos.exit27, label %for.body.i17, !llvm.loop !9
for.body.i17: ; preds = %sos.exit, %for.cond.i21
%i.011.i18 = phi i32 [ %inc.i22, %for.cond.i21 ], [ 2, %sos.exit ]
%rem.i19 = srem i32 %add, %i.011.i18
%cmp3.i20 = icmp eq i32 %rem.i19, 0
br i1 %cmp3.i20, label %for.inc, label %for.cond.i21
sos.exit27: ; preds = %for.cond.i21, %sos.exit
%cmp4.not = icmp eq i32 %retval.0.i, 0
br i1 %cmp4.not, label %for.inc, label %for.end
for.inc: ; preds = %for.body.i17, %sos.exit27
%retval.0.i2632 = phi i32 [ %add, %sos.exit27 ], [ 0, %for.body.i17 ]
%dec = add nsw i32 %i.034, -1
%cmp1 = icmp sgt i32 %i.034, 2
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %sos.exit27, %if.end
%p.2 = phi i32 [ %p.041, %if.end ], [ %retval.0.i, %sos.exit27 ], [ %retval.0.i, %for.inc ]
%q.2 = phi i32 [ %q.042, %if.end ], [ %retval.0.i2632, %for.inc ], [ %add, %sos.exit27 ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.2, i32 noundef %q.2)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind memory(write) uwtable
define dso_local i32 @sos(i32 noundef %x) local_unnamed_addr #3 {
entry:
%conv1 = sitofp i32 %x to double
%call9 = tail call double @sqrt(double noundef %conv1) #5
%cmp10 = fcmp ult double %call9, 2.000000e+00
br i1 %cmp10, label %cleanup, label %for.body
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %i.011, 1
%conv = sitofp i32 %inc to double
%call = tail call double @sqrt(double noundef %conv1) #5
%cmp = fcmp ult double %call, %conv
br i1 %cmp, label %cleanup, label %for.body, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
%i.011 = phi i32 [ %inc, %for.cond ], [ 2, %entry ]
%rem = srem i32 %x, %i.011
%cmp3 = icmp eq i32 %rem, 0
br i1 %cmp3, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ %x, %entry ], [ %x, %for.cond ], [ 0, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double 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 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int a[2]={0},i,j,n;
for(i=0;i<2;i++)for(j=0;j<4;j++){
scanf("%d",&n);
a[i]+=n;
}
if(a[1]>a[0])a[0]=a[1];
printf("%d\n",a[0]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278031/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278031/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%add.1 = add nsw i32 %0, %1
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%2 = load i32, ptr %n, align 4, !tbaa !5
%add.2 = add nsw i32 %add.1, %2
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%3 = load i32, ptr %n, align 4, !tbaa !5
%add.3 = add nsw i32 %add.2, %3
%call.120 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !5
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%5 = load i32, ptr %n, align 4, !tbaa !5
%add.1.1 = add nsw i32 %4, %5
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%6 = load i32, ptr %n, align 4, !tbaa !5
%add.2.1 = add nsw i32 %add.1.1, %6
%call.3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%7 = load i32, ptr %n, align 4, !tbaa !5
%add.3.1 = add nsw i32 %add.2.1, %7
%spec.store.select = call i32 @llvm.smax.i32(i32 %add.3.1, i32 %add.3)
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.store.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(void){
int a[4],b[4],t,c=0,d=0,f;
scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]);
scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);
for(t=0;t<4;t++){
c+=a[t];
d+=b[t];
}
f=fmax(c,d);
printf("%d\n",f);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278082/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278082/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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 [4 x i32], align 16
%b = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #5
%arrayidx1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2
%arrayidx3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%arrayidx5 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1
%arrayidx6 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2
%arrayidx7 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7)
%0 = load <4 x i32>, ptr %a, align 16, !tbaa !5
%1 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %0)
%2 = load <4 x i32>, ptr %b, align 16, !tbaa !5
%3 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %2)
%conv = sitofp i32 %1 to double
%conv13 = sitofp i32 %3 to double
%4 = call double @llvm.maxnum.f64(double %conv, double %conv13)
%conv14 = fptosi double %4 to i32
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv14)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 16, 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.maxnum.f64(double, double) #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.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 speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int aj,as,ar,ae,bj,bs,br,be,S,T;
scanf("%d %d %d %d", &aj,&as,&ar,&ae);
scanf("%d %d %d %d", &bj,&bs,&br,&be);
S=aj+as+ar+ae;
T=bj+bs+br+be;
if(S>=T) printf("%d\n",S);
else printf("%d\n",T);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278125/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278125/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%aj = alloca i32, align 4
%as = alloca i32, align 4
%ar = alloca i32, align 4
%ae = alloca i32, align 4
%bj = alloca i32, align 4
%bs = alloca i32, align 4
%br = alloca i32, align 4
%be = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %aj) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %as) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ar) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ae) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %bj) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %bs) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %br) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %be) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %aj, ptr noundef nonnull %as, ptr noundef nonnull %ar, ptr noundef nonnull %ae)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %bj, ptr noundef nonnull %bs, ptr noundef nonnull %br, ptr noundef nonnull %be)
%0 = load i32, ptr %aj, align 4, !tbaa !5
%1 = load i32, ptr %as, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %ar, align 4, !tbaa !5
%add2 = add nsw i32 %add, %2
%3 = load i32, ptr %ae, align 4, !tbaa !5
%add3 = add nsw i32 %add2, %3
%4 = load i32, ptr %bj, align 4, !tbaa !5
%5 = load i32, ptr %bs, align 4, !tbaa !5
%add4 = add nsw i32 %5, %4
%6 = load i32, ptr %br, align 4, !tbaa !5
%add5 = add nsw i32 %add4, %6
%7 = load i32, ptr %be, align 4, !tbaa !5
%add6 = add nsw i32 %add5, %7
%add6.add3 = call i32 @llvm.smax.i32(i32 %add3, i32 %add6)
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add6.add3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %be) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %br) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %bs) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %bj) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ae) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ar) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %as) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %aj) #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<stdio.h>
int main(){
int a[4],b[4],sum1=0,sum2=0,i;
for(i=0;i<4;i++){
scanf("%d",&a[i]);
sum1+=a[i];
}
for(i=0;i<4;i++){
scanf("%d",&b[i]);
sum2+=b[i];
}
if(sum1>sum2){
printf("%d\n",sum1);
} else if (sum1<sum2){
printf("%d\n",sum2);
} else {
printf("%d\n",sum1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278169/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278169/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i32], align 16
%b = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 16, !tbaa !5
%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)
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%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)
%2 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%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)
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%4 = load i32, ptr %b, align 16, !tbaa !5
%arrayidx7.1 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1
%call8.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.1)
%5 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5
%add11.1 = add nsw i32 %5, %4
%arrayidx7.2 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2
%call8.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.2)
%6 = load i32, ptr %arrayidx7.2, align 8, !tbaa !5
%add11.2 = add nsw i32 %6, %add11.1
%arrayidx7.3 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3
%call8.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.3)
%7 = load i32, ptr %arrayidx7.3, align 4, !tbaa !5
%add11.3 = add nsw i32 %7, %add11.2
%add.1 = add nsw i32 %1, %0
%add.2 = add nsw i32 %2, %add.1
%add.3 = add nsw i32 %3, %add.2
%add11.3.add.3 = call i32 @llvm.smax.i32(i32 %add.3, i32 %add11.3)
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add11.3.add.3)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #4
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<stdio.h>
int main(){
int a;
int b;
int s = 0;
int t = 0;
int i;
for(i = 0; i < 4; i++){
scanf("%d", &a);
s += a;
}
for(i = 0; i < 4; i++){
scanf("%d", &b);
t += b;
}
if(s < t){
printf("%d\n", t);
}else{
printf("%d\n", s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278248/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278248/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%2 = load i32, ptr %a, align 4, !tbaa !5
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%3 = load i32, ptr %a, align 4, !tbaa !5
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%4 = load i32, ptr %b, align 4, !tbaa !5
%call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%5 = load i32, ptr %b, align 4, !tbaa !5
%add5.1 = add nsw i32 %5, %4
%call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%6 = load i32, ptr %b, align 4, !tbaa !5
%add5.2 = add nsw i32 %6, %add5.1
%call4.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%7 = load i32, ptr %b, align 4, !tbaa !5
%add5.3 = add nsw i32 %7, %add5.2
%add.1 = add nsw i32 %1, %0
%add.2 = add nsw i32 %2, %add.1
%add.3 = add nsw i32 %3, %add.2
%add5.3.add.3 = call i32 @llvm.smax.i32(i32 %add.3, i32 %add5.3)
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5.3.add.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int c,d[30][30],p[30][3]={},i,j,k,n,x,y,r=1<<29;
scanf("%d%d",&n,&c);
for(i=0;i<c;i++)for(j=0;j<c;j++)scanf("%d",&d[i][j]);
for(i=0;i<n;i++)for(j=0;j<n;j++){scanf("%d",&k);p[k-1][(i+j)%3]++;}
for(i=0;i<c;i++)for(j=0;j<c;j++)for(k=0;k<c;k++)if(i!=j&&j!=k&&k!=i){
y=0;for(x=0;x<c;x++)y+=d[x][i]*p[x][0]+d[x][j]*p[x][1]+d[x][k]*p[x][2];
r=y<r?y:r;
}
printf("%d",r);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278299/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278299/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca i32, align 4
%d = alloca [30 x [30 x i32]], align 16
%p = alloca [30 x [3 x i32]], align 16
%k = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 3600, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 360, ptr nonnull %p) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(360) %p, i8 0, i64 360, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %c)
%0 = load i32, ptr %c, align 4, !tbaa !5
%cmp118 = icmp sgt i32 %0, 0
br i1 %cmp118, label %for.cond1.preheader, label %for.cond10.preheader
for.cond1.preheader: ; preds = %entry, %for.inc7
%1 = phi i32 [ %6, %for.inc7 ], [ %0, %entry ]
%indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.inc7 ], [ 0, %entry ]
%cmp2116 = icmp sgt i32 %1, 0
br i1 %cmp2116, label %for.body3, label %for.cond1.preheader.for.inc7_crit_edge
for.cond1.preheader.for.inc7_crit_edge: ; preds = %for.cond1.preheader
%.pre181 = sext i32 %1 to i64
br label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%2 = phi i32 [ %0, %entry ], [ %6, %for.inc7 ]
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp11122 = icmp sgt i32 %3, 0
br i1 %cmp11122, label %for.cond13.preheader, label %for.cond28.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [30 x [30 x i32]], ptr %d, i64 0, i64 %indvars.iv160, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %c, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !9
for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge
%.pre-phi = phi i64 [ %.pre181, %for.cond1.preheader.for.inc7_crit_edge ], [ %5, %for.body3 ]
%6 = phi i32 [ %1, %for.cond1.preheader.for.inc7_crit_edge ], [ %4, %for.body3 ]
%indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
%cmp = icmp slt i64 %indvars.iv.next161, %.pre-phi
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc25
%7 = phi i32 [ %18, %for.inc25 ], [ %3, %for.cond10.preheader ]
%i.1123 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond10.preheader ]
%cmp14120 = icmp sgt i32 %7, 0
br i1 %cmp14120, label %for.body15, label %for.inc25
for.cond28.preheader.loopexit: ; preds = %for.inc25
%.pre = load i32, ptr %c, align 4, !tbaa !5
br label %for.cond28.preheader
for.cond28.preheader: ; preds = %for.cond28.preheader.loopexit, %for.cond10.preheader
%8 = phi i32 [ %.pre, %for.cond28.preheader.loopexit ], [ %2, %for.cond10.preheader ]
%cmp29153 = icmp sgt i32 %8, 0
br i1 %cmp29153, label %for.cond31.preheader.us.preheader, label %for.end82
for.cond31.preheader.us.preheader: ; preds = %for.cond28.preheader
%wide.trip.count179 = zext i32 %8 to i64
br label %for.cond31.preheader.us
for.cond31.preheader.us: ; preds = %for.cond31.preheader.us.preheader, %for.cond31.for.inc80_crit_edge.split.us.us
%indvars.iv176 = phi i64 [ 0, %for.cond31.preheader.us.preheader ], [ %indvars.iv.next177, %for.cond31.for.inc80_crit_edge.split.us.us ]
%r.0155.us = phi i32 [ 536870912, %for.cond31.preheader.us.preheader ], [ %.us-phi133.us.us, %for.cond31.for.inc80_crit_edge.split.us.us ]
br label %for.cond34.preheader.us.us
for.cond34.preheader.us.us: ; preds = %for.cond34.for.inc77_crit_edge.us.us, %for.cond31.preheader.us
%indvars.iv171 = phi i64 [ %indvars.iv.next172, %for.cond34.for.inc77_crit_edge.us.us ], [ 0, %for.cond31.preheader.us ]
%r.1148.us.us = phi i32 [ %.us-phi133.us.us, %for.cond34.for.inc77_crit_edge.us.us ], [ %r.0155.us, %for.cond31.preheader.us ]
%cmp37.not.us.us = icmp eq i64 %indvars.iv176, %indvars.iv171
%cmp37.not.fr.us.us = freeze i1 %cmp37.not.us.us
br i1 %cmp37.not.fr.us.us, label %for.cond34.for.inc77_crit_edge.us.us, label %for.body36.us134.us.us
for.cond34.for.inc77_crit_edge.us.us: ; preds = %for.inc74.us137.us.us, %for.cond34.preheader.us.us
%.us-phi133.us.us = phi i32 [ %r.1148.us.us, %for.cond34.preheader.us.us ], [ %r.3.us138.us.us, %for.inc74.us137.us.us ]
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%exitcond175.not = icmp eq i64 %indvars.iv.next172, %wide.trip.count179
br i1 %exitcond175.not, label %for.cond31.for.inc80_crit_edge.split.us.us, label %for.cond34.preheader.us.us, !llvm.loop !13
for.body36.us134.us.us: ; preds = %for.cond34.preheader.us.us, %for.inc74.us137.us.us
%indvars.iv166 = phi i64 [ %indvars.iv.next167, %for.inc74.us137.us.us ], [ 0, %for.cond34.preheader.us.us ]
%r.2130.us135.us.us = phi i32 [ %r.3.us138.us.us, %for.inc74.us137.us.us ], [ %r.1148.us.us, %for.cond34.preheader.us.us ]
%cmp38.not.us.us.us = icmp eq i64 %indvars.iv171, %indvars.iv166
%cmp40.not.us.us.us = icmp eq i64 %indvars.iv166, %indvars.iv176
%or.cond115.us.us.us = or i1 %cmp40.not.us.us.us, %cmp38.not.us.us.us
br i1 %or.cond115.us.us.us, label %for.inc74.us137.us.us, label %for.body43.us.us.us
for.body43.us.us.us: ; preds = %for.body36.us134.us.us, %for.body43.us.us.us
%indvars.iv163 = phi i64 [ %indvars.iv.next164, %for.body43.us.us.us ], [ 0, %for.body36.us134.us.us ]
%y.0126.us.us.us = phi i32 [ %add69.us.us.us, %for.body43.us.us.us ], [ 0, %for.body36.us134.us.us ]
%arrayidx47.us.us.us = getelementptr inbounds [30 x [30 x i32]], ptr %d, i64 0, i64 %indvars.iv163, i64 %indvars.iv176
%9 = load i32, ptr %arrayidx47.us.us.us, align 4, !tbaa !5
%arrayidx49.us.us.us = getelementptr inbounds [30 x [3 x i32]], ptr %p, i64 0, i64 %indvars.iv163
%10 = load i32, ptr %arrayidx49.us.us.us, align 4, !tbaa !5
%mul.us.us.us = mul nsw i32 %10, %9
%arrayidx54.us.us.us = getelementptr inbounds [30 x [30 x i32]], ptr %d, i64 0, i64 %indvars.iv163, i64 %indvars.iv171
%11 = load i32, ptr %arrayidx54.us.us.us, align 4, !tbaa !5
%arrayidx57.us.us.us = getelementptr inbounds [30 x [3 x i32]], ptr %p, i64 0, i64 %indvars.iv163, i64 1
%12 = load i32, ptr %arrayidx57.us.us.us, align 4, !tbaa !5
%mul58.us.us.us = mul nsw i32 %12, %11
%arrayidx63.us.us.us = getelementptr inbounds [30 x [30 x i32]], ptr %d, i64 0, i64 %indvars.iv163, i64 %indvars.iv166
%13 = load i32, ptr %arrayidx63.us.us.us, align 4, !tbaa !5
%arrayidx66.us.us.us = getelementptr inbounds [30 x [3 x i32]], ptr %p, i64 0, i64 %indvars.iv163, i64 2
%14 = load i32, ptr %arrayidx66.us.us.us, align 4, !tbaa !5
%mul67.us.us.us = mul nsw i32 %14, %13
%add59.us.us.us = add i32 %mul.us.us.us, %y.0126.us.us.us
%add68.us.us.us = add i32 %add59.us.us.us, %mul58.us.us.us
%add69.us.us.us = add i32 %add68.us.us.us, %mul67.us.us.us
%indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
%exitcond.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count179
br i1 %exitcond.not, label %for.cond41.for.end72_crit_edge.us.us.us, label %for.body43.us.us.us, !llvm.loop !14
for.inc74.us137.us.us: ; preds = %for.cond41.for.end72_crit_edge.us.us.us, %for.body36.us134.us.us
%r.3.us138.us.us = phi i32 [ %cond.us.us.us, %for.cond41.for.end72_crit_edge.us.us.us ], [ %r.2130.us135.us.us, %for.body36.us134.us.us ]
%indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
%exitcond170.not = icmp eq i64 %indvars.iv.next167, %wide.trip.count179
br i1 %exitcond170.not, label %for.cond34.for.inc77_crit_edge.us.us, label %for.body36.us134.us.us, !llvm.loop !15
for.cond41.for.end72_crit_edge.us.us.us: ; preds = %for.body43.us.us.us
%cond.us.us.us = call i32 @llvm.smin.i32(i32 %add69.us.us.us, i32 %r.2130.us135.us.us)
br label %for.inc74.us137.us.us
for.cond31.for.inc80_crit_edge.split.us.us: ; preds = %for.cond34.for.inc77_crit_edge.us.us
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%exitcond180.not = icmp eq i64 %indvars.iv.next177, %wide.trip.count179
br i1 %exitcond180.not, label %for.cond28.for.end82_crit_edge.split.us, label %for.cond31.preheader.us, !llvm.loop !16
for.cond28.for.end82_crit_edge.split.us: ; preds = %for.cond31.for.inc80_crit_edge.split.us.us
store i32 %8, ptr %k, align 4, !tbaa !5
br label %for.end82
for.body15: ; preds = %for.cond13.preheader, %for.body15
%j.1121 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.cond13.preheader ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k)
%15 = load i32, ptr %k, align 4, !tbaa !5
%sub = add nsw i32 %15, -1
%idxprom17 = sext i32 %sub to i64
%add = add nuw nsw i32 %j.1121, %i.1123
%rem = urem i32 %add, 3
%idxprom19 = zext i32 %rem to i64
%arrayidx20 = getelementptr inbounds [30 x [3 x i32]], ptr %p, i64 0, i64 %idxprom17, i64 %idxprom19
%16 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%inc21 = add nsw i32 %16, 1
store i32 %inc21, ptr %arrayidx20, align 4, !tbaa !5
%inc23 = add nuw nsw i32 %j.1121, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc23, %17
br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !17
for.inc25: ; preds = %for.body15, %for.cond13.preheader
%18 = phi i32 [ %7, %for.cond13.preheader ], [ %17, %for.body15 ]
%inc26 = add nuw nsw i32 %i.1123, 1
%cmp11 = icmp slt i32 %inc26, %18
br i1 %cmp11, label %for.cond13.preheader, label %for.cond28.preheader.loopexit, !llvm.loop !18
for.end82: ; preds = %for.cond28.for.end82_crit_edge.split.us, %for.cond28.preheader
%r.0.lcssa = phi i32 [ %.us-phi133.us.us, %for.cond28.for.end82_crit_edge.split.us ], [ 536870912, %for.cond28.preheader ]
%call83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 360, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 3600, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !12}
|
#include <stdio.h>
int main(void){
int sum, a, i;
while(1){
scanf("%d", &sum);
if(sum==0) break;
for(i=0; i<9; i++){
scanf(" %d", &a);
sum -= a;
}
printf("%d\n", sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278341/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278341/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%sum = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sum) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sum)
%0 = load i32, ptr %sum, align 4, !tbaa !5
%cmp7 = icmp eq i32 %0, 0
br i1 %cmp7, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.cond.preheader
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %sum, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
store i32 %sub, ptr %sum, align 4, !tbaa !5
%call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%3 = load i32, ptr %a, align 4, !tbaa !5
%4 = load i32, ptr %sum, align 4, !tbaa !5
%sub.1 = sub nsw i32 %4, %3
store i32 %sub.1, ptr %sum, align 4, !tbaa !5
%call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%5 = load i32, ptr %a, align 4, !tbaa !5
%6 = load i32, ptr %sum, align 4, !tbaa !5
%sub.2 = sub nsw i32 %6, %5
store i32 %sub.2, ptr %sum, align 4, !tbaa !5
%call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%7 = load i32, ptr %a, align 4, !tbaa !5
%8 = load i32, ptr %sum, align 4, !tbaa !5
%sub.3 = sub nsw i32 %8, %7
store i32 %sub.3, ptr %sum, align 4, !tbaa !5
%call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%9 = load i32, ptr %a, align 4, !tbaa !5
%10 = load i32, ptr %sum, align 4, !tbaa !5
%sub.4 = sub nsw i32 %10, %9
store i32 %sub.4, ptr %sum, align 4, !tbaa !5
%call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%11 = load i32, ptr %a, align 4, !tbaa !5
%12 = load i32, ptr %sum, align 4, !tbaa !5
%sub.5 = sub nsw i32 %12, %11
store i32 %sub.5, ptr %sum, align 4, !tbaa !5
%call2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%13 = load i32, ptr %a, align 4, !tbaa !5
%14 = load i32, ptr %sum, align 4, !tbaa !5
%sub.6 = sub nsw i32 %14, %13
store i32 %sub.6, ptr %sum, align 4, !tbaa !5
%call2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%15 = load i32, ptr %a, align 4, !tbaa !5
%16 = load i32, ptr %sum, align 4, !tbaa !5
%sub.7 = sub nsw i32 %16, %15
store i32 %sub.7, ptr %sum, align 4, !tbaa !5
%call2.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%17 = load i32, ptr %a, align 4, !tbaa !5
%18 = load i32, ptr %sum, align 4, !tbaa !5
%sub.8 = sub nsw i32 %18, %17
store i32 %sub.8, ptr %sum, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub.8)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sum)
%19 = load i32, ptr %sum, align 4, !tbaa !5
%cmp = icmp eq i32 %19, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.cond.preheader, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sum) #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 total;
int book;
int i;
while (1){
scanf("%d", &total);
if (total == 0){
break;
}
for (i = 0; i < 9; i++){
scanf("%d", &book);
total -= book;
}
printf("%d\n", total);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278385/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278385/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%total = alloca i32, align 4
%book = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %total) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %book) #3
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %total)
%0 = load i32, ptr %total, align 4, !tbaa !5
%cmp7 = icmp eq i32 %0, 0
br i1 %cmp7, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.cond.preheader
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%1 = load i32, ptr %book, align 4, !tbaa !5
%2 = load i32, ptr %total, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
store i32 %sub, ptr %total, align 4, !tbaa !5
%call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%3 = load i32, ptr %book, align 4, !tbaa !5
%4 = load i32, ptr %total, align 4, !tbaa !5
%sub.1 = sub nsw i32 %4, %3
store i32 %sub.1, ptr %total, align 4, !tbaa !5
%call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%5 = load i32, ptr %book, align 4, !tbaa !5
%6 = load i32, ptr %total, align 4, !tbaa !5
%sub.2 = sub nsw i32 %6, %5
store i32 %sub.2, ptr %total, align 4, !tbaa !5
%call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%7 = load i32, ptr %book, align 4, !tbaa !5
%8 = load i32, ptr %total, align 4, !tbaa !5
%sub.3 = sub nsw i32 %8, %7
store i32 %sub.3, ptr %total, align 4, !tbaa !5
%call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%9 = load i32, ptr %book, align 4, !tbaa !5
%10 = load i32, ptr %total, align 4, !tbaa !5
%sub.4 = sub nsw i32 %10, %9
store i32 %sub.4, ptr %total, align 4, !tbaa !5
%call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%11 = load i32, ptr %book, align 4, !tbaa !5
%12 = load i32, ptr %total, align 4, !tbaa !5
%sub.5 = sub nsw i32 %12, %11
store i32 %sub.5, ptr %total, align 4, !tbaa !5
%call2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%13 = load i32, ptr %book, align 4, !tbaa !5
%14 = load i32, ptr %total, align 4, !tbaa !5
%sub.6 = sub nsw i32 %14, %13
store i32 %sub.6, ptr %total, align 4, !tbaa !5
%call2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%15 = load i32, ptr %book, align 4, !tbaa !5
%16 = load i32, ptr %total, align 4, !tbaa !5
%sub.7 = sub nsw i32 %16, %15
store i32 %sub.7, ptr %total, align 4, !tbaa !5
%call2.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %book)
%17 = load i32, ptr %book, align 4, !tbaa !5
%18 = load i32, ptr %total, align 4, !tbaa !5
%sub.8 = sub nsw i32 %18, %17
store i32 %sub.8, ptr %total, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.8)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %total)
%19 = load i32, ptr %total, align 4, !tbaa !5
%cmp = icmp eq i32 %19, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.cond.preheader, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %book) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %total) #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 x,a,i;
int main(){
scanf("%d",&x);
while(x!=0){
for(i=0;i<9;i++){
scanf("%d",&a);
x=x-a;
}
printf("%d\n",x);
scanf("%d",&x);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278428/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278428/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@x = dso_local global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@a = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
%0 = load i32, ptr @x, align 4, !tbaa !5
%cmp.not5 = icmp eq i32 %0, 0
br i1 %cmp.not5, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
store i32 0, ptr @i, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a)
%1 = load i32, ptr @x, align 4, !tbaa !5
%2 = load i32, ptr @a, align 4, !tbaa !5
%sub = sub nsw i32 %1, %2
store i32 %sub, ptr @x, align 4, !tbaa !5
%3 = load i32, ptr @i, align 4, !tbaa !5
%inc = add nsw i32 %3, 1
store i32 %inc, ptr @i, align 4, !tbaa !5
%cmp1 = icmp slt i32 %3, 8
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%call4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
%4 = load i32, ptr @x, align 4, !tbaa !5
%cmp.not = icmp eq i32 %4, 0
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11
while.end: ; preds = %for.end, %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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int t;
scanf("%d", &t);
while (t > 0)
{
int n;
scanf("%d", &n);
long int k = 1;
for (int i = 0; i < n; i++)
{
k = 2 * k;
}
printf("%ld\n", k - 1);
t--;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27850/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27850/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%.pr = load i32, ptr %t, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %.pr, 0
br i1 %cmp9, label %while.body, label %while.end
while.body: ; preds = %entry, %for.cond.cleanup
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp26 = icmp sgt i32 %0, 0
br i1 %cmp26, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %while.body
%xtraiter = and i32 %0, 7
%1 = icmp ult i32 %0, 8
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 i32 %0, -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, %for.body ]
%k.07.unr = phi i64 [ 1, %for.body.preheader ], [ %mul, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%k.07.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %k.07.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = shl nsw i64 %k.07.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.cond.cleanup, label %for.body.epil, !llvm.loop !9
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %while.body
%k.0.lcssa = phi i64 [ 1, %while.body ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
%sub = add nsw i64 %k.0.lcssa, -1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub)
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
%cmp = icmp sgt i32 %2, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11
for.body: ; preds = %for.body, %for.body.preheader.new
%k.07 = phi i64 [ 1, %for.body.preheader.new ], [ %mul, %for.body ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = shl i64 %k.07, 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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !13
while.end: ; preds = %for.cond.cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
#include<math.h>
int main(void)
{
int A, B, C, K, flag=0, i=0, j=0, k=0;
scanf("%d %d %d", &A, &B, &C);
scanf("%d", &K);
for(i=0; i<=K; i++) {
for(j=0; j<=K-i; j++) {
for(k=0; k<=K-(i+j); k++) {
if(A*pow(2,i) < B*pow(2,j) && B*pow(2,j) < C*pow(2,k)) {
printf("Yes\n");
flag = 1;
break;
}
}
if(flag == 1) {
break;
}
}
if(flag == 1) {
break;
}
}
if(flag == 0) {
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278550/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278550/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = 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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #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 %A, ptr noundef nonnull %B, ptr noundef nonnull %C)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %K)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp.not69 = icmp slt i32 %0, 0
br i1 %cmp.not69, label %if.end46, label %for.cond2.preheader
for.cond2.preheader: ; preds = %entry, %for.inc39
%1 = phi i32 [ %12, %for.inc39 ], [ %0, %entry ]
%i.070 = phi i32 [ %inc40, %for.inc39 ], [ 0, %entry ]
%cmp3.not.not67 = icmp slt i32 %1, %i.070
br i1 %cmp3.not.not67, label %for.inc39, label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.cond2.preheader, %for.inc32
%2 = phi i32 [ %10, %for.inc32 ], [ %1, %for.cond2.preheader ]
%3 = phi i32 [ %11, %for.inc32 ], [ %1, %for.cond2.preheader ]
%j.068 = phi i32 [ %inc33, %for.inc32 ], [ 0, %for.cond2.preheader ]
%4 = add nuw i32 %j.068, %i.070
%sub663 = sub i32 %3, %4
%cmp7.not.not64 = icmp slt i32 %sub663, 0
br i1 %cmp7.not.not64, label %for.inc32, label %for.body8
for.body8: ; preds = %for.cond5.preheader, %for.inc
%k.065 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond5.preheader ]
%5 = load i32, ptr %A, align 4, !tbaa !5
%conv = sitofp i32 %5 to double
%ldexp = call double @ldexp(double 1.000000e+00, i32 %i.070) #5
%mul = fmul double %ldexp, %conv
%6 = load i32, ptr %B, align 4, !tbaa !5
%conv11 = sitofp i32 %6 to double
%ldexp59 = call double @ldexp(double 1.000000e+00, i32 %j.068) #5
%mul14 = fmul double %ldexp59, %conv11
%cmp15 = fcmp olt double %mul, %mul14
br i1 %cmp15, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body8
%7 = load i32, ptr %B, align 4, !tbaa !5
%conv17 = sitofp i32 %7 to double
%ldexp60 = call double @ldexp(double 1.000000e+00, i32 %j.068) #5
%mul20 = fmul double %ldexp60, %conv17
%8 = load i32, ptr %C, align 4, !tbaa !5
%conv21 = sitofp i32 %8 to double
%ldexp61 = call double @ldexp(double 1.000000e+00, i32 %k.065) #5
%mul24 = fmul double %ldexp61, %conv21
%cmp25 = fcmp olt double %mul20, %mul24
br i1 %cmp25, label %if.end46, label %for.inc
for.inc: ; preds = %for.body8, %land.lhs.true
%inc = add nuw nsw i32 %k.065, 1
%9 = load i32, ptr %K, align 4, !tbaa !5
%sub6 = sub i32 %9, %4
%cmp7.not.not.not = icmp slt i32 %k.065, %sub6
br i1 %cmp7.not.not.not, label %for.body8, label %for.inc32, !llvm.loop !9
for.inc32: ; preds = %for.inc, %for.cond5.preheader
%10 = phi i32 [ %2, %for.cond5.preheader ], [ %9, %for.inc ]
%11 = phi i32 [ %3, %for.cond5.preheader ], [ %9, %for.inc ]
%inc33 = add nuw nsw i32 %j.068, 1
%sub = sub nsw i32 %11, %i.070
%cmp3.not.not.not = icmp slt i32 %j.068, %sub
br i1 %cmp3.not.not.not, label %for.cond5.preheader, label %for.inc39, !llvm.loop !11
for.inc39: ; preds = %for.inc32, %for.cond2.preheader
%12 = phi i32 [ %1, %for.cond2.preheader ], [ %10, %for.inc32 ]
%inc40 = add nuw nsw i32 %i.070, 1
%cmp.not.not = icmp slt i32 %i.070, %12
br i1 %cmp.not.not, label %for.cond2.preheader, label %if.end46, !llvm.loop !12
if.end46: ; preds = %for.inc39, %land.lhs.true, %entry
%str.sink = phi ptr [ @str.4, %entry ], [ @str, %land.lhs.true ], [ @str.4, %for.inc39 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree willreturn
declare double @ldexp(double, i32) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define rep(i,n) for(int i=0; i<n; i++)
int f(int A, int B, int C, int K, int i){
if(i>K) return 0;
if(B > A && C > B) return 1;
i++;
A*=2;
if(f(A,B,C,K,i)) return 1;
A/=2;
B*=2;
if(f(A,B,C,K,i)) return 1;
B/=2;
C*=2;
if(f(A,B,C,K,i)) return 1;
C/=2;
return 0;
}
int main(void){
int A, B, C;
int K;
scanf("%d %d %d", &A, &B, &C);
scanf("%d", &K);
if(f(A,B,C,K,0)) printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278594/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278594/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @f(i32 noundef %A, i32 noundef %B, i32 noundef %C, i32 noundef %K, i32 noundef %i) local_unnamed_addr #0 {
entry:
%mul7 = shl nsw i32 %B, 1
%cmp42 = icmp sgt i32 %i, %K
br i1 %cmp42, label %return, label %if.end.lr.ph
if.end.lr.ph: ; preds = %entry
%cmp1 = icmp sgt i32 %B, %A
%mul = shl nsw i32 %A, 1
br i1 %cmp1, label %if.end, label %if.end.us
if.end.us: ; preds = %if.end.lr.ph, %tailrecurse.us
%i.tr44.us = phi i32 [ %inc.us, %tailrecurse.us ], [ %i, %if.end.lr.ph ]
%C.tr43.us = phi i32 [ %mul13.us, %tailrecurse.us ], [ %C, %if.end.lr.ph ]
%inc.us = add nsw i32 %i.tr44.us, 1
%call.us = tail call i32 @f(i32 noundef %mul, i32 noundef %B, i32 noundef %C.tr43.us, i32 noundef %K, i32 noundef %inc.us), !range !5
%tobool.not.us = icmp eq i32 %call.us, 0
br i1 %tobool.not.us, label %if.end6.us, label %return
tailrecurse.us: ; preds = %if.end6.us
%mul13.us = shl nsw i32 %C.tr43.us, 1
%exitcond.not = icmp eq i32 %i.tr44.us, %K
br i1 %exitcond.not, label %return, label %if.end.us
if.end6.us: ; preds = %if.end.us
%call8.us = tail call i32 @f(i32 noundef %A, i32 noundef %mul7, i32 noundef %C.tr43.us, i32 noundef %K, i32 noundef %inc.us), !range !5
%tobool9.not.us = icmp eq i32 %call8.us, 0
br i1 %tobool9.not.us, label %tailrecurse.us, label %return
tailrecurse: ; preds = %if.end6
%mul13 = shl nsw i32 %C.tr43, 1
%exitcond52.not = icmp eq i32 %i.tr44, %K
br i1 %exitcond52.not, label %return, label %if.end
if.end: ; preds = %if.end.lr.ph, %tailrecurse
%i.tr44 = phi i32 [ %inc, %tailrecurse ], [ %i, %if.end.lr.ph ]
%C.tr43 = phi i32 [ %mul13, %tailrecurse ], [ %C, %if.end.lr.ph ]
%cmp2 = icmp sgt i32 %C.tr43, %B
br i1 %cmp2, label %return, label %if.end4
if.end4: ; preds = %if.end
%inc = add i32 %i.tr44, 1
%call = tail call i32 @f(i32 noundef %mul, i32 noundef %B, i32 noundef %C.tr43, i32 noundef %K, i32 noundef %inc), !range !5
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %if.end6, label %return
if.end6: ; preds = %if.end4
%call8 = tail call i32 @f(i32 noundef %A, i32 noundef %mul7, i32 noundef %C.tr43, i32 noundef %K, i32 noundef %inc), !range !5
%tobool9.not = icmp eq i32 %call8, 0
br i1 %tobool9.not, label %tailrecurse, label %return
return: ; preds = %tailrecurse.us, %if.end.us, %if.end6.us, %tailrecurse, %if.end, %if.end4, %if.end6, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 1, %if.end6 ], [ 1, %if.end4 ], [ 1, %if.end ], [ 0, %tailrecurse ], [ 1, %if.end6.us ], [ 1, %if.end.us ], [ 0, %tailrecurse.us ]
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
%C = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #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 %A, ptr noundef nonnull %B, ptr noundef nonnull %C)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %K)
%0 = load i32, ptr %A, align 4, !tbaa !6
%1 = load i32, ptr %B, align 4, !tbaa !6
%2 = load i32, ptr %C, align 4, !tbaa !6
%3 = load i32, ptr %K, align 4, !tbaa !6
%call2 = call i32 @f(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef 0), !range !5
%tobool.not = icmp eq i32 %call2, 0
%str.str.4 = select i1 %tobool.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 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 = !{i32 0, i32 2}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
int main(){
int a,b,c,k;
scanf("%d%d%d%d",&a,&b,&c,&k);
int cnt=0;
while(a>=b)b*=2,cnt++;
while(b>=c)c*=2,cnt++;
puts(cnt<=k?"Yes":"No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278644/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278644/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [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) #6
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #6
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @pom(i64 noundef %a, i64 noundef %n, i32 noundef %m) local_unnamed_addr #3 {
entry:
%conv = sext i32 %m to i64
%tobool.not16 = icmp eq i64 %n, 0
br i1 %tobool.not16, label %for.end, label %for.body
for.body: ; preds = %entry, %cond.end
%mul4.pn = phi i64 [ %mul4, %cond.end ], [ %a, %entry ]
%x.018 = phi i64 [ %x.1, %cond.end ], [ 1, %entry ]
%n.addr.017 = phi i64 [ %div, %cond.end ], [ %n, %entry ]
%a.addr.019 = srem i64 %mul4.pn, %conv
%and = and i64 %n.addr.017, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %cond.end, label %cond.true
cond.true: ; preds = %for.body
%mul = mul nsw i64 %a.addr.019, %x.018
%rem3 = srem i64 %mul, %conv
br label %cond.end
cond.end: ; preds = %for.body, %cond.true
%x.1 = phi i64 [ %rem3, %cond.true ], [ %x.018, %for.body ]
%mul4 = mul nsw i64 %a.addr.019, %a.addr.019
%div = sdiv i64 %n.addr.017, 2
%n.addr.017.off = add i64 %n.addr.017, 1
%tobool.not = icmp ult i64 %n.addr.017.off, 3
br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %cond.end, %entry
%x.0.lcssa = phi i64 [ 1, %entry ], [ %x.1, %cond.end ]
ret i64 %x.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %k)
%0 = load i32, ptr %a, align 4, !tbaa !11
%b.promoted = load i32, ptr %b, align 4, !tbaa !11
%cmp.not13 = icmp slt i32 %0, %b.promoted
br i1 %cmp.not13, label %while.cond1.preheader, label %while.body
while.cond.while.cond1.preheader_crit_edge: ; preds = %while.body
store i32 %mul, ptr %b, align 4, !tbaa !11
br label %while.cond1.preheader
while.cond1.preheader: ; preds = %while.cond.while.cond1.preheader_crit_edge, %entry
%cnt.0.lcssa = phi i32 [ %inc, %while.cond.while.cond1.preheader_crit_edge ], [ 0, %entry ]
%.lcssa = phi i32 [ %mul, %while.cond.while.cond1.preheader_crit_edge ], [ %b.promoted, %entry ]
%c.promoted = load i32, ptr %c, align 4, !tbaa !11
%cmp2.not18 = icmp slt i32 %.lcssa, %c.promoted
br i1 %cmp2.not18, label %while.end6, label %while.body3
while.body: ; preds = %entry, %while.body
%cnt.015 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%mul1214 = phi i32 [ %mul, %while.body ], [ %b.promoted, %entry ]
%mul = shl nsw i32 %mul1214, 1
%inc = add nuw nsw i32 %cnt.015, 1
%cmp.not = icmp slt i32 %0, %mul
br i1 %cmp.not, label %while.cond.while.cond1.preheader_crit_edge, label %while.body, !llvm.loop !13
while.body3: ; preds = %while.cond1.preheader, %while.body3
%cnt.120 = phi i32 [ %inc5, %while.body3 ], [ %cnt.0.lcssa, %while.cond1.preheader ]
%mul41719 = phi i32 [ %mul4, %while.body3 ], [ %c.promoted, %while.cond1.preheader ]
%mul4 = shl nsw i32 %mul41719, 1
%inc5 = add nuw nsw i32 %cnt.120, 1
%cmp2.not = icmp slt i32 %.lcssa, %mul4
br i1 %cmp2.not, label %while.cond1.while.end6_crit_edge, label %while.body3, !llvm.loop !14
while.cond1.while.end6_crit_edge: ; preds = %while.body3
store i32 %mul4, ptr %c, align 4, !tbaa !11
br label %while.end6
while.end6: ; preds = %while.cond1.while.end6_crit_edge, %while.cond1.preheader
%cnt.1.lcssa = phi i32 [ %inc5, %while.cond1.while.end6_crit_edge ], [ %cnt.0.lcssa, %while.cond1.preheader ]
%1 = load i32, ptr %k, align 4, !tbaa !11
%cmp7.not = icmp sgt i32 %cnt.1.lcssa, %1
%cond = select i1 %cmp7.not, ptr @.str.2, ptr @.str.1
%call8 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
int compare_int(const void *b,const void *a){
return *(long*)a-*(long*)b;
}
int max(int a,int b){
if(a > b){
return a;
}
return b;
}
int main(void){
int N,H;
scanf("%d%d",&N,&H);
int a,b[N];
int maximam = 0;
for(int i = 0;i < N;i++){
scanf("%d%d",&a,&b[i]);
maximam = max(maximam,a);
}
qsort(b,N,sizeof(int),compare_int);
int cnt;
for(cnt = 0;H > 0 && cnt < N;cnt++){
if(b[cnt] < maximam) break;
H -= b[cnt];
}
if(H > 0) cnt += (H+maximam-1)/maximam;
printf("%d\n",cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278688/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278688/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %b, ptr nocapture noundef readonly %a) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
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 #2 {
entry:
%N = alloca i32, align 4
%H = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %H)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #8
%0 = load i32, ptr %N, align 4, !tbaa !9
%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 !9
%cmp43 = icmp sgt i32 %3, 0
br i1 %cmp43, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %9, %for.body ]
%maximam.0.lcssa = phi i32 [ 0, %entry.for.cond.cleanup_crit_edge ], [ %a.b.i, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare_int) #8
%.pr = load i32, ptr %H, align 4, !tbaa !9
%4 = load i32, ptr %N, align 4
%cmp447 = icmp sgt i32 %.pr, 0
%cmp648 = icmp sgt i32 %4, 0
%5 = select i1 %cmp447, i1 %cmp648, i1 false
br i1 %5, label %for.body8.preheader, label %for.end17
for.body8.preheader: ; preds = %for.cond.cleanup
%6 = zext i32 %4 to i64
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%maximam.044 = phi i32 [ %a.b.i, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx)
%7 = load i32, ptr %a, align 4, !tbaa !9
%a.b.i = call i32 @llvm.smax.i32(i32 %maximam.044, i32 %7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %N, align 4, !tbaa !9
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
for.body8: ; preds = %for.body8.preheader, %if.end
%indvars.iv59 = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next60, %if.end ]
%10 = phi i32 [ %.pr, %for.body8.preheader ], [ %sub, %if.end ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59
%11 = load i32, ptr %arrayidx10, align 4, !tbaa !9
%cmp11 = icmp slt i32 %11, %maximam.0.lcssa
br i1 %cmp11, label %if.then20.loopexit, label %if.end
if.end: ; preds = %for.body8
%sub = sub nsw i32 %10, %11
store i32 %sub, ptr %H, align 4, !tbaa !9
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%cmp4 = icmp sgt i32 %sub, 0
%cmp6 = icmp ult i64 %indvars.iv.next60, %6
%12 = select i1 %cmp4, i1 %cmp6, i1 false
br i1 %12, label %for.body8, label %for.end17.loopexit, !llvm.loop !13
for.end17.loopexit: ; preds = %if.end
%13 = trunc i64 %indvars.iv.next60 to i32
br i1 %cmp4, label %if.then20, label %if.end23
for.end17: ; preds = %for.cond.cleanup
br i1 %cmp447, label %if.then20, label %if.end23
if.then20.loopexit: ; preds = %for.body8
%14 = trunc i64 %indvars.iv59 to i32
br label %if.then20
if.then20: ; preds = %for.end17.loopexit, %if.then20.loopexit, %for.end17
%15 = phi i32 [ %.pr, %for.end17 ], [ %10, %if.then20.loopexit ], [ %sub, %for.end17.loopexit ]
%cnt.040 = phi i32 [ 0, %for.end17 ], [ %14, %if.then20.loopexit ], [ %13, %for.end17.loopexit ]
%add = add nsw i32 %maximam.0.lcssa, -1
%sub21 = add i32 %add, %15
%div = sdiv i32 %sub21, %maximam.0.lcssa
%add22 = add nsw i32 %div, %cnt.040
br label %if.end23
if.end23: ; preds = %for.end17.loopexit, %if.then20, %for.end17
%cnt.1 = phi i32 [ %add22, %if.then20 ], [ 0, %for.end17 ], [ %13, %for.end17.loopexit ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.1)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #8
call void @llvm.lifetime.end.p0(i64 4, 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) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
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 nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 <stdlib.h>
/* ソート関数 */
int int_sort( const void * a , const void * b ) {
/* 引数はvoid*型と規定されているのでint型にcastする */
if( *( int * )a < *( int * )b ) {
return 1;
}
else
if( *( int * )a == *( int * )b ) {
return 0;
}
return -1;
}
int main(void){
int N,H;
scanf("%d %d",&N,&H);
int a[N],b[N];
int maxa=0;
for(int i=0;i<N;i++){
scanf("%d %d",&a[i],&b[i]);
if(maxa<a[i])maxa=a[i];
}
qsort(( void * )b , N , sizeof( b[0] ), int_sort );
int ans=0;
for(int i=0;i<N;i++){
if(maxa>b[i])break;
H-=b[i];
ans++;
if(H<=0){
printf("%d",ans);
return 0;
}
}
ans+=(H+maxa-1)/maxa;
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278730/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278730/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @int_sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%H = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %H)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp61 = icmp sgt i32 %3, 0
br i1 %cmp61, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %8, %for.body ]
%maxa.0.lcssa = phi i32 [ 0, %entry.for.cond.cleanup_crit_edge ], [ %spec.select, %for.body ]
call void @qsort(ptr noundef nonnull %vla1, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @int_sort) #7
%5 = load i32, ptr %N, align 4, !tbaa !5
%H.promoted = load i32, ptr %H, align 4, !tbaa !5
%cmp1266 = icmp sgt i32 %5, 0
br i1 %cmp1266, label %for.body15.preheader, label %for.end32
for.body15.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %5 to i64
br label %for.body15
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%maxa.062 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%arrayidx3 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %maxa.062, i32 %6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %N, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond11: ; preds = %if.end21
%exitcond.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count
br i1 %exitcond.not, label %for.end32, label %for.body15, !llvm.loop !11
for.body15: ; preds = %for.body15.preheader, %for.cond11
%indvars.iv74 = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next75, %for.cond11 ]
%sub6567 = phi i32 [ %H.promoted, %for.body15.preheader ], [ %sub, %for.cond11 ]
%arrayidx17 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv74
%9 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %maxa.0.lcssa, %9
br i1 %cmp18, label %for.end32.loopexit.split.loop.exit79, label %if.end21
if.end21: ; preds = %for.body15
%sub = sub nsw i32 %sub6567, %9
store i32 %sub, ptr %H, align 4, !tbaa !5
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%cmp25 = icmp slt i32 %sub, 1
br i1 %cmp25, label %cleanup, label %for.cond11
cleanup: ; preds = %if.end21
%indvars77 = trunc i64 %indvars.iv.next75 to i32
br label %cleanup36
for.end32.loopexit.split.loop.exit79: ; preds = %for.body15
%indvars78.le = trunc i64 %indvars.iv74 to i32
br label %for.end32
for.end32: ; preds = %for.cond11, %for.end32.loopexit.split.loop.exit79, %for.cond.cleanup
%10 = phi i32 [ %H.promoted, %for.cond.cleanup ], [ %sub6567, %for.end32.loopexit.split.loop.exit79 ], [ %sub, %for.cond11 ]
%ans.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ %indvars78.le, %for.end32.loopexit.split.loop.exit79 ], [ %5, %for.cond11 ]
%add = add nsw i32 %maxa.0.lcssa, -1
%sub33 = add i32 %add, %10
%div = sdiv i32 %sub33, %maxa.0.lcssa
%add34 = add nsw i32 %div, %ans.0.lcssa
br label %cleanup36
cleanup36: ; preds = %cleanup, %for.end32
%indvars77.sink = phi i32 [ %indvars77, %cleanup ], [ %add34, %for.end32 ]
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %indvars77.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int n;
scanf("%d", &n);
int x[n],y[n];
for(int i=0;i<n;i++){
scanf("%d %d", &x[i], &y[i]);
}
for(int i=0;i<n-2;i++){
if((x[i] == y[i]) && (x[i+1] == y[i+1]) &&(x[i+2] == y[i+2])){
printf("Yes\n");
return 0;
}
}
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278774/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278774/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.4 = 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) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp47 = icmp sgt i32 %3, 0
br i1 %cmp47, label %for.body, label %cleanup34
for.cond6.preheader: ; preds = %for.body
%cmp7.not49 = icmp sgt i32 %5, 2
br i1 %cmp7.not49, label %for.body9.preheader, label %cleanup34
for.body9.preheader: ; preds = %for.cond6.preheader
%sub = add nsw i32 %5, -2
%wide.trip.count = zext i32 %sub to i64
br label %for.body9
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%arrayidx3 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.body9: ; preds = %for.body9.preheader, %for.inc30
%indvars.iv53 = phi i64 [ 0, %for.body9.preheader ], [ %9, %for.inc30 ]
%arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv53
%7 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv53
%8 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14 = icmp eq i32 %7, %8
%9 = add nuw nsw i64 %indvars.iv53, 1
br i1 %cmp14, label %land.lhs.true, label %for.inc30
land.lhs.true: ; preds = %for.body9
%arrayidx16 = getelementptr inbounds i32, ptr %vla, i64 %9
%10 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds i32, ptr %vla1, i64 %9
%11 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20 = icmp eq i32 %10, %11
br i1 %cmp20, label %land.lhs.true21, label %for.inc30
land.lhs.true21: ; preds = %land.lhs.true
%12 = add nuw nsw i64 %indvars.iv53, 2
%arrayidx24 = getelementptr inbounds i32, ptr %vla, i64 %12
%13 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds i32, ptr %vla1, i64 %12
%14 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28 = icmp eq i32 %13, %14
br i1 %cmp28, label %cleanup34, label %for.inc30
for.inc30: ; preds = %for.body9, %land.lhs.true, %land.lhs.true21
%exitcond.not = icmp eq i64 %9, %wide.trip.count
br i1 %exitcond.not, label %cleanup34, label %for.body9, !llvm.loop !11
cleanup34: ; preds = %for.inc30, %land.lhs.true21, %for.cond6.preheader, %entry
%str.sink = phi ptr [ @str.4, %entry ], [ @str.4, %for.cond6.preheader ], [ @str, %land.lhs.true21 ], [ @str.4, %for.inc30 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @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 willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main() {
int x, _, y, nl;
int counter = 0;
while ((nl = getchar()) != '\n') {}
while (1) {
x = getchar();
if (x == EOF) {
printf("No");
return 0;
}
_ = getchar();
y = getchar();
nl = getchar();
if (x == y) {
counter += 1;
} else {
counter = 0;
}
if (counter == 3) {
printf("Yes");
return 0;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278817/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278817/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
%cmp.not = icmp eq i32 %call.i, 10
br i1 %cmp.not, label %while.cond1, label %while.cond, !llvm.loop !9
while.cond1: ; preds = %while.cond, %if.end
%counter.0 = phi i32 [ %counter.1, %if.end ], [ 0, %while.cond ]
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i22 = tail call i32 @getc(ptr noundef %1)
%cmp4 = icmp eq i32 %call.i22, -1
br i1 %cmp4, label %cleanup, label %if.end
if.end: ; preds = %while.cond1
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i23 = tail call i32 @getc(ptr noundef %2)
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i24 = tail call i32 @getc(ptr noundef %3)
%4 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i25 = tail call i32 @getc(ptr noundef %4)
%cmp9 = icmp eq i32 %call.i22, %call.i24
%add = add nsw i32 %counter.0, 1
%counter.1 = select i1 %cmp9, i32 %add, i32 0
%cmp12 = icmp eq i32 %counter.1, 3
br i1 %cmp12, label %cleanup, label %while.cond1
cleanup: ; preds = %if.end, %while.cond1
%.str.1.sink = phi ptr [ @.str, %while.cond1 ], [ @.str.1, %if.end ]
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int N, DB, DA;
int judge = 0;
//Db Dbefor Da Dafter
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%d %d", &DA, &DB);
if (judge!=3) {
if (DA == DB)
judge++;
else
judge = 0;
}
}
if (judge == 3)
printf("Yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278860/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"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:
%N = alloca i32, align 4
%DB = alloca i32, align 4
%DA = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %DB) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %DA) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.body, label %if.else10
for.cond.cleanup: ; preds = %for.inc
%1 = icmp eq i32 %spec.select, 3
br i1 %1, label %if.end12, label %if.else10
for.body: ; preds = %entry, %for.body.backedge
%i.018 = phi i32 [ %i.018.be, %for.body.backedge ], [ 0, %entry ]
%judge.017 = phi i32 [ %judge.017.be, %for.body.backedge ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %DA, ptr noundef nonnull %DB)
%cmp2.not = icmp eq i32 %judge.017, 3
br i1 %cmp2.not, label %for.inc.thread, label %for.inc
for.inc: ; preds = %for.body
%2 = load i32, ptr %DA, align 4, !tbaa !5
%3 = load i32, ptr %DB, align 4, !tbaa !5
%cmp3 = icmp eq i32 %2, %3
%inc = add nsw i32 %judge.017, 1
%spec.select = select i1 %cmp3, i32 %inc, i32 0
%inc6 = add nuw nsw i32 %i.018, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc6, %4
br i1 %cmp, label %for.body.backedge, label %for.cond.cleanup
for.body.backedge: ; preds = %for.inc, %for.inc.thread
%i.018.be = phi i32 [ %inc6, %for.inc ], [ %inc621, %for.inc.thread ]
%judge.017.be = phi i32 [ %spec.select, %for.inc ], [ 3, %for.inc.thread ]
br label %for.body, !llvm.loop !9
for.inc.thread: ; preds = %for.body
%inc621 = add nuw nsw i32 %i.018, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%cmp22 = icmp slt i32 %inc621, %5
br i1 %cmp22, label %for.body.backedge, label %if.end12
if.else10: ; preds = %entry, %for.cond.cleanup
br label %if.end12
if.end12: ; preds = %for.inc.thread, %for.cond.cleanup, %if.else10
%.str.3.sink = phi ptr [ @.str.3, %if.else10 ], [ @.str.2, %for.cond.cleanup ], [ @.str.2, %for.inc.thread ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %DA) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %DB) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.