Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main()
{
long long int t,i,j,s=0,k,n;
scanf("%lld",&t);
while(t--)
{
scanf("%lld",&n);
long long int a[n];
for(i=0;i<n;i++)
scanf("%lld",&a[i]);
for(i=1;i<n-2;i++)
{
if(a[i]>a[i-1]&&a[i]>a[i+1])
{
if(a[i]>a[i+2])
{
a[i+1]=a[i];
s++;
}
else
{
a[i+1]=a[i+2];
s++;
}
}
}
if(a[n-2]>a[n-1]&&a[n-2]>a[n-3]){
a[n-1]=a[n-2];s++;
}
printf("%d\n",s);
for(i=0;i<n;i++)
printf("%d ",a[i]);
s=0;
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1390/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1390/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%dec90 = add nsw i64 %0, -1
store i64 %dec90, ptr %t, align 8, !tbaa !5
%tobool.not91 = icmp eq i64 %0, 0
br i1 %tobool.not91, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end57
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !5
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp81 = icmp sgt i64 %3, 0
br i1 %cmp81, label %for.body, label %for.cond3.preheader.thread
for.cond3.preheader.thread: ; preds = %while.body
%sub94 = add i64 %3, -2
br label %for.end30
for.cond3.preheader: ; preds = %for.body
%sub = add i64 %4, -2
%cmp483 = icmp sgt i64 %4, 3
br i1 %cmp483, label %for.body5, label %for.end30
for.body: ; preds = %while.body, %for.body
%i.082 = phi i64 [ %inc, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.082
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.082, 1
%4 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %4
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.body5: ; preds = %for.cond3.preheader, %for.inc28
%i.185 = phi i64 [ %inc29, %for.inc28 ], [ 1, %for.cond3.preheader ]
%s.184 = phi i64 [ %s.2, %for.inc28 ], [ 0, %for.cond3.preheader ]
%arrayidx6 = getelementptr inbounds i64, ptr %vla, i64 %i.185
%5 = load i64, ptr %arrayidx6, align 8, !tbaa !5
%arrayidx8 = getelementptr i64, ptr %arrayidx6, i64 -1
%6 = load i64, ptr %arrayidx8, align 8, !tbaa !5
%cmp9 = icmp sgt i64 %5, %6
br i1 %cmp9, label %land.lhs.true, label %for.inc28
land.lhs.true: ; preds = %for.body5
%arrayidx11 = getelementptr i64, ptr %arrayidx6, i64 1
%7 = load i64, ptr %arrayidx11, align 8, !tbaa !5
%cmp12 = icmp sgt i64 %5, %7
br i1 %cmp12, label %if.then, label %for.inc28
if.then: ; preds = %land.lhs.true
%arrayidx15 = getelementptr i64, ptr %arrayidx6, i64 2
%8 = load i64, ptr %arrayidx15, align 8, !tbaa !5
%inc21 = add nsw i64 %s.184, 1
%. = call i64 @llvm.smax.i64(i64 %5, i64 %8)
store i64 %., ptr %arrayidx11, align 8, !tbaa !5
br label %for.inc28
for.inc28: ; preds = %if.then, %for.body5, %land.lhs.true
%s.2 = phi i64 [ %s.184, %land.lhs.true ], [ %s.184, %for.body5 ], [ %inc21, %if.then ]
%inc29 = add nuw nsw i64 %i.185, 1
%exitcond.not = icmp eq i64 %inc29, %sub
br i1 %exitcond.not, label %for.end30, label %for.body5, !llvm.loop !11
for.end30: ; preds = %for.inc28, %for.cond3.preheader.thread, %for.cond3.preheader
%sub97 = phi i64 [ %sub, %for.cond3.preheader ], [ %sub94, %for.cond3.preheader.thread ], [ %sub, %for.inc28 ]
%.lcssa96 = phi i64 [ %4, %for.cond3.preheader ], [ %3, %for.cond3.preheader.thread ], [ %4, %for.inc28 ]
%s.1.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ 0, %for.cond3.preheader.thread ], [ %s.2, %for.inc28 ]
%arrayidx32 = getelementptr inbounds i64, ptr %vla, i64 %sub97
%9 = load i64, ptr %arrayidx32, align 8, !tbaa !5
%10 = getelementptr i64, ptr %vla, i64 %.lcssa96
%arrayidx34 = getelementptr i64, ptr %10, i64 -1
%11 = load i64, ptr %arrayidx34, align 8, !tbaa !5
%cmp35 = icmp sgt i64 %9, %11
br i1 %cmp35, label %land.lhs.true36, label %if.end48
land.lhs.true36: ; preds = %for.end30
%arrayidx40 = getelementptr i64, ptr %10, i64 -3
%12 = load i64, ptr %arrayidx40, align 8, !tbaa !5
%cmp41 = icmp sgt i64 %9, %12
br i1 %cmp41, label %if.then42, label %if.end48
if.then42: ; preds = %land.lhs.true36
store i64 %9, ptr %arrayidx34, align 8, !tbaa !5
%inc47 = add nsw i64 %s.1.lcssa, 1
br label %if.end48
if.end48: ; preds = %if.then42, %land.lhs.true36, %for.end30
%s.3 = phi i64 [ %inc47, %if.then42 ], [ %s.1.lcssa, %land.lhs.true36 ], [ %s.1.lcssa, %for.end30 ]
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %s.3)
%13 = load i64, ptr %n, align 8, !tbaa !5
%cmp5188 = icmp sgt i64 %13, 0
br i1 %cmp5188, label %for.body52, label %for.end57
for.body52: ; preds = %if.end48, %for.body52
%i.289 = phi i64 [ %inc56, %for.body52 ], [ 0, %if.end48 ]
%arrayidx53 = getelementptr inbounds i64, ptr %vla, i64 %i.289
%14 = load i64, ptr %arrayidx53, align 8, !tbaa !5
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %14)
%inc56 = add nuw nsw i64 %i.289, 1
%15 = load i64, ptr %n, align 8, !tbaa !5
%cmp51 = icmp slt i64 %inc56, %15
br i1 %cmp51, label %for.body52, label %for.end57, !llvm.loop !12
for.end57: ; preds = %for.body52, %if.end48
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %2)
%16 = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %16, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %16, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %for.end57, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
#define MAX_H 100000
#define MAX_W 100000
#define MAX_C 1000000007
long long H, W, A, B;
long long fact[MAX_H+MAX_W];
long long i_fact[MAX_H+MAX_W];
long long bin_pow(long long x){
long long n=MAX_C-2, p=x, y=1;
while (n>0) {
if (n%2==0){
p = ((long long)p*p) % MAX_C;
n = n/2;
} else {
y = ((long long)y*p) % MAX_C;
n--;
}
}
return y;
}
void set(){
long long i;
fact[0] = 1; i_fact[0] = 1;
for (i=1; i<=H+W-2; i++){
fact[i] = ((long long)fact[i-1] * i) % MAX_C;
i_fact[i] = bin_pow(fact[i]);
}
}
long long combi(long long n, long long r){
long long y;
y = (fact[n] * i_fact[r]) % MAX_C;
y = (y * i_fact[n-r]) % MAX_C;
return y;
}
int main(){
long long x, y, ans=0, i;
scanf("%lld%lld%lld%lld", &H, &W, &A, &B);
set();
x = B; y = H-A-1;
for (i=B; i<W; i++) {
ans += combi(H-A+i-1, i) * combi(W+A-i-2, A-1);
ans = ans % MAX_C;
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139042/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139042/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@fact = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16
@i_fact = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16
@H = dso_local global i64 0, align 8
@W = dso_local global i64 0, align 8
@.str = private unnamed_addr constant [17 x i8] c"%lld%lld%lld%lld\00", align 1
@A = dso_local global i64 0, align 8
@B = dso_local global i64 0, align 8
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bin_pow(i64 noundef %x) local_unnamed_addr #0 {
entry:
br label %while.body
while.body: ; preds = %entry, %if.end
%y.014 = phi i64 [ 1, %entry ], [ %y.1, %if.end ]
%p.013 = phi i64 [ %x, %entry ], [ %p.1, %if.end ]
%n.012 = phi i64 [ 1000000005, %entry ], [ %n.1, %if.end ]
%rem = and i64 %n.012, 1
%cmp1 = icmp eq i64 %rem, 0
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%mul = mul nsw i64 %p.013, %p.013
%rem2 = urem i64 %mul, 1000000007
%div11 = lshr i64 %n.012, 1
br label %if.end
if.else: ; preds = %while.body
%mul3 = mul nsw i64 %y.014, %p.013
%rem4 = srem i64 %mul3, 1000000007
%dec = add nsw i64 %n.012, -1
br label %if.end
if.end: ; preds = %if.else, %if.then
%n.1 = phi i64 [ %div11, %if.then ], [ %dec, %if.else ]
%p.1 = phi i64 [ %rem2, %if.then ], [ %p.013, %if.else ]
%y.1 = phi i64 [ %y.014, %if.then ], [ %rem4, %if.else ]
%cmp = icmp sgt i64 %n.1, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !5
while.end: ; preds = %if.end
ret i64 %y.1
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @set() local_unnamed_addr #1 {
entry:
store i64 1, ptr @fact, align 16, !tbaa !7
store i64 1, ptr @i_fact, align 16, !tbaa !7
%0 = load i64, ptr @H, align 8, !tbaa !7
%1 = load i64, ptr @W, align 8, !tbaa !7
%add = add i64 %0, -2
%sub = add i64 %add, %1
%cmp.not11 = icmp slt i64 %sub, 1
br i1 %cmp.not11, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%2 = add i64 %1, %0
%3 = add i64 %2, -2
br label %for.body
for.body: ; preds = %for.body.preheader, %bin_pow.exit
%4 = phi i64 [ %rem, %bin_pow.exit ], [ 1, %for.body.preheader ]
%i.012 = phi i64 [ %inc, %bin_pow.exit ], [ 1, %for.body.preheader ]
%mul = mul nsw i64 %4, %i.012
%rem = srem i64 %mul, 1000000007
%arrayidx2 = getelementptr inbounds [200000 x i64], ptr @fact, i64 0, i64 %i.012
store i64 %rem, ptr %arrayidx2, align 8, !tbaa !7
br label %while.body.i
while.body.i: ; preds = %if.end.i, %for.body
%y.014.i = phi i64 [ 1, %for.body ], [ %y.1.i, %if.end.i ]
%p.013.i = phi i64 [ %rem, %for.body ], [ %p.1.i, %if.end.i ]
%n.012.i = phi i64 [ 1000000005, %for.body ], [ %n.1.i, %if.end.i ]
%rem.i = and i64 %n.012.i, 1
%cmp1.i = icmp eq i64 %rem.i, 0
br i1 %cmp1.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %while.body.i
%mul.i = mul nsw i64 %p.013.i, %p.013.i
%rem2.i = urem i64 %mul.i, 1000000007
%div11.i = lshr i64 %n.012.i, 1
br label %if.end.i
if.else.i: ; preds = %while.body.i
%mul3.i = mul nsw i64 %p.013.i, %y.014.i
%rem4.i = srem i64 %mul3.i, 1000000007
%dec.i = add nsw i64 %n.012.i, -1
br label %if.end.i
if.end.i: ; preds = %if.else.i, %if.then.i
%n.1.i = phi i64 [ %div11.i, %if.then.i ], [ %dec.i, %if.else.i ]
%p.1.i = phi i64 [ %rem2.i, %if.then.i ], [ %p.013.i, %if.else.i ]
%y.1.i = phi i64 [ %y.014.i, %if.then.i ], [ %rem4.i, %if.else.i ]
%cmp.i = icmp sgt i64 %n.1.i, 0
br i1 %cmp.i, label %while.body.i, label %bin_pow.exit, !llvm.loop !5
bin_pow.exit: ; preds = %if.end.i
%arrayidx4 = getelementptr inbounds [200000 x i64], ptr @i_fact, i64 0, i64 %i.012
store i64 %y.1.i, ptr %arrayidx4, align 8, !tbaa !7
%inc = add nuw i64 %i.012, 1
%exitcond.not = icmp eq i64 %i.012, %3
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %bin_pow.exit, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @combi(i64 noundef %n, i64 noundef %r) local_unnamed_addr #2 {
entry:
%arrayidx = getelementptr inbounds [200000 x i64], ptr @fact, i64 0, i64 %n
%0 = load i64, ptr %arrayidx, align 8, !tbaa !7
%arrayidx1 = getelementptr inbounds [200000 x i64], ptr @i_fact, i64 0, i64 %r
%1 = load i64, ptr %arrayidx1, align 8, !tbaa !7
%mul = mul nsw i64 %1, %0
%rem = srem i64 %mul, 1000000007
%sub = sub nsw i64 %n, %r
%arrayidx2 = getelementptr inbounds [200000 x i64], ptr @i_fact, i64 0, i64 %sub
%2 = load i64, ptr %arrayidx2, align 8, !tbaa !7
%mul3 = mul nsw i64 %rem, %2
%rem4 = srem i64 %mul3, 1000000007
ret i64 %rem4
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @H, ptr noundef nonnull @W, ptr noundef nonnull @A, ptr noundef nonnull @B)
store i64 1, ptr @fact, align 16, !tbaa !7
store i64 1, ptr @i_fact, align 16, !tbaa !7
%0 = load i64, ptr @H, align 8, !tbaa !7
%1 = load i64, ptr @W, align 8, !tbaa !7
%add.i = add i64 %0, -2
%sub.i = add i64 %add.i, %1
%cmp.not11.i = icmp slt i64 %sub.i, 1
br i1 %cmp.not11.i, label %set.exit, label %for.body.i
for.body.i: ; preds = %entry, %bin_pow.exit.i
%2 = phi i64 [ %rem.i, %bin_pow.exit.i ], [ 1, %entry ]
%i.012.i = phi i64 [ %inc.i, %bin_pow.exit.i ], [ 1, %entry ]
%mul.i = mul nsw i64 %i.012.i, %2
%rem.i = srem i64 %mul.i, 1000000007
%arrayidx2.i = getelementptr inbounds [200000 x i64], ptr @fact, i64 0, i64 %i.012.i
store i64 %rem.i, ptr %arrayidx2.i, align 8, !tbaa !7
br label %while.body.i.i
while.body.i.i: ; preds = %if.end.i.i, %for.body.i
%y.014.i.i = phi i64 [ 1, %for.body.i ], [ %y.1.i.i, %if.end.i.i ]
%p.013.i.i = phi i64 [ %rem.i, %for.body.i ], [ %p.1.i.i, %if.end.i.i ]
%n.012.i.i = phi i64 [ 1000000005, %for.body.i ], [ %n.1.i.i, %if.end.i.i ]
%rem.i.i = and i64 %n.012.i.i, 1
%cmp1.i.i = icmp eq i64 %rem.i.i, 0
br i1 %cmp1.i.i, label %if.then.i.i, label %if.else.i.i
if.then.i.i: ; preds = %while.body.i.i
%mul.i.i = mul nsw i64 %p.013.i.i, %p.013.i.i
%rem2.i.i = urem i64 %mul.i.i, 1000000007
%div11.i.i = lshr i64 %n.012.i.i, 1
br label %if.end.i.i
if.else.i.i: ; preds = %while.body.i.i
%mul3.i.i = mul nsw i64 %p.013.i.i, %y.014.i.i
%rem4.i.i = srem i64 %mul3.i.i, 1000000007
%dec.i.i = add nsw i64 %n.012.i.i, -1
br label %if.end.i.i
if.end.i.i: ; preds = %if.else.i.i, %if.then.i.i
%n.1.i.i = phi i64 [ %div11.i.i, %if.then.i.i ], [ %dec.i.i, %if.else.i.i ]
%p.1.i.i = phi i64 [ %rem2.i.i, %if.then.i.i ], [ %p.013.i.i, %if.else.i.i ]
%y.1.i.i = phi i64 [ %y.014.i.i, %if.then.i.i ], [ %rem4.i.i, %if.else.i.i ]
%cmp.i.i = icmp sgt i64 %n.1.i.i, 0
br i1 %cmp.i.i, label %while.body.i.i, label %bin_pow.exit.i, !llvm.loop !5
bin_pow.exit.i: ; preds = %if.end.i.i
%arrayidx4.i = getelementptr inbounds [200000 x i64], ptr @i_fact, i64 0, i64 %i.012.i
store i64 %y.1.i.i, ptr %arrayidx4.i, align 8, !tbaa !7
%inc.i = add nuw i64 %i.012.i, 1
%exitcond.not.i = icmp eq i64 %i.012.i, %sub.i
br i1 %exitcond.not.i, label %set.exit, label %for.body.i, !llvm.loop !11
set.exit: ; preds = %bin_pow.exit.i, %entry
%3 = load i64, ptr @B, align 8, !tbaa !7
%cmp30 = icmp slt i64 %3, %1
br i1 %cmp30, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %set.exit
%4 = load i64, ptr @A, align 8, !tbaa !7
%sub2 = add i64 %0, -1
%add5 = add i64 %1, -2
%sub8 = add nsw i64 %4, -1
%arrayidx1.i23 = getelementptr inbounds [200000 x i64], ptr @i_fact, i64 0, i64 %sub8
%5 = load i64, ptr %arrayidx1.i23, align 8, !tbaa !7
%6 = sub i64 %sub2, %4
%arrayidx2.i21.phi.trans.insert = getelementptr inbounds [200000 x i64], ptr @i_fact, i64 0, i64 %6
%.pre = load i64, ptr %arrayidx2.i21.phi.trans.insert, align 8, !tbaa !7
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%i.032 = phi i64 [ %3, %for.body.lr.ph ], [ %inc, %for.body ]
%ans.031 = phi i64 [ 0, %for.body.lr.ph ], [ %rem, %for.body ]
%add = add i64 %sub2, %i.032
%sub3 = sub i64 %add, %4
%arrayidx.i = getelementptr inbounds [200000 x i64], ptr @fact, i64 0, i64 %sub3
%7 = load i64, ptr %arrayidx.i, align 8, !tbaa !7
%arrayidx1.i = getelementptr inbounds [200000 x i64], ptr @i_fact, i64 0, i64 %i.032
%8 = load i64, ptr %arrayidx1.i, align 8, !tbaa !7
%mul.i18 = mul nsw i64 %8, %7
%rem.i19 = srem i64 %mul.i18, 1000000007
%mul3.i = mul nsw i64 %rem.i19, %.pre
%rem4.i = srem i64 %mul3.i, 1000000007
%sub6 = sub i64 %add5, %i.032
%sub7 = add i64 %sub6, %4
%arrayidx.i22 = getelementptr inbounds [200000 x i64], ptr @fact, i64 0, i64 %sub7
%9 = load i64, ptr %arrayidx.i22, align 8, !tbaa !7
%mul.i24 = mul nsw i64 %5, %9
%rem.i25 = srem i64 %mul.i24, 1000000007
%sub.i26 = sub nsw i64 %sub7, %sub8
%arrayidx2.i27 = getelementptr inbounds [200000 x i64], ptr @i_fact, i64 0, i64 %sub.i26
%10 = load i64, ptr %arrayidx2.i27, align 8, !tbaa !7
%mul3.i28 = mul nsw i64 %rem.i25, %10
%rem4.i29 = srem i64 %mul3.i28, 1000000007
%mul = mul nsw i64 %rem4.i29, %rem4.i
%add10 = add nsw i64 %mul, %ans.031
%rem = srem i64 %add10, 1000000007
%inc = add nsw i64 %i.032, 1
%exitcond.not = icmp eq i64 %inc, %1
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body, %set.exit
%ans.0.lcssa = phi i64 [ 0, %set.exit ], [ %rem, %for.body ]
%call11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
|
#include <stdio.h>
#include <stdlib.h>
#define int long long
#define p (int)(1e9 + 7)
int MOD(int a){
a %= p;
return a >= 0 ? a : a + p;
}
int rank(int **A, int N){
int i, j, k, l, *tmp;
for(i = 0, j = 0; j < N; j++){
// printf("(i, j) = (%lld, %lld)\n", i, j);
for(k = i; k < N && A[k][j] == 0; k++);
// printf("k = %lld\n", k);
if(k == N){
continue;
}
tmp = A[i];
A[i] = A[k];
A[k] = tmp;
for(k = 0; k < N; k++){
if(i == k || A[k][j] == 0){
continue;
}
for(l = j; l < N; l++){
A[k][l] ^= A[i][l];
}
}
i++;
}
return i;
}
signed main(){
int N, R, i, j, k;
scanf("%lld", &N);
int **C = (int **)malloc(sizeof(int *) * N);
for(i = 0; i < N; i++){
C[i] = (int *)malloc(sizeof(int) * N);
for(j = 0; j < N; j++){
scanf("%lld", &C[i][j]);
}
}
R = rank(C, N);
// printf("R = %lld\n", R);
int *pow2 = (int *)malloc(sizeof(int) * (N * N + 1));
pow2[0] = 1;
for(i = 1; i <= N * N; i++){
pow2[i] = MOD(pow2[i - 1] * 2);
}
int ***dp = (int ***)malloc(sizeof(int **) * (N + 1));
for(i = 0; i <= N; i++){
dp[i] = (int **)malloc(sizeof(int *) * (N + 2));
for(j = 0; j <= N + 1; j++){
dp[i][j] = (int *)malloc(sizeof(int) * (N + 2));
for(k = 0; k <= N + 1; k++){
dp[i][j][k] = 0;
}
}
}
dp[0][0][0] = 1;
for(i = 0; i < N; i++){
for(j = 0; j <= N; j++){
for(k = 0; k <= N; k++){
if(k > R || j < k){
dp[i][j][k] = 0;
}
else{
dp[i + 1][j][k] = MOD(dp[i + 1][j][k] + pow2[j] * dp[i][j][k]);
dp[i + 1][j + 1][k] = MOD(dp[i + 1][j + 1][k] + MOD(pow2[N] - pow2[R - k + j]) * dp[i][j][k]);
dp[i + 1][j + 1][k + 1] = MOD(dp[i + 1][j + 1][k + 1] + MOD(pow2[R - k + j] - pow2[j]) * dp[i][j][k]);
}
}
}
}
/* for(i = 0; i <= N; i++){
for(j = 0; j <= N; j++){
for(k = 0; k <= N; k++){
printf("dp[%lld][%lld][%lld] = %lld\n", i, j, k, dp[i][j][k]);
}
}
printf("\n");
}
*/ int ans = 0;
for(j = 0; j <= N; j++){
ans = MOD(ans + pow2[N * (N - j)] * dp[N][j][R]);
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139086/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139086/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @MOD(i64 noundef %a) local_unnamed_addr #0 {
entry:
%rem = srem i64 %a, 1000000007
%add = add nsw i64 %rem, 1000000007
%cmp4 = icmp slt i64 %rem, 0
%cond = select i1 %cmp4, i64 %add, i64 %rem
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @rank(ptr nocapture noundef %A, i64 noundef %N) local_unnamed_addr #1 {
entry:
%cmp78 = icmp sgt i64 %N, 0
br i1 %cmp78, label %for.cond1.preheader.us, label %for.end36
for.cond1.preheader.us: ; preds = %entry, %for.inc34.us
%i.082.us = phi i64 [ %i.1.us, %for.inc34.us ], [ 0, %entry ]
%j.079.us = phi i64 [ %inc35.us, %for.inc34.us ], [ 0, %entry ]
%0 = add nuw i64 %j.079.us, 1
%smax108 = tail call i64 @llvm.smax.i64(i64 %N, i64 %0)
%1 = sub i64 %smax108, %j.079.us
%2 = shl i64 %j.079.us, 3
%3 = add i64 %2, 8
%4 = add nuw i64 %j.079.us, 1
%smax = tail call i64 @llvm.smax.i64(i64 %N, i64 %4)
%5 = xor i64 %j.079.us, -1
%6 = add i64 %smax, %5
%7 = shl i64 %6, 3
%8 = add i64 %3, %7
%cmp271.us = icmp slt i64 %i.082.us, %N
br i1 %cmp271.us, label %land.rhs.us, label %for.end.us
land.rhs.us: ; preds = %for.cond1.preheader.us, %for.inc.us
%k.072.us = phi i64 [ %inc.us, %for.inc.us ], [ %i.082.us, %for.cond1.preheader.us ]
%arrayidx.us = getelementptr inbounds ptr, ptr %A, i64 %k.072.us
%9 = load ptr, ptr %arrayidx.us, align 8, !tbaa !5
%arrayidx3.us = getelementptr inbounds i64, ptr %9, i64 %j.079.us
%10 = load i64, ptr %arrayidx3.us, align 8, !tbaa !9
%cmp4.us = icmp eq i64 %10, 0
br i1 %cmp4.us, label %for.inc.us, label %for.end.us
for.end.us: ; preds = %land.rhs.us, %for.cond1.preheader.us
%k.0.lcssa.us = phi i64 [ %i.082.us, %for.cond1.preheader.us ], [ %k.072.us, %land.rhs.us ]
%cmp6.us = icmp eq i64 %k.0.lcssa.us, %N
br i1 %cmp6.us, label %for.inc34.us, label %for.body13.us.us.preheader
for.body13.us.us.preheader: ; preds = %for.end.us
%arrayidx7.us = getelementptr inbounds ptr, ptr %A, i64 %i.082.us
%11 = load ptr, ptr %arrayidx7.us, align 8, !tbaa !5
%arrayidx8.us = getelementptr inbounds ptr, ptr %A, i64 %k.0.lcssa.us
%12 = load ptr, ptr %arrayidx8.us, align 8, !tbaa !5
store ptr %12, ptr %arrayidx7.us, align 8, !tbaa !5
store ptr %11, ptr %arrayidx8.us, align 8, !tbaa !5
%min.iters.check = icmp ult i64 %1, 6
%n.vec = and i64 %1, -4
%ind.end = add i64 %j.079.us, %n.vec
%cmp.n = icmp eq i64 %1, %n.vec
br label %for.body13.us.us
for.inc34.us: ; preds = %for.inc.us, %for.cond11.for.end32_crit_edge.us, %for.end.us
%i.1.us = phi i64 [ %i.082.us, %for.end.us ], [ %inc33.us, %for.cond11.for.end32_crit_edge.us ], [ %i.082.us, %for.inc.us ]
%inc35.us = add nuw nsw i64 %j.079.us, 1
%exitcond100.not = icmp eq i64 %inc35.us, %N
br i1 %exitcond100.not, label %for.end36, label %for.cond1.preheader.us, !llvm.loop !11
for.inc.us: ; preds = %land.rhs.us
%inc.us = add i64 %k.072.us, 1
%exitcond.not = icmp eq i64 %inc.us, %N
br i1 %exitcond.not, label %for.inc34.us, label %land.rhs.us, !llvm.loop !13
for.cond11.for.end32_crit_edge.us: ; preds = %for.inc30.us.us
%inc33.us = add nsw i64 %i.082.us, 1
br label %for.inc34.us
for.body13.us.us: ; preds = %for.body13.us.us.preheader, %for.inc30.us.us
%k.177.us.us = phi i64 [ %inc31.us.us, %for.inc30.us.us ], [ 0, %for.body13.us.us.preheader ]
%cmp14.us.us = icmp eq i64 %i.082.us, %k.177.us.us
br i1 %cmp14.us.us, label %for.inc30.us.us, label %lor.lhs.false.us.us
lor.lhs.false.us.us: ; preds = %for.body13.us.us
%arrayidx15.us.us = getelementptr inbounds ptr, ptr %A, i64 %k.177.us.us
%13 = load ptr, ptr %arrayidx15.us.us, align 8, !tbaa !5
%arrayidx16.us.us = getelementptr inbounds i64, ptr %13, i64 %j.079.us
%14 = load i64, ptr %arrayidx16.us.us, align 8, !tbaa !9
%cmp17.us.us = icmp eq i64 %14, 0
br i1 %cmp17.us.us, label %for.inc30.us.us, label %for.cond20.preheader.us.us
for.body22.us.us: ; preds = %for.body22.us.us.preheader, %for.body22.us.us
%l.075.us.us = phi i64 [ %inc28.us.us, %for.body22.us.us ], [ %l.075.us.us.ph, %for.body22.us.us.preheader ]
%arrayidx24.us.us = getelementptr inbounds i64, ptr %17, i64 %l.075.us.us
%15 = load i64, ptr %arrayidx24.us.us, align 8, !tbaa !9
%arrayidx26.us.us = getelementptr inbounds i64, ptr %13, i64 %l.075.us.us
%16 = load i64, ptr %arrayidx26.us.us, align 8, !tbaa !9
%xor.us.us = xor i64 %16, %15
store i64 %xor.us.us, ptr %arrayidx26.us.us, align 8, !tbaa !9
%inc28.us.us = add nuw nsw i64 %l.075.us.us, 1
%cmp21.us.us = icmp slt i64 %inc28.us.us, %N
br i1 %cmp21.us.us, label %for.body22.us.us, label %for.inc30.us.us, !llvm.loop !14
for.inc30.us.us: ; preds = %for.body22.us.us, %middle.block, %lor.lhs.false.us.us, %for.body13.us.us
%inc31.us.us = add nuw nsw i64 %k.177.us.us, 1
%exitcond99.not = icmp eq i64 %inc31.us.us, %N
br i1 %exitcond99.not, label %for.cond11.for.end32_crit_edge.us, label %for.body13.us.us, !llvm.loop !16
for.cond20.preheader.us.us: ; preds = %lor.lhs.false.us.us
%17 = load ptr, ptr %arrayidx7.us, align 8, !tbaa !5
br i1 %min.iters.check, label %for.body22.us.us.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.cond20.preheader.us.us
%scevgep = getelementptr i8, ptr %13, i64 %2
%scevgep105 = getelementptr i8, ptr %13, i64 %8
%scevgep106 = getelementptr i8, ptr %17, i64 %2
%scevgep107 = getelementptr i8, ptr %17, i64 %8
%bound0 = icmp ult ptr %scevgep, %scevgep107
%bound1 = icmp ult ptr %scevgep106, %scevgep105
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body22.us.us.preheader, label %vector.body
vector.body: ; preds = %vector.memcheck, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
%offset.idx = add i64 %j.079.us, %index
%18 = getelementptr inbounds i64, ptr %17, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %18, align 8, !tbaa !9, !alias.scope !17
%19 = getelementptr inbounds i64, ptr %18, i64 2
%wide.load109 = load <2 x i64>, ptr %19, align 8, !tbaa !9, !alias.scope !17
%20 = getelementptr inbounds i64, ptr %13, i64 %offset.idx
%wide.load110 = load <2 x i64>, ptr %20, align 8, !tbaa !9, !alias.scope !20, !noalias !17
%21 = getelementptr inbounds i64, ptr %20, i64 2
%wide.load111 = load <2 x i64>, ptr %21, align 8, !tbaa !9, !alias.scope !20, !noalias !17
%22 = xor <2 x i64> %wide.load110, %wide.load
%23 = xor <2 x i64> %wide.load111, %wide.load109
store <2 x i64> %22, ptr %20, align 8, !tbaa !9, !alias.scope !20, !noalias !17
store <2 x i64> %23, ptr %21, align 8, !tbaa !9, !alias.scope !20, !noalias !17
%index.next = add nuw i64 %index, 4
%24 = icmp eq i64 %index.next, %n.vec
br i1 %24, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.inc30.us.us, label %for.body22.us.us.preheader
for.body22.us.us.preheader: ; preds = %vector.memcheck, %for.cond20.preheader.us.us, %middle.block
%l.075.us.us.ph = phi i64 [ %j.079.us, %vector.memcheck ], [ %j.079.us, %for.cond20.preheader.us.us ], [ %ind.end, %middle.block ]
br label %for.body22.us.us
for.end36: ; preds = %for.inc34.us, %entry
%i.0.lcssa = phi i64 [ 0, %entry ], [ %i.1.us, %for.inc34.us ]
ret i64 %i.0.lcssa
}
; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%N = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8
%mul = shl i64 %0, 3
%call1 = call noalias ptr @malloc(i64 noundef %mul) #10
%cmp295 = icmp sgt i64 %0, 0
br i1 %cmp295, label %for.body, label %rank.exit
for.body: ; preds = %entry, %for.inc10
%1 = phi i64 [ %3, %for.inc10 ], [ %0, %entry ]
%i.0296 = phi i64 [ %inc11, %for.inc10 ], [ 0, %entry ]
%mul2 = shl i64 %1, 3
%call3 = call noalias ptr @malloc(i64 noundef %mul2) #10
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %i.0296
store ptr %call3, ptr %arrayidx, align 8, !tbaa !5
%cmp5293 = icmp sgt i64 %1, 0
br i1 %cmp5293, label %for.body6, label %for.inc10
for.body6: ; preds = %for.body, %for.body6
%j.0294 = phi i64 [ %inc, %for.body6 ], [ 0, %for.body ]
%arrayidx8 = getelementptr inbounds i64, ptr %call3, i64 %j.0294
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx8)
%inc = add nuw nsw i64 %j.0294, 1
%2 = load i64, ptr %N, align 8
%cmp5 = icmp slt i64 %inc, %2
br i1 %cmp5, label %for.body6, label %for.inc10, !llvm.loop !24
for.inc10: ; preds = %for.body6, %for.body
%3 = phi i64 [ %1, %for.body ], [ %2, %for.body6 ]
%inc11 = add nuw nsw i64 %i.0296, 1
%cmp = icmp slt i64 %inc11, %3
br i1 %cmp, label %for.body, label %for.end12, !llvm.loop !25
for.end12: ; preds = %for.inc10
%cmp78.i = icmp sgt i64 %3, 0
br i1 %cmp78.i, label %for.cond1.preheader.us.i, label %rank.exit
for.cond1.preheader.us.i: ; preds = %for.end12, %for.inc34.us.i
%i.082.us.i = phi i64 [ %i.1.us.i, %for.inc34.us.i ], [ 0, %for.end12 ]
%j.079.us.i = phi i64 [ %inc35.us.i, %for.inc34.us.i ], [ 0, %for.end12 ]
%4 = add nuw i64 %j.079.us.i, 1
%smax356 = call i64 @llvm.smax.i64(i64 %3, i64 %4)
%5 = sub i64 %smax356, %j.079.us.i
%6 = shl i64 %j.079.us.i, 3
%7 = add i64 %6, 8
%8 = add nuw i64 %j.079.us.i, 1
%smax = call i64 @llvm.smax.i64(i64 %3, i64 %8)
%9 = xor i64 %j.079.us.i, -1
%10 = add i64 %smax, %9
%11 = shl i64 %10, 3
%12 = add i64 %7, %11
%cmp271.us.i = icmp slt i64 %i.082.us.i, %3
br i1 %cmp271.us.i, label %land.rhs.us.i, label %for.end.us.i
land.rhs.us.i: ; preds = %for.cond1.preheader.us.i, %for.inc.us.i
%k.072.us.i = phi i64 [ %inc.us.i, %for.inc.us.i ], [ %i.082.us.i, %for.cond1.preheader.us.i ]
%arrayidx.us.i = getelementptr inbounds ptr, ptr %call1, i64 %k.072.us.i
%13 = load ptr, ptr %arrayidx.us.i, align 8, !tbaa !5
%arrayidx3.us.i = getelementptr inbounds i64, ptr %13, i64 %j.079.us.i
%14 = load i64, ptr %arrayidx3.us.i, align 8, !tbaa !9
%cmp4.us.i = icmp eq i64 %14, 0
br i1 %cmp4.us.i, label %for.inc.us.i, label %for.end.us.i
for.end.us.i: ; preds = %land.rhs.us.i, %for.cond1.preheader.us.i
%k.0.lcssa.us.i = phi i64 [ %i.082.us.i, %for.cond1.preheader.us.i ], [ %k.072.us.i, %land.rhs.us.i ]
%cmp6.us.i = icmp eq i64 %k.0.lcssa.us.i, %3
br i1 %cmp6.us.i, label %for.inc34.us.i, label %for.body13.us.us.preheader.i
for.body13.us.us.preheader.i: ; preds = %for.end.us.i
%arrayidx7.us.i = getelementptr inbounds ptr, ptr %call1, i64 %i.082.us.i
%15 = load ptr, ptr %arrayidx7.us.i, align 8, !tbaa !5
%arrayidx8.us.i = getelementptr inbounds ptr, ptr %call1, i64 %k.0.lcssa.us.i
%16 = load ptr, ptr %arrayidx8.us.i, align 8, !tbaa !5
store ptr %16, ptr %arrayidx7.us.i, align 8, !tbaa !5
store ptr %15, ptr %arrayidx8.us.i, align 8, !tbaa !5
%min.iters.check = icmp ult i64 %5, 6
%n.vec = and i64 %5, -4
%ind.end = add i64 %j.079.us.i, %n.vec
%cmp.n = icmp eq i64 %5, %n.vec
br label %for.body13.us.us.i
for.inc34.us.i: ; preds = %for.inc.us.i, %for.cond11.for.end32_crit_edge.us.i, %for.end.us.i
%i.1.us.i = phi i64 [ %i.082.us.i, %for.end.us.i ], [ %inc33.us.i, %for.cond11.for.end32_crit_edge.us.i ], [ %i.082.us.i, %for.inc.us.i ]
%inc35.us.i = add nuw nsw i64 %j.079.us.i, 1
%exitcond100.not.i = icmp eq i64 %inc35.us.i, %3
br i1 %exitcond100.not.i, label %rank.exit.loopexit, label %for.cond1.preheader.us.i, !llvm.loop !11
for.inc.us.i: ; preds = %land.rhs.us.i
%inc.us.i = add i64 %k.072.us.i, 1
%exitcond.not.i = icmp eq i64 %inc.us.i, %3
br i1 %exitcond.not.i, label %for.inc34.us.i, label %land.rhs.us.i, !llvm.loop !13
for.cond11.for.end32_crit_edge.us.i: ; preds = %for.inc30.us.us.i
%inc33.us.i = add nsw i64 %i.082.us.i, 1
br label %for.inc34.us.i
for.body13.us.us.i: ; preds = %for.inc30.us.us.i, %for.body13.us.us.preheader.i
%k.177.us.us.i = phi i64 [ %inc31.us.us.i, %for.inc30.us.us.i ], [ 0, %for.body13.us.us.preheader.i ]
%cmp14.us.us.i = icmp eq i64 %i.082.us.i, %k.177.us.us.i
br i1 %cmp14.us.us.i, label %for.inc30.us.us.i, label %lor.lhs.false.us.us.i
lor.lhs.false.us.us.i: ; preds = %for.body13.us.us.i
%arrayidx15.us.us.i = getelementptr inbounds ptr, ptr %call1, i64 %k.177.us.us.i
%17 = load ptr, ptr %arrayidx15.us.us.i, align 8, !tbaa !5
%arrayidx16.us.us.i = getelementptr inbounds i64, ptr %17, i64 %j.079.us.i
%18 = load i64, ptr %arrayidx16.us.us.i, align 8, !tbaa !9
%cmp17.us.us.i = icmp eq i64 %18, 0
br i1 %cmp17.us.us.i, label %for.inc30.us.us.i, label %for.cond20.preheader.us.us.i
for.body22.us.us.i: ; preds = %for.body22.us.us.i.preheader, %for.body22.us.us.i
%l.075.us.us.i = phi i64 [ %inc28.us.us.i, %for.body22.us.us.i ], [ %l.075.us.us.i.ph, %for.body22.us.us.i.preheader ]
%arrayidx24.us.us.i = getelementptr inbounds i64, ptr %21, i64 %l.075.us.us.i
%19 = load i64, ptr %arrayidx24.us.us.i, align 8, !tbaa !9
%arrayidx26.us.us.i = getelementptr inbounds i64, ptr %17, i64 %l.075.us.us.i
%20 = load i64, ptr %arrayidx26.us.us.i, align 8, !tbaa !9
%xor.us.us.i = xor i64 %20, %19
store i64 %xor.us.us.i, ptr %arrayidx26.us.us.i, align 8, !tbaa !9
%inc28.us.us.i = add nuw nsw i64 %l.075.us.us.i, 1
%cmp21.us.us.i = icmp slt i64 %inc28.us.us.i, %3
br i1 %cmp21.us.us.i, label %for.body22.us.us.i, label %for.inc30.us.us.i, !llvm.loop !27
for.inc30.us.us.i: ; preds = %for.body22.us.us.i, %middle.block, %lor.lhs.false.us.us.i, %for.body13.us.us.i
%inc31.us.us.i = add nuw nsw i64 %k.177.us.us.i, 1
%exitcond99.not.i = icmp eq i64 %inc31.us.us.i, %3
br i1 %exitcond99.not.i, label %for.cond11.for.end32_crit_edge.us.i, label %for.body13.us.us.i, !llvm.loop !16
for.cond20.preheader.us.us.i: ; preds = %lor.lhs.false.us.us.i
%21 = load ptr, ptr %arrayidx7.us.i, align 8, !tbaa !5
br i1 %min.iters.check, label %for.body22.us.us.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.cond20.preheader.us.us.i
%scevgep = getelementptr i8, ptr %17, i64 %6
%scevgep353 = getelementptr i8, ptr %17, i64 %12
%scevgep354 = getelementptr i8, ptr %21, i64 %6
%scevgep355 = getelementptr i8, ptr %21, i64 %12
%bound0 = icmp ult ptr %scevgep, %scevgep355
%bound1 = icmp ult ptr %scevgep354, %scevgep353
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body22.us.us.i.preheader, label %vector.body
vector.body: ; preds = %vector.memcheck, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
%offset.idx = add i64 %j.079.us.i, %index
%22 = getelementptr inbounds i64, ptr %21, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %22, align 8, !tbaa !9, !alias.scope !28
%23 = getelementptr inbounds i64, ptr %22, i64 2
%wide.load357 = load <2 x i64>, ptr %23, align 8, !tbaa !9, !alias.scope !28
%24 = getelementptr inbounds i64, ptr %17, i64 %offset.idx
%wide.load358 = load <2 x i64>, ptr %24, align 8, !tbaa !9, !alias.scope !31, !noalias !28
%25 = getelementptr inbounds i64, ptr %24, i64 2
%wide.load359 = load <2 x i64>, ptr %25, align 8, !tbaa !9, !alias.scope !31, !noalias !28
%26 = xor <2 x i64> %wide.load358, %wide.load
%27 = xor <2 x i64> %wide.load359, %wide.load357
store <2 x i64> %26, ptr %24, align 8, !tbaa !9, !alias.scope !31, !noalias !28
store <2 x i64> %27, ptr %25, align 8, !tbaa !9, !alias.scope !31, !noalias !28
%index.next = add nuw i64 %index, 4
%28 = icmp eq i64 %index.next, %n.vec
br i1 %28, label %middle.block, label %vector.body, !llvm.loop !33
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.inc30.us.us.i, label %for.body22.us.us.i.preheader
for.body22.us.us.i.preheader: ; preds = %vector.memcheck, %for.cond20.preheader.us.us.i, %middle.block
%l.075.us.us.i.ph = phi i64 [ %j.079.us.i, %vector.memcheck ], [ %j.079.us.i, %for.cond20.preheader.us.us.i ], [ %ind.end, %middle.block ]
br label %for.body22.us.us.i
rank.exit.loopexit: ; preds = %for.inc34.us.i
%.pre = load i64, ptr %N, align 8
br label %rank.exit
rank.exit: ; preds = %entry, %rank.exit.loopexit, %for.end12
%29 = phi i64 [ %3, %for.end12 ], [ %.pre, %rank.exit.loopexit ], [ %0, %entry ]
%i.0.lcssa.i = phi i64 [ 0, %for.end12 ], [ %i.1.us.i, %rank.exit.loopexit ], [ 0, %entry ]
%mul14 = mul nsw i64 %29, %29
%add = shl i64 %mul14, 3
%mul15 = add i64 %add, 8
%call16 = call noalias ptr @malloc(i64 noundef %mul15) #10
store i64 1, ptr %call16, align 8, !tbaa !9
%cmp20.not298 = icmp eq i64 %29, 0
br i1 %cmp20.not298, label %for.end28, label %for.body21.preheader
for.body21.preheader: ; preds = %rank.exit
%umax = call i64 @llvm.umax.i64(i64 %mul14, i64 1)
%load_initial = load i64, ptr %call16, align 8
%xtraiter = and i64 %umax, 1
%30 = icmp ult i64 %mul14, 2
br i1 %30, label %for.end28.loopexit.unr-lcssa, label %for.body21.preheader.new
for.body21.preheader.new: ; preds = %for.body21.preheader
%unroll_iter = and i64 %umax, 9223372036854775806
%invariant.gep372 = getelementptr i64, ptr %call16, i64 1
br label %for.body21
for.body21: ; preds = %for.body21, %for.body21.preheader.new
%store_forwarded = phi i64 [ %load_initial, %for.body21.preheader.new ], [ %cond.i.1, %for.body21 ]
%i.1299 = phi i64 [ 1, %for.body21.preheader.new ], [ %inc27.1, %for.body21 ]
%niter = phi i64 [ 0, %for.body21.preheader.new ], [ %niter.next.1, %for.body21 ]
%31 = getelementptr i64, ptr %call16, i64 %i.1299
%mul23 = shl nsw i64 %store_forwarded, 1
%rem.i = srem i64 %mul23, 1000000007
%add.i = add nsw i64 %rem.i, 1000000007
%cmp4.i = icmp slt i64 %rem.i, 0
%cond.i = select i1 %cmp4.i, i64 %add.i, i64 %rem.i
store i64 %cond.i, ptr %31, align 8, !tbaa !9
%gep373 = getelementptr i64, ptr %invariant.gep372, i64 %i.1299
%mul23.1 = shl nsw i64 %cond.i, 1
%rem.i.1 = srem i64 %mul23.1, 1000000007
%add.i.1 = add nsw i64 %rem.i.1, 1000000007
%cmp4.i.1 = icmp slt i64 %rem.i.1, 0
%cond.i.1 = select i1 %cmp4.i.1, i64 %add.i.1, i64 %rem.i.1
store i64 %cond.i.1, ptr %gep373, align 8, !tbaa !9
%inc27.1 = add nuw i64 %i.1299, 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.end28.loopexit.unr-lcssa, label %for.body21, !llvm.loop !34
for.end28.loopexit.unr-lcssa: ; preds = %for.body21, %for.body21.preheader
%store_forwarded.unr = phi i64 [ %load_initial, %for.body21.preheader ], [ %cond.i.1, %for.body21 ]
%i.1299.unr = phi i64 [ 1, %for.body21.preheader ], [ %inc27.1, %for.body21 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end28, label %for.body21.epil
for.body21.epil: ; preds = %for.end28.loopexit.unr-lcssa
%32 = getelementptr i64, ptr %call16, i64 %i.1299.unr
%mul23.epil = shl nsw i64 %store_forwarded.unr, 1
%rem.i.epil = srem i64 %mul23.epil, 1000000007
%add.i.epil = add nsw i64 %rem.i.epil, 1000000007
%cmp4.i.epil = icmp slt i64 %rem.i.epil, 0
%cond.i.epil = select i1 %cmp4.i.epil, i64 %add.i.epil, i64 %rem.i.epil
store i64 %cond.i.epil, ptr %32, align 8, !tbaa !9
br label %for.end28
for.end28: ; preds = %for.body21.epil, %for.end28.loopexit.unr-lcssa, %rank.exit
%add29 = shl i64 %29, 3
%mul30 = add i64 %add29, 8
%call31 = call noalias ptr @malloc(i64 noundef %mul30) #10
%cmp33.not304 = icmp sgt i64 %29, -1
call void @llvm.assume(i1 %cmp33.not304)
%mul36 = add i64 %add29, 16
%33 = add nuw i64 %29, 1
br label %for.body34
for.body34: ; preds = %for.end28, %for.cond39.for.inc61_crit_edge.split
%i.2305 = phi i64 [ %inc62, %for.cond39.for.inc61_crit_edge.split ], [ 0, %for.end28 ]
%call37 = call noalias ptr @malloc(i64 noundef %mul36) #10
%arrayidx38 = getelementptr inbounds ptr, ptr %call31, i64 %i.2305
store ptr %call37, ptr %arrayidx38, align 8, !tbaa !5
br label %for.body42
for.body42: ; preds = %for.body34, %for.body42
%j.1303 = phi i64 [ 0, %for.body34 ], [ %inc59, %for.body42 ]
%calloc = call ptr @calloc(i64 1, i64 %mul36)
%arrayidx47 = getelementptr inbounds ptr, ptr %call37, i64 %j.1303
store ptr %calloc, ptr %arrayidx47, align 8, !tbaa !5
%inc59 = add nuw i64 %j.1303, 1
%exitcond334 = icmp eq i64 %j.1303, %33
br i1 %exitcond334, label %for.cond39.for.inc61_crit_edge.split, label %for.body42, !llvm.loop !35
for.cond39.for.inc61_crit_edge.split: ; preds = %for.body42
%inc62 = add nuw i64 %i.2305, 1
%exitcond335.not = icmp eq i64 %i.2305, %29
br i1 %exitcond335.not, label %for.end63.loopexit327, label %for.body34, !llvm.loop !36
for.end63.loopexit327: ; preds = %for.cond39.for.inc61_crit_edge.split
%.pre338 = load ptr, ptr %call31, align 8, !tbaa !5
%34 = load ptr, ptr %.pre338, align 8, !tbaa !5
store i64 1, ptr %34, align 8, !tbaa !9
%35 = load i64, ptr %N, align 8, !tbaa !9
%cmp68316 = icmp sgt i64 %35, 0
br i1 %cmp68316, label %for.cond70.preheader, label %for.cond151.preheader
for.cond70.preheader: ; preds = %for.end63.loopexit327, %for.inc148
%36 = phi i64 [ %61, %for.inc148 ], [ %35, %for.end63.loopexit327 ]
%i.3317 = phi i64 [ %inc149, %for.inc148 ], [ 0, %for.end63.loopexit327 ]
%cmp71.not314 = icmp slt i64 %36, 0
br i1 %cmp71.not314, label %for.inc148, label %for.cond73.preheader.preheader
for.cond73.preheader.preheader: ; preds = %for.cond70.preheader
%37 = getelementptr ptr, ptr %call31, i64 %i.3317
%arrayidx82 = getelementptr ptr, ptr %37, i64 1
br label %for.cond73.preheader
for.cond151.preheader: ; preds = %for.inc148, %for.end63.loopexit327
%.lcssa = phi i64 [ %35, %for.end63.loopexit327 ], [ %61, %for.inc148 ]
%cmp152.not320 = icmp slt i64 %.lcssa, 0
br i1 %cmp152.not320, label %for.end165, label %for.body153.lr.ph
for.body153.lr.ph: ; preds = %for.cond151.preheader
%arrayidx157 = getelementptr inbounds ptr, ptr %call31, i64 %.lcssa
%38 = load ptr, ptr %arrayidx157, align 8, !tbaa !5
br label %for.body153
for.cond73.preheader: ; preds = %for.cond73.preheader.preheader, %for.inc145
%39 = phi i64 [ %59, %for.inc145 ], [ %36, %for.cond73.preheader.preheader ]
%40 = phi i64 [ %60, %for.inc145 ], [ %36, %for.cond73.preheader.preheader ]
%j.2315 = phi i64 [ %inc146, %for.inc145 ], [ 0, %for.cond73.preheader.preheader ]
%invariant.gep = getelementptr i64, ptr %call16, i64 %j.2315
%cmp74.not312 = icmp slt i64 %40, 0
br i1 %cmp74.not312, label %for.inc145, label %for.body75
for.body75: ; preds = %for.cond73.preheader, %for.inc142
%k.1313 = phi i64 [ %inc143, %for.inc142 ], [ 0, %for.cond73.preheader ]
%cmp76 = icmp sgt i64 %k.1313, %i.0.lcssa.i
%cmp77 = icmp ult i64 %j.2315, %k.1313
%or.cond = or i1 %cmp76, %cmp77
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %for.body75
%41 = load ptr, ptr %37, align 8, !tbaa !5
%arrayidx79 = getelementptr inbounds ptr, ptr %41, i64 %j.2315
%42 = load ptr, ptr %arrayidx79, align 8, !tbaa !5
%arrayidx80 = getelementptr inbounds i64, ptr %42, i64 %k.1313
store i64 0, ptr %arrayidx80, align 8, !tbaa !9
br label %for.inc142
if.else: ; preds = %for.body75
%43 = load ptr, ptr %arrayidx82, align 8, !tbaa !5
%arrayidx83 = getelementptr ptr, ptr %43, i64 %j.2315
%44 = load ptr, ptr %arrayidx83, align 8, !tbaa !5
%arrayidx84 = getelementptr inbounds i64, ptr %44, i64 %k.1313
%45 = load i64, ptr %arrayidx84, align 8, !tbaa !9
%46 = load i64, ptr %invariant.gep, align 8, !tbaa !9
%47 = load ptr, ptr %37, align 8, !tbaa !5
%arrayidx87 = getelementptr inbounds ptr, ptr %47, i64 %j.2315
%48 = load ptr, ptr %arrayidx87, align 8, !tbaa !5
%arrayidx88 = getelementptr inbounds i64, ptr %48, i64 %k.1313
%49 = load i64, ptr %arrayidx88, align 8, !tbaa !9
%mul89 = mul nsw i64 %49, %46
%add90 = add nsw i64 %mul89, %45
%rem.i266 = srem i64 %add90, 1000000007
%add.i267 = add nsw i64 %rem.i266, 1000000007
%cmp4.i268 = icmp slt i64 %rem.i266, 0
%cond.i269 = select i1 %cmp4.i268, i64 %add.i267, i64 %rem.i266
store i64 %cond.i269, ptr %arrayidx84, align 8, !tbaa !9
%arrayidx99 = getelementptr ptr, ptr %arrayidx83, i64 1
%50 = load ptr, ptr %arrayidx99, align 8, !tbaa !5
%arrayidx100 = getelementptr i64, ptr %50, i64 %k.1313
%51 = load i64, ptr %arrayidx100, align 8, !tbaa !9
%52 = load i64, ptr %N, align 8, !tbaa !9
%arrayidx101 = getelementptr inbounds i64, ptr %call16, i64 %52
%53 = load i64, ptr %arrayidx101, align 8, !tbaa !9
%sub102 = sub nsw i64 %i.0.lcssa.i, %k.1313
%gep = getelementptr i64, ptr %invariant.gep, i64 %sub102
%54 = load i64, ptr %gep, align 8, !tbaa !9
%sub105 = sub nsw i64 %53, %54
%rem.i270 = srem i64 %sub105, 1000000007
%add.i271 = add nsw i64 %rem.i270, 1000000007
%cmp4.i272 = icmp slt i64 %rem.i270, 0
%cond.i273 = select i1 %cmp4.i272, i64 %add.i271, i64 %rem.i270
%55 = load i64, ptr %arrayidx88, align 8, !tbaa !9
%mul110 = mul nsw i64 %cond.i273, %55
%add111 = add nsw i64 %mul110, %51
%rem.i274 = srem i64 %add111, 1000000007
%add.i275 = add nsw i64 %rem.i274, 1000000007
%cmp4.i276 = icmp slt i64 %rem.i274, 0
%cond.i277 = select i1 %cmp4.i276, i64 %add.i275, i64 %rem.i274
store i64 %cond.i277, ptr %arrayidx100, align 8, !tbaa !9
%arrayidx123 = getelementptr i64, ptr %arrayidx100, i64 1
%56 = load i64, ptr %arrayidx123, align 8, !tbaa !9
%sub128 = sub nsw i64 %54, %46
%rem.i278 = srem i64 %sub128, 1000000007
%add.i279 = add nsw i64 %rem.i278, 1000000007
%cmp4.i280 = icmp slt i64 %rem.i278, 0
%cond.i281 = select i1 %cmp4.i280, i64 %add.i279, i64 %rem.i278
%57 = load i64, ptr %arrayidx88, align 8, !tbaa !9
%mul133 = mul nsw i64 %cond.i281, %57
%add134 = add nsw i64 %mul133, %56
%rem.i282 = srem i64 %add134, 1000000007
%add.i283 = add nsw i64 %rem.i282, 1000000007
%cmp4.i284 = icmp slt i64 %rem.i282, 0
%cond.i285 = select i1 %cmp4.i284, i64 %add.i283, i64 %rem.i282
store i64 %cond.i285, ptr %arrayidx123, align 8, !tbaa !9
br label %for.inc142
for.inc142: ; preds = %if.then, %if.else
%inc143 = add nuw nsw i64 %k.1313, 1
%58 = load i64, ptr %N, align 8, !tbaa !9
%cmp74.not.not = icmp slt i64 %k.1313, %58
br i1 %cmp74.not.not, label %for.body75, label %for.inc145, !llvm.loop !37
for.inc145: ; preds = %for.inc142, %for.cond73.preheader
%59 = phi i64 [ %39, %for.cond73.preheader ], [ %58, %for.inc142 ]
%60 = phi i64 [ %40, %for.cond73.preheader ], [ %58, %for.inc142 ]
%inc146 = add nuw nsw i64 %j.2315, 1
%cmp71.not.not = icmp slt i64 %j.2315, %60
br i1 %cmp71.not.not, label %for.cond73.preheader, label %for.inc148, !llvm.loop !38
for.inc148: ; preds = %for.inc145, %for.cond70.preheader
%61 = phi i64 [ %36, %for.cond70.preheader ], [ %59, %for.inc145 ]
%inc149 = add nuw nsw i64 %i.3317, 1
%cmp68 = icmp slt i64 %inc149, %61
br i1 %cmp68, label %for.cond70.preheader, label %for.cond151.preheader, !llvm.loop !39
for.body153: ; preds = %for.body153.lr.ph, %for.body153
%ans.0322 = phi i64 [ 0, %for.body153.lr.ph ], [ %cond.i289, %for.body153 ]
%j.3321 = phi i64 [ 0, %for.body153.lr.ph ], [ %inc164, %for.body153 ]
%sub154 = sub nsw i64 %.lcssa, %j.3321
%mul155 = mul nsw i64 %sub154, %.lcssa
%arrayidx156 = getelementptr inbounds i64, ptr %call16, i64 %mul155
%62 = load i64, ptr %arrayidx156, align 8, !tbaa !9
%arrayidx158 = getelementptr inbounds ptr, ptr %38, i64 %j.3321
%63 = load ptr, ptr %arrayidx158, align 8, !tbaa !5
%arrayidx159 = getelementptr inbounds i64, ptr %63, i64 %i.0.lcssa.i
%64 = load i64, ptr %arrayidx159, align 8, !tbaa !9
%mul160 = mul nsw i64 %64, %62
%add161 = add nsw i64 %mul160, %ans.0322
%rem.i286 = srem i64 %add161, 1000000007
%add.i287 = add nsw i64 %rem.i286, 1000000007
%cmp4.i288 = icmp slt i64 %rem.i286, 0
%cond.i289 = select i1 %cmp4.i288, i64 %add.i287, i64 %rem.i286
%inc164 = add nuw i64 %j.3321, 1
%exitcond337.not = icmp eq i64 %j.3321, %.lcssa
br i1 %exitcond337.not, label %for.end165, label %for.body153, !llvm.loop !40
for.end165: ; preds = %for.body153, %for.cond151.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond151.preheader ], [ %cond.i289, %for.body153 ]
%call166 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #9
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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #6
; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #8 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = distinct !{!16, !12}
!17 = !{!18}
!18 = distinct !{!18, !19}
!19 = distinct !{!19, !"LVerDomain"}
!20 = !{!21}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !12, !15, !23}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12, !26}
!26 = !{!"llvm.loop.unswitch.partial.disable"}
!27 = distinct !{!27, !12, !15}
!28 = !{!29}
!29 = distinct !{!29, !30}
!30 = distinct !{!30, !"LVerDomain"}
!31 = !{!32}
!32 = distinct !{!32, !30}
!33 = distinct !{!33, !12, !15, !23}
!34 = distinct !{!34, !12}
!35 = distinct !{!35, !12}
!36 = distinct !{!36, !12}
!37 = distinct !{!37, !12}
!38 = distinct !{!38, !12, !26}
!39 = distinct !{!39, !12, !26}
!40 = distinct !{!40, !12}
|
#include<stdio.h>
int main(void){
int n;
scanf("%d",&n);
if(n/100==7||n/10%10==7||n%10==7){
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139129/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139129/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%.off = add i32 %0, -700
%cmp = icmp ult i32 %.off, 100
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%div1 = sdiv i32 %0, 10
%rem = srem i32 %div1, 10
%cmp2 = icmp eq i32 %rem, 7
%rem4 = srem i32 %0, 10
%cmp5 = icmp eq i32 %rem4, 7
%or.cond = or i1 %cmp5, %cmp2
%spec.select = select i1 %or.cond, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ %spec.select, %lor.lhs.false ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
char N[3];
scanf("%s",N);
if(N[0]=='7'||N[1]=='7'||N[2]=='7'){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139172/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139172/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i8, ptr %N, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 55
%arrayidx2 = getelementptr inbounds [3 x i8], ptr %N, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp, i1 true, i1 %cmp4
%arrayidx7 = getelementptr inbounds [3 x i8], ptr %N, i64 0, i64 2
%2 = load i8, ptr %arrayidx7, align 1
%cmp9 = icmp eq i8 %2, 55
%or.cond13 = select i1 %or.cond, i1 true, i1 %cmp9
%str.3.str = select i1 %or.cond13, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int x;
scanf("%d", &x);
if(x%10==7 || x% 100 /10 ==7 || x%1000 /100 ==7) printf("Yes\n");
else printf("No\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139215/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139215/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%rem = srem i32 %0, 10
%cmp = icmp eq i32 %rem, 7
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%rem1 = srem i32 %0, 100
%rem1.off = add nsw i32 %rem1, -70
%cmp2 = icmp ult i32 %rem1.off, 10
br i1 %cmp2, label %if.end, label %lor.lhs.false3
lor.lhs.false3: ; preds = %lor.lhs.false
%rem4 = srem i32 %0, 1000
%rem4.off = add nsw i32 %rem4, -700
%cmp6 = icmp ult i32 %rem4.off, 100
%spec.select = select i1 %cmp6, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false3, %entry, %lor.lhs.false
%str.sink = phi ptr [ @str.3, %lor.lhs.false ], [ @str.3, %entry ], [ %spec.select, %lor.lhs.false3 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int N,A,B,C,D,E,F;
scanf("%d",&N);
if(N>=100&&N<=999)
{
A=N%100;
B=A%10;
N=N-B;
C=N%100;
D=C/10;
E=N-D;
F=E/100;
if(B==7||D==7||F==7)
{
printf("Yes");
}
else
printf("No");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139259/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139259/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4
%1 = add i32 %0, -100
%or.cond = icmp ult i32 %1, 900
br i1 %or.cond, label %if.then, label %if.end13
if.then: ; preds = %entry
%rem.lhs.trunc = trunc i32 %0 to i16
%rem18 = urem i16 %rem.lhs.trunc, 100
%rem2.lhs.trunc = trunc i16 %rem18 to i8
%rem219 = urem i8 %rem2.lhs.trunc, 10
%rem2.zext = zext i8 %rem219 to i32
%sub = sub nuw nsw i32 %0, %rem2.zext
store i32 %sub, ptr %N, align 4, !tbaa !5
%rem3.lhs.trunc = trunc i32 %sub to i16
%rem320 = urem i16 %rem3.lhs.trunc, 100
%rem3.zext = zext i16 %rem320 to i32
%div.lhs.trunc = trunc i16 %rem320 to i8
%div21 = udiv i8 %div.lhs.trunc, 10
%div.zext = zext i8 %div21 to i32
%cmp6 = icmp eq i8 %rem219, 7
%rem3.off = add nsw i32 %rem3.zext, -70
%cmp7 = icmp ult i32 %rem3.off, 10
%or.cond14 = select i1 %cmp6, i1 true, i1 %cmp7
%sub4 = add nsw i32 %sub, -700
%sub4.off = sub nsw i32 %sub4, %div.zext
%cmp9 = icmp ult i32 %sub4.off, 100
%or.cond15 = select i1 %or.cond14, i1 true, i1 %cmp9
%.str.1..str.2 = select i1 %or.cond15, ptr @.str.1, ptr @.str.2
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
br label %if.end13
if.end13: ; preds = %if.then, %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"}
|
#include <stdio.h>
int main()
{
int n,i;
int f=0;
scanf("%d",&n);
for(i=0;i<3;i++){
if(n%10==7) f=1;
n=n/10;
}
if(f==1) printf("Yes");
else printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139301/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139301/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%n.promoted = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %n.promoted, 10
%cmp1 = icmp eq i32 %rem, 7
%div = sdiv i32 %n.promoted, 10
%rem.1 = srem i32 %div, 10
%cmp1.1 = icmp eq i32 %rem.1, 7
%narrow = or i1 %cmp1.1, %cmp1
%div.1 = sdiv i32 %n.promoted, 100
%rem.2 = srem i32 %div.1, 10
%cmp1.2 = icmp eq i32 %rem.2, 7
%narrow12 = or i1 %cmp1.2, %narrow
%div.2 = sdiv i32 %n.promoted, 1000
store i32 %div.2, ptr %n, align 4, !tbaa !5
%.str.1..str.2 = select i1 %narrow12, ptr @.str.1, ptr @.str.2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int count=0;
for(;n!=0;n/=10)
{
if(n%10==7)
{printf("Yes");
count=1;break;}
}
if(count==0)
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139352/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139352/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp.not7 = icmp eq i32 %.pr, 0
br i1 %cmp.not7, label %if.end6, label %for.body
for.body: ; preds = %entry, %for.inc
%0 = phi i32 [ %div, %for.inc ], [ %.pr, %entry ]
%rem = srem i32 %0, 10
%div = sdiv i32 %0, 10
%cmp1 = icmp eq i32 %rem, 7
br i1 %cmp1, label %if.end6, label %for.inc
for.inc: ; preds = %for.body
store i32 %div, ptr %n, align 4, !tbaa !5
%.off = add i32 %0, 9
%cmp.not = icmp ult i32 %.off, 19
br i1 %cmp.not, label %if.end6, label %for.body, !llvm.loop !9
if.end6: ; preds = %for.inc, %for.body, %entry
%.str.1.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body ], [ @.str.2, %for.inc ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int n,a,b,c;
scanf("%d",&n);
a=n/100;
b=(n%100)/10;
c=(n%100)%10;
if(a==7 || b==7 || c==7)
printf("Yes");
else
printf("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139396/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139396/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 100
%rem3.lhs.trunc = trunc i32 %rem to i8
%rem310 = srem i8 %rem3.lhs.trunc, 10
%.off = add i32 %0, -700
%cmp = icmp ult i32 %.off, 100
%rem.off = add nsw i32 %rem, -70
%cmp4 = icmp ult i32 %rem.off, 10
%or.cond = select i1 %cmp, i1 true, i1 %cmp4
%cmp6 = icmp eq i8 %rem310, 7
%or.cond9 = or i1 %or.cond, %cmp6
%.str.1..str.2 = select i1 %or.cond9, ptr @.str.1, ptr @.str.2
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
char N[3];
scanf("%s", N);
if(N[0]=='7'||N[1]=='7'||N[2]=='7'){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139439/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139439/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i8, ptr %N, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 55
%arrayidx2 = getelementptr inbounds [3 x i8], ptr %N, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp, i1 true, i1 %cmp4
%arrayidx7 = getelementptr inbounds [3 x i8], ptr %N, i64 0, i64 2
%2 = load i8, ptr %arrayidx7, align 1
%cmp9 = icmp eq i8 %2, 55
%or.cond13 = select i1 %or.cond, i1 true, i1 %cmp9
%str.3.str = select i1 %or.cond13, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdbool.h>
int main(void)
{
int n;
if (scanf("%d", &n));
bool ret = false;
if ((n % 10) == 7) ret = true;
if (((n/10) % 10) == 7) ret = true;
if (((n/100) % 10) == 7) ret = true;
printf("%s", (ret)? "Yes":"No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139482/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139482/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 10
%cmp = icmp eq i32 %rem, 7
%div = sdiv i32 %0, 10
%rem3 = srem i32 %div, 10
%cmp4 = icmp eq i32 %rem3, 7
%narrow = or i1 %cmp, %cmp4
%div7 = sdiv i32 %0, 100
%rem8 = srem i32 %div7, 10
%cmp9 = icmp eq i32 %rem8, 7
%narrow16 = or i1 %cmp9, %narrow
%cond = select i1 %narrow16, ptr @.str.2, ptr @.str.3
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i=0;i<n;i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max(a,b)-min(a,b))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1; rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)n,(int)n)
#define nHr(n,r) nCr((int)(n+r+1),(int)r)
#define sankaku(x) ((1+x)*x)/2
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
void initialize(){
}
int main(void){
initialize();
ll n,m,i,j,result=0;
int a[LIMIT2]={0};
char s[LIMIT1];
scanf("%lld",&n);
while(n >= 10){
if(n % 10 == 7) result = 1;
n /= 10;
}
if(n == 7) result = 1;
if(result == 1) printf("Yes");
else printf("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139525/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139525/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dx = dso_local local_unnamed_addr global [8 x i32] [i32 1, i32 0, i32 -1, i32 0, i32 1, i32 -1, i32 -1, i32 1], align 16
@dy = dso_local local_unnamed_addr global [8 x i32] [i32 0, i32 1, i32 0, i32 -1, i32 1, i32 1, i32 -1, i32 -1], align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @nPr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #0 {
entry:
%conv = sext i32 %r to i64
%cmp6 = icmp sgt i32 %r, 0
br i1 %cmp6, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%conv2 = sext i32 %n to i64
%xtraiter = and i64 %conv, 7
%0 = icmp ult i32 %r, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %conv, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%result.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul.7, %for.body ]
%i.07 = phi i64 [ 0, %for.body.lr.ph.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.7, %for.body ]
%sub = sub nsw i64 %conv2, %i.07
%mul = mul nsw i64 %result.08, %sub
%inc.neg = xor i64 %i.07, -1
%sub.1 = add i64 %inc.neg, %conv2
%mul.1 = mul nsw i64 %mul, %sub.1
%inc.1 = or i64 %i.07, 2
%sub.2 = sub nsw i64 %conv2, %inc.1
%mul.2 = mul nsw i64 %mul.1, %sub.2
%inc.2 = or i64 %i.07, 3
%sub.3 = sub nsw i64 %conv2, %inc.2
%mul.3 = mul nsw i64 %mul.2, %sub.3
%inc.3 = or i64 %i.07, 4
%sub.4 = sub nsw i64 %conv2, %inc.3
%mul.4 = mul nsw i64 %mul.3, %sub.4
%inc.4 = or i64 %i.07, 5
%sub.5 = sub nsw i64 %conv2, %inc.4
%mul.5 = mul nsw i64 %mul.4, %sub.5
%inc.5 = or i64 %i.07, 6
%sub.6 = sub nsw i64 %conv2, %inc.5
%mul.6 = mul nsw i64 %mul.5, %sub.6
%inc.6 = or i64 %i.07, 7
%sub.7 = sub nsw i64 %conv2, %inc.6
%mul.7 = mul nsw i64 %mul.6, %sub.7
%inc.7 = add nuw nsw i64 %i.07, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !5
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul.7, %for.body ]
%result.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul.7, %for.body ]
%i.07.unr = phi i64 [ 0, %for.body.lr.ph ], [ %inc.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%result.08.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %result.08.unr, %for.end.loopexit.unr-lcssa ]
%i.07.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%sub.epil = sub nsw i64 %conv2, %i.07.epil
%mul.epil = mul nsw i64 %result.08.epil, %sub.epil
%inc.epil = add nuw nsw i64 %i.07.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !7
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %result.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @nCr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #2 {
entry:
%sub = sub nsw i32 %n, %r
%cond = tail call i32 @llvm.smin.i32(i32 %sub, i32 %r)
%conv = sext i32 %cond to i64
%cmp216 = icmp sgt i32 %cond, 0
br i1 %cmp216, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%conv4 = sext i32 %n to i64
%xtraiter = and i64 %conv, 1
%0 = icmp eq i32 %cond, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %conv, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%result.018 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.017 = phi i64 [ 0, %for.body.lr.ph.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub5 = sub nsw i64 %conv4, %i.017
%mul = mul nsw i64 %result.018, %sub5
%add = or i64 %i.017, 1
%div = sdiv i64 %mul, %add
%sub5.1 = sub nsw i64 %conv4, %add
%mul.1 = mul nsw i64 %div, %sub5.1
%add.1 = add nuw nsw i64 %i.017, 2
%div.1 = sdiv i64 %mul.1, %add.1
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%result.018.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.017.unr = phi i64 [ 0, %for.body.lr.ph ], [ %add.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub5.epil = sub nsw i64 %conv4, %i.017.unr
%mul.epil = mul nsw i64 %result.018.unr, %sub5.epil
%add.epil = add nuw nsw i64 %i.017.unr, 1
%div.epil = sdiv i64 %mul.epil, %add.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !10
%1 = load i32, ptr %b, align 4, !tbaa !10
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !10
%1 = load i32, ptr %b, align 4, !tbaa !10
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upchar(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %left, ptr noundef nonnull dereferenceable(1) %right) #10
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downchar(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %right, ptr noundef nonnull dereferenceable(1) %left) #10
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @initialize() local_unnamed_addr #6 {
entry:
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%.pr = load i64, ptr %n, align 8, !tbaa !14
%cmp13 = icmp sgt i64 %.pr, 9
br i1 %cmp13, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%result.014 = phi i64 [ %spec.select, %while.body ], [ 0, %entry ]
%0 = phi i64 [ %div11, %while.body ], [ %.pr, %entry ]
%rem = urem i64 %0, 10
%cmp1 = icmp eq i64 %rem, 7
%spec.select = select i1 %cmp1, i64 1, i64 %result.014
%div11 = udiv i64 %0, 10
%cmp = icmp ugt i64 %0, 99
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !16
while.cond.while.end_crit_edge: ; preds = %while.body
store i64 %div11, ptr %n, align 8, !tbaa !14
%1 = icmp eq i64 %spec.select, 1
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%.lcssa = phi i64 [ %div11, %while.cond.while.end_crit_edge ], [ %.pr, %entry ]
%result.0.lcssa = phi i1 [ %1, %while.cond.while.end_crit_edge ], [ false, %entry ]
%cmp2 = icmp eq i64 %.lcssa, 7
%cmp5 = select i1 %cmp2, i1 true, i1 %result.0.lcssa
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #11
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #9
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.unroll.disable"}
!9 = distinct !{!9, !6}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C/C++ TBAA"}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !12, i64 0}
!16 = distinct !{!16, !6}
|
#include<stdio.h>
int main(){
int n ;
scanf("%d",&n);
if (700<=n && n<=799)
printf("Yes");
else if (n%10==7)
printf ("Yes");
else if (70<=n%100 && n%100<=79)
printf ("Yes");
else printf ("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139569/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139569/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4
%1 = add i32 %0, -700
%or.cond = icmp ult i32 %1, 100
%rem = srem i32 %0, 10
%cmp3 = icmp eq i32 %rem, 7
%or.cond19 = or i1 %or.cond, %cmp3
br i1 %or.cond19, label %if.end17, label %if.else6
if.else6: ; preds = %entry
%rem7 = srem i32 %0, 100
%2 = add nsw i32 %rem7, -70
%or.cond18 = icmp ult i32 %2, 10
%.str.1..str.2 = select i1 %or.cond18, ptr @.str.1, ptr @.str.2
br label %if.end17
if.end17: ; preds = %if.else6, %entry
%.str.1.sink = phi ptr [ @.str.1, %entry ], [ %.str.1..str.2, %if.else6 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(){
int n, a, b, c;
scanf("%d", &n);
a = n/100;
b = (n/10)%10;
c = n%10;
if (a == 7)
printf("Yes");
else if (b == 7)
printf("Yes");
else if (c == 7)
printf("Yes");
else
printf("No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139611/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139611/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem2 = srem i32 %0, 10
%div1 = sdiv i32 %0, 10
%.off = add i32 %0, -700
%cmp = icmp ult i32 %.off, 100
%rem = srem i32 %div1, 10
%cmp4 = icmp eq i32 %rem, 7
%or.cond = or i1 %cmp, %cmp4
%cmp8 = icmp eq i32 %rem2, 7
%.str.1..str.2 = select i1 %cmp8, ptr @.str.1, ptr @.str.2
%.str.1.sink = select i1 %or.cond, ptr @.str.1, ptr %.str.1..str.2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
int n=0,i;
char s[3];
scanf("%s",s);
for(i=0; i<3; i++){
if(s[i]=='7') n++;
}
if(n==0) printf("No");
else printf("Yes");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139662/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139662/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [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, 55
%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, 55
%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, 55
%inc.2.neg = sext i1 %cmp1.2 to i32
%cmp4 = icmp eq i32 %spec.select.1, %inc.2.neg
%.str.1..str.2 = select i1 %cmp4, ptr @.str.1, ptr @.str.2
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.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>
#include<stdlib.h>
#include <string.h>
int main(void){
char N[3];
scanf("%s", &N);
if(N[0] == '7'){
printf("Yes");
}else if(N[1] == '7'){
printf("Yes");
}else if(N[2] == '7'){
printf("Yes");
}else{
printf("No");
}
//printf("%d\n", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139705/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139705/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i8, ptr %N, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 55
%arrayidx3 = getelementptr inbounds [3 x i8], ptr %N, i64 0, i64 1
%1 = load i8, ptr %arrayidx3, align 1
%cmp5 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp, i1 true, i1 %cmp5
%arrayidx10 = getelementptr inbounds [3 x i8], ptr %N, i64 0, i64 2
%2 = load i8, ptr %arrayidx10, align 1
%cmp12 = icmp eq i8 %2, 55
%3 = select i1 %or.cond, i1 true, i1 %cmp12
%.str.1.sink = select i1 %3, ptr @.str.1, ptr @.str.2
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 3, 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int N,flag;
scanf("%d", &N);
flag = N%10;
N -=flag;
if(flag==7){
printf("Yes");
return 0;
}
flag = N%100/10;
N -= flag;
if(flag==7){
printf("Yes");
return 0;
}
flag = N%1000/100;
if(flag==7){
printf("Yes");
return 0;
}
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139749/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139749/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 10
%sub = sub nsw i32 %0, %rem
store i32 %sub, ptr %N, align 4, !tbaa !5
%cmp = icmp eq i32 %rem, 7
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%rem2 = srem i32 %sub, 100
%div.neg.lhs.trunc = trunc i32 %rem2 to i8
%div.neg20 = sdiv i8 %div.neg.lhs.trunc, -10
%div.neg.sext = sext i8 %div.neg20 to i32
%sub3 = add i32 %sub, %div.neg.sext
store i32 %sub3, ptr %N, align 4, !tbaa !5
%rem2.off = add nsw i32 %rem2, -70
%cmp4 = icmp ult i32 %rem2.off, 10
br i1 %cmp4, label %cleanup, label %if.end7
if.end7: ; preds = %if.end
%rem8 = srem i32 %sub3, 1000
%rem8.off = add nsw i32 %rem8, -700
%cmp10 = icmp ult i32 %rem8.off, 100
%.str.1..str.2 = select i1 %cmp10, ptr @.str.1, ptr @.str.2
br label %cleanup
cleanup: ; preds = %if.end7, %if.end, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %if.end ], [ %.str.1..str.2, %if.end7 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
#define ll long long
int main(){
int n;
scanf("%d",&n);
if((n<800 && n>=700) || (n%100>=70 && n%100<80) || n%10==7){
printf("Yes");
return 0;
}
else{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139792/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139792/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4
%1 = add i32 %0, -700
%or.cond = icmp ult i32 %1, 100
br i1 %or.cond, label %cleanup, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%rem = srem i32 %0, 100
%2 = add nsw i32 %rem, -70
%or.cond11 = icmp ult i32 %2, 10
%rem7 = srem i32 %0, 10
%cmp8 = icmp eq i32 %rem7, 7
%or.cond12 = or i1 %cmp8, %or.cond11
%spec.select = select i1 %or.cond12, ptr @.str.1, ptr @.str.2
br label %cleanup
cleanup: ; preds = %lor.lhs.false, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int solve(int N){
if(N/100 == 7)
return 1;
N %= 100;
if(N/10 == 7)
return 1;
N %= 10;
if(N == 7)
return 1;
else
return 0;
}
int main(){
int N;
scanf("%d",&N);
if(solve(N))
printf("Yes");
else
printf("No");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139835/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139835/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @solve(i32 noundef %N) local_unnamed_addr #0 {
entry:
%N.off = add i32 %N, -700
%cmp = icmp ult i32 %N.off, 100
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%rem = srem i32 %N, 100
%rem.off = add nsw i32 %rem, -70
%cmp2 = icmp ult i32 %rem.off, 10
br i1 %cmp2, label %return, label %if.end4
if.end4: ; preds = %if.end
%rem5.lhs.trunc = trunc i32 %rem to i8
%rem512 = srem i8 %rem5.lhs.trunc, 10
%cmp6 = icmp eq i8 %rem512, 7
%. = zext i1 %cmp6 to i32
br label %return
return: ; preds = %if.end4, %if.end, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %if.end ], [ %., %if.end4 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%N.off.i = add i32 %0, -700
%cmp.i = icmp ult i32 %N.off.i, 100
br i1 %cmp.i, label %if.end, label %if.end.i
if.end.i: ; preds = %entry
%rem.i = srem i32 %0, 100
%rem.off.i = add nsw i32 %rem.i, -70
%cmp2.i = icmp ult i32 %rem.off.i, 10
%rem5.lhs.trunc.i = trunc i32 %rem.i to i8
%rem512.i = srem i8 %rem5.lhs.trunc.i, 10
%cmp6.i.not = icmp eq i8 %rem512.i, 7
%or.cond = or i1 %cmp2.i, %cmp6.i.not
%spec.select = select i1 %or.cond, ptr @.str.1, ptr @.str.2
br label %if.end
if.end: ; preds = %if.end.i, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %if.end.i ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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"}
|
#include<stdio.h>
int main(){
int i,j,mi,k;
double c[3],d,min;
char s[8];
char w[]={"0123456789abcdef"};
char n[][10]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
int p[][3]={{0,0,0},{0,0,255},{0,255,0},{0,255,255},
{255,0,0},{255,0,255},{255,255,0},{255,255,255}
};
while(scanf("%s",s),s[1]){
for(i=0;i<3;i++){
for(j=0;s[i*2+1]-w[j];j++);
for(k=0;s[i*2+2]-w[k];k++);
c[i]=j*16+k;
}
min=256*256*4;
for(i=0;i<8;i++){
for(j=d=0;j<3;j++)d+=(p[i][j]-c[j])*(p[i][j]-c[j]);
if(min>d){
min=d;
mi=i;
}
}
printf("%s\n",n[mi]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139886/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139886/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.w = private unnamed_addr constant [17 x i8] c"0123456789abcdef\00", align 16
@__const.main.n = private unnamed_addr constant [8 x [10 x i8]] [[10 x i8] c"black\00\00\00\00\00", [10 x i8] c"blue\00\00\00\00\00\00", [10 x i8] c"lime\00\00\00\00\00\00", [10 x i8] c"aqua\00\00\00\00\00\00", [10 x i8] c"red\00\00\00\00\00\00\00", [10 x i8] c"fuchsia\00\00\00", [10 x i8] c"yellow\00\00\00\00", [10 x i8] c"white\00\00\00\00\00"], align 16
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [8 x i8], align 1
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s) #5
%call95 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx = getelementptr inbounds [8 x i8], ptr %s, i64 0, i64 1
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%tobool.not96 = icmp eq i8 %0, 0
br i1 %tobool.not96, label %while.end, label %for.cond.preheader.preheader
for.cond.preheader.preheader: ; preds = %entry
%arrayidx12 = getelementptr inbounds [8 x i8], ptr %s, i64 0, i64 2
%arrayidx2.1 = getelementptr inbounds [8 x i8], ptr %s, i64 0, i64 3
%arrayidx12.1 = getelementptr inbounds [8 x i8], ptr %s, i64 0, i64 4
%arrayidx2.2 = getelementptr inbounds [8 x i8], ptr %s, i64 0, i64 5
%arrayidx12.2 = getelementptr inbounds [8 x i8], ptr %s, i64 0, i64 6
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.end22.2
%1 = phi i8 [ %33, %for.end22.2 ], [ %0, %for.cond.preheader.preheader ]
%mi.097 = phi i32 [ %mi.2.7, %for.end22.2 ], [ undef, %for.cond.preheader.preheader ]
br label %for.cond1
for.cond1: ; preds = %for.cond1, %for.cond.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1 ], [ 0, %for.cond.preheader ]
%arrayidx4 = getelementptr inbounds [17 x i8], ptr @__const.main.w, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%tobool6.not = icmp eq i8 %1, %2
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %tobool6.not, label %for.cond8.preheader, label %for.cond1, !llvm.loop !8
for.cond8.preheader: ; preds = %for.cond1
%3 = load i8, ptr %arrayidx12, align 1, !tbaa !5
br label %for.cond8
for.cond8: ; preds = %for.cond8, %for.cond8.preheader
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.cond8 ], [ 0, %for.cond8.preheader ]
%arrayidx15 = getelementptr inbounds [17 x i8], ptr @__const.main.w, i64 0, i64 %indvars.iv99
%4 = load i8, ptr %arrayidx15, align 1, !tbaa !5
%tobool18.not = icmp eq i8 %3, %4
%indvars.iv.next100 = add nuw i64 %indvars.iv99, 1
br i1 %tobool18.not, label %for.end22, label %for.cond8, !llvm.loop !10
for.end22: ; preds = %for.cond8
%5 = trunc i64 %indvars.iv to i32
%6 = trunc i64 %indvars.iv99 to i32
%mul23 = shl nsw i32 %5, 4
%add24 = add nuw nsw i32 %mul23, %6
%conv25 = sitofp i32 %add24 to double
%7 = load i8, ptr %arrayidx2.1, align 1, !tbaa !5
br label %for.cond1.1
for.cond1.1: ; preds = %for.cond1.1, %for.end22
%indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %for.cond1.1 ], [ 0, %for.end22 ]
%arrayidx4.1 = getelementptr inbounds [17 x i8], ptr @__const.main.w, i64 0, i64 %indvars.iv.1
%8 = load i8, ptr %arrayidx4.1, align 1, !tbaa !5
%tobool6.not.1 = icmp eq i8 %7, %8
%indvars.iv.next.1 = add nuw i64 %indvars.iv.1, 1
br i1 %tobool6.not.1, label %for.cond8.preheader.1, label %for.cond1.1, !llvm.loop !8
for.cond8.preheader.1: ; preds = %for.cond1.1
%9 = load i8, ptr %arrayidx12.1, align 1, !tbaa !5
br label %for.cond8.1
for.cond8.1: ; preds = %for.cond8.1, %for.cond8.preheader.1
%indvars.iv99.1 = phi i64 [ %indvars.iv.next100.1, %for.cond8.1 ], [ 0, %for.cond8.preheader.1 ]
%arrayidx15.1 = getelementptr inbounds [17 x i8], ptr @__const.main.w, i64 0, i64 %indvars.iv99.1
%10 = load i8, ptr %arrayidx15.1, align 1, !tbaa !5
%tobool18.not.1 = icmp eq i8 %9, %10
%indvars.iv.next100.1 = add nuw i64 %indvars.iv99.1, 1
br i1 %tobool18.not.1, label %for.end22.1, label %for.cond8.1, !llvm.loop !10
for.end22.1: ; preds = %for.cond8.1
%11 = trunc i64 %indvars.iv.1 to i32
%12 = trunc i64 %indvars.iv99.1 to i32
%mul23.1 = shl nsw i32 %11, 4
%add24.1 = add nuw nsw i32 %mul23.1, %12
%conv25.1 = sitofp i32 %add24.1 to double
%13 = load i8, ptr %arrayidx2.2, align 1, !tbaa !5
br label %for.cond1.2
for.cond1.2: ; preds = %for.cond1.2, %for.end22.1
%indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %for.cond1.2 ], [ 0, %for.end22.1 ]
%arrayidx4.2 = getelementptr inbounds [17 x i8], ptr @__const.main.w, i64 0, i64 %indvars.iv.2
%14 = load i8, ptr %arrayidx4.2, align 1, !tbaa !5
%tobool6.not.2 = icmp eq i8 %13, %14
%indvars.iv.next.2 = add nuw i64 %indvars.iv.2, 1
br i1 %tobool6.not.2, label %for.cond8.preheader.2, label %for.cond1.2, !llvm.loop !8
for.cond8.preheader.2: ; preds = %for.cond1.2
%15 = load i8, ptr %arrayidx12.2, align 1, !tbaa !5
br label %for.cond8.2
for.cond8.2: ; preds = %for.cond8.2, %for.cond8.preheader.2
%indvars.iv99.2 = phi i64 [ %indvars.iv.next100.2, %for.cond8.2 ], [ 0, %for.cond8.preheader.2 ]
%arrayidx15.2 = getelementptr inbounds [17 x i8], ptr @__const.main.w, i64 0, i64 %indvars.iv99.2
%16 = load i8, ptr %arrayidx15.2, align 1, !tbaa !5
%tobool18.not.2 = icmp eq i8 %15, %16
%indvars.iv.next100.2 = add nuw i64 %indvars.iv99.2, 1
br i1 %tobool18.not.2, label %for.end22.2, label %for.cond8.2, !llvm.loop !10
for.end22.2: ; preds = %for.cond8.2
%17 = trunc i64 %indvars.iv.2 to i32
%18 = trunc i64 %indvars.iv99.2 to i32
%mul23.2 = shl nsw i32 %17, 4
%add24.2 = add nuw nsw i32 %mul23.2, %18
%conv25.2 = sitofp i32 %add24.2 to double
%sub46 = fsub double 0.000000e+00, %conv25
%19 = call double @llvm.fmuladd.f64(double %sub46, double %sub46, double 0.000000e+00)
%sub46.1 = fsub double 0.000000e+00, %conv25.1
%20 = call double @llvm.fmuladd.f64(double %sub46.1, double %sub46.1, double %19)
%sub46.2 = fsub double 0.000000e+00, %conv25.2
%21 = call double @llvm.fmuladd.f64(double %sub46.2, double %sub46.2, double %20)
%cmp59 = fcmp olt double %21, 2.621440e+05
%mi.2 = select i1 %cmp59, i32 0, i32 %mi.097
%min.1 = select i1 %cmp59, double %21, double 2.621440e+05
%sub46.2.1 = fsub double 2.550000e+02, %conv25.2
%22 = call double @llvm.fmuladd.f64(double %sub46.2.1, double %sub46.2.1, double %20)
%cmp59.1 = fcmp ogt double %min.1, %22
%mi.2.1 = select i1 %cmp59.1, i32 1, i32 %mi.2
%min.1.1 = select i1 %cmp59.1, double %22, double %min.1
%sub46.1.2 = fsub double 2.550000e+02, %conv25.1
%23 = call double @llvm.fmuladd.f64(double %sub46.1.2, double %sub46.1.2, double %19)
%24 = call double @llvm.fmuladd.f64(double %sub46.2, double %sub46.2, double %23)
%cmp59.2 = fcmp ogt double %min.1.1, %24
%mi.2.2 = select i1 %cmp59.2, i32 2, i32 %mi.2.1
%min.1.2 = select i1 %cmp59.2, double %24, double %min.1.1
%25 = call double @llvm.fmuladd.f64(double %sub46.2.1, double %sub46.2.1, double %23)
%cmp59.3 = fcmp ogt double %min.1.2, %25
%mi.2.3 = select i1 %cmp59.3, i32 3, i32 %mi.2.2
%min.1.3 = select i1 %cmp59.3, double %25, double %min.1.2
%sub46.4 = fsub double 2.550000e+02, %conv25
%26 = call double @llvm.fmuladd.f64(double %sub46.4, double %sub46.4, double 0.000000e+00)
%27 = call double @llvm.fmuladd.f64(double %sub46.1, double %sub46.1, double %26)
%28 = call double @llvm.fmuladd.f64(double %sub46.2, double %sub46.2, double %27)
%cmp59.4 = fcmp ogt double %min.1.3, %28
%mi.2.4 = select i1 %cmp59.4, i32 4, i32 %mi.2.3
%min.1.4 = select i1 %cmp59.4, double %28, double %min.1.3
%29 = call double @llvm.fmuladd.f64(double %sub46.2.1, double %sub46.2.1, double %27)
%cmp59.5 = fcmp ogt double %min.1.4, %29
%mi.2.5 = select i1 %cmp59.5, i32 5, i32 %mi.2.4
%min.1.5 = select i1 %cmp59.5, double %29, double %min.1.4
%30 = call double @llvm.fmuladd.f64(double %sub46.1.2, double %sub46.1.2, double %26)
%31 = call double @llvm.fmuladd.f64(double %sub46.2, double %sub46.2, double %30)
%cmp59.6 = fcmp ogt double %min.1.5, %31
%mi.2.6 = select i1 %cmp59.6, i32 6, i32 %mi.2.5
%min.1.6 = select i1 %cmp59.6, double %31, double %min.1.5
%32 = call double @llvm.fmuladd.f64(double %sub46.2.1, double %sub46.2.1, double %30)
%cmp59.7 = fcmp ogt double %min.1.6, %32
%mi.2.7 = select i1 %cmp59.7, i32 7, i32 %mi.2.6
%idxprom64 = sext i32 %mi.2.7 to i64
%arrayidx65 = getelementptr inbounds [8 x [10 x i8]], ptr @__const.main.n, i64 0, i64 %idxprom64
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx65)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%33 = load i8, ptr %arrayidx, align 1, !tbaa !5
%tobool.not = icmp eq i8 %33, 0
br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !11
while.end: ; preds = %for.end22.2, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
|
#include <stdio.h>
typedef long long int ll;
int mod = 1000000007;
int dp[1001][1001];
int main(){
int i, j, k, n, ans;
for(i=2;i<=1000;i++){
if(dp[i][0]) continue;
for(j=i;j<=1000;j+=i) dp[j][0]=1;
for(k=i;k<=1000;k*=i){
for(j=k;j<=1000;j+=k){
dp[j][i]++;
}
}
}
scanf("%d", &n);
for(j=2;j<=n;j++){
for(i=j;i<n;i++){
dp[n][j] += dp[i][j];
}
}
ans = 1;
for(j=2;j<=n;j++){
ans = (ll) ans * (dp[n][j]+1) % mod;
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139936/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139936/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr global i32 1000000007, align 4
@dp = dso_local local_unnamed_addr global [1001 x [1001 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind 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
br label %for.body
for.body: ; preds = %entry, %for.inc23
%indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %for.inc23 ]
%arrayidx = getelementptr inbounds [1001 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %for.body4, label %for.inc23
for.cond11.preheader.preheader: ; preds = %for.body4
%1 = trunc i64 %indvars.iv to i32
br label %for.cond11.preheader
for.body4: ; preds = %for.body, %for.body4
%indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.body4 ], [ %indvars.iv, %for.body ]
%arrayidx6 = getelementptr inbounds [1001 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv106
store i32 1, ptr %arrayidx6, align 4, !tbaa !5
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, %indvars.iv
%cmp3 = icmp ult i64 %indvars.iv.next107, 1001
br i1 %cmp3, label %for.body4, label %for.cond11.preheader.preheader, !llvm.loop !9
for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.inc21
%k.095 = phi i32 [ %mul, %for.inc21 ], [ %1, %for.cond11.preheader.preheader ]
%2 = zext i32 %k.095 to i64
br label %for.body13
for.body13: ; preds = %for.cond11.preheader, %for.body13
%indvars.iv109 = phi i64 [ %2, %for.cond11.preheader ], [ %indvars.iv.next110, %for.body13 ]
%arrayidx17 = getelementptr inbounds [1001 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv109, i64 %indvars.iv
%3 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%inc = add nsw i32 %3, 1
store i32 %inc, ptr %arrayidx17, align 4, !tbaa !5
%indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, %2
%cmp12 = icmp ult i64 %indvars.iv.next110, 1001
br i1 %cmp12, label %for.body13, label %for.inc21, !llvm.loop !11
for.inc21: ; preds = %for.body13
%mul = mul nsw i32 %k.095, %1
%cmp9 = icmp ult i32 %mul, 1001
br i1 %cmp9, label %for.cond11.preheader, label %for.inc23, !llvm.loop !12
for.inc23: ; preds = %for.inc21, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 1001
br i1 %exitcond.not, label %for.end25, label %for.body, !llvm.loop !13
for.end25: ; preds = %for.inc23
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp27.not100 = icmp slt i32 %4, 2
br i1 %cmp27.not100, label %for.end61, label %for.cond29.preheader.lr.ph
for.cond29.preheader.lr.ph: ; preds = %for.end25
%idxprom36 = zext i32 %4 to i64
%5 = add i32 %4, 1
%wide.trip.count120 = zext i32 %5 to i64
%wide.trip.count = zext i32 %4 to i64
br label %for.cond29.preheader
for.cond29.preheader: ; preds = %for.cond29.preheader.lr.ph, %for.inc44
%indvars.iv113 = phi i64 [ 2, %for.cond29.preheader.lr.ph ], [ %indvars.iv.next114, %for.inc44 ]
%cmp3098 = icmp ult i64 %indvars.iv113, %idxprom36
br i1 %cmp3098, label %for.body31.lr.ph, label %for.inc44
for.body31.lr.ph: ; preds = %for.cond29.preheader
%arrayidx39 = getelementptr inbounds [1001 x [1001 x i32]], ptr @dp, i64 0, i64 %idxprom36, i64 %indvars.iv113
%arrayidx39.promoted = load i32, ptr %arrayidx39, align 4, !tbaa !5
br label %for.body31
for.cond47.preheader: ; preds = %for.inc44
br i1 %cmp27.not100, label %for.end61, label %for.body49.lr.ph
for.body49.lr.ph: ; preds = %for.cond47.preheader
%idxprom50 = zext i32 %4 to i64
%6 = load i32, ptr @mod, align 4, !tbaa !5
%conv57 = sext i32 %6 to i64
%xtraiter = and i64 %wide.trip.count120, 1
%7 = icmp eq i32 %5, 3
br i1 %7, label %for.end61.loopexit.unr-lcssa, label %for.body49.lr.ph.new
for.body49.lr.ph.new: ; preds = %for.body49.lr.ph
%8 = and i64 %wide.trip.count120, 4294967294
%9 = add nsw i64 %8, -4
br label %for.body49
for.body31: ; preds = %for.body31.lr.ph, %for.body31
%indvars.iv115 = phi i64 [ %indvars.iv113, %for.body31.lr.ph ], [ %indvars.iv.next116, %for.body31 ]
%10 = phi i32 [ %arrayidx39.promoted, %for.body31.lr.ph ], [ %add40, %for.body31 ]
%arrayidx35 = getelementptr inbounds [1001 x [1001 x i32]], ptr @dp, i64 0, i64 %indvars.iv115, i64 %indvars.iv113
%11 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%add40 = add nsw i32 %10, %11
store i32 %add40, ptr %arrayidx39, align 4, !tbaa !5
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%exitcond118.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count
br i1 %exitcond118.not, label %for.inc44, label %for.body31, !llvm.loop !14
for.inc44: ; preds = %for.body31, %for.cond29.preheader
%indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
%exitcond121.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count120
br i1 %exitcond121.not, label %for.cond47.preheader, label %for.cond29.preheader, !llvm.loop !15
for.body49: ; preds = %for.body49, %for.body49.lr.ph.new
%indvars.iv122 = phi i64 [ 2, %for.body49.lr.ph.new ], [ %indvars.iv.next123.1, %for.body49 ]
%ans.0104 = phi i64 [ 1, %for.body49.lr.ph.new ], [ %rem.1, %for.body49 ]
%niter = phi i64 [ 0, %for.body49.lr.ph.new ], [ %niter.next.1, %for.body49 ]
%arrayidx53 = getelementptr inbounds [1001 x [1001 x i32]], ptr @dp, i64 0, i64 %idxprom50, i64 %indvars.iv122
%12 = load i32, ptr %arrayidx53, align 4, !tbaa !5
%add54 = add nsw i32 %12, 1
%conv55 = sext i32 %add54 to i64
%mul56 = mul nsw i64 %ans.0104, %conv55
%rem = srem i64 %mul56, %conv57
%indvars.iv.next123 = or i64 %indvars.iv122, 1
%arrayidx53.1 = getelementptr inbounds [1001 x [1001 x i32]], ptr @dp, i64 0, i64 %idxprom50, i64 %indvars.iv.next123
%13 = load i32, ptr %arrayidx53.1, align 4, !tbaa !5
%add54.1 = add nsw i32 %13, 1
%conv55.1 = sext i32 %add54.1 to i64
%mul56.1 = mul nsw i64 %rem, %conv55.1
%rem.1 = srem i64 %mul56.1, %conv57
%indvars.iv.next123.1 = add nuw nsw i64 %indvars.iv122, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter, %9
br i1 %niter.ncmp.1, label %for.end61.loopexit.unr-lcssa, label %for.body49, !llvm.loop !16
for.end61.loopexit.unr-lcssa: ; preds = %for.body49, %for.body49.lr.ph
%rem.lcssa.ph = phi i64 [ undef, %for.body49.lr.ph ], [ %rem.1, %for.body49 ]
%indvars.iv122.unr = phi i64 [ 2, %for.body49.lr.ph ], [ %indvars.iv.next123.1, %for.body49 ]
%ans.0104.unr = phi i64 [ 1, %for.body49.lr.ph ], [ %rem.1, %for.body49 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end61.loopexit, label %for.body49.epil
for.body49.epil: ; preds = %for.end61.loopexit.unr-lcssa
%arrayidx53.epil = getelementptr inbounds [1001 x [1001 x i32]], ptr @dp, i64 0, i64 %idxprom50, i64 %indvars.iv122.unr
%14 = load i32, ptr %arrayidx53.epil, align 4, !tbaa !5
%add54.epil = add nsw i32 %14, 1
%conv55.epil = sext i32 %add54.epil to i64
%mul56.epil = mul nsw i64 %ans.0104.unr, %conv55.epil
%rem.epil = srem i64 %mul56.epil, %conv57
br label %for.end61.loopexit
for.end61.loopexit: ; preds = %for.end61.loopexit.unr-lcssa, %for.body49.epil
%rem.lcssa = phi i64 [ %rem.lcssa.ph, %for.end61.loopexit.unr-lcssa ], [ %rem.epil, %for.body49.epil ]
%conv58 = trunc i64 %rem.lcssa to i32
br label %for.end61
for.end61: ; preds = %for.end25, %for.end61.loopexit, %for.cond47.preheader
%ans.0.lcssa = phi i32 [ 1, %for.cond47.preheader ], [ %conv58, %for.end61.loopexit ], [ 1, %for.end25 ]
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <math.h>
int main(void) {
int n;
int a;
long long ans = 0;
int flag = 0;
int min = INT_MAX,temp;
int fu_cnt = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &a);
if (a < 0)fu_cnt++;
else if (a == 0)flag = 1;
temp = abs(a);
if (min > temp)min = temp;
ans += temp;
}
if (flag || fu_cnt % 2 == 0)printf("%lld", ans);
else printf("%lld", ans - 2 * min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139987/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139987/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %if.end17
for.cond.cleanup: ; preds = %for.body
%1 = icmp ne i32 %flag.1, 0
%2 = and i32 %fu_cnt.1, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %1, i1 true, i1 %3
br i1 %4, label %if.end17, label %if.else14
for.body: ; preds = %entry, %for.body
%i.032 = phi i32 [ %inc9, %for.body ], [ 0, %entry ]
%fu_cnt.031 = phi i32 [ %fu_cnt.1, %for.body ], [ 0, %entry ]
%ans.030 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%min.029 = phi i32 [ %spec.select26, %for.body ], [ 2147483647, %entry ]
%flag.028 = phi i32 [ %flag.1, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp slt i32 %5, 0
%cmp3 = icmp eq i32 %5, 0
%spec.select = select i1 %cmp3, i32 1, i32 %flag.028
%flag.1 = select i1 %cmp2, i32 %flag.028, i32 %spec.select
%.lobit = lshr i32 %5, 31
%fu_cnt.1 = add nuw nsw i32 %.lobit, %fu_cnt.031
%6 = call i32 @llvm.abs.i32(i32 %5, i1 true)
%spec.select26 = call i32 @llvm.smin.i32(i32 %min.029, i32 %6)
%conv = zext i32 %6 to i64
%add = add nuw nsw i64 %ans.030, %conv
%inc9 = add nuw nsw i32 %i.032, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc9, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.else14: ; preds = %for.cond.cleanup
%8 = shl nuw nsw i32 %spec.select26, 1
%9 = zext i32 %8 to i64
%sub = sub nsw i64 %add, %9
br label %if.end17
if.end17: ; preds = %for.cond.cleanup, %entry, %if.else14
%sub.sink = phi i64 [ %sub, %if.else14 ], [ %add, %for.cond.cleanup ], [ 0, %entry ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
long long int max(long long int a, long long int b) {
if (a >= b) {
return a;
}
return b;
}
int main(void) {
int n, i;
scanf("%d", &n);
long long int a[n];
for (i = 0; i < n; i++) {
scanf("%lld", &a[i]);
}
long long int dp[n][2];
dp[0][0] = 0;
dp[0][1] = -999999999999999999;
for (i = 0; i < n; i++) {
dp[i + 1][0] = max(dp[i][0] + a[i], dp[i][1] - a[i]);
dp[i + 1][1] = max(dp[i][0] - a[i], dp[i][1] + a[i]);
}
printf("%lld\n", dp[n][0]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140028/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140028/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%b.a = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %b.a
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %3, 0
br i1 %cmp65, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%4 = zext i32 %3 to i64
%vla275 = alloca [2 x i64], i64 %4, align 16
store i64 0, ptr %vla275, align 16, !tbaa !9
%arrayidx676 = getelementptr inbounds [2 x i64], ptr %vla275, i64 0, i64 1
store i64 -999999999999999999, ptr %arrayidx676, align 8, !tbaa !9
br label %for.end44
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%7 = zext i32 %5 to i64
%vla2 = alloca [2 x i64], i64 %7, align 16
store i64 0, ptr %vla2, align 16, !tbaa !9
%arrayidx6 = getelementptr inbounds [2 x i64], ptr %vla2, i64 0, i64 1
store i64 -999999999999999999, ptr %arrayidx6, align 8, !tbaa !9
%cmp867 = icmp sgt i32 %5, 0
br i1 %cmp867, label %for.body9, label %for.end44
for.body9: ; preds = %for.end, %for.body9
%8 = phi i64 [ %b.a.i64, %for.body9 ], [ -999999999999999999, %for.end ]
%9 = phi i64 [ %b.a.i, %for.body9 ], [ 0, %for.end ]
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body9 ], [ 0, %for.end ]
%arrayidx14 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv71
%10 = load i64, ptr %arrayidx14, align 8, !tbaa !9
%add = add nsw i64 %10, %9
%sub = sub nsw i64 %8, %10
%b.a.i = call i64 @llvm.smax.i64(i64 %add, i64 %sub)
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%arrayidx23 = getelementptr inbounds [2 x i64], ptr %vla2, i64 %indvars.iv.next72
store i64 %b.a.i, ptr %arrayidx23, align 16, !tbaa !9
%sub30 = sub nsw i64 %9, %10
%add36 = add nsw i64 %8, %10
%b.a.i64 = call i64 @llvm.smax.i64(i64 %sub30, i64 %add36)
%arrayidx41 = getelementptr inbounds [2 x i64], ptr %vla2, i64 %indvars.iv.next72, i64 1
store i64 %b.a.i64, ptr %arrayidx41, align 8, !tbaa !9
%exitcond.not = icmp eq i64 %indvars.iv.next72, %7
br i1 %exitcond.not, label %for.end44, label %for.body9, !llvm.loop !13
for.end44: ; preds = %for.body9, %for.end.thread, %for.end
%vla279 = phi ptr [ %vla275, %for.end.thread ], [ %vla2, %for.end ], [ %vla2, %for.body9 ]
%.lcssa78 = phi i32 [ %3, %for.end.thread ], [ %5, %for.end ], [ %5, %for.body9 ]
%idxprom45 = sext i32 %.lcssa78 to i64
%arrayidx46 = getelementptr inbounds [2 x i64], ptr %vla279, i64 %idxprom45
%11 = load i64, ptr %arrayidx46, align 16, !tbaa !9
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %11)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
int A[100000];
int Abs(int x){
if(x < 0) return -x;
else return x;
}
void Do(int N){
int i, c, C, m, n;
long long B;
c = 0;
C = 0;
m = 1e9;
n = -1;
for(i = 0;i < N;i++){
scanf("%d", &A[i]);
if(A[i] == 0) c = 1;
if(c == 0 && A[i] < 0) C++;
if(m > Abs(A[i])){
m = Abs(A[i]);
n = i;
}
}
B = 0;
if(c == 0 && C % 2 == 1){
for(i = 0;i < N;i++){
if(i == n) B -= Abs(A[i]);
else B += Abs(A[i]);
}
}else for(i = 0;i < N;i++) B += Abs(A[i]);
printf("%lld\n", B);
}
int main(void){
int N;
scanf("%d", &N);
Do(N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140079/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140079/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @Abs(i32 noundef %x) local_unnamed_addr #0 {
entry:
%retval.0 = tail call i32 @llvm.abs.i32(i32 %x, i1 true)
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @Do(i32 noundef %N) local_unnamed_addr #1 {
entry:
%cmp83 = icmp sgt i32 %N, 0
br i1 %cmp83, label %for.body.preheader, label %if.end53
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %N to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%n.088 = phi i32 [ -1, %for.body.preheader ], [ %n.1, %for.body ]
%m.087 = phi i32 [ 1000000000, %for.body.preheader ], [ %m.1, %for.body ]
%C.086 = phi i32 [ 0, %for.body.preheader ], [ %C.1, %for.body ]
%c.085 = phi i32 [ 0, %for.body.preheader ], [ %spec.select, %for.body ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp3 = icmp eq i32 %0, 0
%spec.select = select i1 %cmp3, i32 1, i32 %c.085
%cmp4 = icmp eq i32 %spec.select, 0
%1 = lshr i32 %0, 31
%spec.select77 = select i1 %cmp4, i32 %1, i32 0
%C.1 = add i32 %spec.select77, %C.086
%retval.0.i = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%cmp13 = icmp sgt i32 %m.087, %retval.0.i
%m.1 = tail call i32 @llvm.smin.i32(i32 %m.087, i32 %retval.0.i)
%2 = trunc i64 %indvars.iv to i32
%n.1 = select i1 %cmp13, i32 %2, i32 %n.088
%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 !9
for.end: ; preds = %for.body
%3 = icmp eq i32 %spec.select, 0
%4 = and i32 %C.1, -2147483647
%5 = icmp eq i32 %4, 1
%6 = select i1 %3, i1 %5, i1 false
%7 = zext i32 %n.1 to i64
br i1 %6, label %for.cond24.preheader, label %for.cond41.preheader
for.cond41.preheader: ; preds = %for.end
br i1 %cmp83, label %for.body44.preheader, label %if.end53
for.body44.preheader: ; preds = %for.cond41.preheader
%wide.trip.count104 = zext i32 %N to i64
%min.iters.check = icmp ult i32 %N, 4
br i1 %min.iters.check, label %for.body44.preheader117, label %vector.ph
vector.ph: ; preds = %for.body44.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%vec.phi115 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%8 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %index
%wide.load = load <2 x i32>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 2
%wide.load116 = load <2 x i32>, ptr %9, align 8, !tbaa !5
%10 = tail call <2 x i32> @llvm.abs.v2i32(<2 x i32> %wide.load, i1 true)
%11 = tail call <2 x i32> @llvm.abs.v2i32(<2 x i32> %wide.load116, i1 true)
%12 = zext <2 x i32> %10 to <2 x i64>
%13 = zext <2 x i32> %11 to <2 x i64>
%14 = add <2 x i64> %vec.phi, %12
%15 = add <2 x i64> %vec.phi115, %13
%index.next = add nuw i64 %index, 4
%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 <2 x i64> %15, %14
%17 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %if.end53, label %for.body44.preheader117
for.body44.preheader117: ; preds = %for.body44.preheader, %middle.block
%indvars.iv101.ph = phi i64 [ 0, %for.body44.preheader ], [ %n.vec, %middle.block ]
%B.293.ph = phi i64 [ 0, %for.body44.preheader ], [ %17, %middle.block ]
br label %for.body44
for.cond24.preheader: ; preds = %for.end
br i1 %cmp83, label %for.body26.preheader, label %if.end53
for.body26.preheader: ; preds = %for.cond24.preheader
%wide.trip.count109 = zext i32 %N to i64
%arrayidx30 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %7
br label %for.body26
for.body26: ; preds = %for.body26.preheader, %for.inc37
%indvars.iv106 = phi i64 [ 0, %for.body26.preheader ], [ %indvars.iv.next107, %for.inc37 ]
%B.097 = phi i64 [ 0, %for.body26.preheader ], [ %B.1, %for.inc37 ]
%cmp27 = icmp eq i64 %indvars.iv106, %7
br i1 %cmp27, label %if.then28, label %if.else
if.then28: ; preds = %for.body26
%18 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%retval.0.i79 = tail call i32 @llvm.abs.i32(i32 %18, i1 true)
%conv = zext i32 %retval.0.i79 to i64
%sub = sub nsw i64 %B.097, %conv
br label %for.inc37
if.else: ; preds = %for.body26
%arrayidx33 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv106
%19 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%retval.0.i80 = tail call i32 @llvm.abs.i32(i32 %19, i1 true)
%conv35 = zext i32 %retval.0.i80 to i64
%add = add nsw i64 %B.097, %conv35
br label %for.inc37
for.inc37: ; preds = %if.then28, %if.else
%B.1 = phi i64 [ %sub, %if.then28 ], [ %add, %if.else ]
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109
br i1 %exitcond110.not, label %if.end53, label %for.body26, !llvm.loop !14
for.body44: ; preds = %for.body44.preheader117, %for.body44
%indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body44 ], [ %indvars.iv101.ph, %for.body44.preheader117 ]
%B.293 = phi i64 [ %add49, %for.body44 ], [ %B.293.ph, %for.body44.preheader117 ]
%arrayidx46 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv101
%20 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%retval.0.i81 = tail call i32 @llvm.abs.i32(i32 %20, i1 true)
%conv48 = zext i32 %retval.0.i81 to i64
%add49 = add nuw nsw i64 %B.293, %conv48
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
br i1 %exitcond105.not, label %if.end53, label %for.body44, !llvm.loop !15
if.end53: ; preds = %for.body44, %for.inc37, %middle.block, %entry, %for.cond41.preheader, %for.cond24.preheader
%B.3 = phi i64 [ 0, %for.cond24.preheader ], [ 0, %for.cond41.preheader ], [ 0, %entry ], [ %17, %middle.block ], [ %B.1, %for.inc37 ], [ %add49, %for.body44 ]
%call54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %B.3)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: 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
call void @Do(i32 noundef %0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.abs.v2i32(<2 x i32>, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
typedef long long int int64;
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
int cmp(const void *a,const void *b){
return *(int *)a - *(int *)b;
}
void run(void){
int n;
scanf("%d",&n);
int a[100000];
int i;
for(i=0;i<n;i++) scanf("%d",a+i);
qsort(a,n,sizeof(int),cmp);
int x,y;
x=y=0;
for(i=n-1;i-1>=0;i--){
if(a[i]==a[i-1]){
x=a[i];
break;
}
}
for(i=i-2;i-1>=0;i--){
if(a[i]==a[i-1]){
y=a[i];
break;
}
}
printf("%lld\n",(int64)x*y);
return;
}
int main(void){
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140129/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140129/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %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 void @run() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%a = alloca [100000 x i32], align 16
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)
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp59 = icmp sgt i32 %0, 0
br i1 %cmp59, 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 ]
%add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.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 @cmp) #5
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
br label %for.cond3
for.cond3: ; preds = %for.body7, %for.end
%indvars.iv66 = phi i64 [ %6, %for.body7 ], [ %4, %for.end ]
%5 = trunc i64 %indvars.iv66 to i32
%cmp5 = icmp sgt i32 %5, 1
br i1 %cmp5, label %for.body7, label %for.end16
for.body7: ; preds = %for.cond3
%6 = add nsw i64 %indvars.iv66, -1
%sub4 = add i64 %indvars.iv66, 4294967294
%arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %6
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom9 = and i64 %sub4, 4294967295
%arrayidx10 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %idxprom9
%8 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp eq i32 %7, %8
br i1 %cmp11, label %if.then, label %for.cond3, !llvm.loop !11
if.then: ; preds = %for.body7
%9 = sext i32 %7 to i64
br label %for.end16
for.end16: ; preds = %for.cond3, %if.then
%x.0 = phi i64 [ %9, %if.then ], [ 0, %for.cond3 ]
%sub17 = add nsw i32 %5, -3
br label %for.cond18
for.cond18: ; preds = %for.body22, %for.end16
%i.2 = phi i32 [ %sub17, %for.end16 ], [ %sub19, %for.body22 ]
%cmp20 = icmp sgt i32 %i.2, 0
br i1 %cmp20, label %for.body22, label %for.end36
for.body22: ; preds = %for.cond18
%sub19 = add nsw i32 %i.2, -1
%idxprom23 = zext i32 %i.2 to i64
%arrayidx24 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %idxprom23
%10 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom26 = zext i32 %sub19 to i64
%arrayidx27 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %idxprom26
%11 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28 = icmp eq i32 %10, %11
br i1 %cmp28, label %if.then30, label %for.cond18, !llvm.loop !12
if.then30: ; preds = %for.body22
%12 = sext i32 %10 to i64
br label %for.end36
for.end36: ; preds = %for.cond18, %if.then30
%y.0 = phi i64 [ %12, %if.then30 ], [ 0, %for.cond18 ]
%mul = mul nsw i64 %y.0, %x.0
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret void
}
; 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 uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
tail call void @run()
ret i32 0
}
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}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdbool.h>
int main(void)
{
bool arr[100][100] = {{false}};
int w, h, n;
int x, y, a;
int ans=0;
scanf("%d %d %d", &w, &h, &n);
for (int r=0; r < n; r++){
scanf("%d %d %d", &x, &y, &a);
if (a == 1) {
for (int j=0; j < h; j++) {
for (int i=0; i < x; i++) {
arr[j][i] = true;
}
}
} else if (a == 2) {
for (int j=0; j < h; j++) {
for (int i=x; i < w; i++) {
arr[j][i] = true;
}
}
} else if (a == 3) {
for (int j=0; j < y; j++) {
for (int i=0; i < w; i++) {
arr[j][i] = true;
}
}
} else if (a == 4) {
for (int j=y; j < h; j++) {
for (int i=0; i < w; i++) {
arr[j][i] = true;
}
}
}
}
for (int j=0; j < h; j++) {
for (int i=0; i < w; i++) {
if (arr[j][i] == false) {
ans++;
}
}
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140172/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140172/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%arr = alloca [100 x [100 x i8]], align 16
%w = alloca i32, align 4
%h = alloca i32, align 4
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %arr) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10000) %arr, i8 0, i64 10000, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp157 = icmp sgt i32 %0, 0
br i1 %cmp157, label %for.body.preheader, label %for.cond91.preheader
for.body.preheader: ; preds = %entry
%invariant.gep233 = getelementptr i8, ptr %arr, i64 100
%invariant.gep235 = getelementptr i8, ptr %arr, i64 200
%invariant.gep237 = getelementptr i8, ptr %arr, i64 300
%invariant.gep239 = getelementptr i8, ptr %arr, i64 400
%invariant.gep241 = getelementptr i8, ptr %arr, i64 500
%invariant.gep243 = getelementptr i8, ptr %arr, i64 600
%invariant.gep245 = getelementptr i8, ptr %arr, i64 700
%invariant.gep261 = getelementptr i8, ptr %arr, i64 100
%invariant.gep263 = getelementptr i8, ptr %arr, i64 200
%invariant.gep265 = getelementptr i8, ptr %arr, i64 300
%invariant.gep267 = getelementptr i8, ptr %arr, i64 400
%invariant.gep269 = getelementptr i8, ptr %arr, i64 500
%invariant.gep271 = getelementptr i8, ptr %arr, i64 600
%invariant.gep273 = getelementptr i8, ptr %arr, i64 700
br label %for.body
for.cond91.preheader: ; preds = %for.inc87, %entry
%1 = load i32, ptr %h, align 4, !tbaa !5
%cmp92162 = icmp sgt i32 %1, 0
br i1 %cmp92162, label %for.cond96.preheader.lr.ph, label %for.cond.cleanup93
for.cond96.preheader.lr.ph: ; preds = %for.cond91.preheader
%2 = load i32, ptr %w, align 4, !tbaa !5
%cmp97159 = icmp sgt i32 %2, 0
br i1 %cmp97159, label %for.cond96.preheader.us.preheader, label %for.cond.cleanup93
for.cond96.preheader.us.preheader: ; preds = %for.cond96.preheader.lr.ph
%wide.trip.count201 = zext i32 %1 to i64
%wide.trip.count196 = zext i32 %2 to i64
%min.iters.check = icmp ult i32 %2, 8
%n.vec = and i64 %wide.trip.count196, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count196
br label %for.cond96.preheader.us
for.cond96.preheader.us: ; preds = %for.cond96.preheader.us.preheader, %for.cond96.for.cond.cleanup98_crit_edge.us
%indvars.iv198 = phi i64 [ 0, %for.cond96.preheader.us.preheader ], [ %indvars.iv.next199, %for.cond96.for.cond.cleanup98_crit_edge.us ]
%ans.0163.us = phi i32 [ 0, %for.cond96.preheader.us.preheader ], [ %spec.select.us.lcssa, %for.cond96.for.cond.cleanup98_crit_edge.us ]
br i1 %min.iters.check, label %for.body99.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond96.preheader.us
%3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %ans.0163.us, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %10, %vector.body ]
%vec.phi209 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%4 = getelementptr inbounds [100 x [100 x i8]], ptr %arr, i64 0, i64 %indvars.iv198, i64 %index
%wide.load = load <4 x i8>, ptr %4, align 4, !tbaa !9
%5 = getelementptr inbounds i8, ptr %4, i64 4
%wide.load210 = load <4 x i8>, ptr %5, align 4, !tbaa !9
%6 = icmp eq <4 x i8> %wide.load, zeroinitializer
%7 = icmp eq <4 x i8> %wide.load210, zeroinitializer
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = add <4 x i32> %vec.phi, %8
%11 = add <4 x i32> %vec.phi209, %9
%index.next = add nuw i64 %index, 8
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %11, %10
%13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond96.for.cond.cleanup98_crit_edge.us, label %for.body99.us.preheader
for.body99.us.preheader: ; preds = %for.cond96.preheader.us, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.cond96.preheader.us ], [ %n.vec, %middle.block ]
%ans.1160.us.ph = phi i32 [ %ans.0163.us, %for.cond96.preheader.us ], [ %13, %middle.block ]
br label %for.body99.us
for.body99.us: ; preds = %for.body99.us.preheader, %for.body99.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body99.us ], [ %indvars.iv.ph, %for.body99.us.preheader ]
%ans.1160.us = phi i32 [ %spec.select.us, %for.body99.us ], [ %ans.1160.us.ph, %for.body99.us.preheader ]
%arrayidx103.us = getelementptr inbounds [100 x [100 x i8]], ptr %arr, i64 0, i64 %indvars.iv198, i64 %indvars.iv
%14 = load i8, ptr %arrayidx103.us, align 1, !tbaa !9, !range !15, !noundef !16
%cmp104.us = icmp eq i8 %14, 0
%inc107.us = zext i1 %cmp104.us to i32
%spec.select.us = add nsw i32 %ans.1160.us, %inc107.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond197.not = icmp eq i64 %indvars.iv.next, %wide.trip.count196
br i1 %exitcond197.not, label %for.cond96.for.cond.cleanup98_crit_edge.us, label %for.body99.us, !llvm.loop !17
for.cond96.for.cond.cleanup98_crit_edge.us: ; preds = %for.body99.us, %middle.block
%spec.select.us.lcssa = phi i32 [ %13, %middle.block ], [ %spec.select.us, %for.body99.us ]
%indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
%exitcond202.not = icmp eq i64 %indvars.iv.next199, %wide.trip.count201
br i1 %exitcond202.not, label %for.cond.cleanup93, label %for.cond96.preheader.us, !llvm.loop !18
for.body: ; preds = %for.body.preheader, %for.inc87
%r.0158 = phi i32 [ %inc88, %for.inc87 ], [ 0, %for.body.preheader ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %a)
%15 = load i32, ptr %a, align 4, !tbaa !5
switch i32 %15, label %for.inc87 [
i32 1, label %for.cond3.preheader
i32 2, label %for.cond19.preheader
i32 3, label %for.cond42.preheader
i32 4, label %if.then63
]
for.cond42.preheader: ; preds = %for.body
%16 = load i32, ptr %y, align 4, !tbaa !5
%cmp43147 = icmp sgt i32 %16, 0
br i1 %cmp43147, label %for.cond47.preheader.lr.ph, label %for.inc87
for.cond47.preheader.lr.ph: ; preds = %for.cond42.preheader
%17 = load i32, ptr %w, align 4, !tbaa !5
%cmp48145 = icmp sgt i32 %17, 0
br i1 %cmp48145, label %for.cond47.preheader.us.preheader, label %for.inc87
for.cond47.preheader.us.preheader: ; preds = %for.cond47.preheader.lr.ph
%18 = zext i32 %17 to i64
%wide.trip.count = zext i32 %16 to i64
%xtraiter216 = and i64 %wide.trip.count, 7
%19 = icmp ult i32 %16, 8
br i1 %19, label %for.inc87.loopexit214.unr-lcssa, label %for.cond47.preheader.us.preheader.new
for.cond47.preheader.us.preheader.new: ; preds = %for.cond47.preheader.us.preheader
%unroll_iter219 = and i64 %wide.trip.count, 4294967288
br label %for.cond47.preheader.us
for.cond47.preheader.us: ; preds = %for.cond47.preheader.us, %for.cond47.preheader.us.preheader.new
%indvar175 = phi i64 [ 0, %for.cond47.preheader.us.preheader.new ], [ %indvar.next176.7, %for.cond47.preheader.us ]
%niter220 = phi i64 [ 0, %for.cond47.preheader.us.preheader.new ], [ %niter220.next.7, %for.cond47.preheader.us ]
%20 = mul nuw nsw i64 %indvar175, 100
%scevgep177 = getelementptr i8, ptr %arr, i64 %20
call void @llvm.memset.p0.i64(ptr align 16 %scevgep177, i8 1, i64 %18, i1 false), !tbaa !9
%21 = mul nuw i64 %indvar175, 100
%gep234 = getelementptr i8, ptr %invariant.gep233, i64 %21
call void @llvm.memset.p0.i64(ptr align 4 %gep234, i8 1, i64 %18, i1 false), !tbaa !9
%22 = mul nuw i64 %indvar175, 100
%gep236 = getelementptr i8, ptr %invariant.gep235, i64 %22
call void @llvm.memset.p0.i64(ptr align 8 %gep236, i8 1, i64 %18, i1 false), !tbaa !9
%23 = mul nuw i64 %indvar175, 100
%gep238 = getelementptr i8, ptr %invariant.gep237, i64 %23
call void @llvm.memset.p0.i64(ptr align 4 %gep238, i8 1, i64 %18, i1 false), !tbaa !9
%24 = mul nuw i64 %indvar175, 100
%gep240 = getelementptr i8, ptr %invariant.gep239, i64 %24
call void @llvm.memset.p0.i64(ptr align 16 %gep240, i8 1, i64 %18, i1 false), !tbaa !9
%25 = mul nuw i64 %indvar175, 100
%gep242 = getelementptr i8, ptr %invariant.gep241, i64 %25
call void @llvm.memset.p0.i64(ptr align 4 %gep242, i8 1, i64 %18, i1 false), !tbaa !9
%26 = mul nuw i64 %indvar175, 100
%gep244 = getelementptr i8, ptr %invariant.gep243, i64 %26
call void @llvm.memset.p0.i64(ptr align 8 %gep244, i8 1, i64 %18, i1 false), !tbaa !9
%27 = mul nuw i64 %indvar175, 100
%gep246 = getelementptr i8, ptr %invariant.gep245, i64 %27
call void @llvm.memset.p0.i64(ptr align 4 %gep246, i8 1, i64 %18, i1 false), !tbaa !9
%indvar.next176.7 = add nuw nsw i64 %indvar175, 8
%niter220.next.7 = add i64 %niter220, 8
%niter220.ncmp.7 = icmp eq i64 %niter220.next.7, %unroll_iter219
br i1 %niter220.ncmp.7, label %for.inc87.loopexit214.unr-lcssa, label %for.cond47.preheader.us, !llvm.loop !19
for.cond19.preheader: ; preds = %for.body
%28 = load i32, ptr %h, align 4, !tbaa !5
%cmp20151 = icmp sgt i32 %28, 0
br i1 %cmp20151, label %for.body22.lr.ph, label %for.inc87
for.body22.lr.ph: ; preds = %for.cond19.preheader
%29 = load i32, ptr %x, align 4, !tbaa !5
%30 = load i32, ptr %w, align 4, !tbaa !5
%cmp25149 = icmp slt i32 %29, %30
br i1 %cmp25149, label %for.body22.us.preheader, label %for.inc87
for.body22.us.preheader: ; preds = %for.body22.lr.ph
%31 = sext i32 %29 to i64
%32 = xor i32 %29, -1
%33 = add i32 %30, %32
%34 = zext i32 %33 to i64
%35 = add nuw nsw i64 %34, 1
%wide.trip.count186 = zext i32 %28 to i64
%invariant.gep = getelementptr i8, ptr %arr, i64 %31
%xtraiter221 = and i64 %wide.trip.count186, 7
%36 = icmp ult i32 %28, 8
br i1 %36, label %for.inc87.loopexit213.unr-lcssa, label %for.body22.us.preheader.new
for.body22.us.preheader.new: ; preds = %for.body22.us.preheader
%unroll_iter224 = and i64 %wide.trip.count186, 4294967288
%invariant.gep247 = getelementptr i8, ptr %invariant.gep, i64 100
%invariant.gep249 = getelementptr i8, ptr %invariant.gep, i64 200
%invariant.gep251 = getelementptr i8, ptr %invariant.gep, i64 300
%invariant.gep253 = getelementptr i8, ptr %invariant.gep, i64 400
%invariant.gep255 = getelementptr i8, ptr %invariant.gep, i64 500
%invariant.gep257 = getelementptr i8, ptr %invariant.gep, i64 600
%invariant.gep259 = getelementptr i8, ptr %invariant.gep, i64 700
br label %for.body22.us
for.body22.us: ; preds = %for.body22.us, %for.body22.us.preheader.new
%indvar181 = phi i64 [ 0, %for.body22.us.preheader.new ], [ %indvar.next182.7, %for.body22.us ]
%niter225 = phi i64 [ 0, %for.body22.us.preheader.new ], [ %niter225.next.7, %for.body22.us ]
%37 = mul nuw nsw i64 %indvar181, 100
%gep = getelementptr i8, ptr %invariant.gep, i64 %37
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep, i8 1, i64 %35, i1 false), !tbaa !9
%38 = mul nuw i64 %indvar181, 100
%gep248 = getelementptr i8, ptr %invariant.gep247, i64 %38
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep248, i8 1, i64 %35, i1 false), !tbaa !9
%39 = mul nuw i64 %indvar181, 100
%gep250 = getelementptr i8, ptr %invariant.gep249, i64 %39
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep250, i8 1, i64 %35, i1 false), !tbaa !9
%40 = mul nuw i64 %indvar181, 100
%gep252 = getelementptr i8, ptr %invariant.gep251, i64 %40
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep252, i8 1, i64 %35, i1 false), !tbaa !9
%41 = mul nuw i64 %indvar181, 100
%gep254 = getelementptr i8, ptr %invariant.gep253, i64 %41
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep254, i8 1, i64 %35, i1 false), !tbaa !9
%42 = mul nuw i64 %indvar181, 100
%gep256 = getelementptr i8, ptr %invariant.gep255, i64 %42
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep256, i8 1, i64 %35, i1 false), !tbaa !9
%43 = mul nuw i64 %indvar181, 100
%gep258 = getelementptr i8, ptr %invariant.gep257, i64 %43
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep258, i8 1, i64 %35, i1 false), !tbaa !9
%44 = mul nuw i64 %indvar181, 100
%gep260 = getelementptr i8, ptr %invariant.gep259, i64 %44
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep260, i8 1, i64 %35, i1 false), !tbaa !9
%indvar.next182.7 = add nuw nsw i64 %indvar181, 8
%niter225.next.7 = add i64 %niter225, 8
%niter225.ncmp.7 = icmp eq i64 %niter225.next.7, %unroll_iter224
br i1 %niter225.ncmp.7, label %for.inc87.loopexit213.unr-lcssa, label %for.body22.us, !llvm.loop !20
for.cond3.preheader: ; preds = %for.body
%45 = load i32, ptr %h, align 4, !tbaa !5
%cmp4155 = icmp sgt i32 %45, 0
br i1 %cmp4155, label %for.cond7.preheader.lr.ph, label %for.inc87
for.cond7.preheader.lr.ph: ; preds = %for.cond3.preheader
%46 = load i32, ptr %x, align 4, !tbaa !5
%cmp8153 = icmp sgt i32 %46, 0
br i1 %cmp8153, label %for.cond7.preheader.us.preheader, label %for.inc87
for.cond7.preheader.us.preheader: ; preds = %for.cond7.preheader.lr.ph
%47 = zext i32 %46 to i64
%wide.trip.count193 = zext i32 %45 to i64
%xtraiter226 = and i64 %wide.trip.count193, 7
%48 = icmp ult i32 %45, 8
br i1 %48, label %for.inc87.loopexit.unr-lcssa, label %for.cond7.preheader.us.preheader.new
for.cond7.preheader.us.preheader.new: ; preds = %for.cond7.preheader.us.preheader
%unroll_iter229 = and i64 %wide.trip.count193, 4294967288
br label %for.cond7.preheader.us
for.cond7.preheader.us: ; preds = %for.cond7.preheader.us, %for.cond7.preheader.us.preheader.new
%indvar188 = phi i64 [ 0, %for.cond7.preheader.us.preheader.new ], [ %indvar.next189.7, %for.cond7.preheader.us ]
%niter230 = phi i64 [ 0, %for.cond7.preheader.us.preheader.new ], [ %niter230.next.7, %for.cond7.preheader.us ]
%49 = mul nuw nsw i64 %indvar188, 100
%scevgep190 = getelementptr i8, ptr %arr, i64 %49
call void @llvm.memset.p0.i64(ptr align 16 %scevgep190, i8 1, i64 %47, i1 false), !tbaa !9
%50 = mul nuw i64 %indvar188, 100
%gep262 = getelementptr i8, ptr %invariant.gep261, i64 %50
call void @llvm.memset.p0.i64(ptr align 4 %gep262, i8 1, i64 %47, i1 false), !tbaa !9
%51 = mul nuw i64 %indvar188, 100
%gep264 = getelementptr i8, ptr %invariant.gep263, i64 %51
call void @llvm.memset.p0.i64(ptr align 8 %gep264, i8 1, i64 %47, i1 false), !tbaa !9
%52 = mul nuw i64 %indvar188, 100
%gep266 = getelementptr i8, ptr %invariant.gep265, i64 %52
call void @llvm.memset.p0.i64(ptr align 4 %gep266, i8 1, i64 %47, i1 false), !tbaa !9
%53 = mul nuw i64 %indvar188, 100
%gep268 = getelementptr i8, ptr %invariant.gep267, i64 %53
call void @llvm.memset.p0.i64(ptr align 16 %gep268, i8 1, i64 %47, i1 false), !tbaa !9
%54 = mul nuw i64 %indvar188, 100
%gep270 = getelementptr i8, ptr %invariant.gep269, i64 %54
call void @llvm.memset.p0.i64(ptr align 4 %gep270, i8 1, i64 %47, i1 false), !tbaa !9
%55 = mul nuw i64 %indvar188, 100
%gep272 = getelementptr i8, ptr %invariant.gep271, i64 %55
call void @llvm.memset.p0.i64(ptr align 8 %gep272, i8 1, i64 %47, i1 false), !tbaa !9
%56 = mul nuw i64 %indvar188, 100
%gep274 = getelementptr i8, ptr %invariant.gep273, i64 %56
call void @llvm.memset.p0.i64(ptr align 4 %gep274, i8 1, i64 %47, i1 false), !tbaa !9
%indvar.next189.7 = add nuw nsw i64 %indvar188, 8
%niter230.next.7 = add i64 %niter230, 8
%niter230.ncmp.7 = icmp eq i64 %niter230.next.7, %unroll_iter229
br i1 %niter230.ncmp.7, label %for.inc87.loopexit.unr-lcssa, label %for.cond7.preheader.us, !llvm.loop !21
if.then63: ; preds = %for.body
%57 = load i32, ptr %y, align 4, !tbaa !5
%58 = load i32, ptr %h, align 4, !tbaa !5
%cmp66143 = icmp slt i32 %57, %58
br i1 %cmp66143, label %for.cond70.preheader.lr.ph, label %for.inc87
for.cond70.preheader.lr.ph: ; preds = %if.then63
%59 = load i32, ptr %w, align 4, !tbaa !5
%cmp71141 = icmp sgt i32 %59, 0
br i1 %cmp71141, label %for.cond70.preheader.us.preheader, label %for.inc87
for.cond70.preheader.us.preheader: ; preds = %for.cond70.preheader.lr.ph
%60 = sext i32 %57 to i64
%61 = zext i32 %59 to i64
%62 = sub i32 %58, %57
%63 = xor i32 %57, -1
%64 = add i32 %58, %63
%xtraiter = and i32 %62, 3
%65 = icmp ult i32 %64, 3
br i1 %65, label %for.inc87.loopexit215.unr-lcssa, label %for.cond70.preheader.us.preheader.new
for.cond70.preheader.us.preheader.new: ; preds = %for.cond70.preheader.us.preheader
%unroll_iter = and i32 %62, -4
br label %for.cond70.preheader.us
for.cond70.preheader.us: ; preds = %for.cond70.preheader.us, %for.cond70.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond70.preheader.us.preheader.new ], [ %indvar.next.3, %for.cond70.preheader.us ]
%niter = phi i32 [ 0, %for.cond70.preheader.us.preheader.new ], [ %niter.next.3, %for.cond70.preheader.us ]
%66 = add i64 %indvar, %60
%67 = mul i64 %66, 100
%scevgep = getelementptr i8, ptr %arr, i64 %67
call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 1, i64 %61, i1 false), !tbaa !9
%indvar.next = or i64 %indvar, 1
%68 = add i64 %indvar.next, %60
%69 = mul i64 %68, 100
%scevgep.1 = getelementptr i8, ptr %arr, i64 %69
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.1, i8 1, i64 %61, i1 false), !tbaa !9
%indvar.next.1 = or i64 %indvar, 2
%70 = add i64 %indvar.next.1, %60
%71 = mul i64 %70, 100
%scevgep.2 = getelementptr i8, ptr %arr, i64 %71
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.2, i8 1, i64 %61, i1 false), !tbaa !9
%indvar.next.2 = or i64 %indvar, 3
%72 = add i64 %indvar.next.2, %60
%73 = mul i64 %72, 100
%scevgep.3 = getelementptr i8, ptr %arr, i64 %73
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.3, i8 1, i64 %61, i1 false), !tbaa !9
%indvar.next.3 = add nuw nsw i64 %indvar, 4
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.inc87.loopexit215.unr-lcssa, label %for.cond70.preheader.us, !llvm.loop !22
for.inc87.loopexit.unr-lcssa: ; preds = %for.cond7.preheader.us, %for.cond7.preheader.us.preheader
%indvar188.unr = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvar.next189.7, %for.cond7.preheader.us ]
%lcmp.mod228.not = icmp eq i64 %xtraiter226, 0
br i1 %lcmp.mod228.not, label %for.inc87, label %for.cond7.preheader.us.epil
for.cond7.preheader.us.epil: ; preds = %for.inc87.loopexit.unr-lcssa, %for.cond7.preheader.us.epil
%indvar188.epil = phi i64 [ %indvar.next189.epil, %for.cond7.preheader.us.epil ], [ %indvar188.unr, %for.inc87.loopexit.unr-lcssa ]
%epil.iter227 = phi i64 [ %epil.iter227.next, %for.cond7.preheader.us.epil ], [ 0, %for.inc87.loopexit.unr-lcssa ]
%74 = mul nuw nsw i64 %indvar188.epil, 100
%scevgep190.epil = getelementptr i8, ptr %arr, i64 %74
call void @llvm.memset.p0.i64(ptr align 4 %scevgep190.epil, i8 1, i64 %47, i1 false), !tbaa !9
%indvar.next189.epil = add nuw nsw i64 %indvar188.epil, 1
%epil.iter227.next = add i64 %epil.iter227, 1
%epil.iter227.cmp.not = icmp eq i64 %epil.iter227.next, %xtraiter226
br i1 %epil.iter227.cmp.not, label %for.inc87, label %for.cond7.preheader.us.epil, !llvm.loop !23
for.inc87.loopexit213.unr-lcssa: ; preds = %for.body22.us, %for.body22.us.preheader
%indvar181.unr = phi i64 [ 0, %for.body22.us.preheader ], [ %indvar.next182.7, %for.body22.us ]
%lcmp.mod223.not = icmp eq i64 %xtraiter221, 0
br i1 %lcmp.mod223.not, label %for.inc87, label %for.body22.us.epil
for.body22.us.epil: ; preds = %for.inc87.loopexit213.unr-lcssa, %for.body22.us.epil
%indvar181.epil = phi i64 [ %indvar.next182.epil, %for.body22.us.epil ], [ %indvar181.unr, %for.inc87.loopexit213.unr-lcssa ]
%epil.iter222 = phi i64 [ %epil.iter222.next, %for.body22.us.epil ], [ 0, %for.inc87.loopexit213.unr-lcssa ]
%75 = mul nuw nsw i64 %indvar181.epil, 100
%gep.epil = getelementptr i8, ptr %invariant.gep, i64 %75
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep.epil, i8 1, i64 %35, i1 false), !tbaa !9
%indvar.next182.epil = add nuw nsw i64 %indvar181.epil, 1
%epil.iter222.next = add i64 %epil.iter222, 1
%epil.iter222.cmp.not = icmp eq i64 %epil.iter222.next, %xtraiter221
br i1 %epil.iter222.cmp.not, label %for.inc87, label %for.body22.us.epil, !llvm.loop !25
for.inc87.loopexit214.unr-lcssa: ; preds = %for.cond47.preheader.us, %for.cond47.preheader.us.preheader
%indvar175.unr = phi i64 [ 0, %for.cond47.preheader.us.preheader ], [ %indvar.next176.7, %for.cond47.preheader.us ]
%lcmp.mod218.not = icmp eq i64 %xtraiter216, 0
br i1 %lcmp.mod218.not, label %for.inc87, label %for.cond47.preheader.us.epil
for.cond47.preheader.us.epil: ; preds = %for.inc87.loopexit214.unr-lcssa, %for.cond47.preheader.us.epil
%indvar175.epil = phi i64 [ %indvar.next176.epil, %for.cond47.preheader.us.epil ], [ %indvar175.unr, %for.inc87.loopexit214.unr-lcssa ]
%epil.iter217 = phi i64 [ %epil.iter217.next, %for.cond47.preheader.us.epil ], [ 0, %for.inc87.loopexit214.unr-lcssa ]
%76 = mul nuw nsw i64 %indvar175.epil, 100
%scevgep177.epil = getelementptr i8, ptr %arr, i64 %76
call void @llvm.memset.p0.i64(ptr align 4 %scevgep177.epil, i8 1, i64 %18, i1 false), !tbaa !9
%indvar.next176.epil = add nuw nsw i64 %indvar175.epil, 1
%epil.iter217.next = add i64 %epil.iter217, 1
%epil.iter217.cmp.not = icmp eq i64 %epil.iter217.next, %xtraiter216
br i1 %epil.iter217.cmp.not, label %for.inc87, label %for.cond47.preheader.us.epil, !llvm.loop !26
for.inc87.loopexit215.unr-lcssa: ; preds = %for.cond70.preheader.us, %for.cond70.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond70.preheader.us.preheader ], [ %indvar.next.3, %for.cond70.preheader.us ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc87, label %for.cond70.preheader.us.epil
for.cond70.preheader.us.epil: ; preds = %for.inc87.loopexit215.unr-lcssa, %for.cond70.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond70.preheader.us.epil ], [ %indvar.unr, %for.inc87.loopexit215.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.cond70.preheader.us.epil ], [ 0, %for.inc87.loopexit215.unr-lcssa ]
%77 = add i64 %indvar.epil, %60
%78 = mul i64 %77, 100
%scevgep.epil = getelementptr i8, ptr %arr, i64 %78
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 1, i64 %61, i1 false), !tbaa !9
%indvar.next.epil = add nuw nsw i64 %indvar.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.inc87, label %for.cond70.preheader.us.epil, !llvm.loop !27
for.inc87: ; preds = %for.inc87.loopexit215.unr-lcssa, %for.cond70.preheader.us.epil, %for.inc87.loopexit214.unr-lcssa, %for.cond47.preheader.us.epil, %for.inc87.loopexit213.unr-lcssa, %for.body22.us.epil, %for.inc87.loopexit.unr-lcssa, %for.cond7.preheader.us.epil, %for.cond70.preheader.lr.ph, %for.cond7.preheader.lr.ph, %for.body22.lr.ph, %for.cond47.preheader.lr.ph, %if.then63, %for.cond42.preheader, %for.cond19.preheader, %for.cond3.preheader, %for.body
%inc88 = add nuw nsw i32 %r.0158, 1
%79 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc88, %79
br i1 %cmp, label %for.body, label %for.cond91.preheader, !llvm.loop !28
for.cond.cleanup93: ; preds = %for.cond96.for.cond.cleanup98_crit_edge.us, %for.cond96.preheader.lr.ph, %for.cond91.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond91.preheader ], [ 0, %for.cond96.preheader.lr.ph ], [ %spec.select.us.lcssa, %for.cond96.for.cond.cleanup98_crit_edge.us ]
%call115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %arr) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12, !14, !13}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !12}
|
#include<stdio.h>
int main()
{
int i=0,xi,yi,a,N;
int wl,wr,hu,hd,W,H;
scanf("%d %d %d",&W,&H,&N);
wl=0,hd=0,wr=W,hu=H;
for(i=0;i<N;i++)
{
scanf("%d %d %d",&xi,&yi,&a);
if(a==1)
{
if(xi>=wl)
wl=xi;
}
else if(a==2)
{
if(xi<=wr)
wr=xi;
}
else if(a==3)
{
if(yi>=hd)
hd=yi;
}
else
{
if(yi<=hu)
hu=yi;
}
}
if((wl>=wr)||(hd>=hu))
{
printf("0");
}
else
printf("%d",(hu-hd)*(wr-wl));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140215/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140215/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.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:
%xi = alloca i32, align 4
%yi = alloca i32, align 4
%a = alloca i32, align 4
%N = alloca i32, align 4
%W = alloca i32, align 4
%H = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %xi) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %yi) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %W, align 4, !tbaa !5
%1 = load i32, ptr %H, align 4, !tbaa !5
%2 = load i32, ptr %N, align 4, !tbaa !5
%cmp47 = icmp sgt i32 %2, 0
br i1 %cmp47, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%hd.052 = phi i32 [ %hd.1, %for.inc ], [ 0, %entry ]
%hu.051 = phi i32 [ %hu.1, %for.inc ], [ %1, %entry ]
%wr.050 = phi i32 [ %wr.1, %for.inc ], [ %0, %entry ]
%wl.049 = phi i32 [ %wl.1, %for.inc ], [ 0, %entry ]
%i.048 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %xi, ptr noundef nonnull %yi, ptr noundef nonnull %a)
%3 = load i32, ptr %a, align 4, !tbaa !5
switch i32 %3, label %if.else16 [
i32 1, label %if.then
i32 2, label %if.then6
i32 3, label %if.then12
]
if.then: ; preds = %for.body
%4 = load i32, ptr %xi, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %4, i32 %wl.049)
br label %for.inc
if.then6: ; preds = %for.body
%5 = load i32, ptr %xi, align 4, !tbaa !5
%spec.select44 = call i32 @llvm.smin.i32(i32 %5, i32 %wr.050)
br label %for.inc
if.then12: ; preds = %for.body
%6 = load i32, ptr %yi, align 4, !tbaa !5
%spec.select45 = call i32 @llvm.smax.i32(i32 %6, i32 %hd.052)
br label %for.inc
if.else16: ; preds = %for.body
%7 = load i32, ptr %yi, align 4, !tbaa !5
%spec.select46 = call i32 @llvm.smin.i32(i32 %7, i32 %hu.051)
br label %for.inc
for.inc: ; preds = %if.else16, %if.then12, %if.then6, %if.then
%wl.1 = phi i32 [ %spec.select, %if.then ], [ %wl.049, %if.then6 ], [ %wl.049, %if.then12 ], [ %wl.049, %if.else16 ]
%wr.1 = phi i32 [ %wr.050, %if.then ], [ %spec.select44, %if.then6 ], [ %wr.050, %if.then12 ], [ %wr.050, %if.else16 ]
%hu.1 = phi i32 [ %hu.051, %if.then ], [ %hu.051, %if.then6 ], [ %hu.051, %if.then12 ], [ %spec.select46, %if.else16 ]
%hd.1 = phi i32 [ %hd.052, %if.then ], [ %hd.052, %if.then6 ], [ %spec.select45, %if.then12 ], [ %hd.052, %if.else16 ]
%inc = add nuw nsw i32 %i.048, 1
%8 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%wl.0.lcssa = phi i32 [ 0, %entry ], [ %wl.1, %for.inc ]
%wr.0.lcssa = phi i32 [ %0, %entry ], [ %wr.1, %for.inc ]
%hu.0.lcssa = phi i32 [ %1, %entry ], [ %hu.1, %for.inc ]
%hd.0.lcssa = phi i32 [ 0, %entry ], [ %hd.1, %for.inc ]
%cmp23.not = icmp slt i32 %wl.0.lcssa, %wr.0.lcssa
%cmp24.not = icmp slt i32 %hd.0.lcssa, %hu.0.lcssa
%or.cond = select i1 %cmp23.not, i1 %cmp24.not, i1 false
br i1 %or.cond, label %if.else27, label %if.then25
if.then25: ; preds = %for.end
%putchar = call i32 @putchar(i32 48)
br label %if.end30
if.else27: ; preds = %for.end
%sub = sub nsw i32 %hu.0.lcssa, %hd.0.lcssa
%sub28 = sub nsw i32 %wr.0.lcssa, %wl.0.lcssa
%mul = mul nsw i32 %sub, %sub28
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul)
br label %if.end30
if.end30: ; preds = %if.else27, %if.then25
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %yi) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %xi) #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>
int main() {
int w, h, n, ans;
int x[100] = {0};
int y[100] = {0};
int a[100] = {0};
int i, j, k;
int square[10000] = {0};
/* よみこみ */
scanf("%d %d %d", &w, &h, &n);
for (i = 0; i < n; i++) {
scanf("%d %d %d", &x[i], &y[i], &a[i]);
}
/* ぬりつぶす */
for (i = 0; i < n; i++) {
switch(a[i]) {
case 1:
for (j = 0; j < x[i]; j++) {
for (k = 0; k < h; k++) {
square[w * k + j] = 1;
}
}
break;
case 2:
for (j = x[i]; j < w; j++) {
for (k = 0; k < h; k++) {
square[w * k + j] = 1;
}
}
break;
case 3:
for (j = 0; j < y[i]; j++) {
for (k = 0; k < w; k++) {
square[w * j + k] = 1;
}
}
break;
case 4:
for (j = y[i]; j < h; j++) {
for (k = 0; k < w; k++) {
square[w * j + k] = 1;
}
}
}
}
/* のこった0を数える */
for (i = 0; i < w * h; i++) {
if (square[i] == 0) {
ans++;
}
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140259/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140259/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%w = alloca i32, align 4
%h = alloca i32, align 4
%n = alloca i32, align 4
%x = alloca [100 x i32], align 16
%y = alloca [100 x i32], align 16
%a = alloca [100 x i32], align 16
%square = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %x) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %x, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %y) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %y, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %a, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %square) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %square, i8 0, i64 40000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp140 = icmp sgt i32 %0, 0
br i1 %cmp140, label %for.body, label %for.cond6.preheader.thread
for.cond6.preheader.thread: ; preds = %entry
%.pre232 = load i32, ptr %w, align 4
%.pre229233 = load i32, ptr %h, align 4
br label %for.cond87.preheader
for.cond6.preheader: ; preds = %for.body
%cmp7158 = icmp sgt i32 %5, 0
%.pre = load i32, ptr %w, align 4
%.pre229 = load i32, ptr %h, align 4
br i1 %cmp7158, label %for.body8.lr.ph, label %for.cond87.preheader
for.body8.lr.ph: ; preds = %for.cond6.preheader
%cmp72142 = icmp slt i32 %.pre, 1
%cmp34150 = icmp slt i32 %.pre229, 1
%1 = sext i32 %.pre to i64
%wide.trip.count222 = zext i32 %5 to i64
%wide.trip.count181 = sext i32 %.pre229 to i64
%wide.trip.count = zext i32 %.pre to i64
%wide.trip.count187 = zext i32 %.pre to i64
%wide.trip.count200 = zext i32 %.pre229 to i64
%2 = add nsw i64 %wide.trip.count200, -1
%min.iters.check249 = icmp ult i32 %.pre, 8
%n.vec252 = and i64 %wide.trip.count, 4294967288
%cmp.n254 = icmp eq i64 %n.vec252, %wide.trip.count
%min.iters.check = icmp ult i32 %.pre, 8
%n.vec = and i64 %wide.trip.count, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%xtraiter = and i64 %wide.trip.count200, 3
%3 = icmp ult i64 %2, 3
%unroll_iter = and i64 %wide.trip.count200, 4294967292
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%xtraiter277 = and i64 %wide.trip.count200, 3
%4 = icmp ult i64 %2, 3
%unroll_iter280 = and i64 %wide.trip.count200, 4294967292
%lcmp.mod279.not = icmp eq i64 %xtraiter277, 0
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%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.cond87.preheader: ; preds = %for.inc84, %for.cond6.preheader.thread, %for.cond6.preheader
%.pre229235 = phi i32 [ %.pre229233, %for.cond6.preheader.thread ], [ %.pre229, %for.cond6.preheader ], [ %.pre229, %for.inc84 ]
%.pre234 = phi i32 [ %.pre232, %for.cond6.preheader.thread ], [ %.pre, %for.cond6.preheader ], [ %.pre, %for.inc84 ]
%mul88 = mul nsw i32 %.pre229235, %.pre234
%cmp89160 = icmp sgt i32 %mul88, 0
call void @llvm.assume(i1 %cmp89160)
%wide.trip.count227 = zext i32 %mul88 to i64
%min.iters.check260 = icmp ult i32 %mul88, 8
br i1 %min.iters.check260, label %for.body90.preheader, label %vector.ph261
vector.ph261: ; preds = %for.cond87.preheader
%n.vec263 = and i64 %wide.trip.count227, 2147483640
br label %vector.body266
vector.body266: ; preds = %vector.body266, %vector.ph261
%index267 = phi i64 [ 0, %vector.ph261 ], [ %index.next270, %vector.body266 ]
%vec.phi = phi <4 x i32> [ <i32 undef, i32 0, i32 0, i32 0>, %vector.ph261 ], [ %13, %vector.body266 ]
%vec.phi268 = phi <4 x i32> [ zeroinitializer, %vector.ph261 ], [ %14, %vector.body266 ]
%7 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %index267
%wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load269 = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = icmp eq <4 x i32> %wide.load, zeroinitializer
%10 = icmp eq <4 x i32> %wide.load269, zeroinitializer
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = add <4 x i32> %vec.phi, %11
%14 = add <4 x i32> %vec.phi268, %12
%index.next270 = add nuw i64 %index267, 8
%15 = icmp eq i64 %index.next270, %n.vec263
br i1 %15, label %middle.block258, label %vector.body266, !llvm.loop !11
middle.block258: ; preds = %vector.body266
%bin.rdx = add <4 x i32> %14, %13
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n265 = icmp eq i64 %n.vec263, %wide.trip.count227
br i1 %cmp.n265, label %for.end97, label %for.body90.preheader
for.body90.preheader: ; preds = %for.cond87.preheader, %middle.block258
%indvars.iv224.ph = phi i64 [ 0, %for.cond87.preheader ], [ %n.vec263, %middle.block258 ]
%ans.0161.ph = phi i32 [ undef, %for.cond87.preheader ], [ %16, %middle.block258 ]
br label %for.body90
for.body8: ; preds = %for.body8.lr.ph, %for.inc84
%indvars.iv219 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next220, %for.inc84 ]
%arrayidx10 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv219
%17 = load i32, ptr %arrayidx10, align 4, !tbaa !5
switch i32 %17, label %for.inc84 [
i32 1, label %for.cond11.preheader
i32 2, label %sw.bb27
i32 3, label %for.cond47.preheader
i32 4, label %sw.bb65
]
for.cond47.preheader: ; preds = %for.body8
%arrayidx49 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv219
%18 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%cmp50148 = icmp slt i32 %18, 1
%brmerge = select i1 %cmp50148, i1 true, i1 %cmp72142
br i1 %brmerge, label %for.inc84, label %for.cond52.preheader.us.preheader
for.cond52.preheader.us.preheader: ; preds = %for.cond47.preheader
%wide.trip.count193 = zext i32 %18 to i64
br label %for.cond52.preheader.us
for.cond52.preheader.us: ; preds = %for.cond52.preheader.us.preheader, %for.cond52.for.inc62_crit_edge.us
%indvars.iv189 = phi i64 [ 0, %for.cond52.preheader.us.preheader ], [ %indvars.iv.next190, %for.cond52.for.inc62_crit_edge.us ]
%19 = mul nsw i64 %indvars.iv189, %1
br i1 %min.iters.check, label %for.body54.us.preheader, label %vector.body
vector.body: ; preds = %for.cond52.preheader.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond52.preheader.us ]
%20 = add nsw i64 %19, %index
%21 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %20
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %21, align 4, !tbaa !5
%22 = getelementptr inbounds i32, ptr %21, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %22, align 4, !tbaa !5
%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 !14
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond52.for.inc62_crit_edge.us, label %for.body54.us.preheader
for.body54.us.preheader: ; preds = %for.cond52.preheader.us, %middle.block
%indvars.iv183.ph = phi i64 [ 0, %for.cond52.preheader.us ], [ %n.vec, %middle.block ]
br label %for.body54.us
for.body54.us: ; preds = %for.body54.us.preheader, %for.body54.us
%indvars.iv183 = phi i64 [ %indvars.iv.next184, %for.body54.us ], [ %indvars.iv183.ph, %for.body54.us.preheader ]
%24 = add nsw i64 %19, %indvars.iv183
%arrayidx58.us = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %24
store i32 1, ptr %arrayidx58.us, align 4, !tbaa !5
%indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
%exitcond188.not = icmp eq i64 %indvars.iv.next184, %wide.trip.count187
br i1 %exitcond188.not, label %for.cond52.for.inc62_crit_edge.us, label %for.body54.us, !llvm.loop !15
for.cond52.for.inc62_crit_edge.us: ; preds = %for.body54.us, %middle.block
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%exitcond194.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count193
br i1 %exitcond194.not, label %for.inc84, label %for.cond52.preheader.us, !llvm.loop !16
for.cond11.preheader: ; preds = %for.body8
%arrayidx13 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv219
%25 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14156 = icmp slt i32 %25, 1
%brmerge239 = select i1 %cmp14156, i1 true, i1 %cmp34150
br i1 %brmerge239, label %for.inc84, label %for.cond16.preheader.us.preheader
for.cond16.preheader.us.preheader: ; preds = %for.cond11.preheader
%wide.trip.count217 = zext i32 %25 to i64
br label %for.cond16.preheader.us
for.cond16.preheader.us: ; preds = %for.cond16.preheader.us.preheader, %for.cond16.for.inc24_crit_edge.us
%indvars.iv214 = phi i64 [ 0, %for.cond16.preheader.us.preheader ], [ %indvars.iv.next215, %for.cond16.for.inc24_crit_edge.us ]
br i1 %4, label %for.cond16.for.inc24_crit_edge.us.unr-lcssa, label %for.body18.us
for.body18.us: ; preds = %for.cond16.preheader.us, %for.body18.us
%indvars.iv207 = phi i64 [ %indvars.iv.next208.3, %for.body18.us ], [ 0, %for.cond16.preheader.us ]
%niter281 = phi i64 [ %niter281.next.3, %for.body18.us ], [ 0, %for.cond16.preheader.us ]
%26 = mul nsw i64 %indvars.iv207, %1
%27 = add nsw i64 %26, %indvars.iv214
%arrayidx20.us = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %27
store i32 1, ptr %arrayidx20.us, align 4, !tbaa !5
%indvars.iv.next208 = or i64 %indvars.iv207, 1
%28 = mul nsw i64 %indvars.iv.next208, %1
%29 = add nsw i64 %28, %indvars.iv214
%arrayidx20.us.1 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %29
store i32 1, ptr %arrayidx20.us.1, align 4, !tbaa !5
%indvars.iv.next208.1 = or i64 %indvars.iv207, 2
%30 = mul nsw i64 %indvars.iv.next208.1, %1
%31 = add nsw i64 %30, %indvars.iv214
%arrayidx20.us.2 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %31
store i32 1, ptr %arrayidx20.us.2, align 4, !tbaa !5
%indvars.iv.next208.2 = or i64 %indvars.iv207, 3
%32 = mul nsw i64 %indvars.iv.next208.2, %1
%33 = add nsw i64 %32, %indvars.iv214
%arrayidx20.us.3 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %33
store i32 1, ptr %arrayidx20.us.3, align 4, !tbaa !5
%indvars.iv.next208.3 = add nuw nsw i64 %indvars.iv207, 4
%niter281.next.3 = add i64 %niter281, 4
%niter281.ncmp.3 = icmp eq i64 %niter281.next.3, %unroll_iter280
br i1 %niter281.ncmp.3, label %for.cond16.for.inc24_crit_edge.us.unr-lcssa, label %for.body18.us, !llvm.loop !17
for.cond16.for.inc24_crit_edge.us.unr-lcssa: ; preds = %for.body18.us, %for.cond16.preheader.us
%indvars.iv207.unr = phi i64 [ 0, %for.cond16.preheader.us ], [ %indvars.iv.next208.3, %for.body18.us ]
br i1 %lcmp.mod279.not, label %for.cond16.for.inc24_crit_edge.us, label %for.body18.us.epil
for.body18.us.epil: ; preds = %for.cond16.for.inc24_crit_edge.us.unr-lcssa, %for.body18.us.epil
%indvars.iv207.epil = phi i64 [ %indvars.iv.next208.epil, %for.body18.us.epil ], [ %indvars.iv207.unr, %for.cond16.for.inc24_crit_edge.us.unr-lcssa ]
%epil.iter278 = phi i64 [ %epil.iter278.next, %for.body18.us.epil ], [ 0, %for.cond16.for.inc24_crit_edge.us.unr-lcssa ]
%34 = mul nsw i64 %indvars.iv207.epil, %1
%35 = add nsw i64 %34, %indvars.iv214
%arrayidx20.us.epil = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %35
store i32 1, ptr %arrayidx20.us.epil, align 4, !tbaa !5
%indvars.iv.next208.epil = add nuw nsw i64 %indvars.iv207.epil, 1
%epil.iter278.next = add i64 %epil.iter278, 1
%epil.iter278.cmp.not = icmp eq i64 %epil.iter278.next, %xtraiter277
br i1 %epil.iter278.cmp.not, label %for.cond16.for.inc24_crit_edge.us, label %for.body18.us.epil, !llvm.loop !18
for.cond16.for.inc24_crit_edge.us: ; preds = %for.body18.us.epil, %for.cond16.for.inc24_crit_edge.us.unr-lcssa
%indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
%exitcond218.not = icmp eq i64 %indvars.iv.next215, %wide.trip.count217
br i1 %exitcond218.not, label %for.inc84, label %for.cond16.preheader.us, !llvm.loop !20
sw.bb27: ; preds = %for.body8
%arrayidx29 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv219
%36 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp31152 = icmp sge i32 %36, %.pre
%brmerge241 = select i1 %cmp31152, i1 true, i1 %cmp34150
br i1 %brmerge241, label %for.inc84, label %for.cond33.preheader.us.preheader
for.cond33.preheader.us.preheader: ; preds = %sw.bb27
%37 = sext i32 %36 to i64
br label %for.cond33.preheader.us
for.cond33.preheader.us: ; preds = %for.cond33.preheader.us.preheader, %for.cond33.for.inc43_crit_edge.us
%indvars.iv202 = phi i64 [ %37, %for.cond33.preheader.us.preheader ], [ %indvars.iv.next203, %for.cond33.for.inc43_crit_edge.us ]
br i1 %3, label %for.cond33.for.inc43_crit_edge.us.unr-lcssa, label %for.body35.us
for.body35.us: ; preds = %for.cond33.preheader.us, %for.body35.us
%indvars.iv195 = phi i64 [ %indvars.iv.next196.3, %for.body35.us ], [ 0, %for.cond33.preheader.us ]
%niter = phi i64 [ %niter.next.3, %for.body35.us ], [ 0, %for.cond33.preheader.us ]
%38 = mul nsw i64 %indvars.iv195, %1
%39 = add nsw i64 %38, %indvars.iv202
%arrayidx39.us = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %39
store i32 1, ptr %arrayidx39.us, align 4, !tbaa !5
%indvars.iv.next196 = or i64 %indvars.iv195, 1
%40 = mul nsw i64 %indvars.iv.next196, %1
%41 = add nsw i64 %40, %indvars.iv202
%arrayidx39.us.1 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %41
store i32 1, ptr %arrayidx39.us.1, align 4, !tbaa !5
%indvars.iv.next196.1 = or i64 %indvars.iv195, 2
%42 = mul nsw i64 %indvars.iv.next196.1, %1
%43 = add nsw i64 %42, %indvars.iv202
%arrayidx39.us.2 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %43
store i32 1, ptr %arrayidx39.us.2, align 4, !tbaa !5
%indvars.iv.next196.2 = or i64 %indvars.iv195, 3
%44 = mul nsw i64 %indvars.iv.next196.2, %1
%45 = add nsw i64 %44, %indvars.iv202
%arrayidx39.us.3 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %45
store i32 1, ptr %arrayidx39.us.3, align 4, !tbaa !5
%indvars.iv.next196.3 = add nuw nsw i64 %indvars.iv195, 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.cond33.for.inc43_crit_edge.us.unr-lcssa, label %for.body35.us, !llvm.loop !21
for.cond33.for.inc43_crit_edge.us.unr-lcssa: ; preds = %for.body35.us, %for.cond33.preheader.us
%indvars.iv195.unr = phi i64 [ 0, %for.cond33.preheader.us ], [ %indvars.iv.next196.3, %for.body35.us ]
br i1 %lcmp.mod.not, label %for.cond33.for.inc43_crit_edge.us, label %for.body35.us.epil
for.body35.us.epil: ; preds = %for.cond33.for.inc43_crit_edge.us.unr-lcssa, %for.body35.us.epil
%indvars.iv195.epil = phi i64 [ %indvars.iv.next196.epil, %for.body35.us.epil ], [ %indvars.iv195.unr, %for.cond33.for.inc43_crit_edge.us.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body35.us.epil ], [ 0, %for.cond33.for.inc43_crit_edge.us.unr-lcssa ]
%46 = mul nsw i64 %indvars.iv195.epil, %1
%47 = add nsw i64 %46, %indvars.iv202
%arrayidx39.us.epil = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %47
store i32 1, ptr %arrayidx39.us.epil, align 4, !tbaa !5
%indvars.iv.next196.epil = add nuw nsw i64 %indvars.iv195.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.cond33.for.inc43_crit_edge.us, label %for.body35.us.epil, !llvm.loop !22
for.cond33.for.inc43_crit_edge.us: ; preds = %for.body35.us.epil, %for.cond33.for.inc43_crit_edge.us.unr-lcssa
%indvars.iv.next203 = add nsw i64 %indvars.iv202, 1
%exitcond206.not = icmp eq i64 %indvars.iv.next203, %1
br i1 %exitcond206.not, label %for.inc84, label %for.cond33.preheader.us, !llvm.loop !23
sw.bb65: ; preds = %for.body8
%arrayidx67 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv219
%48 = load i32, ptr %arrayidx67, align 4, !tbaa !5
%cmp69144 = icmp sge i32 %48, %.pre229
%brmerge243 = select i1 %cmp69144, i1 true, i1 %cmp72142
br i1 %brmerge243, label %for.inc84, label %for.cond71.preheader.us.preheader
for.cond71.preheader.us.preheader: ; preds = %sw.bb65
%49 = sext i32 %48 to i64
br label %for.cond71.preheader.us
for.cond71.preheader.us: ; preds = %for.cond71.preheader.us.preheader, %for.cond71.for.inc81_crit_edge.us
%indvars.iv177 = phi i64 [ %49, %for.cond71.preheader.us.preheader ], [ %indvars.iv.next178, %for.cond71.for.inc81_crit_edge.us ]
%50 = mul nsw i64 %indvars.iv177, %1
br i1 %min.iters.check249, label %for.body73.us.preheader, label %vector.body255
vector.body255: ; preds = %for.cond71.preheader.us, %vector.body255
%index256 = phi i64 [ %index.next257, %vector.body255 ], [ 0, %for.cond71.preheader.us ]
%51 = add nsw i64 %50, %index256
%52 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %51
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %52, align 4, !tbaa !5
%53 = getelementptr inbounds i32, ptr %52, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %53, align 4, !tbaa !5
%index.next257 = add nuw i64 %index256, 8
%54 = icmp eq i64 %index.next257, %n.vec252
br i1 %54, label %middle.block247, label %vector.body255, !llvm.loop !24
middle.block247: ; preds = %vector.body255
br i1 %cmp.n254, label %for.cond71.for.inc81_crit_edge.us, label %for.body73.us.preheader
for.body73.us.preheader: ; preds = %for.cond71.preheader.us, %middle.block247
%indvars.iv173.ph = phi i64 [ 0, %for.cond71.preheader.us ], [ %n.vec252, %middle.block247 ]
br label %for.body73.us
for.body73.us: ; preds = %for.body73.us.preheader, %for.body73.us
%indvars.iv173 = phi i64 [ %indvars.iv.next174, %for.body73.us ], [ %indvars.iv173.ph, %for.body73.us.preheader ]
%55 = add nsw i64 %50, %indvars.iv173
%arrayidx77.us = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %55
store i32 1, ptr %arrayidx77.us, align 4, !tbaa !5
%indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
%exitcond.not = icmp eq i64 %indvars.iv.next174, %wide.trip.count
br i1 %exitcond.not, label %for.cond71.for.inc81_crit_edge.us, label %for.body73.us, !llvm.loop !25
for.cond71.for.inc81_crit_edge.us: ; preds = %for.body73.us, %middle.block247
%indvars.iv.next178 = add nsw i64 %indvars.iv177, 1
%exitcond182.not = icmp eq i64 %indvars.iv.next178, %wide.trip.count181
br i1 %exitcond182.not, label %for.inc84, label %for.cond71.preheader.us, !llvm.loop !26
for.inc84: ; preds = %for.cond71.for.inc81_crit_edge.us, %for.cond52.for.inc62_crit_edge.us, %for.cond33.for.inc43_crit_edge.us, %for.cond16.for.inc24_crit_edge.us, %sw.bb65, %sw.bb27, %for.cond11.preheader, %for.cond47.preheader, %for.body8
%indvars.iv.next220 = add nuw nsw i64 %indvars.iv219, 1
%exitcond223.not = icmp eq i64 %indvars.iv.next220, %wide.trip.count222
br i1 %exitcond223.not, label %for.cond87.preheader, label %for.body8, !llvm.loop !27
for.body90: ; preds = %for.body90.preheader, %for.body90
%indvars.iv224 = phi i64 [ %indvars.iv.next225, %for.body90 ], [ %indvars.iv224.ph, %for.body90.preheader ]
%ans.0161 = phi i32 [ %spec.select, %for.body90 ], [ %ans.0161.ph, %for.body90.preheader ]
%arrayidx92 = getelementptr inbounds [10000 x i32], ptr %square, i64 0, i64 %indvars.iv224
%56 = load i32, ptr %arrayidx92, align 4, !tbaa !5
%cmp93 = icmp eq i32 %56, 0
%inc94 = zext i1 %cmp93 to i32
%spec.select = add nsw i32 %ans.0161, %inc94
%indvars.iv.next225 = add nuw nsw i64 %indvars.iv224, 1
%exitcond228.not = icmp eq i64 %indvars.iv.next225, %wide.trip.count227
br i1 %exitcond228.not, label %for.end97, label %for.body90, !llvm.loop !28
for.end97: ; preds = %for.body90, %middle.block258
%spec.select.lcssa = phi i32 [ %16, %middle.block258 ], [ %spec.select, %for.body90 ]
%call98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.lcssa)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %square) #6
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %x) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: 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 willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #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 = { 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 willreturn memory(inaccessiblemem: 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, !12, !13}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10, !12, !13}
!25 = distinct !{!25, !10, !13, !12}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10, !13, !12}
|
#include <stdio.h>
int field[105][105];
int x[105];
int y[105];
int a[105];
int main() {
int W, H, N;
scanf("%d %d %d", &W, &H, &N);
int i,j,k;
for (i = 0; i < N; i++) {
scanf("%d %d %d",&x[i],&y[i],&a[i]);
}
for (i = 0; i < N; i++) {
if (a[i] == 1) {
if (x[i] != 0) {
for (j = 0; j < H; j++) {
for (k = 0; k < x[i]; k++) {
field[j][k] = 1;
}
}
}
}
else if (a[i] == 2) {
if (x[i] != W) {
for (j = 0; j < H; j++) {
for (k = x[i]; k < W; k++) {
field[j][k] = 1;
}
}
}
}
else if (a[i] == 3) {
if (y[i] != 0) {
int cnt = 0;
for (j = H-1;; j--) {
if (cnt == y[i]) { break; }
for (k = 0; k < W; k++) {
field[j][k] = 1;
}
cnt++;
}
}
}
else {
if (y[i] != H) {
int cnt = H;
for (j = 0;; j++) {
if (cnt == y[i]) { break; }
for (k = 0; k < W; k++) {
field[j][k] = 1;
}
cnt--;
}
}
}
}
int ans = 0;
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
if (field[i][j] == 0) { ans++; }
}
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140301/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140301/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@x = dso_local global [105 x i32] zeroinitializer, align 16
@y = dso_local global [105 x i32] zeroinitializer, align 16
@a = dso_local global [105 x i32] zeroinitializer, align 16
@field = dso_local local_unnamed_addr global [105 x [105 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:
%W = alloca i32, align 4
%H = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %W, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp194 = icmp sgt i32 %0, 0
br i1 %cmp194, label %for.body, label %for.cond6.preheader.thread
for.cond6.preheader.thread: ; preds = %entry
%.pre285 = load i32, ptr %H, align 4
br label %for.cond123.preheader
for.cond6.preheader: ; preds = %for.body
%cmp7213 = icmp sgt i32 %3, 0
%.pre = load i32, ptr %H, align 4
br i1 %cmp7213, label %for.body8.lr.ph, label %for.cond123.preheader
for.body8.lr.ph: ; preds = %for.cond6.preheader
%1 = load i32, ptr %W, align 4
%cmp77196 = icmp slt i32 %1, 1
%cmp43203 = icmp slt i32 %.pre, 1
%2 = sext i32 %.pre to i64
%wide.trip.count271 = zext i32 %3 to i64
%wide.trip.count = zext i32 %1 to i64
%wide.trip.count248 = zext i32 %.pre to i64
%wide.trip.count243 = sext i32 %1 to i64
%wide.trip.count258 = zext i32 %.pre to i64
%wide.trip.count263 = zext i32 %1 to i64
%min.iters.check321 = icmp ult i32 %1, 8
%n.vec324 = and i64 %wide.trip.count, 4294967288
%cmp.n326 = icmp eq i64 %n.vec324, %wide.trip.count
%min.iters.check = icmp ult i32 %1, 8
%n.vec = and i64 %wide.trip.count, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [105 x i32], ptr @x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [105 x i32], ptr @y, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%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.cond6.preheader, !llvm.loop !9
for.cond123.preheader: ; preds = %for.inc120, %for.cond6.preheader.thread, %for.cond6.preheader
%.pre286 = phi i32 [ %.pre285, %for.cond6.preheader.thread ], [ %.pre, %for.cond6.preheader ], [ %.pre, %for.inc120 ]
%cmp124219 = icmp sgt i32 %.pre286, 0
br i1 %cmp124219, label %for.cond126.preheader.lr.ph, label %for.end142
for.cond126.preheader.lr.ph: ; preds = %for.cond123.preheader
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp127215 = icmp sgt i32 %5, 0
br i1 %cmp127215, label %for.cond126.preheader.us.preheader, label %for.end142
for.cond126.preheader.us.preheader: ; preds = %for.cond126.preheader.lr.ph
%wide.trip.count281 = zext i32 %.pre286 to i64
%wide.trip.count276 = zext i32 %5 to i64
%min.iters.check332 = icmp ult i32 %5, 8
%n.vec335 = and i64 %wide.trip.count276, 4294967288
%cmp.n337 = icmp eq i64 %n.vec335, %wide.trip.count276
br label %for.cond126.preheader.us
for.cond126.preheader.us: ; preds = %for.cond126.preheader.us.preheader, %for.cond126.for.inc140_crit_edge.us
%indvars.iv278 = phi i64 [ 0, %for.cond126.preheader.us.preheader ], [ %indvars.iv.next279, %for.cond126.for.inc140_crit_edge.us ]
%ans.0221.us = phi i32 [ 0, %for.cond126.preheader.us.preheader ], [ %spec.select.us.lcssa, %for.cond126.for.inc140_crit_edge.us ]
br i1 %min.iters.check332, label %for.body128.us.preheader, label %vector.ph333
vector.ph333: ; preds = %for.cond126.preheader.us
%6 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %ans.0221.us, i64 0
br label %vector.body338
vector.body338: ; preds = %vector.body338, %vector.ph333
%index339 = phi i64 [ 0, %vector.ph333 ], [ %index.next342, %vector.body338 ]
%vec.phi = phi <4 x i32> [ %6, %vector.ph333 ], [ %13, %vector.body338 ]
%vec.phi340 = phi <4 x i32> [ zeroinitializer, %vector.ph333 ], [ %14, %vector.body338 ]
%7 = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv278, i64 %index339
%wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load341 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = icmp eq <4 x i32> %wide.load, zeroinitializer
%10 = icmp eq <4 x i32> %wide.load341, zeroinitializer
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = add <4 x i32> %vec.phi, %11
%14 = add <4 x i32> %vec.phi340, %12
%index.next342 = add nuw i64 %index339, 8
%15 = icmp eq i64 %index.next342, %n.vec335
br i1 %15, label %middle.block330, label %vector.body338, !llvm.loop !11
middle.block330: ; preds = %vector.body338
%bin.rdx = add <4 x i32> %14, %13
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n337, label %for.cond126.for.inc140_crit_edge.us, label %for.body128.us.preheader
for.body128.us.preheader: ; preds = %for.cond126.preheader.us, %middle.block330
%indvars.iv273.ph = phi i64 [ 0, %for.cond126.preheader.us ], [ %n.vec335, %middle.block330 ]
%ans.1217.us.ph = phi i32 [ %ans.0221.us, %for.cond126.preheader.us ], [ %16, %middle.block330 ]
br label %for.body128.us
for.body128.us: ; preds = %for.body128.us.preheader, %for.body128.us
%indvars.iv273 = phi i64 [ %indvars.iv.next274, %for.body128.us ], [ %indvars.iv273.ph, %for.body128.us.preheader ]
%ans.1217.us = phi i32 [ %spec.select.us, %for.body128.us ], [ %ans.1217.us.ph, %for.body128.us.preheader ]
%arrayidx132.us = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv278, i64 %indvars.iv273
%17 = load i32, ptr %arrayidx132.us, align 4, !tbaa !5
%cmp133.us = icmp eq i32 %17, 0
%inc135.us = zext i1 %cmp133.us to i32
%spec.select.us = add nsw i32 %ans.1217.us, %inc135.us
%indvars.iv.next274 = add nuw nsw i64 %indvars.iv273, 1
%exitcond277.not = icmp eq i64 %indvars.iv.next274, %wide.trip.count276
br i1 %exitcond277.not, label %for.cond126.for.inc140_crit_edge.us, label %for.body128.us, !llvm.loop !14
for.cond126.for.inc140_crit_edge.us: ; preds = %for.body128.us, %middle.block330
%spec.select.us.lcssa = phi i32 [ %16, %middle.block330 ], [ %spec.select.us, %for.body128.us ]
%indvars.iv.next279 = add nuw nsw i64 %indvars.iv278, 1
%exitcond282.not = icmp eq i64 %indvars.iv.next279, %wide.trip.count281
br i1 %exitcond282.not, label %for.end142, label %for.cond126.preheader.us, !llvm.loop !15
for.body8: ; preds = %for.body8.lr.ph, %for.inc120
%indvars.iv268 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next269, %for.inc120 ]
%arrayidx10 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv268
%18 = load i32, ptr %arrayidx10, align 4, !tbaa !5
switch i32 %18, label %if.else90 [
i32 1, label %if.then
i32 2, label %if.then37
i32 3, label %if.then65
]
if.then: ; preds = %for.body8
%arrayidx13 = getelementptr inbounds [105 x i32], ptr @x, i64 0, i64 %indvars.iv268
%19 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp22205 = icmp slt i32 %19, 1
%or.cond.not = select i1 %cmp22205, i1 true, i1 %cmp43203
br i1 %or.cond.not, label %for.inc120, label %for.cond19.preheader.us.preheader
for.cond19.preheader.us.preheader: ; preds = %if.then
%wide.trip.count253 = zext i32 %19 to i64
%min.iters.check299 = icmp ult i32 %19, 8
%n.vec302 = and i64 %wide.trip.count253, 4294967288
%cmp.n304 = icmp eq i64 %n.vec302, %wide.trip.count253
br label %for.cond19.preheader.us
for.cond19.preheader.us: ; preds = %for.cond19.preheader.us.preheader, %for.cond19.for.inc31_crit_edge.us
%indvars.iv255 = phi i64 [ 0, %for.cond19.preheader.us.preheader ], [ %indvars.iv.next256, %for.cond19.for.inc31_crit_edge.us ]
br i1 %min.iters.check299, label %for.body23.us.preheader, label %vector.body305
vector.body305: ; preds = %for.cond19.preheader.us, %vector.body305
%index306 = phi i64 [ %index.next307, %vector.body305 ], [ 0, %for.cond19.preheader.us ]
%20 = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv255, i64 %index306
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %20, align 4, !tbaa !5
%21 = getelementptr inbounds i32, ptr %20, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %21, align 4, !tbaa !5
%index.next307 = add nuw i64 %index306, 8
%22 = icmp eq i64 %index.next307, %n.vec302
br i1 %22, label %middle.block297, label %vector.body305, !llvm.loop !16
middle.block297: ; preds = %vector.body305
br i1 %cmp.n304, label %for.cond19.for.inc31_crit_edge.us, label %for.body23.us.preheader
for.body23.us.preheader: ; preds = %for.cond19.preheader.us, %middle.block297
%indvars.iv250.ph = phi i64 [ 0, %for.cond19.preheader.us ], [ %n.vec302, %middle.block297 ]
br label %for.body23.us
for.body23.us: ; preds = %for.body23.us.preheader, %for.body23.us
%indvars.iv250 = phi i64 [ %indvars.iv.next251, %for.body23.us ], [ %indvars.iv250.ph, %for.body23.us.preheader ]
%arrayidx27.us = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv255, i64 %indvars.iv250
store i32 1, ptr %arrayidx27.us, align 4, !tbaa !5
%indvars.iv.next251 = add nuw nsw i64 %indvars.iv250, 1
%exitcond254.not = icmp eq i64 %indvars.iv.next251, %wide.trip.count253
br i1 %exitcond254.not, label %for.cond19.for.inc31_crit_edge.us, label %for.body23.us, !llvm.loop !17
for.cond19.for.inc31_crit_edge.us: ; preds = %for.body23.us, %middle.block297
%indvars.iv.next256 = add nuw nsw i64 %indvars.iv255, 1
%exitcond259.not = icmp eq i64 %indvars.iv.next256, %wide.trip.count258
br i1 %exitcond259.not, label %for.inc120, label %for.cond19.preheader.us, !llvm.loop !18
if.then37: ; preds = %for.body8
%arrayidx39 = getelementptr inbounds [105 x i32], ptr @x, i64 0, i64 %indvars.iv268
%23 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%cmp48201 = icmp sge i32 %23, %1
%or.cond290.not = select i1 %cmp48201, i1 true, i1 %cmp43203
br i1 %or.cond290.not, label %for.inc120, label %for.cond47.preheader.us.preheader
for.cond47.preheader.us.preheader: ; preds = %if.then37
%24 = sext i32 %23 to i64
%25 = sub nsw i64 %wide.trip.count243, %24
%min.iters.check310 = icmp ult i64 %25, 8
%n.vec313 = and i64 %25, -8
%ind.end = add nsw i64 %n.vec313, %24
%cmp.n315 = icmp eq i64 %25, %n.vec313
br label %for.cond47.preheader.us
for.cond47.preheader.us: ; preds = %for.cond47.preheader.us.preheader, %for.cond47.for.inc57_crit_edge.us
%indvars.iv245 = phi i64 [ 0, %for.cond47.preheader.us.preheader ], [ %indvars.iv.next246, %for.cond47.for.inc57_crit_edge.us ]
br i1 %min.iters.check310, label %for.body49.us.preheader, label %vector.body316
vector.body316: ; preds = %for.cond47.preheader.us, %vector.body316
%index317 = phi i64 [ %index.next318, %vector.body316 ], [ 0, %for.cond47.preheader.us ]
%offset.idx = add i64 %index317, %24
%26 = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv245, i64 %offset.idx
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %26, align 4, !tbaa !5
%27 = getelementptr inbounds i32, ptr %26, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %27, align 4, !tbaa !5
%index.next318 = add nuw i64 %index317, 8
%28 = icmp eq i64 %index.next318, %n.vec313
br i1 %28, label %middle.block308, label %vector.body316, !llvm.loop !19
middle.block308: ; preds = %vector.body316
br i1 %cmp.n315, label %for.cond47.for.inc57_crit_edge.us, label %for.body49.us.preheader
for.body49.us.preheader: ; preds = %for.cond47.preheader.us, %middle.block308
%indvars.iv240.ph = phi i64 [ %24, %for.cond47.preheader.us ], [ %ind.end, %middle.block308 ]
br label %for.body49.us
for.body49.us: ; preds = %for.body49.us.preheader, %for.body49.us
%indvars.iv240 = phi i64 [ %indvars.iv.next241, %for.body49.us ], [ %indvars.iv240.ph, %for.body49.us.preheader ]
%arrayidx53.us = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv245, i64 %indvars.iv240
store i32 1, ptr %arrayidx53.us, align 4, !tbaa !5
%indvars.iv.next241 = add nsw i64 %indvars.iv240, 1
%exitcond244.not = icmp eq i64 %indvars.iv.next241, %wide.trip.count243
br i1 %exitcond244.not, label %for.cond47.for.inc57_crit_edge.us, label %for.body49.us, !llvm.loop !20
for.cond47.for.inc57_crit_edge.us: ; preds = %for.body49.us, %middle.block308
%indvars.iv.next246 = add nuw nsw i64 %indvars.iv245, 1
%exitcond249.not = icmp eq i64 %indvars.iv.next246, %wide.trip.count248
br i1 %exitcond249.not, label %for.inc120, label %for.cond47.preheader.us, !llvm.loop !21
if.then65: ; preds = %for.body8
%arrayidx67 = getelementptr inbounds [105 x i32], ptr @y, i64 0, i64 %indvars.iv268
%29 = load i32, ptr %arrayidx67, align 4, !tbaa !5
%cmp68.not = icmp eq i32 %29, 0
%brmerge291 = select i1 %cmp68.not, i1 true, i1 %cmp77196
br i1 %brmerge291, label %for.inc120, label %for.cond76.preheader.us
for.cond76.preheader.us: ; preds = %if.then65, %for.cond76.for.end85_crit_edge.us
%indvars.iv237 = phi i64 [ %indvars.iv.next238, %for.cond76.for.end85_crit_edge.us ], [ %2, %if.then65 ]
%cnt.0199.us = phi i32 [ %inc86.us, %for.cond76.for.end85_crit_edge.us ], [ 0, %if.then65 ]
%indvars.iv.next238 = add nsw i64 %indvars.iv237, -1
br i1 %min.iters.check321, label %for.body78.us.preheader, label %vector.body327
vector.body327: ; preds = %for.cond76.preheader.us, %vector.body327
%index328 = phi i64 [ %index.next329, %vector.body327 ], [ 0, %for.cond76.preheader.us ]
%30 = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv.next238, i64 %index328
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %30, align 4, !tbaa !5
%31 = getelementptr inbounds i32, ptr %30, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %31, align 4, !tbaa !5
%index.next329 = add nuw i64 %index328, 8
%32 = icmp eq i64 %index.next329, %n.vec324
br i1 %32, label %middle.block319, label %vector.body327, !llvm.loop !22
middle.block319: ; preds = %vector.body327
br i1 %cmp.n326, label %for.cond76.for.end85_crit_edge.us, label %for.body78.us.preheader
for.body78.us.preheader: ; preds = %for.cond76.preheader.us, %middle.block319
%indvars.iv234.ph = phi i64 [ 0, %for.cond76.preheader.us ], [ %n.vec324, %middle.block319 ]
br label %for.body78.us
for.body78.us: ; preds = %for.body78.us.preheader, %for.body78.us
%indvars.iv234 = phi i64 [ %indvars.iv.next235, %for.body78.us ], [ %indvars.iv234.ph, %for.body78.us.preheader ]
%arrayidx82.us = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv.next238, i64 %indvars.iv234
store i32 1, ptr %arrayidx82.us, align 4, !tbaa !5
%indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
%exitcond.not = icmp eq i64 %indvars.iv.next235, %wide.trip.count
br i1 %exitcond.not, label %for.cond76.for.end85_crit_edge.us, label %for.body78.us, !llvm.loop !23
for.cond76.for.end85_crit_edge.us: ; preds = %for.body78.us, %middle.block319
%inc86.us = add nuw nsw i32 %cnt.0199.us, 1
%cmp73.us = icmp eq i32 %inc86.us, %29
br i1 %cmp73.us, label %for.inc120, label %for.cond76.preheader.us
if.else90: ; preds = %for.body8
%arrayidx92 = getelementptr inbounds [105 x i32], ptr @y, i64 0, i64 %indvars.iv268
%33 = load i32, ptr %arrayidx92, align 4, !tbaa !5
%cmp93.not = icmp eq i32 %33, %.pre
%brmerge293 = select i1 %cmp93.not, i1 true, i1 %cmp77196
br i1 %brmerge293, label %for.inc120, label %for.cond102.preheader.us
for.cond102.preheader.us: ; preds = %if.else90, %for.cond102.for.end111_crit_edge.us
%indvars.iv265 = phi i64 [ %indvars.iv.next266, %for.cond102.for.end111_crit_edge.us ], [ 0, %if.else90 ]
%cnt95.0212.us = phi i32 [ %dec112.us, %for.cond102.for.end111_crit_edge.us ], [ %.pre, %if.else90 ]
br i1 %min.iters.check, label %for.body104.us.preheader, label %vector.body
vector.body: ; preds = %for.cond102.preheader.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond102.preheader.us ]
%34 = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv265, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %34, align 4, !tbaa !5
%35 = getelementptr inbounds i32, ptr %34, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %35, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%36 = icmp eq i64 %index.next, %n.vec
br i1 %36, label %middle.block, label %vector.body, !llvm.loop !24
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond102.for.end111_crit_edge.us, label %for.body104.us.preheader
for.body104.us.preheader: ; preds = %for.cond102.preheader.us, %middle.block
%indvars.iv260.ph = phi i64 [ 0, %for.cond102.preheader.us ], [ %n.vec, %middle.block ]
br label %for.body104.us
for.body104.us: ; preds = %for.body104.us.preheader, %for.body104.us
%indvars.iv260 = phi i64 [ %indvars.iv.next261, %for.body104.us ], [ %indvars.iv260.ph, %for.body104.us.preheader ]
%arrayidx108.us = getelementptr inbounds [105 x [105 x i32]], ptr @field, i64 0, i64 %indvars.iv265, i64 %indvars.iv260
store i32 1, ptr %arrayidx108.us, align 4, !tbaa !5
%indvars.iv.next261 = add nuw nsw i64 %indvars.iv260, 1
%exitcond264.not = icmp eq i64 %indvars.iv.next261, %wide.trip.count263
br i1 %exitcond264.not, label %for.cond102.for.end111_crit_edge.us, label %for.body104.us, !llvm.loop !25
for.cond102.for.end111_crit_edge.us: ; preds = %for.body104.us, %middle.block
%dec112.us = add nsw i32 %cnt95.0212.us, -1
%indvars.iv.next266 = add nuw nsw i64 %indvars.iv265, 1
%cmp99.us = icmp eq i32 %dec112.us, %33
br i1 %cmp99.us, label %for.inc120, label %for.cond102.preheader.us
for.inc120: ; preds = %for.cond76.for.end85_crit_edge.us, %for.cond47.for.inc57_crit_edge.us, %for.cond19.for.inc31_crit_edge.us, %for.cond102.for.end111_crit_edge.us, %if.else90, %if.then65, %if.then37, %if.then
%indvars.iv.next269 = add nuw nsw i64 %indvars.iv268, 1
%exitcond272.not = icmp eq i64 %indvars.iv.next269, %wide.trip.count271
br i1 %exitcond272.not, label %for.cond123.preheader, label %for.body8, !llvm.loop !26
for.end142: ; preds = %for.cond126.for.inc140_crit_edge.us, %for.cond126.preheader.lr.ph, %for.cond123.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond123.preheader ], [ 0, %for.cond126.preheader.lr.ph ], [ %spec.select.us.lcssa, %for.cond126.for.inc140_crit_edge.us ]
%call143 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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 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}
!16 = distinct !{!16, !10, !12, !13}
!17 = distinct !{!17, !10, !13, !12}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !12, !13}
!20 = distinct !{!20, !10, !13, !12}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !12, !13}
!23 = distinct !{!23, !10, !13, !12}
!24 = distinct !{!24, !10, !12, !13}
!25 = distinct !{!25, !10, !13, !12}
!26 = distinct !{!26, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define swap(type,x,y) do{type t=x; x=y; y=t;}while(0)
void quick(int a[][4],int left,int right,int num){
int i;
int pl=left;
int pr=right;
int x=a[(pl+pr)/2][num];
do{
while(a[pl][num]<x) pl++;
while(a[pr][num]>x) pr--;
if(pl<=pr){
for(i=0;i<=3;i++){
swap(int,a[pl][i],a[pr][i]);
}
pl++;
pr--;
}
}while(pl<=pr);
if(left<pr) quick(a,left,pr,num);
if(pl<right) quick(a,pl,right,num);
}
int main(void){
int i,j;
int n,m;
scanf("%d%d",&n,&m);
int b[n+1];
for(i=1;i<=n;i++){
b[i]=1;
}
int a[m+1][4];
for(i=1;i<=m;i++){
scanf("%d%d",&a[i][1],&a[i][2]);
a[i][0]=i;
}
quick(a,1,m,2);
for(i=1;i<=m;i++){
a[i][3]=b[a[i][1]];
b[a[i][1]]++;
}
quick(a,1,m,0);
for(i=1;i<=m;i++){
printf("%06d%06d\n",a[i][1],a[i][3]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140352/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140352/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%06d%06d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quick(ptr nocapture noundef %a, i32 noundef %left, i32 noundef %right, i32 noundef %num) local_unnamed_addr #0 {
entry:
%idxprom1 = sext i32 %num to i64
br label %tailrecurse
tailrecurse: ; preds = %if.end42, %entry
%left.tr = phi i32 [ %left, %entry ], [ %pl.2, %if.end42 ]
%add = add nsw i32 %left.tr, %right
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 %idxprom, i64 %idxprom1
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
br label %do.body
do.body: ; preds = %do.cond37, %tailrecurse
%pr.0 = phi i32 [ %right, %tailrecurse ], [ %pr.2, %do.cond37 ]
%pl.0 = phi i32 [ %left.tr, %tailrecurse ], [ %pl.2, %do.cond37 ]
%1 = sext i32 %pl.0 to i64
br label %while.cond
while.cond: ; preds = %while.cond, %do.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ %1, %do.body ]
%arrayidx6 = getelementptr inbounds [4 x i32], ptr %a, i64 %indvars.iv, i64 %idxprom1
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp = icmp slt i32 %2, %0
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp, label %while.cond, label %while.cond7.preheader, !llvm.loop !9
while.cond7.preheader: ; preds = %while.cond
%3 = sext i32 %pr.0 to i64
br label %while.cond7
while.cond7: ; preds = %while.cond7, %while.cond7.preheader
%indvars.iv88 = phi i64 [ %indvars.iv.next89, %while.cond7 ], [ %3, %while.cond7.preheader ]
%arrayidx11 = getelementptr inbounds [4 x i32], ptr %a, i64 %indvars.iv88, i64 %idxprom1
%4 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %4, %0
%indvars.iv.next89 = add i64 %indvars.iv88, -1
br i1 %cmp12, label %while.cond7, label %while.end14, !llvm.loop !11
while.end14: ; preds = %while.cond7
%5 = trunc i64 %indvars.iv to i32
%6 = trunc i64 %indvars.iv88 to i32
%cmp15.not = icmp sgt i32 %5, %6
br i1 %cmp15.not, label %do.cond37, label %do.body17.preheader
do.body17.preheader: ; preds = %while.end14
%arrayidx21 = getelementptr inbounds [4 x i32], ptr %a, i64 %indvars.iv, i64 0
%arrayidx25 = getelementptr inbounds [4 x i32], ptr %a, i64 %indvars.iv88, i64 0
%7 = load <4 x i32>, ptr %arrayidx21, align 4, !tbaa !5
%8 = load <4 x i32>, ptr %arrayidx25, align 4, !tbaa !5
store <4 x i32> %8, ptr %arrayidx21, align 4, !tbaa !5
store <4 x i32> %7, ptr %arrayidx25, align 4, !tbaa !5
%inc35 = add nsw i32 %5, 1
%dec36 = add nsw i32 %6, -1
br label %do.cond37
do.cond37: ; preds = %while.end14, %do.body17.preheader
%pr.2 = phi i32 [ %dec36, %do.body17.preheader ], [ %6, %while.end14 ]
%pl.2 = phi i32 [ %inc35, %do.body17.preheader ], [ %5, %while.end14 ]
%cmp38.not = icmp sgt i32 %pl.2, %pr.2
br i1 %cmp38.not, label %do.end39, label %do.body, !llvm.loop !12
do.end39: ; preds = %do.cond37
%cmp40 = icmp sgt i32 %pr.2, %left.tr
br i1 %cmp40, label %if.then41, label %if.end42
if.then41: ; preds = %do.end39
tail call void @quick(ptr noundef nonnull %a, i32 noundef %left.tr, i32 noundef %pr.2, i32 noundef %num)
br label %if.end42
if.end42: ; preds = %if.then41, %do.end39
%cmp43 = icmp slt i32 %pl.2, %right
br i1 %cmp43, label %tailrecurse, label %if.end45
if.end45: ; preds = %if.end42
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 i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not70 = icmp slt i32 %3, 1
br i1 %cmp.not70, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%4 = add nuw i32 %3, 1
%wide.trip.count = zext i32 %4 to i64
%5 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body.preheader94, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %5, -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 ]
%offset.idx = or i64 %index, 1
%6 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %7, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %5, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader94
for.body.preheader94: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader94, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader94 ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !16
for.end: ; preds = %for.body, %middle.block, %entry
%9 = load i32, ptr %m, align 4, !tbaa !5
%add1 = add nsw i32 %9, 1
%10 = zext i32 %add1 to i64
%vla2 = alloca [4 x i32], i64 %10, align 16
%cmp4.not72 = icmp slt i32 %9, 1
br i1 %cmp4.not72, label %for.end18.thread, label %for.body5
for.end18.thread: ; preds = %for.end
call void @quick(ptr noundef nonnull %vla2, i32 noundef 1, i32 noundef %9, i32 noundef 2)
br label %for.end38.thread
for.body5: ; preds = %for.end, %for.body5
%indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body5 ], [ 1, %for.end ]
%arrayidx7 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv80
%arrayidx8 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv80, i64 1
%arrayidx11 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv80, i64 2
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %arrayidx11)
%11 = trunc i64 %indvars.iv80 to i32
store i32 %11, ptr %arrayidx7, align 16, !tbaa !5
%indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
%12 = load i32, ptr %m, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp4.not.not = icmp slt i64 %indvars.iv80, %13
br i1 %cmp4.not.not, label %for.body5, label %for.end18, !llvm.loop !17
for.end18: ; preds = %for.body5
call void @quick(ptr noundef nonnull %vla2, i32 noundef 1, i32 noundef %12, i32 noundef 2)
%cmp20.not74 = icmp slt i32 %12, 1
br i1 %cmp20.not74, label %for.end38.thread, label %for.body21.preheader
for.body21.preheader: ; preds = %for.end18
%14 = zext i32 %12 to i64
%xtraiter = and i64 %14, 1
%15 = icmp eq i32 %12, 1
br i1 %15, label %for.end38.unr-lcssa, label %for.body21.preheader.new
for.body21.preheader.new: ; preds = %for.body21.preheader
%unroll_iter = and i64 %14, 4294967294
br label %for.body21
for.body21: ; preds = %for.body21, %for.body21.preheader.new
%indvars.iv83 = phi i64 [ 1, %for.body21.preheader.new ], [ %indvars.iv.next84.1, %for.body21 ]
%niter = phi i64 [ 0, %for.body21.preheader.new ], [ %niter.next.1, %for.body21 ]
%arrayidx24 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv83, i64 1
%16 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = sext i32 %16 to i64
%arrayidx26 = getelementptr inbounds i32, ptr %vla, i64 %idxprom25
%17 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%arrayidx29 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv83, i64 3
store i32 %17, ptr %arrayidx29, align 4, !tbaa !5
%inc35 = add nsw i32 %17, 1
store i32 %inc35, ptr %arrayidx26, align 4, !tbaa !5
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%arrayidx24.1 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv.next84, i64 1
%18 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5
%idxprom25.1 = sext i32 %18 to i64
%arrayidx26.1 = getelementptr inbounds i32, ptr %vla, i64 %idxprom25.1
%19 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5
%arrayidx29.1 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv.next84, i64 3
store i32 %19, ptr %arrayidx29.1, align 4, !tbaa !5
%inc35.1 = add nsw i32 %19, 1
store i32 %inc35.1, ptr %arrayidx26.1, align 4, !tbaa !5
%indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 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.end38.unr-lcssa, label %for.body21, !llvm.loop !18
for.end38.thread: ; preds = %for.end18.thread, %for.end18
%.ph = phi i32 [ %12, %for.end18 ], [ %9, %for.end18.thread ]
call void @quick(ptr noundef nonnull %vla2, i32 noundef 1, i32 noundef %.ph, i32 noundef 0)
br label %for.end51
for.end38.unr-lcssa: ; preds = %for.body21, %for.body21.preheader
%indvars.iv83.unr = phi i64 [ 1, %for.body21.preheader ], [ %indvars.iv.next84.1, %for.body21 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end38, label %for.body21.epil
for.body21.epil: ; preds = %for.end38.unr-lcssa
%arrayidx24.epil = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv83.unr, i64 1
%20 = load i32, ptr %arrayidx24.epil, align 4, !tbaa !5
%idxprom25.epil = sext i32 %20 to i64
%arrayidx26.epil = getelementptr inbounds i32, ptr %vla, i64 %idxprom25.epil
%21 = load i32, ptr %arrayidx26.epil, align 4, !tbaa !5
%arrayidx29.epil = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv83.unr, i64 3
store i32 %21, ptr %arrayidx29.epil, align 4, !tbaa !5
%inc35.epil = add nsw i32 %21, 1
store i32 %inc35.epil, ptr %arrayidx26.epil, align 4, !tbaa !5
br label %for.end38
for.end38: ; preds = %for.end38.unr-lcssa, %for.body21.epil
call void @quick(ptr noundef nonnull %vla2, i32 noundef 1, i32 noundef %12, i32 noundef 0)
br i1 %cmp20.not74, label %for.end51, label %for.body41
for.body41: ; preds = %for.end38, %for.body41
%indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.body41 ], [ 1, %for.end38 ]
%arrayidx44 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv88, i64 1
%22 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%arrayidx47 = getelementptr inbounds [4 x i32], ptr %vla2, i64 %indvars.iv88, i64 3
%23 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %22, i32 noundef %23)
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%24 = load i32, ptr %m, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp40.not.not = icmp slt i64 %indvars.iv88, %25
br i1 %cmp40.not.not, label %for.body41, label %for.end51, !llvm.loop !19
for.end51: ; preds = %for.body41, %for.end38.thread, %for.end38
call void @llvm.stackrestore.p0(ptr %2)
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
attributes #0 = { nofree 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 nosync nounwind willreturn }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
|
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))
typedef struct {
size_t idx;
size_t P;
size_t Y;
size_t order;
} ID;
int compare_f(const void *a, const void *b) {
const ID * aP = (ID *)a;
const ID * bP = (ID *)b;
if (aP->P < bP->P) {
return -1;
}
else if (aP->P == bP->P){
if (aP->Y < bP->Y) {
return -1;
}
else {
return 1;
}
}
else {
return 1;
}
}
int compare_f2(const void *a, const void *b)
{
return (((ID *)a)->idx < ((ID *)b)->idx) ? -1 : 1;
}
static size_t comb(const size_t n, const size_t r) {
size_t result = 1;
for (size_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static uint64_t gcd(uint64_t m, uint64_t n)
{
uint64_t temp;
while (m%n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
static ID id[100000];
int main(void) {
size_t N, M;
scanf("%zu %zu\n", &N, &M);
for (size_t idx = 0; idx < M; idx++) {
scanf("%zu %zu", &(id[idx].P), &(id[idx].Y));
if (idx < M - 1) {
scanf("\n");
}
id[idx].idx = idx;
}
qsort(id, M, sizeof(ID), compare_f);
size_t contiguousCount = 0;
size_t curP = (size_t)UINT32_MAX;
for (size_t idx = 0; idx < M; idx++) {
if (id[idx].P != curP) {
contiguousCount = 1;
curP = id[idx].P;
}
else {
contiguousCount++;
}
id[idx].order = contiguousCount;
}
qsort(id, M, sizeof(ID), compare_f2);
for (size_t idx = 0; idx < M; idx++) {
printf("%06zu%06zu\n", id[idx].P, id[idx].order);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140396/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140396/source.c"
target datalayout = "e-m:e-p270: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.ID = type { i64, i64, i64, i64 }
@.str = private unnamed_addr constant [9 x i8] c"%zu %zu\0A\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%zu %zu\00", align 1
@id = internal global [100000 x %struct.ID] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@.str.3 = private unnamed_addr constant [12 x i8] c"%06zu%06zu\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_f(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%P = getelementptr inbounds %struct.ID, ptr %a, i64 0, i32 1
%0 = load i64, ptr %P, align 8, !tbaa !5
%P1 = getelementptr inbounds %struct.ID, ptr %b, i64 0, i32 1
%1 = load i64, ptr %P1, align 8, !tbaa !5
%cmp = icmp ult i64 %0, %1
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%cmp4 = icmp eq i64 %0, %1
br i1 %cmp4, label %if.then5, label %cleanup
if.then5: ; preds = %if.else
%Y = getelementptr inbounds %struct.ID, ptr %a, i64 0, i32 2
%2 = load i64, ptr %Y, align 8, !tbaa !10
%Y6 = getelementptr inbounds %struct.ID, ptr %b, i64 0, i32 2
%3 = load i64, ptr %Y6, align 8, !tbaa !10
%cmp7 = icmp ult i64 %2, %3
%. = select i1 %cmp7, i32 -1, i32 1
br label %cleanup
cleanup: ; preds = %if.else, %if.then5, %entry
%retval.0 = phi i32 [ -1, %entry ], [ %., %if.then5 ], [ 1, %if.else ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_f2(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !11
%1 = load i64, ptr %b, align 8, !tbaa !11
%cmp = icmp ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
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 %M, align 8, !tbaa !12
%cmp54.not = icmp eq i64 %0, 0
br i1 %cmp54.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %if.end, %entry
%.lcssa53 = phi i64 [ 0, %entry ], [ %4, %if.end ]
call void @qsort(ptr noundef nonnull @id, i64 noundef %.lcssa53, i64 noundef 32, ptr noundef nonnull @compare_f) #5
%1 = load i64, ptr %M, align 8, !tbaa !12
%cmp956.not = icmp eq i64 %1, 0
br i1 %cmp956.not, label %for.cond.cleanup10, label %for.body11.preheader
for.body11.preheader: ; preds = %for.cond.cleanup
%xtraiter = and i64 %1, 1
%2 = icmp eq i64 %1, 1
br i1 %2, label %for.cond.cleanup10.loopexit.unr-lcssa, label %for.body11.preheader.new
for.body11.preheader.new: ; preds = %for.body11.preheader
%unroll_iter = and i64 %1, -2
br label %for.body11
for.body: ; preds = %entry, %if.end
%idx.055 = phi i64 [ %inc, %if.end ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx.055
%P = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx.055, i32 1
%Y = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx.055, i32 2
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %P, ptr noundef nonnull %Y)
%3 = load i64, ptr %M, align 8, !tbaa !12
%sub = add i64 %3, -1
%cmp3 = icmp ult i64 %idx.055, %sub
br i1 %cmp3, label %if.then, label %if.end
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2)
%.pre = load i64, ptr %M, align 8, !tbaa !12
br label %if.end
if.end: ; preds = %if.then, %for.body
%4 = phi i64 [ %.pre, %if.then ], [ %3, %for.body ]
store i64 %idx.055, ptr %arrayidx, align 16, !tbaa !11
%inc = add nuw i64 %idx.055, 1
%cmp = icmp ult i64 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup10.loopexit.unr-lcssa.loopexit: ; preds = %for.body11
%5 = add i64 %contiguousCount.1.1, 1
br label %for.cond.cleanup10.loopexit.unr-lcssa
for.cond.cleanup10.loopexit.unr-lcssa: ; preds = %for.cond.cleanup10.loopexit.unr-lcssa.loopexit, %for.body11.preheader
%idx7.059.unr = phi i64 [ 0, %for.body11.preheader ], [ %inc22.1, %for.cond.cleanup10.loopexit.unr-lcssa.loopexit ]
%curP.058.unr = phi i64 [ 4294967295, %for.body11.preheader ], [ %9, %for.cond.cleanup10.loopexit.unr-lcssa.loopexit ]
%contiguousCount.057.unr = phi i64 [ 1, %for.body11.preheader ], [ %5, %for.cond.cleanup10.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup10, label %for.body11.epil
for.body11.epil: ; preds = %for.cond.cleanup10.loopexit.unr-lcssa
%P13.epil = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx7.059.unr, i32 1
%6 = load i64, ptr %P13.epil, align 8, !tbaa !5
%cmp14.not.epil = icmp eq i64 %6, %curP.058.unr
%contiguousCount.1.epil = select i1 %cmp14.not.epil, i64 %contiguousCount.057.unr, i64 1
%order.epil = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx7.059.unr, i32 3
store i64 %contiguousCount.1.epil, ptr %order.epil, align 8, !tbaa !15
br label %for.cond.cleanup10
for.cond.cleanup10: ; preds = %for.body11.epil, %for.cond.cleanup10.loopexit.unr-lcssa, %for.cond.cleanup
call void @qsort(ptr noundef nonnull @id, i64 noundef %1, i64 noundef 32, ptr noundef nonnull @compare_f2) #5
%7 = load i64, ptr %M, align 8, !tbaa !12
%cmp2661.not = icmp eq i64 %7, 0
br i1 %cmp2661.not, label %for.cond.cleanup27, label %for.body28
for.body11: ; preds = %for.body11, %for.body11.preheader.new
%idx7.059 = phi i64 [ 0, %for.body11.preheader.new ], [ %inc22.1, %for.body11 ]
%curP.058 = phi i64 [ 4294967295, %for.body11.preheader.new ], [ %9, %for.body11 ]
%contiguousCount.057 = phi i64 [ 0, %for.body11.preheader.new ], [ %contiguousCount.1.1, %for.body11 ]
%niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.body11 ]
%P13 = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx7.059, i32 1
%8 = load i64, ptr %P13, align 8, !tbaa !5
%cmp14.not = icmp eq i64 %8, %curP.058
%inc18 = add i64 %contiguousCount.057, 1
%contiguousCount.1 = select i1 %cmp14.not, i64 %inc18, i64 1
%order = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx7.059, i32 3
store i64 %contiguousCount.1, ptr %order, align 8, !tbaa !15
%inc22 = or i64 %idx7.059, 1
%P13.1 = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %inc22, i32 1
%9 = load i64, ptr %P13.1, align 8, !tbaa !5
%cmp14.not.1 = icmp eq i64 %9, %8
%inc18.1 = add i64 %contiguousCount.1, 1
%contiguousCount.1.1 = select i1 %cmp14.not.1, i64 %inc18.1, i64 1
%order.1 = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %inc22, i32 3
store i64 %contiguousCount.1.1, ptr %order.1, align 8, !tbaa !15
%inc22.1 = add nuw i64 %idx7.059, 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.cleanup10.loopexit.unr-lcssa.loopexit, label %for.body11, !llvm.loop !16
for.cond.cleanup27: ; preds = %for.body28, %for.cond.cleanup10
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.body28: ; preds = %for.cond.cleanup10, %for.body28
%idx24.062 = phi i64 [ %inc35, %for.body28 ], [ 0, %for.cond.cleanup10 ]
%P30 = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx24.062, i32 1
%10 = load i64, ptr %P30, align 8, !tbaa !5
%order32 = getelementptr inbounds [100000 x %struct.ID], ptr @id, i64 0, i64 %idx24.062, i32 3
%11 = load i64, ptr %order32, align 8, !tbaa !15
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %10, i64 noundef %11)
%inc35 = add nuw i64 %idx24.062, 1
%12 = load i64, ptr %M, align 8, !tbaa !12
%cmp26 = icmp ult i64 %inc35, %12
br i1 %cmp26, label %for.body28, label %for.cond.cleanup27, !llvm.loop !17
}
; 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
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !7, i64 8}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 16}
!11 = !{!6, !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !7, i64 24}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
|
#include<stdio.h>
int linear(int A[],int n,int key){
int i=0;
A[n]= key;
while(A[i]!=key)i++;
return i !=n ;
}
int main(){
int a,b,num=0,i,j,key,l,n,q,S[10000+1];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&key);
if( linear(S,n,key) )num++;
}
printf("%d\n",num);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140439/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140439/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @linear(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; 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:
%key = alloca i32, align 4
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [10001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %linear.exit
%num.022 = phi i32 [ %spec.select, %linear.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %linear.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %linear.exit, label %while.cond.i, !llvm.loop !9
linear.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %num.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %linear.exit, %for.end
%num.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %linear.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void) {
int n,i,c=0;
long S[10001],q;
scanf("%d\n",&n);
for(i=0;i<n;i++) scanf("%ld",&S[i]);
scanf("\n"); scanf("%ld\n",&q);
for(i=0;i<q;i++) {
long t;
scanf("%ld",&t);
int j=0;
S[n]=t;
while (S[j]!=t) j++;
if(j<n) c++;
}
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140482/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140482/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%S = alloca [10001 x i64], align 16
%q = alloca i64, align 8
%t = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 80008, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %0, 0
br i1 %cmp30, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i64], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %q)
%3 = load i64, ptr %q, align 8, !tbaa !11
%cmp532 = icmp sgt i64 %3, 0
br i1 %cmp532, label %for.body7, label %for.end21
for.body7: ; preds = %for.end, %while.end
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %while.end ], [ 0, %for.end ]
%c.034 = phi i32 [ %spec.select, %while.end ], [ 0, %for.end ]
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #3
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%4 = load i64, ptr %t, align 8, !tbaa !11
%5 = load i32, ptr %n, align 4, !tbaa !5
%idxprom9 = sext i32 %5 to i64
%arrayidx10 = getelementptr inbounds [10001 x i64], ptr %S, i64 0, i64 %idxprom9
store i64 %4, ptr %arrayidx10, align 8, !tbaa !11
br label %while.cond
while.cond: ; preds = %while.cond, %for.body7
%indvars.iv36 = phi i64 [ %indvars.iv.next37, %while.cond ], [ 0, %for.body7 ]
%arrayidx12 = getelementptr inbounds [10001 x i64], ptr %S, i64 0, i64 %indvars.iv36
%6 = load i64, ptr %arrayidx12, align 8, !tbaa !11
%cmp13.not = icmp eq i64 %6, %4
%indvars.iv.next37 = add nuw i64 %indvars.iv36, 1
br i1 %cmp13.not, label %while.end, label %while.cond, !llvm.loop !13
while.end: ; preds = %while.cond
%7 = trunc i64 %indvars.iv36 to i32
%cmp16 = icmp sgt i32 %5, %7
%inc18 = zext i1 %cmp16 to i32
%spec.select = add nuw nsw i32 %c.034, %inc18
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #3
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%8 = load i64, ptr %q, align 8, !tbaa !11
%cmp5 = icmp sgt i64 %8, %indvars.iv.next40
br i1 %cmp5, label %for.body7, label %for.end21, !llvm.loop !14
for.end21: ; preds = %while.end, %for.end
%c.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %while.end ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 80008, ptr nonnull %S) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#define MAXLEN 10000
int main( void )
{
int n,q;
int S[ MAXLEN+1 ],T[ MAXLEN+1 ];
int i,j;
int cnt;
scanf( "%d", &n );
for( i=0; i<n; i++ ) {
scanf( "%d", &S[i] );
}
cnt=0;
scanf( "%d", &q );
for( i=0; i<q; i++ ) {
scanf( "%d", &T[i] );
for( j=0; j<n; j++ ) {
if( T[i] == S[j] ) {
cnt++;
break;
}
}
}
if( cnt ) {
printf( "%d\n", cnt );
} else {
printf( "0\n" );
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140547/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140547/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [10001 x i32], align 16
%T = 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 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp38 = icmp sgt i32 %0, 0
br i1 %cmp38, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp442 = icmp sgt i32 %3, 0
br i1 %cmp442, label %for.body5, label %if.else
for.body5: ; preds = %for.end, %for.inc21
%indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.inc21 ], [ 0, %for.end ]
%cnt.044 = phi i32 [ %cnt.1, %for.inc21 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [10001 x i32], ptr %T, i64 0, i64 %indvars.iv49
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1040 = icmp sgt i32 %4, 0
br i1 %cmp1040, label %for.body11.lr.ph, label %for.inc21
for.body11.lr.ph: ; preds = %for.body5
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
br label %for.body11
for.cond9: ; preds = %for.body11
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%exitcond.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count
br i1 %exitcond.not, label %for.inc21, label %for.body11, !llvm.loop !11
for.body11: ; preds = %for.body11.lr.ph, %for.cond9
%indvars.iv46 = phi i64 [ 0, %for.body11.lr.ph ], [ %indvars.iv.next47, %for.cond9 ]
%arrayidx15 = getelementptr inbounds [10001 x i32], ptr %S, i64 0, i64 %indvars.iv46
%6 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp eq i32 %5, %6
br i1 %cmp16, label %if.then, label %for.cond9
if.then: ; preds = %for.body11
%inc17 = add nsw i32 %cnt.044, 1
br label %for.inc21
for.inc21: ; preds = %for.cond9, %for.body5, %if.then
%cnt.1 = phi i32 [ %inc17, %if.then ], [ %cnt.044, %for.body5 ], [ %cnt.044, %for.cond9 ]
%indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next50, %8
br i1 %cmp4, label %for.body5, label %for.end23, !llvm.loop !12
for.end23: ; preds = %for.inc21
%tobool.not = icmp eq i32 %cnt.1, 0
br i1 %tobool.not, label %if.else, label %if.then24
if.then24: ; preds = %for.end23
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.1)
br label %if.end27
if.else: ; preds = %for.end, %for.end23
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end27
if.end27: ; preds = %if.else, %if.then24
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int LinearSearch(int );
int S[1000000],n;
int main(){
int j,i,q,T[1000000],count=0,flag;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&T[i]);
}
for(j=0;j<q;j++){
flag=LinearSearch(T[j]);
if(flag==1) count++;
}
printf("%d\n",count);
return 0;
}
int LinearSearch(int key){
int i;
for(i=0;i<n;i++){
if(S[i]==key) return 1;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140590/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140590/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@S = dso_local global [1000000 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:
%q = alloca i32, align 4
%T = alloca [1000000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %T) #4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr @S, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp437 = icmp sgt i32 %3, 0
br i1 %cmp437, label %for.body5, label %for.end22
for.cond12.preheader: ; preds = %for.body5
%cmp1339 = icmp sgt i32 %12, 0
br i1 %cmp1339, label %for.body14.lr.ph, label %for.end22
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr @n, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %4, 0
%wide.trip.count.i = zext i32 %4 to i64
br i1 %cmp4.i, label %for.body14.us.preheader, label %for.end22
for.body14.us.preheader: ; preds = %for.body14.lr.ph
%wide.trip.count = zext i32 %12 to i64
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %12, 1
br i1 %5, label %for.end22.loopexit.unr-lcssa, label %for.body14.us.preheader.new
for.body14.us.preheader.new: ; preds = %for.body14.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body14.us
for.body14.us: ; preds = %for.cond12.us.1, %for.body14.us.preheader.new
%indvars.iv50 = phi i64 [ 0, %for.body14.us.preheader.new ], [ %indvars.iv.next51.1, %for.cond12.us.1 ]
%count.040.us = phi i32 [ 0, %for.body14.us.preheader.new ], [ %11, %for.cond12.us.1 ]
%niter = phi i64 [ 0, %for.body14.us.preheader.new ], [ %niter.next.1, %for.cond12.us.1 ]
%arrayidx16.us = getelementptr inbounds [1000000 x i32], ptr %T, i64 0, i64 %indvars.iv50
%6 = load i32, ptr %arrayidx16.us, align 8, !tbaa !5
br label %for.body.i.us
for.body.i.us: ; preds = %for.cond.i.us, %for.body14.us
%indvars.iv.i.us = phi i64 [ 0, %for.body14.us ], [ %indvars.iv.next.i.us, %for.cond.i.us ]
%arrayidx.i.us = getelementptr inbounds [1000000 x i32], ptr @S, i64 0, i64 %indvars.iv.i.us
%7 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%cmp1.i.us = icmp eq i32 %7, %6
br i1 %cmp1.i.us, label %LinearSearch.exit.us, label %for.cond.i.us
for.cond.i.us: ; preds = %for.body.i.us
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %for.cond12.us, label %for.body.i.us, !llvm.loop !11
LinearSearch.exit.us: ; preds = %for.body.i.us
%inc19.us = add nsw i32 %count.040.us, 1
br label %for.cond12.us
for.cond12.us: ; preds = %for.cond.i.us, %LinearSearch.exit.us
%8 = phi i32 [ %inc19.us, %LinearSearch.exit.us ], [ %count.040.us, %for.cond.i.us ]
%indvars.iv.next51 = or i64 %indvars.iv50, 1
%arrayidx16.us.1 = getelementptr inbounds [1000000 x i32], ptr %T, i64 0, i64 %indvars.iv.next51
%9 = load i32, ptr %arrayidx16.us.1, align 4, !tbaa !5
br label %for.body.i.us.1
for.body.i.us.1: ; preds = %for.cond.i.us.1, %for.cond12.us
%indvars.iv.i.us.1 = phi i64 [ 0, %for.cond12.us ], [ %indvars.iv.next.i.us.1, %for.cond.i.us.1 ]
%arrayidx.i.us.1 = getelementptr inbounds [1000000 x i32], ptr @S, i64 0, i64 %indvars.iv.i.us.1
%10 = load i32, ptr %arrayidx.i.us.1, align 4, !tbaa !5
%cmp1.i.us.1 = icmp eq i32 %10, %9
br i1 %cmp1.i.us.1, label %LinearSearch.exit.us.1, label %for.cond.i.us.1
for.cond.i.us.1: ; preds = %for.body.i.us.1
%indvars.iv.next.i.us.1 = add nuw nsw i64 %indvars.iv.i.us.1, 1
%exitcond.not.i.us.1 = icmp eq i64 %indvars.iv.next.i.us.1, %wide.trip.count.i
br i1 %exitcond.not.i.us.1, label %for.cond12.us.1, label %for.body.i.us.1, !llvm.loop !11
LinearSearch.exit.us.1: ; preds = %for.body.i.us.1
%inc19.us.1 = add nsw i32 %8, 1
br label %for.cond12.us.1
for.cond12.us.1: ; preds = %for.cond.i.us.1, %LinearSearch.exit.us.1
%11 = phi i32 [ %inc19.us.1, %LinearSearch.exit.us.1 ], [ %8, %for.cond.i.us.1 ]
%indvars.iv.next51.1 = add nuw nsw i64 %indvars.iv50, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end22.loopexit.unr-lcssa, label %for.body14.us, !llvm.loop !12
for.body5: ; preds = %for.end, %for.body5
%indvars.iv47 = phi i64 [ %indvars.iv.next48, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [1000000 x i32], ptr %T, i64 0, i64 %indvars.iv47
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%12 = load i32, ptr %q, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp4 = icmp slt i64 %indvars.iv.next48, %13
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end22.loopexit.unr-lcssa: ; preds = %for.cond12.us.1, %for.body14.us.preheader
%.lcssa.ph = phi i32 [ undef, %for.body14.us.preheader ], [ %11, %for.cond12.us.1 ]
%indvars.iv50.unr = phi i64 [ 0, %for.body14.us.preheader ], [ %indvars.iv.next51.1, %for.cond12.us.1 ]
%count.040.us.unr = phi i32 [ 0, %for.body14.us.preheader ], [ %11, %for.cond12.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end22, label %for.body14.us.epil
for.body14.us.epil: ; preds = %for.end22.loopexit.unr-lcssa
%arrayidx16.us.epil = getelementptr inbounds [1000000 x i32], ptr %T, i64 0, i64 %indvars.iv50.unr
%14 = load i32, ptr %arrayidx16.us.epil, align 4, !tbaa !5
br label %for.body.i.us.epil
for.body.i.us.epil: ; preds = %for.cond.i.us.epil, %for.body14.us.epil
%indvars.iv.i.us.epil = phi i64 [ 0, %for.body14.us.epil ], [ %indvars.iv.next.i.us.epil, %for.cond.i.us.epil ]
%arrayidx.i.us.epil = getelementptr inbounds [1000000 x i32], ptr @S, i64 0, i64 %indvars.iv.i.us.epil
%15 = load i32, ptr %arrayidx.i.us.epil, align 4, !tbaa !5
%cmp1.i.us.epil = icmp eq i32 %15, %14
br i1 %cmp1.i.us.epil, label %LinearSearch.exit.us.epil, label %for.cond.i.us.epil
for.cond.i.us.epil: ; preds = %for.body.i.us.epil
%indvars.iv.next.i.us.epil = add nuw nsw i64 %indvars.iv.i.us.epil, 1
%exitcond.not.i.us.epil = icmp eq i64 %indvars.iv.next.i.us.epil, %wide.trip.count.i
br i1 %exitcond.not.i.us.epil, label %for.end22, label %for.body.i.us.epil, !llvm.loop !11
LinearSearch.exit.us.epil: ; preds = %for.body.i.us.epil
%inc19.us.epil = add nsw i32 %count.040.us.unr, 1
br label %for.end22
for.end22: ; preds = %for.end22.loopexit.unr-lcssa, %for.cond.i.us.epil, %LinearSearch.exit.us.epil, %for.end, %for.body14.lr.ph, %for.cond12.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.body14.lr.ph ], [ 0, %for.end ], [ %.lcssa.ph, %for.end22.loopexit.unr-lcssa ], [ %inc19.us.epil, %LinearSearch.exit.us.epil ], [ %count.040.us.unr, %for.cond.i.us.epil ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %T) #4
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: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @LinearSearch(i32 noundef %key) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr @S, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %1, %key
br i1 %cmp1, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(){
int i,j=0;
int s,t;
int count=0;
int key;
scanf("%d",&s);
int S[s];
for(i=0;i<s;i++)scanf("%d",&S[i]);
scanf("%d",&t);
int T[t];
for(i=0;i<t;i++)scanf("%d",&T[i]);
for(i=0;i<t;i++){
key=T[i];
j=0;
S[s]=key;
while(S[j]!=key)j++;
if(j==s);
else{
count++;
}
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140633/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140633/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, 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 %s, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %3, 0
br i1 %cmp42, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %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 %s, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%6 = load i32, ptr %t, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca i32, i64 %7, align 16
%cmp544 = icmp sgt i32 %6, 0
br i1 %cmp544, label %for.body6, label %for.end28
for.cond13.preheader: ; preds = %for.body6
%cmp1446 = icmp sgt i32 %10, 0
br i1 %cmp1446, label %for.body15.lr.ph, label %for.end28
for.body15.lr.ph: ; preds = %for.cond13.preheader
%8 = load i32, ptr %s, align 4, !tbaa !5
%idxprom18 = sext i32 %8 to i64
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %idxprom18
%wide.trip.count = zext i32 %10 to i64
%xtraiter = and i64 %wide.trip.count, 1
%9 = icmp eq i32 %10, 1
br i1 %9, label %for.end28.loopexit.unr-lcssa, label %for.body15.lr.ph.new
for.body15.lr.ph.new: ; preds = %for.body15.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body15
for.body6: ; preds = %for.end, %for.body6
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv52
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%10 = load i32, ptr %t, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp5 = icmp slt i64 %indvars.iv.next53, %11
br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !11
for.body15: ; preds = %while.end.1, %for.body15.lr.ph.new
%indvars.iv58 = phi i64 [ 0, %for.body15.lr.ph.new ], [ %indvars.iv.next59.1, %while.end.1 ]
%count.047 = phi i32 [ 0, %for.body15.lr.ph.new ], [ %spec.select.1, %while.end.1 ]
%niter = phi i64 [ 0, %for.body15.lr.ph.new ], [ %niter.next.1, %while.end.1 ]
%arrayidx17 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv58
%12 = load i32, ptr %arrayidx17, align 8, !tbaa !5
store i32 %12, ptr %arrayidx19, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %for.body15
%indvars.iv55 = phi i64 [ %indvars.iv.next56, %while.cond ], [ 0, %for.body15 ]
%arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv55
%13 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not = icmp eq i32 %13, %12
%indvars.iv.next56 = add nuw i64 %indvars.iv55, 1
br i1 %cmp22.not, label %while.end, label %while.cond, !llvm.loop !12
while.end: ; preds = %while.cond
%14 = trunc i64 %indvars.iv55 to i32
%cmp24 = icmp ne i32 %8, %14
%inc25 = zext i1 %cmp24 to i32
%spec.select = add nuw nsw i32 %count.047, %inc25
%indvars.iv.next59 = or i64 %indvars.iv58, 1
%arrayidx17.1 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv.next59
%15 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5
store i32 %15, ptr %arrayidx19, align 4, !tbaa !5
br label %while.cond.1
while.cond.1: ; preds = %while.cond.1, %while.end
%indvars.iv55.1 = phi i64 [ %indvars.iv.next56.1, %while.cond.1 ], [ 0, %while.end ]
%arrayidx21.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv55.1
%16 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
%cmp22.not.1 = icmp eq i32 %16, %15
%indvars.iv.next56.1 = add nuw i64 %indvars.iv55.1, 1
br i1 %cmp22.not.1, label %while.end.1, label %while.cond.1, !llvm.loop !12
while.end.1: ; preds = %while.cond.1
%17 = trunc i64 %indvars.iv55.1 to i32
%cmp24.1 = icmp ne i32 %8, %17
%inc25.1 = zext i1 %cmp24.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc25.1
%indvars.iv.next59.1 = add nuw nsw i64 %indvars.iv58, 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.end28.loopexit.unr-lcssa, label %for.body15, !llvm.loop !13
for.end28.loopexit.unr-lcssa: ; preds = %while.end.1, %for.body15.lr.ph
%spec.select.lcssa.ph = phi i32 [ undef, %for.body15.lr.ph ], [ %spec.select.1, %while.end.1 ]
%indvars.iv58.unr = phi i64 [ 0, %for.body15.lr.ph ], [ %indvars.iv.next59.1, %while.end.1 ]
%count.047.unr = phi i32 [ 0, %for.body15.lr.ph ], [ %spec.select.1, %while.end.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end28, label %for.body15.epil
for.body15.epil: ; preds = %for.end28.loopexit.unr-lcssa
%arrayidx17.epil = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv58.unr
%18 = load i32, ptr %arrayidx17.epil, align 4, !tbaa !5
store i32 %18, ptr %arrayidx19, align 4, !tbaa !5
br label %while.cond.epil
while.cond.epil: ; preds = %while.cond.epil, %for.body15.epil
%indvars.iv55.epil = phi i64 [ %indvars.iv.next56.epil, %while.cond.epil ], [ 0, %for.body15.epil ]
%arrayidx21.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv55.epil
%19 = load i32, ptr %arrayidx21.epil, align 4, !tbaa !5
%cmp22.not.epil = icmp eq i32 %19, %18
%indvars.iv.next56.epil = add nuw i64 %indvars.iv55.epil, 1
br i1 %cmp22.not.epil, label %while.end.epil, label %while.cond.epil, !llvm.loop !12
while.end.epil: ; preds = %while.cond.epil
%20 = trunc i64 %indvars.iv55.epil to i32
%cmp24.epil = icmp ne i32 %8, %20
%inc25.epil = zext i1 %cmp24.epil to i32
%spec.select.epil = add nuw nsw i32 %count.047.unr, %inc25.epil
br label %for.end28
for.end28: ; preds = %while.end.epil, %for.end28.loopexit.unr-lcssa, %for.end, %for.cond13.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %for.end ], [ %spec.select.lcssa.ph, %for.end28.loopexit.unr-lcssa ], [ %spec.select.epil, %while.end.epil ]
%call29 = 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 %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#define N 10000
#define Q 500
int main()
{
int n,q,S[N],T[Q],i,j;
int count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(j=0;j<q;j++){
scanf("%d",&T[j]);
}
for(j=0;j<q;j++){
for(i=0;i<n;i++){
if(S[i]==T[j]){
count++;
break;
}
}
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140677/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140677/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [10000 x i32], align 16
%T = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %0, 0
br i1 %cmp42, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp444 = icmp sgt i32 %3, 0
br i1 %cmp444, label %for.body5, label %for.end29
for.cond12.preheader: ; preds = %for.body5
%cmp1348 = icmp sgt i32 %10, 0
br i1 %cmp1348, label %for.cond15.preheader.lr.ph, label %for.end29
for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1646 = icmp sgt i32 %4, 0
br i1 %cmp1646, label %for.cond15.preheader.us.preheader, label %for.end29
for.cond15.preheader.us.preheader: ; preds = %for.cond15.preheader.lr.ph
%wide.trip.count65 = zext i32 %10 to i64
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count65, 1
%5 = icmp eq i32 %10, 1
br i1 %5, label %for.end29.loopexit.unr-lcssa, label %for.cond15.preheader.us.preheader.new
for.cond15.preheader.us.preheader.new: ; preds = %for.cond15.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count65, 4294967294
br label %for.cond15.preheader.us
for.cond15.preheader.us: ; preds = %for.inc27.us.1, %for.cond15.preheader.us.preheader.new
%indvars.iv62 = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %indvars.iv.next63.1, %for.inc27.us.1 ]
%count.051.us = phi i32 [ 0, %for.cond15.preheader.us.preheader.new ], [ %count.1.us.1, %for.inc27.us.1 ]
%niter = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %niter.next.1, %for.inc27.us.1 ]
%arrayidx21.us = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv62
%6 = load i32, ptr %arrayidx21.us, align 8, !tbaa !5
br label %for.body17.us
for.cond15.us: ; preds = %for.body17.us
%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.inc27.us, label %for.body17.us, !llvm.loop !11
for.body17.us: ; preds = %for.cond15.preheader.us, %for.cond15.us
%indvars.iv59 = phi i64 [ 0, %for.cond15.preheader.us ], [ %indvars.iv.next60, %for.cond15.us ]
%arrayidx19.us = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv59
%7 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
%cmp22.us = icmp eq i32 %7, %6
br i1 %cmp22.us, label %if.then.us, label %for.cond15.us
if.then.us: ; preds = %for.body17.us
%inc23.us = add nsw i32 %count.051.us, 1
br label %for.inc27.us
for.inc27.us: ; preds = %for.cond15.us, %if.then.us
%count.1.us = phi i32 [ %inc23.us, %if.then.us ], [ %count.051.us, %for.cond15.us ]
%indvars.iv.next63 = or i64 %indvars.iv62, 1
%arrayidx21.us.1 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv.next63
%8 = load i32, ptr %arrayidx21.us.1, align 4, !tbaa !5
br label %for.body17.us.1
for.body17.us.1: ; preds = %for.cond15.us.1, %for.inc27.us
%indvars.iv59.1 = phi i64 [ 0, %for.inc27.us ], [ %indvars.iv.next60.1, %for.cond15.us.1 ]
%arrayidx19.us.1 = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv59.1
%9 = load i32, ptr %arrayidx19.us.1, align 4, !tbaa !5
%cmp22.us.1 = icmp eq i32 %9, %8
br i1 %cmp22.us.1, label %if.then.us.1, label %for.cond15.us.1
for.cond15.us.1: ; preds = %for.body17.us.1
%indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next60.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc27.us.1, label %for.body17.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body17.us.1
%inc23.us.1 = add nsw i32 %count.1.us, 1
br label %for.inc27.us.1
for.inc27.us.1: ; preds = %for.cond15.us.1, %if.then.us.1
%count.1.us.1 = phi i32 [ %inc23.us.1, %if.then.us.1 ], [ %count.1.us, %for.cond15.us.1 ]
%indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 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.end29.loopexit.unr-lcssa, label %for.cond15.preheader.us, !llvm.loop !12
for.body5: ; preds = %for.end, %for.body5
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv56
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp4 = icmp slt i64 %indvars.iv.next57, %11
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end29.loopexit.unr-lcssa: ; preds = %for.inc27.us.1, %for.cond15.preheader.us.preheader
%count.1.us.lcssa.ph = phi i32 [ undef, %for.cond15.preheader.us.preheader ], [ %count.1.us.1, %for.inc27.us.1 ]
%indvars.iv62.unr = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvars.iv.next63.1, %for.inc27.us.1 ]
%count.051.us.unr = phi i32 [ 0, %for.cond15.preheader.us.preheader ], [ %count.1.us.1, %for.inc27.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29, label %for.cond15.preheader.us.epil
for.cond15.preheader.us.epil: ; preds = %for.end29.loopexit.unr-lcssa
%arrayidx21.us.epil = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv62.unr
%12 = load i32, ptr %arrayidx21.us.epil, align 4, !tbaa !5
br label %for.body17.us.epil
for.body17.us.epil: ; preds = %for.cond15.us.epil, %for.cond15.preheader.us.epil
%indvars.iv59.epil = phi i64 [ 0, %for.cond15.preheader.us.epil ], [ %indvars.iv.next60.epil, %for.cond15.us.epil ]
%arrayidx19.us.epil = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv59.epil
%13 = load i32, ptr %arrayidx19.us.epil, align 4, !tbaa !5
%cmp22.us.epil = icmp eq i32 %13, %12
br i1 %cmp22.us.epil, label %if.then.us.epil, label %for.cond15.us.epil
for.cond15.us.epil: ; preds = %for.body17.us.epil
%indvars.iv.next60.epil = add nuw nsw i64 %indvars.iv59.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next60.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end29, label %for.body17.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body17.us.epil
%inc23.us.epil = add nsw i32 %count.051.us.unr, 1
br label %for.end29
for.end29: ; preds = %for.end29.loopexit.unr-lcssa, %for.cond15.us.epil, %if.then.us.epil, %for.end, %for.cond15.preheader.lr.ph, %for.cond12.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.cond15.preheader.lr.ph ], [ 0, %for.end ], [ %count.1.us.lcssa.ph, %for.end29.loopexit.unr-lcssa ], [ %inc23.us.epil, %if.then.us.epil ], [ %count.051.us.unr, %for.cond15.us.epil ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void){
int i,j,a,c,d,cnt,sum=0,b[10001];
scanf("%d",&a);
for(i=0;i<a;i++)
scanf("%d",&b[i]);
scanf("%d",&c);
for(i=0;i<c;i++){
cnt=0;
scanf("%d",&d);
b[a]=d;
for(j=0;j<=a;j++){
if(b[j]==d)
cnt++;
}
if(cnt>=2)
sum++;
}
printf("%d\n",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140727/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140727/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%c = alloca i32, align 4
%d = alloca i32, align 4
%b = alloca [10001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 40004, 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
%cmp36 = icmp sgt i32 %0, 0
br i1 %cmp36, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %b, 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 %a, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%3 = load i32, ptr %c, align 4, !tbaa !5
%cmp441 = icmp sgt i32 %3, 0
br i1 %cmp441, label %for.body5, label %for.end25
for.body5: ; preds = %for.end, %for.end18
%sum.043 = phi i32 [ %spec.select35, %for.end18 ], [ 0, %for.end ]
%i.142 = phi i32 [ %inc24, %for.end18 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%4 = load i32, ptr %d, align 4, !tbaa !5
%5 = load i32, ptr %a, align 4, !tbaa !5
%idxprom7 = sext i32 %5 to i64
%arrayidx8 = getelementptr inbounds [10001 x i32], ptr %b, i64 0, i64 %idxprom7
store i32 %4, ptr %arrayidx8, align 4, !tbaa !5
%cmp10.not38 = icmp slt i32 %5, 0
br i1 %cmp10.not38, label %for.end18, label %for.body11.preheader
for.body11.preheader: ; preds = %for.body5
%6 = add nuw i32 %5, 1
%wide.trip.count = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %5, 7
br i1 %min.iters.check, label %for.body11.preheader51, label %vector.ph
vector.ph: ; preds = %for.body11.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %4, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.phi49 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%7 = getelementptr inbounds [10001 x i32], ptr %b, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load50 = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = icmp eq <4 x i32> %wide.load, %broadcast.splat
%10 = icmp eq <4 x i32> %wide.load50, %broadcast.splat
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = add <4 x i32> %vec.phi, %11
%14 = add <4 x i32> %vec.phi49, %12
%index.next = add nuw i64 %index, 8
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %14, %13
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end18, label %for.body11.preheader51
for.body11.preheader51: ; preds = %for.body11.preheader, %middle.block
%indvars.iv46.ph = phi i64 [ 0, %for.body11.preheader ], [ %n.vec, %middle.block ]
%cnt.040.ph = phi i32 [ 0, %for.body11.preheader ], [ %16, %middle.block ]
br label %for.body11
for.body11: ; preds = %for.body11.preheader51, %for.body11
%indvars.iv46 = phi i64 [ %indvars.iv.next47, %for.body11 ], [ %indvars.iv46.ph, %for.body11.preheader51 ]
%cnt.040 = phi i32 [ %spec.select, %for.body11 ], [ %cnt.040.ph, %for.body11.preheader51 ]
%arrayidx13 = getelementptr inbounds [10001 x i32], ptr %b, i64 0, i64 %indvars.iv46
%17 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14 = icmp eq i32 %17, %4
%inc15 = zext i1 %cmp14 to i32
%spec.select = add nuw nsw i32 %cnt.040, %inc15
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%exitcond.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count
br i1 %exitcond.not, label %for.end18, label %for.body11, !llvm.loop !14
for.end18: ; preds = %for.body11, %middle.block, %for.body5
%cnt.0.lcssa = phi i32 [ 0, %for.body5 ], [ %16, %middle.block ], [ %spec.select, %for.body11 ]
%cmp19 = icmp ugt i32 %cnt.0.lcssa, 1
%inc21 = zext i1 %cmp19 to i32
%spec.select35 = add nuw nsw i32 %sum.043, %inc21
%inc24 = add nuw nsw i32 %i.142, 1
%18 = load i32, ptr %c, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc24, %18
br i1 %cmp4, label %for.body5, label %for.end25, !llvm.loop !15
for.end25: ; preds = %for.end18, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select35, %for.end18 ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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.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}
|
#define NOT_FOUND 20000
#include <stdio.h>
//????????????????????£?¨?.
int linearSearch(int key, int *t, int n);
int main(void) {
int s[10001] = {};
int t[501] = {};
int n = 0;
int q = 0;
int k = 0; //?????´????????°.
int i = 0;
int j = 0;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d", &s[i]);
scanf("%d", &q);
for (i = 0; i < q; i++)
scanf("%d", &t[i]);
for (i = 0; i < q; i++) {
if (linearSearch(t[i], s, n) != NOT_FOUND)
k++;
}
printf("%d\n", k);
return 0;
}
//key?????¢?´¢.
int linearSearch(int key, int *s, int n) {
int i = 0;
s[n] = key;
while (s[i] != key) {
i++;
}
if (i == n)
return NOT_FOUND;
return i;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140770/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140770/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [10001 x i32], align 16
%t = alloca [501 x i32], align 16
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %s) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40004) %s, i8 0, i64 40004, i1 false)
call void @llvm.lifetime.start.p0(i64 2004, ptr nonnull %t) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2004) %t, i8 0, i64 2004, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
store i32 0, ptr %n, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
store i32 0, ptr %q, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %for.body5, label %for.end22
for.cond12.preheader: ; preds = %for.body5
%cmp1338 = icmp sgt i32 %5, 0
br i1 %cmp1338, label %for.body14.lr.ph, label %for.end22
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %s, i64 %idxprom.i
%wide.trip.count = zext i32 %5 to i64
br label %for.body14
for.body5: ; preds = %for.end, %for.body5
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [501 x i32], ptr %t, i64 0, i64 %indvars.iv44
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%5 = load i32, ptr %q, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp4 = icmp slt i64 %indvars.iv.next45, %6
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11
for.body14: ; preds = %for.body14.lr.ph, %linearSearch.exit
%indvars.iv47 = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next48, %linearSearch.exit ]
%k.040 = phi i32 [ 0, %for.body14.lr.ph ], [ %spec.select, %linearSearch.exit ]
%arrayidx16 = getelementptr inbounds [501 x i32], ptr %t, i64 0, i64 %indvars.iv47
%7 = load i32, ptr %arrayidx16, align 4, !tbaa !5
store i32 %7, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body14
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body14 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %s, i64 %indvars.iv.i
%8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %8, %7
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %linearSearch.exit, label %while.cond.i, !llvm.loop !12
linearSearch.exit: ; preds = %while.cond.i
%9 = trunc i64 %indvars.iv.i to i32
%cmp3.i = icmp ne i32 %4, %9
%cmp18.not33 = icmp ne i32 %9, 20000
%cmp18.not.not = and i1 %cmp3.i, %cmp18.not33
%inc19 = zext i1 %cmp18.not.not to i32
%spec.select = add nuw nsw i32 %k.040, %inc19
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%exitcond.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count
br i1 %exitcond.not, label %for.end22, label %for.body14, !llvm.loop !13
for.end22: ; preds = %linearSearch.exit, %for.end, %for.cond12.preheader
%k.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.end ], [ %spec.select, %linearSearch.exit ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 2004, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @linearSearch(i32 noundef %key, ptr nocapture noundef %s, i32 noundef %n) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %s, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %s, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !12
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp eq i32 %1, %n
%.i.0 = select i1 %cmp3, i32 20000, i32 %1
ret i32 %.i.0
}
; 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 = { 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define N 10000
int linearSearch(int A[], int aLength, int key) {
int i;
for (i = 0; i < aLength; i++) {
if(A[i] == key) return 1;
}
return 0;
}
int main() {
int i, length, tLength;
int count = 0;
int S[N], T[N];
scanf("%d", &length);
for (i = 0; i < length; i++) {
scanf("%d", &S[i]);
}
scanf("%d", &tLength);
for (i = 0; i < tLength; i++) {
scanf("%d", &T[i]);
if (linearSearch(S, length, T[i]) == 1) {
count++;
}
}
printf("%d\n", count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140820/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140820/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @linearSearch(ptr nocapture noundef readonly %A, i32 noundef %aLength, i32 noundef %key) local_unnamed_addr #0 {
entry:
%cmp4 = icmp sgt i32 %aLength, 0
br i1 %cmp4, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %aLength to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !5
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !7
%cmp1 = icmp eq i32 %0, %key
br i1 %cmp1, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%length = alloca i32, align 4
%tLength = alloca i32, align 4
%S = alloca [10000 x i32], align 16
%T = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %length) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tLength) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %length)
%0 = load i32, ptr %length, align 4, !tbaa !7
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %length, align 4, !tbaa !7
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tLength)
%3 = load i32, ptr %tLength, align 4, !tbaa !7
%cmp430 = icmp sgt i32 %3, 0
br i1 %cmp430, label %for.body5, label %for.end16
for.body5: ; preds = %for.end, %for.cond3
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %for.cond3 ], [ 0, %for.end ]
%count.032 = phi i32 [ %7, %for.cond3 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv34
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%4 = load i32, ptr %length, align 4, !tbaa !7
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !7
%cmp4.i = icmp sgt i32 %4, 0
br i1 %cmp4.i, label %for.body.preheader.i, label %for.cond3
for.body.preheader.i: ; preds = %for.body5
%wide.trip.count.i = zext i32 %4 to i64
br label %for.body.i
for.cond.i: ; preds = %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond3, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !7
%cmp1.i = icmp eq i32 %6, %5
br i1 %cmp1.i, label %linearSearch.exit, label %for.cond.i
linearSearch.exit: ; preds = %for.body.i
%inc13 = add nsw i32 %count.032, 1
br label %for.cond3
for.cond3: ; preds = %for.cond.i, %for.body5, %linearSearch.exit
%7 = phi i32 [ %inc13, %linearSearch.exit ], [ %count.032, %for.body5 ], [ %count.032, %for.cond.i ]
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%8 = load i32, ptr %tLength, align 4, !tbaa !7
%9 = sext i32 %8 to i64
%cmp4 = icmp slt i64 %indvars.iv.next35, %9
br i1 %cmp4, label %for.body5, label %for.end16, !llvm.loop !12
for.end16: ; preds = %for.cond3, %for.end
%count.0.lcssa = phi i32 [ 0, %for.end ], [ %7, %for.cond3 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tLength) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %length) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = 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}
|
#include <stdio.h>
#define SMAX 10000
#define TMAX 500
int main( )
{
int i=0,j=0,n,q,count=0;
int S[SMAX],T[TMAX];
scanf("%d",&n);
while(i < n){
scanf("%d",&S[i]);
i++;
}
scanf("%d",&q);
while(j < q ){
scanf("%d",&T[j]);
j++;
}
for(j=0;j < q;j++){
for(i=0;i < n;i++){
if(T[j]==S[i]){
count++;
break;
}
}
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140864/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140864/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [10000 x i32], align 16
%T = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp439 = icmp sgt i32 %3, 0
br i1 %cmp439, label %while.body5, label %for.end24
for.cond.preheader: ; preds = %while.body5
%cmp1143 = icmp sgt i32 %10, 0
br i1 %cmp1143, label %for.cond12.preheader.lr.ph, label %for.end24
for.cond12.preheader.lr.ph: ; preds = %for.cond.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1341 = icmp sgt i32 %4, 0
br i1 %cmp1341, label %for.cond12.preheader.us.preheader, label %for.end24
for.cond12.preheader.us.preheader: ; preds = %for.cond12.preheader.lr.ph
%wide.trip.count60 = zext i32 %10 to i64
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count60, 1
%5 = icmp eq i32 %10, 1
br i1 %5, label %for.end24.loopexit.unr-lcssa, label %for.cond12.preheader.us.preheader.new
for.cond12.preheader.us.preheader.new: ; preds = %for.cond12.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count60, 4294967294
br label %for.cond12.preheader.us
for.cond12.preheader.us: ; preds = %for.inc22.us.1, %for.cond12.preheader.us.preheader.new
%indvars.iv57 = phi i64 [ 0, %for.cond12.preheader.us.preheader.new ], [ %indvars.iv.next58.1, %for.inc22.us.1 ]
%count.046.us = phi i32 [ 0, %for.cond12.preheader.us.preheader.new ], [ %count.1.us.1, %for.inc22.us.1 ]
%niter = phi i64 [ 0, %for.cond12.preheader.us.preheader.new ], [ %niter.next.1, %for.inc22.us.1 ]
%arrayidx16.us = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv57
%6 = load i32, ptr %arrayidx16.us, align 8, !tbaa !5
br label %for.body14.us
for.cond12.us: ; preds = %for.body14.us
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count
br i1 %exitcond.not, label %for.inc22.us, label %for.body14.us, !llvm.loop !11
for.body14.us: ; preds = %for.cond12.preheader.us, %for.cond12.us
%indvars.iv54 = phi i64 [ 0, %for.cond12.preheader.us ], [ %indvars.iv.next55, %for.cond12.us ]
%arrayidx18.us = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv54
%7 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5
%cmp19.us = icmp eq i32 %6, %7
br i1 %cmp19.us, label %if.then.us, label %for.cond12.us
if.then.us: ; preds = %for.body14.us
%inc20.us = add nsw i32 %count.046.us, 1
br label %for.inc22.us
for.inc22.us: ; preds = %for.cond12.us, %if.then.us
%count.1.us = phi i32 [ %inc20.us, %if.then.us ], [ %count.046.us, %for.cond12.us ]
%indvars.iv.next58 = or i64 %indvars.iv57, 1
%arrayidx16.us.1 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv.next58
%8 = load i32, ptr %arrayidx16.us.1, align 4, !tbaa !5
br label %for.body14.us.1
for.body14.us.1: ; preds = %for.cond12.us.1, %for.inc22.us
%indvars.iv54.1 = phi i64 [ 0, %for.inc22.us ], [ %indvars.iv.next55.1, %for.cond12.us.1 ]
%arrayidx18.us.1 = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv54.1
%9 = load i32, ptr %arrayidx18.us.1, align 4, !tbaa !5
%cmp19.us.1 = icmp eq i32 %8, %9
br i1 %cmp19.us.1, label %if.then.us.1, label %for.cond12.us.1
for.cond12.us.1: ; preds = %for.body14.us.1
%indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next55.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc22.us.1, label %for.body14.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body14.us.1
%inc20.us.1 = add nsw i32 %count.1.us, 1
br label %for.inc22.us.1
for.inc22.us.1: ; preds = %for.cond12.us.1, %if.then.us.1
%count.1.us.1 = phi i32 [ %inc20.us.1, %if.then.us.1 ], [ %count.1.us, %for.cond12.us.1 ]
%indvars.iv.next58.1 = add nuw nsw i64 %indvars.iv57, 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.end24.loopexit.unr-lcssa, label %for.cond12.preheader.us, !llvm.loop !12
while.body5: ; preds = %while.end, %while.body5
%indvars.iv51 = phi i64 [ %indvars.iv.next52, %while.body5 ], [ 0, %while.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv51
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp4 = icmp slt i64 %indvars.iv.next52, %11
br i1 %cmp4, label %while.body5, label %for.cond.preheader, !llvm.loop !13
for.end24.loopexit.unr-lcssa: ; preds = %for.inc22.us.1, %for.cond12.preheader.us.preheader
%count.1.us.lcssa.ph = phi i32 [ undef, %for.cond12.preheader.us.preheader ], [ %count.1.us.1, %for.inc22.us.1 ]
%indvars.iv57.unr = phi i64 [ 0, %for.cond12.preheader.us.preheader ], [ %indvars.iv.next58.1, %for.inc22.us.1 ]
%count.046.us.unr = phi i32 [ 0, %for.cond12.preheader.us.preheader ], [ %count.1.us.1, %for.inc22.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end24, label %for.cond12.preheader.us.epil
for.cond12.preheader.us.epil: ; preds = %for.end24.loopexit.unr-lcssa
%arrayidx16.us.epil = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv57.unr
%12 = load i32, ptr %arrayidx16.us.epil, align 4, !tbaa !5
br label %for.body14.us.epil
for.body14.us.epil: ; preds = %for.cond12.us.epil, %for.cond12.preheader.us.epil
%indvars.iv54.epil = phi i64 [ 0, %for.cond12.preheader.us.epil ], [ %indvars.iv.next55.epil, %for.cond12.us.epil ]
%arrayidx18.us.epil = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv54.epil
%13 = load i32, ptr %arrayidx18.us.epil, align 4, !tbaa !5
%cmp19.us.epil = icmp eq i32 %12, %13
br i1 %cmp19.us.epil, label %if.then.us.epil, label %for.cond12.us.epil
for.cond12.us.epil: ; preds = %for.body14.us.epil
%indvars.iv.next55.epil = add nuw nsw i64 %indvars.iv54.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next55.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end24, label %for.body14.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body14.us.epil
%inc20.us.epil = add nsw i32 %count.046.us.unr, 1
br label %for.end24
for.end24: ; preds = %for.end24.loopexit.unr-lcssa, %for.cond12.us.epil, %if.then.us.epil, %while.end, %for.cond12.preheader.lr.ph, %for.cond.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ 0, %for.cond12.preheader.lr.ph ], [ 0, %while.end ], [ %count.1.us.lcssa.ph, %for.end24.loopexit.unr-lcssa ], [ %inc20.us.epil, %if.then.us.epil ], [ %count.046.us.unr, %for.cond12.us.epil ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <string.h>
#define MAX1 10000
#define MAX2 500
int S[MAX1];
int linearSearch(int,int);
int main()
{
int n,q,i,T[MAX2],x,cnt=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++)
{
scanf("%d",&T[i]);
}
for(i=0;i<q;i++)
{
x=linearSearch(T[i],n);
if(x==1) cnt=cnt+1;
}
printf("%d\n",cnt);
return 0;
}
int linearSearch(int key,int n)
{
int i;
i=0;
S[n]=key;
while(S[i]!=key)
{
i++;
if(i==n)
{
return 0;
}
}
if(i!=n) return 1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140914/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140914/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@S = dso_local global [10000 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:
%n = alloca i32, align 4
%q = alloca i32, align 4
%T = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %0, 0
br i1 %cmp36, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp438 = icmp sgt i32 %3, 0
br i1 %cmp438, label %for.body5, label %for.end21
for.cond12.preheader: ; preds = %for.body5
%cmp1340 = icmp sgt i32 %6, 0
br i1 %cmp1340, label %for.body14.lr.ph, label %for.end21
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %idxprom.i
%5 = zext i32 %4 to i64
%wide.trip.count = zext i32 %6 to i64
br label %for.body14
for.body5: ; preds = %for.end, %for.body5
%indvars.iv47 = phi i64 [ %indvars.iv.next48, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv47
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%6 = load i32, ptr %q, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next48, %7
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11
for.body14: ; preds = %for.body14.lr.ph, %linearSearch.exit
%indvars.iv50 = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next51, %linearSearch.exit ]
%cnt.042 = phi i32 [ 0, %for.body14.lr.ph ], [ %11, %linearSearch.exit ]
%arrayidx16 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv50
%8 = load i32, ptr %arrayidx16, align 4, !tbaa !5
store i32 %8, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.body.i, %for.body14
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.body.i ], [ 0, %for.body14 ]
%arrayidx2.i = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %9, %8
br i1 %cmp.not.i, label %10, label %while.body.i
while.body.i: ; preds = %while.cond.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%cmp3.i = icmp eq i64 %indvars.iv.next.i, %5
br i1 %cmp3.i, label %linearSearch.exit, label %while.cond.i, !llvm.loop !12
10: ; preds = %while.cond.i
%add34 = add nsw i32 %cnt.042, 1
br label %linearSearch.exit
linearSearch.exit: ; preds = %while.body.i, %10
%11 = phi i32 [ %add34, %10 ], [ %cnt.042, %while.body.i ]
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count
br i1 %exitcond.not, label %for.end21, label %for.body14, !llvm.loop !13
for.end21: ; preds = %linearSearch.exit, %for.end, %for.cond12.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.end ], [ %11, %linearSearch.exit ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @linearSearch(i32 noundef %key, i32 noundef %n) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
%0 = zext i32 %n to i64
br label %while.cond
while.cond: ; preds = %while.body, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %1, %key
br i1 %cmp.not, label %cleanup, label %while.body
while.body: ; preds = %while.cond
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp3 = icmp eq i64 %indvars.iv.next, %0
br i1 %cmp3, label %cleanup, label %while.cond, !llvm.loop !12
cleanup: ; preds = %while.cond, %while.body
%retval.0 = phi i32 [ 0, %while.body ], [ 1, %while.cond ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 search(int A[],int n,int key){
int i=0;
A[n]=key;
while(A[i]!=key)i++;
return i!=n;
}
int main(){
int i,n,A[100000+1],q,key,sum=0;
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&A[i]);
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&key);
if(search(A,n,key))sum++;
}
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140958/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140958/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; 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
%A = alloca [100001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void) {
int n,cnta,cntb,i;
scanf("%d",&n);
char ch[n+1];
scanf("%s",ch);
cnta=0;
cntb=0;
for(i=0;i<n;i++)
{
if(ch[i]=='A')
cnta++;
else
cntb++;
}
if(cnta>cntb)
printf("Anton");
else if(cntb>cnta)
printf("Danik");
else
printf("Friendship");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14100/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14100/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"Anton\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"Danik\00", align 1
@.str.4 = private unnamed_addr constant [11 x i8] c"Friendship\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
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp25 = icmp sgt i32 %3, 0
br i1 %cmp25, label %for.body.preheader, label %if.else15
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body.preheader45, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%vec.phi39 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.phi40 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi41 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%4 = getelementptr inbounds i8, ptr %vla, i64 %index
%wide.load = load <4 x i8>, ptr %4, align 8, !tbaa !9
%5 = getelementptr inbounds i8, ptr %4, i64 4
%wide.load42 = load <4 x i8>, ptr %5, align 4, !tbaa !9
%6 = icmp ne <4 x i8> %wide.load, <i8 65, i8 65, i8 65, i8 65>
%7 = icmp ne <4 x i8> %wide.load42, <i8 65, i8 65, i8 65, i8 65>
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = add <4 x i32> %vec.phi40, %8
%11 = add <4 x i32> %vec.phi41, %9
%12 = xor <4 x i1> %6, <i1 true, i1 true, i1 true, i1 true>
%13 = xor <4 x i1> %7, <i1 true, i1 true, i1 true, i1 true>
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi39, %15
%index.next = add nuw i64 %index, 8
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx43 = add <4 x i32> %11, %10
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx43)
%bin.rdx = add <4 x i32> %17, %16
%20 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader45
for.body.preheader45: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%cnta.028.ph = phi i32 [ 0, %for.body.preheader ], [ %20, %middle.block ]
%cntb.026.ph = phi i32 [ 0, %for.body.preheader ], [ %19, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader45, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader45 ]
%cnta.028 = phi i32 [ %cnta.1, %for.body ], [ %cnta.028.ph, %for.body.preheader45 ]
%cntb.026 = phi i32 [ %cntb.1, %for.body ], [ %cntb.026.ph, %for.body.preheader45 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%21 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp2 = icmp ne i8 %21, 65
%inc4 = zext i1 %cmp2 to i32
%cntb.1 = add nuw nsw i32 %cntb.026, %inc4
%not.cmp2 = xor i1 %cmp2, true
%inc = zext i1 %not.cmp2 to i32
%cnta.1 = add nuw nsw i32 %cnta.028, %inc
%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 !14
for.end: ; preds = %for.body, %middle.block
%cntb.1.lcssa = phi i32 [ %19, %middle.block ], [ %cntb.1, %for.body ]
%cnta.1.lcssa = phi i32 [ %20, %middle.block ], [ %cnta.1, %for.body ]
%cmp6 = icmp ugt i32 %cnta.1.lcssa, %cntb.1.lcssa
br i1 %cmp6, label %if.end18, label %if.else10
if.else10: ; preds = %for.end
%cmp11 = icmp ugt i32 %cntb.1.lcssa, %cnta.1.lcssa
br i1 %cmp11, label %if.end18, label %if.else15
if.else15: ; preds = %entry, %if.else10
br label %if.end18
if.end18: ; preds = %if.else10, %for.end, %if.else15
%.str.3.sink = phi ptr [ @.str.4, %if.else15 ], [ @.str.2, %for.end ], [ @.str.3, %if.else10 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
|
#include<stdio.h>
int search(int A[], int n, int key) {
int i = 0;
A[n] = key;
while ( A[i] != key ) i++;
return i != n;
}
int main() {
int i, n, A[10000+1], q, key, sum = 0;
scanf("%d", &n);
for ( i = 0; i < n; i++ ) scanf("%d", &A[i]);
scanf("%d", &q);
for ( i = 0; i < q; i++ ) {
scanf("%d", &key);
if ( search(A, n, key) ) sum++;
}
printf("%d\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141050/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141050/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; 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
%A = alloca [10001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 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 !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#define N 10000
int check(int a[],int x,int n){
for(int i=0;i<n;i++){
if(a[i]==x)return 1;
}
return 0;
}
int main(){
int n,i,q,x;
int a[N];
int cnt=0;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&x);
cnt+=check(a,x,n);
}
printf("%d\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141094/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141094/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @check(ptr nocapture noundef readonly %a, i32 noundef %x, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp sgt i32 %n, 0
br i1 %cmp.not4, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%0 = zext i32 %n to i64
%wide.trip.count = zext i32 %n to i64
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp18 = icmp eq i32 %1, %x
br i1 %cmp18, label %cleanup, label %for.cond
for.cond: ; preds = %for.body.preheader, %for.body
%indvars.iv9 = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv9, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup.loopexit.loopexit, label %for.body, !llvm.loop !9
for.body: ; preds = %for.cond
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %2, %x
br i1 %cmp1, label %cleanup.loopexit.loopexit, label %for.cond, !llvm.loop !9
cleanup.loopexit.loopexit: ; preds = %for.body, %for.cond
%cmp.not.le = icmp ult i64 %indvars.iv.next, %0
%3 = zext i1 %cmp.not.le to i32
br label %cleanup
cleanup: ; preds = %for.body.preheader, %cleanup.loopexit.loopexit, %entry
%cmp.not.lcssa = phi i32 [ 0, %entry ], [ 1, %for.body.preheader ], [ %3, %cleanup.loopexit.loopexit ]
ret i32 %cmp.not.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%x = alloca i32, align 4
%a = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 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 !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp422 = icmp sgt i32 %3, 0
br i1 %cmp422, label %for.body5, label %for.end10
for.body5: ; preds = %for.end, %check.exit
%cnt.024 = phi i32 [ %add, %check.exit ], [ 0, %for.end ]
%i.123 = phi i32 [ %inc9, %check.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%4 = load i32, ptr %x, align 4, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not4.i = icmp sgt i32 %5, 0
br i1 %cmp.not4.i, label %for.body.preheader.i, label %check.exit
for.body.preheader.i: ; preds = %for.body5
%6 = zext i32 %5 to i64
%7 = load i32, ptr %a, align 16, !tbaa !5
%cmp1.i19 = icmp eq i32 %7, %4
br i1 %cmp1.i19, label %cleanup.loopexit.i, label %for.cond.i
for.cond.i: ; preds = %for.body.preheader.i, %for.body.i
%indvars.iv.i20 = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %for.body.preheader.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i20, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %6
br i1 %exitcond.not.i, label %cleanup.loopexit.i.loopexit, label %for.body.i, !llvm.loop !9
for.body.i: ; preds = %for.cond.i
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %8, %4
br i1 %cmp1.i, label %cleanup.loopexit.i.loopexit, label %for.cond.i, !llvm.loop !9
cleanup.loopexit.i.loopexit: ; preds = %for.body.i, %for.cond.i
%cmp.not.i.le = icmp ult i64 %indvars.iv.next.i, %6
br label %cleanup.loopexit.i
cleanup.loopexit.i: ; preds = %cleanup.loopexit.i.loopexit, %for.body.preheader.i
%cmp.not.lcssa.ph.i = phi i1 [ true, %for.body.preheader.i ], [ %cmp.not.i.le, %cleanup.loopexit.i.loopexit ]
%9 = zext i1 %cmp.not.lcssa.ph.i to i32
br label %check.exit
check.exit: ; preds = %for.body5, %cleanup.loopexit.i
%cmp.not.lcssa.i = phi i32 [ 0, %for.body5 ], [ %9, %cleanup.loopexit.i ]
%add = add nuw nsw i32 %cmp.not.lcssa.i, %cnt.024
%inc9 = add nuw nsw i32 %i.123, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc9, %10
br i1 %cmp4, label %for.body5, label %for.end10, !llvm.loop !12
for.end10: ; preds = %check.exit, %for.end
%cnt.0.lcssa = phi i32 [ 0, %for.end ], [ %add, %check.exit ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define n 10000
#define q 500
int main(){
int a,b,i,j,status;
int count = 0;
int S[n],T[q];
scanf("%d",&a);
for(i=0;i<a;i++){
scanf("%d",&S[i]);
}
scanf("%d",&b);
for(i=0;i<b;i++){
scanf("%d",&T[i]);
j = 0;
while(j<a){
if(S[j] == T[i]){
count++;
break;
}
j++;
}
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141144/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141144/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%S = alloca [10000 x i32], align 16
%T = alloca [500 x i32], align 16
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 40000, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %0, 0
br i1 %cmp30, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp434 = icmp sgt i32 %3, 0
br i1 %cmp434, label %for.body5, label %for.end19
for.body5: ; preds = %for.end, %for.inc17
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.inc17 ], [ 0, %for.end ]
%count.036 = phi i32 [ %count.1, %for.inc17 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv41
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%4 = load i32, ptr %a, align 4, !tbaa !5
%cmp932 = icmp sgt i32 %4, 0
br i1 %cmp932, label %while.body.lr.ph, label %for.inc17
while.body.lr.ph: ; preds = %for.body5
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
br label %while.body
while.cond: ; preds = %while.body
%indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
%exitcond.not = icmp eq i64 %indvars.iv.next39, %wide.trip.count
br i1 %exitcond.not, label %for.inc17, label %while.body, !llvm.loop !11
while.body: ; preds = %while.body.lr.ph, %while.cond
%indvars.iv38 = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next39, %while.cond ]
%arrayidx11 = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv38
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp14 = icmp eq i32 %6, %5
br i1 %cmp14, label %if.then, label %while.cond
if.then: ; preds = %while.body
%inc15 = add nsw i32 %count.036, 1
br label %for.inc17
for.inc17: ; preds = %while.cond, %for.body5, %if.then
%count.1 = phi i32 [ %inc15, %if.then ], [ %count.036, %for.body5 ], [ %count.036, %while.cond ]
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%7 = load i32, ptr %b, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next42, %8
br i1 %cmp4, label %for.body5, label %for.end19, !llvm.loop !12
for.end19: ; preds = %for.inc17, %for.end
%count.0.lcssa = phi i32 [ 0, %for.end ], [ %count.1, %for.inc17 ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 40000, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<stdlib.h>
int Lsearch(int[],int,int);
int main(){
int data[10001],n,q,key,i,total=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&data[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&key);
if(Lsearch(data,n,key)!=n)total++;
}
printf("%d\n",total);
return 0;
}
int Lsearch(int data[],int n,int key){
int i=0;
data[n]=key;
while(data[i]!=key){
i++;
}
return i;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141188/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141188/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%data = alloca [10001 x i32], align 16
%n = alloca i32, align 4
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %data) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %data, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp421 = icmp sgt i32 %3, 0
br i1 %cmp421, label %for.body5, label %for.end12
for.body5: ; preds = %for.end, %Lsearch.exit
%total.023 = phi i32 [ %spec.select, %Lsearch.exit ], [ 0, %for.end ]
%i.122 = phi i32 [ %inc11, %Lsearch.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %data, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %Lsearch.exit, label %while.cond.i, !llvm.loop !11
Lsearch.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp8.not = icmp ne i32 %4, %7
%inc9 = zext i1 %cmp8.not to i32
%spec.select = add nuw nsw i32 %total.023, %inc9
%inc11 = add nuw nsw i32 %i.122, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc11, %8
br i1 %cmp4, label %for.body5, label %for.end12, !llvm.loop !12
for.end12: ; preds = %Lsearch.exit, %for.end
%total.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %Lsearch.exit ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %total.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %data) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @Lsearch(ptr nocapture noundef %data, i32 noundef %n, i32 noundef %key) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %data, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
ret i32 %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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 N 10000
int linerSearch(int [],int,int);
int main(){
int A[N],i,n,q,key,x,count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&key);
x= linerSearch(A,n,key);
if(x!=n+1) count++;
}
printf("%d\n",count);
return 0;
}
int linerSearch(int A[],int n, int key){
int i=0;
A[n]=key;
while(A[i]!=key){
i++;
}
if(i==n) return n+1;
else return i;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141230/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141230/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10000 x i32], align 16
%n = alloca i32, align 4
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp422 = icmp sgt i32 %3, 0
br i1 %cmp422, label %for.body5, label %for.end12
for.body5: ; preds = %for.end, %linerSearch.exit
%count.024 = phi i32 [ %spec.select, %linerSearch.exit ], [ 0, %for.end ]
%i.123 = phi i32 [ %inc11, %linerSearch.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %linerSearch.exit, label %while.cond.i, !llvm.loop !11
linerSearch.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i = icmp ne i32 %4, %7
%add.i = add nsw i32 %4, 1
%cmp8.not19 = icmp ne i32 %add.i, %7
%cmp8.not.not = select i1 %cmp3.i, i1 %cmp8.not19, i1 false
%inc9 = zext i1 %cmp8.not.not to i32
%spec.select = add nuw nsw i32 %count.024, %inc9
%inc11 = add nuw nsw i32 %i.123, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc11, %8
br i1 %cmp4, label %for.body5, label %for.end12, !llvm.loop !12
for.end12: ; preds = %linerSearch.exit, %for.end
%count.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %linerSearch.exit ]
%call13 = 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 %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @linerSearch(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp eq i32 %1, %n
%add = add nsw i32 %n, 1
%retval.0 = select i1 %cmp3, i32 %add, i32 %1
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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,m,s[10000],t[500],i,j,count = 0;
scanf("%d",&n);
for(i = 0; i < n ;i++){
scanf("%d",&s[i]);
}
scanf("%d",&m);
for(i = 0; i < m ; i++){
scanf("%d",&t[i]);
}
for(i = 0 ; i < m; i++){
for(j = 0; j < n; j++){
if(t[i] == s[j]){
count++;
break;
}
}
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141274/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141274/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%m = alloca i32, align 4
%s = alloca [10000 x i32], align 16
%t = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %0, 0
br i1 %cmp42, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp444 = icmp sgt i32 %3, 0
br i1 %cmp444, label %for.body5, label %for.end29
for.cond12.preheader: ; preds = %for.body5
%cmp1348 = icmp sgt i32 %10, 0
br i1 %cmp1348, label %for.cond15.preheader.lr.ph, label %for.end29
for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1646 = icmp sgt i32 %4, 0
br i1 %cmp1646, label %for.cond15.preheader.us.preheader, label %for.end29
for.cond15.preheader.us.preheader: ; preds = %for.cond15.preheader.lr.ph
%wide.trip.count65 = zext i32 %10 to i64
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count65, 1
%5 = icmp eq i32 %10, 1
br i1 %5, label %for.end29.loopexit.unr-lcssa, label %for.cond15.preheader.us.preheader.new
for.cond15.preheader.us.preheader.new: ; preds = %for.cond15.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count65, 4294967294
br label %for.cond15.preheader.us
for.cond15.preheader.us: ; preds = %for.inc27.us.1, %for.cond15.preheader.us.preheader.new
%indvars.iv62 = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %indvars.iv.next63.1, %for.inc27.us.1 ]
%count.051.us = phi i32 [ 0, %for.cond15.preheader.us.preheader.new ], [ %count.1.us.1, %for.inc27.us.1 ]
%niter = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %niter.next.1, %for.inc27.us.1 ]
%arrayidx19.us = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv62
%6 = load i32, ptr %arrayidx19.us, align 8, !tbaa !5
br label %for.body17.us
for.cond15.us: ; preds = %for.body17.us
%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.inc27.us, label %for.body17.us, !llvm.loop !11
for.body17.us: ; preds = %for.cond15.preheader.us, %for.cond15.us
%indvars.iv59 = phi i64 [ 0, %for.cond15.preheader.us ], [ %indvars.iv.next60, %for.cond15.us ]
%arrayidx21.us = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv59
%7 = load i32, ptr %arrayidx21.us, align 4, !tbaa !5
%cmp22.us = icmp eq i32 %6, %7
br i1 %cmp22.us, label %if.then.us, label %for.cond15.us
if.then.us: ; preds = %for.body17.us
%inc23.us = add nsw i32 %count.051.us, 1
br label %for.inc27.us
for.inc27.us: ; preds = %for.cond15.us, %if.then.us
%count.1.us = phi i32 [ %inc23.us, %if.then.us ], [ %count.051.us, %for.cond15.us ]
%indvars.iv.next63 = or i64 %indvars.iv62, 1
%arrayidx19.us.1 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv.next63
%8 = load i32, ptr %arrayidx19.us.1, align 4, !tbaa !5
br label %for.body17.us.1
for.body17.us.1: ; preds = %for.cond15.us.1, %for.inc27.us
%indvars.iv59.1 = phi i64 [ 0, %for.inc27.us ], [ %indvars.iv.next60.1, %for.cond15.us.1 ]
%arrayidx21.us.1 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv59.1
%9 = load i32, ptr %arrayidx21.us.1, align 4, !tbaa !5
%cmp22.us.1 = icmp eq i32 %8, %9
br i1 %cmp22.us.1, label %if.then.us.1, label %for.cond15.us.1
for.cond15.us.1: ; preds = %for.body17.us.1
%indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next60.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc27.us.1, label %for.body17.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body17.us.1
%inc23.us.1 = add nsw i32 %count.1.us, 1
br label %for.inc27.us.1
for.inc27.us.1: ; preds = %for.cond15.us.1, %if.then.us.1
%count.1.us.1 = phi i32 [ %inc23.us.1, %if.then.us.1 ], [ %count.1.us, %for.cond15.us.1 ]
%indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 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.end29.loopexit.unr-lcssa, label %for.cond15.preheader.us, !llvm.loop !12
for.body5: ; preds = %for.end, %for.body5
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv56
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%10 = load i32, ptr %m, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp4 = icmp slt i64 %indvars.iv.next57, %11
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end29.loopexit.unr-lcssa: ; preds = %for.inc27.us.1, %for.cond15.preheader.us.preheader
%count.1.us.lcssa.ph = phi i32 [ undef, %for.cond15.preheader.us.preheader ], [ %count.1.us.1, %for.inc27.us.1 ]
%indvars.iv62.unr = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvars.iv.next63.1, %for.inc27.us.1 ]
%count.051.us.unr = phi i32 [ 0, %for.cond15.preheader.us.preheader ], [ %count.1.us.1, %for.inc27.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29, label %for.cond15.preheader.us.epil
for.cond15.preheader.us.epil: ; preds = %for.end29.loopexit.unr-lcssa
%arrayidx19.us.epil = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv62.unr
%12 = load i32, ptr %arrayidx19.us.epil, align 4, !tbaa !5
br label %for.body17.us.epil
for.body17.us.epil: ; preds = %for.cond15.us.epil, %for.cond15.preheader.us.epil
%indvars.iv59.epil = phi i64 [ 0, %for.cond15.preheader.us.epil ], [ %indvars.iv.next60.epil, %for.cond15.us.epil ]
%arrayidx21.us.epil = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv59.epil
%13 = load i32, ptr %arrayidx21.us.epil, align 4, !tbaa !5
%cmp22.us.epil = icmp eq i32 %12, %13
br i1 %cmp22.us.epil, label %if.then.us.epil, label %for.cond15.us.epil
for.cond15.us.epil: ; preds = %for.body17.us.epil
%indvars.iv.next60.epil = add nuw nsw i64 %indvars.iv59.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next60.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end29, label %for.body17.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body17.us.epil
%inc23.us.epil = add nsw i32 %count.051.us.unr, 1
br label %for.end29
for.end29: ; preds = %for.end29.loopexit.unr-lcssa, %for.cond15.us.epil, %if.then.us.epil, %for.end, %for.cond15.preheader.lr.ph, %for.cond12.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.cond15.preheader.lr.ph ], [ 0, %for.end ], [ %count.1.us.lcssa.ph, %for.end29.loopexit.unr-lcssa ], [ %inc23.us.epil, %if.then.us.epil ], [ %count.051.us.unr, %for.cond15.us.epil ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
#define MAX 10001
int main() {
int i,j;
int n,m,a[MAX],b[MAX],key,count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d",&b[i]);
}
i=0;
for (j = 0; j < m; j++) {
key=b[j];
while (a[i]!=key) {
i++;
if(i==n) {break;}
}
if(i!=n) {count++;}
i=0;
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141317/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141317/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%m = alloca i32, align 4
%a = alloca [10001 x i32], align 16
%b = alloca [10001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %0, 0
br i1 %cmp42, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp444 = icmp sgt i32 %3, 0
br i1 %cmp444, label %for.body5, label %for.end28
for.cond12.preheader: ; preds = %for.body5
%cmp1346 = icmp sgt i32 %6, 0
br i1 %cmp1346, label %for.body14.lr.ph, label %for.end28
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4
%5 = zext i32 %4 to i64
%wide.trip.count = zext i32 %6 to i64
br label %for.body14
for.body5: ; preds = %for.end, %for.body5
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [10001 x i32], ptr %b, i64 0, i64 %indvars.iv52
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%6 = load i32, ptr %m, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next53, %7
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11
for.body14: ; preds = %for.body14.lr.ph, %while.end
%indvars.iv58 = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next59, %while.end ]
%count.048 = phi i32 [ 0, %for.body14.lr.ph ], [ %spec.select, %while.end ]
%arrayidx16 = getelementptr inbounds [10001 x i32], ptr %b, i64 0, i64 %indvars.iv58
%8 = load i32, ptr %arrayidx16, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.body, %for.body14
%indvars.iv55 = phi i64 [ %indvars.iv.next56, %while.body ], [ 0, %for.body14 ]
%arrayidx18 = getelementptr inbounds [10001 x i32], ptr %a, i64 0, i64 %indvars.iv55
%9 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%cmp19.not = icmp eq i32 %9, %8
br i1 %cmp19.not, label %while.end.split.loop.exit63, label %while.body
while.body: ; preds = %while.cond
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
%cmp21 = icmp eq i64 %indvars.iv.next56, %5
br i1 %cmp21, label %while.end, label %while.cond, !llvm.loop !12
while.end.split.loop.exit63: ; preds = %while.cond
%10 = trunc i64 %indvars.iv55 to i32
br label %while.end
while.end: ; preds = %while.body, %while.end.split.loop.exit63
%i.4 = phi i32 [ %10, %while.end.split.loop.exit63 ], [ %4, %while.body ]
%cmp22.not = icmp ne i32 %i.4, %4
%inc24 = zext i1 %cmp22.not to i32
%spec.select = add nuw nsw i32 %count.048, %inc24
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count
br i1 %exitcond.not, label %for.end28, label %for.body14, !llvm.loop !13
for.end28: ; preds = %while.end, %for.end, %for.cond12.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.end ], [ %spec.select, %while.end ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(){
int S[10001],T[501],U[10001];
int i,j,lengh1,lengh2,count=0,count2=0,count3=0;
scanf("%d",&lengh1);
for(i=1;i<=lengh1;i++){
scanf("%d",&S[i]);}
scanf("%d",&lengh2);
for(i=1;i<=lengh2;i++){
scanf("%d",&T[i]);
}
for(i=1;i<=lengh1;i++){
for(j=1;j<=lengh2;j++){
if(S[i]==T[j]){
count++;
U[count]=T[j];
}
}}
count2=count;
for(i=1;i<=count2;i++){
for(j=i+1;j<=count2;j++){
if(U[j]==U[i]){
count--;
break;}
}}
printf("%d\n",count+count3);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141368/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141368/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [10001 x i32], align 16
%T = alloca [501 x i32], align 16
%U = alloca [10001 x i32], align 16
%lengh1 = alloca i32, align 4
%lengh2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 2004, ptr nonnull %T) #3
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %U) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %lengh1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %lengh2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %lengh1)
%0 = load i32, ptr %lengh1, align 4, !tbaa !5
%cmp.not78 = icmp slt i32 %0, 1
br i1 %cmp.not78, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %lengh1, 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.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %lengh2)
%3 = load i32, ptr %lengh2, align 4, !tbaa !5
%cmp4.not80 = icmp slt i32 %3, 1
br i1 %cmp4.not80, label %for.cond12.preheader, label %for.body5
for.cond12.preheader: ; preds = %for.body5, %for.end
%.lcssa = phi i32 [ %3, %for.end ], [ %9, %for.body5 ]
%4 = load i32, ptr %lengh1, align 4, !tbaa !5
%cmp13.not86 = icmp slt i32 %4, 1
%cmp16.not82 = icmp slt i32 %.lcssa, 1
%or.cond = or i1 %cmp13.not86, %cmp16.not82
br i1 %or.cond, label %for.end52, label %for.cond15.preheader.preheader
for.cond15.preheader.preheader: ; preds = %for.cond12.preheader
%5 = add i32 %.lcssa, 1
%6 = add nuw i32 %4, 1
%wide.trip.count108 = zext i32 %6 to i64
%wide.trip.count = zext i32 %5 to i64
%7 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %7, 1
%8 = icmp eq i32 %5, 2
%unroll_iter = and i64 %7, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond15.preheader
for.body5: ; preds = %for.end, %for.body5
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body5 ], [ 1, %for.end ]
%arrayidx7 = getelementptr inbounds [501 x i32], ptr %T, i64 0, i64 %indvars.iv99
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%9 = load i32, ptr %lengh2, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp4.not.not = icmp slt i64 %indvars.iv99, %10
br i1 %cmp4.not.not, label %for.body5, label %for.cond12.preheader, !llvm.loop !11
for.cond15.preheader: ; preds = %for.cond15.preheader.preheader, %for.cond15.for.inc31_crit_edge
%indvars.iv105 = phi i64 [ 1, %for.cond15.preheader.preheader ], [ %indvars.iv.next106, %for.cond15.for.inc31_crit_edge ]
%count.087 = phi i32 [ 0, %for.cond15.preheader.preheader ], [ %count.2.lcssa, %for.cond15.for.inc31_crit_edge ]
%arrayidx19 = getelementptr inbounds [10001 x i32], ptr %S, i64 0, i64 %indvars.iv105
%11 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br i1 %8, label %for.cond15.for.inc31_crit_edge.unr-lcssa, label %for.body17
for.cond34.preheader: ; preds = %for.cond15.for.inc31_crit_edge
%cmp35.not92 = icmp slt i32 %count.2.lcssa, 1
br i1 %cmp35.not92, label %for.end52, label %for.body36.preheader
for.body36.preheader: ; preds = %for.cond34.preheader
%12 = add nuw i32 %count.2.lcssa, 1
%13 = zext i32 %count.2.lcssa to i64
%wide.trip.count119 = zext i32 %12 to i64
br label %for.body36
for.body17: ; preds = %for.cond15.preheader, %for.inc28.1
%indvars.iv102 = phi i64 [ %indvars.iv.next103.1, %for.inc28.1 ], [ 1, %for.cond15.preheader ]
%count.184 = phi i32 [ %count.2.1, %for.inc28.1 ], [ %count.087, %for.cond15.preheader ]
%niter = phi i64 [ %niter.next.1, %for.inc28.1 ], [ 0, %for.cond15.preheader ]
%arrayidx21 = getelementptr inbounds [501 x i32], ptr %T, i64 0, i64 %indvars.iv102
%14 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp eq i32 %11, %14
br i1 %cmp22, label %if.then, label %for.inc28
if.then: ; preds = %for.body17
%inc23 = add nsw i32 %count.184, 1
%idxprom26 = sext i32 %inc23 to i64
%arrayidx27 = getelementptr inbounds [10001 x i32], ptr %U, i64 0, i64 %idxprom26
store i32 %11, ptr %arrayidx27, align 4, !tbaa !5
br label %for.inc28
for.inc28: ; preds = %for.body17, %if.then
%count.2 = phi i32 [ %inc23, %if.then ], [ %count.184, %for.body17 ]
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%arrayidx21.1 = getelementptr inbounds [501 x i32], ptr %T, i64 0, i64 %indvars.iv.next103
%15 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
%cmp22.1 = icmp eq i32 %11, %15
br i1 %cmp22.1, label %if.then.1, label %for.inc28.1
if.then.1: ; preds = %for.inc28
%inc23.1 = add nsw i32 %count.2, 1
%idxprom26.1 = sext i32 %inc23.1 to i64
%arrayidx27.1 = getelementptr inbounds [10001 x i32], ptr %U, i64 0, i64 %idxprom26.1
store i32 %11, ptr %arrayidx27.1, align 4, !tbaa !5
br label %for.inc28.1
for.inc28.1: ; preds = %if.then.1, %for.inc28
%count.2.1 = phi i32 [ %inc23.1, %if.then.1 ], [ %count.2, %for.inc28 ]
%indvars.iv.next103.1 = add nuw nsw i64 %indvars.iv102, 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.cond15.for.inc31_crit_edge.unr-lcssa, label %for.body17, !llvm.loop !12
for.cond15.for.inc31_crit_edge.unr-lcssa: ; preds = %for.inc28.1, %for.cond15.preheader
%count.2.lcssa.ph = phi i32 [ undef, %for.cond15.preheader ], [ %count.2.1, %for.inc28.1 ]
%indvars.iv102.unr = phi i64 [ 1, %for.cond15.preheader ], [ %indvars.iv.next103.1, %for.inc28.1 ]
%count.184.unr = phi i32 [ %count.087, %for.cond15.preheader ], [ %count.2.1, %for.inc28.1 ]
br i1 %lcmp.mod.not, label %for.cond15.for.inc31_crit_edge, label %for.body17.epil
for.body17.epil: ; preds = %for.cond15.for.inc31_crit_edge.unr-lcssa
%arrayidx21.epil = getelementptr inbounds [501 x i32], ptr %T, i64 0, i64 %indvars.iv102.unr
%16 = load i32, ptr %arrayidx21.epil, align 4, !tbaa !5
%cmp22.epil = icmp eq i32 %11, %16
br i1 %cmp22.epil, label %if.then.epil, label %for.cond15.for.inc31_crit_edge
if.then.epil: ; preds = %for.body17.epil
%inc23.epil = add nsw i32 %count.184.unr, 1
%idxprom26.epil = sext i32 %inc23.epil to i64
%arrayidx27.epil = getelementptr inbounds [10001 x i32], ptr %U, i64 0, i64 %idxprom26.epil
store i32 %11, ptr %arrayidx27.epil, align 4, !tbaa !5
br label %for.cond15.for.inc31_crit_edge
for.cond15.for.inc31_crit_edge: ; preds = %for.body17.epil, %if.then.epil, %for.cond15.for.inc31_crit_edge.unr-lcssa
%count.2.lcssa = phi i32 [ %count.2.lcssa.ph, %for.cond15.for.inc31_crit_edge.unr-lcssa ], [ %inc23.epil, %if.then.epil ], [ %count.184.unr, %for.body17.epil ]
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108
br i1 %exitcond109.not, label %for.cond34.preheader, label %for.cond15.preheader, !llvm.loop !13
for.body36: ; preds = %for.body36.preheader, %for.inc50
%indvars.iv116 = phi i64 [ 1, %for.body36.preheader ], [ %indvars.iv.next117, %for.inc50 ]
%indvars.iv110 = phi i64 [ 2, %for.body36.preheader ], [ %indvars.iv.next111, %for.inc50 ]
%count.393 = phi i32 [ %count.2.lcssa, %for.body36.preheader ], [ %count.4, %for.inc50 ]
%indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
%cmp38.not90.not = icmp ult i64 %indvars.iv116, %13
br i1 %cmp38.not90.not, label %for.body39.lr.ph, label %for.inc50
for.body39.lr.ph: ; preds = %for.body36
%arrayidx43 = getelementptr inbounds [10001 x i32], ptr %U, i64 0, i64 %indvars.iv116
%17 = load i32, ptr %arrayidx43, align 4, !tbaa !5
br label %for.body39
for.cond37: ; preds = %for.body39
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%lftr.wideiv = trunc i64 %indvars.iv.next113 to i32
%exitcond115.not = icmp eq i32 %12, %lftr.wideiv
br i1 %exitcond115.not, label %for.inc50, label %for.body39, !llvm.loop !14
for.body39: ; preds = %for.body39.lr.ph, %for.cond37
%indvars.iv112 = phi i64 [ %indvars.iv110, %for.body39.lr.ph ], [ %indvars.iv.next113, %for.cond37 ]
%arrayidx41 = getelementptr inbounds [10001 x i32], ptr %U, i64 0, i64 %indvars.iv112
%18 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%cmp44 = icmp eq i32 %18, %17
br i1 %cmp44, label %if.then45, label %for.cond37
if.then45: ; preds = %for.body39
%dec = add nsw i32 %count.393, -1
br label %for.inc50
for.inc50: ; preds = %for.cond37, %for.body36, %if.then45
%count.4 = phi i32 [ %dec, %if.then45 ], [ %count.393, %for.body36 ], [ %count.393, %for.cond37 ]
%indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
%exitcond120.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count119
br i1 %exitcond120.not, label %for.end52, label %for.body36, !llvm.loop !15
for.end52: ; preds = %for.inc50, %for.cond12.preheader, %for.cond34.preheader
%count.3.lcssa = phi i32 [ %count.2.lcssa, %for.cond34.preheader ], [ 0, %for.cond12.preheader ], [ %count.4, %for.inc50 ]
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.3.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %lengh2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %lengh1) #3
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %U) #3
call void @llvm.lifetime.end.p0(i64 2004, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 40004, 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 = !{!"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>
int search(int A[], int n, int key){
int i=0;A[n]=key;
while(A[i]!=key)i++;
return i!=n;
}
int main(void){
int i,n,A[10000+1],q,key,sum=0;
scanf("%d",&n);
for(i=0; i<n; i++)scanf("%d",&A[i]);
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&key);
if(search(A,n,key))sum++;
}
printf("%d\n",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141469/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141469/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; 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
%A = alloca [10001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 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 !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int search(int A[], int n, int key){
int i =0;
A[n] = key;
while (A[i] != key) i++;
return i != n;
}
int main(){
int i, n,A[10000+1],q,key, sum =0;
scanf("%d",&n);
for (i =0; i<n ; i++) scanf("%d", &A[i]);
scanf("%d",&q);
for(i=0; i<q; i++) {
scanf("%d",&key);
if(search(A, n, key)) sum++ ;
}
printf("%d\n",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141511/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141511/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; 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
%A = alloca [10001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 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 !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#define N 10000
int linearSearch();
int main(){
int i,n,A[N], a,b,c = 0;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d", &A[i]);
}
scanf("%d", &a);
for(i = 0; i < a; i++){
scanf("%d", &b);
if( linearSearch(A,b,n) == 1 ) c++;
}
printf("%d\n",c);
return 0;
}
int linearSearch(int A[], int b, int n){
int i;
for(i = 0 ; i < n-1; i++){
if(A[i] == b) return 1;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141555/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141555/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10000 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) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %A) #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 %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%3 = load i32, ptr %a, align 4, !tbaa !5
%cmp424 = icmp sgt i32 %3, 0
br i1 %cmp424, label %for.body5, label %for.end12
for.body5: ; preds = %for.end, %for.cond3
%c.026 = phi i32 [ %7, %for.cond3 ], [ 0, %for.end ]
%i.125 = phi i32 [ %inc11, %for.cond3 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%4 = load i32, ptr %b, align 4, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %5, 1
br i1 %cmp4.i, label %for.body.preheader.i, label %for.cond3
for.body.preheader.i: ; preds = %for.body5
%sub.i = add nsw i32 %5, -1
%wide.trip.count.i = zext i32 %sub.i to i64
br label %for.body.i
for.cond.i: ; preds = %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond3, label %for.body.i, !llvm.loop !11
for.body.i: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %6, %4
br i1 %cmp1.i, label %linearSearch.exit, label %for.cond.i
linearSearch.exit: ; preds = %for.body.i
%inc9 = add nsw i32 %c.026, 1
br label %for.cond3
for.cond3: ; preds = %for.cond.i, %for.body5, %linearSearch.exit
%7 = phi i32 [ %inc9, %linearSearch.exit ], [ %c.026, %for.body5 ], [ %c.026, %for.cond.i ]
%inc11 = add nuw nsw i32 %i.125, 1
%8 = load i32, ptr %a, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc11, %8
br i1 %cmp4, label %for.body5, label %for.end12, !llvm.loop !12
for.end12: ; preds = %for.cond3, %for.end
%c.0.lcssa = phi i32 [ 0, %for.end ], [ %7, %for.cond3 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @linearSearch(ptr nocapture noundef readonly %A, i32 noundef %b, i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp4 = icmp sgt i32 %n, 1
br i1 %cmp4, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
%wide.trip.count = zext i32 %sub to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, %b
br i1 %cmp1, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ]
ret i32 %retval.0
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
void Search(int);
int S[10000],count=0;
int main(){
int Slength,Tlength,key;
int i;
//input S
scanf("%d",&Slength);
for(i=0;i<Slength;i++){
scanf("%d",&S[i]);
}
//input T
scanf("%d",&Tlength);
for(i=0;i<Tlength;i++){
scanf("%d",&key);
Search(key);
}
//output C
printf("%d\n",count);
return 0;
}
void Search(int key){
int i;
for(i=0;i<10000;i++){
if(S[i]==key){
count++;
break;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141599/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141599/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@count = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@S = dso_local global [10000 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:
%Slength = alloca i32, align 4
%Tlength = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Slength) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Tlength) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Slength)
%0 = load i32, ptr %Slength, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %0, 0
br i1 %cmp15, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %Slength, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Tlength)
%3 = load i32, ptr %Tlength, align 4, !tbaa !5
%cmp417 = icmp sgt i32 %3, 0
br i1 %cmp417, label %for.body5, label %for.end9
for.body5: ; preds = %for.end, %Search.exit
%i.118 = phi i32 [ %inc8, %Search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %key, align 4, !tbaa !5
br label %for.body.i
for.cond.i: ; preds = %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.next.i
%5 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5
%cmp1.i.1 = icmp eq i32 %5, %4
br i1 %cmp1.i.1, label %if.then.i, label %for.cond.i.1
for.cond.i.1: ; preds = %for.cond.i
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.next.i.1
%6 = load i32, ptr %arrayidx.i.2, align 4, !tbaa !5
%cmp1.i.2 = icmp eq i32 %6, %4
br i1 %cmp1.i.2, label %if.then.i, label %for.cond.i.2
for.cond.i.2: ; preds = %for.cond.i.1
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.next.i.2
%7 = load i32, ptr %arrayidx.i.3, align 4, !tbaa !5
%cmp1.i.3 = icmp eq i32 %7, %4
br i1 %cmp1.i.3, label %if.then.i, label %for.cond.i.3
for.cond.i.3: ; preds = %for.cond.i.2
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%arrayidx.i.4 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.next.i.3
%8 = load i32, ptr %arrayidx.i.4, align 4, !tbaa !5
%cmp1.i.4 = icmp eq i32 %8, %4
br i1 %cmp1.i.4, label %if.then.i, label %for.cond.i.4
for.cond.i.4: ; preds = %for.cond.i.3
%indvars.iv.next.i.4 = add nuw nsw i64 %indvars.iv.i, 5
%exitcond.not.i.4 = icmp eq i64 %indvars.iv.next.i.4, 10000
br i1 %exitcond.not.i.4, label %Search.exit, label %for.body.i, !llvm.loop !11
for.body.i: ; preds = %for.cond.i.4, %for.body5
%indvars.iv.i = phi i64 [ 0, %for.body5 ], [ %indvars.iv.next.i.4, %for.cond.i.4 ]
%arrayidx.i = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %9, %4
br i1 %cmp1.i, label %if.then.i, label %for.cond.i
if.then.i: ; preds = %for.cond.i.3, %for.cond.i.2, %for.cond.i.1, %for.cond.i, %for.body.i
%10 = load i32, ptr @count, align 4, !tbaa !5
%inc.i = add nsw i32 %10, 1
store i32 %inc.i, ptr @count, align 4, !tbaa !5
br label %Search.exit
Search.exit: ; preds = %for.cond.i.4, %if.then.i
%inc8 = add nuw nsw i32 %i.118, 1
%11 = load i32, ptr %Tlength, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc8, %11
br i1 %cmp4, label %for.body5, label %for.end9, !llvm.loop !12
for.end9: ; preds = %Search.exit, %for.end
%12 = load i32, ptr @count, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Tlength) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Slength) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @Search(i32 noundef %key) local_unnamed_addr #3 {
entry:
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.next
%0 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp1.1 = icmp eq i32 %0, %key
br i1 %cmp1.1, label %if.then, label %for.cond.1
for.cond.1: ; preds = %for.cond
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.next.1
%1 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%cmp1.2 = icmp eq i32 %1, %key
br i1 %cmp1.2, label %if.then, label %for.cond.2
for.cond.2: ; preds = %for.cond.1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.next.2
%2 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp1.3 = icmp eq i32 %2, %key
br i1 %cmp1.3, label %if.then, label %for.cond.3
for.cond.3: ; preds = %for.cond.2
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%arrayidx.4 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv.next.3
%3 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%cmp1.4 = icmp eq i32 %3, %key
br i1 %cmp1.4, label %if.then, label %for.cond.4
for.cond.4: ; preds = %for.cond.3
%indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5
%exitcond.not.4 = icmp eq i64 %indvars.iv.next.4, 10000
br i1 %exitcond.not.4, label %for.end, label %for.body, !llvm.loop !11
for.body: ; preds = %for.cond.4, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.4, %for.cond.4 ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %4, %key
br i1 %cmp1, label %if.then, label %for.cond
if.then: ; preds = %for.cond.3, %for.cond.2, %for.cond.1, %for.cond, %for.body
%5 = load i32, ptr @count, align 4, !tbaa !5
%inc = add nsw i32 %5, 1
store i32 %inc, ptr @count, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.4, %if.then
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 search(int S[],int n,int key){
int i;
i=0;
S[n]=key;
while(S[i] != key)i++;
return i !=n;
}
int main(){
int i,n,q,cnt=0,key;
scanf("%d",&n);
int S[10000];
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&key);
if (search(S, n, key))cnt++;
}
printf("%d\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141641/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141641/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %S, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %S, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %S, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%key = alloca i32, align 4
%S = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%cnt.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %cnt.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%cnt.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
int *S;
int n;
int q;
int *T;
int i,j;
int jg=0;
scanf("%d",&n);
S=(int *)malloc(n*sizeof(int));
for(i=0;i<n;i++)scanf("%d",&S[i]);
scanf("%d",&q);
T=(int *)malloc(q*sizeof(int));
for(i=0;i<q;i++)scanf("%d",&T[i]);
for(j=0;j<q;j++){
for(i=0;i<n;i++){
if(S[i]==T[j]){
jg++;
break;
}
}
}
printf("%d\n",jg);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141685/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141685/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #5
%cmp53 = icmp sgt i32 %0, 0
br i1 %cmp53, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %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
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%conv5 = sext i32 %3 to i64
%mul6 = shl nsw i64 %conv5, 2
%call7 = call noalias ptr @malloc(i64 noundef %mul6) #5
%cmp955 = icmp sgt i32 %3, 0
br i1 %cmp955, label %for.body11, label %for.end38
for.cond18.preheader: ; preds = %for.body11
%cmp1959 = icmp sgt i32 %10, 0
br i1 %cmp1959, label %for.cond22.preheader.lr.ph, label %for.end38
for.cond22.preheader.lr.ph: ; preds = %for.cond18.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp2357 = icmp sgt i32 %4, 0
br i1 %cmp2357, label %for.cond22.preheader.us.preheader, label %for.end38
for.cond22.preheader.us.preheader: ; preds = %for.cond22.preheader.lr.ph
%wide.trip.count76 = zext i32 %10 to i64
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count76, 1
%5 = icmp eq i32 %10, 1
br i1 %5, label %for.end38.loopexit.unr-lcssa, label %for.cond22.preheader.us.preheader.new
for.cond22.preheader.us.preheader.new: ; preds = %for.cond22.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count76, 4294967294
br label %for.cond22.preheader.us
for.cond22.preheader.us: ; preds = %for.inc36.us.1, %for.cond22.preheader.us.preheader.new
%indvars.iv73 = phi i64 [ 0, %for.cond22.preheader.us.preheader.new ], [ %indvars.iv.next74.1, %for.inc36.us.1 ]
%jg.062.us = phi i32 [ 0, %for.cond22.preheader.us.preheader.new ], [ %jg.1.us.1, %for.inc36.us.1 ]
%niter = phi i64 [ 0, %for.cond22.preheader.us.preheader.new ], [ %niter.next.1, %for.inc36.us.1 ]
%arrayidx29.us = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv73
%6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5
br label %for.body25.us
for.cond22.us: ; preds = %for.body25.us
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count
br i1 %exitcond.not, label %for.inc36.us, label %for.body25.us, !llvm.loop !11
for.body25.us: ; preds = %for.cond22.preheader.us, %for.cond22.us
%indvars.iv70 = phi i64 [ 0, %for.cond22.preheader.us ], [ %indvars.iv.next71, %for.cond22.us ]
%arrayidx27.us = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv70
%7 = load i32, ptr %arrayidx27.us, align 4, !tbaa !5
%cmp30.us = icmp eq i32 %7, %6
br i1 %cmp30.us, label %if.then.us, label %for.cond22.us
if.then.us: ; preds = %for.body25.us
%inc32.us = add nsw i32 %jg.062.us, 1
br label %for.inc36.us
for.inc36.us: ; preds = %for.cond22.us, %if.then.us
%jg.1.us = phi i32 [ %inc32.us, %if.then.us ], [ %jg.062.us, %for.cond22.us ]
%indvars.iv.next74 = or i64 %indvars.iv73, 1
%arrayidx29.us.1 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv.next74
%8 = load i32, ptr %arrayidx29.us.1, align 4, !tbaa !5
br label %for.body25.us.1
for.body25.us.1: ; preds = %for.cond22.us.1, %for.inc36.us
%indvars.iv70.1 = phi i64 [ 0, %for.inc36.us ], [ %indvars.iv.next71.1, %for.cond22.us.1 ]
%arrayidx27.us.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv70.1
%9 = load i32, ptr %arrayidx27.us.1, align 4, !tbaa !5
%cmp30.us.1 = icmp eq i32 %9, %8
br i1 %cmp30.us.1, label %if.then.us.1, label %for.cond22.us.1
for.cond22.us.1: ; preds = %for.body25.us.1
%indvars.iv.next71.1 = add nuw nsw i64 %indvars.iv70.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next71.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc36.us.1, label %for.body25.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body25.us.1
%inc32.us.1 = add nsw i32 %jg.1.us, 1
br label %for.inc36.us.1
for.inc36.us.1: ; preds = %for.cond22.us.1, %if.then.us.1
%jg.1.us.1 = phi i32 [ %inc32.us.1, %if.then.us.1 ], [ %jg.1.us, %for.cond22.us.1 ]
%indvars.iv.next74.1 = add nuw nsw i64 %indvars.iv73, 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.end38.loopexit.unr-lcssa, label %for.cond22.preheader.us, !llvm.loop !12
for.body11: ; preds = %for.end, %for.body11
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body11 ], [ 0, %for.end ]
%arrayidx13 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv67
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx13)
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp9 = icmp slt i64 %indvars.iv.next68, %11
br i1 %cmp9, label %for.body11, label %for.cond18.preheader, !llvm.loop !13
for.end38.loopexit.unr-lcssa: ; preds = %for.inc36.us.1, %for.cond22.preheader.us.preheader
%jg.1.us.lcssa.ph = phi i32 [ undef, %for.cond22.preheader.us.preheader ], [ %jg.1.us.1, %for.inc36.us.1 ]
%indvars.iv73.unr = phi i64 [ 0, %for.cond22.preheader.us.preheader ], [ %indvars.iv.next74.1, %for.inc36.us.1 ]
%jg.062.us.unr = phi i32 [ 0, %for.cond22.preheader.us.preheader ], [ %jg.1.us.1, %for.inc36.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end38, label %for.cond22.preheader.us.epil
for.cond22.preheader.us.epil: ; preds = %for.end38.loopexit.unr-lcssa
%arrayidx29.us.epil = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv73.unr
%12 = load i32, ptr %arrayidx29.us.epil, align 4, !tbaa !5
br label %for.body25.us.epil
for.body25.us.epil: ; preds = %for.cond22.us.epil, %for.cond22.preheader.us.epil
%indvars.iv70.epil = phi i64 [ 0, %for.cond22.preheader.us.epil ], [ %indvars.iv.next71.epil, %for.cond22.us.epil ]
%arrayidx27.us.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv70.epil
%13 = load i32, ptr %arrayidx27.us.epil, align 4, !tbaa !5
%cmp30.us.epil = icmp eq i32 %13, %12
br i1 %cmp30.us.epil, label %if.then.us.epil, label %for.cond22.us.epil
for.cond22.us.epil: ; preds = %for.body25.us.epil
%indvars.iv.next71.epil = add nuw nsw i64 %indvars.iv70.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next71.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end38, label %for.body25.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body25.us.epil
%inc32.us.epil = add nsw i32 %jg.062.us.unr, 1
br label %for.end38
for.end38: ; preds = %for.end38.loopexit.unr-lcssa, %for.cond22.us.epil, %if.then.us.epil, %for.end, %for.cond22.preheader.lr.ph, %for.cond18.preheader
%jg.0.lcssa = phi i32 [ 0, %for.cond18.preheader ], [ 0, %for.cond22.preheader.lr.ph ], [ 0, %for.end ], [ %jg.1.us.lcssa.ph, %for.end38.loopexit.unr-lcssa ], [ %inc32.us.epil, %if.then.us.epil ], [ %jg.062.us.unr, %for.cond22.us.epil ]
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %jg.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int sensearch(int *,int,int);
int main()
{
int n,i,key,sum=0,q;
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++)
{
scanf("%d",&key);
if(sensearch(&a[0],n,key))sum++;
}
printf("%d\n",sum);
return 0;
}
int sensearch(int *a,int n,int key)
{
int i=0;
a[n]=key;
while(a[i]!=key)i++;
return i != n;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141728/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141728/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%key = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %3, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%6 = load i32, ptr %q, align 4, !tbaa !5
%cmp421 = icmp sgt i32 %6, 0
br i1 %cmp421, label %for.body5, label %for.end12
for.body5: ; preds = %for.end, %sensearch.exit
%i.123 = phi i32 [ %inc11, %sensearch.exit ], [ 0, %for.end ]
%sum.022 = phi i32 [ %spec.select, %sensearch.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %7 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom.i
store i32 %8, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %9, %8
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %sensearch.exit, label %while.cond.i, !llvm.loop !11
sensearch.exit: ; preds = %while.cond.i
%10 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %7, %10
%inc9 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc9
%inc11 = add nuw nsw i32 %i.123, 1
%11 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc11, %11
br i1 %cmp4, label %for.body5, label %for.end12, !llvm.loop !12
for.end12: ; preds = %sensearch.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %sensearch.exit ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @sensearch(ptr nocapture noundef %a, i32 noundef %n, i32 noundef %key) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 NOT_FOUND 0;
int linerSearch(int A[], int key, int n){
int i=0;
A[n] = key;
while(A[i] != key){
i++;
}
return i != n;
}
int main(void){
int n,i,q;
scanf("%d",&n);
int S[n];
for(i=0;i<n;i++){scanf("%d",&S[i]);}
scanf("%d\n",&q);
int T[q];
for(i=0;i<q;i++){scanf("%d",&T[i]);}
int k=0;
for(i=0; i<q; i++){
if(linerSearch(S,T[i],n)){
k++;
}
}
printf("%d\n",k);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141771/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141771/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @linerSearch(ptr nocapture noundef %A, i32 noundef %key, i32 noundef %n) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp33 = icmp sgt i32 %3, 0
br i1 %cmp33, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q)
%6 = load i32, ptr %q, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca i32, i64 %7, align 16
%cmp535 = icmp sgt i32 %6, 0
br i1 %cmp535, label %for.body6, label %for.end22
for.cond13.preheader: ; preds = %for.body6
%cmp1437 = icmp sgt i32 %10, 0
br i1 %cmp1437, label %for.body15.lr.ph, label %for.end22
for.body15.lr.ph: ; preds = %for.cond13.preheader
%8 = load i32, ptr %n, align 4, !tbaa !5
%idxprom.i = sext i32 %8 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom.i
%wide.trip.count = zext i32 %10 to i64
%xtraiter = and i64 %wide.trip.count, 1
%9 = icmp eq i32 %10, 1
br i1 %9, label %for.end22.loopexit.unr-lcssa, label %for.body15.lr.ph.new
for.body15.lr.ph.new: ; preds = %for.body15.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body15
for.body6: ; preds = %for.end, %for.body6
%indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv43
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp5 = icmp slt i64 %indvars.iv.next44, %11
br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !12
for.body15: ; preds = %linerSearch.exit.1, %for.body15.lr.ph.new
%indvars.iv46 = phi i64 [ 0, %for.body15.lr.ph.new ], [ %indvars.iv.next47.1, %linerSearch.exit.1 ]
%k.039 = phi i32 [ 0, %for.body15.lr.ph.new ], [ %spec.select.1, %linerSearch.exit.1 ]
%niter = phi i64 [ 0, %for.body15.lr.ph.new ], [ %niter.next.1, %linerSearch.exit.1 ]
%arrayidx17 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv46
%12 = load i32, ptr %arrayidx17, align 8, !tbaa !5
store i32 %12, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body15
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body15 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%13 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %13, %12
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %linerSearch.exit, label %while.cond.i, !llvm.loop !9
linerSearch.exit: ; preds = %while.cond.i
%14 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %8, %14
%inc19 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %k.039, %inc19
%indvars.iv.next47 = or i64 %indvars.iv46, 1
%arrayidx17.1 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv.next47
%15 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5
store i32 %15, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i.1
while.cond.i.1: ; preds = %while.cond.i.1, %linerSearch.exit
%indvars.iv.i.1 = phi i64 [ %indvars.iv.next.i.1, %while.cond.i.1 ], [ 0, %linerSearch.exit ]
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i.1
%16 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp.not.i.1 = icmp eq i32 %16, %15
%indvars.iv.next.i.1 = add nuw i64 %indvars.iv.i.1, 1
br i1 %cmp.not.i.1, label %linerSearch.exit.1, label %while.cond.i.1, !llvm.loop !9
linerSearch.exit.1: ; preds = %while.cond.i.1
%17 = trunc i64 %indvars.iv.i.1 to i32
%cmp3.i.not.1 = icmp ne i32 %8, %17
%inc19.1 = zext i1 %cmp3.i.not.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc19.1
%indvars.iv.next47.1 = add nuw nsw i64 %indvars.iv46, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end22.loopexit.unr-lcssa, label %for.body15, !llvm.loop !13
for.end22.loopexit.unr-lcssa: ; preds = %linerSearch.exit.1, %for.body15.lr.ph
%spec.select.lcssa.ph = phi i32 [ undef, %for.body15.lr.ph ], [ %spec.select.1, %linerSearch.exit.1 ]
%indvars.iv46.unr = phi i64 [ 0, %for.body15.lr.ph ], [ %indvars.iv.next47.1, %linerSearch.exit.1 ]
%k.039.unr = phi i32 [ 0, %for.body15.lr.ph ], [ %spec.select.1, %linerSearch.exit.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end22, label %for.body15.epil
for.body15.epil: ; preds = %for.end22.loopexit.unr-lcssa
%arrayidx17.epil = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv46.unr
%18 = load i32, ptr %arrayidx17.epil, align 4, !tbaa !5
store i32 %18, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i.epil
while.cond.i.epil: ; preds = %while.cond.i.epil, %for.body15.epil
%indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %while.cond.i.epil ], [ 0, %for.body15.epil ]
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i.epil
%19 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp.not.i.epil = icmp eq i32 %19, %18
%indvars.iv.next.i.epil = add nuw i64 %indvars.iv.i.epil, 1
br i1 %cmp.not.i.epil, label %linerSearch.exit.epil, label %while.cond.i.epil, !llvm.loop !9
linerSearch.exit.epil: ; preds = %while.cond.i.epil
%20 = trunc i64 %indvars.iv.i.epil to i32
%cmp3.i.not.epil = icmp ne i32 %8, %20
%inc19.epil = zext i1 %cmp3.i.not.epil to i32
%spec.select.epil = add nuw nsw i32 %k.039.unr, %inc19.epil
br label %for.end22
for.end22: ; preds = %linerSearch.exit.epil, %for.end22.loopexit.unr-lcssa, %for.end, %for.cond13.preheader
%k.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %for.end ], [ %spec.select.lcssa.ph, %for.end22.loopexit.unr-lcssa ], [ %spec.select.epil, %linerSearch.exit.epil ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
attributes #0 = { nofree norecurse nosync nounwind memory(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 nosync nounwind willreturn }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, q;
int s[11000], t[1000];
int i, j;
int ans=0;
scanf("%d", &n);
for(i=0; i<n; i++){
scanf("%d", &s[i]);
}
scanf("%d", &q);
for(i=0; i<q; i++){
scanf("%d", &t[i]);
}
for(i=0; i<q; i++){
for(j=0; j<n; j++){
if(s[j]==t[i]){
ans++;
break;
}
}
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141814/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141814/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%s = alloca [11000 x i32], align 16
%t = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.start.p0(i64 44000, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %0, 0
br i1 %cmp42, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [11000 x i32], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp444 = icmp sgt i32 %3, 0
br i1 %cmp444, label %for.body5, label %for.end29
for.cond12.preheader: ; preds = %for.body5
%cmp1348 = icmp sgt i32 %10, 0
br i1 %cmp1348, label %for.cond15.preheader.lr.ph, label %for.end29
for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1646 = icmp sgt i32 %4, 0
br i1 %cmp1646, label %for.cond15.preheader.us.preheader, label %for.end29
for.cond15.preheader.us.preheader: ; preds = %for.cond15.preheader.lr.ph
%wide.trip.count65 = zext i32 %10 to i64
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count65, 1
%5 = icmp eq i32 %10, 1
br i1 %5, label %for.end29.loopexit.unr-lcssa, label %for.cond15.preheader.us.preheader.new
for.cond15.preheader.us.preheader.new: ; preds = %for.cond15.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count65, 4294967294
br label %for.cond15.preheader.us
for.cond15.preheader.us: ; preds = %for.inc27.us.1, %for.cond15.preheader.us.preheader.new
%indvars.iv62 = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %indvars.iv.next63.1, %for.inc27.us.1 ]
%ans.051.us = phi i32 [ 0, %for.cond15.preheader.us.preheader.new ], [ %ans.1.us.1, %for.inc27.us.1 ]
%niter = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %niter.next.1, %for.inc27.us.1 ]
%arrayidx21.us = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv62
%6 = load i32, ptr %arrayidx21.us, align 8, !tbaa !5
br label %for.body17.us
for.cond15.us: ; preds = %for.body17.us
%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.inc27.us, label %for.body17.us, !llvm.loop !11
for.body17.us: ; preds = %for.cond15.preheader.us, %for.cond15.us
%indvars.iv59 = phi i64 [ 0, %for.cond15.preheader.us ], [ %indvars.iv.next60, %for.cond15.us ]
%arrayidx19.us = getelementptr inbounds [11000 x i32], ptr %s, i64 0, i64 %indvars.iv59
%7 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
%cmp22.us = icmp eq i32 %7, %6
br i1 %cmp22.us, label %if.then.us, label %for.cond15.us
if.then.us: ; preds = %for.body17.us
%inc23.us = add nsw i32 %ans.051.us, 1
br label %for.inc27.us
for.inc27.us: ; preds = %for.cond15.us, %if.then.us
%ans.1.us = phi i32 [ %inc23.us, %if.then.us ], [ %ans.051.us, %for.cond15.us ]
%indvars.iv.next63 = or i64 %indvars.iv62, 1
%arrayidx21.us.1 = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv.next63
%8 = load i32, ptr %arrayidx21.us.1, align 4, !tbaa !5
br label %for.body17.us.1
for.body17.us.1: ; preds = %for.cond15.us.1, %for.inc27.us
%indvars.iv59.1 = phi i64 [ 0, %for.inc27.us ], [ %indvars.iv.next60.1, %for.cond15.us.1 ]
%arrayidx19.us.1 = getelementptr inbounds [11000 x i32], ptr %s, i64 0, i64 %indvars.iv59.1
%9 = load i32, ptr %arrayidx19.us.1, align 4, !tbaa !5
%cmp22.us.1 = icmp eq i32 %9, %8
br i1 %cmp22.us.1, label %if.then.us.1, label %for.cond15.us.1
for.cond15.us.1: ; preds = %for.body17.us.1
%indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next60.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc27.us.1, label %for.body17.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body17.us.1
%inc23.us.1 = add nsw i32 %ans.1.us, 1
br label %for.inc27.us.1
for.inc27.us.1: ; preds = %for.cond15.us.1, %if.then.us.1
%ans.1.us.1 = phi i32 [ %inc23.us.1, %if.then.us.1 ], [ %ans.1.us, %for.cond15.us.1 ]
%indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 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.end29.loopexit.unr-lcssa, label %for.cond15.preheader.us, !llvm.loop !12
for.body5: ; preds = %for.end, %for.body5
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv56
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp4 = icmp slt i64 %indvars.iv.next57, %11
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end29.loopexit.unr-lcssa: ; preds = %for.inc27.us.1, %for.cond15.preheader.us.preheader
%ans.1.us.lcssa.ph = phi i32 [ undef, %for.cond15.preheader.us.preheader ], [ %ans.1.us.1, %for.inc27.us.1 ]
%indvars.iv62.unr = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvars.iv.next63.1, %for.inc27.us.1 ]
%ans.051.us.unr = phi i32 [ 0, %for.cond15.preheader.us.preheader ], [ %ans.1.us.1, %for.inc27.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29, label %for.cond15.preheader.us.epil
for.cond15.preheader.us.epil: ; preds = %for.end29.loopexit.unr-lcssa
%arrayidx21.us.epil = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv62.unr
%12 = load i32, ptr %arrayidx21.us.epil, align 4, !tbaa !5
br label %for.body17.us.epil
for.body17.us.epil: ; preds = %for.cond15.us.epil, %for.cond15.preheader.us.epil
%indvars.iv59.epil = phi i64 [ 0, %for.cond15.preheader.us.epil ], [ %indvars.iv.next60.epil, %for.cond15.us.epil ]
%arrayidx19.us.epil = getelementptr inbounds [11000 x i32], ptr %s, i64 0, i64 %indvars.iv59.epil
%13 = load i32, ptr %arrayidx19.us.epil, align 4, !tbaa !5
%cmp22.us.epil = icmp eq i32 %13, %12
br i1 %cmp22.us.epil, label %if.then.us.epil, label %for.cond15.us.epil
for.cond15.us.epil: ; preds = %for.body17.us.epil
%indvars.iv.next60.epil = add nuw nsw i64 %indvars.iv59.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next60.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end29, label %for.body17.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body17.us.epil
%inc23.us.epil = add nsw i32 %ans.051.us.unr, 1
br label %for.end29
for.end29: ; preds = %for.end29.loopexit.unr-lcssa, %for.cond15.us.epil, %if.then.us.epil, %for.end, %for.cond15.preheader.lr.ph, %for.cond12.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.cond15.preheader.lr.ph ], [ 0, %for.end ], [ %ans.1.us.lcssa.ph, %for.end29.loopexit.unr-lcssa ], [ %inc23.us.epil, %if.then.us.epil ], [ %ans.051.us.unr, %for.cond15.us.epil ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 44000, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void){
int n;
scanf("%d", &n);
int s[n];
for(int i=0; i<n; i++) scanf("%d", &s[i]);
int q;
scanf("%d", &q);
int t[q];
for(int i=0; i<q; i++) scanf("%d", &t[i]);
int cou=0;
for(int i=0; i<q; i++){
for(int j=0; j<n; j++){
if(t[i]==s[j]){
cou++;
break;
}
}
}
printf("%d\n", cou);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141858/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141858/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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
%cmp51 = icmp sgt i32 %3, 0
br i1 %cmp51, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%4 = load i32, ptr %q, align 4, !tbaa !5
%5 = zext i32 %4 to i64
%vla3 = alloca i32, i64 %5, align 16
%cmp653 = icmp sgt i32 %4, 0
br i1 %cmp653, label %for.body8, label %for.cond.cleanup18
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.cond.cleanup, !llvm.loop !9
for.cond16.preheader: ; preds = %for.body8
%cmp1757 = icmp sgt i32 %14, 0
br i1 %cmp1757, label %for.cond20.preheader.lr.ph, label %for.cond.cleanup18
for.cond20.preheader.lr.ph: ; preds = %for.cond16.preheader
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp2155 = icmp sgt i32 %8, 0
br i1 %cmp2155, label %for.cond20.preheader.us.preheader, label %for.cond.cleanup18
for.cond20.preheader.us.preheader: ; preds = %for.cond20.preheader.lr.ph
%wide.trip.count74 = zext i32 %14 to i64
%wide.trip.count = zext i32 %8 to i64
%xtraiter = and i64 %wide.trip.count74, 1
%9 = icmp eq i32 %14, 1
br i1 %9, label %for.cond.cleanup18.loopexit.unr-lcssa, label %for.cond20.preheader.us.preheader.new
for.cond20.preheader.us.preheader.new: ; preds = %for.cond20.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count74, 4294967294
br label %for.cond20.preheader.us
for.cond20.preheader.us: ; preds = %cleanup.us.1, %for.cond20.preheader.us.preheader.new
%indvars.iv71 = phi i64 [ 0, %for.cond20.preheader.us.preheader.new ], [ %indvars.iv.next72.1, %cleanup.us.1 ]
%cou.058.us = phi i32 [ 0, %for.cond20.preheader.us.preheader.new ], [ %cou.1.us.1, %cleanup.us.1 ]
%niter = phi i64 [ 0, %for.cond20.preheader.us.preheader.new ], [ %niter.next.1, %cleanup.us.1 ]
%arrayidx25.us = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv71
%10 = load i32, ptr %arrayidx25.us, align 8, !tbaa !5
br label %for.body23.us
for.cond20.us: ; preds = %for.body23.us
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count
br i1 %exitcond.not, label %cleanup.us, label %for.body23.us, !llvm.loop !11
for.body23.us: ; preds = %for.cond20.preheader.us, %for.cond20.us
%indvars.iv68 = phi i64 [ 0, %for.cond20.preheader.us ], [ %indvars.iv.next69, %for.cond20.us ]
%arrayidx27.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv68
%11 = load i32, ptr %arrayidx27.us, align 4, !tbaa !5
%cmp28.us = icmp eq i32 %10, %11
br i1 %cmp28.us, label %if.then.us, label %for.cond20.us
if.then.us: ; preds = %for.body23.us
%inc29.us = add nsw i32 %cou.058.us, 1
br label %cleanup.us
cleanup.us: ; preds = %for.cond20.us, %if.then.us
%cou.1.us = phi i32 [ %inc29.us, %if.then.us ], [ %cou.058.us, %for.cond20.us ]
%indvars.iv.next72 = or i64 %indvars.iv71, 1
%arrayidx25.us.1 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv.next72
%12 = load i32, ptr %arrayidx25.us.1, align 4, !tbaa !5
br label %for.body23.us.1
for.body23.us.1: ; preds = %for.cond20.us.1, %cleanup.us
%indvars.iv68.1 = phi i64 [ 0, %cleanup.us ], [ %indvars.iv.next69.1, %for.cond20.us.1 ]
%arrayidx27.us.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv68.1
%13 = load i32, ptr %arrayidx27.us.1, align 4, !tbaa !5
%cmp28.us.1 = icmp eq i32 %12, %13
br i1 %cmp28.us.1, label %if.then.us.1, label %for.cond20.us.1
for.cond20.us.1: ; preds = %for.body23.us.1
%indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next69.1, %wide.trip.count
br i1 %exitcond.not.1, label %cleanup.us.1, label %for.body23.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body23.us.1
%inc29.us.1 = add nsw i32 %cou.1.us, 1
br label %cleanup.us.1
cleanup.us.1: ; preds = %for.cond20.us.1, %if.then.us.1
%cou.1.us.1 = phi i32 [ %inc29.us.1, %if.then.us.1 ], [ %cou.1.us, %for.cond20.us.1 ]
%indvars.iv.next72.1 = add nuw nsw i64 %indvars.iv71, 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.cond20.preheader.us, !llvm.loop !12
for.body8: ; preds = %for.cond.cleanup, %for.body8
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.body8 ], [ 0, %for.cond.cleanup ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv65
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10)
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%14 = load i32, ptr %q, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp6 = icmp slt i64 %indvars.iv.next66, %15
br i1 %cmp6, label %for.body8, label %for.cond16.preheader, !llvm.loop !13
for.cond.cleanup18.loopexit.unr-lcssa: ; preds = %cleanup.us.1, %for.cond20.preheader.us.preheader
%cou.1.us.lcssa.ph = phi i32 [ undef, %for.cond20.preheader.us.preheader ], [ %cou.1.us.1, %cleanup.us.1 ]
%indvars.iv71.unr = phi i64 [ 0, %for.cond20.preheader.us.preheader ], [ %indvars.iv.next72.1, %cleanup.us.1 ]
%cou.058.us.unr = phi i32 [ 0, %for.cond20.preheader.us.preheader ], [ %cou.1.us.1, %cleanup.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup18, label %for.cond20.preheader.us.epil
for.cond20.preheader.us.epil: ; preds = %for.cond.cleanup18.loopexit.unr-lcssa
%arrayidx25.us.epil = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv71.unr
%16 = load i32, ptr %arrayidx25.us.epil, align 4, !tbaa !5
br label %for.body23.us.epil
for.body23.us.epil: ; preds = %for.cond20.us.epil, %for.cond20.preheader.us.epil
%indvars.iv68.epil = phi i64 [ 0, %for.cond20.preheader.us.epil ], [ %indvars.iv.next69.epil, %for.cond20.us.epil ]
%arrayidx27.us.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv68.epil
%17 = load i32, ptr %arrayidx27.us.epil, align 4, !tbaa !5
%cmp28.us.epil = icmp eq i32 %16, %17
br i1 %cmp28.us.epil, label %if.then.us.epil, label %for.cond20.us.epil
for.cond20.us.epil: ; preds = %for.body23.us.epil
%indvars.iv.next69.epil = add nuw nsw i64 %indvars.iv68.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next69.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.cond.cleanup18, label %for.body23.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body23.us.epil
%inc29.us.epil = add nsw i32 %cou.058.us.unr, 1
br label %for.cond.cleanup18
for.cond.cleanup18: ; preds = %for.cond.cleanup18.loopexit.unr-lcssa, %for.cond20.us.epil, %if.then.us.epil, %for.cond.cleanup, %for.cond20.preheader.lr.ph, %for.cond16.preheader
%cou.0.lcssa = phi i32 [ 0, %for.cond16.preheader ], [ 0, %for.cond20.preheader.lr.ph ], [ 0, %for.cond.cleanup ], [ %cou.1.us.lcssa.ph, %for.cond.cleanup18.loopexit.unr-lcssa ], [ %inc29.us.epil, %if.then.us.epil ], [ %cou.058.us.unr, %for.cond20.us.epil ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cou.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
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: 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 search(int A[], int a, int key);
int main(){
int i,j,k,key,sum=0,A[10000+1];
scanf("%d",&j);
for(i=0;i<j;i++){
scanf("%d",&A[i]);
}
scanf("%d",&k);
for(i=0;i<k;i++){
scanf("%d",&key);
if(search(A,j,key)){
sum++;
}
}
printf("%d\n",sum);
return 0;
}
int search(int A[], int a, int key){
int x=0;
A[a]=key;
while(A[x]!=key) x++;
return x!=a;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141900/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141900/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%j = alloca i32, align 4
%k = alloca i32, align 4
%key = alloca i32, align 4
%A = alloca [10001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j)
%0 = load i32, ptr %j, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 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 %j, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %j, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !11
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %k, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %a, i32 noundef %key) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %a to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %a
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 N 10000
int linsea(int key,int A[],int n);
int main(){
int a,b,c=0,i;
int S[N],T[N];
scanf("%d",&a);
for(i=0;i<a;i++)scanf("%d",&S[i]);
scanf("%d",&b);
for(i=0;i<b;i++)scanf("%d",&T[i]);
for(i=0;i<b;i++){
c+=linsea(T[i],S,a);
}
printf("%d\n",c);
}
int linsea(int key,int A[],int n){
int i=0;
A[n]=key;
while(key!=A[i]){
i++;
if(i==n)return 0;
}
return 1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141944/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141944/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%S = alloca [10000 x i32], align 16
%T = alloca [10000 x i32], align 16
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 40000, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp433 = icmp sgt i32 %3, 0
br i1 %cmp433, label %for.body5, label %for.end20
for.cond12.preheader: ; preds = %for.body5
%cmp1335 = icmp sgt i32 %7, 0
br i1 %cmp1335, label %for.body14.lr.ph, label %for.end20
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %a, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i
%5 = zext i32 %4 to i64
%wide.trip.count = zext i32 %7 to i64
%xtraiter = and i64 %wide.trip.count, 1
%6 = icmp eq i32 %7, 1
br i1 %6, label %for.end20.loopexit.unr-lcssa, label %for.body14.lr.ph.new
for.body14.lr.ph.new: ; preds = %for.body14.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body14
for.body5: ; preds = %for.end, %for.body5
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv41
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%7 = load i32, ptr %b, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next42, %8
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11
for.body14: ; preds = %linsea.exit.1, %for.body14.lr.ph.new
%indvars.iv44 = phi i64 [ 0, %for.body14.lr.ph.new ], [ %indvars.iv.next45.1, %linsea.exit.1 ]
%c.036 = phi i32 [ 0, %for.body14.lr.ph.new ], [ %add.1, %linsea.exit.1 ]
%niter = phi i64 [ 0, %for.body14.lr.ph.new ], [ %niter.next.1, %linsea.exit.1 ]
%arrayidx16 = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv44
%9 = load i32, ptr %arrayidx16, align 8, !tbaa !5
store i32 %9, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.body.i, %for.body14
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.body.i ], [ 0, %for.body14 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%10 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %10, %9
br i1 %cmp.not.i, label %linsea.exit, label %while.body.i
while.body.i: ; preds = %while.cond.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%cmp3.i = icmp eq i64 %indvars.iv.next.i, %5
br i1 %cmp3.i, label %linsea.exit, label %while.cond.i, !llvm.loop !12
linsea.exit: ; preds = %while.cond.i, %while.body.i
%retval.0.i = phi i32 [ 0, %while.body.i ], [ 1, %while.cond.i ]
%add = add nuw nsw i32 %retval.0.i, %c.036
%indvars.iv.next45 = or i64 %indvars.iv44, 1
%arrayidx16.1 = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv.next45
%11 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
store i32 %11, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i.1
while.cond.i.1: ; preds = %while.body.i.1, %linsea.exit
%indvars.iv.i.1 = phi i64 [ %indvars.iv.next.i.1, %while.body.i.1 ], [ 0, %linsea.exit ]
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.1
%12 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp.not.i.1 = icmp eq i32 %12, %11
br i1 %cmp.not.i.1, label %linsea.exit.1, label %while.body.i.1
while.body.i.1: ; preds = %while.cond.i.1
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i.1, 1
%cmp3.i.1 = icmp eq i64 %indvars.iv.next.i.1, %5
br i1 %cmp3.i.1, label %linsea.exit.1, label %while.cond.i.1, !llvm.loop !12
linsea.exit.1: ; preds = %while.body.i.1, %while.cond.i.1
%retval.0.i.1 = phi i32 [ 0, %while.body.i.1 ], [ 1, %while.cond.i.1 ]
%add.1 = add nuw nsw i32 %retval.0.i.1, %add
%indvars.iv.next45.1 = add nuw nsw i64 %indvars.iv44, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end20.loopexit.unr-lcssa, label %for.body14, !llvm.loop !13
for.end20.loopexit.unr-lcssa: ; preds = %linsea.exit.1, %for.body14.lr.ph
%add.lcssa.ph = phi i32 [ undef, %for.body14.lr.ph ], [ %add.1, %linsea.exit.1 ]
%indvars.iv44.unr = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next45.1, %linsea.exit.1 ]
%c.036.unr = phi i32 [ 0, %for.body14.lr.ph ], [ %add.1, %linsea.exit.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end20, label %for.body14.epil
for.body14.epil: ; preds = %for.end20.loopexit.unr-lcssa
%arrayidx16.epil = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv44.unr
%13 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
store i32 %13, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i.epil
while.cond.i.epil: ; preds = %while.body.i.epil, %for.body14.epil
%indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %while.body.i.epil ], [ 0, %for.body14.epil ]
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.epil
%14 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp.not.i.epil = icmp eq i32 %14, %13
br i1 %cmp.not.i.epil, label %linsea.exit.epil, label %while.body.i.epil
while.body.i.epil: ; preds = %while.cond.i.epil
%indvars.iv.next.i.epil = add nuw nsw i64 %indvars.iv.i.epil, 1
%cmp3.i.epil = icmp eq i64 %indvars.iv.next.i.epil, %5
br i1 %cmp3.i.epil, label %linsea.exit.epil, label %while.cond.i.epil, !llvm.loop !12
linsea.exit.epil: ; preds = %while.body.i.epil, %while.cond.i.epil
%retval.0.i.epil = phi i32 [ 0, %while.body.i.epil ], [ 1, %while.cond.i.epil ]
%add.epil = add nuw nsw i32 %retval.0.i.epil, %c.036.unr
br label %for.end20
for.end20: ; preds = %linsea.exit.epil, %for.end20.loopexit.unr-lcssa, %for.end, %for.cond12.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.end ], [ %add.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %add.epil, %linsea.exit.epil ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @linsea(i32 noundef %key, ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
%0 = zext i32 %n to i64
br label %while.cond
while.cond: ; preds = %while.body, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %1, %key
br i1 %cmp.not, label %cleanup, label %while.body
while.body: ; preds = %while.cond
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp3 = icmp eq i64 %indvars.iv.next, %0
br i1 %cmp3, label %cleanup, label %while.cond, !llvm.loop !12
cleanup: ; preds = %while.cond, %while.body
%retval.0 = phi i32 [ 0, %while.body ], [ 1, %while.cond ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 NMAX 10000
int linearSearch(int[], int, int);
int main(){
int S[NMAX], n, i, q, key;
int sum = 0;
scanf("%d", &n);
for(i = 0; i < n; i++)
scanf("%d", &S[i]);
scanf("%d", &q);
for(i = 0; i < q; i++){
scanf("%d", &key);
if (linearSearch(S, n, key))
sum++;
}
printf("%d\n", sum);
return 0;
}
int linearSearch(int S[], int n, int key){
int i = 0;
S[n] = key;
while(S[i] != key)
i++;
if(i == n)
return 0;
else return 1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141988/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141988/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [10000 x i32], align 16
%n = alloca i32, align 4
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %linearSearch.exit
%sum.022 = phi i32 [ %spec.select, %linearSearch.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %linearSearch.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %linearSearch.exit, label %while.cond.i, !llvm.loop !11
linearSearch.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %linearSearch.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %linearSearch.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @linearSearch(ptr nocapture noundef %S, i32 noundef %n, i32 noundef %key) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %S, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %S, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%. = zext i1 %cmp3 to i32
ret i32 %.
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 linearsearch(int *A, int key, int n)
{
int i = 0;
A[n] = key;
while(A[i] != key)
i++;
if (i==n) return 0;
else
return 1;
}
int main(void)
{
int n, q, i;
int S[10000];
int T[10000];
int count = 0;
scanf("%d", &n);
for(i = 0; i < n; i++) scanf("%d", &S[i]);
scanf("%d", &q);
for(i = 0; i < q; i++) scanf("%d", &T[i]);
for(i = 0; i < q; i++)
count = count + linearsearch(S, T[i], n);
printf("%d\n", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142037/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142037/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @linearsearch(ptr nocapture noundef %A, i32 noundef %key, i32 noundef %n) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%. = zext i1 %cmp3 to i32
ret i32 %.
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [10000 x i32], align 16
%T = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp433 = icmp sgt i32 %3, 0
br i1 %cmp433, label %for.body5, label %for.end20
for.cond12.preheader: ; preds = %for.body5
%cmp1335 = icmp sgt i32 %6, 0
br i1 %cmp1335, label %for.body14.lr.ph, label %for.end20
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i
%wide.trip.count = zext i32 %6 to i64
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %6, 1
br i1 %5, label %for.end20.loopexit.unr-lcssa, label %for.body14.lr.ph.new
for.body14.lr.ph.new: ; preds = %for.body14.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body14
for.body5: ; preds = %for.end, %for.body5
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv41
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%6 = load i32, ptr %q, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next42, %7
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !12
for.body14: ; preds = %linearsearch.exit.1, %for.body14.lr.ph.new
%indvars.iv44 = phi i64 [ 0, %for.body14.lr.ph.new ], [ %indvars.iv.next45.1, %linearsearch.exit.1 ]
%count.037 = phi i32 [ 0, %for.body14.lr.ph.new ], [ %add.1, %linearsearch.exit.1 ]
%niter = phi i64 [ 0, %for.body14.lr.ph.new ], [ %niter.next.1, %linearsearch.exit.1 ]
%arrayidx16 = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv44
%8 = load i32, ptr %arrayidx16, align 8, !tbaa !5
store i32 %8, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body14
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body14 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %9, %8
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %linearsearch.exit, label %while.cond.i, !llvm.loop !9
linearsearch.exit: ; preds = %while.cond.i
%10 = trunc i64 %indvars.iv.i to i32
%cmp3.i = icmp ne i32 %4, %10
%..i = zext i1 %cmp3.i to i32
%add = add nuw nsw i32 %count.037, %..i
%indvars.iv.next45 = or i64 %indvars.iv44, 1
%arrayidx16.1 = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv.next45
%11 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
store i32 %11, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i.1
while.cond.i.1: ; preds = %while.cond.i.1, %linearsearch.exit
%indvars.iv.i.1 = phi i64 [ %indvars.iv.next.i.1, %while.cond.i.1 ], [ 0, %linearsearch.exit ]
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.1
%12 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp.not.i.1 = icmp eq i32 %12, %11
%indvars.iv.next.i.1 = add nuw i64 %indvars.iv.i.1, 1
br i1 %cmp.not.i.1, label %linearsearch.exit.1, label %while.cond.i.1, !llvm.loop !9
linearsearch.exit.1: ; preds = %while.cond.i.1
%13 = trunc i64 %indvars.iv.i.1 to i32
%cmp3.i.1 = icmp ne i32 %4, %13
%..i.1 = zext i1 %cmp3.i.1 to i32
%add.1 = add nuw nsw i32 %add, %..i.1
%indvars.iv.next45.1 = add nuw nsw i64 %indvars.iv44, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end20.loopexit.unr-lcssa, label %for.body14, !llvm.loop !13
for.end20.loopexit.unr-lcssa: ; preds = %linearsearch.exit.1, %for.body14.lr.ph
%add.lcssa.ph = phi i32 [ undef, %for.body14.lr.ph ], [ %add.1, %linearsearch.exit.1 ]
%indvars.iv44.unr = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next45.1, %linearsearch.exit.1 ]
%count.037.unr = phi i32 [ 0, %for.body14.lr.ph ], [ %add.1, %linearsearch.exit.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end20, label %for.body14.epil
for.body14.epil: ; preds = %for.end20.loopexit.unr-lcssa
%arrayidx16.epil = getelementptr inbounds [10000 x i32], ptr %T, i64 0, i64 %indvars.iv44.unr
%14 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
store i32 %14, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i.epil
while.cond.i.epil: ; preds = %while.cond.i.epil, %for.body14.epil
%indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %while.cond.i.epil ], [ 0, %for.body14.epil ]
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.epil
%15 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp.not.i.epil = icmp eq i32 %15, %14
%indvars.iv.next.i.epil = add nuw i64 %indvars.iv.i.epil, 1
br i1 %cmp.not.i.epil, label %linearsearch.exit.epil, label %while.cond.i.epil, !llvm.loop !9
linearsearch.exit.epil: ; preds = %while.cond.i.epil
%16 = trunc i64 %indvars.iv.i.epil to i32
%cmp3.i.epil = icmp ne i32 %4, %16
%..i.epil = zext i1 %cmp3.i.epil to i32
%add.epil = add nuw nsw i32 %count.037.unr, %..i.epil
br label %for.end20
for.end20: ; preds = %linearsearch.exit.epil, %for.end20.loopexit.unr-lcssa, %for.end, %for.cond12.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.end ], [ %add.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %add.epil, %linearsearch.exit.epil ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int search(int A[], int n, int key) {
int i = 0;
A[n] = key;
while ( A[i] != key ) i++;
return i != n;
}
int main(){
int i, n, A[10000+1], q, key, sum = 0;
scanf("%d", &n);
for ( i = 0; i < n; i++ ) scanf("%d", &A[i]);
scanf("%d", &q);
for ( i = 0; i < q; i++ ){
scanf("%d", &key);
if ( search(A, n, key) ) sum++;
}
printf("%d\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142080/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142080/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; 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
%A = alloca [10001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 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 !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void)
{
int n,k;
scanf("%d %d",&n,&k);
int min=1;
int count=0;
while(count<n){
if(min*2<min+k){
min*=2;
}else{
min+=k;
}
count++;
}
printf("%d\n",min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142123/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142123/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, 0
br i1 %cmp10, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %k, align 4, !tbaa !5
%xtraiter = and i32 %0, 3
%2 = icmp ult i32 %0, 4
br i1 %2, label %while.end.loopexit.unr-lcssa, label %while.body.lr.ph.new
while.body.lr.ph.new: ; preds = %while.body.lr.ph
%unroll_iter = and i32 %0, -4
br label %while.body
while.body: ; preds = %while.body, %while.body.lr.ph.new
%min.011 = phi i32 [ 1, %while.body.lr.ph.new ], [ %mul.add.3, %while.body ]
%niter = phi i32 [ 0, %while.body.lr.ph.new ], [ %niter.next.3, %while.body ]
%mul = shl nsw i32 %min.011, 1
%add = add nsw i32 %1, %min.011
%mul.add = call i32 @llvm.smin.i32(i32 %mul, i32 %add)
%mul.1 = shl nsw i32 %mul.add, 1
%add.1 = add nsw i32 %1, %mul.add
%mul.add.1 = call i32 @llvm.smin.i32(i32 %mul.1, i32 %add.1)
%mul.2 = shl nsw i32 %mul.add.1, 1
%add.2 = add nsw i32 %1, %mul.add.1
%mul.add.2 = call i32 @llvm.smin.i32(i32 %mul.2, i32 %add.2)
%mul.3 = shl nsw i32 %mul.add.2, 1
%add.3 = add nsw i32 %1, %mul.add.2
%mul.add.3 = call i32 @llvm.smin.i32(i32 %mul.3, i32 %add.3)
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %while.end.loopexit.unr-lcssa, label %while.body, !llvm.loop !9
while.end.loopexit.unr-lcssa: ; preds = %while.body, %while.body.lr.ph
%mul.add.lcssa.ph = phi i32 [ undef, %while.body.lr.ph ], [ %mul.add.3, %while.body ]
%min.011.unr = phi i32 [ 1, %while.body.lr.ph ], [ %mul.add.3, %while.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.end, label %while.body.epil
while.body.epil: ; preds = %while.end.loopexit.unr-lcssa, %while.body.epil
%min.011.epil = phi i32 [ %mul.add.epil, %while.body.epil ], [ %min.011.unr, %while.end.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %while.body.epil ], [ 0, %while.end.loopexit.unr-lcssa ]
%mul.epil = shl nsw i32 %min.011.epil, 1
%add.epil = add nsw i32 %1, %min.011.epil
%mul.add.epil = call i32 @llvm.smin.i32(i32 %mul.epil, i32 %add.epil)
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %while.end, label %while.body.epil, !llvm.loop !11
while.end: ; preds = %while.end.loopexit.unr-lcssa, %while.body.epil, %entry
%min.0.lcssa = phi i32 [ 1, %entry ], [ %mul.add.lcssa.ph, %while.end.loopexit.unr-lcssa ], [ %mul.add.epil, %while.body.epil ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int main(){
int n, k;
scanf("%d", &n);
scanf("%d", &k);
int x = 1;
for(int i=0;i<n;i++){
if (x*2 < x+k)
x *= 2;
else
x += k;
}
printf("%d\n", x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142167/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142167/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %k, align 4, !tbaa !5
%xtraiter = and i32 %0, 3
%2 = icmp ult i32 %0, 4
br i1 %2, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %0, -4
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.add.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %mul.add.3, %for.body ]
%x.012.unr = phi i32 [ 1, %for.body.lr.ph ], [ %mul.add.3, %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
%x.012.epil = phi i32 [ %mul.add.epil, %for.body.epil ], [ %x.012.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 i32 %x.012.epil, 1
%add.epil = add nsw i32 %1, %x.012.epil
%mul.add.epil = call i32 @llvm.smin.i32(i32 %mul.epil, i32 %add.epil)
%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, %entry
%x.0.lcssa = phi i32 [ 1, %entry ], [ %mul.add.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.add.epil, %for.body.epil ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %for.body, %for.body.lr.ph.new
%x.012 = phi i32 [ 1, %for.body.lr.ph.new ], [ %mul.add.3, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%mul = shl nsw i32 %x.012, 1
%add = add nsw i32 %1, %x.012
%mul.add = call i32 @llvm.smin.i32(i32 %mul, i32 %add)
%mul.1 = shl nsw i32 %mul.add, 1
%add.1 = add nsw i32 %1, %mul.add
%mul.add.1 = call i32 @llvm.smin.i32(i32 %mul.1, i32 %add.1)
%mul.2 = shl nsw i32 %mul.add.1, 1
%add.2 = add nsw i32 %1, %mul.add.1
%mul.add.2 = call i32 @llvm.smin.i32(i32 %mul.2, i32 %add.2)
%mul.3 = shl nsw i32 %mul.add.2, 1
%add.3 = add nsw i32 %1, %mul.add.2
%mul.add.3 = call i32 @llvm.smin.i32(i32 %mul.3, i32 %add.3)
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
// Anton and Digits
#include<stdio.h>
int main(void)
{
int k2,k3,k5,k6,sum,x;
scanf("%d %d %d %d",&k2,&k3,&k5,&k6);
if((k2<=k5)&&(k2<=k6))
{
sum = 256*k2;
printf("%d\n",sum);
}
else if((k5<=k2)&&(k5<=k6))
{
sum = 256*k5;
if((k2-k5)==k3)
{
printf("%d\n",sum+32*(k2-k5));
}
else if((k2-k5)>k3)
{
printf("%d\n",sum+32*k3);
}
else if((k2-k5)<k3)
{
printf("%d\n",sum+32*(k2-k5));
}
}
else if((k6<=k2)&&(k6<=k5))
{
sum = 256*k6;
if((k2-k6)==k3)
{
printf("%d\n",sum+32*(k2-k6));
}
else if((k2-k6)>k3)
{
printf("%d\n",sum+32*k3);
}
else if((k2-k6)<k3)
{
printf("%d\n",sum+32*(k2-k6));
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14221/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14221/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%k2 = alloca i32, align 4
%k3 = alloca i32, align 4
%k5 = alloca i32, align 4
%k6 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k3) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k5) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k6) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k2, ptr noundef nonnull %k3, ptr noundef nonnull %k5, ptr noundef nonnull %k6)
%0 = load i32, ptr %k2, align 4, !tbaa !5
%1 = load i32, ptr %k5, align 4
%cmp.not = icmp sgt i32 %0, %1
%2 = load i32, ptr %k6, align 4
%cmp1.not = icmp sgt i32 %0, %2
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %entry
%mul = shl nsw i32 %0, 8
br label %if.end63.sink.split
if.else: ; preds = %entry
%cmp3.not = icmp sgt i32 %1, %0
%cmp5.not = icmp sgt i32 %1, %2
%or.cond76 = select i1 %cmp3.not, i1 true, i1 %cmp5.not
br i1 %or.cond76, label %if.else30, label %if.then6
if.then6: ; preds = %if.else
%mul7 = shl nsw i32 %1, 8
%sub = sub nsw i32 %0, %1
%3 = load i32, ptr %k3, align 4, !tbaa !5
%cmp8 = icmp eq i32 %sub, %3
br i1 %cmp8, label %if.then9, label %if.else13
if.then9: ; preds = %if.then6
%mul11 = shl nsw i32 %sub, 5
%add = add nsw i32 %mul11, %mul7
br label %if.end63.sink.split
if.else13: ; preds = %if.then6
%cmp15 = icmp sgt i32 %sub, %3
br i1 %cmp15, label %if.then16, label %if.else20
if.then16: ; preds = %if.else13
%mul17 = shl nsw i32 %3, 5
%add18 = add nsw i32 %mul17, %mul7
br label %if.end63.sink.split
if.else20: ; preds = %if.else13
%cmp22 = icmp slt i32 %sub, %3
br i1 %cmp22, label %if.then23, label %if.end63
if.then23: ; preds = %if.else20
%mul25 = shl nsw i32 %sub, 5
%add26 = add nsw i32 %mul25, %mul7
br label %if.end63.sink.split
if.else30: ; preds = %if.else
%cmp31.not = icmp sgt i32 %2, %0
%cmp33.not = icmp sgt i32 %2, %1
%or.cond77 = or i1 %cmp31.not, %cmp33.not
br i1 %or.cond77, label %if.end63, label %if.then34
if.then34: ; preds = %if.else30
%mul35 = shl nsw i32 %2, 8
%sub36 = sub nsw i32 %0, %2
%4 = load i32, ptr %k3, align 4, !tbaa !5
%cmp37 = icmp eq i32 %sub36, %4
br i1 %cmp37, label %if.then38, label %if.else43
if.then38: ; preds = %if.then34
%mul40 = shl nsw i32 %sub36, 5
%add41 = add nsw i32 %mul40, %mul35
br label %if.end63.sink.split
if.else43: ; preds = %if.then34
%cmp45 = icmp sgt i32 %sub36, %4
br i1 %cmp45, label %if.then46, label %if.else50
if.then46: ; preds = %if.else43
%mul47 = shl nsw i32 %4, 5
%add48 = add nsw i32 %mul47, %mul35
br label %if.end63.sink.split
if.else50: ; preds = %if.else43
%cmp52 = icmp slt i32 %sub36, %4
br i1 %cmp52, label %if.then53, label %if.end63
if.then53: ; preds = %if.else50
%mul55 = shl nsw i32 %sub36, 5
%add56 = add nsw i32 %mul55, %mul35
br label %if.end63.sink.split
if.end63.sink.split: ; preds = %if.then, %if.then46, %if.then53, %if.then38, %if.then9, %if.then23, %if.then16
%add18.sink = phi i32 [ %add18, %if.then16 ], [ %add26, %if.then23 ], [ %add, %if.then9 ], [ %add41, %if.then38 ], [ %add56, %if.then53 ], [ %add48, %if.then46 ], [ %mul, %if.then ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add18.sink)
br label %if.end63
if.end63: ; preds = %if.end63.sink.split, %if.else20, %if.else50, %if.else30
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k6) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k5) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k3) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k2) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,a1=1,b,sum=0,i,c;
scanf("%d %d",&a,&b);
for(i=1;i<=a;i++)
{
if(a1<b){
a1=a1*2;
}
else
a1=a1+b;
}
printf("%d\n",a1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142260/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142260/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp.not7 = icmp slt i32 %0, 1
br i1 %cmp.not7, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %b, align 4, !tbaa !5
%xtraiter = and i32 %0, 3
%2 = icmp ult i32 %0, 4
br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %0, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%a1.09 = phi i32 [ 1, %for.body.lr.ph.new ], [ %a1.1.3, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%cmp1 = icmp slt i32 %a1.09, %1
%mul = shl nsw i32 %a1.09, 1
%add = add nsw i32 %1, %a1.09
%a1.1 = select i1 %cmp1, i32 %mul, i32 %add
%cmp1.1 = icmp slt i32 %a1.1, %1
%mul.1 = shl nsw i32 %a1.1, 1
%add.1 = add nsw i32 %1, %a1.1
%a1.1.1 = select i1 %cmp1.1, i32 %mul.1, i32 %add.1
%cmp1.2 = icmp slt i32 %a1.1.1, %1
%mul.2 = shl nsw i32 %a1.1.1, 1
%add.2 = add nsw i32 %1, %a1.1.1
%a1.1.2 = select i1 %cmp1.2, i32 %mul.2, i32 %add.2
%cmp1.3 = icmp slt i32 %a1.1.2, %1
%mul.3 = shl nsw i32 %a1.1.2, 1
%add.3 = add nsw i32 %1, %a1.1.2
%a1.1.3 = select i1 %cmp1.3, i32 %mul.3, i32 %add.3
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%a1.1.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %a1.1.3, %for.body ]
%a1.09.unr = phi i32 [ 1, %for.body.lr.ph ], [ %a1.1.3, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%a1.09.epil = phi i32 [ %a1.1.epil, %for.body.epil ], [ %a1.09.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%cmp1.epil = icmp slt i32 %a1.09.epil, %1
%mul.epil = shl nsw i32 %a1.09.epil, 1
%add.epil = add nsw i32 %1, %a1.09.epil
%a1.1.epil = select i1 %cmp1.epil, i32 %mul.epil, i32 %add.epil
%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.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%a1.0.lcssa = phi i32 [ 1, %entry ], [ %a1.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %a1.1.epil, %for.body.epil ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a1.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int main() {
int N,K,s,i;
s=1;
scanf("%d",&N);
scanf("%d",&K);
for (i=0;i<N;i++) {
if (s<K) s=s*2;
else s=s+K;
}
printf("%d\n",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142310/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142310/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %K, align 4, !tbaa !5
%xtraiter = and i32 %0, 3
%2 = icmp ult i32 %0, 4
br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %0, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%s.09 = phi i32 [ 1, %for.body.lr.ph.new ], [ %s.1.3, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%cmp2 = icmp slt i32 %s.09, %1
%mul = shl nsw i32 %s.09, 1
%add = add nsw i32 %1, %s.09
%s.1 = select i1 %cmp2, i32 %mul, i32 %add
%cmp2.1 = icmp slt i32 %s.1, %1
%mul.1 = shl nsw i32 %s.1, 1
%add.1 = add nsw i32 %1, %s.1
%s.1.1 = select i1 %cmp2.1, i32 %mul.1, i32 %add.1
%cmp2.2 = icmp slt i32 %s.1.1, %1
%mul.2 = shl nsw i32 %s.1.1, 1
%add.2 = add nsw i32 %1, %s.1.1
%s.1.2 = select i1 %cmp2.2, i32 %mul.2, i32 %add.2
%cmp2.3 = icmp slt i32 %s.1.2, %1
%mul.3 = shl nsw i32 %s.1.2, 1
%add.3 = add nsw i32 %1, %s.1.2
%s.1.3 = select i1 %cmp2.3, i32 %mul.3, i32 %add.3
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%s.1.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %s.1.3, %for.body ]
%s.09.unr = phi i32 [ 1, %for.body.lr.ph ], [ %s.1.3, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%s.09.epil = phi i32 [ %s.1.epil, %for.body.epil ], [ %s.09.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%cmp2.epil = icmp slt i32 %s.09.epil, %1
%mul.epil = shl nsw i32 %s.09.epil, 1
%add.epil = add nsw i32 %1, %s.09.epil
%s.1.epil = select i1 %cmp2.epil, i32 %mul.epil, i32 %add.epil
%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.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%s.0.lcssa = phi i32 [ 1, %entry ], [ %s.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %s.1.epil, %for.body.epil ]
%call3 = 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 %K) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int a[100*1000];
int ans_x[100*1000];
int ans_y[100*1000];
int ans_n = 0;
int main( int argc , char *argv[] )
{
int n;
int sum = 0;
int min = 10001;
int max = -10001;
int min_n;
int max_n;
int tmp;
int tmp2;
int i;
scanf( "%d\n" , &n );
for( i = 0 ; i < n-1 ; i++ ) {
scanf( "%d " , &(a[i]) );
}
scanf( "%d\n" , &(a[n-1]) );
for( i = 0 ; i < n ; i++ ) {
if( max < a[i] ) {
max = a[i];
max_n = i;
}
if( min > a[i] ) {
min = a[i];
min_n = i;
}
}
if( max_n == min_n ) {
min = 10001;
for( i = 0 ; i < n ; i++ ) {
if( min > a[i] && i != max_n ) {
min = a[i];
min_n = i;
}
}
}
sum = max;
tmp = max;
for( i = 0 ; i < n ; i++ ) {
if( i != max_n && i != min_n && a[i] < 0 ) {
ans_x[ans_n] = tmp;
ans_y[ans_n] = a[i];
ans_n++;
tmp = tmp - a[i];
sum -= a[i];
}
}
sum += -min;
tmp2 = min;
for( i = 0 ; i < n ; i++ ) {
if( i != max_n && i != min_n && a[i] >= 0 ) {
ans_x[ans_n] = tmp2;
ans_y[ans_n] = a[i];
ans_n++;
tmp2 = tmp2 - a[i];
sum += a[i];
}
}
ans_x[ans_n] = tmp;
ans_y[ans_n] = tmp2;
ans_n++;
printf( "%d\n" , sum );
for( i = 0 ; i < ans_n ; i++ ) {
printf( "%d %d\n" , ans_x[i] , ans_y[i] );
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142354/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142354/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@ans_n = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@a = dso_local global [100000 x i32] zeroinitializer, align 16
@ans_x = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@ans_y = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%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
%cmp174 = icmp sgt i32 %0, 1
br i1 %cmp174, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%sub173 = add nsw i32 %0, -1
%.pre = sext i32 %sub173 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%2 = sext i32 %sub 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
%idxprom3.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
%arrayidx4 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom3.pre-phi
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx4)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp7176 = icmp sgt i32 %3, 0
br i1 %cmp7176, label %for.body8.preheader, label %if.end40.thread
for.body8.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%4 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %for.end23.unr-lcssa, label %for.body8.preheader.new
for.body8.preheader.new: ; preds = %for.body8.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body8
for.body8: ; preds = %for.body8, %for.body8.preheader.new
%indvars.iv216 = phi i64 [ 0, %for.body8.preheader.new ], [ %indvars.iv.next217.1, %for.body8 ]
%max_n.0180 = phi i32 [ undef, %for.body8.preheader.new ], [ %spec.select170.1, %for.body8 ]
%min_n.0179 = phi i32 [ undef, %for.body8.preheader.new ], [ %min_n.1.1, %for.body8 ]
%max.0178 = phi i32 [ -10001, %for.body8.preheader.new ], [ %spec.select.1, %for.body8 ]
%min.0177 = phi i32 [ 10001, %for.body8.preheader.new ], [ %min.1.1, %for.body8 ]
%niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.body8 ]
%arrayidx10 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv216
%6 = load i32, ptr %arrayidx10, align 8, !tbaa !5
%cmp11 = icmp slt i32 %max.0178, %6
%spec.select = call i32 @llvm.smax.i32(i32 %max.0178, i32 %6)
%7 = trunc i64 %indvars.iv216 to i32
%spec.select170 = select i1 %cmp11, i32 %7, i32 %max_n.0180
%cmp16 = icmp sgt i32 %min.0177, %6
%min.1 = call i32 @llvm.smin.i32(i32 %min.0177, i32 %6)
%min_n.1 = select i1 %cmp16, i32 %7, i32 %min_n.0179
%indvars.iv.next217 = or i64 %indvars.iv216, 1
%arrayidx10.1 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next217
%8 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.1 = icmp slt i32 %spec.select, %8
%spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %8)
%9 = trunc i64 %indvars.iv.next217 to i32
%spec.select170.1 = select i1 %cmp11.1, i32 %9, i32 %spec.select170
%cmp16.1 = icmp sgt i32 %min.1, %8
%min.1.1 = call i32 @llvm.smin.i32(i32 %min.1, i32 %8)
%min_n.1.1 = select i1 %cmp16.1, i32 %9, i32 %min_n.1
%indvars.iv.next217.1 = add nuw nsw i64 %indvars.iv216, 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.unr-lcssa, label %for.body8, !llvm.loop !11
for.end23.unr-lcssa: ; preds = %for.body8, %for.body8.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %spec.select.1, %for.body8 ]
%min.1.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %min.1.1, %for.body8 ]
%indvars.iv216.unr = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next217.1, %for.body8 ]
%max_n.0180.unr = phi i32 [ undef, %for.body8.preheader ], [ %spec.select170.1, %for.body8 ]
%min_n.0179.unr = phi i32 [ undef, %for.body8.preheader ], [ %min_n.1.1, %for.body8 ]
%max.0178.unr = phi i32 [ -10001, %for.body8.preheader ], [ %spec.select.1, %for.body8 ]
%min.0177.unr = phi i32 [ 10001, %for.body8.preheader ], [ %min.1.1, %for.body8 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end23, label %for.body8.epil
for.body8.epil: ; preds = %for.end23.unr-lcssa
%arrayidx10.epil = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv216.unr
%10 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5
%cmp11.epil = icmp slt i32 %max.0178.unr, %10
%spec.select.epil = call i32 @llvm.smax.i32(i32 %max.0178.unr, i32 %10)
%11 = trunc i64 %indvars.iv216.unr to i32
%spec.select170.epil = select i1 %cmp11.epil, i32 %11, i32 %max_n.0180.unr
%cmp16.epil = icmp sgt i32 %min.0177.unr, %10
%min.1.epil = call i32 @llvm.smin.i32(i32 %min.0177.unr, i32 %10)
%min_n.1.epil = select i1 %cmp16.epil, i32 %11, i32 %min_n.0179.unr
br label %for.end23
for.end23: ; preds = %for.end23.unr-lcssa, %for.body8.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end23.unr-lcssa ], [ %spec.select.epil, %for.body8.epil ]
%spec.select170.lcssa = phi i32 [ %max_n.0180.unr, %for.end23.unr-lcssa ], [ %spec.select170.epil, %for.body8.epil ]
%min.1.lcssa = phi i32 [ %min.1.lcssa.ph, %for.end23.unr-lcssa ], [ %min.1.epil, %for.body8.epil ]
%min_n.1.lcssa = phi i32 [ %min_n.0179.unr, %for.end23.unr-lcssa ], [ %min_n.1.epil, %for.body8.epil ]
%cmp24 = icmp eq i32 %spec.select170.lcssa, %min_n.1.lcssa
br i1 %cmp24, label %for.cond26.preheader, label %if.end40
for.cond26.preheader: ; preds = %for.end23
br i1 %cmp7176, label %for.body28.preheader, label %if.end40.thread
for.body28.preheader: ; preds = %for.cond26.preheader
%12 = zext i32 %min_n.1.lcssa to i64
%xtraiter271 = and i64 %wide.trip.count, 1
%13 = icmp eq i64 %4, 0
br i1 %13, label %if.end40.loopexit.unr-lcssa, label %for.body28.preheader.new
for.body28.preheader.new: ; preds = %for.body28.preheader
%unroll_iter275 = and i64 %wide.trip.count, 4294967294
br label %for.body28
for.body28: ; preds = %for.body28, %for.body28.preheader.new
%indvars.iv219 = phi i64 [ 0, %for.body28.preheader.new ], [ %indvars.iv.next220.1, %for.body28 ]
%min_n.2189 = phi i32 [ %min_n.1.lcssa, %for.body28.preheader.new ], [ %min_n.3.1, %for.body28 ]
%min.2188 = phi i32 [ 10001, %for.body28.preheader.new ], [ %min.3.1, %for.body28 ]
%niter276 = phi i64 [ 0, %for.body28.preheader.new ], [ %niter276.next.1, %for.body28 ]
%arrayidx30 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv219
%14 = load i32, ptr %arrayidx30, align 8, !tbaa !5
%cmp31 = icmp sle i32 %min.2188, %14
%cmp32.not = icmp eq i64 %indvars.iv219, %12
%or.cond = or i1 %cmp31, %cmp32.not
%min.3 = select i1 %or.cond, i32 %min.2188, i32 %14
%15 = trunc i64 %indvars.iv219 to i32
%min_n.3 = select i1 %or.cond, i32 %min_n.2189, i32 %15
%indvars.iv.next220 = or i64 %indvars.iv219, 1
%arrayidx30.1 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next220
%16 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5
%cmp31.1 = icmp sle i32 %min.3, %16
%cmp32.not.1 = icmp eq i64 %indvars.iv.next220, %12
%or.cond.1 = or i1 %cmp31.1, %cmp32.not.1
%min.3.1 = select i1 %or.cond.1, i32 %min.3, i32 %16
%17 = trunc i64 %indvars.iv.next220 to i32
%min_n.3.1 = select i1 %or.cond.1, i32 %min_n.3, i32 %17
%indvars.iv.next220.1 = add nuw nsw i64 %indvars.iv219, 2
%niter276.next.1 = add i64 %niter276, 2
%niter276.ncmp.1 = icmp eq i64 %niter276.next.1, %unroll_iter275
br i1 %niter276.ncmp.1, label %if.end40.loopexit.unr-lcssa, label %for.body28, !llvm.loop !12
if.end40.thread: ; preds = %for.cond26.preheader, %for.end
%max.0.lcssa243.ph = phi i32 [ %spec.select.lcssa, %for.cond26.preheader ], [ -10001, %for.end ]
%ans_n.promoted255 = load i32, ptr @ans_n, align 4, !tbaa !5
br label %for.end68.thread
if.end40.loopexit.unr-lcssa: ; preds = %for.body28, %for.body28.preheader
%min.3.lcssa.ph = phi i32 [ undef, %for.body28.preheader ], [ %min.3.1, %for.body28 ]
%min_n.3.lcssa.ph = phi i32 [ undef, %for.body28.preheader ], [ %min_n.3.1, %for.body28 ]
%indvars.iv219.unr = phi i64 [ 0, %for.body28.preheader ], [ %indvars.iv.next220.1, %for.body28 ]
%min_n.2189.unr = phi i32 [ %min_n.1.lcssa, %for.body28.preheader ], [ %min_n.3.1, %for.body28 ]
%min.2188.unr = phi i32 [ 10001, %for.body28.preheader ], [ %min.3.1, %for.body28 ]
%lcmp.mod272.not = icmp eq i64 %xtraiter271, 0
br i1 %lcmp.mod272.not, label %if.end40, label %for.body28.epil
for.body28.epil: ; preds = %if.end40.loopexit.unr-lcssa
%arrayidx30.epil = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv219.unr
%18 = load i32, ptr %arrayidx30.epil, align 4, !tbaa !5
%cmp31.epil = icmp sle i32 %min.2188.unr, %18
%cmp32.not.epil = icmp eq i64 %indvars.iv219.unr, %12
%or.cond.epil = or i1 %cmp31.epil, %cmp32.not.epil
%min.3.epil = select i1 %or.cond.epil, i32 %min.2188.unr, i32 %18
%19 = trunc i64 %indvars.iv219.unr to i32
%min_n.3.epil = select i1 %or.cond.epil, i32 %min_n.2189.unr, i32 %19
br label %if.end40
if.end40: ; preds = %for.body28.epil, %if.end40.loopexit.unr-lcssa, %for.end23
%min.4 = phi i32 [ %min.1.lcssa, %for.end23 ], [ %min.3.lcssa.ph, %if.end40.loopexit.unr-lcssa ], [ %min.3.epil, %for.body28.epil ]
%min_n.4 = phi i32 [ %min_n.1.lcssa, %for.end23 ], [ %min_n.3.lcssa.ph, %if.end40.loopexit.unr-lcssa ], [ %min_n.3.epil, %for.body28.epil ]
%ans_n.promoted = load i32, ptr @ans_n, align 4, !tbaa !5
br i1 %cmp7176, label %for.body43.preheader, label %for.end68.thread
for.body43.preheader: ; preds = %if.end40
%20 = zext i32 %min_n.4 to i64
%21 = zext i32 %spec.select170.lcssa to i64
%wide.trip.count227 = zext i32 %3 to i64
br label %for.body43
for.body43: ; preds = %for.body43.preheader, %for.inc66
%indvars.iv224 = phi i64 [ 0, %for.body43.preheader ], [ %indvars.iv.next225, %for.inc66 ]
%tmp.0198 = phi i32 [ %spec.select.lcssa, %for.body43.preheader ], [ %tmp.1, %for.inc66 ]
%sum.0197 = phi i32 [ %spec.select.lcssa, %for.body43.preheader ], [ %sum.1, %for.inc66 ]
%inc58194196 = phi i32 [ %ans_n.promoted, %for.body43.preheader ], [ %inc58193, %for.inc66 ]
%cmp44.not = icmp eq i64 %indvars.iv224, %21
%cmp46.not = icmp eq i64 %indvars.iv224, %20
%or.cond171 = select i1 %cmp44.not, i1 true, i1 %cmp46.not
br i1 %or.cond171, label %for.inc66, label %land.lhs.true47
land.lhs.true47: ; preds = %for.body43
%arrayidx49 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv224
%22 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%cmp50 = icmp slt i32 %22, 0
br i1 %cmp50, label %if.then51, label %for.inc66
if.then51: ; preds = %land.lhs.true47
%idxprom52 = sext i32 %inc58194196 to i64
%arrayidx53 = getelementptr inbounds [100000 x i32], ptr @ans_x, i64 0, i64 %idxprom52
store i32 %tmp.0198, ptr %arrayidx53, align 4, !tbaa !5
%arrayidx57 = getelementptr inbounds [100000 x i32], ptr @ans_y, i64 0, i64 %idxprom52
store i32 %22, ptr %arrayidx57, align 4, !tbaa !5
%inc58 = add nsw i32 %inc58194196, 1
%sub61 = sub nsw i32 %tmp.0198, %22
%sub64 = sub nsw i32 %sum.0197, %22
br label %for.inc66
for.inc66: ; preds = %for.body43, %land.lhs.true47, %if.then51
%inc58193 = phi i32 [ %inc58, %if.then51 ], [ %inc58194196, %land.lhs.true47 ], [ %inc58194196, %for.body43 ]
%sum.1 = phi i32 [ %sub64, %if.then51 ], [ %sum.0197, %land.lhs.true47 ], [ %sum.0197, %for.body43 ]
%tmp.1 = phi i32 [ %sub61, %if.then51 ], [ %tmp.0198, %land.lhs.true47 ], [ %tmp.0198, %for.body43 ]
%indvars.iv.next225 = add nuw nsw i64 %indvars.iv224, 1
%exitcond228.not = icmp eq i64 %indvars.iv.next225, %wide.trip.count227
br i1 %exitcond228.not, label %for.end68, label %for.body43, !llvm.loop !13
for.end68.thread: ; preds = %if.end40.thread, %if.end40
%min.4257.ph = phi i32 [ 10001, %if.end40.thread ], [ %min.4, %if.end40 ]
%ans_n.promoted202.ph = phi i32 [ %ans_n.promoted255, %if.end40.thread ], [ %ans_n.promoted, %if.end40 ]
%sum.0.lcssa.ph = phi i32 [ %max.0.lcssa243.ph, %if.end40.thread ], [ %spec.select.lcssa, %if.end40 ]
%add265 = sub i32 %sum.0.lcssa.ph, %min.4257.ph
br label %for.end97
for.end68: ; preds = %for.inc66
%add = sub i32 %sum.1, %min.4
br i1 %cmp7176, label %for.body72.preheader, label %for.end97
for.body72.preheader: ; preds = %for.end68
%23 = zext i32 %min_n.4 to i64
%24 = zext i32 %spec.select170.lcssa to i64
%wide.trip.count232 = zext i32 %3 to i64
br label %for.body72
for.body72: ; preds = %for.body72.preheader, %for.inc95
%indvars.iv229 = phi i64 [ 0, %for.body72.preheader ], [ %indvars.iv.next230, %for.inc95 ]
%tmp2.0208 = phi i32 [ %min.4, %for.body72.preheader ], [ %tmp2.1, %for.inc95 ]
%sum.2207 = phi i32 [ %add, %for.body72.preheader ], [ %sum.3, %for.inc95 ]
%inc87204206 = phi i32 [ %inc58193, %for.body72.preheader ], [ %inc87203, %for.inc95 ]
%cmp73.not = icmp eq i64 %indvars.iv229, %24
%cmp75.not = icmp eq i64 %indvars.iv229, %23
%or.cond172 = select i1 %cmp73.not, i1 true, i1 %cmp75.not
br i1 %or.cond172, label %for.inc95, label %land.lhs.true76
land.lhs.true76: ; preds = %for.body72
%arrayidx78 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv229
%25 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%cmp79 = icmp sgt i32 %25, -1
br i1 %cmp79, label %if.then80, label %for.inc95
if.then80: ; preds = %land.lhs.true76
%idxprom81 = sext i32 %inc87204206 to i64
%arrayidx82 = getelementptr inbounds [100000 x i32], ptr @ans_x, i64 0, i64 %idxprom81
store i32 %tmp2.0208, ptr %arrayidx82, align 4, !tbaa !5
%arrayidx86 = getelementptr inbounds [100000 x i32], ptr @ans_y, i64 0, i64 %idxprom81
store i32 %25, ptr %arrayidx86, align 4, !tbaa !5
%inc87 = add nsw i32 %inc87204206, 1
%sub90 = sub nsw i32 %tmp2.0208, %25
%add93 = add nsw i32 %25, %sum.2207
br label %for.inc95
for.inc95: ; preds = %for.body72, %land.lhs.true76, %if.then80
%inc87203 = phi i32 [ %inc87, %if.then80 ], [ %inc87204206, %land.lhs.true76 ], [ %inc87204206, %for.body72 ]
%sum.3 = phi i32 [ %add93, %if.then80 ], [ %sum.2207, %land.lhs.true76 ], [ %sum.2207, %for.body72 ]
%tmp2.1 = phi i32 [ %sub90, %if.then80 ], [ %tmp2.0208, %land.lhs.true76 ], [ %tmp2.0208, %for.body72 ]
%indvars.iv.next230 = add nuw nsw i64 %indvars.iv229, 1
%exitcond233.not = icmp eq i64 %indvars.iv.next230, %wide.trip.count232
br i1 %exitcond233.not, label %for.end97, label %for.body72, !llvm.loop !14
for.end97: ; preds = %for.inc95, %for.end68.thread, %for.end68
%tmp.0.lcssa266 = phi i32 [ %tmp.1, %for.end68 ], [ %sum.0.lcssa.ph, %for.end68.thread ], [ %tmp.1, %for.inc95 ]
%26 = phi i32 [ %inc58193, %for.end68 ], [ %ans_n.promoted202.ph, %for.end68.thread ], [ %inc87203, %for.inc95 ]
%sum.2.lcssa = phi i32 [ %add, %for.end68 ], [ %add265, %for.end68.thread ], [ %sum.3, %for.inc95 ]
%tmp2.0.lcssa = phi i32 [ %min.4, %for.end68 ], [ %min.4257.ph, %for.end68.thread ], [ %tmp2.1, %for.inc95 ]
%idxprom98 = sext i32 %26 to i64
%arrayidx99 = getelementptr inbounds [100000 x i32], ptr @ans_x, i64 0, i64 %idxprom98
store i32 %tmp.0.lcssa266, ptr %arrayidx99, align 4, !tbaa !5
%arrayidx101 = getelementptr inbounds [100000 x i32], ptr @ans_y, i64 0, i64 %idxprom98
store i32 %tmp2.0.lcssa, ptr %arrayidx101, align 4, !tbaa !5
%inc102 = add nsw i32 %26, 1
store i32 %inc102, ptr @ans_n, align 4, !tbaa !5
%call103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.2.lcssa)
%27 = load i32, ptr @ans_n, align 4, !tbaa !5
%cmp105212 = icmp sgt i32 %27, 0
br i1 %cmp105212, label %for.body106, label %for.end114
for.body106: ; preds = %for.end97, %for.body106
%indvars.iv234 = phi i64 [ %indvars.iv.next235, %for.body106 ], [ 0, %for.end97 ]
%arrayidx108 = getelementptr inbounds [100000 x i32], ptr @ans_x, i64 0, i64 %indvars.iv234
%28 = load i32, ptr %arrayidx108, align 4, !tbaa !5
%arrayidx110 = getelementptr inbounds [100000 x i32], ptr @ans_y, i64 0, i64 %indvars.iv234
%29 = load i32, ptr %arrayidx110, align 4, !tbaa !5
%call111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28, i32 noundef %29)
%indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
%30 = load i32, ptr @ans_n, align 4, !tbaa !5
%31 = sext i32 %30 to i64
%cmp105 = icmp slt i64 %indvars.iv.next235, %31
br i1 %cmp105, label %for.body106, label %for.end114, !llvm.loop !15
for.end114: ; preds = %for.body106, %for.end97
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
#define MAX(x,y) (((x)<(y))?(y):(x))
typedef long long ll;
int main(void){
ll t[100000],a[100000];
ll maxT,maxA,mtp,map,tM=1,aM=1;
int N,i,j,k;
ll const mod=(ll)1E9+7;
scanf("%d",&N);
for(i=0;i<N;i++) scanf("%lld",&t[i]);
for(i=0;i<N;i++) scanf("%lld",&a[i]);
for(i=maxT=maxA=0;i<N;i++){
if(maxT<t[i]) maxT=t[mtp=i];
if(maxA<a[N-1-i]) maxA=a[map=N-1-i];
}
if(maxT!=maxA || t[mtp]!=a[mtp] || t[map]!=a[map] || mtp>map){
puts("0");
return 0;
}
for(i=0;i<N && t[i]!=maxT;i++){
if(i!=0 && t[i]==t[i-1]){
tM*=t[i-1];
tM%=mod;
}
}
for(j=N-2;j>i;j--){
if(a[j]==a[j+1]){
aM*=a[j+1];
aM%=mod;
}
}
printf("%lld\n",aM*tM%mod);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142398/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142398/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"0\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca [100000 x i64], align 16
%a = alloca [100000 x i64], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %a) #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
%cmp148 = icmp sgt i32 %0, 0
br i1 %cmp148, label %for.body, label %lor.lhs.false
for.cond2.preheader: ; preds = %for.body
%cmp3150 = icmp sgt i32 %1, 0
br i1 %cmp3150, label %for.body4, label %lor.lhs.false
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr %t, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !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
%cmp12152 = icmp sgt i32 %3, 0
br i1 %cmp12152, label %for.body13.preheader, label %lor.lhs.false
for.body13.preheader: ; preds = %for.cond11.preheader
%wide.trip.count = zext i32 %3 to i64
br label %for.body13
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv175 = phi i64 [ %indvars.iv.next176, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %indvars.iv175
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp3 = icmp slt i64 %indvars.iv.next176, %4
br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11
for.body13: ; preds = %for.body13.preheader, %for.body13
%indvars.iv178 = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next179, %for.body13 ]
%maxT.0157 = phi i64 [ 0, %for.body13.preheader ], [ %spec.select147, %for.body13 ]
%map.0155 = phi i64 [ undef, %for.body13.preheader ], [ %map.1, %for.body13 ]
%mtp.0154 = phi i64 [ undef, %for.body13.preheader ], [ %spec.select, %for.body13 ]
%maxA.0153 = phi i64 [ 0, %for.body13.preheader ], [ %maxA.1, %for.body13 ]
%arrayidx15 = getelementptr inbounds [100000 x i64], ptr %t, i64 0, i64 %indvars.iv178
%5 = load i64, ptr %arrayidx15, align 8, !tbaa !12
%cmp16 = icmp slt i64 %maxT.0157, %5
%spec.select = select i1 %cmp16, i64 %indvars.iv178, i64 %mtp.0154
%spec.select147 = call i64 @llvm.smax.i64(i64 %maxT.0157, i64 %5)
%6 = trunc i64 %indvars.iv178 to i32
%7 = xor i32 %6, -1
%sub18 = add i32 %3, %7
%idxprom19 = sext i32 %sub18 to i64
%arrayidx20 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %idxprom19
%8 = load i64, ptr %arrayidx20, align 8, !tbaa !12
%cmp21 = icmp slt i64 %maxA.0153, %8
%maxA.1 = call i64 @llvm.smax.i64(i64 %maxA.0153, i64 %8)
%map.1 = select i1 %cmp21, i64 %idxprom19, i64 %map.0155
%indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
%exitcond.not = icmp eq i64 %indvars.iv.next179, %wide.trip.count
br i1 %exitcond.not, label %for.end31, label %for.body13, !llvm.loop !14
for.end31: ; preds = %for.body13
%cmp32.not = icmp eq i64 %spec.select147, %maxA.1
br i1 %cmp32.not, label %lor.lhs.false, label %if.then46
lor.lhs.false: ; preds = %entry, %for.cond2.preheader, %for.cond11.preheader, %for.end31
%map.0.lcssa208 = phi i64 [ %map.1, %for.end31 ], [ undef, %for.cond11.preheader ], [ undef, %for.cond2.preheader ], [ undef, %entry ]
%mtp.0.lcssa207 = phi i64 [ %spec.select, %for.end31 ], [ undef, %for.cond11.preheader ], [ undef, %for.cond2.preheader ], [ undef, %entry ]
%maxA.0.lcssa206 = phi i64 [ %maxA.1, %for.end31 ], [ 0, %for.cond11.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ]
%.lcssa195205 = phi i32 [ %3, %for.end31 ], [ %3, %for.cond11.preheader ], [ %1, %for.cond2.preheader ], [ %0, %entry ]
%cmp12152196204 = phi i1 [ %cmp12152, %for.end31 ], [ false, %for.cond11.preheader ], [ false, %for.cond2.preheader ], [ false, %entry ]
%arrayidx34 = getelementptr inbounds [100000 x i64], ptr %t, i64 0, i64 %mtp.0.lcssa207
%9 = load i64, ptr %arrayidx34, align 8, !tbaa !12
%arrayidx35 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %mtp.0.lcssa207
%10 = load i64, ptr %arrayidx35, align 8, !tbaa !12
%cmp36.not = icmp eq i64 %9, %10
br i1 %cmp36.not, label %lor.lhs.false38, label %if.then46
lor.lhs.false38: ; preds = %lor.lhs.false
%arrayidx39 = getelementptr inbounds [100000 x i64], ptr %t, i64 0, i64 %map.0.lcssa208
%11 = load i64, ptr %arrayidx39, align 8, !tbaa !12
%arrayidx40 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %map.0.lcssa208
%12 = load i64, ptr %arrayidx40, align 8, !tbaa !12
%cmp41.not = icmp ne i64 %11, %12
%cmp44 = icmp sgt i64 %mtp.0.lcssa207, %map.0.lcssa208
%or.cond = select i1 %cmp41.not, i1 true, i1 %cmp44
br i1 %or.cond, label %if.then46, label %for.cond49.preheader
for.cond49.preheader: ; preds = %lor.lhs.false38
br i1 %cmp12152196204, label %land.rhs.preheader, label %for.end73
land.rhs.preheader: ; preds = %for.cond49.preheader
%wide.trip.count185 = zext i32 %.lcssa195205 to i64
%13 = load i64, ptr %t, align 16, !tbaa !12
%cmp54.not.peel = icmp eq i64 %13, %maxA.0.lcssa206
br i1 %cmp54.not.peel, label %for.end73, label %for.inc71.peel
for.inc71.peel: ; preds = %land.rhs.preheader
%exitcond186.peel.not = icmp eq i32 %.lcssa195205, 1
br i1 %exitcond186.peel.not, label %for.end93, label %land.rhs
if.then46: ; preds = %lor.lhs.false38, %lor.lhs.false, %for.end31
%call47 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
land.rhs: ; preds = %for.inc71.peel, %for.inc71
%indvars.iv181 = phi i64 [ %indvars.iv.next182, %for.inc71 ], [ 1, %for.inc71.peel ]
%tM.0163 = phi i64 [ %tM.1, %for.inc71 ], [ 1, %for.inc71.peel ]
%arrayidx53 = getelementptr inbounds [100000 x i64], ptr %t, i64 0, i64 %indvars.iv181
%14 = load i64, ptr %arrayidx53, align 8, !tbaa !12
%cmp54.not = icmp eq i64 %14, %maxA.0.lcssa206
br i1 %cmp54.not, label %for.end73.loopexit, label %land.lhs.true
land.lhs.true: ; preds = %land.rhs
%15 = add nsw i64 %indvars.iv181, -1
%arrayidx63 = getelementptr inbounds [100000 x i64], ptr %t, i64 0, i64 %15
%16 = load i64, ptr %arrayidx63, align 8, !tbaa !12
%cmp64 = icmp eq i64 %14, %16
br i1 %cmp64, label %if.then66, label %for.inc71
if.then66: ; preds = %land.lhs.true
%mul = mul nsw i64 %14, %tM.0163
%rem = srem i64 %mul, 1000000007
br label %for.inc71
for.inc71: ; preds = %land.lhs.true, %if.then66
%tM.1 = phi i64 [ %rem, %if.then66 ], [ %tM.0163, %land.lhs.true ]
%indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
%exitcond186.not = icmp eq i64 %indvars.iv.next182, %wide.trip.count185
br i1 %exitcond186.not, label %for.end93, label %land.rhs, !llvm.loop !15
for.end73.loopexit: ; preds = %land.rhs
%17 = trunc i64 %indvars.iv181 to i32
br label %for.end73
for.end73: ; preds = %for.end73.loopexit, %land.rhs.preheader, %for.cond49.preheader
%tM.0.lcssa = phi i64 [ 1, %for.cond49.preheader ], [ 1, %land.rhs.preheader ], [ %tM.0163, %for.end73.loopexit ]
%i.3.lcssa = phi i32 [ 0, %for.cond49.preheader ], [ 0, %land.rhs.preheader ], [ %17, %for.end73.loopexit ]
%sub74 = add nsw i32 %.lcssa195205, -2
%cmp76169 = icmp sgt i32 %sub74, %i.3.lcssa
br i1 %cmp76169, label %for.body78.preheader, label %for.end93
for.body78.preheader: ; preds = %for.end73
%18 = sext i32 %sub74 to i64
%19 = sext i32 %i.3.lcssa to i64
%20 = sub nsw i64 %18, %19
%xtraiter = and i64 %20, 1
%21 = sub nsw i64 0, %18
%22 = xor i64 %19, %21
%23 = icmp eq i64 %22, -1
br i1 %23, label %for.end93.loopexit.unr-lcssa, label %for.body78.preheader.new
for.body78.preheader.new: ; preds = %for.body78.preheader
%unroll_iter = and i64 %20, -2
br label %for.body78
for.body78: ; preds = %for.inc92.1, %for.body78.preheader.new
%indvars.iv188 = phi i64 [ %18, %for.body78.preheader.new ], [ %indvars.iv.next189.1, %for.inc92.1 ]
%aM.0170 = phi i64 [ 1, %for.body78.preheader.new ], [ %aM.1.1, %for.inc92.1 ]
%niter = phi i64 [ 0, %for.body78.preheader.new ], [ %niter.next.1, %for.inc92.1 ]
%arrayidx80 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %indvars.iv188
%24 = load i64, ptr %arrayidx80, align 8, !tbaa !12
%25 = add nsw i64 %indvars.iv188, 1
%arrayidx82 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %25
%26 = load i64, ptr %arrayidx82, align 8, !tbaa !12
%cmp83 = icmp eq i64 %24, %26
br i1 %cmp83, label %if.then85, label %for.inc92
if.then85: ; preds = %for.body78
%mul89 = mul nsw i64 %24, %aM.0170
%rem90 = srem i64 %mul89, 1000000007
br label %for.inc92
for.inc92: ; preds = %for.body78, %if.then85
%aM.1 = phi i64 [ %rem90, %if.then85 ], [ %aM.0170, %for.body78 ]
%indvars.iv.next189 = add nsw i64 %indvars.iv188, -1
%arrayidx80.1 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %indvars.iv.next189
%27 = load i64, ptr %arrayidx80.1, align 8, !tbaa !12
%arrayidx82.1 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %indvars.iv188
%28 = load i64, ptr %arrayidx82.1, align 8, !tbaa !12
%cmp83.1 = icmp eq i64 %27, %28
br i1 %cmp83.1, label %if.then85.1, label %for.inc92.1
if.then85.1: ; preds = %for.inc92
%mul89.1 = mul nsw i64 %27, %aM.1
%rem90.1 = srem i64 %mul89.1, 1000000007
br label %for.inc92.1
for.inc92.1: ; preds = %if.then85.1, %for.inc92
%aM.1.1 = phi i64 [ %rem90.1, %if.then85.1 ], [ %aM.1, %for.inc92 ]
%indvars.iv.next189.1 = add nsw i64 %indvars.iv188, -2
%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.end93.loopexit.unr-lcssa, label %for.body78, !llvm.loop !17
for.end93.loopexit.unr-lcssa: ; preds = %for.inc92.1, %for.body78.preheader
%aM.1.lcssa.ph = phi i64 [ undef, %for.body78.preheader ], [ %aM.1.1, %for.inc92.1 ]
%indvars.iv188.unr = phi i64 [ %18, %for.body78.preheader ], [ %indvars.iv.next189.1, %for.inc92.1 ]
%aM.0170.unr = phi i64 [ 1, %for.body78.preheader ], [ %aM.1.1, %for.inc92.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end93, label %for.body78.epil
for.body78.epil: ; preds = %for.end93.loopexit.unr-lcssa
%arrayidx80.epil = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %indvars.iv188.unr
%29 = load i64, ptr %arrayidx80.epil, align 8, !tbaa !12
%30 = add nsw i64 %indvars.iv188.unr, 1
%arrayidx82.epil = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %30
%31 = load i64, ptr %arrayidx82.epil, align 8, !tbaa !12
%cmp83.epil = icmp eq i64 %29, %31
br i1 %cmp83.epil, label %if.then85.epil, label %for.end93
if.then85.epil: ; preds = %for.body78.epil
%mul89.epil = mul nsw i64 %29, %aM.0170.unr
%rem90.epil = srem i64 %mul89.epil, 1000000007
br label %for.end93
for.end93: ; preds = %for.inc71, %for.end93.loopexit.unr-lcssa, %if.then85.epil, %for.body78.epil, %for.inc71.peel, %for.end73
%tM.0.lcssa213 = phi i64 [ %tM.0.lcssa, %for.end73 ], [ 1, %for.inc71.peel ], [ %tM.0.lcssa, %for.body78.epil ], [ %tM.0.lcssa, %if.then85.epil ], [ %tM.0.lcssa, %for.end93.loopexit.unr-lcssa ], [ %tM.1, %for.inc71 ]
%aM.0.lcssa = phi i64 [ 1, %for.end73 ], [ 1, %for.inc71.peel ], [ %aM.1.lcssa.ph, %for.end93.loopexit.unr-lcssa ], [ %rem90.epil, %if.then85.epil ], [ %aM.0170.unr, %for.body78.epil ], [ 1, %for.inc71 ]
%mul94 = mul nsw i64 %aM.0.lcssa, %tM.0.lcssa213
%rem95 = srem i64 %mul94, 1000000007
%call96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %rem95)
br label %cleanup
cleanup: ; preds = %for.end93, %if.then46
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
#include <limits.h>
int main(void) {
int i, ix, jx, iy, jy, l, m, N, K;
long long x[50], y[50], lx, ly, sx, sy, R, S;
scanf("%d%d", &N, &K);
for (i=0;i<N;i++) {
scanf("%lld%lld", &x[i], &y[i]);
}
S = LLONG_MAX;
for (ix=1;ix<N;ix++) {
for (jx=0;jx<ix;jx++) {
if (x[ix] < x[jx]) {
lx = x[jx]; sx = x[ix];
} else {
lx = x[ix]; sx = x[jx];
}
for (iy=1;iy<N;iy++) {
for (jy=0;jy<N;jy++) {
if (y[iy] < y[jy]) {
ly = y[jy]; sy = y[iy];
} else {
ly = y[iy]; sy = y[jy];
}
R = (lx-sx)*(ly-sy);
m = 0;
for (l=0;l<N;l++) {
if (x[l] <= lx && x[l] >= sx && y[l] <= ly && y[l] >= sy) m++;
}
if (m>=K) {
if (R<S) S = R;
}
}
}
}
}
printf("%lld\n", S);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142440/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142440/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 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 nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
%x = alloca [50 x i64], align 16
%y = alloca [50 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp133 = icmp sgt i32 %0, 0
br i1 %cmp133, label %for.body, label %for.end86
for.cond4.preheader: ; preds = %for.body
%cmp5171 = icmp sgt i32 %12, 1
br i1 %cmp5171, label %for.cond7.preheader.us.us.preheader, label %for.end86
for.cond7.preheader.us.us.preheader: ; preds = %for.cond4.preheader
%1 = load i32, ptr %K, align 4
%wide.trip.count207 = zext i32 %12 to i64
%xtraiter = and i64 %wide.trip.count207, 1
%unroll_iter = and i64 %wide.trip.count207, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond7.preheader.us.us
for.cond7.preheader.us.us: ; preds = %for.cond7.preheader.us.us.preheader, %for.inc84.split.us.split.us.us.us
%indvars.iv204 = phi i64 [ 1, %for.cond7.preheader.us.us.preheader ], [ %indvars.iv.next205, %for.inc84.split.us.split.us.us.us ]
%S.0174.us.us = phi i64 [ 9223372036854775807, %for.cond7.preheader.us.us.preheader ], [ %S.4.us.us.us.us.us.us, %for.inc84.split.us.split.us.us.us ]
%arrayidx11.us.us = getelementptr inbounds [50 x i64], ptr %x, i64 0, i64 %indvars.iv204
%2 = load i64, ptr %arrayidx11.us.us, align 8, !tbaa !9
br label %for.body9.us.us.us.us
for.body9.us.us.us.us: ; preds = %for.cond23.for.inc81_crit_edge.split.us.us.us.us.us, %for.cond7.preheader.us.us
%indvars.iv199 = phi i64 [ %indvars.iv.next200, %for.cond23.for.inc81_crit_edge.split.us.us.us.us.us ], [ 0, %for.cond7.preheader.us.us ]
%S.1163.us.us.us.us = phi i64 [ %S.4.us.us.us.us.us.us, %for.cond23.for.inc81_crit_edge.split.us.us.us.us.us ], [ %S.0174.us.us, %for.cond7.preheader.us.us ]
%arrayidx13.us.us.us.us = getelementptr inbounds [50 x i64], ptr %x, i64 0, i64 %indvars.iv199
%3 = load i64, ptr %arrayidx13.us.us.us.us, align 8, !tbaa !9
%..us.us.us.us = call i64 @llvm.smax.i64(i64 %2, i64 %3)
%.128.us.us.us.us = call i64 @llvm.smin.i64(i64 %2, i64 %3)
%sub.us.us.us.us = sub nsw i64 %..us.us.us.us, %.128.us.us.us.us
br label %for.cond26.preheader.us.us.us.us.us
for.cond26.preheader.us.us.us.us.us: ; preds = %for.cond26.for.inc78_crit_edge.split.us.us.us.us.us.us, %for.body9.us.us.us.us
%indvars.iv194 = phi i64 [ %indvars.iv.next195, %for.cond26.for.inc78_crit_edge.split.us.us.us.us.us.us ], [ 1, %for.body9.us.us.us.us ]
%S.2160.us.us.us.us.us = phi i64 [ %S.4.us.us.us.us.us.us, %for.cond26.for.inc78_crit_edge.split.us.us.us.us.us.us ], [ %S.1163.us.us.us.us, %for.body9.us.us.us.us ]
%arrayidx30.us.us.us.us.us = getelementptr inbounds [50 x i64], ptr %y, i64 0, i64 %indvars.iv194
%4 = load i64, ptr %arrayidx30.us.us.us.us.us, align 8, !tbaa !9
br label %for.body28.us.us.us.us.us.us
for.body28.us.us.us.us.us.us: ; preds = %for.cond46.for.end68_crit_edge.us.us.us.us.us.us, %for.cond26.preheader.us.us.us.us.us
%indvars.iv189 = phi i64 [ %indvars.iv.next190, %for.cond46.for.end68_crit_edge.us.us.us.us.us.us ], [ 0, %for.cond26.preheader.us.us.us.us.us ]
%S.3141.us.us.us.us.us.us = phi i64 [ %S.4.us.us.us.us.us.us, %for.cond46.for.end68_crit_edge.us.us.us.us.us.us ], [ %S.2160.us.us.us.us.us, %for.cond26.preheader.us.us.us.us.us ]
%arrayidx32.us.us.us.us.us.us = getelementptr inbounds [50 x i64], ptr %y, i64 0, i64 %indvars.iv189
%5 = load i64, ptr %arrayidx32.us.us.us.us.us.us, align 8, !tbaa !9
%.129.us.us.us.us.us.us = call i64 @llvm.smax.i64(i64 %4, i64 %5)
%.130.us.us.us.us.us.us = call i64 @llvm.smin.i64(i64 %4, i64 %5)
%sub45.us.us.us.us.us.us = sub nsw i64 %.129.us.us.us.us.us.us, %.130.us.us.us.us.us.us
br label %for.body48.us.us.us.us.us.us
for.body48.us.us.us.us.us.us: ; preds = %for.inc66.us.us.us.us.us.us.1, %for.body28.us.us.us.us.us.us
%indvars.iv186 = phi i64 [ 0, %for.body28.us.us.us.us.us.us ], [ %indvars.iv.next187.1, %for.inc66.us.us.us.us.us.us.1 ]
%m.0137.us.us.us.us.us.us = phi i32 [ 0, %for.body28.us.us.us.us.us.us ], [ %m.1.us.us.us.us.us.us.1, %for.inc66.us.us.us.us.us.us.1 ]
%niter = phi i64 [ 0, %for.body28.us.us.us.us.us.us ], [ %niter.next.1, %for.inc66.us.us.us.us.us.us.1 ]
%arrayidx50.us.us.us.us.us.us = getelementptr inbounds [50 x i64], ptr %x, i64 0, i64 %indvars.iv186
%6 = load i64, ptr %arrayidx50.us.us.us.us.us.us, align 16, !tbaa !9
%cmp51.not.us.us.us.us.us.us = icmp sgt i64 %6, %..us.us.us.us
%cmp54.not.us.us.us.us.us.us = icmp slt i64 %6, %.128.us.us.us.us
%or.cond.us.us.us.us.us.us = select i1 %cmp51.not.us.us.us.us.us.us, i1 true, i1 %cmp54.not.us.us.us.us.us.us
br i1 %or.cond.us.us.us.us.us.us, label %for.inc66.us.us.us.us.us.us, label %land.lhs.true55.us.us.us.us.us.us
land.lhs.true55.us.us.us.us.us.us: ; preds = %for.body48.us.us.us.us.us.us
%arrayidx57.us.us.us.us.us.us = getelementptr inbounds [50 x i64], ptr %y, i64 0, i64 %indvars.iv186
%7 = load i64, ptr %arrayidx57.us.us.us.us.us.us, align 16, !tbaa !9
%cmp58.not.us.us.us.us.us.us = icmp sle i64 %7, %.129.us.us.us.us.us.us
%cmp62.not.us.us.us.us.us.us = icmp sge i64 %7, %.130.us.us.us.us.us.us
%or.cond131.not.us.us.us.us.us.us = select i1 %cmp58.not.us.us.us.us.us.us, i1 %cmp62.not.us.us.us.us.us.us, i1 false
%inc64.us.us.us.us.us.us = zext i1 %or.cond131.not.us.us.us.us.us.us to i32
%spec.select.us.us.us.us.us.us = add nsw i32 %m.0137.us.us.us.us.us.us, %inc64.us.us.us.us.us.us
br label %for.inc66.us.us.us.us.us.us
for.inc66.us.us.us.us.us.us: ; preds = %land.lhs.true55.us.us.us.us.us.us, %for.body48.us.us.us.us.us.us
%m.1.us.us.us.us.us.us = phi i32 [ %m.0137.us.us.us.us.us.us, %for.body48.us.us.us.us.us.us ], [ %spec.select.us.us.us.us.us.us, %land.lhs.true55.us.us.us.us.us.us ]
%indvars.iv.next187 = or i64 %indvars.iv186, 1
%arrayidx50.us.us.us.us.us.us.1 = getelementptr inbounds [50 x i64], ptr %x, i64 0, i64 %indvars.iv.next187
%8 = load i64, ptr %arrayidx50.us.us.us.us.us.us.1, align 8, !tbaa !9
%cmp51.not.us.us.us.us.us.us.1 = icmp sgt i64 %8, %..us.us.us.us
%cmp54.not.us.us.us.us.us.us.1 = icmp slt i64 %8, %.128.us.us.us.us
%or.cond.us.us.us.us.us.us.1 = select i1 %cmp51.not.us.us.us.us.us.us.1, i1 true, i1 %cmp54.not.us.us.us.us.us.us.1
br i1 %or.cond.us.us.us.us.us.us.1, label %for.inc66.us.us.us.us.us.us.1, label %land.lhs.true55.us.us.us.us.us.us.1
land.lhs.true55.us.us.us.us.us.us.1: ; preds = %for.inc66.us.us.us.us.us.us
%arrayidx57.us.us.us.us.us.us.1 = getelementptr inbounds [50 x i64], ptr %y, i64 0, i64 %indvars.iv.next187
%9 = load i64, ptr %arrayidx57.us.us.us.us.us.us.1, align 8, !tbaa !9
%cmp58.not.us.us.us.us.us.us.1 = icmp sle i64 %9, %.129.us.us.us.us.us.us
%cmp62.not.us.us.us.us.us.us.1 = icmp sge i64 %9, %.130.us.us.us.us.us.us
%or.cond131.not.us.us.us.us.us.us.1 = select i1 %cmp58.not.us.us.us.us.us.us.1, i1 %cmp62.not.us.us.us.us.us.us.1, i1 false
%inc64.us.us.us.us.us.us.1 = zext i1 %or.cond131.not.us.us.us.us.us.us.1 to i32
%spec.select.us.us.us.us.us.us.1 = add nsw i32 %m.1.us.us.us.us.us.us, %inc64.us.us.us.us.us.us.1
br label %for.inc66.us.us.us.us.us.us.1
for.inc66.us.us.us.us.us.us.1: ; preds = %land.lhs.true55.us.us.us.us.us.us.1, %for.inc66.us.us.us.us.us.us
%m.1.us.us.us.us.us.us.1 = phi i32 [ %m.1.us.us.us.us.us.us, %for.inc66.us.us.us.us.us.us ], [ %spec.select.us.us.us.us.us.us.1, %land.lhs.true55.us.us.us.us.us.us.1 ]
%indvars.iv.next187.1 = add nuw nsw i64 %indvars.iv186, 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.cond46.for.end68_crit_edge.us.us.us.us.us.us.unr-lcssa, label %for.body48.us.us.us.us.us.us, !llvm.loop !11
for.cond46.for.end68_crit_edge.us.us.us.us.us.us.unr-lcssa: ; preds = %for.inc66.us.us.us.us.us.us.1
br i1 %lcmp.mod.not, label %for.cond46.for.end68_crit_edge.us.us.us.us.us.us, label %for.body48.us.us.us.us.us.us.epil
for.body48.us.us.us.us.us.us.epil: ; preds = %for.cond46.for.end68_crit_edge.us.us.us.us.us.us.unr-lcssa
%arrayidx50.us.us.us.us.us.us.epil = getelementptr inbounds [50 x i64], ptr %x, i64 0, i64 %indvars.iv.next187.1
%10 = load i64, ptr %arrayidx50.us.us.us.us.us.us.epil, align 8, !tbaa !9
%cmp51.not.us.us.us.us.us.us.epil = icmp sgt i64 %10, %..us.us.us.us
%cmp54.not.us.us.us.us.us.us.epil = icmp slt i64 %10, %.128.us.us.us.us
%or.cond.us.us.us.us.us.us.epil = select i1 %cmp51.not.us.us.us.us.us.us.epil, i1 true, i1 %cmp54.not.us.us.us.us.us.us.epil
br i1 %or.cond.us.us.us.us.us.us.epil, label %for.cond46.for.end68_crit_edge.us.us.us.us.us.us, label %land.lhs.true55.us.us.us.us.us.us.epil
land.lhs.true55.us.us.us.us.us.us.epil: ; preds = %for.body48.us.us.us.us.us.us.epil
%arrayidx57.us.us.us.us.us.us.epil = getelementptr inbounds [50 x i64], ptr %y, i64 0, i64 %indvars.iv.next187.1
%11 = load i64, ptr %arrayidx57.us.us.us.us.us.us.epil, align 8, !tbaa !9
%cmp58.not.us.us.us.us.us.us.epil = icmp sle i64 %11, %.129.us.us.us.us.us.us
%cmp62.not.us.us.us.us.us.us.epil = icmp sge i64 %11, %.130.us.us.us.us.us.us
%or.cond131.not.us.us.us.us.us.us.epil = select i1 %cmp58.not.us.us.us.us.us.us.epil, i1 %cmp62.not.us.us.us.us.us.us.epil, i1 false
%inc64.us.us.us.us.us.us.epil = zext i1 %or.cond131.not.us.us.us.us.us.us.epil to i32
%spec.select.us.us.us.us.us.us.epil = add nsw i32 %m.1.us.us.us.us.us.us.1, %inc64.us.us.us.us.us.us.epil
br label %for.cond46.for.end68_crit_edge.us.us.us.us.us.us
for.cond46.for.end68_crit_edge.us.us.us.us.us.us: ; preds = %for.body48.us.us.us.us.us.us.epil, %land.lhs.true55.us.us.us.us.us.us.epil, %for.cond46.for.end68_crit_edge.us.us.us.us.us.us.unr-lcssa
%m.1.us.us.us.us.us.us.lcssa = phi i32 [ %m.1.us.us.us.us.us.us.1, %for.cond46.for.end68_crit_edge.us.us.us.us.us.us.unr-lcssa ], [ %m.1.us.us.us.us.us.us.1, %for.body48.us.us.us.us.us.us.epil ], [ %spec.select.us.us.us.us.us.us.epil, %land.lhs.true55.us.us.us.us.us.us.epil ]
%mul.us.us.us.us.us.us = mul nsw i64 %sub45.us.us.us.us.us.us, %sub.us.us.us.us
%cmp69.not.us.us.us.us.us.us = icmp sge i32 %m.1.us.us.us.us.us.us.lcssa, %1
%cmp71.us.us.us.us.us.us = icmp slt i64 %mul.us.us.us.us.us.us, %S.3141.us.us.us.us.us.us
%or.cond132.us.us.us.us.us.us = select i1 %cmp69.not.us.us.us.us.us.us, i1 %cmp71.us.us.us.us.us.us, i1 false
%S.4.us.us.us.us.us.us = select i1 %or.cond132.us.us.us.us.us.us, i64 %mul.us.us.us.us.us.us, i64 %S.3141.us.us.us.us.us.us
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%exitcond193.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count207
br i1 %exitcond193.not, label %for.cond26.for.inc78_crit_edge.split.us.us.us.us.us.us, label %for.body28.us.us.us.us.us.us, !llvm.loop !13
for.cond26.for.inc78_crit_edge.split.us.us.us.us.us.us: ; preds = %for.cond46.for.end68_crit_edge.us.us.us.us.us.us
%indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
%exitcond198.not = icmp eq i64 %indvars.iv.next195, %wide.trip.count207
br i1 %exitcond198.not, label %for.cond23.for.inc81_crit_edge.split.us.us.us.us.us, label %for.cond26.preheader.us.us.us.us.us, !llvm.loop !14
for.cond23.for.inc81_crit_edge.split.us.us.us.us.us: ; preds = %for.cond26.for.inc78_crit_edge.split.us.us.us.us.us.us
%indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1
%exitcond203.not = icmp eq i64 %indvars.iv.next200, %indvars.iv204
br i1 %exitcond203.not, label %for.inc84.split.us.split.us.us.us, label %for.body9.us.us.us.us, !llvm.loop !15
for.inc84.split.us.split.us.us.us: ; preds = %for.cond23.for.inc81_crit_edge.split.us.us.us.us.us
%indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
%exitcond208.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count207
br i1 %exitcond208.not, label %for.end86, label %for.cond7.preheader.us.us, !llvm.loop !16
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [50 x i64], ptr %x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [50 x i64], ptr %y, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr %N, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !17
for.end86: ; preds = %for.inc84.split.us.split.us.us.us, %entry, %for.cond4.preheader
%S.0.lcssa = phi i64 [ 9223372036854775807, %for.cond4.preheader ], [ 9223372036854775807, %entry ], [ %S.4.us.us.us.us.us.us, %for.inc84.split.us.split.us.us.us ]
%call87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %S.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
|
#include <stdio.h>
#include <string.h>
int main(void){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a+b+c>=22)
printf("bust");
else
printf("win");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142512/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142512/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\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, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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()
{
int a1, a2, a3;
scanf("%d%d%d", &a1, &a2, &a3);
printf("%s\n",(a1+a2+a3>21?"bust":"win"));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142570/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"win\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a1 = alloca i32, align 4
%a2 = alloca i32, align 4
%a3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a3) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a1, ptr noundef nonnull %a2, ptr noundef nonnull %a3)
%0 = load i32, ptr %a1, align 4, !tbaa !5
%1 = load i32, ptr %a2, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %a3, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%cond = select i1 %cmp, ptr @.str.2, ptr @.str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
puts(a+b+c>21?"bust":"win");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142613/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142613/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\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, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%cond = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int A1,A2,A3;
scanf("%d%d%d",&A1,&A2,&A3);
if(A1+A2+A3>=22)
{
printf("bust");
}
else
{
printf("win");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142664/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142664/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A1 = alloca i32, align 4
%A2 = alloca i32, align 4
%A3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A1, ptr noundef nonnull %A2, ptr noundef nonnull %A3)
%0 = load i32, ptr %A1, align 4, !tbaa !5
%1 = load i32, ptr %A2, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %A3, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A3) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A1) #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"}
|
// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF (1 << 29) * 2
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }
int main()
{
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
puts(a + b + c >= 22 ? "bust" : "win");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142707/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142707/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #5
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%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) #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 = 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 !9
%1 = load i32, ptr %b, align 4, !tbaa !9
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !9
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%cond = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
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) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include <stdio.h>
int main()
{
int a,b,c,x;
scanf("%d%d%d",&a,&b,&c);
x=a+b+c;
if(x>=22)
printf("bust\n");
else
printf("win\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142758/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142758/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"win\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"bust\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) #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 = 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, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c,d;
scanf("%d%d%d",&a,&b,&c);
d=a+b+c;
if(d>=22)
{
printf("bust");
}
else
{
printf("win\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142822/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142822/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
@str = private unnamed_addr constant [4 x i8] c"win\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) #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 = 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, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int a1, a2, a3;
scanf("%d %d %d", &a1, &a2, &a3);
if(a1+a2+a3 < 22) printf("win");
else printf("bust");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142866/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142866/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"win\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a1 = alloca i32, align 4
%a2 = alloca i32, align 4
%a3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a1, ptr noundef nonnull %a2, ptr noundef nonnull %a3)
%0 = load i32, ptr %a1, align 4, !tbaa !5
%1 = load i32, ptr %a2, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %a3, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp slt i32 %add1, 22
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a3) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a1) #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,d;
scanf("%d%d%d",&a,&b,&c);
d = a+b+c;
if(d>21) {
printf("bust");
}
else if(d<=21){
printf("win");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142909/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142909/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\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, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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, d;
scanf("%d %d %d", &a, &b, &c);
d = a + b + c;
if (d >= 22)printf("bust");
else printf("win");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142952/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142952/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\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, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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[3];
int x;
int i;
for(i = 0; i< 3; i++){
scanf("%d", &a[i]);
}
x = a[0]+a[1]+a[2];
if(x<22){
printf("win");
}
else {
printf("bust");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142996/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142996/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"win\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%add4 = add nsw i32 %add, %2
%cmp5 = icmp slt i32 %add4, 22
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int A1,A2,A3;
scanf("%d%d%d",&A1,&A2,&A3);
if(A1+A2+A3>=22)
printf("bust");
else
printf("win");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143038/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143038/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A1 = alloca i32, align 4
%A2 = alloca i32, align 4
%A3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A1, ptr noundef nonnull %A2, ptr noundef nonnull %A3)
%0 = load i32, ptr %A1, align 4, !tbaa !5
%1 = load i32, ptr %A2, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %A3, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A3) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A1) #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 a1,a2,a3;
scanf("%d %d %d", &a1, &a2, &a3);
if((a1+a2+a3)>=22){
printf("bust\n");
}
else{
printf("win\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143081/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143081/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [4 x i8] c"win\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a1 = alloca i32, align 4
%a2 = alloca i32, align 4
%a3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a3) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a1, ptr noundef nonnull %a2, ptr noundef nonnull %a3)
%0 = load i32, ptr %a1, align 4, !tbaa !5
%1 = load i32, ptr %a2, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %a3, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#define pai 3.1415926535
int main(void) {
int A[3];
int sum = 0;
for (int i = 0; i < 3; i++) {
scanf("%d", &A[i]);
sum += A[i];
}
if (sum >= 22) {
printf("bust");
}
else {
printf("win");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143124/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143124/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%0 = load i32, ptr %A, align 4, !tbaa !5
%arrayidx.1 = getelementptr inbounds [3 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
%add.1 = add nsw i32 %1, %0
%arrayidx.2 = getelementptr inbounds [3 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 4, !tbaa !5
%add.2 = add nsw i32 %2, %add.1
%cmp3 = icmp sgt i32 %add.2, 21
%.str.1..str.2 = select i1 %cmp3, ptr @.str.1, ptr @.str.2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <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;}
char s[2000][2001];
short d[2000][2000][4];
int main(void){
int h, w, i, j;
scanf("%d %d", &h, &w);
for(i=0; i<h; i++){
scanf("%s", s[i]);
}
int f, g;
for(i=0; i<h; i++){
f=0;
for(j=0; j<w; j++){
if(s[i][j]=='.'){
if(f==0){ f=1; g=j; }
d[i][j][0]=j-g;
}else{
f=0;
}
}
}
for(i=0; i<h; i++){
f=0;
for(j=w-1; j>=0; j--){
if(s[i][j]=='.'){
if(f==0){ f=1; g=j; }
d[i][j][1]=g-j;
}else{
f=0;
}
}
}
for(j=0; j<w; j++){
f=0;
for(i=0; i<h; i++){
if(s[i][j]=='.'){
if(f==0){ f=1; g=i; }
d[i][j][2]=i-g;
}else{
f=0;
}
}
}
for(j=0; j<w; j++){
f=0;
for(i=h-1; i>=0; i--){
if(s[i][j]=='.'){
if(f==0){ f=1; g=i; }
d[i][j][3]=g-i;
}else{
f=0;
}
}
}
int ans=0;
for(i=0; i<h; i++){
for(j=0; j<w; j++){
if(s[i][j]=='.'){
int now=d[i][j][0]+d[i][j][1]+d[i][j][2]+d[i][j][3]+1;
if(now>ans) ans=now;
}
}
}
printf("%d\n", ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143168/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143168/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1
@s = dso_local global [2000 x [2001 x i8]] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [2000 x [2000 x [4 x i16]]] zeroinitializer, align 16
@.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 @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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp259 = icmp sgt i32 %0, 0
br i1 %cmp259, label %for.body, label %for.end189
for.cond2.preheader: ; preds = %for.body
%cmp3266 = icmp sgt i32 %9, 0
%.pre.pre = load i32, ptr %w, align 4, !tbaa !5
br i1 %cmp3266, label %for.cond5.preheader.lr.ph, label %for.cond65.preheader
for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader
%cmp6261 = icmp sgt i32 %.pre.pre, 0
br i1 %cmp6261, label %for.cond5.preheader.us.preheader, label %for.end189
for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph
%wide.trip.count323 = zext i32 %9 to i64
%wide.trip.count = zext i32 %.pre.pre to i64
%1 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%2 = icmp eq i64 %1, 0
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond5.preheader.us
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc27_crit_edge.us
%indvars.iv320 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next321, %for.cond5.for.inc27_crit_edge.us ]
%g.0267.us = phi i32 [ undef, %for.cond5.preheader.us.preheader ], [ %g.3.us.lcssa, %for.cond5.for.inc27_crit_edge.us ]
br i1 %2, label %for.cond5.for.inc27_crit_edge.us.unr-lcssa, label %for.body7.us
for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc24.us.1
%indvars.iv317 = phi i64 [ %indvars.iv.next318.1, %for.inc24.us.1 ], [ 0, %for.cond5.preheader.us ]
%g.1264.us = phi i32 [ %g.3.us.1, %for.inc24.us.1 ], [ %g.0267.us, %for.cond5.preheader.us ]
%f.0263.us = phi i32 [ %f.2.us.1, %for.inc24.us.1 ], [ 0, %for.cond5.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc24.us.1 ], [ 0, %for.cond5.preheader.us ]
%arrayidx11.us = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv320, i64 %indvars.iv317
%3 = load i8, ptr %arrayidx11.us, align 1, !tbaa !9
%cmp12.us.not = icmp eq i8 %3, 46
br i1 %cmp12.us.not, label %if.then.us, label %for.inc24.us
if.then.us: ; preds = %for.body7.us
%cmp14.us = icmp eq i32 %f.0263.us, 0
%4 = trunc i64 %indvars.iv317 to i32
%spec.select.us = select i1 %cmp14.us, i32 %4, i32 %g.1264.us
%sub.us = sub nsw i32 %4, %spec.select.us
%conv17.us = trunc i32 %sub.us to i16
%arrayidx21.us = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv320, i64 %indvars.iv317
store i16 %conv17.us, ptr %arrayidx21.us, align 16, !tbaa !10
br label %for.inc24.us
for.inc24.us: ; preds = %if.then.us, %for.body7.us
%g.3.us = phi i32 [ %spec.select.us, %if.then.us ], [ %g.1264.us, %for.body7.us ]
%indvars.iv.next318 = or i64 %indvars.iv317, 1
%arrayidx11.us.1 = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv320, i64 %indvars.iv.next318
%5 = load i8, ptr %arrayidx11.us.1, align 1, !tbaa !9
%cmp12.us.1 = icmp eq i8 %5, 46
br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc24.us.1
if.then.us.1: ; preds = %for.inc24.us
%6 = trunc i64 %indvars.iv.next318 to i32
%spec.select.us.1 = select i1 %cmp12.us.not, i32 %g.3.us, i32 %6
%sub.us.1 = sub nsw i32 %6, %spec.select.us.1
%conv17.us.1 = trunc i32 %sub.us.1 to i16
%arrayidx21.us.1 = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv320, i64 %indvars.iv.next318
store i16 %conv17.us.1, ptr %arrayidx21.us.1, align 8, !tbaa !10
br label %for.inc24.us.1
for.inc24.us.1: ; preds = %if.then.us.1, %for.inc24.us
%f.2.us.1 = phi i32 [ 1, %if.then.us.1 ], [ 0, %for.inc24.us ]
%g.3.us.1 = phi i32 [ %spec.select.us.1, %if.then.us.1 ], [ %g.3.us, %for.inc24.us ]
%indvars.iv.next318.1 = add nuw nsw i64 %indvars.iv317, 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.cond5.for.inc27_crit_edge.us.unr-lcssa, label %for.body7.us, !llvm.loop !12
for.cond5.for.inc27_crit_edge.us.unr-lcssa: ; preds = %for.inc24.us.1, %for.cond5.preheader.us
%g.3.us.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.us ], [ %g.3.us.1, %for.inc24.us.1 ]
%indvars.iv317.unr = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next318.1, %for.inc24.us.1 ]
%g.1264.us.unr = phi i32 [ %g.0267.us, %for.cond5.preheader.us ], [ %g.3.us.1, %for.inc24.us.1 ]
%f.0263.us.unr = phi i32 [ 0, %for.cond5.preheader.us ], [ %f.2.us.1, %for.inc24.us.1 ]
br i1 %lcmp.mod.not, label %for.cond5.for.inc27_crit_edge.us, label %for.body7.us.epil
for.body7.us.epil: ; preds = %for.cond5.for.inc27_crit_edge.us.unr-lcssa
%arrayidx11.us.epil = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv320, i64 %indvars.iv317.unr
%7 = load i8, ptr %arrayidx11.us.epil, align 1, !tbaa !9
%cmp12.us.epil = icmp eq i8 %7, 46
br i1 %cmp12.us.epil, label %if.then.us.epil, label %for.cond5.for.inc27_crit_edge.us
if.then.us.epil: ; preds = %for.body7.us.epil
%cmp14.us.epil = icmp eq i32 %f.0263.us.unr, 0
%8 = trunc i64 %indvars.iv317.unr to i32
%spec.select.us.epil = select i1 %cmp14.us.epil, i32 %8, i32 %g.1264.us.unr
%sub.us.epil = sub nsw i32 %8, %spec.select.us.epil
%conv17.us.epil = trunc i32 %sub.us.epil to i16
%arrayidx21.us.epil = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv320, i64 %indvars.iv317.unr
store i16 %conv17.us.epil, ptr %arrayidx21.us.epil, align 8, !tbaa !10
br label %for.cond5.for.inc27_crit_edge.us
for.cond5.for.inc27_crit_edge.us: ; preds = %for.body7.us.epil, %if.then.us.epil, %for.cond5.for.inc27_crit_edge.us.unr-lcssa
%g.3.us.lcssa = phi i32 [ %g.3.us.lcssa.ph, %for.cond5.for.inc27_crit_edge.us.unr-lcssa ], [ %spec.select.us.epil, %if.then.us.epil ], [ %g.1264.us.unr, %for.body7.us.epil ]
%indvars.iv.next321 = add nuw nsw i64 %indvars.iv320, 1
%exitcond324.not = icmp eq i64 %indvars.iv.next321, %wide.trip.count323
br i1 %exitcond324.not, label %for.cond30.preheader, label %for.cond5.preheader.us, !llvm.loop !14
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, 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
%9 = load i32, ptr %h, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !15
for.cond30.preheader: ; preds = %for.cond5.for.inc27_crit_edge.us
br i1 %cmp3266, label %for.body33.lr.ph, label %for.cond65.preheader
for.body33.lr.ph: ; preds = %for.cond30.preheader
%cmp36271 = icmp sgt i32 %.pre.pre, 0
br i1 %cmp36271, label %for.body33.us.preheader, label %for.end189
for.body33.us.preheader: ; preds = %for.body33.lr.ph
%11 = zext i32 %.pre.pre to i64
%wide.trip.count332 = zext i32 %9 to i64
%xtraiter482 = and i64 %wide.trip.count, 1
%12 = icmp eq i64 %1, 0
%unroll_iter485 = and i64 %wide.trip.count, 4294967294
%lcmp.mod483.not = icmp eq i64 %xtraiter482, 0
br label %for.body33.us
for.body33.us: ; preds = %for.body33.us.preheader, %for.cond35.for.inc62_crit_edge.us
%indvars.iv328 = phi i64 [ 0, %for.body33.us.preheader ], [ %indvars.iv.next329, %for.cond35.for.inc62_crit_edge.us ]
%g.4277.us = phi i32 [ %g.3.us.lcssa, %for.body33.us.preheader ], [ %g.7.us.lcssa, %for.cond35.for.inc62_crit_edge.us ]
br i1 %12, label %for.cond35.for.inc62_crit_edge.us.unr-lcssa, label %for.body38.us
for.body38.us: ; preds = %for.body33.us, %for.inc60.us.1
%indvars.iv325 = phi i64 [ %indvars.iv.next326.1, %for.inc60.us.1 ], [ %11, %for.body33.us ]
%g.5273.us = phi i32 [ %g.7.us.1, %for.inc60.us.1 ], [ %g.4277.us, %for.body33.us ]
%f.3272.us = phi i32 [ %f.5.us.1, %for.inc60.us.1 ], [ 0, %for.body33.us ]
%niter486 = phi i64 [ %niter486.next.1, %for.inc60.us.1 ], [ 0, %for.body33.us ]
%indvars.iv.next326 = add nsw i64 %indvars.iv325, -1
%idxprom41.us = and i64 %indvars.iv.next326, 4294967295
%arrayidx42.us = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv328, i64 %idxprom41.us
%13 = load i8, ptr %arrayidx42.us, align 1, !tbaa !9
%cmp44.us.not = icmp eq i8 %13, 46
br i1 %cmp44.us.not, label %if.then46.us, label %for.inc60.us
if.then46.us: ; preds = %for.body38.us
%indvars = trunc i64 %indvars.iv.next326 to i32
%cmp47.us = icmp eq i32 %f.3272.us, 0
%spec.select254.us = select i1 %cmp47.us, i32 %indvars, i32 %g.5273.us
%sub51.us = sub nsw i32 %spec.select254.us, %indvars
%conv52.us = trunc i32 %sub51.us to i16
%arrayidx57.us = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv328, i64 %idxprom41.us, i64 1
store i16 %conv52.us, ptr %arrayidx57.us, align 2, !tbaa !10
br label %for.inc60.us
for.inc60.us: ; preds = %if.then46.us, %for.body38.us
%g.7.us = phi i32 [ %spec.select254.us, %if.then46.us ], [ %g.5273.us, %for.body38.us ]
%indvars.iv.next326.1 = add nsw i64 %indvars.iv325, -2
%idxprom41.us.1 = and i64 %indvars.iv.next326.1, 4294967295
%arrayidx42.us.1 = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv328, i64 %idxprom41.us.1
%14 = load i8, ptr %arrayidx42.us.1, align 1, !tbaa !9
%cmp44.us.1 = icmp eq i8 %14, 46
br i1 %cmp44.us.1, label %if.then46.us.1, label %for.inc60.us.1
if.then46.us.1: ; preds = %for.inc60.us
%indvars.1 = trunc i64 %indvars.iv.next326.1 to i32
%spec.select254.us.1 = select i1 %cmp44.us.not, i32 %g.7.us, i32 %indvars.1
%sub51.us.1 = sub nsw i32 %spec.select254.us.1, %indvars.1
%conv52.us.1 = trunc i32 %sub51.us.1 to i16
%arrayidx57.us.1 = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv328, i64 %idxprom41.us.1, i64 1
store i16 %conv52.us.1, ptr %arrayidx57.us.1, align 2, !tbaa !10
br label %for.inc60.us.1
for.inc60.us.1: ; preds = %if.then46.us.1, %for.inc60.us
%f.5.us.1 = phi i32 [ 1, %if.then46.us.1 ], [ 0, %for.inc60.us ]
%g.7.us.1 = phi i32 [ %spec.select254.us.1, %if.then46.us.1 ], [ %g.7.us, %for.inc60.us ]
%niter486.next.1 = add i64 %niter486, 2
%niter486.ncmp.1.not = icmp eq i64 %niter486.next.1, %unroll_iter485
br i1 %niter486.ncmp.1.not, label %for.cond35.for.inc62_crit_edge.us.unr-lcssa, label %for.body38.us, !llvm.loop !16
for.cond35.for.inc62_crit_edge.us.unr-lcssa: ; preds = %for.inc60.us.1, %for.body33.us
%g.7.us.lcssa.ph = phi i32 [ undef, %for.body33.us ], [ %g.7.us.1, %for.inc60.us.1 ]
%indvars.iv325.unr = phi i64 [ %11, %for.body33.us ], [ %indvars.iv.next326.1, %for.inc60.us.1 ]
%g.5273.us.unr = phi i32 [ %g.4277.us, %for.body33.us ], [ %g.7.us.1, %for.inc60.us.1 ]
%f.3272.us.unr = phi i32 [ 0, %for.body33.us ], [ %f.5.us.1, %for.inc60.us.1 ]
br i1 %lcmp.mod483.not, label %for.cond35.for.inc62_crit_edge.us, label %for.body38.us.epil
for.body38.us.epil: ; preds = %for.cond35.for.inc62_crit_edge.us.unr-lcssa
%indvars.iv.next326.epil = add nsw i64 %indvars.iv325.unr, -1
%idxprom41.us.epil = and i64 %indvars.iv.next326.epil, 4294967295
%arrayidx42.us.epil = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv328, i64 %idxprom41.us.epil
%15 = load i8, ptr %arrayidx42.us.epil, align 1, !tbaa !9
%cmp44.us.epil = icmp eq i8 %15, 46
br i1 %cmp44.us.epil, label %if.then46.us.epil, label %for.cond35.for.inc62_crit_edge.us
if.then46.us.epil: ; preds = %for.body38.us.epil
%indvars.epil = trunc i64 %indvars.iv.next326.epil to i32
%cmp47.us.epil = icmp eq i32 %f.3272.us.unr, 0
%spec.select254.us.epil = select i1 %cmp47.us.epil, i32 %indvars.epil, i32 %g.5273.us.unr
%sub51.us.epil = sub nsw i32 %spec.select254.us.epil, %indvars.epil
%conv52.us.epil = trunc i32 %sub51.us.epil to i16
%arrayidx57.us.epil = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv328, i64 %idxprom41.us.epil, i64 1
store i16 %conv52.us.epil, ptr %arrayidx57.us.epil, align 2, !tbaa !10
br label %for.cond35.for.inc62_crit_edge.us
for.cond35.for.inc62_crit_edge.us: ; preds = %for.body38.us.epil, %if.then46.us.epil, %for.cond35.for.inc62_crit_edge.us.unr-lcssa
%g.7.us.lcssa = phi i32 [ %g.7.us.lcssa.ph, %for.cond35.for.inc62_crit_edge.us.unr-lcssa ], [ %spec.select254.us.epil, %if.then46.us.epil ], [ %g.5273.us.unr, %for.body38.us.epil ]
%indvars.iv.next329 = add nuw nsw i64 %indvars.iv328, 1
%exitcond333.not = icmp eq i64 %indvars.iv.next329, %wide.trip.count332
br i1 %exitcond333.not, label %for.cond65.preheader, label %for.body33.us, !llvm.loop !17
for.cond65.preheader: ; preds = %for.cond35.for.inc62_crit_edge.us, %for.cond2.preheader, %for.cond30.preheader
%cmp3266372379 = phi i1 [ false, %for.cond30.preheader ], [ false, %for.cond2.preheader ], [ true, %for.cond35.for.inc62_crit_edge.us ]
%g.4.lcssa = phi i32 [ %g.3.us.lcssa, %for.cond30.preheader ], [ undef, %for.cond2.preheader ], [ %g.7.us.lcssa, %for.cond35.for.inc62_crit_edge.us ]
%cmp66286 = icmp sgt i32 %.pre.pre, 0
%brmerge.not = and i1 %cmp66286, %cmp3266372379
br i1 %brmerge.not, label %for.cond69.preheader.us.preheader, label %for.end189
for.cond69.preheader.us.preheader: ; preds = %for.cond65.preheader
%wide.trip.count344 = zext i32 %.pre.pre to i64
%wide.trip.count338 = zext i32 %9 to i64
%xtraiter487 = and i64 %wide.trip.count338, 1
%16 = icmp eq i32 %9, 1
%unroll_iter490 = and i64 %wide.trip.count338, 4294967294
%lcmp.mod488.not = icmp eq i64 %xtraiter487, 0
br label %for.cond69.preheader.us
for.cond69.preheader.us: ; preds = %for.cond69.preheader.us.preheader, %for.cond69.for.inc97_crit_edge.us
%indvars.iv340 = phi i64 [ 0, %for.cond69.preheader.us.preheader ], [ %indvars.iv.next341, %for.cond69.for.inc97_crit_edge.us ]
%g.8288.us = phi i32 [ %g.4.lcssa, %for.cond69.preheader.us.preheader ], [ %g.11.us.lcssa, %for.cond69.for.inc97_crit_edge.us ]
br i1 %16, label %for.cond69.for.inc97_crit_edge.us.unr-lcssa, label %for.body72.us
for.body72.us: ; preds = %for.cond69.preheader.us, %for.inc94.us.1
%indvars.iv334 = phi i64 [ %indvars.iv.next335.1, %for.inc94.us.1 ], [ 0, %for.cond69.preheader.us ]
%g.9283.us = phi i32 [ %g.11.us.1, %for.inc94.us.1 ], [ %g.8288.us, %for.cond69.preheader.us ]
%f.6282.us = phi i32 [ %f.8.us.1, %for.inc94.us.1 ], [ 0, %for.cond69.preheader.us ]
%niter491 = phi i64 [ %niter491.next.1, %for.inc94.us.1 ], [ 0, %for.cond69.preheader.us ]
%arrayidx76.us = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv334, i64 %indvars.iv340
%17 = load i8, ptr %arrayidx76.us, align 1, !tbaa !9
%cmp78.us.not = icmp eq i8 %17, 46
br i1 %cmp78.us.not, label %if.then80.us, label %for.inc94.us
if.then80.us: ; preds = %for.body72.us
%cmp81.us = icmp eq i32 %f.6282.us, 0
%18 = trunc i64 %indvars.iv334 to i32
%spec.select255.us = select i1 %cmp81.us, i32 %18, i32 %g.9283.us
%sub85.us = sub nsw i32 %18, %spec.select255.us
%conv86.us = trunc i32 %sub85.us to i16
%arrayidx91.us = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv334, i64 %indvars.iv340, i64 2
store i16 %conv86.us, ptr %arrayidx91.us, align 4, !tbaa !10
br label %for.inc94.us
for.inc94.us: ; preds = %if.then80.us, %for.body72.us
%g.11.us = phi i32 [ %spec.select255.us, %if.then80.us ], [ %g.9283.us, %for.body72.us ]
%indvars.iv.next335 = or i64 %indvars.iv334, 1
%arrayidx76.us.1 = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv.next335, i64 %indvars.iv340
%19 = load i8, ptr %arrayidx76.us.1, align 1, !tbaa !9
%cmp78.us.1 = icmp eq i8 %19, 46
br i1 %cmp78.us.1, label %if.then80.us.1, label %for.inc94.us.1
if.then80.us.1: ; preds = %for.inc94.us
%20 = trunc i64 %indvars.iv.next335 to i32
%spec.select255.us.1 = select i1 %cmp78.us.not, i32 %g.11.us, i32 %20
%sub85.us.1 = sub nsw i32 %20, %spec.select255.us.1
%conv86.us.1 = trunc i32 %sub85.us.1 to i16
%arrayidx91.us.1 = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv.next335, i64 %indvars.iv340, i64 2
store i16 %conv86.us.1, ptr %arrayidx91.us.1, align 4, !tbaa !10
br label %for.inc94.us.1
for.inc94.us.1: ; preds = %if.then80.us.1, %for.inc94.us
%f.8.us.1 = phi i32 [ 1, %if.then80.us.1 ], [ 0, %for.inc94.us ]
%g.11.us.1 = phi i32 [ %spec.select255.us.1, %if.then80.us.1 ], [ %g.11.us, %for.inc94.us ]
%indvars.iv.next335.1 = add nuw nsw i64 %indvars.iv334, 2
%niter491.next.1 = add i64 %niter491, 2
%niter491.ncmp.1 = icmp eq i64 %niter491.next.1, %unroll_iter490
br i1 %niter491.ncmp.1, label %for.cond69.for.inc97_crit_edge.us.unr-lcssa, label %for.body72.us, !llvm.loop !18
for.cond69.for.inc97_crit_edge.us.unr-lcssa: ; preds = %for.inc94.us.1, %for.cond69.preheader.us
%g.11.us.lcssa.ph = phi i32 [ undef, %for.cond69.preheader.us ], [ %g.11.us.1, %for.inc94.us.1 ]
%indvars.iv334.unr = phi i64 [ 0, %for.cond69.preheader.us ], [ %indvars.iv.next335.1, %for.inc94.us.1 ]
%g.9283.us.unr = phi i32 [ %g.8288.us, %for.cond69.preheader.us ], [ %g.11.us.1, %for.inc94.us.1 ]
%f.6282.us.unr = phi i32 [ 0, %for.cond69.preheader.us ], [ %f.8.us.1, %for.inc94.us.1 ]
br i1 %lcmp.mod488.not, label %for.cond69.for.inc97_crit_edge.us, label %for.body72.us.epil
for.body72.us.epil: ; preds = %for.cond69.for.inc97_crit_edge.us.unr-lcssa
%arrayidx76.us.epil = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv334.unr, i64 %indvars.iv340
%21 = load i8, ptr %arrayidx76.us.epil, align 1, !tbaa !9
%cmp78.us.epil = icmp eq i8 %21, 46
br i1 %cmp78.us.epil, label %if.then80.us.epil, label %for.cond69.for.inc97_crit_edge.us
if.then80.us.epil: ; preds = %for.body72.us.epil
%cmp81.us.epil = icmp eq i32 %f.6282.us.unr, 0
%22 = trunc i64 %indvars.iv334.unr to i32
%spec.select255.us.epil = select i1 %cmp81.us.epil, i32 %22, i32 %g.9283.us.unr
%sub85.us.epil = sub nsw i32 %22, %spec.select255.us.epil
%conv86.us.epil = trunc i32 %sub85.us.epil to i16
%arrayidx91.us.epil = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv334.unr, i64 %indvars.iv340, i64 2
store i16 %conv86.us.epil, ptr %arrayidx91.us.epil, align 4, !tbaa !10
br label %for.cond69.for.inc97_crit_edge.us
for.cond69.for.inc97_crit_edge.us: ; preds = %for.body72.us.epil, %if.then80.us.epil, %for.cond69.for.inc97_crit_edge.us.unr-lcssa
%g.11.us.lcssa = phi i32 [ %g.11.us.lcssa.ph, %for.cond69.for.inc97_crit_edge.us.unr-lcssa ], [ %spec.select255.us.epil, %if.then80.us.epil ], [ %g.9283.us.unr, %for.body72.us.epil ]
%indvars.iv.next341 = add nuw nsw i64 %indvars.iv340, 1
%exitcond345.not = icmp eq i64 %indvars.iv.next341, %wide.trip.count344
br i1 %exitcond345.not, label %for.cond105.preheader.lr.ph, label %for.cond69.preheader.us, !llvm.loop !19
for.cond105.preheader.lr.ph: ; preds = %for.cond69.for.inc97_crit_edge.us
br i1 %cmp3266372379, label %for.cond105.preheader.us.preheader, label %for.end189
for.cond105.preheader.us.preheader: ; preds = %for.cond105.preheader.lr.ph
%23 = zext i32 %9 to i64
%wide.trip.count354 = zext i32 %.pre.pre to i64
br label %for.cond105.preheader.us
for.cond105.preheader.us: ; preds = %for.cond105.preheader.us.preheader, %for.cond105.for.inc133_crit_edge.us
%indvars.iv350 = phi i64 [ 0, %for.cond105.preheader.us.preheader ], [ %indvars.iv.next351, %for.cond105.for.inc133_crit_edge.us ]
%g.12301.us = phi i32 [ %g.11.us.lcssa, %for.cond105.preheader.us.preheader ], [ %g.15.us, %for.cond105.for.inc133_crit_edge.us ]
br label %for.body108.us
for.body108.us: ; preds = %for.cond105.preheader.us, %for.inc130.us
%indvars.iv346 = phi i64 [ %23, %for.cond105.preheader.us ], [ %indvars.iv.next347, %for.inc130.us ]
%g.13296.us = phi i32 [ %g.12301.us, %for.cond105.preheader.us ], [ %g.15.us, %for.inc130.us ]
%f.9295.us = phi i32 [ 0, %for.cond105.preheader.us ], [ %f.11.us, %for.inc130.us ]
%indvars.iv.next347 = add nsw i64 %indvars.iv346, -1
%idxprom109.us = and i64 %indvars.iv.next347, 4294967295
%arrayidx112.us = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %idxprom109.us, i64 %indvars.iv350
%24 = load i8, ptr %arrayidx112.us, align 1, !tbaa !9
%cmp114.us = icmp eq i8 %24, 46
br i1 %cmp114.us, label %if.then116.us, label %for.inc130.us
if.then116.us: ; preds = %for.body108.us
%indvars348 = trunc i64 %indvars.iv.next347 to i32
%cmp117.us = icmp eq i32 %f.9295.us, 0
%spec.select256.us = select i1 %cmp117.us, i32 %indvars348, i32 %g.13296.us
%sub121.us = sub nsw i32 %spec.select256.us, %indvars348
%conv122.us = trunc i32 %sub121.us to i16
%arrayidx127.us = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %idxprom109.us, i64 %indvars.iv350, i64 3
store i16 %conv122.us, ptr %arrayidx127.us, align 2, !tbaa !10
br label %for.inc130.us
for.inc130.us: ; preds = %if.then116.us, %for.body108.us
%f.11.us = phi i32 [ 1, %if.then116.us ], [ 0, %for.body108.us ]
%g.15.us = phi i32 [ %spec.select256.us, %if.then116.us ], [ %g.13296.us, %for.body108.us ]
%cmp106.us = icmp sgt i64 %indvars.iv346, 1
br i1 %cmp106.us, label %for.body108.us, label %for.cond105.for.inc133_crit_edge.us, !llvm.loop !20
for.cond105.for.inc133_crit_edge.us: ; preds = %for.inc130.us
%indvars.iv.next351 = add nuw nsw i64 %indvars.iv350, 1
%exitcond355.not = icmp eq i64 %indvars.iv.next351, %wide.trip.count354
br i1 %exitcond355.not, label %for.cond136.preheader, label %for.cond105.preheader.us, !llvm.loop !21
for.cond136.preheader: ; preds = %for.cond105.for.inc133_crit_edge.us
br i1 %cmp3266372379, label %for.cond140.preheader.us.preheader, label %for.end189
for.cond140.preheader.us.preheader: ; preds = %for.cond136.preheader
%wide.trip.count366 = zext i32 %9 to i64
%wide.trip.count360 = zext i32 %.pre.pre to i64
br label %for.cond140.preheader.us
for.cond140.preheader.us: ; preds = %for.cond140.preheader.us.preheader, %for.cond140.for.inc187_crit_edge.us
%indvars.iv362 = phi i64 [ 0, %for.cond140.preheader.us.preheader ], [ %indvars.iv.next363, %for.cond140.for.inc187_crit_edge.us ]
%ans.0307.us = phi i32 [ 0, %for.cond140.preheader.us.preheader ], [ %ans.3.us, %for.cond140.for.inc187_crit_edge.us ]
br label %for.body143.us
for.body143.us: ; preds = %for.cond140.preheader.us, %for.inc184.us
%indvars.iv356 = phi i64 [ 0, %for.cond140.preheader.us ], [ %indvars.iv.next357, %for.inc184.us ]
%ans.1304.us = phi i32 [ %ans.0307.us, %for.cond140.preheader.us ], [ %ans.3.us, %for.inc184.us ]
%arrayidx147.us = getelementptr inbounds [2000 x [2001 x i8]], ptr @s, i64 0, i64 %indvars.iv362, i64 %indvars.iv356
%25 = load i8, ptr %arrayidx147.us, align 1, !tbaa !9
%cmp149.us = icmp eq i8 %25, 46
br i1 %cmp149.us, label %if.then151.us, label %for.inc184.us
if.then151.us: ; preds = %for.body143.us
%arrayidx155.us = getelementptr inbounds [2000 x [2000 x [4 x i16]]], ptr @d, i64 0, i64 %indvars.iv362, i64 %indvars.iv356
%26 = load <4 x i16>, ptr %arrayidx155.us, align 8, !tbaa !10
%27 = sext <4 x i16> %26 to <4 x i32>
%28 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %27)
%cmp179.not.us = icmp slt i32 %28, %ans.1304.us
%add178.us = add nsw i32 %28, 1
%spec.select257.us = select i1 %cmp179.not.us, i32 %ans.1304.us, i32 %add178.us
br label %for.inc184.us
for.inc184.us: ; preds = %if.then151.us, %for.body143.us
%ans.3.us = phi i32 [ %spec.select257.us, %if.then151.us ], [ %ans.1304.us, %for.body143.us ]
%indvars.iv.next357 = add nuw nsw i64 %indvars.iv356, 1
%exitcond361.not = icmp eq i64 %indvars.iv.next357, %wide.trip.count360
br i1 %exitcond361.not, label %for.cond140.for.inc187_crit_edge.us, label %for.body143.us, !llvm.loop !22
for.cond140.for.inc187_crit_edge.us: ; preds = %for.inc184.us
%indvars.iv.next363 = add nuw nsw i64 %indvars.iv362, 1
%exitcond367.not = icmp eq i64 %indvars.iv.next363, %wide.trip.count366
br i1 %exitcond367.not, label %for.end189, label %for.cond140.preheader.us, !llvm.loop !23
for.end189: ; preds = %for.cond140.for.inc187_crit_edge.us, %for.cond65.preheader, %entry, %for.body33.lr.ph, %for.cond5.preheader.lr.ph, %for.cond105.preheader.lr.ph, %for.cond136.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond136.preheader ], [ 0, %for.cond105.preheader.lr.ph ], [ 0, %for.cond5.preheader.lr.ph ], [ 0, %for.body33.lr.ph ], [ 0, %entry ], [ 0, %for.cond65.preheader ], [ %ans.3.us, %for.cond140.for.inc187_crit_edge.us ]
%call190 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
|
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{
int h, w;
int i, j, k;
int sum = 0;
int count;
int grid_w[2000][2000] = {{0}};
int grid_h[2000][2000] = {{0}};
char str[2000][2001];
scanf("%d%d", &h, &w);
for(i = 0; i < h; i++) {
scanf("%s", str[i]);
}
// 横方向で何個連続してるかカウント
for(i = 0; i < h; i++) {
count = 0;
for(j = 0; j < w; j++) {
if(str[i][j] == '#') {
grid_w[i][j] = 0;
if(count > 0) {
for(k = 0; k < count; k++) {
grid_w[i][j - k - 1] = count;
}
}
count = 0;
} else {
count++;
}
}
if(str[i][j - 1] == '.') {
for(k = 0; k < count; k++) {
grid_w[i][j - k - 1] = count;
}
}
}
// 縦方向で何個連続してるかカウント
for(j = 0; j < w; j++) {
count = 0;
for(i = 0; i < h; i++) {
if(str[i][j] == '#') {
grid_h[i][j] = 0;
if(count > 0) {
for(k = 0; k < count; k++) {
grid_h[i - k - 1][j] = count;
}
}
count = 0;
} else {
count++;
}
}
if(str[i - 1][j] == '.') {
for(k = 0; k < count; k++) {
grid_h[i - k - 1][j] = count;
}
}
}
for(i = 0; i < h; i++) {
for(j = 0; j < w; j++) {
if(grid_w[i][j] + grid_h[i][j] - 1 > sum) {
sum = grid_w[i][j] + grid_h[i][j] - 1;
}
}
}
printf("%d\n", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143232/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143232/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%grid_w = alloca [2000 x [2000 x i32]], align 16
%grid_h = alloca [2000 x [2000 x i32]], align 16
%str = alloca [2000 x [2001 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 16000000, ptr nonnull %grid_w) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16000000) %grid_w, i8 0, i64 16000000, i1 false)
call void @llvm.lifetime.start.p0(i64 16000000, ptr nonnull %grid_h) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16000000) %grid_h, i8 0, i64 16000000, i1 false)
call void @llvm.lifetime.start.p0(i64 4002000, ptr nonnull %str) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp236 = icmp sgt i32 %0, 0
br i1 %cmp236, label %for.body, label %for.end169
for.cond2.preheader: ; preds = %for.body
%cmp3246 = icmp slt i32 %18, 1
%.pre = load i32, ptr %w, align 4, !tbaa !5
br i1 %cmp3246, label %for.cond64.preheader, label %for.cond5.preheader.lr.ph
for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader
%cmp6239 = icmp sgt i32 %.pre, 0
br i1 %cmp6239, label %for.cond5.preheader.us.preheader, label %for.end169
for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph
%wide.trip.count291 = zext i32 %18 to i64
%wide.trip.count280 = zext i32 %.pre to i64
br label %for.cond5.preheader.us
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.inc61.us
%indvars.iv288 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next289, %for.inc61.us ]
br label %for.body7.us
for.inc61.us: ; preds = %for.body50.us, %middle.block, %for.cond5.for.end37_crit_edge.us
%indvars.iv.next289 = add nuw nsw i64 %indvars.iv288, 1
%exitcond292.not = icmp eq i64 %indvars.iv.next289, %wide.trip.count291
br i1 %exitcond292.not, label %for.cond64.preheader, label %for.cond5.preheader.us, !llvm.loop !9
for.body50.us: ; preds = %for.body50.us.preheader406, %for.body50.us
%indvars.iv282 = phi i64 [ %indvars.iv.next283, %for.body50.us ], [ %indvars.iv282.ph, %for.body50.us.preheader406 ]
%1 = sub nsw i64 %12, %indvars.iv282
%arrayidx56.us = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_w, i64 0, i64 %indvars.iv288, i64 %1
store i32 %count.1.us, ptr %arrayidx56.us, align 4, !tbaa !5
%indvars.iv.next283 = add nuw nsw i64 %indvars.iv282, 1
%exitcond287.not = icmp eq i64 %indvars.iv.next283, %wide.trip.count286
br i1 %exitcond287.not, label %for.inc61.us, label %for.body50.us, !llvm.loop !11
for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc35.us
%indvars.iv277 = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next278, %for.inc35.us ]
%count.0241.us = phi i32 [ 0, %for.cond5.preheader.us ], [ %count.1.us, %for.inc35.us ]
%arrayidx11.us = getelementptr inbounds [2000 x [2001 x i8]], ptr %str, i64 0, i64 %indvars.iv288, i64 %indvars.iv277
%2 = load i8, ptr %arrayidx11.us, align 1, !tbaa !14
%cmp12.us = icmp eq i8 %2, 35
br i1 %cmp12.us, label %if.then.us, label %if.else.us
if.else.us: ; preds = %for.body7.us
%inc33.us = add nsw i32 %count.0241.us, 1
br label %for.inc35.us
if.then.us: ; preds = %for.body7.us
%arrayidx17.us = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_w, i64 0, i64 %indvars.iv288, i64 %indvars.iv277
store i32 0, ptr %arrayidx17.us, align 4, !tbaa !5
%cmp18.us = icmp sgt i32 %count.0241.us, 0
br i1 %cmp18.us, label %for.body24.us.preheader, label %for.inc35.us
for.body24.us.preheader: ; preds = %if.then.us
%wide.trip.count = zext i32 %count.0241.us to i64
%min.iters.check375 = icmp ult i32 %count.0241.us, 8
br i1 %min.iters.check375, label %for.body24.us.preheader405, label %vector.ph376
vector.ph376: ; preds = %for.body24.us.preheader
%n.vec378 = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert383 = insertelement <4 x i32> poison, i32 %count.0241.us, i64 0
%broadcast.splat384 = shufflevector <4 x i32> %broadcast.splatinsert383, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body381
vector.body381: ; preds = %vector.body381, %vector.ph376
%index382 = phi i64 [ 0, %vector.ph376 ], [ %index.next387, %vector.body381 ]
%3 = xor i64 %index382, -1
%4 = add nsw i64 %indvars.iv277, %3
%5 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_w, i64 0, i64 %indvars.iv288, i64 %4
%6 = getelementptr inbounds i32, ptr %5, i64 -3
store <4 x i32> %broadcast.splat384, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %5, i64 -7
store <4 x i32> %broadcast.splat384, ptr %7, align 4, !tbaa !5
%index.next387 = add nuw i64 %index382, 8
%8 = icmp eq i64 %index.next387, %n.vec378
br i1 %8, label %middle.block373, label %vector.body381, !llvm.loop !15
middle.block373: ; preds = %vector.body381
%cmp.n380 = icmp eq i64 %n.vec378, %wide.trip.count
br i1 %cmp.n380, label %for.inc35.us, label %for.body24.us.preheader405
for.body24.us.preheader405: ; preds = %for.body24.us.preheader, %middle.block373
%indvars.iv273.ph = phi i64 [ 0, %for.body24.us.preheader ], [ %n.vec378, %middle.block373 ]
br label %for.body24.us
for.inc35.us: ; preds = %for.body24.us, %middle.block373, %if.then.us, %if.else.us
%count.1.us = phi i32 [ %inc33.us, %if.else.us ], [ 0, %if.then.us ], [ 0, %middle.block373 ], [ 0, %for.body24.us ]
%indvars.iv.next278 = add nuw nsw i64 %indvars.iv277, 1
%exitcond281.not = icmp eq i64 %indvars.iv.next278, %wide.trip.count280
br i1 %exitcond281.not, label %for.cond5.for.end37_crit_edge.us, label %for.body7.us, !llvm.loop !16
for.body24.us: ; preds = %for.body24.us.preheader405, %for.body24.us
%indvars.iv273 = phi i64 [ %indvars.iv.next274, %for.body24.us ], [ %indvars.iv273.ph, %for.body24.us.preheader405 ]
%9 = xor i64 %indvars.iv273, -1
%10 = add nsw i64 %indvars.iv277, %9
%arrayidx29.us = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_w, i64 0, i64 %indvars.iv288, i64 %10
store i32 %count.0241.us, ptr %arrayidx29.us, align 4, !tbaa !5
%indvars.iv.next274 = add nuw nsw i64 %indvars.iv273, 1
%exitcond.not = icmp eq i64 %indvars.iv.next274, %wide.trip.count
br i1 %exitcond.not, label %for.inc35.us, label %for.body24.us, !llvm.loop !17
for.cond5.for.end37_crit_edge.us: ; preds = %for.inc35.us
%idxprom41.us = and i64 %indvars.iv277, 4294967295
%arrayidx42.us = getelementptr inbounds [2000 x [2001 x i8]], ptr %str, i64 0, i64 %indvars.iv288, i64 %idxprom41.us
%11 = load i8, ptr %arrayidx42.us, align 1, !tbaa !14
%cmp44.us = icmp eq i8 %11, 46
%cmp48244.us = icmp sgt i32 %count.1.us, 0
%or.cond = select i1 %cmp44.us, i1 %cmp48244.us, i1 false
br i1 %or.cond, label %for.body50.us.preheader, label %for.inc61.us
for.body50.us.preheader: ; preds = %for.cond5.for.end37_crit_edge.us
%sext = shl i64 %indvars.iv277, 32
%12 = ashr exact i64 %sext, 32
%wide.trip.count286 = zext i32 %count.1.us to i64
%min.iters.check = icmp ult i32 %count.1.us, 8
br i1 %min.iters.check, label %for.body50.us.preheader406, label %vector.ph
vector.ph: ; preds = %for.body50.us.preheader
%n.vec = and i64 %wide.trip.count286, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %count.1.us, 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 ]
%13 = sub nsw i64 %12, %index
%14 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_w, i64 0, i64 %indvars.iv288, i64 %13
%15 = getelementptr inbounds i32, ptr %14, i64 -3
store <4 x i32> %broadcast.splat, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %14, i64 -7
store <4 x i32> %broadcast.splat, ptr %16, align 4, !tbaa !5
%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 !18
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count286
br i1 %cmp.n, label %for.inc61.us, label %for.body50.us.preheader406
for.body50.us.preheader406: ; preds = %for.body50.us.preheader, %middle.block
%indvars.iv282.ph = phi i64 [ 0, %for.body50.us.preheader ], [ %n.vec, %middle.block ]
br label %for.body50.us
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [2000 x [2001 x i8]], ptr %str, 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
%18 = load i32, ptr %h, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp = icmp slt i64 %indvars.iv.next, %19
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !19
for.cond64.preheader: ; preds = %for.inc61.us, %for.cond2.preheader
%cmp65256 = icmp slt i32 %.pre, 1
br i1 %cmp65256, label %for.cond133.preheader, label %for.cond68.preheader.lr.ph
for.cond68.preheader.lr.ph: ; preds = %for.cond64.preheader
br i1 %cmp3246, label %for.end169, label %for.cond68.preheader.us.preheader
for.cond68.preheader.us.preheader: ; preds = %for.cond68.preheader.lr.ph
%wide.trip.count313 = zext i32 %.pre to i64
%wide.trip.count302 = zext i32 %18 to i64
br label %for.cond68.preheader.us
for.cond68.preheader.us: ; preds = %for.cond68.preheader.us.preheader, %for.inc130.us
%indvars.iv310 = phi i64 [ 0, %for.cond68.preheader.us.preheader ], [ %indvars.iv.next311, %for.inc130.us ]
br label %for.body71.us
for.inc130.us.loopexit.unr-lcssa: ; preds = %for.body119.us, %for.body119.us.preheader
%indvars.iv304.unr = phi i64 [ 0, %for.body119.us.preheader ], [ %indvars.iv.next305.3, %for.body119.us ]
%lcmp.mod410.not = icmp eq i64 %xtraiter408, 0
br i1 %lcmp.mod410.not, label %for.inc130.us, label %for.body119.us.epil
for.body119.us.epil: ; preds = %for.inc130.us.loopexit.unr-lcssa, %for.body119.us.epil
%indvars.iv304.epil = phi i64 [ %indvars.iv.next305.epil, %for.body119.us.epil ], [ %indvars.iv304.unr, %for.inc130.us.loopexit.unr-lcssa ]
%epil.iter409 = phi i64 [ %epil.iter409.next, %for.body119.us.epil ], [ 0, %for.inc130.us.loopexit.unr-lcssa ]
%20 = sub nsw i64 %38, %indvars.iv304.epil
%arrayidx125.us.epil = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %20, i64 %indvars.iv310
store i32 %count.3.us, ptr %arrayidx125.us.epil, align 4, !tbaa !5
%indvars.iv.next305.epil = add nuw nsw i64 %indvars.iv304.epil, 1
%epil.iter409.next = add i64 %epil.iter409, 1
%epil.iter409.cmp.not = icmp eq i64 %epil.iter409.next, %xtraiter408
br i1 %epil.iter409.cmp.not, label %for.inc130.us, label %for.body119.us.epil, !llvm.loop !20
for.inc130.us: ; preds = %for.inc130.us.loopexit.unr-lcssa, %for.body119.us.epil, %for.cond68.for.end106_crit_edge.us
%indvars.iv.next311 = add nuw nsw i64 %indvars.iv310, 1
%exitcond314.not = icmp eq i64 %indvars.iv.next311, %wide.trip.count313
br i1 %exitcond314.not, label %for.cond133.preheader, label %for.cond68.preheader.us, !llvm.loop !22
for.body119.us: ; preds = %for.body119.us, %for.body119.us.preheader.new
%indvars.iv304 = phi i64 [ 0, %for.body119.us.preheader.new ], [ %indvars.iv.next305.3, %for.body119.us ]
%niter412 = phi i64 [ 0, %for.body119.us.preheader.new ], [ %niter412.next.3, %for.body119.us ]
%21 = sub nsw i64 %38, %indvars.iv304
%arrayidx125.us = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %21, i64 %indvars.iv310
store i32 %count.3.us, ptr %arrayidx125.us, align 4, !tbaa !5
%indvars.iv.next305.neg = xor i64 %indvars.iv304, -1
%22 = add i64 %38, %indvars.iv.next305.neg
%arrayidx125.us.1 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %22, i64 %indvars.iv310
store i32 %count.3.us, ptr %arrayidx125.us.1, align 4, !tbaa !5
%indvars.iv.next305.1 = or i64 %indvars.iv304, 2
%23 = sub nsw i64 %38, %indvars.iv.next305.1
%arrayidx125.us.2 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %23, i64 %indvars.iv310
store i32 %count.3.us, ptr %arrayidx125.us.2, align 4, !tbaa !5
%indvars.iv.next305.2 = or i64 %indvars.iv304, 3
%24 = sub nsw i64 %38, %indvars.iv.next305.2
%arrayidx125.us.3 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %24, i64 %indvars.iv310
store i32 %count.3.us, ptr %arrayidx125.us.3, align 4, !tbaa !5
%indvars.iv.next305.3 = add nuw nsw i64 %indvars.iv304, 4
%niter412.next.3 = add i64 %niter412, 4
%niter412.ncmp.3 = icmp eq i64 %niter412.next.3, %unroll_iter411
br i1 %niter412.ncmp.3, label %for.inc130.us.loopexit.unr-lcssa, label %for.body119.us, !llvm.loop !23
for.body71.us: ; preds = %for.cond68.preheader.us, %for.inc104.us
%indvars.iv299 = phi i64 [ 0, %for.cond68.preheader.us ], [ %indvars.iv.next300, %for.inc104.us ]
%count.2251.us = phi i32 [ 0, %for.cond68.preheader.us ], [ %count.3.us, %for.inc104.us ]
%arrayidx75.us = getelementptr inbounds [2000 x [2001 x i8]], ptr %str, i64 0, i64 %indvars.iv299, i64 %indvars.iv310
%25 = load i8, ptr %arrayidx75.us, align 1, !tbaa !14
%cmp77.us = icmp eq i8 %25, 35
br i1 %cmp77.us, label %if.then79.us, label %if.else101.us
if.else101.us: ; preds = %for.body71.us
%inc102.us = add nsw i32 %count.2251.us, 1
br label %for.inc104.us
if.then79.us: ; preds = %for.body71.us
%arrayidx83.us = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %indvars.iv299, i64 %indvars.iv310
store i32 0, ptr %arrayidx83.us, align 4, !tbaa !5
%cmp84.us = icmp sgt i32 %count.2251.us, 0
br i1 %cmp84.us, label %for.body90.us.preheader, label %for.inc104.us
for.body90.us.preheader: ; preds = %if.then79.us
%wide.trip.count297 = zext i32 %count.2251.us to i64
%xtraiter = and i64 %wide.trip.count297, 3
%26 = icmp ult i32 %count.2251.us, 4
br i1 %26, label %for.inc104.us.loopexit.unr-lcssa, label %for.body90.us.preheader.new
for.body90.us.preheader.new: ; preds = %for.body90.us.preheader
%unroll_iter = and i64 %wide.trip.count297, 4294967292
br label %for.body90.us
for.inc104.us.loopexit.unr-lcssa: ; preds = %for.body90.us, %for.body90.us.preheader
%indvars.iv293.unr = phi i64 [ 0, %for.body90.us.preheader ], [ %indvars.iv.next294.3, %for.body90.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc104.us, label %for.body90.us.epil
for.body90.us.epil: ; preds = %for.inc104.us.loopexit.unr-lcssa, %for.body90.us.epil
%indvars.iv293.epil = phi i64 [ %indvars.iv.next294.epil, %for.body90.us.epil ], [ %indvars.iv293.unr, %for.inc104.us.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body90.us.epil ], [ 0, %for.inc104.us.loopexit.unr-lcssa ]
%27 = xor i64 %indvars.iv293.epil, -1
%28 = add nsw i64 %indvars.iv299, %27
%arrayidx96.us.epil = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %28, i64 %indvars.iv310
store i32 %count.2251.us, ptr %arrayidx96.us.epil, align 4, !tbaa !5
%indvars.iv.next294.epil = add nuw nsw i64 %indvars.iv293.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.inc104.us, label %for.body90.us.epil, !llvm.loop !24
for.inc104.us: ; preds = %for.inc104.us.loopexit.unr-lcssa, %for.body90.us.epil, %if.then79.us, %if.else101.us
%count.3.us = phi i32 [ %inc102.us, %if.else101.us ], [ 0, %if.then79.us ], [ 0, %for.body90.us.epil ], [ 0, %for.inc104.us.loopexit.unr-lcssa ]
%indvars.iv.next300 = add nuw nsw i64 %indvars.iv299, 1
%exitcond303.not = icmp eq i64 %indvars.iv.next300, %wide.trip.count302
br i1 %exitcond303.not, label %for.cond68.for.end106_crit_edge.us, label %for.body71.us, !llvm.loop !25
for.body90.us: ; preds = %for.body90.us, %for.body90.us.preheader.new
%indvars.iv293 = phi i64 [ 0, %for.body90.us.preheader.new ], [ %indvars.iv.next294.3, %for.body90.us ]
%niter = phi i64 [ 0, %for.body90.us.preheader.new ], [ %niter.next.3, %for.body90.us ]
%29 = xor i64 %indvars.iv293, -1
%30 = add nsw i64 %indvars.iv299, %29
%arrayidx96.us = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %30, i64 %indvars.iv310
store i32 %count.2251.us, ptr %arrayidx96.us, align 4, !tbaa !5
%31 = xor i64 %indvars.iv293, -2
%32 = add nsw i64 %indvars.iv299, %31
%arrayidx96.us.1 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %32, i64 %indvars.iv310
store i32 %count.2251.us, ptr %arrayidx96.us.1, align 4, !tbaa !5
%33 = xor i64 %indvars.iv293, -3
%34 = add nsw i64 %indvars.iv299, %33
%arrayidx96.us.2 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %34, i64 %indvars.iv310
store i32 %count.2251.us, ptr %arrayidx96.us.2, align 4, !tbaa !5
%35 = xor i64 %indvars.iv293, -4
%36 = add nsw i64 %indvars.iv299, %35
%arrayidx96.us.3 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %36, i64 %indvars.iv310
store i32 %count.2251.us, ptr %arrayidx96.us.3, align 4, !tbaa !5
%indvars.iv.next294.3 = add nuw nsw i64 %indvars.iv293, 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.inc104.us.loopexit.unr-lcssa, label %for.body90.us, !llvm.loop !26
for.cond68.for.end106_crit_edge.us: ; preds = %for.inc104.us
%idxprom108.us = and i64 %indvars.iv299, 4294967295
%arrayidx111.us = getelementptr inbounds [2000 x [2001 x i8]], ptr %str, i64 0, i64 %idxprom108.us, i64 %indvars.iv310
%37 = load i8, ptr %arrayidx111.us, align 1, !tbaa !14
%cmp113.us = icmp eq i8 %37, 46
%cmp117254.us = icmp sgt i32 %count.3.us, 0
%or.cond268 = select i1 %cmp113.us, i1 %cmp117254.us, i1 false
br i1 %or.cond268, label %for.body119.us.preheader, label %for.inc130.us
for.body119.us.preheader: ; preds = %for.cond68.for.end106_crit_edge.us
%sext325 = shl i64 %indvars.iv299, 32
%38 = ashr exact i64 %sext325, 32
%wide.trip.count308 = zext i32 %count.3.us to i64
%xtraiter408 = and i64 %wide.trip.count308, 3
%39 = icmp ult i32 %count.3.us, 4
br i1 %39, label %for.inc130.us.loopexit.unr-lcssa, label %for.body119.us.preheader.new
for.body119.us.preheader.new: ; preds = %for.body119.us.preheader
%unroll_iter411 = and i64 %wide.trip.count308, 4294967292
br label %for.body119.us
for.cond133.preheader: ; preds = %for.inc130.us, %for.cond64.preheader
%brmerge = or i1 %cmp3246, %cmp65256
br i1 %brmerge, label %for.end169, label %for.cond137.preheader.us.preheader
for.cond137.preheader.us.preheader: ; preds = %for.cond133.preheader
%wide.trip.count323 = zext i32 %18 to i64
%wide.trip.count318 = zext i32 %.pre to i64
%min.iters.check390 = icmp ult i32 %.pre, 8
%n.vec393 = and i64 %wide.trip.count318, 4294967288
%cmp.n395 = icmp eq i64 %n.vec393, %wide.trip.count318
br label %for.cond137.preheader.us
for.cond137.preheader.us: ; preds = %for.cond137.preheader.us.preheader, %for.cond137.for.inc167_crit_edge.us
%indvars.iv320 = phi i64 [ 0, %for.cond137.preheader.us.preheader ], [ %indvars.iv.next321, %for.cond137.for.inc167_crit_edge.us ]
%sum.0265.us = phi i32 [ 0, %for.cond137.preheader.us.preheader ], [ %spec.select.us.lcssa, %for.cond137.for.inc167_crit_edge.us ]
br i1 %min.iters.check390, label %for.body140.us.preheader, label %vector.ph391
vector.ph391: ; preds = %for.cond137.preheader.us
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %sum.0265.us, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body396
vector.body396: ; preds = %vector.body396, %vector.ph391
%index397 = phi i64 [ 0, %vector.ph391 ], [ %index.next402, %vector.body396 ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph391 ], [ %48, %vector.body396 ]
%vec.phi398 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph391 ], [ %49, %vector.body396 ]
%40 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_w, i64 0, i64 %indvars.iv320, i64 %index397
%wide.load = load <4 x i32>, ptr %40, align 16, !tbaa !5
%41 = getelementptr inbounds i32, ptr %40, i64 4
%wide.load399 = load <4 x i32>, ptr %41, align 16, !tbaa !5
%42 = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %indvars.iv320, i64 %index397
%wide.load400 = load <4 x i32>, ptr %42, align 16, !tbaa !5
%43 = getelementptr inbounds i32, ptr %42, i64 4
%wide.load401 = load <4 x i32>, ptr %43, align 16, !tbaa !5
%44 = add <4 x i32> %wide.load, <i32 -1, i32 -1, i32 -1, i32 -1>
%45 = add <4 x i32> %wide.load399, <i32 -1, i32 -1, i32 -1, i32 -1>
%46 = add <4 x i32> %44, %wide.load400
%47 = add <4 x i32> %45, %wide.load401
%48 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %46, <4 x i32> %vec.phi)
%49 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %47, <4 x i32> %vec.phi398)
%index.next402 = add nuw i64 %index397, 8
%50 = icmp eq i64 %index.next402, %n.vec393
br i1 %50, label %middle.block388, label %vector.body396, !llvm.loop !27
middle.block388: ; preds = %vector.body396
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %48, <4 x i32> %49)
%51 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
br i1 %cmp.n395, label %for.cond137.for.inc167_crit_edge.us, label %for.body140.us.preheader
for.body140.us.preheader: ; preds = %for.cond137.preheader.us, %middle.block388
%indvars.iv315.ph = phi i64 [ 0, %for.cond137.preheader.us ], [ %n.vec393, %middle.block388 ]
%sum.1261.us.ph = phi i32 [ %sum.0265.us, %for.cond137.preheader.us ], [ %51, %middle.block388 ]
br label %for.body140.us
for.body140.us: ; preds = %for.body140.us.preheader, %for.body140.us
%indvars.iv315 = phi i64 [ %indvars.iv.next316, %for.body140.us ], [ %indvars.iv315.ph, %for.body140.us.preheader ]
%sum.1261.us = phi i32 [ %spec.select.us, %for.body140.us ], [ %sum.1261.us.ph, %for.body140.us.preheader ]
%arrayidx144.us = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_w, i64 0, i64 %indvars.iv320, i64 %indvars.iv315
%52 = load i32, ptr %arrayidx144.us, align 4, !tbaa !5
%arrayidx148.us = getelementptr inbounds [2000 x [2000 x i32]], ptr %grid_h, i64 0, i64 %indvars.iv320, i64 %indvars.iv315
%53 = load i32, ptr %arrayidx148.us, align 4, !tbaa !5
%add.us = add i32 %52, -1
%sub149.us = add i32 %add.us, %53
%spec.select.us = call i32 @llvm.smax.i32(i32 %sub149.us, i32 %sum.1261.us)
%indvars.iv.next316 = add nuw nsw i64 %indvars.iv315, 1
%exitcond319.not = icmp eq i64 %indvars.iv.next316, %wide.trip.count318
br i1 %exitcond319.not, label %for.cond137.for.inc167_crit_edge.us, label %for.body140.us, !llvm.loop !28
for.cond137.for.inc167_crit_edge.us: ; preds = %for.body140.us, %middle.block388
%spec.select.us.lcssa = phi i32 [ %51, %middle.block388 ], [ %spec.select.us, %for.body140.us ]
%indvars.iv.next321 = add nuw nsw i64 %indvars.iv320, 1
%exitcond324.not = icmp eq i64 %indvars.iv.next321, %wide.trip.count323
br i1 %exitcond324.not, label %for.end169, label %for.cond137.preheader.us, !llvm.loop !29
for.end169: ; preds = %for.cond137.for.inc167_crit_edge.us, %for.cond133.preheader, %entry, %for.cond68.preheader.lr.ph, %for.cond5.preheader.lr.ph
%sum.0.lcssa = phi i32 [ 0, %for.cond133.preheader ], [ 0, %for.cond5.preheader.lr.ph ], [ 0, %for.cond68.preheader.lr.ph ], [ 0, %entry ], [ %spec.select.us.lcssa, %for.cond137.for.inc167_crit_edge.us ]
%call170 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4002000, ptr nonnull %str) #5
call void @llvm.lifetime.end.p0(i64 16000000, ptr nonnull %grid_h) #5
call void @llvm.lifetime.end.p0(i64 16000000, ptr nonnull %grid_w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !12, !13}
!18 = distinct !{!18, !10, !13, !12}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10, !13, !12}
!28 = distinct !{!28, !10, !12, !13}
!29 = distinct !{!29, !10}
|
#include <stdio.h>
#include <memory.h>
int main(void){
int n,m[5],i,j,f=0;
int s[8][5];
while(scanf("%d",&n)!=EOF){
if(f)
puts("");
memset(s,0,sizeof(s));
for(i=4;i>=0;i--){
m[i]=n%10;
n/=10;
}
for(i=0;i<5;i++){
if(m[i]>=5){
s[0][i]=' ';
s[1][i]='*';
m[i]%=5;
}
else{
s[0][i]='*';
s[1][i]=' ';
}
}
for(i=0;i<5;i++)
s[2][i]='=';
for(i=0;i<5;i++){
for(j=0;j<m[i];j++){
s[3+j][i]='*';
}
s[3+j][i]=' ';
for(j++;j<5;j++){
s[3+j][i]='*';
}
}
for(i=0;i<8;i++){
for(j=0;j<5;j++){
printf("%c",s[i][j]);
}
puts("");
}
f=1;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143283/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143283/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%s = alloca [8 x [5 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %s) #5
%call138 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not139 = icmp eq i32 %call138, -1
br i1 %cmp.not139, label %while.end, label %if.end.preheader
if.end.preheader: ; preds = %entry
%arrayidx81.7 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 7, i64 0
%0 = getelementptr inbounds i8, ptr %s, i64 48
%1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 1, i64 0
%2 = getelementptr inbounds [5 x i32], ptr %s, i64 0, i64 1
%3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 1, i64 1
%4 = getelementptr inbounds [5 x i32], ptr %s, i64 0, i64 2
%5 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 1, i64 2
%6 = getelementptr inbounds [5 x i32], ptr %s, i64 0, i64 3
%7 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 1, i64 3
%8 = getelementptr inbounds [5 x i32], ptr %s, i64 0, i64 4
%9 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 1, i64 4
%arrayidx33 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 2, i64 0
%arrayidx33.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 2, i64 1
%arrayidx33.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 2, i64 2
%arrayidx33.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 2, i64 3
%arrayidx33.4 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 2, i64 4
%arrayidx56188 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 0
%arrayidx56.1194 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 1
%arrayidx56.2200 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 2
%arrayidx56.3206 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 3
%arrayidx56.4212 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 4
%arrayidx81.3167 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 0
%arrayidx81.1.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 1
%arrayidx81.2.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 2
%arrayidx81.3.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 3
%arrayidx81.4.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 3, i64 4
%arrayidx81.4169 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 4, i64 0
%arrayidx81.1.4 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 4, i64 1
%arrayidx81.2.4 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 4, i64 2
%arrayidx81.3.4 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 4, i64 3
%arrayidx81.4.4 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 4, i64 4
%arrayidx81.5 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 5, i64 0
%arrayidx81.1.5 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 5, i64 1
%arrayidx81.2.5 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 5, i64 2
%arrayidx81.3.5 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 5, i64 3
%arrayidx81.4.5 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 5, i64 4
%arrayidx81.6 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 6, i64 0
%arrayidx81.1.6 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 6, i64 1
%arrayidx81.2.6 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 6, i64 2
%arrayidx81.3.6 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 6, i64 3
%arrayidx81.4.6 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 6, i64 4
%arrayidx81.1.7 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 7, i64 1
%arrayidx81.2.7 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 7, i64 2
%arrayidx81.3.7 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 7, i64 3
%arrayidx81.4.7 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 7, i64 4
br label %if.end
if.then.critedge: ; preds = %for.inc69.4
%putchar = call i32 @putchar(i32 10)
br label %if.end
if.end: ; preds = %if.end.preheader, %if.then.critedge
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(160) %0, i8 0, i64 112, i1 false)
%n.promoted = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %n.promoted, 10
%div = sdiv i32 %n.promoted, 10
%rem.1 = srem i32 %div, 10
%div.1 = sdiv i32 %n.promoted, 100
%rem.2 = srem i32 %div.1, 10
%div.2 = sdiv i32 %n.promoted, 1000
%rem.3 = srem i32 %div.2, 10
%div.3 = sdiv i32 %n.promoted, 10000
%rem.4 = srem i32 %div.3, 10
%div.4 = sdiv i32 %n.promoted, 100000
store i32 %div.4, ptr %n, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %rem.4, 4
%rem18124 = add nsw i32 %rem.4, -5
%.sink176 = select i1 %cmp8, i32 32, i32 42
%.sink = select i1 %cmp8, i32 42, i32 32
%m.sroa.0.0 = select i1 %cmp8, i32 %rem18124, i32 %rem.4
store i32 %.sink176, ptr %s, align 16
store i32 %.sink, ptr %1, align 4
%cmp8.1 = icmp sgt i32 %rem.3, 4
%rem18124.1 = add nsw i32 %rem.3, -5
%.sink178 = select i1 %cmp8.1, i32 32, i32 42
%.sink177 = select i1 %cmp8.1, i32 42, i32 32
%m.sroa.6.0 = select i1 %cmp8.1, i32 %rem18124.1, i32 %rem.3
store i32 %.sink178, ptr %2, align 4
store i32 %.sink177, ptr %3, align 8
%cmp8.2 = icmp sgt i32 %rem.2, 4
%rem18124.2 = add nsw i32 %rem.2, -5
%.sink180 = select i1 %cmp8.2, i32 32, i32 42
%.sink179 = select i1 %cmp8.2, i32 42, i32 32
%m.sroa.10.0 = select i1 %cmp8.2, i32 %rem18124.2, i32 %rem.2
store i32 %.sink180, ptr %4, align 8
store i32 %.sink179, ptr %5, align 4
%cmp8.3 = icmp sgt i32 %rem.1, 4
%rem18124.3 = add nsw i32 %rem.1, -5
%.sink182 = select i1 %cmp8.3, i32 32, i32 42
%.sink181 = select i1 %cmp8.3, i32 42, i32 32
%m.sroa.14.0 = select i1 %cmp8.3, i32 %rem18124.3, i32 %rem.1
store i32 %.sink182, ptr %6, align 4
store i32 %.sink181, ptr %7, align 16
%cmp8.4 = icmp sgt i32 %rem, 4
%rem18124.4 = add nsw i32 %rem, -5
%.sink184 = select i1 %cmp8.4, i32 32, i32 42
%.sink183 = select i1 %cmp8.4, i32 42, i32 32
%m.sroa.18.0 = select i1 %cmp8.4, i32 %rem18124.4, i32 %rem
store i32 %.sink184, ptr %8, align 16
store i32 %.sink183, ptr %9, align 4
store <4 x i32> <i32 61, i32 61, i32 61, i32 61>, ptr %arrayidx33, align 8, !tbaa !5
store i32 61, ptr %arrayidx33.4, align 8, !tbaa !5
%cmp43130 = icmp sgt i32 %m.sroa.0.0, 0
br i1 %cmp43130, label %for.body44.preheader, label %for.end51.thread
for.end51.thread: ; preds = %if.end
store i32 32, ptr %arrayidx56188, align 4, !tbaa !5
br label %for.body60.preheader
for.body44.preheader: ; preds = %if.end
%wide.trip.count = zext i32 %m.sroa.0.0 to i64
%xtraiter = and i64 %wide.trip.count, 3
%10 = icmp ult i32 %m.sroa.0.0, 4
br i1 %10, label %for.end51.unr-lcssa, label %for.body44.preheader.new
for.body44.preheader.new: ; preds = %for.body44.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body44
for.body44: ; preds = %for.body44, %for.body44.preheader.new
%indvars.iv = phi i64 [ 0, %for.body44.preheader.new ], [ %indvars.iv.next.3225, %for.body44 ]
%niter = phi i64 [ 0, %for.body44.preheader.new ], [ %niter.next.3, %for.body44 ]
%11 = or i64 %indvars.iv, 3
%arrayidx48 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %11, i64 0
store i32 42, ptr %arrayidx48, align 4, !tbaa !5
%12 = add nuw nsw i64 %indvars.iv, 4
%arrayidx48.1216 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %12, i64 0
store i32 42, ptr %arrayidx48.1216, align 16, !tbaa !5
%13 = add nuw nsw i64 %indvars.iv, 5
%arrayidx48.2220 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %13, i64 0
store i32 42, ptr %arrayidx48.2220, align 4, !tbaa !5
%14 = add nuw nsw i64 %indvars.iv, 6
%arrayidx48.3224 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %14, i64 0
store i32 42, ptr %arrayidx48.3224, align 8, !tbaa !5
%indvars.iv.next.3225 = 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.end51.unr-lcssa, label %for.body44, !llvm.loop !9
for.end51.unr-lcssa: ; preds = %for.body44, %for.body44.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body44.preheader ], [ %indvars.iv.next.3225, %for.body44 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end51, label %for.body44.epil
for.body44.epil: ; preds = %for.end51.unr-lcssa, %for.body44.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body44.epil ], [ %indvars.iv.unr, %for.end51.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body44.epil ], [ 0, %for.end51.unr-lcssa ]
%15 = add nuw nsw i64 %indvars.iv.epil, 3
%arrayidx48.epil = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %15, i64 0
store i32 42, ptr %arrayidx48.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.end51, label %for.body44.epil, !llvm.loop !11
for.end51: ; preds = %for.body44.epil, %for.end51.unr-lcssa
%add52 = add nuw nsw i32 %m.sroa.0.0, 3
%idxprom53 = zext i32 %add52 to i64
%arrayidx56 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %idxprom53, i64 0
store i32 32, ptr %arrayidx56, align 4, !tbaa !5
%cmp59133 = icmp ult i32 %m.sroa.0.0, 4
br i1 %cmp59133, label %for.body60.preheader, label %for.inc69
for.body60.preheader: ; preds = %for.end51.thread, %for.end51
%j.0.lcssa190 = phi i32 [ 0, %for.end51.thread ], [ %m.sroa.0.0, %for.end51 ]
%16 = zext i32 %j.0.lcssa190 to i64
%17 = sub nsw i64 0, %16
%xtraiter227 = and i64 %17, 3
%lcmp.mod228.not = icmp eq i64 %xtraiter227, 0
br i1 %lcmp.mod228.not, label %for.body60.prol.loopexit, label %for.body60.prol
for.body60.prol: ; preds = %for.body60.preheader, %for.body60.prol
%indvars.iv146.prol = phi i64 [ %indvars.iv.next147.prol, %for.body60.prol ], [ %16, %for.body60.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body60.prol ], [ 0, %for.body60.preheader ]
%indvars.iv.next147.prol = add nuw nsw i64 %indvars.iv146.prol, 1
%18 = add nuw nsw i64 %indvars.iv146.prol, 4
%arrayidx65.prol = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %18, i64 0
store i32 42, ptr %arrayidx65.prol, align 4, !tbaa !5
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter227
br i1 %prol.iter.cmp.not, label %for.body60.prol.loopexit, label %for.body60.prol, !llvm.loop !13
for.body60.prol.loopexit: ; preds = %for.body60.prol, %for.body60.preheader
%indvars.iv146.unr = phi i64 [ %16, %for.body60.preheader ], [ %indvars.iv.next147.prol, %for.body60.prol ]
%.not = icmp eq i32 %j.0.lcssa190, 0
br i1 %.not, label %for.body60, label %for.inc69
for.body60: ; preds = %for.body60.prol.loopexit, %for.body60
%indvars.iv146 = phi i64 [ %indvars.iv.next147.3238, %for.body60 ], [ %indvars.iv146.unr, %for.body60.prol.loopexit ]
%19 = add nuw nsw i64 %indvars.iv146, 4
%arrayidx65 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %19, i64 0
store i32 42, ptr %arrayidx65, align 4, !tbaa !5
%20 = add nuw nsw i64 %indvars.iv146, 5
%arrayidx65.1231 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %20, i64 0
store i32 42, ptr %arrayidx65.1231, align 4, !tbaa !5
%21 = add nuw nsw i64 %indvars.iv146, 6
%arrayidx65.2235 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %21, i64 0
store i32 42, ptr %arrayidx65.2235, align 4, !tbaa !5
%indvars.iv.next147.3238 = add nuw nsw i64 %indvars.iv146, 4
%22 = add nuw nsw i64 %indvars.iv146, 7
%arrayidx65.3239 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %22, i64 0
store i32 42, ptr %arrayidx65.3239, align 4, !tbaa !5
%exitcond150.not.3 = icmp eq i64 %indvars.iv146, 0
br i1 %exitcond150.not.3, label %for.inc69, label %for.body60, !llvm.loop !14
for.inc69: ; preds = %for.body60.prol.loopexit, %for.body60, %for.end51
%cmp43130.1 = icmp sgt i32 %m.sroa.6.0, 0
br i1 %cmp43130.1, label %for.body44.preheader.1, label %for.end51.1.thread
for.end51.1.thread: ; preds = %for.inc69
store i32 32, ptr %arrayidx56.1194, align 16, !tbaa !5
br label %for.body60.preheader.1
for.body44.preheader.1: ; preds = %for.inc69
%wide.trip.count.1 = zext i32 %m.sroa.6.0 to i64
%xtraiter241 = and i64 %wide.trip.count.1, 3
%23 = icmp ult i32 %m.sroa.6.0, 4
br i1 %23, label %for.end51.1.unr-lcssa, label %for.body44.preheader.1.new
for.body44.preheader.1.new: ; preds = %for.body44.preheader.1
%unroll_iter244 = and i64 %wide.trip.count.1, 4294967292
br label %for.body44.1
for.body44.1: ; preds = %for.body44.1, %for.body44.preheader.1.new
%indvars.iv.1 = phi i64 [ 0, %for.body44.preheader.1.new ], [ %indvars.iv.next.1.3, %for.body44.1 ]
%niter245 = phi i64 [ 0, %for.body44.preheader.1.new ], [ %niter245.next.3, %for.body44.1 ]
%24 = or i64 %indvars.iv.1, 3
%arrayidx48.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %24, i64 1
store i32 42, ptr %arrayidx48.1, align 16, !tbaa !5
%25 = add nuw nsw i64 %indvars.iv.1, 4
%arrayidx48.1.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %25, i64 1
store i32 42, ptr %arrayidx48.1.1, align 4, !tbaa !5
%26 = add nuw nsw i64 %indvars.iv.1, 5
%arrayidx48.1.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %26, i64 1
store i32 42, ptr %arrayidx48.1.2, align 8, !tbaa !5
%27 = add nuw nsw i64 %indvars.iv.1, 6
%arrayidx48.1.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %27, i64 1
store i32 42, ptr %arrayidx48.1.3, align 4, !tbaa !5
%indvars.iv.next.1.3 = add nuw nsw i64 %indvars.iv.1, 4
%niter245.next.3 = add i64 %niter245, 4
%niter245.ncmp.3 = icmp eq i64 %niter245.next.3, %unroll_iter244
br i1 %niter245.ncmp.3, label %for.end51.1.unr-lcssa, label %for.body44.1, !llvm.loop !9
for.end51.1.unr-lcssa: ; preds = %for.body44.1, %for.body44.preheader.1
%indvars.iv.1.unr = phi i64 [ 0, %for.body44.preheader.1 ], [ %indvars.iv.next.1.3, %for.body44.1 ]
%lcmp.mod243.not = icmp eq i64 %xtraiter241, 0
br i1 %lcmp.mod243.not, label %for.end51.1, label %for.body44.1.epil
for.body44.1.epil: ; preds = %for.end51.1.unr-lcssa, %for.body44.1.epil
%indvars.iv.1.epil = phi i64 [ %indvars.iv.next.1.epil, %for.body44.1.epil ], [ %indvars.iv.1.unr, %for.end51.1.unr-lcssa ]
%epil.iter242 = phi i64 [ %epil.iter242.next, %for.body44.1.epil ], [ 0, %for.end51.1.unr-lcssa ]
%28 = add nuw nsw i64 %indvars.iv.1.epil, 3
%arrayidx48.1.epil = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %28, i64 1
store i32 42, ptr %arrayidx48.1.epil, align 4, !tbaa !5
%indvars.iv.next.1.epil = add nuw nsw i64 %indvars.iv.1.epil, 1
%epil.iter242.next = add i64 %epil.iter242, 1
%epil.iter242.cmp.not = icmp eq i64 %epil.iter242.next, %xtraiter241
br i1 %epil.iter242.cmp.not, label %for.end51.1, label %for.body44.1.epil, !llvm.loop !15
for.end51.1: ; preds = %for.body44.1.epil, %for.end51.1.unr-lcssa
%add52.1 = add nuw nsw i32 %m.sroa.6.0, 3
%idxprom53.1 = zext i32 %add52.1 to i64
%arrayidx56.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %idxprom53.1, i64 1
store i32 32, ptr %arrayidx56.1, align 4, !tbaa !5
%cmp59133.1 = icmp ult i32 %m.sroa.6.0, 4
br i1 %cmp59133.1, label %for.body60.preheader.1, label %for.inc69.1
for.body60.preheader.1: ; preds = %for.end51.1.thread, %for.end51.1
%j.0.lcssa.1196 = phi i32 [ 0, %for.end51.1.thread ], [ %m.sroa.6.0, %for.end51.1 ]
%29 = zext i32 %j.0.lcssa.1196 to i64
%30 = sub nsw i64 0, %29
%xtraiter246 = and i64 %30, 3
%lcmp.mod247.not = icmp eq i64 %xtraiter246, 0
br i1 %lcmp.mod247.not, label %for.body60.1.prol.loopexit, label %for.body60.1.prol
for.body60.1.prol: ; preds = %for.body60.preheader.1, %for.body60.1.prol
%indvars.iv146.1.prol = phi i64 [ %indvars.iv.next147.1.prol, %for.body60.1.prol ], [ %29, %for.body60.preheader.1 ]
%prol.iter248 = phi i64 [ %prol.iter248.next, %for.body60.1.prol ], [ 0, %for.body60.preheader.1 ]
%indvars.iv.next147.1.prol = add nuw nsw i64 %indvars.iv146.1.prol, 1
%31 = add nuw nsw i64 %indvars.iv146.1.prol, 4
%arrayidx65.1.prol = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %31, i64 1
store i32 42, ptr %arrayidx65.1.prol, align 4, !tbaa !5
%prol.iter248.next = add i64 %prol.iter248, 1
%prol.iter248.cmp.not = icmp eq i64 %prol.iter248.next, %xtraiter246
br i1 %prol.iter248.cmp.not, label %for.body60.1.prol.loopexit, label %for.body60.1.prol, !llvm.loop !16
for.body60.1.prol.loopexit: ; preds = %for.body60.1.prol, %for.body60.preheader.1
%indvars.iv146.1.unr = phi i64 [ %29, %for.body60.preheader.1 ], [ %indvars.iv.next147.1.prol, %for.body60.1.prol ]
%.not273 = icmp eq i32 %j.0.lcssa.1196, 0
br i1 %.not273, label %for.body60.1, label %for.inc69.1
for.body60.1: ; preds = %for.body60.1.prol.loopexit, %for.body60.1
%indvars.iv146.1 = phi i64 [ %indvars.iv.next147.1.3, %for.body60.1 ], [ %indvars.iv146.1.unr, %for.body60.1.prol.loopexit ]
%32 = add nuw nsw i64 %indvars.iv146.1, 4
%arrayidx65.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %32, i64 1
store i32 42, ptr %arrayidx65.1, align 4, !tbaa !5
%33 = add nuw nsw i64 %indvars.iv146.1, 5
%arrayidx65.1.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %33, i64 1
store i32 42, ptr %arrayidx65.1.1, align 4, !tbaa !5
%34 = add nuw nsw i64 %indvars.iv146.1, 6
%arrayidx65.1.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %34, i64 1
store i32 42, ptr %arrayidx65.1.2, align 4, !tbaa !5
%indvars.iv.next147.1.3 = add nuw nsw i64 %indvars.iv146.1, 4
%35 = add nuw nsw i64 %indvars.iv146.1, 7
%arrayidx65.1.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %35, i64 1
store i32 42, ptr %arrayidx65.1.3, align 4, !tbaa !5
%exitcond150.1.not.3 = icmp eq i64 %indvars.iv146.1, 0
br i1 %exitcond150.1.not.3, label %for.inc69.1, label %for.body60.1, !llvm.loop !14
for.inc69.1: ; preds = %for.body60.1.prol.loopexit, %for.body60.1, %for.end51.1
%cmp43130.2 = icmp sgt i32 %m.sroa.10.0, 0
br i1 %cmp43130.2, label %for.body44.preheader.2, label %for.end51.2.thread
for.end51.2.thread: ; preds = %for.inc69.1
store i32 32, ptr %arrayidx56.2200, align 4, !tbaa !5
br label %for.body60.preheader.2
for.body44.preheader.2: ; preds = %for.inc69.1
%wide.trip.count.2 = zext i32 %m.sroa.10.0 to i64
%xtraiter249 = and i64 %wide.trip.count.2, 3
%36 = icmp ult i32 %m.sroa.10.0, 4
br i1 %36, label %for.end51.2.unr-lcssa, label %for.body44.preheader.2.new
for.body44.preheader.2.new: ; preds = %for.body44.preheader.2
%unroll_iter252 = and i64 %wide.trip.count.2, 4294967292
br label %for.body44.2
for.body44.2: ; preds = %for.body44.2, %for.body44.preheader.2.new
%indvars.iv.2 = phi i64 [ 0, %for.body44.preheader.2.new ], [ %indvars.iv.next.2.3, %for.body44.2 ]
%niter253 = phi i64 [ 0, %for.body44.preheader.2.new ], [ %niter253.next.3, %for.body44.2 ]
%37 = or i64 %indvars.iv.2, 3
%arrayidx48.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %37, i64 2
store i32 42, ptr %arrayidx48.2, align 4, !tbaa !5
%38 = add nuw nsw i64 %indvars.iv.2, 4
%arrayidx48.2.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %38, i64 2
store i32 42, ptr %arrayidx48.2.1, align 8, !tbaa !5
%39 = add nuw nsw i64 %indvars.iv.2, 5
%arrayidx48.2.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %39, i64 2
store i32 42, ptr %arrayidx48.2.2, align 4, !tbaa !5
%40 = add nuw nsw i64 %indvars.iv.2, 6
%arrayidx48.2.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %40, i64 2
store i32 42, ptr %arrayidx48.2.3, align 16, !tbaa !5
%indvars.iv.next.2.3 = add nuw nsw i64 %indvars.iv.2, 4
%niter253.next.3 = add i64 %niter253, 4
%niter253.ncmp.3 = icmp eq i64 %niter253.next.3, %unroll_iter252
br i1 %niter253.ncmp.3, label %for.end51.2.unr-lcssa, label %for.body44.2, !llvm.loop !9
for.end51.2.unr-lcssa: ; preds = %for.body44.2, %for.body44.preheader.2
%indvars.iv.2.unr = phi i64 [ 0, %for.body44.preheader.2 ], [ %indvars.iv.next.2.3, %for.body44.2 ]
%lcmp.mod251.not = icmp eq i64 %xtraiter249, 0
br i1 %lcmp.mod251.not, label %for.end51.2, label %for.body44.2.epil
for.body44.2.epil: ; preds = %for.end51.2.unr-lcssa, %for.body44.2.epil
%indvars.iv.2.epil = phi i64 [ %indvars.iv.next.2.epil, %for.body44.2.epil ], [ %indvars.iv.2.unr, %for.end51.2.unr-lcssa ]
%epil.iter250 = phi i64 [ %epil.iter250.next, %for.body44.2.epil ], [ 0, %for.end51.2.unr-lcssa ]
%41 = add nuw nsw i64 %indvars.iv.2.epil, 3
%arrayidx48.2.epil = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %41, i64 2
store i32 42, ptr %arrayidx48.2.epil, align 4, !tbaa !5
%indvars.iv.next.2.epil = add nuw nsw i64 %indvars.iv.2.epil, 1
%epil.iter250.next = add i64 %epil.iter250, 1
%epil.iter250.cmp.not = icmp eq i64 %epil.iter250.next, %xtraiter249
br i1 %epil.iter250.cmp.not, label %for.end51.2, label %for.body44.2.epil, !llvm.loop !17
for.end51.2: ; preds = %for.body44.2.epil, %for.end51.2.unr-lcssa
%add52.2 = add nuw nsw i32 %m.sroa.10.0, 3
%idxprom53.2 = zext i32 %add52.2 to i64
%arrayidx56.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %idxprom53.2, i64 2
store i32 32, ptr %arrayidx56.2, align 4, !tbaa !5
%cmp59133.2 = icmp ult i32 %m.sroa.10.0, 4
br i1 %cmp59133.2, label %for.body60.preheader.2, label %for.inc69.2
for.body60.preheader.2: ; preds = %for.end51.2.thread, %for.end51.2
%j.0.lcssa.2202 = phi i32 [ 0, %for.end51.2.thread ], [ %m.sroa.10.0, %for.end51.2 ]
%42 = zext i32 %j.0.lcssa.2202 to i64
%43 = sub nsw i64 0, %42
%xtraiter254 = and i64 %43, 3
%lcmp.mod255.not = icmp eq i64 %xtraiter254, 0
br i1 %lcmp.mod255.not, label %for.body60.2.prol.loopexit, label %for.body60.2.prol
for.body60.2.prol: ; preds = %for.body60.preheader.2, %for.body60.2.prol
%indvars.iv146.2.prol = phi i64 [ %indvars.iv.next147.2.prol, %for.body60.2.prol ], [ %42, %for.body60.preheader.2 ]
%prol.iter256 = phi i64 [ %prol.iter256.next, %for.body60.2.prol ], [ 0, %for.body60.preheader.2 ]
%indvars.iv.next147.2.prol = add nuw nsw i64 %indvars.iv146.2.prol, 1
%44 = add nuw nsw i64 %indvars.iv146.2.prol, 4
%arrayidx65.2.prol = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %44, i64 2
store i32 42, ptr %arrayidx65.2.prol, align 4, !tbaa !5
%prol.iter256.next = add i64 %prol.iter256, 1
%prol.iter256.cmp.not = icmp eq i64 %prol.iter256.next, %xtraiter254
br i1 %prol.iter256.cmp.not, label %for.body60.2.prol.loopexit, label %for.body60.2.prol, !llvm.loop !18
for.body60.2.prol.loopexit: ; preds = %for.body60.2.prol, %for.body60.preheader.2
%indvars.iv146.2.unr = phi i64 [ %42, %for.body60.preheader.2 ], [ %indvars.iv.next147.2.prol, %for.body60.2.prol ]
%.not274 = icmp eq i32 %j.0.lcssa.2202, 0
br i1 %.not274, label %for.body60.2, label %for.inc69.2
for.body60.2: ; preds = %for.body60.2.prol.loopexit, %for.body60.2
%indvars.iv146.2 = phi i64 [ %indvars.iv.next147.2.3, %for.body60.2 ], [ %indvars.iv146.2.unr, %for.body60.2.prol.loopexit ]
%45 = add nuw nsw i64 %indvars.iv146.2, 4
%arrayidx65.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %45, i64 2
store i32 42, ptr %arrayidx65.2, align 4, !tbaa !5
%46 = add nuw nsw i64 %indvars.iv146.2, 5
%arrayidx65.2.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %46, i64 2
store i32 42, ptr %arrayidx65.2.1, align 4, !tbaa !5
%47 = add nuw nsw i64 %indvars.iv146.2, 6
%arrayidx65.2.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %47, i64 2
store i32 42, ptr %arrayidx65.2.2, align 4, !tbaa !5
%indvars.iv.next147.2.3 = add nuw nsw i64 %indvars.iv146.2, 4
%48 = add nuw nsw i64 %indvars.iv146.2, 7
%arrayidx65.2.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %48, i64 2
store i32 42, ptr %arrayidx65.2.3, align 4, !tbaa !5
%exitcond150.2.not.3 = icmp eq i64 %indvars.iv146.2, 0
br i1 %exitcond150.2.not.3, label %for.inc69.2, label %for.body60.2, !llvm.loop !14
for.inc69.2: ; preds = %for.body60.2.prol.loopexit, %for.body60.2, %for.end51.2
%cmp43130.3 = icmp sgt i32 %m.sroa.14.0, 0
br i1 %cmp43130.3, label %for.body44.preheader.3, label %for.end51.3.thread
for.end51.3.thread: ; preds = %for.inc69.2
store i32 32, ptr %arrayidx56.3206, align 8, !tbaa !5
br label %for.body60.preheader.3
for.body44.preheader.3: ; preds = %for.inc69.2
%wide.trip.count.3 = zext i32 %m.sroa.14.0 to i64
%xtraiter257 = and i64 %wide.trip.count.3, 3
%49 = icmp ult i32 %m.sroa.14.0, 4
br i1 %49, label %for.end51.3.unr-lcssa, label %for.body44.preheader.3.new
for.body44.preheader.3.new: ; preds = %for.body44.preheader.3
%unroll_iter260 = and i64 %wide.trip.count.3, 4294967292
br label %for.body44.3
for.body44.3: ; preds = %for.body44.3, %for.body44.preheader.3.new
%indvars.iv.3 = phi i64 [ 0, %for.body44.preheader.3.new ], [ %indvars.iv.next.3.3, %for.body44.3 ]
%niter261 = phi i64 [ 0, %for.body44.preheader.3.new ], [ %niter261.next.3, %for.body44.3 ]
%50 = or i64 %indvars.iv.3, 3
%arrayidx48.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %50, i64 3
store i32 42, ptr %arrayidx48.3, align 8, !tbaa !5
%51 = add nuw nsw i64 %indvars.iv.3, 4
%arrayidx48.3.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %51, i64 3
store i32 42, ptr %arrayidx48.3.1, align 4, !tbaa !5
%52 = add nuw nsw i64 %indvars.iv.3, 5
%arrayidx48.3.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %52, i64 3
store i32 42, ptr %arrayidx48.3.2, align 16, !tbaa !5
%53 = add nuw nsw i64 %indvars.iv.3, 6
%arrayidx48.3.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %53, i64 3
store i32 42, ptr %arrayidx48.3.3, align 4, !tbaa !5
%indvars.iv.next.3.3 = add nuw nsw i64 %indvars.iv.3, 4
%niter261.next.3 = add i64 %niter261, 4
%niter261.ncmp.3 = icmp eq i64 %niter261.next.3, %unroll_iter260
br i1 %niter261.ncmp.3, label %for.end51.3.unr-lcssa, label %for.body44.3, !llvm.loop !9
for.end51.3.unr-lcssa: ; preds = %for.body44.3, %for.body44.preheader.3
%indvars.iv.3.unr = phi i64 [ 0, %for.body44.preheader.3 ], [ %indvars.iv.next.3.3, %for.body44.3 ]
%lcmp.mod259.not = icmp eq i64 %xtraiter257, 0
br i1 %lcmp.mod259.not, label %for.end51.3, label %for.body44.3.epil
for.body44.3.epil: ; preds = %for.end51.3.unr-lcssa, %for.body44.3.epil
%indvars.iv.3.epil = phi i64 [ %indvars.iv.next.3.epil, %for.body44.3.epil ], [ %indvars.iv.3.unr, %for.end51.3.unr-lcssa ]
%epil.iter258 = phi i64 [ %epil.iter258.next, %for.body44.3.epil ], [ 0, %for.end51.3.unr-lcssa ]
%54 = add nuw nsw i64 %indvars.iv.3.epil, 3
%arrayidx48.3.epil = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %54, i64 3
store i32 42, ptr %arrayidx48.3.epil, align 4, !tbaa !5
%indvars.iv.next.3.epil = add nuw nsw i64 %indvars.iv.3.epil, 1
%epil.iter258.next = add i64 %epil.iter258, 1
%epil.iter258.cmp.not = icmp eq i64 %epil.iter258.next, %xtraiter257
br i1 %epil.iter258.cmp.not, label %for.end51.3, label %for.body44.3.epil, !llvm.loop !19
for.end51.3: ; preds = %for.body44.3.epil, %for.end51.3.unr-lcssa
%add52.3 = add nuw nsw i32 %m.sroa.14.0, 3
%idxprom53.3 = zext i32 %add52.3 to i64
%arrayidx56.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %idxprom53.3, i64 3
store i32 32, ptr %arrayidx56.3, align 4, !tbaa !5
%cmp59133.3 = icmp ult i32 %m.sroa.14.0, 4
br i1 %cmp59133.3, label %for.body60.preheader.3, label %for.inc69.3
for.body60.preheader.3: ; preds = %for.end51.3.thread, %for.end51.3
%j.0.lcssa.3208 = phi i32 [ 0, %for.end51.3.thread ], [ %m.sroa.14.0, %for.end51.3 ]
%55 = zext i32 %j.0.lcssa.3208 to i64
%56 = sub nsw i64 0, %55
%xtraiter262 = and i64 %56, 3
%lcmp.mod263.not = icmp eq i64 %xtraiter262, 0
br i1 %lcmp.mod263.not, label %for.body60.3.prol.loopexit, label %for.body60.3.prol
for.body60.3.prol: ; preds = %for.body60.preheader.3, %for.body60.3.prol
%indvars.iv146.3.prol = phi i64 [ %indvars.iv.next147.3.prol, %for.body60.3.prol ], [ %55, %for.body60.preheader.3 ]
%prol.iter264 = phi i64 [ %prol.iter264.next, %for.body60.3.prol ], [ 0, %for.body60.preheader.3 ]
%indvars.iv.next147.3.prol = add nuw nsw i64 %indvars.iv146.3.prol, 1
%57 = add nuw nsw i64 %indvars.iv146.3.prol, 4
%arrayidx65.3.prol = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %57, i64 3
store i32 42, ptr %arrayidx65.3.prol, align 4, !tbaa !5
%prol.iter264.next = add i64 %prol.iter264, 1
%prol.iter264.cmp.not = icmp eq i64 %prol.iter264.next, %xtraiter262
br i1 %prol.iter264.cmp.not, label %for.body60.3.prol.loopexit, label %for.body60.3.prol, !llvm.loop !20
for.body60.3.prol.loopexit: ; preds = %for.body60.3.prol, %for.body60.preheader.3
%indvars.iv146.3.unr = phi i64 [ %55, %for.body60.preheader.3 ], [ %indvars.iv.next147.3.prol, %for.body60.3.prol ]
%.not275 = icmp eq i32 %j.0.lcssa.3208, 0
br i1 %.not275, label %for.body60.3, label %for.inc69.3
for.body60.3: ; preds = %for.body60.3.prol.loopexit, %for.body60.3
%indvars.iv146.3 = phi i64 [ %indvars.iv.next147.3.3, %for.body60.3 ], [ %indvars.iv146.3.unr, %for.body60.3.prol.loopexit ]
%58 = add nuw nsw i64 %indvars.iv146.3, 4
%arrayidx65.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %58, i64 3
store i32 42, ptr %arrayidx65.3, align 4, !tbaa !5
%59 = add nuw nsw i64 %indvars.iv146.3, 5
%arrayidx65.3.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %59, i64 3
store i32 42, ptr %arrayidx65.3.1, align 4, !tbaa !5
%60 = add nuw nsw i64 %indvars.iv146.3, 6
%arrayidx65.3.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %60, i64 3
store i32 42, ptr %arrayidx65.3.2, align 4, !tbaa !5
%indvars.iv.next147.3.3 = add nuw nsw i64 %indvars.iv146.3, 4
%61 = add nuw nsw i64 %indvars.iv146.3, 7
%arrayidx65.3.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %61, i64 3
store i32 42, ptr %arrayidx65.3.3, align 4, !tbaa !5
%exitcond150.3.not.3 = icmp eq i64 %indvars.iv146.3, 0
br i1 %exitcond150.3.not.3, label %for.inc69.3, label %for.body60.3, !llvm.loop !14
for.inc69.3: ; preds = %for.body60.3.prol.loopexit, %for.body60.3, %for.end51.3
%cmp43130.4 = icmp sgt i32 %m.sroa.18.0, 0
br i1 %cmp43130.4, label %for.body44.preheader.4, label %for.end51.4.thread
for.end51.4.thread: ; preds = %for.inc69.3
store i32 32, ptr %arrayidx56.4212, align 4, !tbaa !5
br label %for.body60.preheader.4
for.body44.preheader.4: ; preds = %for.inc69.3
%wide.trip.count.4 = zext i32 %m.sroa.18.0 to i64
%xtraiter265 = and i64 %wide.trip.count.4, 3
%62 = icmp ult i32 %m.sroa.18.0, 4
br i1 %62, label %for.end51.4.unr-lcssa, label %for.body44.preheader.4.new
for.body44.preheader.4.new: ; preds = %for.body44.preheader.4
%unroll_iter268 = and i64 %wide.trip.count.4, 4294967292
br label %for.body44.4
for.body44.4: ; preds = %for.body44.4, %for.body44.preheader.4.new
%indvars.iv.4 = phi i64 [ 0, %for.body44.preheader.4.new ], [ %indvars.iv.next.4.3, %for.body44.4 ]
%niter269 = phi i64 [ 0, %for.body44.preheader.4.new ], [ %niter269.next.3, %for.body44.4 ]
%63 = or i64 %indvars.iv.4, 3
%arrayidx48.4 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %63, i64 4
store i32 42, ptr %arrayidx48.4, align 4, !tbaa !5
%64 = add nuw nsw i64 %indvars.iv.4, 4
%arrayidx48.4.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %64, i64 4
store i32 42, ptr %arrayidx48.4.1, align 16, !tbaa !5
%65 = add nuw nsw i64 %indvars.iv.4, 5
%arrayidx48.4.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %65, i64 4
store i32 42, ptr %arrayidx48.4.2, align 4, !tbaa !5
%66 = add nuw nsw i64 %indvars.iv.4, 6
%arrayidx48.4.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %66, i64 4
store i32 42, ptr %arrayidx48.4.3, align 8, !tbaa !5
%indvars.iv.next.4.3 = add nuw nsw i64 %indvars.iv.4, 4
%niter269.next.3 = add i64 %niter269, 4
%niter269.ncmp.3 = icmp eq i64 %niter269.next.3, %unroll_iter268
br i1 %niter269.ncmp.3, label %for.end51.4.unr-lcssa, label %for.body44.4, !llvm.loop !9
for.end51.4.unr-lcssa: ; preds = %for.body44.4, %for.body44.preheader.4
%indvars.iv.4.unr = phi i64 [ 0, %for.body44.preheader.4 ], [ %indvars.iv.next.4.3, %for.body44.4 ]
%lcmp.mod267.not = icmp eq i64 %xtraiter265, 0
br i1 %lcmp.mod267.not, label %for.end51.4, label %for.body44.4.epil
for.body44.4.epil: ; preds = %for.end51.4.unr-lcssa, %for.body44.4.epil
%indvars.iv.4.epil = phi i64 [ %indvars.iv.next.4.epil, %for.body44.4.epil ], [ %indvars.iv.4.unr, %for.end51.4.unr-lcssa ]
%epil.iter266 = phi i64 [ %epil.iter266.next, %for.body44.4.epil ], [ 0, %for.end51.4.unr-lcssa ]
%67 = add nuw nsw i64 %indvars.iv.4.epil, 3
%arrayidx48.4.epil = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %67, i64 4
store i32 42, ptr %arrayidx48.4.epil, align 4, !tbaa !5
%indvars.iv.next.4.epil = add nuw nsw i64 %indvars.iv.4.epil, 1
%epil.iter266.next = add i64 %epil.iter266, 1
%epil.iter266.cmp.not = icmp eq i64 %epil.iter266.next, %xtraiter265
br i1 %epil.iter266.cmp.not, label %for.end51.4, label %for.body44.4.epil, !llvm.loop !21
for.end51.4: ; preds = %for.body44.4.epil, %for.end51.4.unr-lcssa
%add52.4 = add nuw nsw i32 %m.sroa.18.0, 3
%idxprom53.4 = zext i32 %add52.4 to i64
%arrayidx56.4 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %idxprom53.4, i64 4
store i32 32, ptr %arrayidx56.4, align 4, !tbaa !5
%cmp59133.4 = icmp ult i32 %m.sroa.18.0, 4
br i1 %cmp59133.4, label %for.body60.preheader.4, label %for.inc69.4
for.body60.preheader.4: ; preds = %for.end51.4.thread, %for.end51.4
%j.0.lcssa.4214 = phi i32 [ 0, %for.end51.4.thread ], [ %m.sroa.18.0, %for.end51.4 ]
%68 = zext i32 %j.0.lcssa.4214 to i64
%69 = sub nsw i64 0, %68
%xtraiter270 = and i64 %69, 3
%lcmp.mod271.not = icmp eq i64 %xtraiter270, 0
br i1 %lcmp.mod271.not, label %for.body60.4.prol.loopexit, label %for.body60.4.prol
for.body60.4.prol: ; preds = %for.body60.preheader.4, %for.body60.4.prol
%indvars.iv146.4.prol = phi i64 [ %indvars.iv.next147.4.prol, %for.body60.4.prol ], [ %68, %for.body60.preheader.4 ]
%prol.iter272 = phi i64 [ %prol.iter272.next, %for.body60.4.prol ], [ 0, %for.body60.preheader.4 ]
%indvars.iv.next147.4.prol = add nuw nsw i64 %indvars.iv146.4.prol, 1
%70 = add nuw nsw i64 %indvars.iv146.4.prol, 4
%arrayidx65.4.prol = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %70, i64 4
store i32 42, ptr %arrayidx65.4.prol, align 4, !tbaa !5
%prol.iter272.next = add i64 %prol.iter272, 1
%prol.iter272.cmp.not = icmp eq i64 %prol.iter272.next, %xtraiter270
br i1 %prol.iter272.cmp.not, label %for.body60.4.prol.loopexit, label %for.body60.4.prol, !llvm.loop !22
for.body60.4.prol.loopexit: ; preds = %for.body60.4.prol, %for.body60.preheader.4
%indvars.iv146.4.unr = phi i64 [ %68, %for.body60.preheader.4 ], [ %indvars.iv.next147.4.prol, %for.body60.4.prol ]
%.not276 = icmp eq i32 %j.0.lcssa.4214, 0
br i1 %.not276, label %for.body60.4, label %for.inc69.4
for.body60.4: ; preds = %for.body60.4.prol.loopexit, %for.body60.4
%indvars.iv146.4 = phi i64 [ %indvars.iv.next147.4.3, %for.body60.4 ], [ %indvars.iv146.4.unr, %for.body60.4.prol.loopexit ]
%71 = add nuw nsw i64 %indvars.iv146.4, 4
%arrayidx65.4 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %71, i64 4
store i32 42, ptr %arrayidx65.4, align 4, !tbaa !5
%72 = add nuw nsw i64 %indvars.iv146.4, 5
%arrayidx65.4.1 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %72, i64 4
store i32 42, ptr %arrayidx65.4.1, align 4, !tbaa !5
%73 = add nuw nsw i64 %indvars.iv146.4, 6
%arrayidx65.4.2 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %73, i64 4
store i32 42, ptr %arrayidx65.4.2, align 4, !tbaa !5
%indvars.iv.next147.4.3 = add nuw nsw i64 %indvars.iv146.4, 4
%74 = add nuw nsw i64 %indvars.iv146.4, 7
%arrayidx65.4.3 = getelementptr inbounds [8 x [5 x i32]], ptr %s, i64 0, i64 %74, i64 4
store i32 42, ptr %arrayidx65.4.3, align 4, !tbaa !5
%exitcond150.4.not.3 = icmp eq i64 %indvars.iv146.4, 0
br i1 %exitcond150.4.not.3, label %for.inc69.4, label %for.body60.4, !llvm.loop !14
for.inc69.4: ; preds = %for.body60.4.prol.loopexit, %for.body60.4, %for.end51.4
%75 = load i32, ptr %s, align 16, !tbaa !5
%putchar123 = call i32 @putchar(i32 %75)
%76 = load i32, ptr %2, align 4, !tbaa !5
%putchar123.1 = call i32 @putchar(i32 %76)
%77 = load i32, ptr %4, align 8, !tbaa !5
%putchar123.2 = call i32 @putchar(i32 %77)
%78 = load i32, ptr %6, align 4, !tbaa !5
%putchar123.3 = call i32 @putchar(i32 %78)
%79 = load i32, ptr %8, align 16, !tbaa !5
%putchar123.4 = call i32 @putchar(i32 %79)
%putchar122 = call i32 @putchar(i32 10)
%80 = load i32, ptr %1, align 4, !tbaa !5
%putchar123.1164 = call i32 @putchar(i32 %80)
%81 = load i32, ptr %3, align 8, !tbaa !5
%putchar123.1.1 = call i32 @putchar(i32 %81)
%82 = load i32, ptr %5, align 4, !tbaa !5
%putchar123.2.1 = call i32 @putchar(i32 %82)
%83 = load i32, ptr %7, align 16, !tbaa !5
%putchar123.3.1 = call i32 @putchar(i32 %83)
%84 = load i32, ptr %9, align 4, !tbaa !5
%putchar123.4.1 = call i32 @putchar(i32 %84)
%putchar122.1 = call i32 @putchar(i32 10)
%85 = load i32, ptr %arrayidx33, align 8, !tbaa !5
%putchar123.2166 = call i32 @putchar(i32 %85)
%86 = load i32, ptr %arrayidx33.1, align 4, !tbaa !5
%putchar123.1.2 = call i32 @putchar(i32 %86)
%87 = load i32, ptr %arrayidx33.2, align 16, !tbaa !5
%putchar123.2.2 = call i32 @putchar(i32 %87)
%88 = load i32, ptr %arrayidx33.3, align 4, !tbaa !5
%putchar123.3.2 = call i32 @putchar(i32 %88)
%89 = load i32, ptr %arrayidx33.4, align 8, !tbaa !5
%putchar123.4.2 = call i32 @putchar(i32 %89)
%putchar122.2 = call i32 @putchar(i32 10)
%90 = load i32, ptr %arrayidx81.3167, align 4, !tbaa !5
%putchar123.3168 = call i32 @putchar(i32 %90)
%91 = load i32, ptr %arrayidx81.1.3, align 16, !tbaa !5
%putchar123.1.3 = call i32 @putchar(i32 %91)
%92 = load i32, ptr %arrayidx81.2.3, align 4, !tbaa !5
%putchar123.2.3 = call i32 @putchar(i32 %92)
%93 = load i32, ptr %arrayidx81.3.3, align 8, !tbaa !5
%putchar123.3.3 = call i32 @putchar(i32 %93)
%94 = load i32, ptr %arrayidx81.4.3, align 4, !tbaa !5
%putchar123.4.3 = call i32 @putchar(i32 %94)
%putchar122.3 = call i32 @putchar(i32 10)
%95 = load i32, ptr %arrayidx81.4169, align 16, !tbaa !5
%putchar123.4170 = call i32 @putchar(i32 %95)
%96 = load i32, ptr %arrayidx81.1.4, align 4, !tbaa !5
%putchar123.1.4 = call i32 @putchar(i32 %96)
%97 = load i32, ptr %arrayidx81.2.4, align 8, !tbaa !5
%putchar123.2.4 = call i32 @putchar(i32 %97)
%98 = load i32, ptr %arrayidx81.3.4, align 4, !tbaa !5
%putchar123.3.4 = call i32 @putchar(i32 %98)
%99 = load i32, ptr %arrayidx81.4.4, align 16, !tbaa !5
%putchar123.4.4 = call i32 @putchar(i32 %99)
%putchar122.4 = call i32 @putchar(i32 10)
%100 = load i32, ptr %arrayidx81.5, align 4, !tbaa !5
%putchar123.5 = call i32 @putchar(i32 %100)
%101 = load i32, ptr %arrayidx81.1.5, align 8, !tbaa !5
%putchar123.1.5 = call i32 @putchar(i32 %101)
%102 = load i32, ptr %arrayidx81.2.5, align 4, !tbaa !5
%putchar123.2.5 = call i32 @putchar(i32 %102)
%103 = load i32, ptr %arrayidx81.3.5, align 16, !tbaa !5
%putchar123.3.5 = call i32 @putchar(i32 %103)
%104 = load i32, ptr %arrayidx81.4.5, align 4, !tbaa !5
%putchar123.4.5 = call i32 @putchar(i32 %104)
%putchar122.5 = call i32 @putchar(i32 10)
%105 = load i32, ptr %arrayidx81.6, align 8, !tbaa !5
%putchar123.6 = call i32 @putchar(i32 %105)
%106 = load i32, ptr %arrayidx81.1.6, align 4, !tbaa !5
%putchar123.1.6 = call i32 @putchar(i32 %106)
%107 = load i32, ptr %arrayidx81.2.6, align 16, !tbaa !5
%putchar123.2.6 = call i32 @putchar(i32 %107)
%108 = load i32, ptr %arrayidx81.3.6, align 4, !tbaa !5
%putchar123.3.6 = call i32 @putchar(i32 %108)
%109 = load i32, ptr %arrayidx81.4.6, align 8, !tbaa !5
%putchar123.4.6 = call i32 @putchar(i32 %109)
%putchar122.6 = call i32 @putchar(i32 10)
%110 = load i32, ptr %arrayidx81.7, align 4, !tbaa !5
%putchar123.7 = call i32 @putchar(i32 %110)
%111 = load i32, ptr %arrayidx81.1.7, align 16, !tbaa !5
%putchar123.1.7 = call i32 @putchar(i32 %111)
%112 = load i32, ptr %arrayidx81.2.7, align 4, !tbaa !5
%putchar123.2.7 = call i32 @putchar(i32 %112)
%113 = load i32, ptr %arrayidx81.3.7, align 8, !tbaa !5
%putchar123.3.7 = call i32 @putchar(i32 %113)
%114 = load i32, ptr %arrayidx81.4.7, align 4, !tbaa !5
%putchar123.4.7 = call i32 @putchar(i32 %114)
%putchar122.7 = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %if.then.critedge, !llvm.loop !23
while.end: ; preds = %for.inc69.4, %entry
call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !10}
|
#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 p[5010];
ll s[5010];
int main(){
int n,k;
scanf("%d%d",&n,&k);
rep(i,0,n)scanf("%d",p+i),p[i]--;
rep(i,0,n)scanf("%lld",s+i);
ll ans=-INF;
rep(i,0,n){
ll score[5010];
ll pp[5010];
score[0]=0;
pp[0]=i;
int pos=i;
int cnt=0;
do{
pos=p[pos];
cnt++;
pp[cnt]=pos;
score[cnt]=score[cnt-1]+s[pos];
}while(pos!=i);
ll tempans=-INF;
if(score[cnt]>0){
//最後の1周だけ全探索
int aaa=max(0,k-cnt);
ll temp=score[cnt]*(aaa/cnt)+score[aaa%cnt];
int num=min(k,cnt);
int crr=pp[aaa%cnt];
tempans=temp;
rep(j,0,num){
crr=p[crr];
temp+=s[crr];
tempans=max(tempans,temp);
}
}else{
//最初の1周だけ全探索
ll temp=0;
int num=min(k,cnt);
int crr=i;
tempans=-INF;
rep(j,0,num){
crr=p[crr];
temp+=s[crr];
tempans=max(tempans,temp);
}
}
//printf("%lld\n",tempans);
ans=max(ans,tempans);
}
printf("%lld",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143333/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143333/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@p = dso_local global [5010 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@s = dso_local global [5010 x i64] zeroinitializer, align 16
; 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) #7
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) #7
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:
%n = alloca i32, align 4
%k = alloca i32, align 4
%score = alloca [5010 x i64], align 16
%pp = alloca [5010 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !11
%cmp171 = icmp sgt i32 %0, 0
br i1 %cmp171, label %for.body, label %for.cond.cleanup20
for.cond4.preheader: ; preds = %for.body
%1 = icmp sgt i32 %3, 0
br i1 %1, label %for.body9, label %for.cond16.preheader
for.body: ; preds = %entry, %for.body
%i.0172 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr @p, i64 %i.0172
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%2 = load i32, ptr %add.ptr, align 4, !tbaa !11
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %add.ptr, align 4, !tbaa !11
%inc = add nuw nsw i64 %i.0172, 1
%3 = load i32, ptr %n, align 4, !tbaa !11
%conv = sext i32 %3 to i64
%cmp = icmp slt i64 %inc, %conv
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.cond16.preheader: ; preds = %for.body9, %for.cond4.preheader
%conv5.lcssa = phi i64 [ %conv, %for.cond4.preheader ], [ %conv5, %for.body9 ]
%cmp18188 = icmp sgt i64 %conv5.lcssa, 0
br i1 %cmp18188, label %for.body21.lr.ph, label %for.cond.cleanup20
for.body21.lr.ph: ; preds = %for.cond16.preheader
%4 = load i32, ptr %k, align 4
%5 = sext i32 %4 to i64
%cmp96176 = icmp sgt i32 %4, 0
%cmp65182 = icmp sgt i32 %4, 0
br label %for.body21
for.body9: ; preds = %for.cond4.preheader, %for.body9
%i3.0175 = phi i64 [ %inc13, %for.body9 ], [ 0, %for.cond4.preheader ]
%add.ptr10 = getelementptr inbounds i64, ptr @s, i64 %i3.0175
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %add.ptr10)
%inc13 = add nuw nsw i64 %i3.0175, 1
%6 = load i32, ptr %n, align 4, !tbaa !11
%conv5 = sext i32 %6 to i64
%cmp6 = icmp slt i64 %inc13, %conv5
br i1 %cmp6, label %for.body9, label %for.cond16.preheader, !llvm.loop !14
for.cond.cleanup20: ; preds = %if.end, %entry, %for.cond16.preheader
%ans.0.lcssa = phi i64 [ -4611686016279904256, %for.cond16.preheader ], [ -4611686016279904256, %entry ], [ %cond119, %if.end ]
%call123 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
for.body21: ; preds = %for.body21.lr.ph, %if.end
%ans.0190 = phi i64 [ -4611686016279904256, %for.body21.lr.ph ], [ %cond119, %if.end ]
%i15.0189 = phi i64 [ 0, %for.body21.lr.ph ], [ %inc121, %if.end ]
call void @llvm.lifetime.start.p0(i64 40080, ptr nonnull %score) #7
call void @llvm.lifetime.start.p0(i64 40080, ptr nonnull %pp) #7
store i64 0, ptr %score, align 16, !tbaa !5
store i64 %i15.0189, ptr %pp, align 16, !tbaa !5
%conv24 = trunc i64 %i15.0189 to i32
br label %do.body
do.body: ; preds = %do.body, %for.body21
%7 = phi i64 [ %add, %do.body ], [ 0, %for.body21 ]
%indvars.iv195 = phi i64 [ %indvars.iv.next196, %do.body ], [ 1, %for.body21 ]
%indvars.iv = phi i64 [ %indvars.iv.next, %do.body ], [ 0, %for.body21 ]
%pos.0 = phi i32 [ %8, %do.body ], [ %conv24, %for.body21 ]
%idxprom = sext i32 %pos.0 to i64
%arrayidx25 = getelementptr inbounds [5010 x i32], ptr @p, i64 0, i64 %idxprom
%8 = load i32, ptr %arrayidx25, align 4, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%conv27 = sext i32 %8 to i64
%arrayidx29 = getelementptr inbounds [5010 x i64], ptr %pp, i64 0, i64 %indvars.iv.next
store i64 %conv27, ptr %arrayidx29, align 8, !tbaa !5
%arrayidx33 = getelementptr inbounds [5010 x i64], ptr @s, i64 0, i64 %conv27
%9 = load i64, ptr %arrayidx33, align 8, !tbaa !5
%add = add nsw i64 %9, %7
%arrayidx35 = getelementptr inbounds [5010 x i64], ptr %score, i64 0, i64 %indvars.iv.next
store i64 %add, ptr %arrayidx35, align 8, !tbaa !5
%cmp37.not = icmp eq i64 %i15.0189, %conv27
%indvars.iv.next196 = add nuw i64 %indvars.iv195, 1
br i1 %cmp37.not, label %do.end, label %do.body, !llvm.loop !15
do.end: ; preds = %do.body
%cmp41 = icmp sgt i64 %add, 0
br i1 %cmp41, label %if.then, label %if.else
if.then: ; preds = %do.end
%10 = trunc i64 %indvars.iv.next to i32
%sub43 = sub nsw i32 %4, %10
%cond = call i32 @llvm.smax.i32(i32 %sub43, i32 0)
%div = udiv i32 %cond, %10
%conv49 = zext i32 %div to i64
%mul = mul nsw i64 %add, %conv49
%rem = urem i32 %cond, %10
%idxprom50 = zext i32 %rem to i64
%arrayidx51 = getelementptr inbounds [5010 x i64], ptr %score, i64 0, i64 %idxprom50
%11 = load i64, ptr %arrayidx51, align 8, !tbaa !5
%add52 = add nsw i64 %mul, %11
br i1 %cmp65182, label %for.body68.preheader, label %if.end
for.body68.preheader: ; preds = %if.then
%arrayidx61 = getelementptr inbounds [5010 x i64], ptr %pp, i64 0, i64 %idxprom50
%12 = load i64, ptr %arrayidx61, align 8, !tbaa !5
%conv62 = trunc i64 %12 to i32
%smin198 = call i64 @llvm.smin.i64(i64 %indvars.iv195, i64 %5)
%smax199 = call i64 @llvm.smax.i64(i64 %smin198, i64 1)
%xtraiter213 = and i64 %smax199, 1
%13 = icmp slt i64 %smin198, 2
br i1 %13, label %if.end.loopexit.unr-lcssa, label %for.body68.preheader.new
for.body68.preheader.new: ; preds = %for.body68.preheader
%unroll_iter216 = and i64 %smax199, 9223372036854775806
br label %for.body68
for.body68: ; preds = %for.body68, %for.body68.preheader.new
%crr.0185 = phi i32 [ %conv62, %for.body68.preheader.new ], [ %16, %for.body68 ]
%temp.0184 = phi i64 [ %add52, %for.body68.preheader.new ], [ %add73.1, %for.body68 ]
%tempans.0183 = phi i64 [ %add52, %for.body68.preheader.new ], [ %cond79.1, %for.body68 ]
%niter217 = phi i64 [ 0, %for.body68.preheader.new ], [ %niter217.next.1, %for.body68 ]
%idxprom69 = sext i32 %crr.0185 to i64
%arrayidx70 = getelementptr inbounds [5010 x i32], ptr @p, i64 0, i64 %idxprom69
%14 = load i32, ptr %arrayidx70, align 4, !tbaa !11
%idxprom71 = sext i32 %14 to i64
%arrayidx72 = getelementptr inbounds [5010 x i64], ptr @s, i64 0, i64 %idxprom71
%15 = load i64, ptr %arrayidx72, align 8, !tbaa !5
%add73 = add nsw i64 %15, %temp.0184
%cond79 = call i64 @llvm.smax.i64(i64 %tempans.0183, i64 %add73)
%idxprom69.1 = sext i32 %14 to i64
%arrayidx70.1 = getelementptr inbounds [5010 x i32], ptr @p, i64 0, i64 %idxprom69.1
%16 = load i32, ptr %arrayidx70.1, align 4, !tbaa !11
%idxprom71.1 = sext i32 %16 to i64
%arrayidx72.1 = getelementptr inbounds [5010 x i64], ptr @s, i64 0, i64 %idxprom71.1
%17 = load i64, ptr %arrayidx72.1, align 8, !tbaa !5
%add73.1 = add nsw i64 %17, %add73
%cond79.1 = call i64 @llvm.smax.i64(i64 %cond79, i64 %add73.1)
%niter217.next.1 = add i64 %niter217, 2
%niter217.ncmp.1 = icmp eq i64 %niter217.next.1, %unroll_iter216
br i1 %niter217.ncmp.1, label %if.end.loopexit.unr-lcssa, label %for.body68, !llvm.loop !16
if.else: ; preds = %do.end
br i1 %cmp96176, label %for.body99.preheader, label %if.end
for.body99.preheader: ; preds = %if.else
%smin = call i64 @llvm.smin.i64(i64 %indvars.iv195, i64 %5)
%smax = call i64 @llvm.smax.i64(i64 %smin, i64 1)
%xtraiter = and i64 %smax, 1
%18 = icmp slt i64 %smin, 2
br i1 %18, label %if.end.loopexit210.unr-lcssa, label %for.body99.preheader.new
for.body99.preheader.new: ; preds = %for.body99.preheader
%unroll_iter = and i64 %smax, 9223372036854775806
br label %for.body99
for.body99: ; preds = %for.body99, %for.body99.preheader.new
%crr91.0179 = phi i32 [ %conv24, %for.body99.preheader.new ], [ %21, %for.body99 ]
%temp83.0178 = phi i64 [ 0, %for.body99.preheader.new ], [ %add104.1, %for.body99 ]
%tempans.1177 = phi i64 [ -4611686016279904256, %for.body99.preheader.new ], [ %cond110.1, %for.body99 ]
%niter = phi i64 [ 0, %for.body99.preheader.new ], [ %niter.next.1, %for.body99 ]
%idxprom100 = sext i32 %crr91.0179 to i64
%arrayidx101 = getelementptr inbounds [5010 x i32], ptr @p, i64 0, i64 %idxprom100
%19 = load i32, ptr %arrayidx101, align 4, !tbaa !11
%idxprom102 = sext i32 %19 to i64
%arrayidx103 = getelementptr inbounds [5010 x i64], ptr @s, i64 0, i64 %idxprom102
%20 = load i64, ptr %arrayidx103, align 8, !tbaa !5
%add104 = add nsw i64 %20, %temp83.0178
%cond110 = call i64 @llvm.smax.i64(i64 %tempans.1177, i64 %add104)
%idxprom100.1 = sext i32 %19 to i64
%arrayidx101.1 = getelementptr inbounds [5010 x i32], ptr @p, i64 0, i64 %idxprom100.1
%21 = load i32, ptr %arrayidx101.1, align 4, !tbaa !11
%idxprom102.1 = sext i32 %21 to i64
%arrayidx103.1 = getelementptr inbounds [5010 x i64], ptr @s, i64 0, i64 %idxprom102.1
%22 = load i64, ptr %arrayidx103.1, align 8, !tbaa !5
%add104.1 = add nsw i64 %22, %add104
%cond110.1 = call i64 @llvm.smax.i64(i64 %cond110, i64 %add104.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 %if.end.loopexit210.unr-lcssa, label %for.body99, !llvm.loop !17
if.end.loopexit.unr-lcssa: ; preds = %for.body68, %for.body68.preheader
%cond79.lcssa.ph = phi i64 [ undef, %for.body68.preheader ], [ %cond79.1, %for.body68 ]
%crr.0185.unr = phi i32 [ %conv62, %for.body68.preheader ], [ %16, %for.body68 ]
%temp.0184.unr = phi i64 [ %add52, %for.body68.preheader ], [ %add73.1, %for.body68 ]
%tempans.0183.unr = phi i64 [ %add52, %for.body68.preheader ], [ %cond79.1, %for.body68 ]
%lcmp.mod214.not = icmp eq i64 %xtraiter213, 0
br i1 %lcmp.mod214.not, label %if.end, label %for.body68.epil
for.body68.epil: ; preds = %if.end.loopexit.unr-lcssa
%idxprom69.epil = sext i32 %crr.0185.unr to i64
%arrayidx70.epil = getelementptr inbounds [5010 x i32], ptr @p, i64 0, i64 %idxprom69.epil
%23 = load i32, ptr %arrayidx70.epil, align 4, !tbaa !11
%idxprom71.epil = sext i32 %23 to i64
%arrayidx72.epil = getelementptr inbounds [5010 x i64], ptr @s, i64 0, i64 %idxprom71.epil
%24 = load i64, ptr %arrayidx72.epil, align 8, !tbaa !5
%add73.epil = add nsw i64 %24, %temp.0184.unr
%cond79.epil = call i64 @llvm.smax.i64(i64 %tempans.0183.unr, i64 %add73.epil)
br label %if.end
if.end.loopexit210.unr-lcssa: ; preds = %for.body99, %for.body99.preheader
%cond110.lcssa.ph = phi i64 [ undef, %for.body99.preheader ], [ %cond110.1, %for.body99 ]
%crr91.0179.unr = phi i32 [ %conv24, %for.body99.preheader ], [ %21, %for.body99 ]
%temp83.0178.unr = phi i64 [ 0, %for.body99.preheader ], [ %add104.1, %for.body99 ]
%tempans.1177.unr = phi i64 [ -4611686016279904256, %for.body99.preheader ], [ %cond110.1, %for.body99 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %if.end, label %for.body99.epil
for.body99.epil: ; preds = %if.end.loopexit210.unr-lcssa
%idxprom100.epil = sext i32 %crr91.0179.unr to i64
%arrayidx101.epil = getelementptr inbounds [5010 x i32], ptr @p, i64 0, i64 %idxprom100.epil
%25 = load i32, ptr %arrayidx101.epil, align 4, !tbaa !11
%idxprom102.epil = sext i32 %25 to i64
%arrayidx103.epil = getelementptr inbounds [5010 x i64], ptr @s, i64 0, i64 %idxprom102.epil
%26 = load i64, ptr %arrayidx103.epil, align 8, !tbaa !5
%add104.epil = add nsw i64 %26, %temp83.0178.unr
%cond110.epil = call i64 @llvm.smax.i64(i64 %tempans.1177.unr, i64 %add104.epil)
br label %if.end
if.end: ; preds = %for.body99.epil, %if.end.loopexit210.unr-lcssa, %for.body68.epil, %if.end.loopexit.unr-lcssa, %if.else, %if.then
%tempans.2 = phi i64 [ %add52, %if.then ], [ -4611686016279904256, %if.else ], [ %cond79.lcssa.ph, %if.end.loopexit.unr-lcssa ], [ %cond79.epil, %for.body68.epil ], [ %cond110.lcssa.ph, %if.end.loopexit210.unr-lcssa ], [ %cond110.epil, %for.body99.epil ]
%cond119 = call i64 @llvm.smax.i64(i64 %ans.0190, i64 %tempans.2)
call void @llvm.lifetime.end.p0(i64 40080, ptr nonnull %pp) #7
call void @llvm.lifetime.end.p0(i64 40080, ptr nonnull %score) #7
%inc121 = add nuw nsw i64 %i15.0189, 1
%exitcond201.not = icmp eq i64 %inc121, %conv5.lcssa
br i1 %exitcond201.not, label %for.cond.cleanup20, label %for.body21, !llvm.loop !18
}
; 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 i64 @llvm.smax.i64(i64, i64) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"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}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
typedef struct {
double x;
double y;
} vector;
vector vector_sub(vector a, vector b){
vector ret;
ret.x = a.x - b.x;
ret.y = a.y - b.y;
return ret;
}
double vector_product(vector a, vector b){
return a.x * b.y - a.y * b.x;
}
int main(void){
vector t1,t2,t3,tp;
vector v12,v23,v31,v1p,v2p,v3p;
double z1,z2,z3;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&t1.x,&t1.y,&t2.x,&t2.y,&t3.x,&t3.y,&tp.x,&tp.y)>=8){
/* 辺と頂点→Pをベクトル化 */
v12 = vector_sub(t2,t1);
v23 = vector_sub(t3,t2);
v31 = vector_sub(t1,t3);
v1p = vector_sub(tp,t1);
v2p = vector_sub(tp,t2);
v3p = vector_sub(tp,t3);
/* ベクトル外積が全て向きが同じなら内部にある */
z1 = vector_product(v12, v2p);
z2 = vector_product(v23, v3p);
z3 = vector_product(v31, v1p);
printf( ( ((z1>0)&&(z2>0)&&(z3>0)) || ((z1<0)&&(z2<0)&&(z3<0)) ) ? "YES\n":"NO\n" );
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143377/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143377/source.c"
target datalayout = "e-m:e-p270: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.vector = type { double, double }
@.str = private unnamed_addr constant [32 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"YES\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"NO\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { double, double } @vector_sub(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #0 {
entry:
%sub = fsub double %a.coerce0, %b.coerce0
%sub4 = fsub double %a.coerce1, %b.coerce1
%.fca.0.insert = insertvalue { double, double } poison, double %sub, 0
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %sub4, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @vector_product(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #1 {
entry:
%0 = fneg double %a.coerce1
%neg = fmul double %0, %b.coerce0
%1 = tail call double @llvm.fmuladd.f64(double %a.coerce0, double %b.coerce1, double %neg)
ret double %1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%t1 = alloca %struct.vector, align 8
%t2 = alloca %struct.vector, align 8
%t3 = alloca %struct.vector, align 8
%tp = alloca %struct.vector, align 8
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %t1) #7
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %t2) #7
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %t3) #7
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %tp) #7
%y = getelementptr inbounds %struct.vector, ptr %t1, i64 0, i32 1
%y2 = getelementptr inbounds %struct.vector, ptr %t2, i64 0, i32 1
%y4 = getelementptr inbounds %struct.vector, ptr %t3, i64 0, i32 1
%y6 = getelementptr inbounds %struct.vector, ptr %tp, i64 0, i32 1
%call58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t1, ptr noundef nonnull %y, ptr noundef nonnull %t2, ptr noundef nonnull %y2, ptr noundef nonnull %t3, ptr noundef nonnull %y4, ptr noundef nonnull %tp, ptr noundef nonnull %y6)
%cmp59 = icmp sgt i32 %call58, 7
br i1 %cmp59, label %while.body, label %while.end
while.body: ; preds = %entry, %while.cond
%0 = load double, ptr %t2, align 8
%1 = load double, ptr %y2, align 8
%2 = load double, ptr %t1, align 8
%3 = load double, ptr %y, align 8
%sub.i = fsub double %0, %2
%sub4.i = fsub double %1, %3
%4 = load double, ptr %t3, align 8
%5 = load double, ptr %y4, align 8
%6 = load double, ptr %tp, align 8
%7 = load double, ptr %y6, align 8
%sub.i47 = fsub double %6, %0
%sub4.i48 = fsub double %7, %1
%8 = fneg double %sub4.i
%neg.i = fmul double %sub.i47, %8
%9 = call double @llvm.fmuladd.f64(double %sub.i, double %sub4.i48, double %neg.i)
%10 = insertelement <2 x double> poison, double %2, i64 0
%11 = insertelement <2 x double> %10, double %4, i64 1
%12 = insertelement <2 x double> poison, double %4, i64 0
%13 = insertelement <2 x double> %12, double %0, i64 1
%14 = fsub <2 x double> %11, %13
%15 = insertelement <2 x double> poison, double %3, i64 0
%16 = insertelement <2 x double> %15, double %5, i64 1
%17 = insertelement <2 x double> poison, double %5, i64 0
%18 = insertelement <2 x double> %17, double %1, i64 1
%19 = fsub <2 x double> %16, %18
%20 = insertelement <2 x double> poison, double %6, i64 0
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> zeroinitializer
%22 = fsub <2 x double> %21, %11
%23 = insertelement <2 x double> poison, double %7, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = fsub <2 x double> %24, %16
%26 = fneg <2 x double> %19
%27 = fmul <2 x double> %22, %26
%28 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %25, <2 x double> %27)
%cmp21 = fcmp ogt double %9, 0.000000e+00
%29 = extractelement <2 x double> %28, i64 1
%cmp22 = fcmp ogt double %29, 0.000000e+00
%or.cond = select i1 %cmp21, i1 %cmp22, i1 false
%30 = extractelement <2 x double> %28, i64 0
%cmp24 = fcmp ogt double %30, 0.000000e+00
%or.cond30 = select i1 %or.cond, i1 %cmp24, i1 false
br i1 %or.cond30, label %lor.end.thread, label %lor.end
lor.end: ; preds = %while.body
%cmp25 = fcmp olt double %9, 0.000000e+00
%31 = fcmp olt <2 x double> %28, zeroinitializer
%32 = extractelement <2 x i1> %31, i64 1
%or.cond31 = select i1 %cmp25, i1 %32, i1 false
%33 = extractelement <2 x i1> %31, i64 0
%spec.select = select i1 %or.cond31, i1 %33, i1 false
%cond.fr = freeze i1 %spec.select
br i1 %cond.fr, label %lor.end.thread, label %while.cond
lor.end.thread: ; preds = %while.body, %lor.end
br label %while.cond
while.cond: ; preds = %lor.end, %lor.end.thread
%34 = phi ptr [ @.str.1, %lor.end.thread ], [ @.str.2, %lor.end ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %34)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t1, ptr noundef nonnull %y, ptr noundef nonnull %t2, ptr noundef nonnull %y2, ptr noundef nonnull %t3, ptr noundef nonnull %y4, ptr noundef nonnull %tp, ptr noundef nonnull %y6)
%cmp = icmp sgt i32 %call, 7
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !5
while.end: ; preds = %while.cond, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %tp) #7
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %t3) #7
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %t2) #7
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %t1) #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) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
const double EPS = 1e-5;
double ix1, ix2, ix3, ixp;
double iy1, iy2, iy3, iyp;
//2点の座標から辺の長さを求める
double sideLength(double x1, double y1, double x2, double y2) {
return sqrt( pow(fabs(x1-x2), 2.0) + pow(fabs(y1-y2), 2.0) );
}
//3辺の長さから三角形の面積を求める
double heron(double a, double b, double c) {
double s = (a + b + c) / 2;
return sqrt( s * (s-a) * (s-b) * (s-c) );
}
int solve1() {
double ab = sideLength(ix1, iy1, ix2, iy2),
bc = sideLength(ix2, iy2, ix3, iy3),
ca = sideLength(ix3, iy3, ix1, iy1),
ap = sideLength(ix1, iy1, ixp, iyp),
bp = sideLength(ix2, iy2, ixp, iyp),
cp = sideLength(ix3, iy3, ixp, iyp);
double Sabc = heron(ab, bc, ca);
double Sabcp = heron(ab, bp, ap) + heron(ca, ap, cp) + heron(bc, bp, cp);
return fabs(Sabcp - Sabc) < EPS;
}
int main() {
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ix1, &iy1, &ix2, &iy2, &ix3, &iy3, &ixp, &iyp) != EOF){
if(solve1()) {
printf("YES\n");
} else {
printf("NO\n");
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143427/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143427/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@EPS = dso_local local_unnamed_addr constant double 1.000000e-05, align 8
@ix1 = dso_local global double 0.000000e+00, align 8
@iy1 = dso_local global double 0.000000e+00, align 8
@ix2 = dso_local global double 0.000000e+00, align 8
@iy2 = dso_local global double 0.000000e+00, align 8
@ix3 = dso_local global double 0.000000e+00, align 8
@iy3 = dso_local global double 0.000000e+00, align 8
@ixp = dso_local global double 0.000000e+00, align 8
@iyp = dso_local global double 0.000000e+00, align 8
@.str = private unnamed_addr constant [32 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @sideLength(double noundef %x1, double noundef %y1, double noundef %x2, double noundef %y2) local_unnamed_addr #0 {
entry:
%0 = insertelement <2 x double> poison, double %x1, i64 0
%1 = insertelement <2 x double> %0, double %y1, i64 1
%2 = insertelement <2 x double> poison, double %x2, i64 0
%3 = insertelement <2 x double> %2, double %y2, i64 1
%4 = fsub <2 x double> %1, %3
%5 = fmul <2 x double> %4, %4
%shift = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%6 = fadd <2 x double> %5, %shift
%add = extractelement <2 x double> %6, i64 0
%sqrt = tail call double @llvm.sqrt.f64(double %add)
ret double %sqrt
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local double @heron(double noundef %a, double noundef %b, double noundef %c) local_unnamed_addr #3 {
entry:
%add = fadd double %a, %b
%add1 = fadd double %add, %c
%div = fmul double %add1, 5.000000e-01
%sub = fsub double %div, %a
%mul = fmul double %div, %sub
%sub2 = fsub double %div, %b
%mul3 = fmul double %sub2, %mul
%sub4 = fsub double %div, %c
%mul5 = fmul double %sub4, %mul3
%call = tail call double @sqrt(double noundef %mul5) #9
ret double %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: write) uwtable
define dso_local i32 @solve1() local_unnamed_addr #4 {
entry:
%0 = load double, ptr @ix1, align 8, !tbaa !5
%1 = load double, ptr @iy1, align 8, !tbaa !5
%2 = load double, ptr @ix2, align 8, !tbaa !5
%3 = load double, ptr @iy2, align 8, !tbaa !5
%4 = insertelement <2 x double> poison, double %0, i64 0
%5 = insertelement <2 x double> %4, double %1, i64 1
%6 = insertelement <2 x double> poison, double %2, i64 0
%7 = insertelement <2 x double> %6, double %3, i64 1
%8 = fsub <2 x double> %5, %7
%9 = fmul <2 x double> %8, %8
%shift = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%10 = fadd <2 x double> %9, %shift
%add.i = extractelement <2 x double> %10, i64 0
%sqrt.i = tail call double @llvm.sqrt.f64(double %add.i)
%11 = load double, ptr @ix3, align 8, !tbaa !5
%12 = load double, ptr @iy3, align 8, !tbaa !5
%13 = load double, ptr @ixp, align 8, !tbaa !5
%14 = load double, ptr @iyp, align 8, !tbaa !5
%15 = insertelement <2 x double> poison, double %13, i64 0
%16 = insertelement <2 x double> %15, double %14, i64 1
%17 = fsub <2 x double> %5, %16
%18 = fmul <2 x double> %17, %17
%shift79 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%19 = fadd <2 x double> %18, %shift79
%add.i33 = extractelement <2 x double> %19, i64 0
%sqrt.i34 = tail call double @llvm.sqrt.f64(double %add.i33)
%20 = insertelement <2 x double> poison, double %11, i64 0
%21 = insertelement <2 x double> %20, double %2, i64 1
%22 = insertelement <2 x double> %4, double %11, i64 1
%23 = fsub <2 x double> %21, %22
%24 = fmul <2 x double> %23, %23
%25 = insertelement <2 x double> poison, double %12, i64 0
%26 = insertelement <2 x double> %25, double %3, i64 1
%27 = insertelement <2 x double> poison, double %1, i64 0
%28 = insertelement <2 x double> %27, double %12, i64 1
%29 = fsub <2 x double> %26, %28
%30 = fmul <2 x double> %29, %29
%31 = fadd <2 x double> %24, %30
%32 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %31)
%33 = extractelement <2 x double> %32, i64 1
%add.i47 = fadd double %sqrt.i, %33
%34 = extractelement <2 x double> %32, i64 0
%add1.i = fadd double %34, %add.i47
%div.i = fmul double %add1.i, 5.000000e-01
%sub.i48 = fsub double %div.i, %sqrt.i
%mul.i = fmul double %div.i, %sub.i48
%35 = insertelement <2 x double> poison, double %div.i, i64 0
%36 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> zeroinitializer
%37 = fsub <2 x double> %36, %32
%38 = extractelement <2 x double> %37, i64 1
%mul3.i = fmul double %38, %mul.i
%39 = extractelement <2 x double> %37, i64 0
%mul5.i = fmul double %39, %mul3.i
%call.i = tail call double @sqrt(double noundef %mul5.i) #9
%add.i59 = fadd double %34, %sqrt.i34
%40 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%41 = fsub <2 x double> %21, %40
%42 = fmul <2 x double> %41, %41
%43 = insertelement <2 x double> poison, double %14, i64 0
%44 = shufflevector <2 x double> %43, <2 x double> poison, <2 x i32> zeroinitializer
%45 = fsub <2 x double> %26, %44
%46 = fmul <2 x double> %45, %45
%47 = fadd <2 x double> %42, %46
%48 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %47)
%49 = extractelement <2 x double> %48, i64 1
%add.i49 = fadd double %sqrt.i, %49
%add1.i50 = fadd double %sqrt.i34, %add.i49
%div.i51 = fmul double %add1.i50, 5.000000e-01
%sub.i52 = fsub double %div.i51, %sqrt.i
%mul.i53 = fmul double %div.i51, %sub.i52
%sub2.i54 = fsub double %div.i51, %49
%mul3.i55 = fmul double %sub2.i54, %mul.i53
%sub4.i56 = fsub double %div.i51, %sqrt.i34
%mul5.i57 = fmul double %sub4.i56, %mul3.i55
%call.i58 = tail call double @sqrt(double noundef %mul5.i57) #9
%50 = extractelement <2 x double> %48, i64 0
%add1.i60 = fadd double %50, %add.i59
%div.i61 = fmul double %add1.i60, 5.000000e-01
%sub.i62 = fsub double %div.i61, %34
%mul.i63 = fmul double %div.i61, %sub.i62
%sub2.i64 = fsub double %div.i61, %sqrt.i34
%mul3.i65 = fmul double %sub2.i64, %mul.i63
%sub4.i66 = fsub double %div.i61, %50
%mul5.i67 = fmul double %sub4.i66, %mul3.i65
%call.i68 = tail call double @sqrt(double noundef %mul5.i67) #9
%add = fadd double %call.i58, %call.i68
%add.i69 = fadd double %33, %49
%add1.i70 = fadd double %50, %add.i69
%div.i71 = fmul double %add1.i70, 5.000000e-01
%sub.i72 = fsub double %div.i71, %33
%mul.i73 = fmul double %div.i71, %sub.i72
%51 = insertelement <2 x double> poison, double %div.i71, i64 0
%52 = shufflevector <2 x double> %51, <2 x double> poison, <2 x i32> zeroinitializer
%53 = fsub <2 x double> %52, %48
%54 = extractelement <2 x double> %53, i64 1
%mul3.i75 = fmul double %54, %mul.i73
%55 = extractelement <2 x double> %53, i64 0
%mul5.i77 = fmul double %55, %mul3.i75
%call.i78 = tail call double @sqrt(double noundef %mul5.i77) #9
%add10 = fadd double %add, %call.i78
%sub = fsub double %add10, %call.i
%56 = tail call double @llvm.fabs.f64(double %sub)
%cmp = fcmp olt double %56, 1.000000e-05
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%call5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @ix1, ptr noundef nonnull @iy1, ptr noundef nonnull @ix2, ptr noundef nonnull @iy2, ptr noundef nonnull @ix3, ptr noundef nonnull @iy3, ptr noundef nonnull @ixp, ptr noundef nonnull @iyp)
%cmp.not6 = icmp eq i32 %call5, -1
br i1 %cmp.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = tail call i32 @solve1(), !range !9
%tobool.not = icmp eq i32 %call1, 0
%str.str.3 = select i1 %tobool.not, ptr @str, ptr @str.3
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @ix1, ptr noundef nonnull @iy1, ptr noundef nonnull @ix2, ptr noundef nonnull @iy2, ptr noundef nonnull @ix3, ptr noundef nonnull @iy3, ptr noundef nonnull @ixp, ptr noundef nonnull @iyp)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10
while.end: ; preds = %while.body, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #8
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i32 0, i32 2}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
double x[5],xp,y[5],yp;
int i,t;
while(0<=scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&xp,&yp)){
x[3]=x[0];
y[3]=y[0];
x[4]=x[1];
y[4]=y[1];
t=0;
for(i=0;i<3;i++){
if(((y[i+1]-y[i])/(x[i+1]-x[i])*(xp-x[i])+y[i]-yp)*((y[i+1]-y[i])/(x[i+1]-x[i])*(x[i+2]-x[i])+y[i]-y[i+2])<=0){
t=1;
break;
}
}
if(t==1){
printf("NO\n");
}else{
printf("YES\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143506/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143506/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [25 x i8] c"%lf%lf%lf%lf%lf%lf%lf%lf\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [5 x double], align 16
%xp = alloca double, align 8
%y = alloca [5 x double], align 16
%yp = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xp) #5
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %y) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yp) #5
%arrayidx2 = getelementptr inbounds [5 x double], ptr %x, i64 0, i64 1
%arrayidx3 = getelementptr inbounds [5 x double], ptr %y, i64 0, i64 1
%arrayidx4 = getelementptr inbounds [5 x double], ptr %x, i64 0, i64 2
%arrayidx5 = getelementptr inbounds [5 x double], ptr %y, i64 0, i64 2
%call77 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %xp, ptr noundef nonnull %yp)
%cmp78 = icmp sgt i32 %call77, -1
br i1 %cmp78, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%arrayidx7 = getelementptr inbounds [5 x double], ptr %x, i64 0, i64 3
%arrayidx9 = getelementptr inbounds [5 x double], ptr %y, i64 0, i64 3
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end60
%0 = load <2 x double>, ptr %x, align 16, !tbaa !5
store <2 x double> %0, ptr %arrayidx7, align 8, !tbaa !5
%1 = load <2 x double>, ptr %y, align 16, !tbaa !5
store <2 x double> %1, ptr %arrayidx9, align 8, !tbaa !5
%2 = load double, ptr %xp, align 8, !tbaa !5
%3 = load double, ptr %yp, align 8, !tbaa !5
%4 = extractelement <2 x double> %1, i64 0
%5 = extractelement <2 x double> %0, i64 0
%6 = shufflevector <2 x double> %1, <2 x double> %0, <2 x i32> <i32 1, i32 3>
%7 = shufflevector <2 x double> %1, <2 x double> %0, <2 x i32> <i32 0, i32 2>
%8 = fsub <2 x double> %6, %7
%9 = extractelement <2 x double> %8, i64 0
%10 = extractelement <2 x double> %8, i64 1
%div = fdiv double %9, %10
%11 = load double, ptr %arrayidx4, align 16, !tbaa !5
%12 = load double, ptr %arrayidx5, align 16, !tbaa !5
%13 = insertelement <2 x double> poison, double %2, i64 0
%14 = insertelement <2 x double> %13, double %11, i64 1
%15 = shufflevector <2 x double> %0, <2 x double> poison, <2 x i32> zeroinitializer
%16 = fsub <2 x double> %14, %15
%17 = insertelement <2 x double> poison, double %div, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = shufflevector <2 x double> %1, <2 x double> poison, <2 x i32> zeroinitializer
%20 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %16, <2 x double> %19)
%21 = insertelement <2 x double> poison, double %3, i64 0
%22 = insertelement <2 x double> %21, double %12, i64 1
%23 = fsub <2 x double> %20, %22
%shift = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%24 = fmul <2 x double> %23, %shift
%mul = extractelement <2 x double> %24, i64 0
%cmp55 = fcmp ugt double %mul, 0.000000e+00
br i1 %cmp55, label %for.cond.1, label %if.end60, !llvm.loop !9
for.cond.1: ; preds = %while.body
%25 = extractelement <2 x double> %1, i64 1
%sub.1 = fsub double %12, %25
%26 = extractelement <2 x double> %0, i64 1
%sub23.1 = fsub double %11, %26
%div.1 = fdiv double %sub.1, %sub23.1
%27 = shufflevector <2 x double> %13, <2 x double> %0, <2 x i32> <i32 0, i32 2>
%28 = shufflevector <2 x double> %0, <2 x double> poison, <2 x i32> <i32 1, i32 1>
%29 = fsub <2 x double> %27, %28
%30 = insertelement <2 x double> poison, double %div.1, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = shufflevector <2 x double> %1, <2 x double> poison, <2 x i32> <i32 1, i32 1>
%33 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %31, <2 x double> %29, <2 x double> %32)
%34 = shufflevector <2 x double> %21, <2 x double> %1, <2 x i32> <i32 0, i32 2>
%35 = fsub <2 x double> %33, %34
%shift81 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%36 = fmul <2 x double> %35, %shift81
%mul.1 = extractelement <2 x double> %36, i64 0
%cmp55.1 = fcmp ugt double %mul.1, 0.000000e+00
br i1 %cmp55.1, label %for.cond.2, label %if.end60, !llvm.loop !9
for.cond.2: ; preds = %for.cond.1
%sub.2 = fsub double %4, %12
%sub23.2 = fsub double %5, %11
%div.2 = fdiv double %sub.2, %sub23.2
%37 = insertelement <2 x double> %0, double %2, i64 0
%38 = insertelement <2 x double> poison, double %11, i64 0
%39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
%40 = fsub <2 x double> %37, %39
%41 = insertelement <2 x double> poison, double %div.2, i64 0
%42 = shufflevector <2 x double> %41, <2 x double> poison, <2 x i32> zeroinitializer
%43 = insertelement <2 x double> poison, double %12, i64 0
%44 = shufflevector <2 x double> %43, <2 x double> poison, <2 x i32> zeroinitializer
%45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %42, <2 x double> %40, <2 x double> %44)
%46 = insertelement <2 x double> %1, double %3, i64 0
%47 = fsub <2 x double> %45, %46
%shift82 = shufflevector <2 x double> %47, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%48 = fmul <2 x double> %47, %shift82
%mul.2 = extractelement <2 x double> %48, i64 0
%cmp55.2 = fcmp ugt double %mul.2, 0.000000e+00
br i1 %cmp55.2, label %if.else, label %if.end60, !llvm.loop !9
if.else: ; preds = %for.cond.2
br label %if.end60
if.end60: ; preds = %while.body, %for.cond.1, %for.cond.2, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.cond.2 ], [ @str.3, %for.cond.1 ], [ @str.3, %while.body ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %xp, ptr noundef nonnull %yp)
%cmp = icmp sgt i32 %call, -1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %if.end60, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yp) #5
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xp) #5
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %x) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int find_sum()
{
int n, *ar, sum = 0;
scanf("%d", &n);
ar = malloc(sizeof(*ar) * n);
for (int i = 0; i < n; i++)
{
scanf("%d", &ar[i]);
sum += ar[i];
}
if ((sum / n) * n >= sum)
return (sum / n);
else
return ((sum + n - 1) / n);
}
int main()
{
int a, b, c;
scanf("%d", &a);
for (int i = 0; i < a; i++)
{
printf("%d\n", find_sum());
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14355/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14355/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @find_sum() 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
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ]
%div = sdiv i32 %sum.0.lcssa, %.lcssa
%mul6 = mul nsw i32 %div, %.lcssa
%cmp7.not = icmp slt i32 %mul6, %sum.0.lcssa
br i1 %cmp7.not, label %if.else, label %cleanup
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.023 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.023
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.else: ; preds = %for.cond.cleanup
%add10 = add nsw i32 %sum.0.lcssa, -1
%sub = add i32 %add10, %.lcssa
%div11 = sdiv i32 %sub, %.lcssa
br label %cleanup
cleanup: ; preds = %for.cond.cleanup, %if.else
%retval.0 = phi i32 [ %div11, %if.else ], [ %div, %for.cond.cleanup ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: 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 #0 {
entry:
%n.i = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %find_sum.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
for.body: ; preds = %entry, %find_sum.exit
%i.05 = phi i32 [ %inc, %find_sum.exit ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n.i) #4
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n.i)
%1 = load i32, ptr %n.i, align 4, !tbaa !5
%conv.i = sext i32 %1 to i64
%mul.i = shl nsw i64 %conv.i, 2
%call1.i = call noalias ptr @malloc(i64 noundef %mul.i) #5
%cmp22.i = icmp sgt i32 %1, 0
br i1 %cmp22.i, label %for.body.i, label %for.cond.cleanup.i
for.cond.cleanup.i: ; preds = %for.body.i, %for.body
%sum.0.lcssa.i = phi i32 [ 0, %for.body ], [ %add.i, %for.body.i ]
%.lcssa.i = phi i32 [ %1, %for.body ], [ %3, %for.body.i ]
%div.i = sdiv i32 %sum.0.lcssa.i, %.lcssa.i
%mul6.i = mul nsw i32 %div.i, %.lcssa.i
%cmp7.not.i = icmp slt i32 %mul6.i, %sum.0.lcssa.i
br i1 %cmp7.not.i, label %if.else.i, label %find_sum.exit
for.body.i: ; preds = %for.body, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %for.body ]
%sum.023.i = phi i32 [ %add.i, %for.body.i ], [ 0, %for.body ]
%arrayidx.i = getelementptr inbounds i32, ptr %call1.i, i64 %indvars.iv.i
%call3.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx.i)
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%add.i = add nsw i32 %2, %sum.023.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%3 = load i32, ptr %n.i, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp.i = icmp slt i64 %indvars.iv.next.i, %4
br i1 %cmp.i, label %for.body.i, label %for.cond.cleanup.i, !llvm.loop !9
if.else.i: ; preds = %for.cond.cleanup.i
%add10.i = add nsw i32 %sum.0.lcssa.i, -1
%sub.i = add i32 %add10.i, %.lcssa.i
%div11.i = sdiv i32 %sub.i, %.lcssa.i
br label %find_sum.exit
find_sum.exit: ; preds = %for.cond.cleanup.i, %if.else.i
%retval.0.i = phi i32 [ %div11.i, %if.else.i ], [ %div.i, %for.cond.cleanup.i ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n.i) #4
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i)
%inc = add nuw nsw i32 %i.05, 1
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define pai 3.1415926535
int main(void) {
int N;
scanf("%d", &N);
int A[100000];
int count = 0;
for (int i = 0; i < N; i++) {
scanf("%d",&A[i]);
if (A[i] % 2 != 0) {
count++;
}
}
if (count % 2 == 0) {
printf("YES");
}
else {
printf("NO");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143593/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143593/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca [100000 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 400000, ptr nonnull %A) #3
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.body, label %if.end11
for.cond.cleanup: ; preds = %for.body
%1 = and i32 %spec.select, 1
%2 = icmp eq i32 %1, 0
%spec.select21 = select i1 %2, ptr @.str.1, ptr @.str.2
br label %if.end11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%count.017 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = and i32 %3, 1
%spec.select = add i32 %4, %count.017
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.end11: ; preds = %for.cond.cleanup, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select21, %for.cond.cleanup ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int n,a,o=0;
scanf("%d",&n);
while(n--){
scanf("%d",&a);
if(a%2){
o++;
}
}
printf("%s\n",o%2?"NO":"YES");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143643/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143643/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec7 = add nsw i32 %0, -1
store i32 %dec7, ptr %n, align 4, !tbaa !5
%tobool.not8 = icmp eq i32 %0, 0
br i1 %tobool.not8, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%o.09 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = and i32 %1, 1
%spec.select = add i32 %2, %o.09
%3 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !9
while.end.loopexit: ; preds = %while.body
%4 = and i32 %spec.select, 1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, ptr @.str.3, ptr @.str.2
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%o.0.lcssa = phi ptr [ @.str.3, %entry ], [ %6, %while.end.loopexit ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %o.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.