Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
#include<math.h>
int main(void) {
unsigned long long int n, p;
unsigned long long int i;
unsigned long long int count = 0;
unsigned long long int ans = 1;
scanf("%llu %llu", &n, &p);
if ( n == 1 ) {
printf("%llu\n", p);
return 0;
}
if ( p == 1 ) {
printf("1\n");
return 0;
}
for ( i = 2; i * i <= p; ) {
count = 0;
while ( p % i == 0 ) {
count++;
p /= i;
}
if ( count / n ) {
ans *= pow(i, (count/n));
}
i++;
}
printf("%llu\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124750/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124750/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%llu %llu\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%p = 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 %p) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp eq i64 %0, 1
%1 = load i64, ptr %p, align 8, !tbaa !5
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1)
br label %cleanup
if.end: ; preds = %entry
%cmp2 = icmp eq i64 %1, 1
br i1 %cmp2, label %if.then3, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end
%cmp6.not36 = icmp ult i64 %1, 4
br i1 %cmp6.not36, label %for.end, label %while.cond.preheader
if.then3: ; preds = %if.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
while.cond.preheader: ; preds = %for.cond.preheader, %if.end16
%2 = phi i64 [ %5, %if.end16 ], [ %1, %for.cond.preheader ]
%ans.038 = phi i64 [ %ans.1, %if.end16 ], [ 1, %for.cond.preheader ]
%i.037 = phi i64 [ %inc17, %if.end16 ], [ 2, %for.cond.preheader ]
%rem32 = urem i64 %2, %i.037
%cmp733 = icmp eq i64 %rem32, 0
br i1 %cmp733, label %while.body, label %while.end
while.body: ; preds = %while.cond.preheader, %while.body
%count.035 = phi i64 [ %inc, %while.body ], [ 0, %while.cond.preheader ]
%div3134 = phi i64 [ %div, %while.body ], [ %2, %while.cond.preheader ]
%inc = add i64 %count.035, 1
%div = udiv i64 %div3134, %i.037
%rem = urem i64 %div, %i.037
%cmp7 = icmp eq i64 %rem, 0
br i1 %cmp7, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i64 %div, ptr %p, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader
%3 = phi i64 [ %div, %while.cond.while.end_crit_edge ], [ %2, %while.cond.preheader ]
%count.0.lcssa = phi i64 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ]
%4 = load i64, ptr %n, align 8, !tbaa !5
%tobool.not = icmp ugt i64 %4, %count.0.lcssa
br i1 %tobool.not, label %if.end16, label %if.then9
if.then9: ; preds = %while.end
%div8 = udiv i64 %count.0.lcssa, %4
%conv = uitofp i64 %i.037 to double
%conv11 = uitofp i64 %div8 to double
%call12 = call double @pow(double noundef %conv, double noundef %conv11) #5
%conv13 = uitofp i64 %ans.038 to double
%mul14 = fmul double %call12, %conv13
%conv15 = fptoui double %mul14 to i64
%.pre = load i64, ptr %p, align 8, !tbaa !5
br label %if.end16
if.end16: ; preds = %if.then9, %while.end
%5 = phi i64 [ %.pre, %if.then9 ], [ %3, %while.end ]
%ans.1 = phi i64 [ %conv15, %if.then9 ], [ %ans.038, %while.end ]
%inc17 = add i64 %i.037, 1
%mul = mul i64 %inc17, %inc17
%cmp6.not = icmp ugt i64 %mul, %5
br i1 %cmp6.not, label %for.end, label %while.cond.preheader, !llvm.loop !11
for.end: ; preds = %if.end16, %for.cond.preheader
%ans.0.lcssa = phi i64 [ 1, %for.cond.preheader ], [ %ans.1, %if.end16 ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
br label %cleanup
cleanup: ; preds = %for.end, %if.then3, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"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}
|
// Aizu 2102: Rummy
// 2017.9.20 bal4u@uu
#include <stdio.h>
#include <string.h>
int f[3][15];
char tr['Z'];
int v[10];
int main()
{
int t, i, j, n;
char c[5];
tr['R'] = 0, tr['G'] = 1, tr['B'] = 2;
scanf("%d", &t); while (t-- > 0) {
memset(f, 0, sizeof(f));
for (i = 0; i < 9; i++) scanf("%d", v+i);
for (i = 0; i < 9; i++) scanf("%s", c), f[tr[*c]][v[i]]++;
for (n = 0, j = 0; j < 3; j++) for (i = 1; i <= 9; i++) {
while (f[j][i] > 0 && f[j][i+1] > 0 && f[j][i+2] > 0)
n++, f[j][i]--, f[j][i+1]--, f[j][i+2]--;
if (n == 3) goto Done;
}
for (j = 0; j < 3; j++) for (i = 1; i <= 9; i++) {
while (f[j][i] >= 3) n++, f[j][i] -= 3;
if (n == 3) goto Done;
}
Done: puts(n == 3 ? "1" : "0");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124794/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124794/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@tr = dso_local local_unnamed_addr global [90 x i8] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@f = dso_local local_unnamed_addr global [3 x [15 x i32]] zeroinitializer, align 16
@v = dso_local global [10 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"1\00", align 1
@.str.3 = 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:
%t = alloca i32, align 4
%c = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %c) #5
store i8 0, ptr getelementptr inbounds ([90 x i8], ptr @tr, i64 0, i64 82), align 2, !tbaa !5
store i8 1, ptr getelementptr inbounds ([90 x i8], ptr @tr, i64 0, i64 71), align 1, !tbaa !5
store i8 2, ptr getelementptr inbounds ([90 x i8], ptr @tr, i64 0, i64 66), align 2, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !8
%dec156 = add nsw i32 %0, -1
store i32 %dec156, ptr %t, align 4, !tbaa !8
%cmp157 = icmp sgt i32 %0, 0
br i1 %cmp157, label %while.body, label %while.end97
while.body: ; preds = %entry, %while.cond
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(180) @f, i8 0, i64 180, i1 false)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @v)
%call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 1))
%call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 2))
%call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 3))
%call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 4))
%call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 5))
%call2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 6))
%call2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 7))
%call2.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 8))
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%1 = load i8, ptr %c, align 1, !tbaa !5
%idxprom = sext i8 %1 to i64
%arrayidx = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%idxprom8 = sext i8 %2 to i64
%3 = load i32, ptr @v, align 16, !tbaa !8
%idxprom12 = sext i32 %3 to i64
%arrayidx13 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8, i64 %idxprom12
%4 = load i32, ptr %arrayidx13, align 4, !tbaa !8
%inc14 = add nsw i32 %4, 1
store i32 %inc14, ptr %arrayidx13, align 4, !tbaa !8
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%5 = load i8, ptr %c, align 1, !tbaa !5
%idxprom.1 = sext i8 %5 to i64
%arrayidx.1 = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom.1
%6 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%idxprom8.1 = sext i8 %6 to i64
%7 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 1), align 4, !tbaa !8
%idxprom12.1 = sext i32 %7 to i64
%arrayidx13.1 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8.1, i64 %idxprom12.1
%8 = load i32, ptr %arrayidx13.1, align 4, !tbaa !8
%inc14.1 = add nsw i32 %8, 1
store i32 %inc14.1, ptr %arrayidx13.1, align 4, !tbaa !8
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%9 = load i8, ptr %c, align 1, !tbaa !5
%idxprom.2 = sext i8 %9 to i64
%arrayidx.2 = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom.2
%10 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%idxprom8.2 = sext i8 %10 to i64
%11 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 2), align 8, !tbaa !8
%idxprom12.2 = sext i32 %11 to i64
%arrayidx13.2 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8.2, i64 %idxprom12.2
%12 = load i32, ptr %arrayidx13.2, align 4, !tbaa !8
%inc14.2 = add nsw i32 %12, 1
store i32 %inc14.2, ptr %arrayidx13.2, align 4, !tbaa !8
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%13 = load i8, ptr %c, align 1, !tbaa !5
%idxprom.3 = sext i8 %13 to i64
%arrayidx.3 = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom.3
%14 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%idxprom8.3 = sext i8 %14 to i64
%15 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 3), align 4, !tbaa !8
%idxprom12.3 = sext i32 %15 to i64
%arrayidx13.3 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8.3, i64 %idxprom12.3
%16 = load i32, ptr %arrayidx13.3, align 4, !tbaa !8
%inc14.3 = add nsw i32 %16, 1
store i32 %inc14.3, ptr %arrayidx13.3, align 4, !tbaa !8
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%17 = load i8, ptr %c, align 1, !tbaa !5
%idxprom.4 = sext i8 %17 to i64
%arrayidx.4 = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom.4
%18 = load i8, ptr %arrayidx.4, align 1, !tbaa !5
%idxprom8.4 = sext i8 %18 to i64
%19 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 4), align 16, !tbaa !8
%idxprom12.4 = sext i32 %19 to i64
%arrayidx13.4 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8.4, i64 %idxprom12.4
%20 = load i32, ptr %arrayidx13.4, align 4, !tbaa !8
%inc14.4 = add nsw i32 %20, 1
store i32 %inc14.4, ptr %arrayidx13.4, align 4, !tbaa !8
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%21 = load i8, ptr %c, align 1, !tbaa !5
%idxprom.5 = sext i8 %21 to i64
%arrayidx.5 = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom.5
%22 = load i8, ptr %arrayidx.5, align 1, !tbaa !5
%idxprom8.5 = sext i8 %22 to i64
%23 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 5), align 4, !tbaa !8
%idxprom12.5 = sext i32 %23 to i64
%arrayidx13.5 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8.5, i64 %idxprom12.5
%24 = load i32, ptr %arrayidx13.5, align 4, !tbaa !8
%inc14.5 = add nsw i32 %24, 1
store i32 %inc14.5, ptr %arrayidx13.5, align 4, !tbaa !8
%call6.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%25 = load i8, ptr %c, align 1, !tbaa !5
%idxprom.6 = sext i8 %25 to i64
%arrayidx.6 = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom.6
%26 = load i8, ptr %arrayidx.6, align 1, !tbaa !5
%idxprom8.6 = sext i8 %26 to i64
%27 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 6), align 8, !tbaa !8
%idxprom12.6 = sext i32 %27 to i64
%arrayidx13.6 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8.6, i64 %idxprom12.6
%28 = load i32, ptr %arrayidx13.6, align 4, !tbaa !8
%inc14.6 = add nsw i32 %28, 1
store i32 %inc14.6, ptr %arrayidx13.6, align 4, !tbaa !8
%call6.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%29 = load i8, ptr %c, align 1, !tbaa !5
%idxprom.7 = sext i8 %29 to i64
%arrayidx.7 = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom.7
%30 = load i8, ptr %arrayidx.7, align 1, !tbaa !5
%idxprom8.7 = sext i8 %30 to i64
%31 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 7), align 4, !tbaa !8
%idxprom12.7 = sext i32 %31 to i64
%arrayidx13.7 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8.7, i64 %idxprom12.7
%32 = load i32, ptr %arrayidx13.7, align 4, !tbaa !8
%inc14.7 = add nsw i32 %32, 1
store i32 %inc14.7, ptr %arrayidx13.7, align 4, !tbaa !8
%call6.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%33 = load i8, ptr %c, align 1, !tbaa !5
%idxprom.8 = sext i8 %33 to i64
%arrayidx.8 = getelementptr inbounds [90 x i8], ptr @tr, i64 0, i64 %idxprom.8
%34 = load i8, ptr %arrayidx.8, align 1, !tbaa !5
%idxprom8.8 = sext i8 %34 to i64
%35 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @v, i64 0, i64 8), align 16, !tbaa !8
%idxprom12.8 = sext i32 %35 to i64
%arrayidx13.8 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %idxprom8.8, i64 %idxprom12.8
%36 = load i32, ptr %arrayidx13.8, align 4, !tbaa !8
%inc14.8 = add nsw i32 %36, 1
store i32 %inc14.8, ptr %arrayidx13.8, align 4, !tbaa !8
br label %for.cond21.preheader
for.cond21.preheader: ; preds = %while.body, %for.cond21.8
%indvars.iv = phi i64 [ 0, %while.body ], [ %indvars.iv.next, %for.cond21.8 ]
%n.0148 = phi i32 [ 0, %while.body ], [ %n.2.lcssa.8206, %for.cond21.8 ]
%arrayidx33 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 2
%arrayidx39 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 3
%arrayidx28 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 1
%arrayidx28.promoted = load i32, ptr %arrayidx28, align 4, !tbaa !8
%cmp29141 = icmp sgt i32 %arrayidx28.promoted, 0
br i1 %cmp29141, label %land.lhs.true.lr.ph, label %for.cond21
for.cond21: ; preds = %for.cond21.preheader, %while.end
%n.2.lcssa209 = phi i32 [ %n.2.lcssa, %while.end ], [ %n.0148, %for.cond21.preheader ]
%arrayidx39.1 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 4
%arrayidx28.promoted.1 = load i32, ptr %arrayidx33, align 4, !tbaa !8
%cmp29141.1 = icmp sgt i32 %arrayidx28.promoted.1, 0
br i1 %cmp29141.1, label %land.lhs.true.lr.ph.1, label %for.cond21.1
land.lhs.true.lr.ph.1: ; preds = %for.cond21
%arrayidx33.promoted.1 = load i32, ptr %arrayidx39, align 4, !tbaa !8
%37 = add i32 %n.2.lcssa209, %arrayidx28.promoted.1
br label %land.lhs.true.1
land.lhs.true.1: ; preds = %while.body41.1, %land.lhs.true.lr.ph.1
%38 = phi i32 [ %arrayidx33.promoted.1, %land.lhs.true.lr.ph.1 ], [ %dec53.1, %while.body41.1 ]
%n.2142.1 = phi i32 [ %n.2.lcssa209, %land.lhs.true.lr.ph.1 ], [ %inc42.1, %while.body41.1 ]
%39 = phi i32 [ %arrayidx28.promoted.1, %land.lhs.true.lr.ph.1 ], [ %dec47.1, %while.body41.1 ]
%cmp34.1 = icmp sgt i32 %38, 0
br i1 %cmp34.1, label %land.rhs.1, label %while.end.1
land.rhs.1: ; preds = %land.lhs.true.1
%40 = load i32, ptr %arrayidx39.1, align 4, !tbaa !8
%cmp40.1 = icmp sgt i32 %40, 0
br i1 %cmp40.1, label %while.body41.1, label %while.end.1
while.body41.1: ; preds = %land.rhs.1
%inc42.1 = add i32 %n.2142.1, 1
%dec47.1 = add nsw i32 %39, -1
store i32 %dec47.1, ptr %arrayidx33, align 4, !tbaa !8
%dec53.1 = add nsw i32 %38, -1
store i32 %dec53.1, ptr %arrayidx39, align 4, !tbaa !8
%dec59.1 = add nsw i32 %40, -1
store i32 %dec59.1, ptr %arrayidx39.1, align 4, !tbaa !8
%cmp29.1 = icmp sgt i32 %39, 1
br i1 %cmp29.1, label %land.lhs.true.1, label %while.end.1, !llvm.loop !10
while.end.1: ; preds = %land.lhs.true.1, %land.rhs.1, %while.body41.1
%n.2.lcssa.1 = phi i32 [ %n.2142.1, %land.rhs.1 ], [ %37, %while.body41.1 ], [ %n.2142.1, %land.lhs.true.1 ]
%cmp60.1 = icmp eq i32 %n.2.lcssa.1, 3
br i1 %cmp60.1, label %while.cond, label %for.cond21.1
for.cond21.1: ; preds = %for.cond21, %while.end.1
%n.2.lcssa.1185 = phi i32 [ %n.2.lcssa.1, %while.end.1 ], [ %n.2.lcssa209, %for.cond21 ]
%arrayidx39.2 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 5
%arrayidx28.promoted.2 = load i32, ptr %arrayidx39, align 4, !tbaa !8
%cmp29141.2 = icmp sgt i32 %arrayidx28.promoted.2, 0
br i1 %cmp29141.2, label %land.lhs.true.lr.ph.2, label %for.cond21.2
land.lhs.true.lr.ph.2: ; preds = %for.cond21.1
%arrayidx33.promoted.2 = load i32, ptr %arrayidx39.1, align 4, !tbaa !8
%41 = add i32 %n.2.lcssa.1185, %arrayidx28.promoted.2
br label %land.lhs.true.2
land.lhs.true.2: ; preds = %while.body41.2, %land.lhs.true.lr.ph.2
%42 = phi i32 [ %arrayidx33.promoted.2, %land.lhs.true.lr.ph.2 ], [ %dec53.2, %while.body41.2 ]
%n.2142.2 = phi i32 [ %n.2.lcssa.1185, %land.lhs.true.lr.ph.2 ], [ %inc42.2, %while.body41.2 ]
%43 = phi i32 [ %arrayidx28.promoted.2, %land.lhs.true.lr.ph.2 ], [ %dec47.2, %while.body41.2 ]
%cmp34.2 = icmp sgt i32 %42, 0
br i1 %cmp34.2, label %land.rhs.2, label %while.end.2
land.rhs.2: ; preds = %land.lhs.true.2
%44 = load i32, ptr %arrayidx39.2, align 4, !tbaa !8
%cmp40.2 = icmp sgt i32 %44, 0
br i1 %cmp40.2, label %while.body41.2, label %while.end.2
while.body41.2: ; preds = %land.rhs.2
%inc42.2 = add i32 %n.2142.2, 1
%dec47.2 = add nsw i32 %43, -1
store i32 %dec47.2, ptr %arrayidx39, align 4, !tbaa !8
%dec53.2 = add nsw i32 %42, -1
store i32 %dec53.2, ptr %arrayidx39.1, align 4, !tbaa !8
%dec59.2 = add nsw i32 %44, -1
store i32 %dec59.2, ptr %arrayidx39.2, align 4, !tbaa !8
%cmp29.2 = icmp sgt i32 %43, 1
br i1 %cmp29.2, label %land.lhs.true.2, label %while.end.2, !llvm.loop !10
while.end.2: ; preds = %land.lhs.true.2, %land.rhs.2, %while.body41.2
%n.2.lcssa.2 = phi i32 [ %n.2142.2, %land.rhs.2 ], [ %41, %while.body41.2 ], [ %n.2142.2, %land.lhs.true.2 ]
%cmp60.2 = icmp eq i32 %n.2.lcssa.2, 3
br i1 %cmp60.2, label %while.cond, label %for.cond21.2
for.cond21.2: ; preds = %for.cond21.1, %while.end.2
%n.2.lcssa.2188 = phi i32 [ %n.2.lcssa.2, %while.end.2 ], [ %n.2.lcssa.1185, %for.cond21.1 ]
%arrayidx39.3 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 6
%arrayidx28.promoted.3 = load i32, ptr %arrayidx39.1, align 4, !tbaa !8
%cmp29141.3 = icmp sgt i32 %arrayidx28.promoted.3, 0
br i1 %cmp29141.3, label %land.lhs.true.lr.ph.3, label %for.cond21.3
land.lhs.true.lr.ph.3: ; preds = %for.cond21.2
%arrayidx33.promoted.3 = load i32, ptr %arrayidx39.2, align 4, !tbaa !8
%45 = add i32 %n.2.lcssa.2188, %arrayidx28.promoted.3
br label %land.lhs.true.3
land.lhs.true.3: ; preds = %while.body41.3, %land.lhs.true.lr.ph.3
%46 = phi i32 [ %arrayidx33.promoted.3, %land.lhs.true.lr.ph.3 ], [ %dec53.3, %while.body41.3 ]
%n.2142.3 = phi i32 [ %n.2.lcssa.2188, %land.lhs.true.lr.ph.3 ], [ %inc42.3, %while.body41.3 ]
%47 = phi i32 [ %arrayidx28.promoted.3, %land.lhs.true.lr.ph.3 ], [ %dec47.3, %while.body41.3 ]
%cmp34.3 = icmp sgt i32 %46, 0
br i1 %cmp34.3, label %land.rhs.3, label %while.end.3
land.rhs.3: ; preds = %land.lhs.true.3
%48 = load i32, ptr %arrayidx39.3, align 4, !tbaa !8
%cmp40.3 = icmp sgt i32 %48, 0
br i1 %cmp40.3, label %while.body41.3, label %while.end.3
while.body41.3: ; preds = %land.rhs.3
%inc42.3 = add i32 %n.2142.3, 1
%dec47.3 = add nsw i32 %47, -1
store i32 %dec47.3, ptr %arrayidx39.1, align 4, !tbaa !8
%dec53.3 = add nsw i32 %46, -1
store i32 %dec53.3, ptr %arrayidx39.2, align 4, !tbaa !8
%dec59.3 = add nsw i32 %48, -1
store i32 %dec59.3, ptr %arrayidx39.3, align 4, !tbaa !8
%cmp29.3 = icmp sgt i32 %47, 1
br i1 %cmp29.3, label %land.lhs.true.3, label %while.end.3, !llvm.loop !10
while.end.3: ; preds = %land.lhs.true.3, %land.rhs.3, %while.body41.3
%n.2.lcssa.3 = phi i32 [ %n.2142.3, %land.rhs.3 ], [ %45, %while.body41.3 ], [ %n.2142.3, %land.lhs.true.3 ]
%cmp60.3 = icmp eq i32 %n.2.lcssa.3, 3
br i1 %cmp60.3, label %while.cond, label %for.cond21.3
for.cond21.3: ; preds = %for.cond21.2, %while.end.3
%n.2.lcssa.3191 = phi i32 [ %n.2.lcssa.3, %while.end.3 ], [ %n.2.lcssa.2188, %for.cond21.2 ]
%arrayidx39.4 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 7
%arrayidx28.promoted.4 = load i32, ptr %arrayidx39.2, align 4, !tbaa !8
%cmp29141.4 = icmp sgt i32 %arrayidx28.promoted.4, 0
br i1 %cmp29141.4, label %land.lhs.true.lr.ph.4, label %for.cond21.4
land.lhs.true.lr.ph.4: ; preds = %for.cond21.3
%arrayidx33.promoted.4 = load i32, ptr %arrayidx39.3, align 4, !tbaa !8
%49 = add i32 %n.2.lcssa.3191, %arrayidx28.promoted.4
br label %land.lhs.true.4
land.lhs.true.4: ; preds = %while.body41.4, %land.lhs.true.lr.ph.4
%50 = phi i32 [ %arrayidx33.promoted.4, %land.lhs.true.lr.ph.4 ], [ %dec53.4, %while.body41.4 ]
%n.2142.4 = phi i32 [ %n.2.lcssa.3191, %land.lhs.true.lr.ph.4 ], [ %inc42.4, %while.body41.4 ]
%51 = phi i32 [ %arrayidx28.promoted.4, %land.lhs.true.lr.ph.4 ], [ %dec47.4, %while.body41.4 ]
%cmp34.4 = icmp sgt i32 %50, 0
br i1 %cmp34.4, label %land.rhs.4, label %while.end.4
land.rhs.4: ; preds = %land.lhs.true.4
%52 = load i32, ptr %arrayidx39.4, align 4, !tbaa !8
%cmp40.4 = icmp sgt i32 %52, 0
br i1 %cmp40.4, label %while.body41.4, label %while.end.4
while.body41.4: ; preds = %land.rhs.4
%inc42.4 = add i32 %n.2142.4, 1
%dec47.4 = add nsw i32 %51, -1
store i32 %dec47.4, ptr %arrayidx39.2, align 4, !tbaa !8
%dec53.4 = add nsw i32 %50, -1
store i32 %dec53.4, ptr %arrayidx39.3, align 4, !tbaa !8
%dec59.4 = add nsw i32 %52, -1
store i32 %dec59.4, ptr %arrayidx39.4, align 4, !tbaa !8
%cmp29.4 = icmp sgt i32 %51, 1
br i1 %cmp29.4, label %land.lhs.true.4, label %while.end.4, !llvm.loop !10
while.end.4: ; preds = %land.lhs.true.4, %land.rhs.4, %while.body41.4
%n.2.lcssa.4 = phi i32 [ %n.2142.4, %land.rhs.4 ], [ %49, %while.body41.4 ], [ %n.2142.4, %land.lhs.true.4 ]
%cmp60.4 = icmp eq i32 %n.2.lcssa.4, 3
br i1 %cmp60.4, label %while.cond, label %for.cond21.4
for.cond21.4: ; preds = %for.cond21.3, %while.end.4
%n.2.lcssa.4194 = phi i32 [ %n.2.lcssa.4, %while.end.4 ], [ %n.2.lcssa.3191, %for.cond21.3 ]
%arrayidx39.5 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 8
%arrayidx28.promoted.5 = load i32, ptr %arrayidx39.3, align 4, !tbaa !8
%cmp29141.5 = icmp sgt i32 %arrayidx28.promoted.5, 0
br i1 %cmp29141.5, label %land.lhs.true.lr.ph.5, label %for.cond21.5
land.lhs.true.lr.ph.5: ; preds = %for.cond21.4
%arrayidx33.promoted.5 = load i32, ptr %arrayidx39.4, align 4, !tbaa !8
%53 = add i32 %n.2.lcssa.4194, %arrayidx28.promoted.5
br label %land.lhs.true.5
land.lhs.true.5: ; preds = %while.body41.5, %land.lhs.true.lr.ph.5
%54 = phi i32 [ %arrayidx33.promoted.5, %land.lhs.true.lr.ph.5 ], [ %dec53.5, %while.body41.5 ]
%n.2142.5 = phi i32 [ %n.2.lcssa.4194, %land.lhs.true.lr.ph.5 ], [ %inc42.5, %while.body41.5 ]
%55 = phi i32 [ %arrayidx28.promoted.5, %land.lhs.true.lr.ph.5 ], [ %dec47.5, %while.body41.5 ]
%cmp34.5 = icmp sgt i32 %54, 0
br i1 %cmp34.5, label %land.rhs.5, label %while.end.5
land.rhs.5: ; preds = %land.lhs.true.5
%56 = load i32, ptr %arrayidx39.5, align 4, !tbaa !8
%cmp40.5 = icmp sgt i32 %56, 0
br i1 %cmp40.5, label %while.body41.5, label %while.end.5
while.body41.5: ; preds = %land.rhs.5
%inc42.5 = add i32 %n.2142.5, 1
%dec47.5 = add nsw i32 %55, -1
store i32 %dec47.5, ptr %arrayidx39.3, align 4, !tbaa !8
%dec53.5 = add nsw i32 %54, -1
store i32 %dec53.5, ptr %arrayidx39.4, align 4, !tbaa !8
%dec59.5 = add nsw i32 %56, -1
store i32 %dec59.5, ptr %arrayidx39.5, align 4, !tbaa !8
%cmp29.5 = icmp sgt i32 %55, 1
br i1 %cmp29.5, label %land.lhs.true.5, label %while.end.5, !llvm.loop !10
while.end.5: ; preds = %land.lhs.true.5, %land.rhs.5, %while.body41.5
%n.2.lcssa.5 = phi i32 [ %n.2142.5, %land.rhs.5 ], [ %53, %while.body41.5 ], [ %n.2142.5, %land.lhs.true.5 ]
%cmp60.5 = icmp eq i32 %n.2.lcssa.5, 3
br i1 %cmp60.5, label %while.cond, label %for.cond21.5
for.cond21.5: ; preds = %for.cond21.4, %while.end.5
%n.2.lcssa.5197 = phi i32 [ %n.2.lcssa.5, %while.end.5 ], [ %n.2.lcssa.4194, %for.cond21.4 ]
%arrayidx39.6 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 9
%arrayidx28.promoted.6 = load i32, ptr %arrayidx39.4, align 4, !tbaa !8
%cmp29141.6 = icmp sgt i32 %arrayidx28.promoted.6, 0
br i1 %cmp29141.6, label %land.lhs.true.lr.ph.6, label %for.cond21.6
land.lhs.true.lr.ph.6: ; preds = %for.cond21.5
%arrayidx33.promoted.6 = load i32, ptr %arrayidx39.5, align 4, !tbaa !8
%57 = add i32 %n.2.lcssa.5197, %arrayidx28.promoted.6
br label %land.lhs.true.6
land.lhs.true.6: ; preds = %while.body41.6, %land.lhs.true.lr.ph.6
%58 = phi i32 [ %arrayidx33.promoted.6, %land.lhs.true.lr.ph.6 ], [ %dec53.6, %while.body41.6 ]
%n.2142.6 = phi i32 [ %n.2.lcssa.5197, %land.lhs.true.lr.ph.6 ], [ %inc42.6, %while.body41.6 ]
%59 = phi i32 [ %arrayidx28.promoted.6, %land.lhs.true.lr.ph.6 ], [ %dec47.6, %while.body41.6 ]
%cmp34.6 = icmp sgt i32 %58, 0
br i1 %cmp34.6, label %land.rhs.6, label %while.end.6
land.rhs.6: ; preds = %land.lhs.true.6
%60 = load i32, ptr %arrayidx39.6, align 4, !tbaa !8
%cmp40.6 = icmp sgt i32 %60, 0
br i1 %cmp40.6, label %while.body41.6, label %while.end.6
while.body41.6: ; preds = %land.rhs.6
%inc42.6 = add i32 %n.2142.6, 1
%dec47.6 = add nsw i32 %59, -1
store i32 %dec47.6, ptr %arrayidx39.4, align 4, !tbaa !8
%dec53.6 = add nsw i32 %58, -1
store i32 %dec53.6, ptr %arrayidx39.5, align 4, !tbaa !8
%dec59.6 = add nsw i32 %60, -1
store i32 %dec59.6, ptr %arrayidx39.6, align 4, !tbaa !8
%cmp29.6 = icmp sgt i32 %59, 1
br i1 %cmp29.6, label %land.lhs.true.6, label %while.end.6, !llvm.loop !10
while.end.6: ; preds = %land.lhs.true.6, %land.rhs.6, %while.body41.6
%n.2.lcssa.6 = phi i32 [ %n.2142.6, %land.rhs.6 ], [ %57, %while.body41.6 ], [ %n.2142.6, %land.lhs.true.6 ]
%cmp60.6 = icmp eq i32 %n.2.lcssa.6, 3
br i1 %cmp60.6, label %while.cond, label %for.cond21.6
for.cond21.6: ; preds = %for.cond21.5, %while.end.6
%n.2.lcssa.6200 = phi i32 [ %n.2.lcssa.6, %while.end.6 ], [ %n.2.lcssa.5197, %for.cond21.5 ]
%arrayidx39.7 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 10
%arrayidx28.promoted.7 = load i32, ptr %arrayidx39.5, align 4, !tbaa !8
%cmp29141.7 = icmp sgt i32 %arrayidx28.promoted.7, 0
br i1 %cmp29141.7, label %land.lhs.true.lr.ph.7, label %for.cond21.7
land.lhs.true.lr.ph.7: ; preds = %for.cond21.6
%arrayidx33.promoted.7 = load i32, ptr %arrayidx39.6, align 4, !tbaa !8
%61 = add i32 %n.2.lcssa.6200, %arrayidx28.promoted.7
br label %land.lhs.true.7
land.lhs.true.7: ; preds = %while.body41.7, %land.lhs.true.lr.ph.7
%62 = phi i32 [ %arrayidx33.promoted.7, %land.lhs.true.lr.ph.7 ], [ %dec53.7, %while.body41.7 ]
%n.2142.7 = phi i32 [ %n.2.lcssa.6200, %land.lhs.true.lr.ph.7 ], [ %inc42.7, %while.body41.7 ]
%63 = phi i32 [ %arrayidx28.promoted.7, %land.lhs.true.lr.ph.7 ], [ %dec47.7, %while.body41.7 ]
%cmp34.7 = icmp sgt i32 %62, 0
br i1 %cmp34.7, label %land.rhs.7, label %while.end.7
land.rhs.7: ; preds = %land.lhs.true.7
%64 = load i32, ptr %arrayidx39.7, align 4, !tbaa !8
%cmp40.7 = icmp sgt i32 %64, 0
br i1 %cmp40.7, label %while.body41.7, label %while.end.7
while.body41.7: ; preds = %land.rhs.7
%inc42.7 = add i32 %n.2142.7, 1
%dec47.7 = add nsw i32 %63, -1
store i32 %dec47.7, ptr %arrayidx39.5, align 4, !tbaa !8
%dec53.7 = add nsw i32 %62, -1
store i32 %dec53.7, ptr %arrayidx39.6, align 4, !tbaa !8
%dec59.7 = add nsw i32 %64, -1
store i32 %dec59.7, ptr %arrayidx39.7, align 4, !tbaa !8
%cmp29.7 = icmp sgt i32 %63, 1
br i1 %cmp29.7, label %land.lhs.true.7, label %while.end.7, !llvm.loop !10
while.end.7: ; preds = %land.lhs.true.7, %land.rhs.7, %while.body41.7
%n.2.lcssa.7 = phi i32 [ %n.2142.7, %land.rhs.7 ], [ %61, %while.body41.7 ], [ %n.2142.7, %land.lhs.true.7 ]
%cmp60.7 = icmp eq i32 %n.2.lcssa.7, 3
br i1 %cmp60.7, label %while.cond, label %for.cond21.7
for.cond21.7: ; preds = %for.cond21.6, %while.end.7
%n.2.lcssa.7203 = phi i32 [ %n.2.lcssa.7, %while.end.7 ], [ %n.2.lcssa.6200, %for.cond21.6 ]
%arrayidx39.8 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 11
%arrayidx28.promoted.8 = load i32, ptr %arrayidx39.6, align 4, !tbaa !8
%cmp29141.8 = icmp sgt i32 %arrayidx28.promoted.8, 0
br i1 %cmp29141.8, label %land.lhs.true.lr.ph.8, label %for.cond21.8
land.lhs.true.lr.ph.8: ; preds = %for.cond21.7
%arrayidx33.promoted.8 = load i32, ptr %arrayidx39.7, align 4, !tbaa !8
%65 = add i32 %n.2.lcssa.7203, %arrayidx28.promoted.8
br label %land.lhs.true.8
land.lhs.true.8: ; preds = %while.body41.8, %land.lhs.true.lr.ph.8
%66 = phi i32 [ %arrayidx33.promoted.8, %land.lhs.true.lr.ph.8 ], [ %dec53.8, %while.body41.8 ]
%n.2142.8 = phi i32 [ %n.2.lcssa.7203, %land.lhs.true.lr.ph.8 ], [ %inc42.8, %while.body41.8 ]
%67 = phi i32 [ %arrayidx28.promoted.8, %land.lhs.true.lr.ph.8 ], [ %dec47.8, %while.body41.8 ]
%cmp34.8 = icmp sgt i32 %66, 0
br i1 %cmp34.8, label %land.rhs.8, label %while.end.8
land.rhs.8: ; preds = %land.lhs.true.8
%68 = load i32, ptr %arrayidx39.8, align 4, !tbaa !8
%cmp40.8 = icmp sgt i32 %68, 0
br i1 %cmp40.8, label %while.body41.8, label %while.end.8
while.body41.8: ; preds = %land.rhs.8
%inc42.8 = add i32 %n.2142.8, 1
%dec47.8 = add nsw i32 %67, -1
store i32 %dec47.8, ptr %arrayidx39.6, align 4, !tbaa !8
%dec53.8 = add nsw i32 %66, -1
store i32 %dec53.8, ptr %arrayidx39.7, align 4, !tbaa !8
%dec59.8 = add nsw i32 %68, -1
store i32 %dec59.8, ptr %arrayidx39.8, align 4, !tbaa !8
%cmp29.8 = icmp sgt i32 %67, 1
br i1 %cmp29.8, label %land.lhs.true.8, label %while.end.8, !llvm.loop !10
while.end.8: ; preds = %land.lhs.true.8, %land.rhs.8, %while.body41.8
%n.2.lcssa.8 = phi i32 [ %n.2142.8, %land.rhs.8 ], [ %65, %while.body41.8 ], [ %n.2142.8, %land.lhs.true.8 ]
%cmp60.8 = icmp eq i32 %n.2.lcssa.8, 3
br i1 %cmp60.8, label %while.cond, label %for.cond21.8
for.cond21.8: ; preds = %for.cond21.7, %while.end.8
%n.2.lcssa.8206 = phi i32 [ %n.2.lcssa.8, %while.end.8 ], [ %n.2.lcssa.7203, %for.cond21.7 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 3
br i1 %exitcond.not, label %for.cond70.preheader, label %for.cond21.preheader, !llvm.loop !12
land.lhs.true.lr.ph: ; preds = %for.cond21.preheader
%arrayidx33.promoted = load i32, ptr %arrayidx33, align 4, !tbaa !8
%69 = add i32 %n.0148, %arrayidx28.promoted
br label %land.lhs.true
land.lhs.true: ; preds = %land.lhs.true.lr.ph, %while.body41
%70 = phi i32 [ %arrayidx33.promoted, %land.lhs.true.lr.ph ], [ %dec53, %while.body41 ]
%n.2142 = phi i32 [ %n.0148, %land.lhs.true.lr.ph ], [ %inc42, %while.body41 ]
%71 = phi i32 [ %arrayidx28.promoted, %land.lhs.true.lr.ph ], [ %dec47, %while.body41 ]
%cmp34 = icmp sgt i32 %70, 0
br i1 %cmp34, label %land.rhs, label %while.end
land.rhs: ; preds = %land.lhs.true
%72 = load i32, ptr %arrayidx39, align 4, !tbaa !8
%cmp40 = icmp sgt i32 %72, 0
br i1 %cmp40, label %while.body41, label %while.end
while.body41: ; preds = %land.rhs
%inc42 = add i32 %n.2142, 1
%dec47 = add nsw i32 %71, -1
store i32 %dec47, ptr %arrayidx28, align 4, !tbaa !8
%dec53 = add nsw i32 %70, -1
store i32 %dec53, ptr %arrayidx33, align 4, !tbaa !8
%dec59 = add nsw i32 %72, -1
store i32 %dec59, ptr %arrayidx39, align 4, !tbaa !8
%cmp29 = icmp sgt i32 %71, 1
br i1 %cmp29, label %land.lhs.true, label %while.end, !llvm.loop !10
while.end: ; preds = %land.rhs, %while.body41, %land.lhs.true
%n.2.lcssa = phi i32 [ %n.2142, %land.rhs ], [ %69, %while.body41 ], [ %n.2142, %land.lhs.true ]
%cmp60 = icmp eq i32 %n.2.lcssa, 3
br i1 %cmp60, label %while.cond, label %for.cond21
for.cond70.preheader: ; preds = %for.cond21.8, %for.cond70.8
%indvars.iv171 = phi i64 [ %indvars.iv.next172, %for.cond70.8 ], [ 0, %for.cond21.8 ]
%n.3155 = phi i32 [ %n.5.lcssa.8233, %for.cond70.8 ], [ %n.2.lcssa.8206, %for.cond21.8 ]
%arrayidx77 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 1
%arrayidx77.promoted = load i32, ptr %arrayidx77, align 4, !tbaa !8
%cmp78149 = icmp sgt i32 %arrayidx77.promoted, 2
br i1 %cmp78149, label %while.end85, label %for.cond70
for.cond70: ; preds = %for.cond70.preheader, %while.end85
%n.5.lcssa236 = phi i32 [ %133, %while.end85 ], [ %n.3155, %for.cond70.preheader ]
%arrayidx77.1 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 2
%arrayidx77.promoted.1 = load i32, ptr %arrayidx77.1, align 4, !tbaa !8
%cmp78149.1 = icmp sgt i32 %arrayidx77.promoted.1, 2
br i1 %cmp78149.1, label %while.end85.1, label %for.cond70.1
while.end85.1: ; preds = %for.cond70
%73 = add i32 %n.5.lcssa236, 1
%74 = add nuw i32 %arrayidx77.promoted.1, 2
%smin.1 = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted.1, i32 5)
%75 = sub nuw i32 %74, %smin.1
%76 = udiv i32 %75, 3
%77 = add i32 %73, %76
%.neg175 = mul nsw i32 %76, -3
%78 = add nsw i32 %arrayidx77.promoted.1, -3
%79 = add nsw i32 %.neg175, %78
store i32 %79, ptr %arrayidx77.1, align 4, !tbaa !8
%cmp86.1 = icmp eq i32 %77, 3
br i1 %cmp86.1, label %while.cond, label %for.cond70.1
for.cond70.1: ; preds = %for.cond70, %while.end85.1
%n.5.lcssa.1212 = phi i32 [ %77, %while.end85.1 ], [ %n.5.lcssa236, %for.cond70 ]
%arrayidx77.2 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 3
%arrayidx77.promoted.2 = load i32, ptr %arrayidx77.2, align 4, !tbaa !8
%cmp78149.2 = icmp sgt i32 %arrayidx77.promoted.2, 2
br i1 %cmp78149.2, label %while.end85.2, label %for.cond70.2
while.end85.2: ; preds = %for.cond70.1
%80 = add i32 %n.5.lcssa.1212, 1
%81 = add nuw i32 %arrayidx77.promoted.2, 2
%smin.2 = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted.2, i32 5)
%82 = sub nuw i32 %81, %smin.2
%83 = udiv i32 %82, 3
%84 = add i32 %80, %83
%.neg176 = mul nsw i32 %83, -3
%85 = add nsw i32 %arrayidx77.promoted.2, -3
%86 = add nsw i32 %.neg176, %85
store i32 %86, ptr %arrayidx77.2, align 4, !tbaa !8
%cmp86.2 = icmp eq i32 %84, 3
br i1 %cmp86.2, label %while.cond, label %for.cond70.2
for.cond70.2: ; preds = %for.cond70.1, %while.end85.2
%n.5.lcssa.2215 = phi i32 [ %84, %while.end85.2 ], [ %n.5.lcssa.1212, %for.cond70.1 ]
%arrayidx77.3 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 4
%arrayidx77.promoted.3 = load i32, ptr %arrayidx77.3, align 4, !tbaa !8
%cmp78149.3 = icmp sgt i32 %arrayidx77.promoted.3, 2
br i1 %cmp78149.3, label %while.end85.3, label %for.cond70.3
while.end85.3: ; preds = %for.cond70.2
%87 = add i32 %n.5.lcssa.2215, 1
%88 = add nuw i32 %arrayidx77.promoted.3, 2
%smin.3 = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted.3, i32 5)
%89 = sub nuw i32 %88, %smin.3
%90 = udiv i32 %89, 3
%91 = add i32 %87, %90
%.neg177 = mul nsw i32 %90, -3
%92 = add nsw i32 %arrayidx77.promoted.3, -3
%93 = add nsw i32 %.neg177, %92
store i32 %93, ptr %arrayidx77.3, align 4, !tbaa !8
%cmp86.3 = icmp eq i32 %91, 3
br i1 %cmp86.3, label %while.cond, label %for.cond70.3
for.cond70.3: ; preds = %for.cond70.2, %while.end85.3
%n.5.lcssa.3218 = phi i32 [ %91, %while.end85.3 ], [ %n.5.lcssa.2215, %for.cond70.2 ]
%arrayidx77.4 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 5
%arrayidx77.promoted.4 = load i32, ptr %arrayidx77.4, align 4, !tbaa !8
%cmp78149.4 = icmp sgt i32 %arrayidx77.promoted.4, 2
br i1 %cmp78149.4, label %while.end85.4, label %for.cond70.4
while.end85.4: ; preds = %for.cond70.3
%94 = add i32 %n.5.lcssa.3218, 1
%95 = add nuw i32 %arrayidx77.promoted.4, 2
%smin.4 = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted.4, i32 5)
%96 = sub nuw i32 %95, %smin.4
%97 = udiv i32 %96, 3
%98 = add i32 %94, %97
%.neg178 = mul nsw i32 %97, -3
%99 = add nsw i32 %arrayidx77.promoted.4, -3
%100 = add nsw i32 %.neg178, %99
store i32 %100, ptr %arrayidx77.4, align 4, !tbaa !8
%cmp86.4 = icmp eq i32 %98, 3
br i1 %cmp86.4, label %while.cond, label %for.cond70.4
for.cond70.4: ; preds = %for.cond70.3, %while.end85.4
%n.5.lcssa.4221 = phi i32 [ %98, %while.end85.4 ], [ %n.5.lcssa.3218, %for.cond70.3 ]
%arrayidx77.5 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 6
%arrayidx77.promoted.5 = load i32, ptr %arrayidx77.5, align 4, !tbaa !8
%cmp78149.5 = icmp sgt i32 %arrayidx77.promoted.5, 2
br i1 %cmp78149.5, label %while.end85.5, label %for.cond70.5
while.end85.5: ; preds = %for.cond70.4
%101 = add i32 %n.5.lcssa.4221, 1
%102 = add nuw i32 %arrayidx77.promoted.5, 2
%smin.5 = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted.5, i32 5)
%103 = sub nuw i32 %102, %smin.5
%104 = udiv i32 %103, 3
%105 = add i32 %101, %104
%.neg179 = mul nsw i32 %104, -3
%106 = add nsw i32 %arrayidx77.promoted.5, -3
%107 = add nsw i32 %.neg179, %106
store i32 %107, ptr %arrayidx77.5, align 4, !tbaa !8
%cmp86.5 = icmp eq i32 %105, 3
br i1 %cmp86.5, label %while.cond, label %for.cond70.5
for.cond70.5: ; preds = %for.cond70.4, %while.end85.5
%n.5.lcssa.5224 = phi i32 [ %105, %while.end85.5 ], [ %n.5.lcssa.4221, %for.cond70.4 ]
%arrayidx77.6 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 7
%arrayidx77.promoted.6 = load i32, ptr %arrayidx77.6, align 4, !tbaa !8
%cmp78149.6 = icmp sgt i32 %arrayidx77.promoted.6, 2
br i1 %cmp78149.6, label %while.end85.6, label %for.cond70.6
while.end85.6: ; preds = %for.cond70.5
%108 = add i32 %n.5.lcssa.5224, 1
%109 = add nuw i32 %arrayidx77.promoted.6, 2
%smin.6 = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted.6, i32 5)
%110 = sub nuw i32 %109, %smin.6
%111 = udiv i32 %110, 3
%112 = add i32 %108, %111
%.neg180 = mul nsw i32 %111, -3
%113 = add nsw i32 %arrayidx77.promoted.6, -3
%114 = add nsw i32 %.neg180, %113
store i32 %114, ptr %arrayidx77.6, align 4, !tbaa !8
%cmp86.6 = icmp eq i32 %112, 3
br i1 %cmp86.6, label %while.cond, label %for.cond70.6
for.cond70.6: ; preds = %for.cond70.5, %while.end85.6
%n.5.lcssa.6227 = phi i32 [ %112, %while.end85.6 ], [ %n.5.lcssa.5224, %for.cond70.5 ]
%arrayidx77.7 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 8
%arrayidx77.promoted.7 = load i32, ptr %arrayidx77.7, align 4, !tbaa !8
%cmp78149.7 = icmp sgt i32 %arrayidx77.promoted.7, 2
br i1 %cmp78149.7, label %while.end85.7, label %for.cond70.7
while.end85.7: ; preds = %for.cond70.6
%115 = add i32 %n.5.lcssa.6227, 1
%116 = add nuw i32 %arrayidx77.promoted.7, 2
%smin.7 = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted.7, i32 5)
%117 = sub nuw i32 %116, %smin.7
%118 = udiv i32 %117, 3
%119 = add i32 %115, %118
%.neg181 = mul nsw i32 %118, -3
%120 = add nsw i32 %arrayidx77.promoted.7, -3
%121 = add nsw i32 %.neg181, %120
store i32 %121, ptr %arrayidx77.7, align 4, !tbaa !8
%cmp86.7 = icmp eq i32 %119, 3
br i1 %cmp86.7, label %while.cond, label %for.cond70.7
for.cond70.7: ; preds = %for.cond70.6, %while.end85.7
%n.5.lcssa.7230 = phi i32 [ %119, %while.end85.7 ], [ %n.5.lcssa.6227, %for.cond70.6 ]
%arrayidx77.8 = getelementptr inbounds [3 x [15 x i32]], ptr @f, i64 0, i64 %indvars.iv171, i64 9
%arrayidx77.promoted.8 = load i32, ptr %arrayidx77.8, align 4, !tbaa !8
%cmp78149.8 = icmp sgt i32 %arrayidx77.promoted.8, 2
br i1 %cmp78149.8, label %while.end85.8, label %for.cond70.8
while.end85.8: ; preds = %for.cond70.7
%122 = add i32 %n.5.lcssa.7230, 1
%123 = add nuw i32 %arrayidx77.promoted.8, 2
%smin.8 = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted.8, i32 5)
%124 = sub nuw i32 %123, %smin.8
%125 = udiv i32 %124, 3
%126 = add i32 %122, %125
%.neg182 = mul nsw i32 %125, -3
%127 = add nsw i32 %arrayidx77.promoted.8, -3
%128 = add nsw i32 %.neg182, %127
store i32 %128, ptr %arrayidx77.8, align 4, !tbaa !8
%cmp86.8 = icmp eq i32 %126, 3
br i1 %cmp86.8, label %while.cond, label %for.cond70.8
for.cond70.8: ; preds = %for.cond70.7, %while.end85.8
%n.5.lcssa.8233 = phi i32 [ %126, %while.end85.8 ], [ %n.5.lcssa.7230, %for.cond70.7 ]
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%exitcond174.not = icmp eq i64 %indvars.iv.next172, 3
br i1 %exitcond174.not, label %while.cond, label %for.cond70.preheader, !llvm.loop !13
while.end85: ; preds = %for.cond70.preheader
%129 = add i32 %n.3155, 1
%130 = add nuw i32 %arrayidx77.promoted, 2
%smin = call i32 @llvm.smin.i32(i32 %arrayidx77.promoted, i32 5)
%131 = sub nuw i32 %130, %smin
%132 = udiv i32 %131, 3
%133 = add i32 %129, %132
%.neg = mul nsw i32 %132, -3
%134 = add nsw i32 %arrayidx77.promoted, -3
%135 = add nsw i32 %.neg, %134
store i32 %135, ptr %arrayidx77, align 4, !tbaa !8
%cmp86 = icmp eq i32 %133, 3
br i1 %cmp86, label %while.cond, label %for.cond70
while.cond: ; preds = %while.end, %while.end.1, %while.end.2, %while.end.3, %while.end.4, %while.end.5, %while.end.6, %while.end.7, %while.end.8, %for.cond70.8, %while.end85, %while.end85.1, %while.end85.2, %while.end85.3, %while.end85.4, %while.end85.5, %while.end85.6, %while.end85.7, %while.end85.8
%136 = phi ptr [ @.str.3, %for.cond70.8 ], [ @.str.2, %while.end85 ], [ @.str.2, %while.end85.1 ], [ @.str.2, %while.end85.2 ], [ @.str.2, %while.end85.3 ], [ @.str.2, %while.end85.4 ], [ @.str.2, %while.end85.5 ], [ @.str.2, %while.end85.6 ], [ @.str.2, %while.end85.7 ], [ @.str.2, %while.end85.8 ], [ @.str.2, %while.end.8 ], [ @.str.2, %while.end.7 ], [ @.str.2, %while.end.6 ], [ @.str.2, %while.end.5 ], [ @.str.2, %while.end.4 ], [ @.str.2, %while.end.3 ], [ @.str.2, %while.end.2 ], [ @.str.2, %while.end.1 ], [ @.str.2, %while.end ]
%call96 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %136)
%137 = load i32, ptr %t, align 4, !tbaa !8
%dec = add nsw i32 %137, -1
store i32 %dec, ptr %t, align 4, !tbaa !8
%cmp = icmp sgt i32 %137, 0
br i1 %cmp, label %while.body, label %while.end97, !llvm.loop !14
while.end97: ; preds = %while.cond, %entry
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
|
#include<stdio.h>
int main(void)
{
int n,x,y,b,p,g,i,h;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d%d%d%d",&x,&y,&b,&p);
if(b>=5&&p>=2)
{
g=(x*b+y*p)*0.8;
printf("%d\n",g);
}
else
{
g=x*b+y*p;
if(b<5) b=5;
if(p<2) p=2;
h=(x*b+y*p)*0.8;
if(g>h){
printf("%d\n",h);
}
else{
printf("%d\n",g);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124844/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124844/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%b = alloca i32, align 4
%p = 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 %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not37 = icmp slt i32 %0, 1
br i1 %cmp.not37, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.038 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %b, ptr noundef nonnull %p)
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, 4
%2 = load i32, ptr %p, align 4
%cmp3 = icmp sgt i32 %2, 1
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
%3 = load i32, ptr %x, align 4, !tbaa !5
%mul = mul nsw i32 %3, %1
%4 = load i32, ptr %y, align 4, !tbaa !5
%mul4 = mul nsw i32 %4, %2
%add = add nsw i32 %mul4, %mul
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %for.body
%conv = sitofp i32 %add to double
%mul5 = fmul double %conv, 8.000000e-01
%conv6 = fptosi double %mul5 to i32
br label %for.inc
if.else: ; preds = %for.body
%cmp11 = icmp slt i32 %1, 5
br i1 %cmp11, label %if.then13, label %if.end
if.then13: ; preds = %if.else
store i32 5, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then13, %if.else
%5 = phi i32 [ 5, %if.then13 ], [ %1, %if.else ]
%cmp14 = icmp slt i32 %2, 2
br i1 %cmp14, label %if.then16, label %if.end17
if.then16: ; preds = %if.end
store i32 2, ptr %p, align 4, !tbaa !5
br label %if.end17
if.end17: ; preds = %if.then16, %if.end
%6 = phi i32 [ 2, %if.then16 ], [ %2, %if.end ]
%mul18 = mul nsw i32 %5, %3
%mul19 = mul nsw i32 %6, %4
%add20 = add nsw i32 %mul19, %mul18
%conv21 = sitofp i32 %add20 to double
%mul22 = fmul double %conv21, 8.000000e-01
%conv23 = fptosi double %mul22 to i32
%conv23.add = call i32 @llvm.smin.i32(i32 %add, i32 %conv23)
br label %for.inc
for.inc: ; preds = %if.end17, %if.then
%conv6.sink = phi i32 [ %conv6, %if.then ], [ %conv23.add, %if.end17 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv6.sink)
%inc = add nuw nsw i32 %i.038, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.038, %7
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
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"}
|
#include<stdio.h>
int main(void)
{
int n;
scanf("%d",&n);
if(n>=65&&n<=90){
printf("1\n");
}
else if(n>=97&&n<=122){
printf("2\n");
}
else{
printf("0\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124895/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124895/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"0\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"2\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%1 = add i32 %0, -65
%or.cond = icmp ult i32 %1, 26
%2 = add i32 %0, -97
%or.cond11 = icmp ult i32 %2, 26
%str.4.str = select i1 %or.cond11, ptr @str.4, ptr @str
%str.4.sink = select i1 %or.cond, ptr @str.5, ptr %str.4.str
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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)"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
scanf("%d",&n);
if(n>=30)printf("Yes");
else
printf("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124938/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124938/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp = icmp sgt i32 %0, 29
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = 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);
if (n >= 30){
printf("%s","Yes");
}else{
printf("%s","No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124989/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124989/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp = icmp sgt i32 %0, 29
%.str.2..str.3 = select i1 %cmp, ptr @.str.2, ptr @.str.3
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %.str.2..str.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"}
|
#include <stdio.h>
int main(void){
int a = 0;
scanf("%d",&a);
if(a >= 30)printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125030/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125030/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
store i32 0, ptr %a, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 29
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #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)
{
int x;
scanf("%d", &x);
if(x >= 30){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125081/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125081/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp = icmp sgt i32 %0, 29
%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 %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 a;
scanf("%d",&a);
if(a >= 30){
printf("Yes");
}
else{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125131/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125131/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 29
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int x;
scanf("%d",&x);
if(x>=30){
printf("Yes");
}else{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125175/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125175/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 29
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int x;
scanf("%d",&x);
if(x>=30) printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125225/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125225/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp = icmp sgt i32 %0, 29
%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 %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 x;
scanf("%d",&x);
if(x>=30)
{
printf("Yes");
}
else
printf("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125269/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125269/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 29
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int x;
scanf("%d",&x);
if(x>=30) printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125319/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125319/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp = icmp sgt i32 %0, 29
%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 %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>
#include<stdlib.h>
#include<math.h>
int main()
{
int a;
scanf("%d",&a);
if(a<30)
printf("No");
else
printf("Yes");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 30
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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 <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//ABC174D
//ABC174C
//ABC174B
//ABC174A
int main(void) {
int n, k, i, cou=0, tmp;
scanf("%d", &n);
if(n>=30) printf("Yes");
else printf("No");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125405/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp = icmp sgt i32 %0, 29
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = 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>
#include <string.h>
void swap(int *a, int *b)
{
*a += *b;
*b = *a - *b;
*a -= *b;
}
int main(void)
{
int n, m;
int i, j;
int q;
int data[1024];
int idx[1024];
while (1){
scanf("%d %d", &n, &m);
if (n == 0 && m == 0){
break;
}
memset(data, 0, sizeof(data));
for (i = 0; i < n; i++){
for (j = 0; j < m; j++){
scanf("%d", &q);
data[j] += q;
idx[j] = j + 1;
}
}
for (i = 0; i < m - 1; i++){
for (j = 0; j < m - i - 1; j++){
if (data[j] < data[j + 1]){
swap(&data[j], &data[j + 1]);
swap(&idx[j], &idx[j + 1]);
}
}
}
for (i = 0; i < m; i++){
printf("%d%c", idx[i], i == m - 1 ? '\n' : ' ');
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125478/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125478/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%add = add nsw i32 %1, %0
store i32 %add, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %add, %2
store i32 %sub, ptr %b, align 4, !tbaa !5
%3 = load i32, ptr %a, align 4, !tbaa !5
%sub1 = sub nsw i32 %3, %sub
store i32 %sub1, ptr %a, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%q = alloca i32, align 4
%data = alloca [1024 x i32], align 16
%idx = alloca [1024 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %data) #5
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %idx) #5
%call89 = 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
%cmp90 = icmp eq i32 %0, 0
%1 = load i32, ptr %m, align 4
%cmp191 = icmp eq i32 %1, 0
%or.cond92 = select i1 %cmp90, i1 %cmp191, i1 false
br i1 %or.cond92, label %while.end, label %if.end
while.cond.loopexit: ; preds = %for.body47, %for.cond3.preheader.lr.ph, %for.cond45.preheader
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %2, 0
%3 = load i32, ptr %m, align 4
%cmp1 = icmp eq i32 %3, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
if.end: ; preds = %entry, %while.cond.loopexit
%4 = phi i32 [ %3, %while.cond.loopexit ], [ %1, %entry ]
%5 = phi i32 [ %2, %while.cond.loopexit ], [ %0, %entry ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4096) %data, i8 0, i64 4096, i1 false)
%cmp281 = icmp sgt i32 %5, 0
br i1 %cmp281, label %for.cond3.preheader.lr.ph, label %for.cond13.preheader
for.cond3.preheader.lr.ph: ; preds = %if.end
%6 = icmp sgt i32 %4, 0
br i1 %6, label %for.cond3.preheader, label %while.cond.loopexit
for.cond13.preheader: ; preds = %for.inc10, %if.end
%7 = phi i32 [ %4, %if.end ], [ %16, %for.inc10 ]
%sub = add i32 %7, -1
%cmp1485 = icmp sgt i32 %7, 1
br i1 %cmp1485, label %for.cond16.preheader, label %for.cond45.preheader
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.inc10
%8 = phi i32 [ %15, %for.inc10 ], [ %5, %for.cond3.preheader.lr.ph ]
%9 = phi i32 [ %16, %for.inc10 ], [ %4, %for.cond3.preheader.lr.ph ]
%i.082 = phi i32 [ %inc11, %for.inc10 ], [ 0, %for.cond3.preheader.lr.ph ]
%cmp479 = icmp sgt i32 %9, 0
br i1 %cmp479, label %for.body5, label %for.inc10
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.cond3.preheader ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q)
%10 = load i32, ptr %q, align 4, !tbaa !5
%arrayidx = getelementptr inbounds [1024 x i32], ptr %data, i64 0, i64 %indvars.iv
%11 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %11, %10
store i32 %add, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx9 = getelementptr inbounds [1024 x i32], ptr %idx, i64 0, i64 %indvars.iv
%12 = trunc i64 %indvars.iv.next to i32
store i32 %12, ptr %arrayidx9, align 4, !tbaa !5
%13 = load i32, ptr %m, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %14
br i1 %cmp4, label %for.body5, label %for.inc10.loopexit, !llvm.loop !9
for.inc10.loopexit: ; preds = %for.body5
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc10
for.inc10: ; preds = %for.inc10.loopexit, %for.cond3.preheader
%15 = phi i32 [ %.pre, %for.inc10.loopexit ], [ %8, %for.cond3.preheader ]
%16 = phi i32 [ %13, %for.inc10.loopexit ], [ %9, %for.cond3.preheader ]
%inc11 = add nuw nsw i32 %i.082, 1
%cmp2 = icmp slt i32 %inc11, %15
br i1 %cmp2, label %for.cond3.preheader, label %for.cond13.preheader, !llvm.loop !11
for.cond45.preheader: ; preds = %for.inc42, %for.cond13.preheader
%cmp4687 = icmp sgt i32 %7, 0
br i1 %cmp4687, label %for.body47, label %while.cond.loopexit
for.cond16.preheader: ; preds = %for.cond13.preheader, %for.inc42
%indvars.iv98 = phi i32 [ %indvars.iv.next99, %for.inc42 ], [ %sub, %for.cond13.preheader ]
%i.186 = phi i32 [ %inc43, %for.inc42 ], [ 0, %for.cond13.preheader ]
%17 = zext i32 %indvars.iv98 to i64
%18 = xor i32 %i.186, -1
%sub18 = add i32 %7, %18
%cmp1983 = icmp sgt i32 %sub18, 0
br i1 %cmp1983, label %for.body20.preheader, label %for.inc42
for.body20.preheader: ; preds = %for.cond16.preheader
%.pre104 = load i32, ptr %data, align 16, !tbaa !5
%xtraiter = and i64 %17, 1
%19 = icmp eq i32 %indvars.iv98, 1
br i1 %19, label %for.inc42.loopexit.unr-lcssa, label %for.body20.preheader.new
for.body20.preheader.new: ; preds = %for.body20.preheader
%unroll_iter = and i64 %17, 4294967294
br label %for.body20
for.body20: ; preds = %for.inc39.1, %for.body20.preheader.new
%20 = phi i32 [ %.pre104, %for.body20.preheader.new ], [ %28, %for.inc39.1 ]
%indvars.iv95 = phi i64 [ 0, %for.body20.preheader.new ], [ %indvars.iv.next96.1, %for.inc39.1 ]
%niter = phi i64 [ 0, %for.body20.preheader.new ], [ %niter.next.1, %for.inc39.1 ]
%indvars.iv.next96 = or i64 %indvars.iv95, 1
%arrayidx25 = getelementptr inbounds [1024 x i32], ptr %data, i64 0, i64 %indvars.iv.next96
%21 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp26 = icmp slt i32 %20, %21
br i1 %cmp26, label %if.then27, label %for.inc39
if.then27: ; preds = %for.body20
%arrayidx22 = getelementptr inbounds [1024 x i32], ptr %data, i64 0, i64 %indvars.iv95
store i32 %20, ptr %arrayidx25, align 4, !tbaa !5
store i32 %21, ptr %arrayidx22, align 8, !tbaa !5
%arrayidx34 = getelementptr inbounds [1024 x i32], ptr %idx, i64 0, i64 %indvars.iv95
%22 = load <2 x i32>, ptr %arrayidx34, align 8, !tbaa !5
%23 = shufflevector <2 x i32> %22, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %23, ptr %arrayidx34, align 8, !tbaa !5
br label %for.inc39
for.inc39: ; preds = %for.body20, %if.then27
%24 = phi i32 [ %21, %for.body20 ], [ %20, %if.then27 ]
%indvars.iv.next96.1 = add nuw nsw i64 %indvars.iv95, 2
%arrayidx25.1 = getelementptr inbounds [1024 x i32], ptr %data, i64 0, i64 %indvars.iv.next96.1
%25 = load i32, ptr %arrayidx25.1, align 8, !tbaa !5
%cmp26.1 = icmp slt i32 %24, %25
br i1 %cmp26.1, label %if.then27.1, label %for.inc39.1
if.then27.1: ; preds = %for.inc39
%arrayidx22.1 = getelementptr inbounds [1024 x i32], ptr %data, i64 0, i64 %indvars.iv.next96
store i32 %24, ptr %arrayidx25.1, align 8, !tbaa !5
store i32 %25, ptr %arrayidx22.1, align 4, !tbaa !5
%arrayidx34.1 = getelementptr inbounds [1024 x i32], ptr %idx, i64 0, i64 %indvars.iv.next96
%26 = load <2 x i32>, ptr %arrayidx34.1, align 4, !tbaa !5
%27 = shufflevector <2 x i32> %26, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %27, ptr %arrayidx34.1, align 4, !tbaa !5
br label %for.inc39.1
for.inc39.1: ; preds = %if.then27.1, %for.inc39
%28 = phi i32 [ %25, %for.inc39 ], [ %24, %if.then27.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.inc42.loopexit.unr-lcssa, label %for.body20, !llvm.loop !13
for.inc42.loopexit.unr-lcssa: ; preds = %for.inc39.1, %for.body20.preheader
%.unr = phi i32 [ %.pre104, %for.body20.preheader ], [ %28, %for.inc39.1 ]
%indvars.iv95.unr = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next96.1, %for.inc39.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc42, label %for.body20.epil
for.body20.epil: ; preds = %for.inc42.loopexit.unr-lcssa
%indvars.iv.next96.epil = add nuw nsw i64 %indvars.iv95.unr, 1
%arrayidx25.epil = getelementptr inbounds [1024 x i32], ptr %data, i64 0, i64 %indvars.iv.next96.epil
%29 = load i32, ptr %arrayidx25.epil, align 4, !tbaa !5
%cmp26.epil = icmp slt i32 %.unr, %29
br i1 %cmp26.epil, label %if.then27.epil, label %for.inc42
if.then27.epil: ; preds = %for.body20.epil
%arrayidx22.epil = getelementptr inbounds [1024 x i32], ptr %data, i64 0, i64 %indvars.iv95.unr
store i32 %.unr, ptr %arrayidx25.epil, align 4, !tbaa !5
store i32 %29, ptr %arrayidx22.epil, align 4, !tbaa !5
%arrayidx34.epil = getelementptr inbounds [1024 x i32], ptr %idx, i64 0, i64 %indvars.iv95.unr
%30 = load <2 x i32>, ptr %arrayidx34.epil, align 4, !tbaa !5
%31 = shufflevector <2 x i32> %30, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %31, ptr %arrayidx34.epil, align 4, !tbaa !5
br label %for.inc42
for.inc42: ; preds = %for.inc42.loopexit.unr-lcssa, %if.then27.epil, %for.body20.epil, %for.cond16.preheader
%inc43 = add nuw nsw i32 %i.186, 1
%indvars.iv.next99 = add i32 %indvars.iv98, -1
%exitcond100.not = icmp eq i32 %inc43, %sub
br i1 %exitcond100.not, label %for.cond45.preheader, label %for.cond16.preheader, !llvm.loop !14
for.body47: ; preds = %for.cond45.preheader, %for.body47
%indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body47 ], [ 0, %for.cond45.preheader ]
%32 = phi i32 [ %35, %for.body47 ], [ %7, %for.cond45.preheader ]
%arrayidx49 = getelementptr inbounds [1024 x i32], ptr %idx, i64 0, i64 %indvars.iv101
%33 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%sub50 = add nsw i32 %32, -1
%34 = zext i32 %sub50 to i64
%cmp51 = icmp eq i64 %indvars.iv101, %34
%cond = select i1 %cmp51, i32 10, i32 32
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33, i32 noundef %cond)
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%35 = load i32, ptr %m, align 4, !tbaa !5
%36 = sext i32 %35 to i64
%cmp46 = icmp slt i64 %indvars.iv.next102, %36
br i1 %cmp46, label %for.body47, label %while.cond.loopexit, !llvm.loop !15
while.end: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %idx) #5
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %data) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define invp(a,p)pom(a,p-2,p)
//*
//遅延セグ木ここから
//↓ここを変える
typedef struct sayouso{ll f,k;}sayouso;
typedef struct atai{ll a;}atai;
//↑ここを変える
typedef struct node{sayouso T;atai x;}node;
node lsegN[1<<21],*lseg;
ll lsegNUM,lsegk;
//↓ここから変える
sayouso id={0,0};
atai xx(atai x,atai y){
return y;
}
atai Tx(sayouso T,atai x){
if(T.f){
atai ret;
ret.a=max(x.a,T.k);
return ret;
}
return x;
}
sayouso TT(sayouso S,sayouso T){
if(S.f){
if(T.f){
sayouso ret;
ret.f=1;
ret.k=max(S.k,T.k);
return ret;
}
return S;
}
return T;
}
sayouso fT(sayouso T,ll k){
return T;
}
//↑ここまで変える
//要素数(2ベキ)でこれを呼ぶ
void lseguse(ll n){
lsegNUM=n;
lseg=lsegN+lsegNUM;
lsegk=0;while(n/=2)lsegk++;
}
//lseg[i].xに値を与えてから初期化
void lseginit(){
for(ll i=lsegNUM-1;i>0;i--)lsegN[i].x=xx(lsegN[2*i].x,lsegN[2*i+1].x);
rep(i,1,2*lsegNUM)lsegN[i].T=id;
}
void lsegupdatesub(ll l,ll r,sayouso T,ll i,ll cl,ll cr,ll ck){
//disjointなとき
if(cr<=l||r<=cl)return;
//完全に含むとき
if(l<=cl&&cr<=r){
lsegN[i].T=TT(T,lsegN[i].T);
return;
}
//どちらでもないとき
//遅延伝播
lsegN[2*i ].T=TT(lsegN[i].T,lsegN[2*i ].T);
lsegN[2*i+1].T=TT(lsegN[i].T,lsegN[2*i+1].T);
//再帰的に更新
ll cm=(cl+cr)/2;
lsegupdatesub(l,r,T,2*i ,cl,cm,ck-1);
lsegupdatesub(l,r,T,2*i+1,cm,cr,ck-1);
//自身のnodeを更新
lsegN[i].x=xx(Tx(fT(lsegN[2*i].T,ck-1),lsegN[2*i].x),Tx(fT(lsegN[2*i+1].T,ck-1),lsegN[2*i+1].x));
lsegN[i].T=id;
}
void lsegupdate(ll l,ll r,sayouso T){lsegupdatesub(l,r,T,1,0,lsegNUM,lsegk);}
atai lsegcalcsub(ll l,ll r,ll i,ll cl,ll cr,ll ck){
//完全に含むとき
if(l<=cl&&cr<=r)return Tx(fT(lsegN[i].T,ck),lsegN[i].x);
ll cm=(cl+cr)/2;
//遅延伝播(変更はないので配るだけで良い)
lsegN[2*i ].T=TT(lsegN[i].T,lsegN[2*i ].T);
lsegN[2*i+1].T=TT(lsegN[i].T,lsegN[2*i+1].T);
lsegN[i].x=Tx(fT(lsegN[i].T,ck),lsegN[i].x);
lsegN[i].T=id;
//左側だけ
if(r<=cm)return lsegcalcsub(l,r,2*i ,cl,cm,ck-1);
//右側だけ
if(cm<=l)return lsegcalcsub(l,r,2*i+1,cm,cr,ck-1);
//両方
return xx(lsegcalcsub(l,r,2*i,cl,cm,ck-1),lsegcalcsub(l,r,2*i+1,cm,cr,ck-1));
}
atai lsegcalc(ll l,ll r){return lsegcalcsub(l,r,1,0,lsegNUM,lsegk);}
//遅延セグ木ここまで
//*/
//座標圧縮
int cocomp(ll*a,int n){
//0~cnt-1に圧縮
ll*b=(ll*)malloc(sizeof(ll)*n);
memcpy(b,a,sizeof(ll)*n);
sortup(b,n);
int cnt=1;
rep(r,1,n)if(b[r]!=b[cnt-1])b[cnt++]=b[r];
rep(i,0,n){
int l=0,r=cnt;
while(r-l>1){int m=(l+r)/2;if(b[m]>a[i])r=m;else l=m;}
a[i]=l;
}
free(b);
return cnt;
}
ll n;
ll h[200010];
ll a[200010];
int main(){
scanf("%lld",&n);
rep(i,0,n)scanf("%lld",h+i);
rep(i,0,n)scanf("%lld",a+i);
lseguse(1LL<<18);
lseginit();
cocomp(h,n);
rep(i,0,n){
//lesg[h[i]]以降をlseg[h[i]].x.a+a[i]に更新する
ll temp=lsegcalc(h[i],h[i]+1).a;
sayouso T;
T.f=1;
T.k=temp+a[i];
lsegupdate(h[i],n,T);
}
printf("%lld\n",lsegcalc(n-1,n).a);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125528/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125528/source.c"
target datalayout = "e-m:e-p270: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.sayouso = type { i64, i64 }
%struct.node = type { %struct.sayouso, %struct.atai }
%struct.atai = type { i64 }
@id = dso_local local_unnamed_addr global %struct.sayouso zeroinitializer, align 8
@lsegNUM = dso_local local_unnamed_addr global i64 0, align 8
@lsegN = dso_local global [2097152 x %struct.node] zeroinitializer, align 16
@lseg = dso_local local_unnamed_addr global ptr null, align 8
@lsegk = dso_local local_unnamed_addr global i64 0, align 8
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@n = dso_local global i64 0, align 8
@h = dso_local global [200010 x i64] zeroinitializer, align 16
@a = dso_local global [200010 x i64] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: 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) #16
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) #16
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 nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @xx(i64 %x.coerce, i64 returned %y.coerce) local_unnamed_addr #4 {
entry:
ret i64 %y.coerce
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @Tx(i64 %T.coerce0, i64 %T.coerce1, i64 %x.coerce) local_unnamed_addr #6 {
entry:
%tobool.not = icmp eq i64 %T.coerce0, 0
%cond = tail call i64 @llvm.smax.i64(i64 %x.coerce, i64 %T.coerce1)
%retval.sroa.0.0 = select i1 %tobool.not, i64 %x.coerce, i64 %cond
ret i64 %retval.sroa.0.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local { i64, i64 } @TT(i64 %S.coerce0, i64 %S.coerce1, i64 %T.coerce0, i64 %T.coerce1) local_unnamed_addr #6 {
entry:
%tobool.not = icmp eq i64 %S.coerce0, 0
br i1 %tobool.not, label %return, label %if.then
if.then: ; preds = %entry
%tobool2.not = icmp eq i64 %T.coerce0, 0
br i1 %tobool2.not, label %return, label %if.then3
if.then3: ; preds = %if.then
%cond = tail call i64 @llvm.smax.i64(i64 %S.coerce1, i64 %T.coerce1)
br label %return
return: ; preds = %entry, %if.then, %if.then3
%retval.sroa.0.0 = phi i64 [ 1, %if.then3 ], [ %S.coerce0, %if.then ], [ %T.coerce0, %entry ]
%retval.sroa.4.0 = phi i64 [ %cond, %if.then3 ], [ %S.coerce1, %if.then ], [ %T.coerce1, %entry ]
%.fca.0.insert = insertvalue { i64, i64 } poison, i64 %retval.sroa.0.0, 0
%.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.4.0, 1
ret { i64, i64 } %.fca.1.insert
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { i64, i64 } @fT(i64 %T.coerce0, i64 %T.coerce1, i64 noundef %k) local_unnamed_addr #4 {
entry:
%.fca.0.insert = insertvalue { i64, i64 } poison, i64 %T.coerce0, 0
%.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %T.coerce1, 1
ret { i64, i64 } %.fca.1.insert
}
; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @lseguse(i64 noundef %n) local_unnamed_addr #7 {
entry:
store i64 %n, ptr @lsegNUM, align 8, !tbaa !5
%add.ptr = getelementptr inbounds %struct.node, ptr @lsegN, i64 %n
store ptr %add.ptr, ptr @lseg, align 8, !tbaa !11
%n.addr.0.off2 = add i64 %n, 1
%tobool.not3 = icmp ult i64 %n.addr.0.off2, 3
br i1 %tobool.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%n.addr.05 = phi i64 [ %div, %while.body ], [ %n, %entry ]
%storemerge4 = phi i64 [ %inc, %while.body ], [ 0, %entry ]
%div = sdiv i64 %n.addr.05, 2
%inc = add nuw nsw i64 %storemerge4, 1
%n.addr.0.off = add nsw i64 %div, 1
%tobool.not = icmp ult i64 %n.addr.0.off, 3
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %while.body, %entry
%storemerge.lcssa = phi i64 [ 0, %entry ], [ %inc, %while.body ]
store i64 %storemerge.lcssa, ptr @lsegk, align 8, !tbaa !5
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @lseginit() local_unnamed_addr #8 {
entry:
%0 = load i64, ptr @lsegNUM, align 8, !tbaa !5
%cmp23 = icmp sgt i64 %0, 1
br i1 %cmp23, label %for.body, label %for.cond9.preheader
for.cond9.preheader: ; preds = %for.body, %entry
%cmp1125 = icmp sgt i64 %0, 0
br i1 %cmp1125, label %for.body13.preheader, label %for.cond.cleanup12
for.body13.preheader: ; preds = %for.cond9.preheader
%mul10 = shl nuw i64 %0, 1
%smax = tail call i64 @llvm.smax.i64(i64 %mul10, i64 2)
%1 = add nsw i64 %smax, -1
%2 = add nsw i64 %smax, -2
%xtraiter = and i64 %1, 3
%3 = icmp ult i64 %2, 3
br i1 %3, label %for.body13.epil.preheader, label %for.body13.preheader.new
for.body13.preheader.new: ; preds = %for.body13.preheader
%unroll_iter = and i64 %1, -4
br label %for.body13
for.body: ; preds = %entry, %for.body
%i.0.in24 = phi i64 [ %i.0, %for.body ], [ %0, %entry ]
%i.0 = add nsw i64 %i.0.in24, -1
%x = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i.0, i32 1
%mul = shl nuw nsw i64 %i.0, 1
%add = or i64 %mul, 1
%x5 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %add, i32 1
%4 = load i64, ptr %x5, align 8
store i64 %4, ptr %x, align 8, !tbaa.struct !14
%cmp = icmp ugt i64 %i.0.in24, 2
br i1 %cmp, label %for.body, label %for.cond9.preheader, !llvm.loop !15
for.body13.epil.preheader: ; preds = %for.body13.preheader, %for.body13
%i8.026.unr = phi i64 [ 1, %for.body13.preheader ], [ %inc.3, %for.body13 ]
br label %for.body13.epil
for.body13.epil: ; preds = %for.body13.epil, %for.body13.epil.preheader
%i8.026.epil = phi i64 [ %inc.epil, %for.body13.epil ], [ %i8.026.unr, %for.body13.epil.preheader ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body13.epil ], [ 0, %for.body13.epil.preheader ]
%arrayidx14.epil = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i8.026.epil
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14.epil, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc.epil = add nuw nsw i64 %i8.026.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup12, label %for.body13.epil, !llvm.loop !17
for.cond.cleanup12: ; preds = %for.body13.epil, %for.cond9.preheader
ret void
for.body13: ; preds = %for.body13, %for.body13.preheader.new
%i8.026 = phi i64 [ 1, %for.body13.preheader.new ], [ %inc.3, %for.body13 ]
%niter = phi i64 [ 0, %for.body13.preheader.new ], [ %niter.next.3, %for.body13 ]
%arrayidx14 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i8.026
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc = add nuw nsw i64 %i8.026, 1
%arrayidx14.1 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %inc
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14.1, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc.1 = add nuw nsw i64 %i8.026, 2
%arrayidx14.2 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %inc.1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14.2, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc.2 = add nuw nsw i64 %i8.026, 3
%arrayidx14.3 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %inc.2
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14.3, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc.3 = add nuw nsw i64 %i8.026, 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.body13.epil.preheader, label %for.body13, !llvm.loop !19
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @lsegupdatesub(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1, i64 noundef %i, i64 noundef %cl, i64 noundef %cr, i64 noundef %ck) local_unnamed_addr #8 {
entry:
%cmp.not = icmp sgt i64 %cr, %l
%cmp1.not = icmp sgt i64 %r, %cl
%or.cond = and i1 %cmp1.not, %cmp.not
br i1 %or.cond, label %if.end, label %common.ret134
if.end: ; preds = %entry
%cmp2.not = icmp sgt i64 %l, %cl
%cmp3.not = icmp sgt i64 %cr, %r
%or.cond103 = or i1 %cmp2.not, %cmp3.not
br i1 %or.cond103, label %if.end8, label %if.then4
if.then4: ; preds = %if.end
%arrayidx = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i
%0 = load i64, ptr %arrayidx, align 8
%1 = getelementptr inbounds { i64, i64 }, ptr %arrayidx, i64 0, i32 1
%2 = load i64, ptr %1, align 8
%tobool.not.i = icmp eq i64 %T.coerce0, 0
br i1 %tobool.not.i, label %TT.exit, label %if.then.i
if.then.i: ; preds = %if.then4
%tobool2.not.i = icmp eq i64 %0, 0
br i1 %tobool2.not.i, label %TT.exit, label %if.then3.i
if.then3.i: ; preds = %if.then.i
%cond.i = tail call i64 @llvm.smax.i64(i64 %T.coerce1, i64 %2)
br label %TT.exit
TT.exit: ; preds = %if.then4, %if.then.i, %if.then3.i
%retval.sroa.0.0.i = phi i64 [ 1, %if.then3.i ], [ %T.coerce0, %if.then.i ], [ %0, %if.then4 ]
%retval.sroa.4.0.i = phi i64 [ %cond.i, %if.then3.i ], [ %T.coerce1, %if.then.i ], [ %2, %if.then4 ]
store i64 %retval.sroa.0.0.i, ptr %arrayidx, align 8, !tbaa.struct !16
store i64 %retval.sroa.4.0.i, ptr %1, align 8, !tbaa.struct !14
br label %common.ret134
if.end8: ; preds = %if.end
%mul = shl nsw i64 %i, 1
%arrayidx9 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %mul
%arrayidx12 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i
%3 = load i64, ptr %arrayidx12, align 8
%4 = getelementptr inbounds { i64, i64 }, ptr %arrayidx12, i64 0, i32 1
%5 = load i64, ptr %4, align 8
%6 = load i64, ptr %arrayidx9, align 16
%7 = getelementptr inbounds { i64, i64 }, ptr %arrayidx9, i64 0, i32 1
%8 = load i64, ptr %7, align 8
%tobool.not.i104 = icmp eq i64 %3, 0
br i1 %tobool.not.i104, label %TT.exit113, label %if.then.i105
if.then.i105: ; preds = %if.end8
%tobool2.not.i106 = icmp eq i64 %6, 0
br i1 %tobool2.not.i106, label %TT.exit113, label %if.then3.i107
if.then3.i107: ; preds = %if.then.i105
%cond.i108 = tail call i64 @llvm.smax.i64(i64 %5, i64 %8)
br label %TT.exit113
TT.exit113: ; preds = %if.end8, %if.then.i105, %if.then3.i107
%retval.sroa.0.0.i109 = phi i64 [ 1, %if.then3.i107 ], [ %3, %if.then.i105 ], [ %6, %if.end8 ]
%retval.sroa.4.0.i110 = phi i64 [ %cond.i108, %if.then3.i107 ], [ %5, %if.then.i105 ], [ %8, %if.end8 ]
store i64 %retval.sroa.0.0.i109, ptr %arrayidx9, align 16, !tbaa.struct !16
store i64 %retval.sroa.4.0.i110, ptr %7, align 8, !tbaa.struct !14
%add = or i64 %mul, 1
%arrayidx19 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %add
%9 = load i64, ptr %arrayidx12, align 8
%10 = load i64, ptr %4, align 8
%11 = load i64, ptr %arrayidx19, align 8
%12 = getelementptr inbounds { i64, i64 }, ptr %arrayidx19, i64 0, i32 1
%13 = load i64, ptr %12, align 16
%tobool.not.i114 = icmp eq i64 %9, 0
br i1 %tobool.not.i114, label %TT.exit123, label %if.then.i115
if.then.i115: ; preds = %TT.exit113
%tobool2.not.i116 = icmp eq i64 %11, 0
br i1 %tobool2.not.i116, label %TT.exit123, label %if.then3.i117
if.then3.i117: ; preds = %if.then.i115
%cond.i118 = tail call i64 @llvm.smax.i64(i64 %10, i64 %13)
br label %TT.exit123
common.ret134: ; preds = %entry, %TT.exit, %TT.exit123
ret void
TT.exit123: ; preds = %TT.exit113, %if.then.i115, %if.then3.i117
%retval.sroa.0.0.i119 = phi i64 [ 1, %if.then3.i117 ], [ %9, %if.then.i115 ], [ %11, %TT.exit113 ]
%retval.sroa.4.0.i120 = phi i64 [ %cond.i118, %if.then3.i117 ], [ %10, %if.then.i115 ], [ %13, %TT.exit113 ]
store i64 %retval.sroa.0.0.i119, ptr %arrayidx19, align 8, !tbaa.struct !16
store i64 %retval.sroa.4.0.i120, ptr %12, align 16, !tbaa.struct !14
%add29 = add nsw i64 %cr, %cl
%div = sdiv i64 %add29, 2
%sub = add nsw i64 %ck, -1
tail call void @lsegupdatesub(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1, i64 noundef %mul, i64 noundef %cl, i64 noundef %div, i64 noundef %sub)
tail call void @lsegupdatesub(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1, i64 noundef %add, i64 noundef %div, i64 noundef %cr, i64 noundef %sub)
%x = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i, i32 1
%14 = load i64, ptr %arrayidx19, align 8
%15 = load i64, ptr %12, align 16
%x58 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %add, i32 1
%16 = load i64, ptr %x58, align 8
%tobool.not.i131 = icmp eq i64 %14, 0
%cond.i132 = tail call i64 @llvm.smax.i64(i64 %16, i64 %15)
%retval.sroa.0.0.i133 = select i1 %tobool.not.i131, i64 %16, i64 %cond.i132
store i64 %retval.sroa.0.0.i133, ptr %x, align 8, !tbaa.struct !14
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx12, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
br label %common.ret134
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @lsegupdate(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1) local_unnamed_addr #9 {
entry:
%0 = load i64, ptr @lsegNUM, align 8, !tbaa !5
%1 = load i64, ptr @lsegk, align 8, !tbaa !5
tail call void @lsegupdatesub(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1, i64 noundef 1, i64 noundef 0, i64 noundef %0, i64 noundef %1)
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef %i, i64 noundef %cl, i64 noundef %cr, i64 noundef %ck) local_unnamed_addr #8 {
entry:
%cmp.not139 = icmp sgt i64 %l, %cl
%cmp1.not133140 = icmp sgt i64 %cr, %r
%or.cond134141 = or i1 %cmp.not139, %cmp1.not133140
br i1 %or.cond134141, label %if.end.lr.ph, label %if.then
if.end.lr.ph: ; preds = %entry, %tailrecurse.outer.backedge
%cmp.not146 = phi i1 [ %cmp.not, %tailrecurse.outer.backedge ], [ %cmp.not139, %entry ]
%ck.tr.ph145 = phi i64 [ %sub55, %tailrecurse.outer.backedge ], [ %ck, %entry ]
%cr.tr.ph144 = phi i64 [ %cr.tr136, %tailrecurse.outer.backedge ], [ %cr, %entry ]
%cl.tr.ph143 = phi i64 [ %div, %tailrecurse.outer.backedge ], [ %cl, %entry ]
%i.tr.ph142 = phi i64 [ %add14, %tailrecurse.outer.backedge ], [ %i, %entry ]
br label %if.end
if.then: ; preds = %tailrecurse.outer.backedge, %if.then40, %entry
%i.tr.lcssa = phi i64 [ %i, %entry ], [ %mul, %if.then40 ], [ %add14, %tailrecurse.outer.backedge ]
%arrayidx = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i.tr.lcssa
%0 = load i64, ptr %arrayidx, align 8
%1 = getelementptr inbounds { i64, i64 }, ptr %arrayidx, i64 0, i32 1
%2 = load i64, ptr %1, align 8
%x = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i.tr.lcssa, i32 1
%3 = load i64, ptr %x, align 8
%tobool.not.i = icmp eq i64 %0, 0
%cond.i = tail call i64 @llvm.smax.i64(i64 %3, i64 %2)
%retval.sroa.0.0.i = select i1 %tobool.not.i, i64 %3, i64 %cond.i
ret i64 %retval.sroa.0.0.i
if.end: ; preds = %if.end.lr.ph, %if.then40
%ck.tr137 = phi i64 [ %ck.tr.ph145, %if.end.lr.ph ], [ %sub, %if.then40 ]
%cr.tr136 = phi i64 [ %cr.tr.ph144, %if.end.lr.ph ], [ %div, %if.then40 ]
%i.tr135 = phi i64 [ %i.tr.ph142, %if.end.lr.ph ], [ %mul, %if.then40 ]
%add = add nsw i64 %cr.tr136, %cl.tr.ph143
%div = sdiv i64 %add, 2
%mul = shl nsw i64 %i.tr135, 1
%arrayidx5 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %mul
%arrayidx7 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i.tr135
%4 = load i64, ptr %arrayidx7, align 8
%5 = getelementptr inbounds { i64, i64 }, ptr %arrayidx7, i64 0, i32 1
%6 = load i64, ptr %5, align 8
%7 = load i64, ptr %arrayidx5, align 16
%8 = getelementptr inbounds { i64, i64 }, ptr %arrayidx5, i64 0, i32 1
%9 = load i64, ptr %8, align 8
%tobool.not.i110 = icmp eq i64 %4, 0
br i1 %tobool.not.i110, label %TT.exit, label %if.then.i
if.then.i: ; preds = %if.end
%tobool2.not.i = icmp eq i64 %7, 0
br i1 %tobool2.not.i, label %TT.exit, label %if.then3.i
if.then3.i: ; preds = %if.then.i
%cond.i111 = tail call i64 @llvm.smax.i64(i64 %6, i64 %9)
br label %TT.exit
TT.exit: ; preds = %if.end, %if.then.i, %if.then3.i
%retval.sroa.0.0.i112 = phi i64 [ 1, %if.then3.i ], [ %4, %if.then.i ], [ %7, %if.end ]
%retval.sroa.4.0.i = phi i64 [ %cond.i111, %if.then3.i ], [ %6, %if.then.i ], [ %9, %if.end ]
store i64 %retval.sroa.0.0.i112, ptr %arrayidx5, align 16, !tbaa.struct !16
store i64 %retval.sroa.4.0.i, ptr %8, align 8, !tbaa.struct !14
%add14 = or i64 %mul, 1
%arrayidx15 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %add14
%10 = load i64, ptr %arrayidx7, align 8
%11 = load i64, ptr %5, align 8
%12 = load i64, ptr %arrayidx15, align 8
%13 = getelementptr inbounds { i64, i64 }, ptr %arrayidx15, i64 0, i32 1
%14 = load i64, ptr %13, align 16
%tobool.not.i115 = icmp eq i64 %10, 0
br i1 %tobool.not.i115, label %TT.exit124, label %if.then.i116
if.then.i116: ; preds = %TT.exit
%tobool2.not.i117 = icmp eq i64 %12, 0
br i1 %tobool2.not.i117, label %TT.exit124, label %if.then3.i118
if.then3.i118: ; preds = %if.then.i116
%cond.i119 = tail call i64 @llvm.smax.i64(i64 %11, i64 %14)
br label %TT.exit124
TT.exit124: ; preds = %TT.exit, %if.then.i116, %if.then3.i118
%retval.sroa.0.0.i120 = phi i64 [ 1, %if.then3.i118 ], [ %10, %if.then.i116 ], [ %12, %TT.exit ]
%retval.sroa.4.0.i121 = phi i64 [ %cond.i119, %if.then3.i118 ], [ %11, %if.then.i116 ], [ %14, %TT.exit ]
store i64 %retval.sroa.0.0.i120, ptr %arrayidx15, align 8, !tbaa.struct !16
store i64 %retval.sroa.4.0.i121, ptr %13, align 16, !tbaa.struct !14
%x26 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i.tr135, i32 1
%15 = load i64, ptr %arrayidx7, align 8
%16 = load i64, ptr %5, align 8
%17 = load i64, ptr %x26, align 8
%tobool.not.i127 = icmp eq i64 %15, 0
%cond.i128 = tail call i64 @llvm.smax.i64(i64 %17, i64 %16)
%retval.sroa.0.0.i129 = select i1 %tobool.not.i127, i64 %17, i64 %cond.i128
store i64 %retval.sroa.0.0.i129, ptr %x26, align 8, !tbaa.struct !14
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx7, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%cmp39.not = icmp slt i64 %div, %r
br i1 %cmp39.not, label %if.end44, label %if.then40
if.then40: ; preds = %TT.exit124
%sub = add nsw i64 %ck.tr137, -1
%cmp1.not = icmp sgt i64 %div, %r
%or.cond = or i1 %cmp.not146, %cmp1.not
br i1 %or.cond, label %if.end, label %if.then
if.end44: ; preds = %TT.exit124
%cmp45.not = icmp sgt i64 %div, %l
%sub55 = add nsw i64 %ck.tr137, -1
br i1 %cmp45.not, label %if.end52, label %tailrecurse.outer.backedge
tailrecurse.outer.backedge: ; preds = %if.end44, %if.end52
%cmp.not = icmp slt i64 %div, %l
%cmp1.not133 = icmp sgt i64 %cr.tr136, %r
%or.cond134 = or i1 %cmp.not, %cmp1.not133
br i1 %or.cond134, label %if.end.lr.ph, label %if.then
if.end52: ; preds = %if.end44
%call56 = tail call i64 @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef %mul, i64 noundef %cl.tr.ph143, i64 noundef %div, i64 noundef %sub55)
br label %tailrecurse.outer.backedge
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @lsegcalc(i64 noundef %l, i64 noundef %r) local_unnamed_addr #9 {
entry:
%0 = load i64, ptr @lsegNUM, align 8, !tbaa !5
%1 = load i64, ptr @lsegk, align 8, !tbaa !5
%call = tail call i64 @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef 1, i64 noundef 0, i64 noundef %0, i64 noundef %1)
ret i64 %call
}
; Function Attrs: nounwind uwtable
define dso_local i32 @cocomp(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #10 {
entry:
%conv = sext i32 %n to i64
%mul = shl nsw i64 %conv, 3
%call = tail call noalias ptr @malloc(i64 noundef %mul) #17
tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %call, ptr align 8 %a, i64 %mul, i1 false)
tail call void @qsort(ptr noundef %call, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #16
%cmp61 = icmp sgt i32 %n, 1
br i1 %cmp61, label %for.body.preheader, label %for.cond12.preheader.thread
for.body.preheader: ; preds = %entry
%0 = add nsw i64 %conv, -1
%xtraiter = and i64 %0, 1
%1 = icmp eq i32 %n, 2
br i1 %1, label %for.cond12.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %0, -2
%invariant.gep = getelementptr i64, ptr %call, i64 1
br label %for.body
for.cond12.preheader.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%cnt.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %cnt.1.1, %for.inc.1 ]
%cnt.063.unr = phi i32 [ 1, %for.body.preheader ], [ %cnt.1.1, %for.inc.1 ]
%r.062.unr = phi i64 [ 1, %for.body.preheader ], [ %inc11.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond12.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond12.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds i64, ptr %call, i64 %r.062.unr
%2 = load i64, ptr %arrayidx.epil, align 8, !tbaa !5
%sub.epil = add nsw i32 %cnt.063.unr, -1
%idxprom.epil = sext i32 %sub.epil to i64
%arrayidx5.epil = getelementptr inbounds i64, ptr %call, i64 %idxprom.epil
%3 = load i64, ptr %arrayidx5.epil, align 8, !tbaa !5
%cmp6.not.epil = icmp eq i64 %2, %3
br i1 %cmp6.not.epil, label %for.cond12.preheader, label %if.then.epil
if.then.epil: ; preds = %for.body.epil
%inc.epil = add nsw i32 %cnt.063.unr, 1
%idxprom9.epil = sext i32 %cnt.063.unr to i64
%arrayidx10.epil = getelementptr inbounds i64, ptr %call, i64 %idxprom9.epil
store i64 %2, ptr %arrayidx10.epil, align 8, !tbaa !5
br label %for.cond12.preheader
for.cond12.preheader: ; preds = %for.body.epil, %if.then.epil, %for.cond12.preheader.unr-lcssa
%cnt.1.lcssa = phi i32 [ %cnt.1.lcssa.ph, %for.cond12.preheader.unr-lcssa ], [ %inc.epil, %if.then.epil ], [ %cnt.063.unr, %for.body.epil ]
%cmp1468 = icmp sgt i32 %n, 0
br i1 %cmp1468, label %while.cond.preheader.lr.ph, label %for.cond.cleanup16
for.cond12.preheader.thread: ; preds = %entry
%cmp146873 = icmp eq i32 %n, 1
br i1 %cmp146873, label %while.cond.preheader.preheader, label %for.cond.cleanup16
while.cond.preheader.lr.ph: ; preds = %for.cond12.preheader
%cmp2064 = icmp sgt i32 %cnt.1.lcssa, 1
br i1 %cmp2064, label %while.cond.preheader.us, label %while.cond.preheader.preheader
while.cond.preheader.preheader: ; preds = %for.cond12.preheader.thread, %while.cond.preheader.lr.ph
%cnt.0.lcssa7578 = phi i32 [ %cnt.1.lcssa, %while.cond.preheader.lr.ph ], [ 1, %for.cond12.preheader.thread ]
tail call void @llvm.memset.p0.i64(ptr align 8 %a, i8 0, i64 %mul, i1 false), !tbaa !5
br label %for.cond.cleanup16
while.cond.preheader.us: ; preds = %while.cond.preheader.lr.ph, %while.cond.while.end_crit_edge.us
%i.069.us = phi i64 [ %inc32.us, %while.cond.while.end_crit_edge.us ], [ 0, %while.cond.preheader.lr.ph ]
%arrayidx24.us = getelementptr inbounds i64, ptr %a, i64 %i.069.us
%4 = load i64, ptr %arrayidx24.us, align 8, !tbaa !5
br label %while.body.us
while.body.us: ; preds = %while.cond.preheader.us, %while.body.us
%r18.066.us = phi i32 [ %cnt.1.lcssa, %while.cond.preheader.us ], [ %div.r18.0.us, %while.body.us ]
%l.065.us = phi i32 [ 0, %while.cond.preheader.us ], [ %l.0.div.us, %while.body.us ]
%add.us = add nsw i32 %r18.066.us, %l.065.us
%div.us = sdiv i32 %add.us, 2
%idxprom22.us = sext i32 %div.us to i64
%arrayidx23.us = getelementptr inbounds i64, ptr %call, i64 %idxprom22.us
%5 = load i64, ptr %arrayidx23.us, align 8, !tbaa !5
%cmp25.us = icmp sgt i64 %5, %4
%l.0.div.us = select i1 %cmp25.us, i32 %l.065.us, i32 %div.us
%div.r18.0.us = select i1 %cmp25.us, i32 %div.us, i32 %r18.066.us
%sub19.us = sub nsw i32 %div.r18.0.us, %l.0.div.us
%cmp20.us = icmp sgt i32 %sub19.us, 1
br i1 %cmp20.us, label %while.body.us, label %while.cond.while.end_crit_edge.us, !llvm.loop !20
while.cond.while.end_crit_edge.us: ; preds = %while.body.us
%conv29.us = sext i32 %l.0.div.us to i64
store i64 %conv29.us, ptr %arrayidx24.us, align 8, !tbaa !5
%inc32.us = add nuw nsw i64 %i.069.us, 1
%exitcond71.not = icmp eq i64 %inc32.us, %conv
br i1 %exitcond71.not, label %for.cond.cleanup16, label %while.cond.preheader.us, !llvm.loop !21
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%cnt.063 = phi i32 [ 1, %for.body.preheader.new ], [ %cnt.1.1, %for.inc.1 ]
%r.062 = phi i64 [ 1, %for.body.preheader.new ], [ %inc11.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i64, ptr %call, i64 %r.062
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%sub = add nsw i32 %cnt.063, -1
%idxprom = sext i32 %sub to i64
%arrayidx5 = getelementptr inbounds i64, ptr %call, i64 %idxprom
%7 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%cmp6.not = icmp eq i64 %6, %7
br i1 %cmp6.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %cnt.063, 1
%idxprom9 = sext i32 %cnt.063 to i64
%arrayidx10 = getelementptr inbounds i64, ptr %call, i64 %idxprom9
store i64 %6, ptr %arrayidx10, align 8, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%cnt.1 = phi i32 [ %inc, %if.then ], [ %cnt.063, %for.body ]
%gep = getelementptr i64, ptr %invariant.gep, i64 %r.062
%8 = load i64, ptr %gep, align 8, !tbaa !5
%sub.1 = add nsw i32 %cnt.1, -1
%idxprom.1 = sext i32 %sub.1 to i64
%arrayidx5.1 = getelementptr inbounds i64, ptr %call, i64 %idxprom.1
%9 = load i64, ptr %arrayidx5.1, align 8, !tbaa !5
%cmp6.not.1 = icmp eq i64 %8, %9
br i1 %cmp6.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %cnt.1, 1
%idxprom9.1 = sext i32 %cnt.1 to i64
%arrayidx10.1 = getelementptr inbounds i64, ptr %call, i64 %idxprom9.1
store i64 %8, ptr %arrayidx10.1, align 8, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%cnt.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %cnt.1, %for.inc ]
%inc11.1 = add nuw nsw i64 %r.062, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond12.preheader.unr-lcssa, label %for.body, !llvm.loop !22
for.cond.cleanup16: ; preds = %while.cond.while.end_crit_edge.us, %for.cond12.preheader.thread, %while.cond.preheader.preheader, %for.cond12.preheader
%cnt.0.lcssa74 = phi i32 [ 1, %for.cond12.preheader.thread ], [ %cnt.0.lcssa7578, %while.cond.preheader.preheader ], [ %cnt.1.lcssa, %for.cond12.preheader ], [ %cnt.1.lcssa, %while.cond.while.end_crit_edge.us ]
tail call void @free(ptr noundef %call) #16
ret i32 %cnt.0.lcssa74
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #11
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #10 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp44 = icmp sgt i64 %0, 0
br i1 %cmp44, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp446 = icmp sgt i64 %1, 0
br i1 %cmp446, label %for.body6, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%i.045 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i64, ptr @h, i64 %i.045
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%inc = add nuw nsw i64 %i.045, 1
%1 = load i64, ptr @n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %1
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !23
for.cond.cleanup5: ; preds = %for.body6, %entry, %for.cond3.preheader
%.lcssa43 = phi i64 [ %1, %for.cond3.preheader ], [ %0, %entry ], [ %6, %for.body6 ]
store i64 262144, ptr @lsegNUM, align 8, !tbaa !5
store ptr getelementptr inbounds ([2097152 x %struct.node], ptr @lsegN, i64 0, i64 262144), ptr @lseg, align 8, !tbaa !11
store i64 18, ptr @lsegk, align 8, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.cond.cleanup5
%i.0.in24.i = phi i64 [ 262144, %for.cond.cleanup5 ], [ %i.0.i.2, %for.body.i ]
%i.0.i = add nsw i64 %i.0.in24.i, -1
%x.i = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i.0.i, i32 1
%mul.i = shl nuw nsw i64 %i.0.i, 1
%add.i = or i64 %mul.i, 1
%x5.i = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %add.i, i32 1
%2 = load i64, ptr %x5.i, align 8
store i64 %2, ptr %x.i, align 8, !tbaa.struct !14
%i.0.i.1 = add nsw i64 %i.0.in24.i, -2
%x.i.1 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i.0.i.1, i32 1
%mul.i.1 = shl nuw nsw i64 %i.0.i.1, 1
%add.i.1 = or i64 %mul.i.1, 1
%x5.i.1 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %add.i.1, i32 1
%3 = load i64, ptr %x5.i.1, align 8
store i64 %3, ptr %x.i.1, align 8, !tbaa.struct !14
%i.0.i.2 = add nsw i64 %i.0.in24.i, -3
%x.i.2 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i.0.i.2, i32 1
%mul.i.2 = shl nuw nsw i64 %i.0.i.2, 1
%add.i.2 = or i64 %mul.i.2, 1
%x5.i.2 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %add.i.2, i32 1
%4 = load i64, ptr %x5.i.2, align 8
store i64 %4, ptr %x.i.2, align 8, !tbaa.struct !14
%cmp.i.2 = icmp ugt i64 %i.0.i.1, 2
br i1 %cmp.i.2, label %for.body.i, label %for.body13.i, !llvm.loop !15
for.body13.i: ; preds = %for.body.i, %for.body13.i.3
%i8.026.i = phi i64 [ %inc.i41.3, %for.body13.i.3 ], [ 1, %for.body.i ]
%arrayidx14.i = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %i8.026.i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14.i, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc.i41 = add nuw nsw i64 %i8.026.i, 1
%arrayidx14.i.1 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %inc.i41
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14.i.1, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc.i41.1 = add nuw nsw i64 %i8.026.i, 2
%arrayidx14.i.2 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %inc.i41.1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14.i.2, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc.i41.2 = add nuw nsw i64 %i8.026.i, 3
%exitcond.not.i.2 = icmp eq i64 %inc.i41.2, 524288
br i1 %exitcond.not.i.2, label %lseginit.exit, label %for.body13.i.3, !llvm.loop !19
for.body13.i.3: ; preds = %for.body13.i
%arrayidx14.i.3 = getelementptr inbounds [2097152 x %struct.node], ptr @lsegN, i64 0, i64 %inc.i41.2
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx14.i.3, ptr noundef nonnull align 8 dereferenceable(16) @id, i64 16, i1 false), !tbaa.struct !16
%inc.i41.3 = add nuw nsw i64 %i8.026.i, 4
br label %for.body13.i
lseginit.exit: ; preds = %for.body13.i
%conv = trunc i64 %.lcssa43 to i32
%call12 = tail call i32 @cocomp(ptr noundef nonnull @h, i32 noundef %conv)
%5 = load i64, ptr @n, align 8, !tbaa !5
%cmp1548 = icmp sgt i64 %5, 0
br i1 %cmp1548, label %for.body18, label %for.cond.cleanup17
for.body6: ; preds = %for.cond3.preheader, %for.body6
%i2.047 = phi i64 [ %inc10, %for.body6 ], [ 0, %for.cond3.preheader ]
%add.ptr7 = getelementptr inbounds i64, ptr @a, i64 %i2.047
%call8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr7)
%inc10 = add nuw nsw i64 %i2.047, 1
%6 = load i64, ptr @n, align 8, !tbaa !5
%cmp4 = icmp slt i64 %inc10, %6
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !24
for.cond.cleanup17: ; preds = %for.body18, %lseginit.exit
%.lcssa = phi i64 [ %5, %lseginit.exit ], [ %17, %for.body18 ]
%sub = add nsw i64 %.lcssa, -1
%7 = load i64, ptr @lsegNUM, align 8, !tbaa !5
%8 = load i64, ptr @lsegk, align 8, !tbaa !5
%call.i = tail call i64 @lsegcalcsub(i64 noundef %sub, i64 noundef %.lcssa, i64 noundef 1, i64 noundef 0, i64 noundef %7, i64 noundef %8)
%call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %call.i)
ret i32 0
for.body18: ; preds = %lseginit.exit, %for.body18
%i13.049 = phi i64 [ %inc25, %for.body18 ], [ 0, %lseginit.exit ]
%arrayidx = getelementptr inbounds [200010 x i64], ptr @h, i64 0, i64 %i13.049
%9 = load i64, ptr %arrayidx, align 8, !tbaa !5
%add = add nsw i64 %9, 1
%10 = load i64, ptr @lsegNUM, align 8, !tbaa !5
%11 = load i64, ptr @lsegk, align 8, !tbaa !5
%call.i42 = tail call i64 @lsegcalcsub(i64 noundef %9, i64 noundef %add, i64 noundef 1, i64 noundef 0, i64 noundef %10, i64 noundef %11)
%arrayidx21 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %i13.049
%12 = load i64, ptr %arrayidx21, align 8, !tbaa !5
%add22 = add nsw i64 %12, %call.i42
%13 = load i64, ptr %arrayidx, align 8, !tbaa !5
%14 = load i64, ptr @n, align 8, !tbaa !5
%15 = load i64, ptr @lsegNUM, align 8, !tbaa !5
%16 = load i64, ptr @lsegk, align 8, !tbaa !5
tail call void @lsegupdatesub(i64 noundef %13, i64 noundef %14, i64 1, i64 %add22, i64 noundef 1, i64 noundef 0, i64 noundef %15, i64 noundef %16)
%inc25 = add nuw nsw i64 %i13.049, 1
%17 = load i64, ptr @n, align 8, !tbaa !5
%cmp15 = icmp slt i64 %inc25, %17
br i1 %cmp15, label %for.body18, label %for.cond.cleanup17, !llvm.loop !25
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #13
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #14
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #15
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 nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { mustprogress 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 #12 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #13 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #15 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #16 = { nounwind }
attributes #17 = { 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 = !{!"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 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{i64 0, i64 8, !5}
!15 = distinct !{!15, !10}
!16 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
|
#include <stdio.h>
int main(void)
{
int n, m;
int i, j;
int a[1024];
int vote[1024] = {0};
int maxi;
scanf("%d %d", &n, &m);
for (i = 0; i < n; i++) scanf("%d", a + i);
for (i = 0; i < m; i++){
int b;
scanf("%d", &b);
for (j = 0; j < n; j++){
if (b >= a[j]){
vote[j]++;
break;
}
}
}
for (i = maxi = 0; i < n; i++){
maxi = vote[maxi] > vote[i] ? maxi : i;
}
printf("%d\n", maxi + 1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125571/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125571/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [1024 x i32], align 16
%vote = alloca [1024 x i32], align 16
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %vote) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4096) %vote, i8 0, i64 4096, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp44 = icmp sgt i32 %0, 0
br i1 %cmp44, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp348 = icmp sgt i32 %2, 0
br i1 %cmp348, label %for.body4, label %for.cond19.preheader
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.1, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond19.preheader: ; preds = %for.end15, %for.cond2.preheader
%5 = phi i32 [ %1, %for.cond2.preheader ], [ %7, %for.end15 ]
%cmp2050 = icmp sgt i32 %5, 0
br i1 %cmp2050, label %for.body21.preheader, label %for.end29
for.body21.preheader: ; preds = %for.cond19.preheader
%wide.trip.count61 = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count61, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end29.loopexit.unr-lcssa, label %for.body21.preheader.new
for.body21.preheader.new: ; preds = %for.body21.preheader
%unroll_iter = and i64 %wide.trip.count61, 4294967292
br label %for.body21
for.body4: ; preds = %for.cond2.preheader, %for.end15
%i.149 = phi i32 [ %inc17, %for.end15 ], [ 0, %for.cond2.preheader ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp746 = icmp sgt i32 %7, 0
br i1 %cmp746, label %for.body8.lr.ph, label %for.end15
for.body8.lr.ph: ; preds = %for.body4
%8 = load i32, ptr %b, align 4, !tbaa !5
%wide.trip.count = zext i32 %7 to i64
br label %for.body8
for.cond6: ; preds = %for.body8
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
%exitcond.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count
br i1 %exitcond.not, label %for.end15, label %for.body8, !llvm.loop !11
for.body8: ; preds = %for.body8.lr.ph, %for.cond6
%indvars.iv55 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next56, %for.cond6 ]
%arrayidx = getelementptr inbounds [1024 x i32], ptr %a, i64 0, i64 %indvars.iv55
%9 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp9.not = icmp slt i32 %8, %9
br i1 %cmp9.not, label %for.cond6, label %if.then
if.then: ; preds = %for.body8
%arrayidx11 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %indvars.iv55
%10 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%inc12 = add nsw i32 %10, 1
store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !5
br label %for.end15
for.end15: ; preds = %for.cond6, %for.body4, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
%inc17 = add nuw nsw i32 %i.149, 1
%11 = load i32, ptr %m, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc17, %11
br i1 %cmp3, label %for.body4, label %for.cond19.preheader, !llvm.loop !12
for.body21: ; preds = %for.body21, %for.body21.preheader.new
%indvars.iv58 = phi i64 [ 0, %for.body21.preheader.new ], [ %indvars.iv.next59.3, %for.body21 ]
%maxi.052 = phi i32 [ 0, %for.body21.preheader.new ], [ %cond.3, %for.body21 ]
%niter = phi i64 [ 0, %for.body21.preheader.new ], [ %niter.next.3, %for.body21 ]
%idxprom22 = sext i32 %maxi.052 to i64
%arrayidx23 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %idxprom22
%12 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%arrayidx25 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %indvars.iv58
%13 = load i32, ptr %arrayidx25, align 16, !tbaa !5
%cmp26 = icmp sgt i32 %12, %13
%14 = trunc i64 %indvars.iv58 to i32
%cond = select i1 %cmp26, i32 %maxi.052, i32 %14
%indvars.iv.next59 = or i64 %indvars.iv58, 1
%idxprom22.1 = sext i32 %cond to i64
%arrayidx23.1 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %idxprom22.1
%15 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%arrayidx25.1 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %indvars.iv.next59
%16 = load i32, ptr %arrayidx25.1, align 4, !tbaa !5
%cmp26.1 = icmp sgt i32 %15, %16
%17 = trunc i64 %indvars.iv.next59 to i32
%cond.1 = select i1 %cmp26.1, i32 %cond, i32 %17
%indvars.iv.next59.1 = or i64 %indvars.iv58, 2
%idxprom22.2 = sext i32 %cond.1 to i64
%arrayidx23.2 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %idxprom22.2
%18 = load i32, ptr %arrayidx23.2, align 4, !tbaa !5
%arrayidx25.2 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %indvars.iv.next59.1
%19 = load i32, ptr %arrayidx25.2, align 8, !tbaa !5
%cmp26.2 = icmp sgt i32 %18, %19
%20 = trunc i64 %indvars.iv.next59.1 to i32
%cond.2 = select i1 %cmp26.2, i32 %cond.1, i32 %20
%indvars.iv.next59.2 = or i64 %indvars.iv58, 3
%idxprom22.3 = sext i32 %cond.2 to i64
%arrayidx23.3 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %idxprom22.3
%21 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5
%arrayidx25.3 = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %indvars.iv.next59.2
%22 = load i32, ptr %arrayidx25.3, align 4, !tbaa !5
%cmp26.3 = icmp sgt i32 %21, %22
%23 = trunc i64 %indvars.iv.next59.2 to i32
%cond.3 = select i1 %cmp26.3, i32 %cond.2, i32 %23
%indvars.iv.next59.3 = add nuw nsw i64 %indvars.iv58, 4
%niter.next.3 = add nuw i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end29.loopexit.unr-lcssa, label %for.body21, !llvm.loop !13
for.end29.loopexit.unr-lcssa: ; preds = %for.body21, %for.body21.preheader
%cond.lcssa.ph = phi i32 [ undef, %for.body21.preheader ], [ %cond.3, %for.body21 ]
%indvars.iv58.unr = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next59.3, %for.body21 ]
%maxi.052.unr = phi i32 [ 0, %for.body21.preheader ], [ %cond.3, %for.body21 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29.loopexit, label %for.body21.epil
for.body21.epil: ; preds = %for.end29.loopexit.unr-lcssa, %for.body21.epil
%indvars.iv58.epil = phi i64 [ %indvars.iv.next59.epil, %for.body21.epil ], [ %indvars.iv58.unr, %for.end29.loopexit.unr-lcssa ]
%maxi.052.epil = phi i32 [ %cond.epil, %for.body21.epil ], [ %maxi.052.unr, %for.end29.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body21.epil ], [ 0, %for.end29.loopexit.unr-lcssa ]
%idxprom22.epil = sext i32 %maxi.052.epil to i64
%arrayidx23.epil = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %idxprom22.epil
%24 = load i32, ptr %arrayidx23.epil, align 4, !tbaa !5
%arrayidx25.epil = getelementptr inbounds [1024 x i32], ptr %vote, i64 0, i64 %indvars.iv58.epil
%25 = load i32, ptr %arrayidx25.epil, align 4, !tbaa !5
%cmp26.epil = icmp sgt i32 %24, %25
%26 = trunc i64 %indvars.iv58.epil to i32
%cond.epil = select i1 %cmp26.epil, i32 %maxi.052.epil, i32 %26
%indvars.iv.next59.epil = add nuw nsw i64 %indvars.iv58.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.end29.loopexit, label %for.body21.epil, !llvm.loop !14
for.end29.loopexit: ; preds = %for.body21.epil, %for.end29.loopexit.unr-lcssa
%cond.lcssa = phi i32 [ %cond.lcssa.ph, %for.end29.loopexit.unr-lcssa ], [ %cond.epil, %for.body21.epil ]
%27 = add nsw i32 %cond.lcssa, 1
br label %for.end29
for.end29: ; preds = %for.end29.loopexit, %for.cond19.preheader
%maxi.0.lcssa = phi i32 [ 1, %for.cond19.preheader ], [ %27, %for.end29.loopexit ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %maxi.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %vote) #4
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
int main(void)
{
int n,m,x[1001],w,cnt[1001],max,s,i,j;
scanf("%d%d",&n,&m);
for(i=0;i<n;i++){
scanf("%d",&x[i]);
cnt[i]=0;
}
for(i=0;i<m;i++){
scanf("%d",&w);
for(j=0;j<n;j++){
if(x[j]<=w){
cnt[j]++;
break;
}
}
}
max=-1;
for(i=0;i<n;i++){
if(max<cnt[i]){
max=cnt[i]; s=i+1;
}
}
// for(i=0;i<n;i++) printf("%d\n",cnt[i]);
printf("%d\n",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125621/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125621/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%x = alloca [1001 x i32], align 16
%w = alloca i32, align 4
%cnt = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %cnt) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, label %for.body, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp555 = icmp sgt i32 %2, 0
br i1 %cmp555, label %for.body6, label %for.cond23.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%arrayidx3 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv
store i32 0, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond23.preheader: ; preds = %for.inc20, %for.cond4.preheader
%5 = phi i32 [ %1, %for.cond4.preheader ], [ %7, %for.inc20 ]
%cmp2457 = icmp sgt i32 %5, 0
call void @llvm.assume(i1 %cmp2457)
%wide.trip.count69 = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count69, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end35.unr-lcssa, label %for.cond23.preheader.new
for.cond23.preheader.new: ; preds = %for.cond23.preheader
%unroll_iter = and i64 %wide.trip.count69, 2147483644
br label %for.body25
for.body6: ; preds = %for.cond4.preheader, %for.inc20
%i.156 = phi i32 [ %inc21, %for.inc20 ], [ 0, %for.cond4.preheader ]
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp953 = icmp sgt i32 %7, 0
br i1 %cmp953, label %for.body10.lr.ph, label %for.inc20
for.body10.lr.ph: ; preds = %for.body6
%8 = load i32, ptr %w, align 4, !tbaa !5
%wide.trip.count = zext i32 %7 to i64
br label %for.body10
for.cond8: ; preds = %for.body10
%indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
%exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
br i1 %exitcond.not, label %for.inc20, label %for.body10, !llvm.loop !11
for.body10: ; preds = %for.body10.lr.ph, %for.cond8
%indvars.iv63 = phi i64 [ 0, %for.body10.lr.ph ], [ %indvars.iv.next64, %for.cond8 ]
%arrayidx12 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %indvars.iv63
%9 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13.not = icmp sgt i32 %9, %8
br i1 %cmp13.not, label %for.cond8, label %if.then
if.then: ; preds = %for.body10
%arrayidx15 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv63
%10 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%inc16 = add nsw i32 %10, 1
store i32 %inc16, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc20
for.inc20: ; preds = %for.cond8, %for.body6, %if.then
%inc21 = add nuw nsw i32 %i.156, 1
%11 = load i32, ptr %m, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc21, %11
br i1 %cmp5, label %for.body6, label %for.cond23.preheader, !llvm.loop !12
for.body25: ; preds = %for.body25, %for.cond23.preheader.new
%indvars.iv66 = phi i64 [ 0, %for.cond23.preheader.new ], [ %indvars.iv.next67.3, %for.body25 ]
%s.059 = phi i32 [ undef, %for.cond23.preheader.new ], [ %spec.select50.3, %for.body25 ]
%max.058 = phi i32 [ -1, %for.cond23.preheader.new ], [ %spec.select.3, %for.body25 ]
%niter = phi i64 [ 0, %for.cond23.preheader.new ], [ %niter.next.3, %for.body25 ]
%arrayidx27 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv66
%12 = load i32, ptr %arrayidx27, align 16, !tbaa !5
%cmp28 = icmp slt i32 %max.058, %12
%indvars.iv.next67 = or i64 %indvars.iv66, 1
%spec.select = call i32 @llvm.smax.i32(i32 %max.058, i32 %12)
%13 = trunc i64 %indvars.iv.next67 to i32
%spec.select50 = select i1 %cmp28, i32 %13, i32 %s.059
%arrayidx27.1 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv.next67
%14 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5
%cmp28.1 = icmp slt i32 %spec.select, %14
%indvars.iv.next67.1 = or i64 %indvars.iv66, 2
%spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %14)
%15 = trunc i64 %indvars.iv.next67.1 to i32
%spec.select50.1 = select i1 %cmp28.1, i32 %15, i32 %spec.select50
%arrayidx27.2 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv.next67.1
%16 = load i32, ptr %arrayidx27.2, align 8, !tbaa !5
%cmp28.2 = icmp slt i32 %spec.select.1, %16
%indvars.iv.next67.2 = or i64 %indvars.iv66, 3
%spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %16)
%17 = trunc i64 %indvars.iv.next67.2 to i32
%spec.select50.2 = select i1 %cmp28.2, i32 %17, i32 %spec.select50.1
%arrayidx27.3 = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv.next67.2
%18 = load i32, ptr %arrayidx27.3, align 4, !tbaa !5
%cmp28.3 = icmp slt i32 %spec.select.2, %18
%indvars.iv.next67.3 = add nuw nsw i64 %indvars.iv66, 4
%spec.select.3 = call i32 @llvm.smax.i32(i32 %spec.select.2, i32 %18)
%19 = trunc i64 %indvars.iv.next67.3 to i32
%spec.select50.3 = select i1 %cmp28.3, i32 %19, i32 %spec.select50.2
%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.end35.unr-lcssa, label %for.body25, !llvm.loop !13
for.end35.unr-lcssa: ; preds = %for.body25, %for.cond23.preheader
%indvars.iv66.unr = phi i64 [ 0, %for.cond23.preheader ], [ %indvars.iv.next67.3, %for.body25 ]
%s.059.unr = phi i32 [ undef, %for.cond23.preheader ], [ %spec.select50.3, %for.body25 ]
%max.058.unr = phi i32 [ -1, %for.cond23.preheader ], [ %spec.select.3, %for.body25 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end35, label %for.body25.epil
for.body25.epil: ; preds = %for.end35.unr-lcssa, %for.body25.epil
%indvars.iv66.epil = phi i64 [ %indvars.iv.next67.epil, %for.body25.epil ], [ %indvars.iv66.unr, %for.end35.unr-lcssa ]
%s.059.epil = phi i32 [ %spec.select50.epil, %for.body25.epil ], [ %s.059.unr, %for.end35.unr-lcssa ]
%max.058.epil = phi i32 [ %spec.select.epil, %for.body25.epil ], [ %max.058.unr, %for.end35.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body25.epil ], [ 0, %for.end35.unr-lcssa ]
%arrayidx27.epil = getelementptr inbounds [1001 x i32], ptr %cnt, i64 0, i64 %indvars.iv66.epil
%20 = load i32, ptr %arrayidx27.epil, align 4, !tbaa !5
%cmp28.epil = icmp slt i32 %max.058.epil, %20
%indvars.iv.next67.epil = add nuw nsw i64 %indvars.iv66.epil, 1
%spec.select.epil = call i32 @llvm.smax.i32(i32 %max.058.epil, i32 %20)
%21 = trunc i64 %indvars.iv.next67.epil to i32
%spec.select50.epil = select i1 %cmp28.epil, i32 %21, i32 %s.059.epil
%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.end35, label %for.body25.epil, !llvm.loop !14
for.end35: ; preds = %for.body25.epil, %for.end35.unr-lcssa
%spec.select50.lcssa = phi i32 [ %s.059.unr, %for.end35.unr-lcssa ], [ %spec.select50.epil, %for.body25.epil ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select50.lcssa)
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %cnt) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
#include<stdlib.h>
int compare_int(const void *a, const void *b)
{
return *(int*)b-*(int*)a;
}
int main(){
int n;
int a[200001];
int i;
long long ans=0;
int p,q;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
qsort(a,n,sizeof(int),compare_int);
p=(n-2)/2;
q=n%2;
ans+=a[0];
for(i=1;i<=p;i++){
ans+=2*a[i];
}
if(q==1) ans+=a[p+1];
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125687/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125687/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%a = alloca [200001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %a) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %0, 0
br i1 %cmp32, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare_int) #6
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %3, -2
%div = sdiv i32 %sub, 2
%4 = load i32, ptr %a, align 16, !tbaa !5
%conv3 = sext i32 %4 to i64
%cmp5.not34 = icmp slt i32 %3, 4
br i1 %cmp5.not34, label %for.end14, label %for.body7.preheader
for.body7.preheader: ; preds = %for.end
%smax = call i32 @llvm.smax.i32(i32 %div, i32 1)
%5 = add nuw nsw i32 %smax, 1
%wide.trip.count = zext i32 %5 to i64
%6 = zext i32 %smax to i64
%min.iters.check = icmp ult i32 %smax, 4
br i1 %min.iters.check, label %for.body7.preheader45, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %6, 2147483644
%ind.end = or i64 %n.vec, 1
%7 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %conv3, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %7, %vector.ph ], [ %14, %vector.body ]
%vec.phi43 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%offset.idx = or i64 %index, 1
%8 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %offset.idx
%wide.load = load <2 x i32>, ptr %8, align 4, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 2
%wide.load44 = load <2 x i32>, ptr %9, align 4, !tbaa !5
%10 = shl nsw <2 x i32> %wide.load, <i32 1, i32 1>
%11 = shl nsw <2 x i32> %wide.load44, <i32 1, i32 1>
%12 = sext <2 x i32> %10 to <2 x i64>
%13 = sext <2 x i32> %11 to <2 x i64>
%14 = add <2 x i64> %vec.phi, %12
%15 = add <2 x i64> %vec.phi43, %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 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %6
br i1 %cmp.n, label %for.end14, label %for.body7.preheader45
for.body7.preheader45: ; preds = %for.body7.preheader, %middle.block
%indvars.iv40.ph = phi i64 [ 1, %for.body7.preheader ], [ %ind.end, %middle.block ]
%ans.035.ph = phi i64 [ %conv3, %for.body7.preheader ], [ %17, %middle.block ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader45, %for.body7
%indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body7 ], [ %indvars.iv40.ph, %for.body7.preheader45 ]
%ans.035 = phi i64 [ %add11, %for.body7 ], [ %ans.035.ph, %for.body7.preheader45 ]
%arrayidx9 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %indvars.iv40
%18 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%mul = shl nsw i32 %18, 1
%conv10 = sext i32 %mul to i64
%add11 = add nsw i64 %ans.035, %conv10
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%exitcond.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count
br i1 %exitcond.not, label %for.end14, label %for.body7, !llvm.loop !14
for.end14: ; preds = %for.body7, %middle.block, %for.end
%ans.0.lcssa = phi i64 [ %conv3, %for.end ], [ %17, %middle.block ], [ %add11, %for.body7 ]
%19 = and i32 %3, -2147483647
%cmp15 = icmp eq i32 %19, 1
br i1 %cmp15, label %if.then, label %if.end
if.then: ; preds = %for.end14
%add17 = add nsw i32 %div, 1
%idxprom18 = sext i32 %add17 to i64
%arrayidx19 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %idxprom18
%20 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%conv20 = sext i32 %20 to i64
%add21 = add nsw i64 %ans.0.lcssa, %conv20
br label %if.end
if.end: ; preds = %if.then, %for.end14
%ans.1 = phi i64 [ %add21, %if.then ], [ %ans.0.lcssa, %for.end14 ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.1)
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include <stdio.h>
#include <string.h>
int main(void){
char s[1001];
int i = 0;
scanf("%[^\n]%*c" , s);
while(s[i] != '\0'){
if(s[i] == 'a'){
if(s[i+1] == 'p'
&& s[i+2] == 'p'
&& s[i+3] == 'l'
&& s[i+4] == 'e'){
printf("peach");
i += 5;
}else{
printf("%c" , s[i]);
i++;
}
}else if(s[i] == 'p'){
if(s[i+1] == 'e'
&& s[i+2] == 'a'
&& s[i+3] == 'c'
&& s[i+4] == 'h'){
printf("apple");
i += 5;
}else{
printf("%c" , s[i]);
i++;
}
}else{
printf("%c" , s[i]);
i++;
}
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125759/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125759/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%[^\0A]%*c\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"peach\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"apple\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%i.0 = phi i32 [ 0, %entry ], [ %i.0.be, %while.cond.backedge ]
%idxprom = sext i32 %i.0 to i64
%arrayidx = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv = sext i8 %0 to i32
switch i8 %0, label %if.else83 [
i8 0, label %while.end
i8 97, label %if.then
i8 112, label %if.then45
]
if.then: ; preds = %while.cond
%add = add nsw i32 %i.0, 1
%idxprom7 = sext i32 %add to i64
%arrayidx8 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom7
%1 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%cmp10 = icmp eq i8 %1, 112
br i1 %cmp10, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %if.then
%add12 = add nsw i32 %i.0, 2
%idxprom13 = sext i32 %add12 to i64
%arrayidx14 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom13
%2 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%cmp16 = icmp eq i8 %2, 112
br i1 %cmp16, label %land.lhs.true18, label %if.else
land.lhs.true18: ; preds = %land.lhs.true
%add19 = add nsw i32 %i.0, 3
%idxprom20 = sext i32 %add19 to i64
%arrayidx21 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom20
%3 = load i8, ptr %arrayidx21, align 1, !tbaa !5
%cmp23 = icmp eq i8 %3, 108
br i1 %cmp23, label %land.lhs.true25, label %if.else
land.lhs.true25: ; preds = %land.lhs.true18
%add26 = add nsw i32 %i.0, 4
%idxprom27 = sext i32 %add26 to i64
%arrayidx28 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom27
%4 = load i8, ptr %arrayidx28, align 1, !tbaa !5
%cmp30 = icmp eq i8 %4, 101
br i1 %cmp30, label %if.then32, label %if.else
if.then32: ; preds = %land.lhs.true25
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%add34 = add nsw i32 %i.0, 5
br label %while.cond.backedge
if.else: ; preds = %land.lhs.true25, %land.lhs.true18, %land.lhs.true, %if.then
%putchar112 = call i32 @putchar(i32 %conv)
br label %while.cond.backedge
if.then45: ; preds = %while.cond
%add46 = add nsw i32 %i.0, 1
%idxprom47 = sext i32 %add46 to i64
%arrayidx48 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom47
%5 = load i8, ptr %arrayidx48, align 1, !tbaa !5
%cmp50 = icmp eq i8 %5, 101
br i1 %cmp50, label %land.lhs.true52, label %if.else76
land.lhs.true52: ; preds = %if.then45
%add53 = add nsw i32 %i.0, 2
%idxprom54 = sext i32 %add53 to i64
%arrayidx55 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom54
%6 = load i8, ptr %arrayidx55, align 1, !tbaa !5
%cmp57 = icmp eq i8 %6, 97
br i1 %cmp57, label %land.lhs.true59, label %if.else76
land.lhs.true59: ; preds = %land.lhs.true52
%add60 = add nsw i32 %i.0, 3
%idxprom61 = sext i32 %add60 to i64
%arrayidx62 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom61
%7 = load i8, ptr %arrayidx62, align 1, !tbaa !5
%cmp64 = icmp eq i8 %7, 99
br i1 %cmp64, label %land.lhs.true66, label %if.else76
land.lhs.true66: ; preds = %land.lhs.true59
%add67 = add nsw i32 %i.0, 4
%idxprom68 = sext i32 %add67 to i64
%arrayidx69 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom68
%8 = load i8, ptr %arrayidx69, align 1, !tbaa !5
%cmp71 = icmp eq i8 %8, 104
br i1 %cmp71, label %if.then73, label %if.else76
if.then73: ; preds = %land.lhs.true66
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
%add75 = add nsw i32 %i.0, 5
br label %while.cond.backedge
if.else76: ; preds = %land.lhs.true66, %land.lhs.true59, %land.lhs.true52, %if.then45
%putchar111 = call i32 @putchar(i32 %conv)
br label %while.cond.backedge
if.else83: ; preds = %while.cond
%putchar110 = call i32 @putchar(i32 %conv)
%inc88 = add nsw i32 %i.0, 1
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.else83, %if.else76, %if.then73, %if.then32, %if.else
%i.0.be = phi i32 [ %add34, %if.then32 ], [ %add, %if.else ], [ %add75, %if.then73 ], [ %add46, %if.else76 ], [ %inc88, %if.else83 ]
br label %while.cond, !llvm.loop !8
while.end: ; preds = %while.cond
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
char S[11];
scanf("%s", S);
int b = 1;
int i = 0;
while(S[i] != '\0'){
if(b){
b = 0;
if(S[i] != 'h') break;
} else if(!b){
if(S[i] == 'i') b = 1;
else break;
}
i++;
}
printf(b ? "Yes" : "No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125830/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125830/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i8, ptr %S, align 1, !tbaa !5
%cmp.not30 = icmp eq i8 %0, 0
br i1 %cmp.not30, label %while.end.thread33, label %while.body
while.body: ; preds = %entry, %if.end19
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end19 ], [ 0, %entry ]
%1 = phi i8 [ %2, %if.end19 ], [ %0, %entry ]
%b.031 = phi i32 [ %b.1, %if.end19 ], [ 1, %entry ]
%tobool.not.not = icmp eq i32 %b.031, 0
br i1 %tobool.not.not, label %if.then9, label %if.then
if.then: ; preds = %while.body
%cmp5.not = icmp eq i8 %1, 104
br i1 %cmp5.not, label %if.end19, label %while.end.thread
if.then9: ; preds = %while.body
%cmp13 = icmp eq i8 %1, 105
br i1 %cmp13, label %if.end19, label %while.end.thread
if.end19: ; preds = %if.then9, %if.then
%b.1 = phi i32 [ 0, %if.then ], [ 1, %if.then9 ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %2, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %if.end19
br i1 %tobool.not.not, label %while.end.thread33, label %while.end.thread
while.end.thread: ; preds = %if.then9, %if.then, %while.end
br label %while.end.thread33
while.end.thread33: ; preds = %entry, %while.end, %while.end.thread
%3 = phi ptr [ @.str.2, %while.end.thread ], [ @.str.1, %while.end ], [ @.str.1, %entry ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %3)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main(void){
char s[10];
int i = 0;
int hnum = 0;
int inum = 0;
scanf("%s", s);
if (strlen(s) < 2 || strlen(s)%2 != 0){
printf("No");
return 0;
}
for(i=0;i<strlen(s);i++){
if(i%2==0){
if(s[i]!='h'){
printf("No");
return 0;
}
}
if(i%2!=0){
if(s[i]!='i'){
printf("No");
return 0;
}
}
}
printf("Yes");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125881/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125881/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%cmp = icmp ugt i64 %call2, 1
%rem = and i64 %call2, 1
%cmp5.not = icmp eq i64 %rem, 0
%or.cond = and i1 %cmp, %cmp5.not
br i1 %or.cond, label %for.body, label %cleanup
for.body: ; preds = %entry, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp16.not = icmp eq i8 %0, 104
br i1 %cmp16.not, label %if.then25.1, label %cleanup
if.then25.1: ; preds = %for.body
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp29.not.1 = icmp eq i8 %1, 105
br i1 %cmp29.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %if.then25.1
%indvars.iv.next.1 = add nuw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %call2
br i1 %exitcond.not.1, label %cleanup, label %for.body, !llvm.loop !8
cleanup: ; preds = %for.body, %if.then25.1, %for.inc.1, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %for.body ], [ @.str.1, %if.then25.1 ], [ @.str.2, %for.inc.1 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#define P
int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}
int main(void){
char s[11];
scanf("%s", s);
int n=strlen(s), i;
if(n%2==0){
for(i=0; i<n; i++){
if(i%2==0){
if(s[i]!='h'){
puts("No");
return 0;
}
}else{
if(s[i]!='i'){
puts("No");
return 0;
}
}
}
puts("Yes");
}else{
puts("No");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125931/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125931/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: 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:
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call2 to i32
%0 = and i32 %conv, 1
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %for.cond.preheader, label %cleanup
for.cond.preheader: ; preds = %entry
%cmp435 = icmp sgt i32 %conv, 0
br i1 %cmp435, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = and i64 %call2, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%rem638 = and i64 %indvars.iv, 1
%cmp7 = icmp eq i64 %rem638, 0
%arrayidx = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
br i1 %cmp7, label %if.then9, label %if.else
if.then9: ; preds = %for.body
%cmp11.not = icmp eq i8 %1, 104
br i1 %cmp11.not, label %for.inc, label %cleanup
if.else: ; preds = %for.body
%cmp18.not = icmp eq i8 %1, 105
br i1 %cmp18.not, label %for.inc, label %cleanup
for.inc: ; preds = %if.then9, %if.else
%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 !10
cleanup: ; preds = %for.inc, %if.else, %if.then9, %entry, %for.cond.preheader
%.str.2.sink = phi ptr [ @.str.2, %for.cond.preheader ], [ @.str.1, %entry ], [ @.str.1, %if.then9 ], [ @.str.1, %if.else ], [ @.str.2, %for.inc ]
%call24 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 11, 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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int N,Y,frag = 0,tmp,frag10000,frag5000,frag1000,a,b,c,A = -1,B = -1,C = -1,x,y = -1;
scanf("%d %d",&N,&Y);
frag10000 = Y / 10000;
frag5000 = Y / 5000;
frag1000 = Y / 1000;
for(a = 0; a <= N; a++){
for(b = 0; b <= N; b++){
c = N - a - b;
if(c < 0){
continue;
}
x = (a * 10000) + (b * 5000) + (c * 1000);
if(x == Y){
frag++;
A = a;
B = b;
C = c;
break;
}
/*for(c = 0; c < frag1000; c++){
tmp = a + b + c;
x = (a * 10000) + (b * 5000) + (c * 1000);
if((tmp == N) && (x == Y)){
frag++;
A = a;
B = b;
C = c;
break;
}
}*/
}
}
printf("%d %d %d",A,B,C);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125975/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125975/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%Y = 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 %Y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not32 = icmp slt i32 %0, 0
br i1 %cmp.not32, label %for.end17, label %for.cond3.preheader.lr.ph
for.cond3.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %Y, align 4
br label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.inc15
%a.036 = phi i32 [ 0, %for.cond3.preheader.lr.ph ], [ %inc16, %for.inc15 ]
%C.035 = phi i32 [ -1, %for.cond3.preheader.lr.ph ], [ %C.1, %for.inc15 ]
%B.034 = phi i32 [ -1, %for.cond3.preheader.lr.ph ], [ %B.1, %for.inc15 ]
%A.033 = phi i32 [ -1, %for.cond3.preheader.lr.ph ], [ %A.1, %for.inc15 ]
%mul = mul nsw i32 %a.036, 10000
br label %for.body5
for.body5: ; preds = %for.cond3.preheader, %for.inc
%b.031 = phi i32 [ 0, %for.cond3.preheader ], [ %inc14, %for.inc ]
%2 = add nuw i32 %a.036, %b.031
%sub6 = sub i32 %0, %2
%cmp7 = icmp slt i32 %sub6, 0
br i1 %cmp7, label %for.inc, label %if.end
if.end: ; preds = %for.body5
%mul8 = mul nsw i32 %b.031, 5000
%add = add nuw nsw i32 %mul8, %mul
%mul9 = mul nsw i32 %sub6, 1000
%add10 = add nsw i32 %add, %mul9
%cmp11 = icmp eq i32 %add10, %1
br i1 %cmp11, label %for.inc15, label %for.inc
for.inc: ; preds = %if.end, %for.body5
%inc14 = add nuw i32 %b.031, 1
%exitcond.not = icmp eq i32 %b.031, %0
br i1 %exitcond.not, label %for.inc15, label %for.body5, !llvm.loop !9
for.inc15: ; preds = %for.inc, %if.end
%A.1 = phi i32 [ %a.036, %if.end ], [ %A.033, %for.inc ]
%B.1 = phi i32 [ %b.031, %if.end ], [ %B.034, %for.inc ]
%C.1 = phi i32 [ %sub6, %if.end ], [ %C.035, %for.inc ]
%inc16 = add nuw i32 %a.036, 1
%exitcond45.not = icmp eq i32 %a.036, %0
br i1 %exitcond45.not, label %for.end17, label %for.cond3.preheader, !llvm.loop !11
for.end17: ; preds = %for.inc15, %entry
%A.0.lcssa = phi i32 [ -1, %entry ], [ %A.1, %for.inc15 ]
%B.0.lcssa = phi i32 [ -1, %entry ], [ %B.1, %for.inc15 ]
%C.0.lcssa = phi i32 [ -1, %entry ], [ %C.1, %for.inc15 ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %A.0.lcssa, i32 noundef %B.0.lcssa, i32 noundef %C.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #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}
|
#include <stdio.h>
int main(void){
int N,Y;
int m,g,s,y,count=0;
scanf("%d%d",&N,&Y);
y=Y/1000;
for(m=0;m<=N;m++){
for(g=0;g<=N;g++){
if(y-9*m-4*g==N&&N-m-g>=0){
s=N-m-g;
printf("%d %d %d\n",m,g,s);
//count++;
return 0;
}
}
}
//if(count=0)
printf("-1 -1 -1");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126024/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126024/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%Y = 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 %Y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y)
%0 = load i32, ptr %Y, align 4, !tbaa !5
%div = sdiv i32 %0, 1000
%1 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not37 = icmp slt i32 %1, 0
br i1 %cmp.not37, label %for.end15, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.for.inc13_crit_edge
%m.038 = phi i32 [ %inc14, %for.cond1.for.inc13_crit_edge ], [ 0, %entry ]
%mul.neg = mul i32 %m.038, -9
%sub = add i32 %mul.neg, %div
br label %for.body3
for.body3: ; preds = %for.cond1.preheader, %for.inc
%g.036 = phi i32 [ 0, %for.cond1.preheader ], [ %inc, %for.inc ]
%2 = shl i32 %g.036, 2
%sub5 = sub i32 %sub, %2
%cmp6 = icmp eq i32 %sub5, %1
br i1 %cmp6, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body3
%3 = add nuw i32 %m.038, %g.036
%sub8 = sub i32 %1, %3
%cmp9 = icmp sgt i32 %sub8, -1
br i1 %cmp9, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.038, i32 noundef %g.036, i32 noundef %sub8)
br label %cleanup
for.inc: ; preds = %for.body3, %land.lhs.true
%inc = add nuw i32 %g.036, 1
%exitcond.not = icmp eq i32 %g.036, %1
br i1 %exitcond.not, label %for.cond1.for.inc13_crit_edge, label %for.body3, !llvm.loop !9
for.cond1.for.inc13_crit_edge: ; preds = %for.inc
%inc14 = add nuw i32 %m.038, 1
%exitcond42.not = icmp eq i32 %m.038, %1
br i1 %exitcond42.not, label %for.end15, label %for.cond1.preheader, !llvm.loop !11
for.end15: ; preds = %for.cond1.for.inc13_crit_edge, %entry
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
cleanup: ; preds = %for.end15, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #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}
|
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int n, y, i, j, k;
int main(void)
{
scanf("%d%d", &n, &y);
for (i=0; i <= n; ++i)
{
for (j = 0; i + j <= n; ++j)
{
k = n - i - j;
if (y == 10000 * i + 5000 * j + 1000 * k)
{
printf("%d %d %d\n", i, j, k);
return 0;
}
}
}
printf("-1 -1 -1\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126068/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126068/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@n = dso_local global i32 0, align 4
@y = dso_local global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@j = dso_local local_unnamed_addr global i32 0, align 4
@k = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@str = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @y)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not24 = icmp slt i32 %0, 0
br i1 %cmp.not24, label %for.end13, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr @y, align 4, !tbaa !5
%2 = add nuw i32 %0, 1
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc11
%storemerge25 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc12, %for.inc11 ]
%mul = mul nuw nsw i32 %storemerge25, 10000
br label %for.body3
for.body3: ; preds = %for.cond1.preheader, %for.inc
%add20 = phi i32 [ %storemerge25, %for.cond1.preheader ], [ %add, %for.inc ]
%storemerge1519 = phi i32 [ 0, %for.cond1.preheader ], [ %inc, %for.inc ]
%sub4 = sub i32 %0, %add20
%mul5 = mul nuw nsw i32 %storemerge1519, 5000
%add6 = add nuw nsw i32 %mul5, %mul
%mul7 = mul nsw i32 %sub4, 1000
%add8 = add nsw i32 %add6, %mul7
%cmp9 = icmp eq i32 %1, %add8
br i1 %cmp9, label %if.then, label %for.inc
if.then: ; preds = %for.body3
store i32 %storemerge25, ptr @i, align 4, !tbaa !5
store i32 %sub4, ptr @k, align 4, !tbaa !5
store i32 %storemerge1519, ptr @j, align 4, !tbaa !5
%call10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %storemerge25, i32 noundef %storemerge1519, i32 noundef %sub4)
br label %return
for.inc: ; preds = %for.body3
%inc = add nuw nsw i32 %storemerge1519, 1
%add = add nuw nsw i32 %inc, %storemerge25
%cmp2.not = icmp sgt i32 %add, %0
br i1 %cmp2.not, label %for.inc11, label %for.body3, !llvm.loop !9
for.inc11: ; preds = %for.inc
store i32 %sub4, ptr @k, align 4, !tbaa !5
store i32 %inc, ptr @j, align 4, !tbaa !5
%inc12 = add nuw i32 %storemerge25, 1
%exitcond.not = icmp eq i32 %storemerge25, %0
br i1 %exitcond.not, label %for.end13, label %for.cond1.preheader, !llvm.loop !11
for.end13: ; preds = %for.inc11, %entry
%storemerge.lcssa = phi i32 [ 0, %entry ], [ %2, %for.inc11 ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %return
return: ; preds = %for.end13, %if.then
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
int N,i,j;
long Y,money,buff;
char str[100],*p;
fgets(str,sizeof(str),stdin);
p=strtok(str," \n");
N=atoi(p);
p=strtok(NULL," \n");
Y=atol(p);
money=Y-1000*N;
for(i=0;i<=N;i++){
Y=money;
Y-=9000*i;
buff=Y;
if(Y<0){
break;
}
for(j=0;j<=N-i;j++){
Y=buff;
Y-=4000*j;
if(Y<0){
break;
}
if(Y==0){
printf("%d %d %d\n",i,j,N-i-j);
return 0;
}
}
}
printf("%d %d %d\n",-1,-1,-1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126110/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126110/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c" \0A\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %0)
%call2 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #4
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %call2, ptr noundef null, i32 noundef 10) #4
%conv.i = trunc i64 %call.i to i32
%call4 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #4
%call.i61 = call i64 @strtol(ptr nocapture noundef nonnull %call4, ptr noundef null, i32 noundef 10) #4
%cmp.not67 = icmp slt i32 %conv.i, 0
br i1 %cmp.not67, label %for.end33, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%sext = mul i64 %call.i, 4294967296000
%conv = ashr exact i64 %sext, 32
%1 = add nuw i32 %conv.i, 1
%wide.trip.count79 = zext i32 %1 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc31
%indvars.iv75 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next76, %for.inc31 ]
%indvars.iv73 = phi i32 [ %1, %for.body.lr.ph ], [ %indvars.iv.next74, %for.inc31 ]
%2 = mul nuw nsw i64 %indvars.iv75, 9000
%3 = add nsw i64 %conv, %2
%sub9 = sub i64 %call.i61, %3
%cmp10 = icmp slt i64 %sub9, 0
br i1 %cmp10, label %for.end33, label %for.cond12.preheader
for.cond12.preheader: ; preds = %for.body
%4 = trunc i64 %indvars.iv75 to i32
%sub13 = sub nsw i32 %conv.i, %4
%cmp14.not65 = icmp slt i32 %sub13, 0
br i1 %cmp14.not65, label %for.inc31, label %for.body16.preheader
for.body16.preheader: ; preds = %for.cond12.preheader
%wide.trip.count = zext i32 %indvars.iv73 to i64
br label %for.body16
for.body16: ; preds = %for.body16.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next, %for.inc ]
%5 = mul nuw nsw i64 %indvars.iv, 4000
%cmp20 = icmp slt i64 %sub9, %5
br i1 %cmp20, label %for.inc31, label %if.end23
if.end23: ; preds = %for.body16
%cmp24 = icmp eq i64 %sub9, %5
br i1 %cmp24, label %if.then26, label %for.inc
if.then26: ; preds = %if.end23
%6 = trunc i64 %indvars.iv to i32
%sub28 = sub nsw i32 %sub13, %6
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %6, i32 noundef %sub28)
br label %cleanup
for.inc: ; preds = %if.end23
%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.inc31, label %for.body16, !llvm.loop !9
for.inc31: ; preds = %for.body16, %for.inc, %for.cond12.preheader
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%indvars.iv.next74 = add i32 %indvars.iv73, -1
%exitcond80.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count79
br i1 %exitcond80.not, label %for.end33, label %for.body, !llvm.loop !11
for.end33: ; preds = %for.inc31, %for.body, %entry
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef -1, i32 noundef -1, i32 noundef -1)
br label %cleanup
cleanup: ; preds = %for.end33, %if.then26
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
//ACACACACACACACACACACACACACACAC
#include<stdio.h>{
int main(){
int n,y,i,j,k;
scanf("%d %d",&n,&y);
for(i=0;i<=n&&i*10<=y/1000;i++){
for(j=0;i+j<=n&&i*10+j*5<=y/1000;j++){
for(k=0;i+j+k<=n&&i*10+j*5+k<=y/1000;k++){
if(i+j+k==n&&i*10+j*5+k==y/1000){
printf("%d %d %d",i,j,k);
return(0);
}
}
}
}
printf("-1 -1 -1");
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126154/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126154/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%y = 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 %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %y)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not76 = icmp slt i32 %0, 0
br i1 %cmp.not76, label %for.end40, label %land.rhs.lr.ph
land.rhs.lr.ph: ; preds = %entry
%1 = load i32, ptr %y, align 4, !tbaa !5
%div = sdiv i32 %1, 1000
br label %land.rhs
land.rhs: ; preds = %land.rhs.lr.ph, %for.inc38
%i.077 = phi i32 [ 0, %land.rhs.lr.ph ], [ %inc39, %for.inc38 ]
%mul = mul nuw nsw i32 %i.077, 10
%cmp1.not = icmp sgt i32 %mul, %div
br i1 %cmp1.not, label %for.end40, label %land.rhs4
land.rhs4: ; preds = %land.rhs, %for.inc35
%add75 = phi i32 [ %add, %for.inc35 ], [ %i.077, %land.rhs ]
%j.074 = phi i32 [ %inc36, %for.inc35 ], [ 0, %land.rhs ]
%mul6 = mul nuw nsw i32 %j.074, 5
%add7 = add nuw nsw i32 %mul6, %mul
%cmp9.not = icmp sgt i32 %add7, %div
br i1 %cmp9.not, label %for.inc38, label %land.rhs16
land.rhs16: ; preds = %land.rhs4, %for.inc
%add1472 = phi i32 [ %add14, %for.inc ], [ %add75, %land.rhs4 ]
%k.071 = phi i32 [ %inc, %for.inc ], [ 0, %land.rhs4 ]
%add20 = add nuw nsw i32 %k.071, %add7
%cmp22.not = icmp sgt i32 %add20, %div
br i1 %cmp22.not, label %for.inc35, label %for.body24
for.body24: ; preds = %land.rhs16
%cmp27 = icmp eq i32 %add1472, %0
%cmp33 = icmp eq i32 %add20, %div
%or.cond = and i1 %cmp27, %cmp33
br i1 %or.cond, label %if.then, label %for.inc
if.then: ; preds = %for.body24
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.077, i32 noundef %j.074, i32 noundef %k.071)
br label %cleanup
for.inc: ; preds = %for.body24
%inc = add nuw nsw i32 %k.071, 1
%add14 = add nuw nsw i32 %inc, %add75
%cmp15.not = icmp sgt i32 %add14, %0
br i1 %cmp15.not, label %for.inc35, label %land.rhs16, !llvm.loop !9
for.inc35: ; preds = %for.inc, %land.rhs16
%inc36 = add nuw nsw i32 %j.074, 1
%add = add nuw nsw i32 %inc36, %i.077
%cmp3.not = icmp sgt i32 %add, %0
br i1 %cmp3.not, label %for.inc38, label %land.rhs4, !llvm.loop !11
for.inc38: ; preds = %for.inc35, %land.rhs4
%inc39 = add nuw nsw i32 %i.077, 1
%exitcond.not = icmp eq i32 %i.077, %0
br i1 %exitcond.not, label %for.end40, label %land.rhs, !llvm.loop !12
for.end40: ; preds = %land.rhs, %for.inc38, %entry
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
cleanup: ; preds = %for.end40, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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}
|
#include<stdio.h>
int main() {
int i, g, s;
int n, y;
int x = 0;
scanf("%d%d", &n, &y);
for(i=0;i<=n,y>=10000*i;i++)
{
for(g=0;g<=n-i,y>=10000*i+5000*g;g++)
{
s=n-(i+g);
if(y==10000*i+5000*g+1000*s&&n==i+g+s)
{
printf("%d %d %d",i,g,s);
x=1;
goto end;
}
}
}
end:
if(x==0)
puts("-1 -1 -1");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126198/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126198/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%y = 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 %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %y)
%0 = load i32, ptr %y, align 4, !tbaa !5
%cmp1.not53 = icmp slt i32 %0, 0
br i1 %cmp1.not53, label %if.then30, label %for.cond3.preheader.lr.ph
for.cond3.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.inc25
%mul55 = phi i32 [ 0, %for.cond3.preheader.lr.ph ], [ %mul, %for.inc25 ]
%i.054 = phi i32 [ 0, %for.cond3.preheader.lr.ph ], [ %inc26, %for.inc25 ]
br label %for.body10
for.body10: ; preds = %for.cond3.preheader, %for.inc
%add52 = phi i32 [ %mul55, %for.cond3.preheader ], [ %add, %for.inc ]
%g.051 = phi i32 [ 0, %for.cond3.preheader ], [ %inc, %for.inc ]
%2 = add nuw i32 %g.051, %i.054
%sub12 = sub i32 %1, %2
%mul16 = mul nsw i32 %sub12, 1000
%add17 = add nsw i32 %mul16, %add52
%cmp18 = icmp eq i32 %0, %add17
br i1 %cmp18, label %if.then, label %for.inc
if.then: ; preds = %for.body10
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.054, i32 noundef %g.051, i32 noundef %sub12)
br label %if.end32
for.inc: ; preds = %for.body10
%inc = add nuw nsw i32 %g.051, 1
%mul7 = mul nsw i32 %inc, 5000
%add = add nuw nsw i32 %mul7, %mul55
%cmp8.not = icmp slt i32 %0, %add
br i1 %cmp8.not, label %for.inc25, label %for.body10, !llvm.loop !9
for.inc25: ; preds = %for.inc
%inc26 = add nuw nsw i32 %i.054, 1
%mul = mul nsw i32 %inc26, 10000
%cmp1.not = icmp slt i32 %0, %mul
br i1 %cmp1.not, label %if.then30, label %for.cond3.preheader, !llvm.loop !11
if.then30: ; preds = %for.inc25, %entry
%call31 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end32
if.end32: ; preds = %if.then, %if.then30
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void) {
int n, y, a,b,c, h, temp;
scanf("%d %d",&n,&y);
for(c=0;c<=n;c++){
h=n-c;
for(a=0;a<=h;a++){
b=n-a-c;
temp = y - 1000*c - 10000*a;
if(temp == b*5000){
printf("%d %d %d",a,b,c);
return 0;
}
}
}
printf("-1 -1 -1");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126240/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126240/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%y = 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 %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %y)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not36 = icmp slt i32 %0, 0
br i1 %cmp.not36, label %for.end14, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %y, align 4
%2 = add nuw i32 %0, 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc12
%indvars.iv = phi i32 [ %2, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc12 ]
%c.037 = phi i32 [ 0, %for.body.lr.ph ], [ %inc13, %for.inc12 ]
%cmp2.not34 = icmp slt i32 %0, %c.037
br i1 %cmp2.not34, label %for.inc12, label %for.body3.lr.ph
for.body3.lr.ph: ; preds = %for.body
%mul.neg = mul i32 %c.037, -1000
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%a.035 = phi i32 [ 0, %for.body3.lr.ph ], [ %inc, %for.inc ]
%3 = add nuw i32 %c.037, %a.035
%sub5 = sub i32 %0, %3
%mul7.neg = mul i32 %a.035, -10000
%sub6 = add i32 %mul7.neg, %mul.neg
%sub8 = add i32 %sub6, %1
%mul9 = mul nsw i32 %sub5, 5000
%cmp10 = icmp eq i32 %sub8, %mul9
br i1 %cmp10, label %if.then, label %for.inc
if.then: ; preds = %for.body3
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.035, i32 noundef %sub5, i32 noundef %c.037)
br label %cleanup
for.inc: ; preds = %for.body3
%inc = add nuw i32 %a.035, 1
%exitcond.not = icmp eq i32 %inc, %indvars.iv
br i1 %exitcond.not, label %for.inc12, label %for.body3, !llvm.loop !9
for.inc12: ; preds = %for.inc, %for.body
%inc13 = add nuw i32 %c.037, 1
%indvars.iv.next = add i32 %indvars.iv, -1
%exitcond41.not = icmp eq i32 %c.037, %0
br i1 %exitcond41.not, label %for.end14, label %for.body, !llvm.loop !11
for.end14: ; preds = %for.inc12, %entry
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
cleanup: ; preds = %for.end14, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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}
|
// AOJ DSL_3_A The Smallest Window I
// 2018.5.5 bal4u
#include <stdio.h>
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
int n = 0, c = gc();
do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
return n;
}
int s[100002];
int main()
{
int N, S, i, j, ans;
N = in(), S = in();
for (i = 1; i <= N; i++) s[i] = s[i-1] + in();
if (s[N] < S) { puts("0"); return 0; }
if (s[N] == S) { printf("%d\n", N); return 0; }
for (j = 1; s[j] < S; j++);
i = 0, ans = j;
while (1) {
while (s[j]-s[i] >= S) i++;
if (j-i+1 < ans) ans = j-i+1;
while (j <= N && s[j]-s[i] < S) j++;
if (j > N) break;
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126291/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126291/source.c"
target datalayout = "e-m:e-p270: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._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@s = dso_local local_unnamed_addr global [100002 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [2 x i8] c"0\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4
%.pre14.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %do.body.preheader
do.body.preheader: ; preds = %cond.true.i, %cond.false.i
%.ph = phi ptr [ %0, %cond.false.i ], [ %.pre14.pre, %cond.true.i ]
%c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %do.body
do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit13
%4 = phi ptr [ %8, %getchar_unlocked.exit13 ], [ %.ph, %do.body.preheader ]
%n.0 = phi i32 [ %add, %getchar_unlocked.exit13 ], [ 0, %do.body.preheader ]
%c.0 = phi i32 [ %cond.i9, %getchar_unlocked.exit13 ], [ %c.0.ph, %do.body.preheader ]
%mul = mul nsw i32 %n.0, 10
%and = and i32 %c.0, 15
%add = add nsw i32 %and, %mul
%_IO_read_ptr.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4, align 8, !tbaa !9
%_IO_read_end.i5 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5, align 8, !tbaa !14
%cmp.not.i6 = icmp ult ptr %5, %6
br i1 %cmp.not.i6, label %cond.false.i10, label %cond.true.i7, !prof !15
cond.true.i7: ; preds = %do.body
%call.i8 = tail call i32 @__uflow(ptr noundef nonnull %4) #4
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13
cond.false.i10: ; preds = %do.body
%incdec.ptr.i11 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11, ptr %_IO_read_ptr.i4, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i12 = zext i8 %7 to i32
br label %getchar_unlocked.exit13
getchar_unlocked.exit13: ; preds = %cond.true.i7, %cond.false.i10
%8 = phi ptr [ %.pre, %cond.true.i7 ], [ %4, %cond.false.i10 ]
%cond.i9 = phi i32 [ %call.i8, %cond.true.i7 ], [ %conv3.i12, %cond.false.i10 ]
%cmp = icmp sgt i32 %cond.i9, 47
br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17
do.end: ; preds = %getchar_unlocked.exit13
ret i32 %add
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14
%cmp.not.i.i = icmp ult ptr %1, %2
br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4
%.pre14.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i.preheader
cond.false.i.i: ; preds = %entry
%incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i.i = zext i8 %3 to i32
br label %do.body.i.preheader
do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i
%.ph191 = phi ptr [ %0, %cond.false.i.i ], [ %.pre14.pre.i, %cond.true.i.i ]
%c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ]
br label %do.body.i
do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit13.i
%4 = phi ptr [ %8, %getchar_unlocked.exit13.i ], [ %.ph191, %do.body.i.preheader ]
%n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit13.i ], [ 0, %do.body.i.preheader ]
%c.0.i = phi i32 [ %cond.i9.i, %getchar_unlocked.exit13.i ], [ %c.0.i.ph, %do.body.i.preheader ]
%mul.i = mul i32 %n.0.i, 10
%and.i = and i32 %c.0.i, 15
%add.i = add nsw i32 %and.i, %mul.i
%_IO_read_ptr.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9
%_IO_read_end.i5.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5.i, align 8, !tbaa !14
%cmp.not.i6.i = icmp ult ptr %5, %6
br i1 %cmp.not.i6.i, label %cond.false.i10.i, label %cond.true.i7.i, !prof !15
cond.true.i7.i: ; preds = %do.body.i
%call.i8.i = tail call i32 @__uflow(ptr noundef nonnull %4) #4
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i
cond.false.i10.i: ; preds = %do.body.i
%incdec.ptr.i11.i = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11.i, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i12.i = zext i8 %7 to i32
br label %getchar_unlocked.exit13.i
getchar_unlocked.exit13.i: ; preds = %cond.false.i10.i, %cond.true.i7.i
%8 = phi ptr [ %.pre.i, %cond.true.i7.i ], [ %4, %cond.false.i10.i ]
%cond.i9.i = phi i32 [ %call.i8.i, %cond.true.i7.i ], [ %conv3.i12.i, %cond.false.i10.i ]
%cmp.i = icmp sgt i32 %cond.i9.i, 47
br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17
in.exit: ; preds = %getchar_unlocked.exit13.i
%_IO_read_ptr.i.i86 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1
%9 = load ptr, ptr %_IO_read_ptr.i.i86, align 8, !tbaa !9
%_IO_read_end.i.i87 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2
%10 = load ptr, ptr %_IO_read_end.i.i87, align 8, !tbaa !14
%cmp.not.i.i88 = icmp ult ptr %9, %10
br i1 %cmp.not.i.i88, label %cond.false.i.i113, label %cond.true.i.i89, !prof !15
cond.true.i.i89: ; preds = %in.exit
%call.i.i90 = tail call i32 @__uflow(ptr noundef nonnull %8) #4
%.pre14.pre.i91 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i95.preheader
cond.false.i.i113: ; preds = %in.exit
%incdec.ptr.i.i114 = getelementptr inbounds i8, ptr %9, i64 1
store ptr %incdec.ptr.i.i114, ptr %_IO_read_ptr.i.i86, align 8, !tbaa !9
%11 = load i8, ptr %9, align 1, !tbaa !16
%conv3.i.i115 = zext i8 %11 to i32
br label %do.body.i95.preheader
do.body.i95.preheader: ; preds = %cond.false.i.i113, %cond.true.i.i89
%.ph189 = phi ptr [ %8, %cond.false.i.i113 ], [ %.pre14.pre.i91, %cond.true.i.i89 ]
%c.0.i97.ph = phi i32 [ %conv3.i.i115, %cond.false.i.i113 ], [ %call.i.i90, %cond.true.i.i89 ]
br label %do.body.i95
do.body.i95: ; preds = %do.body.i95.preheader, %getchar_unlocked.exit13.i107
%12 = phi ptr [ %16, %getchar_unlocked.exit13.i107 ], [ %.ph189, %do.body.i95.preheader ]
%n.0.i96 = phi i32 [ %add.i100, %getchar_unlocked.exit13.i107 ], [ 0, %do.body.i95.preheader ]
%c.0.i97 = phi i32 [ %cond.i9.i108, %getchar_unlocked.exit13.i107 ], [ %c.0.i97.ph, %do.body.i95.preheader ]
%mul.i98 = mul nsw i32 %n.0.i96, 10
%and.i99 = and i32 %c.0.i97, 15
%add.i100 = add nsw i32 %and.i99, %mul.i98
%_IO_read_ptr.i4.i101 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1
%13 = load ptr, ptr %_IO_read_ptr.i4.i101, align 8, !tbaa !9
%_IO_read_end.i5.i102 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2
%14 = load ptr, ptr %_IO_read_end.i5.i102, align 8, !tbaa !14
%cmp.not.i6.i103 = icmp ult ptr %13, %14
br i1 %cmp.not.i6.i103, label %cond.false.i10.i110, label %cond.true.i7.i104, !prof !15
cond.true.i7.i104: ; preds = %do.body.i95
%call.i8.i105 = tail call i32 @__uflow(ptr noundef nonnull %12) #4
%.pre.i106 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i107
cond.false.i10.i110: ; preds = %do.body.i95
%incdec.ptr.i11.i111 = getelementptr inbounds i8, ptr %13, i64 1
store ptr %incdec.ptr.i11.i111, ptr %_IO_read_ptr.i4.i101, align 8, !tbaa !9
%15 = load i8, ptr %13, align 1, !tbaa !16
%conv3.i12.i112 = zext i8 %15 to i32
br label %getchar_unlocked.exit13.i107
getchar_unlocked.exit13.i107: ; preds = %cond.false.i10.i110, %cond.true.i7.i104
%16 = phi ptr [ %.pre.i106, %cond.true.i7.i104 ], [ %12, %cond.false.i10.i110 ]
%cond.i9.i108 = phi i32 [ %call.i8.i105, %cond.true.i7.i104 ], [ %conv3.i12.i112, %cond.false.i10.i110 ]
%cmp.i109 = icmp sgt i32 %cond.i9.i108, 47
br i1 %cmp.i109, label %do.body.i95, label %for.cond.preheader, !llvm.loop !17
for.cond.preheader: ; preds = %getchar_unlocked.exit13.i107
%cmp.not149 = icmp slt i32 %add.i, 1
br i1 %cmp.not149, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%17 = or i32 %mul.i, 1
%18 = and i32 %c.0.i, 15
%19 = add i32 %17, %18
%wide.trip.count = zext i32 %19 to i64
%.pre = load i32, ptr @s, align 16, !tbaa !19
br label %for.body
for.body: ; preds = %for.body.preheader, %in.exit147
%20 = phi ptr [ %16, %for.body.preheader ], [ %30, %in.exit147 ]
%21 = phi i32 [ %.pre, %for.body.preheader ], [ %add, %in.exit147 ]
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %in.exit147 ]
%_IO_read_ptr.i.i117 = getelementptr inbounds %struct._IO_FILE, ptr %20, i64 0, i32 1
%22 = load ptr, ptr %_IO_read_ptr.i.i117, align 8, !tbaa !9
%_IO_read_end.i.i118 = getelementptr inbounds %struct._IO_FILE, ptr %20, i64 0, i32 2
%23 = load ptr, ptr %_IO_read_end.i.i118, align 8, !tbaa !14
%cmp.not.i.i119 = icmp ult ptr %22, %23
br i1 %cmp.not.i.i119, label %cond.false.i.i144, label %cond.true.i.i120, !prof !15
cond.true.i.i120: ; preds = %for.body
%call.i.i121 = tail call i32 @__uflow(ptr noundef nonnull %20) #4
%.pre14.pre.i122 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i126.preheader
cond.false.i.i144: ; preds = %for.body
%incdec.ptr.i.i145 = getelementptr inbounds i8, ptr %22, i64 1
store ptr %incdec.ptr.i.i145, ptr %_IO_read_ptr.i.i117, align 8, !tbaa !9
%24 = load i8, ptr %22, align 1, !tbaa !16
%conv3.i.i146 = zext i8 %24 to i32
br label %do.body.i126.preheader
do.body.i126.preheader: ; preds = %cond.false.i.i144, %cond.true.i.i120
%.ph187 = phi ptr [ %20, %cond.false.i.i144 ], [ %.pre14.pre.i122, %cond.true.i.i120 ]
%c.0.i128.ph = phi i32 [ %conv3.i.i146, %cond.false.i.i144 ], [ %call.i.i121, %cond.true.i.i120 ]
br label %do.body.i126
do.body.i126: ; preds = %do.body.i126.preheader, %getchar_unlocked.exit13.i138
%25 = phi ptr [ %30, %getchar_unlocked.exit13.i138 ], [ %.ph187, %do.body.i126.preheader ]
%26 = phi ptr [ %31, %getchar_unlocked.exit13.i138 ], [ %.ph187, %do.body.i126.preheader ]
%n.0.i127 = phi i32 [ %add.i131, %getchar_unlocked.exit13.i138 ], [ 0, %do.body.i126.preheader ]
%c.0.i128 = phi i32 [ %cond.i9.i139, %getchar_unlocked.exit13.i138 ], [ %c.0.i128.ph, %do.body.i126.preheader ]
%mul.i129 = mul nsw i32 %n.0.i127, 10
%and.i130 = and i32 %c.0.i128, 15
%add.i131 = add nsw i32 %and.i130, %mul.i129
%_IO_read_ptr.i4.i132 = getelementptr inbounds %struct._IO_FILE, ptr %26, i64 0, i32 1
%27 = load ptr, ptr %_IO_read_ptr.i4.i132, align 8, !tbaa !9
%_IO_read_end.i5.i133 = getelementptr inbounds %struct._IO_FILE, ptr %26, i64 0, i32 2
%28 = load ptr, ptr %_IO_read_end.i5.i133, align 8, !tbaa !14
%cmp.not.i6.i134 = icmp ult ptr %27, %28
br i1 %cmp.not.i6.i134, label %cond.false.i10.i141, label %cond.true.i7.i135, !prof !15
cond.true.i7.i135: ; preds = %do.body.i126
%call.i8.i136 = tail call i32 @__uflow(ptr noundef nonnull %26) #4
%.pre.i137 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i138
cond.false.i10.i141: ; preds = %do.body.i126
%incdec.ptr.i11.i142 = getelementptr inbounds i8, ptr %27, i64 1
store ptr %incdec.ptr.i11.i142, ptr %_IO_read_ptr.i4.i132, align 8, !tbaa !9
%29 = load i8, ptr %27, align 1, !tbaa !16
%conv3.i12.i143 = zext i8 %29 to i32
br label %getchar_unlocked.exit13.i138
getchar_unlocked.exit13.i138: ; preds = %cond.false.i10.i141, %cond.true.i7.i135
%30 = phi ptr [ %.pre.i137, %cond.true.i7.i135 ], [ %25, %cond.false.i10.i141 ]
%31 = phi ptr [ %.pre.i137, %cond.true.i7.i135 ], [ %26, %cond.false.i10.i141 ]
%cond.i9.i139 = phi i32 [ %call.i8.i136, %cond.true.i7.i135 ], [ %conv3.i12.i143, %cond.false.i10.i141 ]
%cmp.i140 = icmp sgt i32 %cond.i9.i139, 47
br i1 %cmp.i140, label %do.body.i126, label %in.exit147, !llvm.loop !17
in.exit147: ; preds = %getchar_unlocked.exit13.i138
%add = add nsw i32 %add.i131, %21
%arrayidx4 = getelementptr inbounds [100002 x i32], ptr @s, i64 0, i64 %indvars.iv
store i32 %add, ptr %arrayidx4, align 4, !tbaa !19
%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 !20
for.end: ; preds = %in.exit147, %for.cond.preheader
%idxprom5 = sext i32 %add.i to i64
%arrayidx6 = getelementptr inbounds [100002 x i32], ptr @s, i64 0, i64 %idxprom5
%32 = load i32, ptr %arrayidx6, align 4, !tbaa !19
%cmp7 = icmp slt i32 %32, %add.i100
br i1 %cmp7, label %if.then, label %if.end
if.then: ; preds = %for.end
%call8 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
br label %cleanup
if.end: ; preds = %for.end
%cmp11 = icmp eq i32 %32, %add.i100
br i1 %cmp11, label %if.then12, label %for.cond15
if.then12: ; preds = %if.end
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.i)
br label %cleanup
for.cond15: ; preds = %if.end, %for.cond15
%indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.cond15 ], [ 1, %if.end ]
%arrayidx17 = getelementptr inbounds [100002 x i32], ptr @s, i64 0, i64 %indvars.iv160
%33 = load i32, ptr %arrayidx17, align 4, !tbaa !19
%cmp18 = icmp slt i32 %33, %add.i100
%indvars.iv.next161 = add nuw i64 %indvars.iv160, 1
br i1 %cmp18, label %for.cond15, label %while.cond.preheader, !llvm.loop !21
while.cond.preheader: ; preds = %for.cond15
%34 = trunc i64 %indvars.iv160 to i32
br label %while.cond
while.cond.loopexit: ; preds = %land.rhs
%35 = trunc i64 %indvars.iv166 to i32
br label %while.cond
while.cond: ; preds = %while.cond.preheader, %while.cond.loopexit
%i.1 = phi i64 [ %indvars.iv163, %while.cond.loopexit ], [ 0, %while.cond.preheader ]
%j.1 = phi i32 [ %35, %while.cond.loopexit ], [ %34, %while.cond.preheader ]
%ans.0 = phi i32 [ %spec.select, %while.cond.loopexit ], [ %34, %while.cond.preheader ]
%idxprom24 = sext i32 %j.1 to i64
%arrayidx25 = getelementptr inbounds [100002 x i32], ptr @s, i64 0, i64 %idxprom24
%36 = load i32, ptr %arrayidx25, align 4, !tbaa !19
%sext = shl i64 %i.1, 32
%37 = ashr exact i64 %sext, 32
br label %while.cond23
while.cond23: ; preds = %while.cond23, %while.cond
%indvars.iv163 = phi i64 [ %indvars.iv.next164, %while.cond23 ], [ %37, %while.cond ]
%arrayidx27 = getelementptr inbounds [100002 x i32], ptr @s, i64 0, i64 %indvars.iv163
%38 = load i32, ptr %arrayidx27, align 4, !tbaa !19
%sub28 = sub nsw i32 %36, %38
%cmp29.not = icmp slt i32 %sub28, %add.i100
%indvars.iv.next164 = add i64 %indvars.iv163, 1
br i1 %cmp29.not, label %while.end, label %while.cond23, !llvm.loop !22
while.end: ; preds = %while.cond23
%39 = trunc i64 %indvars.iv163 to i32
%sub32 = add i32 %j.1, 1
%add33 = sub i32 %sub32, %39
%spec.select = tail call i32 @llvm.smin.i32(i32 %add33, i32 %ans.0)
%cmp40.not151 = icmp sgt i32 %j.1, %add.i
br i1 %cmp40.not151, label %while.end53, label %land.rhs
land.rhs: ; preds = %while.end, %while.body47
%indvars.iv166 = phi i64 [ %indvars.iv.next167, %while.body47 ], [ %idxprom24, %while.end ]
%arrayidx42 = getelementptr inbounds [100002 x i32], ptr @s, i64 0, i64 %indvars.iv166
%40 = load i32, ptr %arrayidx42, align 4, !tbaa !19
%sub45 = sub nsw i32 %40, %38
%cmp46 = icmp slt i32 %sub45, %add.i100
br i1 %cmp46, label %while.body47, label %while.cond.loopexit
while.body47: ; preds = %land.rhs
%indvars.iv.next167 = add nsw i64 %indvars.iv166, 1
%cmp40.not.not = icmp slt i64 %indvars.iv166, %idxprom5
br i1 %cmp40.not.not, label %land.rhs, label %while.end53, !llvm.loop !23
while.end53: ; preds = %while.end, %while.body47
%call54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
br label %cleanup
cleanup: ; preds = %while.end53, %if.then12, %if.then
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
declare i32 @__uflow(ptr noundef) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
|
//情報オリンピック2010予選問4「一年生」
#include<stdio.h>
long long c[21];
int j[100];
int n;
void ck(int);
int main(void){
int f1;
long long out;
scanf("%d",&n);
for(f1 = 0; f1 < n; f1++)
scanf("%d",&j[f1]);
for(f1 = 0; f1 < 21; f1++)
c[f1] = 0;
c[ j[0] ] = 1;
ck(1);
out = c[ j[n-1] ];
printf("%lld\n",out);
return 0;
}
void ck(int cnt){
int fs1, wa, sa;
long long cl2[21];
if(cnt < n-1){
for(fs1 = 0; fs1 < 21; fs1++)
cl2[fs1] = 0;
for(fs1 = 0; fs1 < 21; fs1++){
if(c[fs1] > 0){
wa = fs1 + j[cnt];
sa = fs1 - j[cnt];
if(wa <= 20)
cl2[wa] += c[fs1];
if(sa >= 0)
cl2[sa] += c[fs1];
}
}
for(fs1 = 0; fs1 < 21; fs1++)
c[fs1] = cl2[fs1];
ck(cnt+1);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126356/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126356/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@j = dso_local global [100 x i32] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [21 x i64] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(168) @c, i8 0, i64 168, i1 false), !tbaa !9
%1 = load i32, ptr @j, align 16, !tbaa !5
%idxprom10 = sext i32 %1 to i64
%arrayidx11 = getelementptr inbounds [21 x i64], ptr @c, i64 0, i64 %idxprom10
store i64 1, ptr %arrayidx11, align 8, !tbaa !9
tail call void @ck(i32 noundef 1)
%2 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom12 = sext i32 %sub to i64
%arrayidx13 = getelementptr inbounds [100 x i32], ptr @j, i64 0, i64 %idxprom12
%3 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%idxprom14 = sext i32 %3 to i64
%arrayidx15 = getelementptr inbounds [21 x i64], ptr @c, i64 0, i64 %idxprom14
%4 = load i64, ptr %arrayidx15, align 8, !tbaa !9
%call16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4)
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr @j, 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
%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.cond2.preheader, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @ck(i32 noundef %cnt) local_unnamed_addr #3 {
entry:
%cl2 = alloca [21 x i64], align 16
call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %cl2) #6
%0 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%cmp = icmp sgt i32 %sub, %cnt
br i1 %cmp, label %for.body.preheader, label %if.end44
for.body.preheader: ; preds = %entry
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(168) %cl2, i8 0, i64 168, i1 false), !tbaa !9
%idxprom9 = sext i32 %cnt to i64
%arrayidx10 = getelementptr inbounds [100 x i32], ptr @j, i64 0, i64 %idxprom9
br label %for.body4
for.body4: ; preds = %for.body.preheader, %for.inc30
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc30 ]
%arrayidx6 = getelementptr inbounds [21 x i64], ptr @c, i64 0, i64 %indvars.iv
%1 = load i64, ptr %arrayidx6, align 8, !tbaa !9
%cmp7 = icmp sgt i64 %1, 0
br i1 %cmp7, label %if.then8, label %for.inc30
if.then8: ; preds = %for.body4
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%3 = trunc i64 %indvars.iv to i32
%add = add nsw i32 %2, %3
%sub13 = sub nsw i32 %3, %2
%cmp14 = icmp slt i32 %add, 21
br i1 %cmp14, label %if.then15, label %if.end
if.then15: ; preds = %if.then8
%idxprom18 = sext i32 %add to i64
%arrayidx19 = getelementptr inbounds [21 x i64], ptr %cl2, i64 0, i64 %idxprom18
%4 = load i64, ptr %arrayidx19, align 8, !tbaa !9
%add20 = add nsw i64 %4, %1
store i64 %add20, ptr %arrayidx19, align 8, !tbaa !9
br label %if.end
if.end: ; preds = %if.then15, %if.then8
%cmp21 = icmp sgt i32 %sub13, -1
br i1 %cmp21, label %if.then22, label %for.inc30
if.then22: ; preds = %if.end
%idxprom25 = zext i32 %sub13 to i64
%arrayidx26 = getelementptr inbounds [21 x i64], ptr %cl2, i64 0, i64 %idxprom25
%5 = load i64, ptr %arrayidx26, align 8, !tbaa !9
%add27 = add nsw i64 %5, %1
store i64 %add27, ptr %arrayidx26, align 8, !tbaa !9
br label %for.inc30
for.inc30: ; preds = %for.body4, %if.then22, %if.end
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 21
br i1 %exitcond.not, label %for.body35.preheader, label %for.body4, !llvm.loop !13
for.body35.preheader: ; preds = %for.inc30
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(168) @c, ptr noundef nonnull align 16 dereferenceable(168) %cl2, i64 168, i1 false), !tbaa !9
%add43 = add nsw i32 %cnt, 1
tail call void @ck(i32 noundef %add43)
br label %if.end44
if.end44: ; preds = %for.body35.preheader, %entry
call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %cl2) #6
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 gcd(int x, int y)
{
return (x % y) ? gcd(y, x % y) : y;
}
int gcd3(int a, int b, int c)
{
return gcd(gcd(a, b), c);
}
int main()
{
int k;
int a, b, c;
int sum = 0;
scanf("%d", &k);
for (a = 1; a <= k; a++) {
for (b = 1; b <= k; b++) {
for (c = 1; c <= k; c++) {
sum += gcd3(a, b, c);
}
}
}
printf("%d\n", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126413/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126413/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(none) uwtable
define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%x.tr = phi i32 [ %x, %entry ], [ %y.tr, %tailrecurse ]
%y.tr = phi i32 [ %y, %entry ], [ %rem, %tailrecurse ]
%rem = srem i32 %x.tr, %y.tr
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %cond.end, label %tailrecurse
cond.end: ; preds = %tailrecurse
ret i32 %y.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd3(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %entry
%x.tr.i = phi i32 [ %a, %entry ], [ %y.tr.i, %tailrecurse.i ]
%y.tr.i = phi i32 [ %b, %entry ], [ %rem.i, %tailrecurse.i ]
%rem.i = srem i32 %x.tr.i, %y.tr.i
%tobool.not.i = icmp eq i32 %rem.i, 0
br i1 %tobool.not.i, label %tailrecurse.i2, label %tailrecurse.i
tailrecurse.i2: ; preds = %tailrecurse.i, %tailrecurse.i2
%x.tr.i3 = phi i32 [ %y.tr.i4, %tailrecurse.i2 ], [ %y.tr.i, %tailrecurse.i ]
%y.tr.i4 = phi i32 [ %rem.i5, %tailrecurse.i2 ], [ %c, %tailrecurse.i ]
%rem.i5 = srem i32 %x.tr.i3, %y.tr.i4
%tobool.not.i6 = icmp eq i32 %rem.i5, 0
br i1 %tobool.not.i6, label %gcd.exit7, label %tailrecurse.i2
gcd.exit7: ; preds = %tailrecurse.i2
ret i32 %y.tr.i4
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%k = alloca i32, align 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 %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not29 = icmp slt i32 %0, 1
br i1 %cmp.not29, label %for.end13, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.for.inc11_crit_edge.split
%sum.031 = phi i32 [ %add, %for.cond1.for.inc11_crit_edge.split ], [ 0, %entry ]
%a.030 = phi i32 [ %inc12, %for.cond1.for.inc11_crit_edge.split ], [ 1, %entry ]
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.for.inc8_crit_edge
%sum.127 = phi i32 [ %sum.031, %for.cond1.preheader ], [ %add, %for.cond4.for.inc8_crit_edge ]
%b.026 = phi i32 [ 1, %for.cond1.preheader ], [ %inc9, %for.cond4.for.inc8_crit_edge ]
br label %tailrecurse.i.i.preheader
tailrecurse.i.i.preheader: ; preds = %for.cond4.preheader, %gcd3.exit
%sum.224 = phi i32 [ %sum.127, %for.cond4.preheader ], [ %add, %gcd3.exit ]
%c.023 = phi i32 [ 1, %for.cond4.preheader ], [ %inc, %gcd3.exit ]
br label %tailrecurse.i.i
tailrecurse.i.i: ; preds = %tailrecurse.i.i.preheader, %tailrecurse.i.i
%x.tr.i.i = phi i32 [ %y.tr.i.i, %tailrecurse.i.i ], [ %a.030, %tailrecurse.i.i.preheader ]
%y.tr.i.i = phi i32 [ %rem.i.i, %tailrecurse.i.i ], [ %b.026, %tailrecurse.i.i.preheader ]
%rem.i.i = srem i32 %x.tr.i.i, %y.tr.i.i
%tobool.not.i.i = icmp eq i32 %rem.i.i, 0
br i1 %tobool.not.i.i, label %tailrecurse.i2.i, label %tailrecurse.i.i
tailrecurse.i2.i: ; preds = %tailrecurse.i.i, %tailrecurse.i2.i
%x.tr.i3.i = phi i32 [ %y.tr.i4.i, %tailrecurse.i2.i ], [ %y.tr.i.i, %tailrecurse.i.i ]
%y.tr.i4.i = phi i32 [ %rem.i5.i, %tailrecurse.i2.i ], [ %c.023, %tailrecurse.i.i ]
%rem.i5.i = srem i32 %x.tr.i3.i, %y.tr.i4.i
%tobool.not.i6.i = icmp eq i32 %rem.i5.i, 0
br i1 %tobool.not.i6.i, label %gcd3.exit, label %tailrecurse.i2.i
gcd3.exit: ; preds = %tailrecurse.i2.i
%add = add nsw i32 %y.tr.i4.i, %sum.224
%inc = add nuw i32 %c.023, 1
%exitcond.not = icmp eq i32 %c.023, %0
br i1 %exitcond.not, label %for.cond4.for.inc8_crit_edge, label %tailrecurse.i.i.preheader, !llvm.loop !9
for.cond4.for.inc8_crit_edge: ; preds = %gcd3.exit
%inc9 = add nuw i32 %b.026, 1
%exitcond33.not = icmp eq i32 %b.026, %0
br i1 %exitcond33.not, label %for.cond1.for.inc11_crit_edge.split, label %for.cond4.preheader, !llvm.loop !11
for.cond1.for.inc11_crit_edge.split: ; preds = %for.cond4.for.inc8_crit_edge
%inc12 = add nuw i32 %a.030, 1
%exitcond34.not = icmp eq i32 %a.030, %0
br i1 %exitcond34.not, label %for.end13, label %for.cond1.preheader, !llvm.loop !12
for.end13: ; preds = %for.cond1.for.inc11_crit_edge.split, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.cond1.for.inc11_crit_edge.split ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int gcd(int a,int b){
return b==0?a:gcd(b,a%b);
}
int main()
{
int n;
long long int sum=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
for(int k=1;k<=n;k++)
{
sum+=gcd(gcd(j,k),i);
}
}
}
printf("%lld",sum);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126457/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126457/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %cond.end, label %cond.false
cond.false: ; preds = %entry, %cond.false
%b.tr6 = phi i32 [ %rem, %cond.false ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %cond.false ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %cond.end, label %cond.false
cond.end: ; preds = %cond.false, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %cond.false ]
ret i32 %a.tr.lcssa
}
; 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
%cmp.not38 = icmp slt i32 %0, 1
br i1 %cmp.not38, label %for.cond.cleanup, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.for.cond.cleanup3_crit_edge.split
%i.040 = phi i32 [ %inc15, %for.cond1.for.cond.cleanup3_crit_edge.split ], [ 1, %entry ]
%sum.039 = phi i64 [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ], [ 0, %entry ]
br label %for.cond5.preheader
for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.split, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.cond5.preheader: ; preds = %for.cond1.preheader, %for.cond5.for.cond.cleanup7_crit_edge
%j.036 = phi i32 [ 1, %for.cond1.preheader ], [ %inc12, %for.cond5.for.cond.cleanup7_crit_edge ]
%sum.135 = phi i64 [ %sum.039, %for.cond1.preheader ], [ %add, %for.cond5.for.cond.cleanup7_crit_edge ]
br label %cond.false.i.preheader
for.cond1.for.cond.cleanup3_crit_edge.split: ; preds = %for.cond5.for.cond.cleanup7_crit_edge
%inc15 = add nuw i32 %i.040, 1
%exitcond43.not = icmp eq i32 %i.040, %0
br i1 %exitcond43.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !9
cond.false.i.preheader: ; preds = %for.cond5.preheader, %gcd.exit30
%k.033 = phi i32 [ 1, %for.cond5.preheader ], [ %inc, %gcd.exit30 ]
%sum.232 = phi i64 [ %sum.135, %for.cond5.preheader ], [ %add, %gcd.exit30 ]
br label %cond.false.i
for.cond5.for.cond.cleanup7_crit_edge: ; preds = %gcd.exit30
%inc12 = add nuw i32 %j.036, 1
%exitcond42.not = icmp eq i32 %j.036, %0
br i1 %exitcond42.not, label %for.cond1.for.cond.cleanup3_crit_edge.split, label %for.cond5.preheader, !llvm.loop !11
cond.false.i: ; preds = %cond.false.i.preheader, %cond.false.i
%b.tr6.i = phi i32 [ %rem.i, %cond.false.i ], [ %k.033, %cond.false.i.preheader ]
%a.tr5.i = phi i32 [ %b.tr6.i, %cond.false.i ], [ %j.036, %cond.false.i.preheader ]
%rem.i = srem i32 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %cond.false.i25, label %cond.false.i
cond.false.i25: ; preds = %cond.false.i, %cond.false.i25
%b.tr6.i26 = phi i32 [ %rem.i28, %cond.false.i25 ], [ %i.040, %cond.false.i ]
%a.tr5.i27 = phi i32 [ %b.tr6.i26, %cond.false.i25 ], [ %b.tr6.i, %cond.false.i ]
%rem.i28 = srem i32 %a.tr5.i27, %b.tr6.i26
%cmp.i29 = icmp eq i32 %rem.i28, 0
br i1 %cmp.i29, label %gcd.exit30, label %cond.false.i25
gcd.exit30: ; preds = %cond.false.i25
%conv = sext i32 %b.tr6.i26 to i64
%add = add nsw i64 %sum.232, %conv
%inc = add nuw i32 %k.033, 1
%exitcond.not = icmp eq i32 %k.033, %0
br i1 %exitcond.not, label %for.cond5.for.cond.cleanup7_crit_edge, label %cond.false.i.preheader, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int arr1[1200],arr2[1200];
int main(void) {
int n,s,flag = 1;
scanf("%d%d",&n,&s);
// 1 base indexing
for(int i = 1; i <= n; i++){
scanf("%d",&arr1[i]);
}
for(int i = 1; i <= n; i++){
scanf("%d",&arr2[i]);
}
if((arr1[s] == 0 && arr2[s] == 0) || arr1[1] == 0){
printf("NO\n");
return 0;
}
if(arr1[s] == 1){
printf("YES\n");
return 0;
}
for(int i = s; i <= n; i++){
if(arr1[i] + arr2[i] == 2){
printf("YES\n");
flag = 1;
return 0;
}
else{
flag = 0;
}
}
if(flag == 0){
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12650/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12650/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@arr1 = dso_local global [1200 x i32] zeroinitializer, align 16
@arr2 = dso_local global [1200 x i32] zeroinitializer, align 16
@str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.6 = 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
%s = 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 %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not65 = icmp slt i32 %0, 1
br i1 %cmp.not65, label %for.cond.cleanup5, label %for.body
for.cond3.preheader: ; preds = %for.body
%cmp4.not67 = icmp slt i32 %1, 1
br i1 %cmp4.not67, label %for.cond.cleanup5, label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [1200 x i32], ptr @arr1, 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.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.body6, %entry, %for.cond3.preheader
%.lcssa = phi i32 [ %1, %for.cond3.preheader ], [ %0, %entry ], [ %5, %for.body6 ]
%3 = load i32, ptr %s, align 4, !tbaa !5
%idxprom13 = sext i32 %3 to i64
%arrayidx14 = getelementptr inbounds [1200 x i32], ptr @arr1, i64 0, i64 %idxprom13
%4 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cmp15 = icmp eq i32 %4, 0
br i1 %cmp15, label %land.lhs.true, label %lor.lhs.false
for.body6: ; preds = %for.cond3.preheader, %for.body6
%indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body6 ], [ 1, %for.cond3.preheader ]
%arrayidx8 = getelementptr inbounds [1200 x i32], ptr @arr2, i64 0, i64 %indvars.iv74
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8)
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp4.not.not = icmp slt i64 %indvars.iv74, %6
br i1 %cmp4.not.not, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11
land.lhs.true: ; preds = %for.cond.cleanup5
%arrayidx17 = getelementptr inbounds [1200 x i32], ptr @arr2, i64 0, i64 %idxprom13
%7 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp eq i32 %7, 0
%8 = load i32, ptr getelementptr inbounds ([1200 x i32], ptr @arr1, i64 0, i64 1), align 4
%cmp19 = icmp eq i32 %8, 0
%or.cond = select i1 %cmp18, i1 true, i1 %cmp19
br i1 %or.cond, label %cleanup47.sink.split, label %for.cond28.preheader
lor.lhs.false: ; preds = %for.cond.cleanup5
%.old = load i32, ptr getelementptr inbounds ([1200 x i32], ptr @arr1, i64 0, i64 1), align 4, !tbaa !5
%cmp19.old = icmp eq i32 %.old, 0
br i1 %cmp19.old, label %cleanup47.sink.split, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp23 = icmp eq i32 %4, 1
br i1 %cmp23, label %cleanup47.sink.split, label %for.cond28.preheader
for.cond28.preheader: ; preds = %land.lhs.true, %if.end
%cmp29.not69.not = icmp sgt i32 %3, %.lcssa
br i1 %cmp29.not69.not, label %cleanup47, label %for.body31.preheader
for.body31.preheader: ; preds = %for.cond28.preheader
%9 = add i32 %.lcssa, 1
br label %for.body31
for.cond28: ; preds = %for.body31
%indvars.iv.next78 = add nsw i64 %indvars.iv77, 1
%lftr.wideiv = trunc i64 %indvars.iv.next78 to i32
%exitcond.not = icmp eq i32 %9, %lftr.wideiv
br i1 %exitcond.not, label %cleanup, label %for.body31, !llvm.loop !12
for.body31: ; preds = %for.body31.preheader, %for.cond28
%indvars.iv77 = phi i64 [ %idxprom13, %for.body31.preheader ], [ %indvars.iv.next78, %for.cond28 ]
%arrayidx33 = getelementptr inbounds [1200 x i32], ptr @arr1, i64 0, i64 %indvars.iv77
%10 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%arrayidx35 = getelementptr inbounds [1200 x i32], ptr @arr2, i64 0, i64 %indvars.iv77
%11 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%add = add nsw i32 %11, %10
%cmp36 = icmp eq i32 %add, 2
br i1 %cmp36, label %cleanup47.sink.split, label %for.cond28
cleanup: ; preds = %for.cond28
br i1 %cmp29.not69.not, label %cleanup47, label %cleanup47.sink.split
cleanup47.sink.split: ; preds = %for.body31, %cleanup, %if.end, %land.lhs.true, %lor.lhs.false
%str.sink = phi ptr [ @str.6, %lor.lhs.false ], [ @str.6, %land.lhs.true ], [ @str.5, %if.end ], [ @str.6, %cleanup ], [ @str.5, %for.body31 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
br label %cleanup47
cleanup47: ; preds = %cleanup47.sink.split, %for.cond28.preheader, %cleanup
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdlib.h>
long long GCD(long long x, long long y) {
if (y == 0) return x;
else return GCD(y, x % y);
}
int main() {
int K;
scanf("%d",&K);
long long res = 0;
for (int a = 1; a <= K; ++a) {
for (int b = 1; b <= K; ++b) {
for (int c = 1; c <= K; ++c) {
res += GCD(GCD(a, b), c);
}
}
}
printf("%d",res);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126558/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126558/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @GCD(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i64 %y, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%y.tr6 = phi i64 [ %rem, %if.else ], [ %y, %entry ]
%x.tr5 = phi i64 [ %y.tr6, %if.else ], [ %x, %entry ]
%rem = srem i64 %x.tr5, %y.tr6
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%x.tr.lcssa = phi i64 [ %x, %entry ], [ %y.tr6, %if.else ]
ret i64 %x.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%K = alloca i32, align 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 %K)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp.not40 = icmp slt i32 %0, 1
br i1 %cmp.not40, label %for.cond.cleanup, label %for.cond1.preheader.preheader
for.cond1.preheader.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%wide.trip.count53 = zext i32 %1 to i64
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond1.for.cond.cleanup3_crit_edge.split
%indvars.iv50 = phi i64 [ 1, %for.cond1.preheader.preheader ], [ %indvars.iv.next51, %for.cond1.for.cond.cleanup3_crit_edge.split ]
%res.041 = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ]
br label %for.cond5.preheader
for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.split, %entry
%res.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %res.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
ret i32 0
for.cond5.preheader: ; preds = %for.cond1.preheader, %for.cond5.for.cond.cleanup7_crit_edge
%indvars.iv45 = phi i64 [ 1, %for.cond1.preheader ], [ %indvars.iv.next46, %for.cond5.for.cond.cleanup7_crit_edge ]
%res.137 = phi i64 [ %res.041, %for.cond1.preheader ], [ %add, %for.cond5.for.cond.cleanup7_crit_edge ]
br label %for.body8
for.cond1.for.cond.cleanup3_crit_edge.split: ; preds = %for.cond5.for.cond.cleanup7_crit_edge
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond54.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count53
br i1 %exitcond54.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !9
for.cond5.for.cond.cleanup7_crit_edge: ; preds = %GCD.exit32
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%exitcond49.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count53
br i1 %exitcond49.not, label %for.cond1.for.cond.cleanup3_crit_edge.split, label %for.cond5.preheader, !llvm.loop !11
for.body8: ; preds = %for.cond5.preheader, %GCD.exit32
%indvars.iv = phi i64 [ 1, %for.cond5.preheader ], [ %indvars.iv.next, %GCD.exit32 ]
%res.234 = phi i64 [ %res.137, %for.cond5.preheader ], [ %add, %GCD.exit32 ]
br label %if.else.i
if.else.i: ; preds = %if.else.i, %for.body8
%y.tr6.i = phi i64 [ %rem.i, %if.else.i ], [ %indvars.iv45, %for.body8 ]
%x.tr5.i = phi i64 [ %y.tr6.i, %if.else.i ], [ %indvars.iv50, %for.body8 ]
%rem.i = srem i64 %x.tr5.i, %y.tr6.i
%cmp.i = icmp eq i64 %rem.i, 0
br i1 %cmp.i, label %if.else.i27, label %if.else.i
if.else.i27: ; preds = %if.else.i, %if.else.i27
%y.tr6.i28 = phi i64 [ %rem.i30, %if.else.i27 ], [ %indvars.iv, %if.else.i ]
%x.tr5.i29 = phi i64 [ %y.tr6.i28, %if.else.i27 ], [ %y.tr6.i, %if.else.i ]
%rem.i30 = srem i64 %x.tr5.i29, %y.tr6.i28
%cmp.i31 = icmp eq i64 %rem.i30, 0
br i1 %cmp.i31, label %GCD.exit32, label %if.else.i27
GCD.exit32: ; preds = %if.else.i27
%add = add nsw i64 %y.tr6.i28, %res.234
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count53
br i1 %exitcond.not, label %for.cond5.for.cond.cleanup7_crit_edge, label %for.body8, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
/*
* main.c
*
* Created on: 2020/03/28
* Author: family
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a > b ? b : a)
typedef long long int ll;
typedef unsigned long long int ull;
int sort_inc(const void *a, const void *b) { return (*(int*)a - *(int*)b);}
int sort_dec(const void* a, const void* b) { return (*(int*)b - *(int*)a);}
int sort_dec_ll(const void *a, const void *b) {
ll da = *(ll*)a, db = *(ll*)b; int val = 0;
if(da > db) { val = -1; }
else if (da == db) { val = 0; }
else { val = 1; }
return val;
}
int sort_inc_ll(const void *a, const void *b) {
ll da = *(ll*)a, db = *(ll*)b; int val = 0;
if(da > db) { val = 1; }
else if (da == db) { val = 0; }
else { val = -1; }
return val;
}
int sort_dic(const void *a, const void *b) {
char *pa = (char *)a; char *pb = (char *)b; int i = 0, val = 0, N = 10;
for (i = 0; i < N; i++) {
char da = pa[i], db = pb[i];
if (da == db) continue;
if (da > db) val = 1; else val = -1;
break;
}
return val;
}
ll mygcd(ll a, ll b)
{
ll tmp = 0;
if(a >= b) {
} else {
return mygcd(b,a);
}
while((tmp = a%b)) {
a = b;
b = tmp;
}
return b;
}
ll val[201][201] = {0};
ll val2[201][201] = {0};
int main()
{
ll K = 0, i = 0, j = 0, k = 0, ans = 0;
scanf("%lld", &K);
memset(val, 0, sizeof(val));
memset(val, 0, sizeof(val2));
for (i = 1; i <= K; i++) {
for (j = 1; j <= K; j++) {
for (k = 1; k <= K; k++) {
ll tmp = 0;
if (val[i][j] == 0) {
tmp = mygcd(i, j);
val[i][j] = tmp;
val[j][i] = tmp;
} else {
tmp = val[i][j];
}
if (val2[k][tmp] == 0) {
ll tmp2 = 0;
tmp2 = mygcd(k, tmp);
ans += tmp2;
val[k][tmp2] = tmp2;
val[tmp2][k] = tmp2;
} else {
ans += val[k][tmp];
}
}
}
}
printf("%lld\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126608/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126608/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@val = dso_local local_unnamed_addr global [201 x [201 x i64]] zeroinitializer, align 16
@val2 = dso_local local_unnamed_addr global [201 x [201 x i64]] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_inc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_dec(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_dec_ll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = zext i1 %cmp1 to i32
%val.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %val.0
}
; 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 @sort_inc_ll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%val.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %val.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_dic(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !11
%1 = load i8, ptr %b, align 1, !tbaa !11
%cmp4 = icmp eq i8 %0, %1
br i1 %cmp4, label %for.cond, label %for.end.split.loop.exit
for.cond: ; preds = %entry
%arrayidx.1 = getelementptr inbounds i8, ptr %a, i64 1
%2 = load i8, ptr %arrayidx.1, align 1, !tbaa !11
%arrayidx2.1 = getelementptr inbounds i8, ptr %b, i64 1
%3 = load i8, ptr %arrayidx2.1, align 1, !tbaa !11
%cmp4.1 = icmp eq i8 %2, %3
br i1 %cmp4.1, label %for.cond.1, label %for.end.split.loop.exit
for.cond.1: ; preds = %for.cond
%arrayidx.2 = getelementptr inbounds i8, ptr %a, i64 2
%4 = load i8, ptr %arrayidx.2, align 1, !tbaa !11
%arrayidx2.2 = getelementptr inbounds i8, ptr %b, i64 2
%5 = load i8, ptr %arrayidx2.2, align 1, !tbaa !11
%cmp4.2 = icmp eq i8 %4, %5
br i1 %cmp4.2, label %for.cond.2, label %for.end.split.loop.exit
for.cond.2: ; preds = %for.cond.1
%arrayidx.3 = getelementptr inbounds i8, ptr %a, i64 3
%6 = load i8, ptr %arrayidx.3, align 1, !tbaa !11
%arrayidx2.3 = getelementptr inbounds i8, ptr %b, i64 3
%7 = load i8, ptr %arrayidx2.3, align 1, !tbaa !11
%cmp4.3 = icmp eq i8 %6, %7
br i1 %cmp4.3, label %for.cond.3, label %for.end.split.loop.exit
for.cond.3: ; preds = %for.cond.2
%arrayidx.4 = getelementptr inbounds i8, ptr %a, i64 4
%8 = load i8, ptr %arrayidx.4, align 1, !tbaa !11
%arrayidx2.4 = getelementptr inbounds i8, ptr %b, i64 4
%9 = load i8, ptr %arrayidx2.4, align 1, !tbaa !11
%cmp4.4 = icmp eq i8 %8, %9
br i1 %cmp4.4, label %for.cond.4, label %for.end.split.loop.exit
for.cond.4: ; preds = %for.cond.3
%arrayidx.5 = getelementptr inbounds i8, ptr %a, i64 5
%10 = load i8, ptr %arrayidx.5, align 1, !tbaa !11
%arrayidx2.5 = getelementptr inbounds i8, ptr %b, i64 5
%11 = load i8, ptr %arrayidx2.5, align 1, !tbaa !11
%cmp4.5 = icmp eq i8 %10, %11
br i1 %cmp4.5, label %for.cond.5, label %for.end.split.loop.exit
for.cond.5: ; preds = %for.cond.4
%arrayidx.6 = getelementptr inbounds i8, ptr %a, i64 6
%12 = load i8, ptr %arrayidx.6, align 1, !tbaa !11
%arrayidx2.6 = getelementptr inbounds i8, ptr %b, i64 6
%13 = load i8, ptr %arrayidx2.6, align 1, !tbaa !11
%cmp4.6 = icmp eq i8 %12, %13
br i1 %cmp4.6, label %for.cond.6, label %for.end.split.loop.exit
for.cond.6: ; preds = %for.cond.5
%arrayidx.7 = getelementptr inbounds i8, ptr %a, i64 7
%14 = load i8, ptr %arrayidx.7, align 1, !tbaa !11
%arrayidx2.7 = getelementptr inbounds i8, ptr %b, i64 7
%15 = load i8, ptr %arrayidx2.7, align 1, !tbaa !11
%cmp4.7 = icmp eq i8 %14, %15
br i1 %cmp4.7, label %for.cond.7, label %for.end.split.loop.exit
for.cond.7: ; preds = %for.cond.6
%arrayidx.8 = getelementptr inbounds i8, ptr %a, i64 8
%16 = load i8, ptr %arrayidx.8, align 1, !tbaa !11
%arrayidx2.8 = getelementptr inbounds i8, ptr %b, i64 8
%17 = load i8, ptr %arrayidx2.8, align 1, !tbaa !11
%cmp4.8 = icmp eq i8 %16, %17
br i1 %cmp4.8, label %for.cond.8, label %for.end.split.loop.exit
for.cond.8: ; preds = %for.cond.7
%arrayidx.9 = getelementptr inbounds i8, ptr %a, i64 9
%18 = load i8, ptr %arrayidx.9, align 1, !tbaa !11
%arrayidx2.9 = getelementptr inbounds i8, ptr %b, i64 9
%19 = load i8, ptr %arrayidx2.9, align 1, !tbaa !11
%cmp4.9 = icmp eq i8 %18, %19
br i1 %cmp4.9, label %for.end, label %for.end.split.loop.exit
for.end.split.loop.exit: ; preds = %for.cond.8, %for.cond.7, %for.cond.6, %for.cond.5, %for.cond.4, %for.cond.3, %for.cond.2, %for.cond.1, %for.cond, %entry
%.lcssa28 = phi i8 [ %0, %entry ], [ %2, %for.cond ], [ %4, %for.cond.1 ], [ %6, %for.cond.2 ], [ %8, %for.cond.3 ], [ %10, %for.cond.4 ], [ %12, %for.cond.5 ], [ %14, %for.cond.6 ], [ %16, %for.cond.7 ], [ %18, %for.cond.8 ]
%.lcssa = phi i8 [ %1, %entry ], [ %3, %for.cond ], [ %5, %for.cond.1 ], [ %7, %for.cond.2 ], [ %9, %for.cond.3 ], [ %11, %for.cond.4 ], [ %13, %for.cond.5 ], [ %15, %for.cond.6 ], [ %17, %for.cond.7 ], [ %19, %for.cond.8 ]
%cmp8.le = icmp sgt i8 %.lcssa28, %.lcssa
%..le = select i1 %cmp8.le, i32 1, i32 -1
br label %for.end
for.end: ; preds = %for.cond.8, %for.end.split.loop.exit
%val.3 = phi i32 [ %..le, %for.end.split.loop.exit ], [ 0, %for.cond.8 ]
ret i32 %val.3
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @mygcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i64 [ %a, %entry ], [ %b.tr, %tailrecurse ]
%b.tr = phi i64 [ %b, %entry ], [ %a.tr, %tailrecurse ]
%cmp.not = icmp slt i64 %a.tr, %b.tr
br i1 %cmp.not, label %tailrecurse, label %while.cond
while.cond: ; preds = %tailrecurse, %while.cond
%a.addr.0 = phi i64 [ %b.addr.0, %while.cond ], [ %a.tr, %tailrecurse ]
%b.addr.0 = phi i64 [ %rem, %while.cond ], [ %b.tr, %tailrecurse ]
%rem = srem i64 %a.addr.0, %b.addr.0
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cleanup, label %while.cond, !llvm.loop !12
cleanup: ; preds = %while.cond
ret i64 %b.addr.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%K = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %K) #6
store i64 0, ptr %K, align 8, !tbaa !9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(323208) @val, i8 0, i64 323208, i1 false)
%0 = load i64, ptr %K, align 8, !tbaa !9
%cmp.not82 = icmp slt i64 %0, 1
br i1 %cmp.not82, label %for.end35, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.for.inc33_crit_edge.split
%i.084 = phi i64 [ %inc34, %for.cond1.for.inc33_crit_edge.split ], [ 1, %entry ]
%ans.083 = phi i64 [ %ans.3, %for.cond1.for.inc33_crit_edge.split ], [ 0, %entry ]
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.for.inc30_crit_edge
%ans.180 = phi i64 [ %ans.083, %for.cond1.preheader ], [ %ans.3, %for.cond4.for.inc30_crit_edge ]
%j.079 = phi i64 [ 1, %for.cond1.preheader ], [ %inc31, %for.cond4.for.inc30_crit_edge ]
%arrayidx7 = getelementptr inbounds [201 x [201 x i64]], ptr @val, i64 0, i64 %i.084, i64 %j.079
%arrayidx13 = getelementptr inbounds [201 x [201 x i64]], ptr @val, i64 0, i64 %j.079, i64 %i.084
br label %for.body6
for.body6: ; preds = %for.cond4.preheader, %if.end29
%ans.277 = phi i64 [ %ans.180, %for.cond4.preheader ], [ %ans.3, %if.end29 ]
%k.076 = phi i64 [ 1, %for.cond4.preheader ], [ %inc, %if.end29 ]
%1 = load i64, ptr %arrayidx7, align 8, !tbaa !9
%cmp8 = icmp eq i64 %1, 0
br i1 %cmp8, label %tailrecurse.i, label %if.end
tailrecurse.i: ; preds = %for.body6, %tailrecurse.i
%a.tr.i = phi i64 [ %b.tr.i, %tailrecurse.i ], [ %i.084, %for.body6 ]
%b.tr.i = phi i64 [ %a.tr.i, %tailrecurse.i ], [ %j.079, %for.body6 ]
%cmp.not.i = icmp slt i64 %a.tr.i, %b.tr.i
br i1 %cmp.not.i, label %tailrecurse.i, label %while.cond.i
while.cond.i: ; preds = %tailrecurse.i, %while.cond.i
%a.addr.0.i = phi i64 [ %b.addr.0.i, %while.cond.i ], [ %a.tr.i, %tailrecurse.i ]
%b.addr.0.i = phi i64 [ %rem.i, %while.cond.i ], [ %b.tr.i, %tailrecurse.i ]
%rem.i = srem i64 %a.addr.0.i, %b.addr.0.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %mygcd.exit, label %while.cond.i, !llvm.loop !12
mygcd.exit: ; preds = %while.cond.i
store i64 %b.addr.0.i, ptr %arrayidx7, align 8, !tbaa !9
store i64 %b.addr.0.i, ptr %arrayidx13, align 8, !tbaa !9
br label %if.end
if.end: ; preds = %for.body6, %mygcd.exit
%tmp.0 = phi i64 [ %b.addr.0.i, %mygcd.exit ], [ %1, %for.body6 ]
%arrayidx17 = getelementptr inbounds [201 x [201 x i64]], ptr @val2, i64 0, i64 %k.076, i64 %tmp.0
%2 = load i64, ptr %arrayidx17, align 8, !tbaa !9
%cmp18 = icmp eq i64 %2, 0
br i1 %cmp18, label %tailrecurse.i65, label %if.else25
tailrecurse.i65: ; preds = %if.end, %tailrecurse.i65
%a.tr.i66 = phi i64 [ %b.tr.i67, %tailrecurse.i65 ], [ %k.076, %if.end ]
%b.tr.i67 = phi i64 [ %a.tr.i66, %tailrecurse.i65 ], [ %tmp.0, %if.end ]
%cmp.not.i68 = icmp slt i64 %a.tr.i66, %b.tr.i67
br i1 %cmp.not.i68, label %tailrecurse.i65, label %while.cond.i69
while.cond.i69: ; preds = %tailrecurse.i65, %while.cond.i69
%a.addr.0.i70 = phi i64 [ %b.addr.0.i71, %while.cond.i69 ], [ %a.tr.i66, %tailrecurse.i65 ]
%b.addr.0.i71 = phi i64 [ %rem.i72, %while.cond.i69 ], [ %b.tr.i67, %tailrecurse.i65 ]
%rem.i72 = srem i64 %a.addr.0.i70, %b.addr.0.i71
%tobool.not.i73 = icmp eq i64 %rem.i72, 0
br i1 %tobool.not.i73, label %mygcd.exit74, label %while.cond.i69, !llvm.loop !12
mygcd.exit74: ; preds = %while.cond.i69
%arrayidx22 = getelementptr inbounds [201 x [201 x i64]], ptr @val, i64 0, i64 %k.076, i64 %b.addr.0.i71
store i64 %b.addr.0.i71, ptr %arrayidx22, align 8, !tbaa !9
%arrayidx24 = getelementptr inbounds [201 x [201 x i64]], ptr @val, i64 0, i64 %b.addr.0.i71, i64 %k.076
store i64 %b.addr.0.i71, ptr %arrayidx24, align 8, !tbaa !9
br label %if.end29
if.else25: ; preds = %if.end
%arrayidx27 = getelementptr inbounds [201 x [201 x i64]], ptr @val, i64 0, i64 %k.076, i64 %tmp.0
%3 = load i64, ptr %arrayidx27, align 8, !tbaa !9
br label %if.end29
if.end29: ; preds = %if.else25, %mygcd.exit74
%call20.pn = phi i64 [ %b.addr.0.i71, %mygcd.exit74 ], [ %3, %if.else25 ]
%ans.3 = add nsw i64 %call20.pn, %ans.277
%inc = add nuw i64 %k.076, 1
%exitcond.not = icmp eq i64 %k.076, %0
br i1 %exitcond.not, label %for.cond4.for.inc30_crit_edge, label %for.body6, !llvm.loop !14
for.cond4.for.inc30_crit_edge: ; preds = %if.end29
%inc31 = add nuw i64 %j.079, 1
%exitcond86.not = icmp eq i64 %j.079, %0
br i1 %exitcond86.not, label %for.cond1.for.inc33_crit_edge.split, label %for.cond4.preheader, !llvm.loop !15
for.cond1.for.inc33_crit_edge.split: ; preds = %for.cond4.for.inc30_crit_edge
%inc34 = add nuw i64 %i.084, 1
%exitcond87.not = icmp eq i64 %i.084, %0
br i1 %exitcond87.not, label %for.end35, label %for.cond1.preheader, !llvm.loop !16
for.end35: ; preds = %for.cond1.for.inc33_crit_edge.split, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.3, %for.cond1.for.inc33_crit_edge.split ]
%call36 = 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 %K) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
|
#include <stdio.h>
#include <math.h>
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
int gcd3(int x, int y, int z) {
int v = gcd(x,y);
return gcd(v, z);
}
int main() {
int n;
int sum = 0;
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
/* code */
for (int j = 1; j <= n; j++) {
/* code */
for (int k = 1; k <= n; k++) {
/* code */
sum += gcd3(i,j,k);
}
}
}
printf("%d\n", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126651/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126651/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(none) uwtable
define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%x.tr = phi i32 [ %x, %entry ], [ %y.tr, %tailrecurse ]
%y.tr = phi i32 [ %y, %entry ], [ %rem, %tailrecurse ]
%rem = srem i32 %x.tr, %y.tr
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %cond.end, label %tailrecurse
cond.end: ; preds = %tailrecurse
ret i32 %y.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd3(i32 noundef %x, i32 noundef %y, i32 noundef %z) local_unnamed_addr #0 {
entry:
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %entry
%x.tr.i = phi i32 [ %x, %entry ], [ %y.tr.i, %tailrecurse.i ]
%y.tr.i = phi i32 [ %y, %entry ], [ %rem.i, %tailrecurse.i ]
%rem.i = srem i32 %x.tr.i, %y.tr.i
%tobool.not.i = icmp eq i32 %rem.i, 0
br i1 %tobool.not.i, label %tailrecurse.i2, label %tailrecurse.i
tailrecurse.i2: ; preds = %tailrecurse.i, %tailrecurse.i2
%x.tr.i3 = phi i32 [ %y.tr.i4, %tailrecurse.i2 ], [ %y.tr.i, %tailrecurse.i ]
%y.tr.i4 = phi i32 [ %rem.i5, %tailrecurse.i2 ], [ %z, %tailrecurse.i ]
%rem.i5 = srem i32 %x.tr.i3, %y.tr.i4
%tobool.not.i6 = icmp eq i32 %rem.i5, 0
br i1 %tobool.not.i6, label %gcd.exit7, label %tailrecurse.i2
gcd.exit7: ; preds = %tailrecurse.i2
ret i32 %y.tr.i4
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not31 = icmp slt i32 %0, 1
br i1 %cmp.not31, label %for.cond.cleanup, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.for.cond.cleanup3_crit_edge.split
%i.033 = phi i32 [ %inc14, %for.cond1.for.cond.cleanup3_crit_edge.split ], [ 1, %entry ]
%sum.032 = phi i32 [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ], [ 0, %entry ]
br label %for.cond5.preheader
for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.split, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ]
%call16 = 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 %n) #4
ret i32 0
for.cond5.preheader: ; preds = %for.cond1.preheader, %for.cond5.for.cond.cleanup7_crit_edge
%j.029 = phi i32 [ 1, %for.cond1.preheader ], [ %inc11, %for.cond5.for.cond.cleanup7_crit_edge ]
%sum.128 = phi i32 [ %sum.032, %for.cond1.preheader ], [ %add, %for.cond5.for.cond.cleanup7_crit_edge ]
br label %tailrecurse.i.i.preheader
for.cond1.for.cond.cleanup3_crit_edge.split: ; preds = %for.cond5.for.cond.cleanup7_crit_edge
%inc14 = add nuw i32 %i.033, 1
%exitcond36.not = icmp eq i32 %i.033, %0
br i1 %exitcond36.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !9
tailrecurse.i.i.preheader: ; preds = %for.cond5.preheader, %gcd3.exit
%k.026 = phi i32 [ 1, %for.cond5.preheader ], [ %inc, %gcd3.exit ]
%sum.225 = phi i32 [ %sum.128, %for.cond5.preheader ], [ %add, %gcd3.exit ]
br label %tailrecurse.i.i
for.cond5.for.cond.cleanup7_crit_edge: ; preds = %gcd3.exit
%inc11 = add nuw i32 %j.029, 1
%exitcond35.not = icmp eq i32 %j.029, %0
br i1 %exitcond35.not, label %for.cond1.for.cond.cleanup3_crit_edge.split, label %for.cond5.preheader, !llvm.loop !11
tailrecurse.i.i: ; preds = %tailrecurse.i.i.preheader, %tailrecurse.i.i
%x.tr.i.i = phi i32 [ %y.tr.i.i, %tailrecurse.i.i ], [ %i.033, %tailrecurse.i.i.preheader ]
%y.tr.i.i = phi i32 [ %rem.i.i, %tailrecurse.i.i ], [ %j.029, %tailrecurse.i.i.preheader ]
%rem.i.i = srem i32 %x.tr.i.i, %y.tr.i.i
%tobool.not.i.i = icmp eq i32 %rem.i.i, 0
br i1 %tobool.not.i.i, label %tailrecurse.i2.i, label %tailrecurse.i.i
tailrecurse.i2.i: ; preds = %tailrecurse.i.i, %tailrecurse.i2.i
%x.tr.i3.i = phi i32 [ %y.tr.i4.i, %tailrecurse.i2.i ], [ %y.tr.i.i, %tailrecurse.i.i ]
%y.tr.i4.i = phi i32 [ %rem.i5.i, %tailrecurse.i2.i ], [ %k.026, %tailrecurse.i.i ]
%rem.i5.i = srem i32 %x.tr.i3.i, %y.tr.i4.i
%tobool.not.i6.i = icmp eq i32 %rem.i5.i, 0
br i1 %tobool.not.i6.i, label %gcd3.exit, label %tailrecurse.i2.i
gcd3.exit: ; preds = %tailrecurse.i2.i
%add = add nsw i32 %y.tr.i4.i, %sum.225
%inc = add nuw i32 %k.026, 1
%exitcond.not = icmp eq i32 %k.026, %0
br i1 %exitcond.not, label %for.cond5.for.cond.cleanup7_crit_edge, label %tailrecurse.i.i.preheader, !llvm.loop !12
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef long long ll;
int gcd(int n1,int n2)
{
int keep,r;
if(n1<n2)
{
keep=n1;
n1=n2;
n2=keep;
}
if(n2==1)
{
return 1;
}
else
{
r=n1%n2;
while(r!=0)
{
n1=n2;
n2=r;
r=n1%n2;
}
return n2;
}
}
int main()
{
int k;
ll ans=0;
scanf("%d",&k);
for(int a=1;a<k+1;a++)
{
for(int b=1;b<k+1;b++)
{
for(int c=1;c<k+1;c++)
{
ans=ans+gcd(a,gcd(b,c));
}
}
}
printf("%lld\n",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126695/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126695/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %n1, i32 noundef %n2) local_unnamed_addr #0 {
entry:
%spec.select16 = tail call i32 @llvm.smin.i32(i32 %n1, i32 %n2)
%cmp1 = icmp eq i32 %spec.select16, 1
br i1 %cmp1, label %cleanup, label %if.else
if.else: ; preds = %entry
%spec.select = tail call i32 @llvm.smax.i32(i32 %n1, i32 %n2)
%rem = srem i32 %spec.select, %spec.select16
%cmp3.not17 = icmp eq i32 %rem, 0
br i1 %cmp3.not17, label %cleanup, label %while.body
while.body: ; preds = %if.else, %while.body
%r.019 = phi i32 [ %rem4, %while.body ], [ %rem, %if.else ]
%n2.addr.118 = phi i32 [ %r.019, %while.body ], [ %spec.select16, %if.else ]
%rem4 = srem i32 %n2.addr.118, %r.019
%cmp3.not = icmp eq i32 %rem4, 0
br i1 %cmp3.not, label %cleanup, label %while.body, !llvm.loop !5
cleanup: ; preds = %while.body, %if.else, %entry
%retval.0 = phi i32 [ 1, %entry ], [ %spec.select16, %if.else ], [ %r.019, %while.body ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !7
%cmp.not48 = icmp slt i32 %0, 1
br i1 %cmp.not48, label %for.cond.cleanup, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.for.cond.cleanup4_crit_edge.split
%a.050 = phi i32 [ %inc18, %for.cond1.for.cond.cleanup4_crit_edge.split ], [ 1, %entry ]
%ans.049 = phi i64 [ %add13, %for.cond1.for.cond.cleanup4_crit_edge.split ], [ 0, %entry ]
br label %for.cond6.preheader
for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup4_crit_edge.split, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %add13, %for.cond1.for.cond.cleanup4_crit_edge.split ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
ret i32 0
for.cond6.preheader: ; preds = %for.cond1.preheader, %for.cond6.for.cond.cleanup9_crit_edge
%b.046 = phi i32 [ 1, %for.cond1.preheader ], [ %inc15, %for.cond6.for.cond.cleanup9_crit_edge ]
%ans.145 = phi i64 [ %ans.049, %for.cond1.preheader ], [ %add13, %for.cond6.for.cond.cleanup9_crit_edge ]
br label %for.body10
for.cond1.for.cond.cleanup4_crit_edge.split: ; preds = %for.cond6.for.cond.cleanup9_crit_edge
%inc18 = add nuw i32 %a.050, 1
%exitcond53.not = icmp eq i32 %a.050, %0
br i1 %exitcond53.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !11
for.cond6.for.cond.cleanup9_crit_edge: ; preds = %gcd.exit40
%inc15 = add nuw i32 %b.046, 1
%exitcond52.not = icmp eq i32 %b.046, %0
br i1 %exitcond52.not, label %for.cond1.for.cond.cleanup4_crit_edge.split, label %for.cond6.preheader, !llvm.loop !12
for.body10: ; preds = %for.cond6.preheader, %gcd.exit40
%c.043 = phi i32 [ 1, %for.cond6.preheader ], [ %inc, %gcd.exit40 ]
%ans.242 = phi i64 [ %ans.145, %for.cond6.preheader ], [ %add13, %gcd.exit40 ]
%spec.select16.i = call i32 @llvm.smin.i32(i32 %b.046, i32 %c.043)
%cmp1.i = icmp eq i32 %spec.select16.i, 1
br i1 %cmp1.i, label %gcd.exit, label %if.else.i
if.else.i: ; preds = %for.body10
%spec.select.i = call i32 @llvm.smax.i32(i32 %b.046, i32 %c.043)
%rem.i = urem i32 %spec.select.i, %spec.select16.i
%cmp3.not17.i = icmp eq i32 %rem.i, 0
br i1 %cmp3.not17.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %if.else.i, %while.body.i
%r.019.i = phi i32 [ %rem4.i, %while.body.i ], [ %rem.i, %if.else.i ]
%n2.addr.118.i = phi i32 [ %r.019.i, %while.body.i ], [ %spec.select16.i, %if.else.i ]
%rem4.i = srem i32 %n2.addr.118.i, %r.019.i
%cmp3.not.i = icmp eq i32 %rem4.i, 0
br i1 %cmp3.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %for.body10, %if.else.i
%retval.0.i = phi i32 [ 1, %for.body10 ], [ %spec.select16.i, %if.else.i ], [ %r.019.i, %while.body.i ]
%spec.select16.i28 = call i32 @llvm.smin.i32(i32 %a.050, i32 %retval.0.i)
%cmp1.i29 = icmp eq i32 %spec.select16.i28, 1
br i1 %cmp1.i29, label %gcd.exit40, label %if.else.i30
if.else.i30: ; preds = %gcd.exit
%spec.select.i31 = call i32 @llvm.smax.i32(i32 %a.050, i32 %retval.0.i)
%rem.i32 = srem i32 %spec.select.i31, %spec.select16.i28
%cmp3.not17.i33 = icmp eq i32 %rem.i32, 0
br i1 %cmp3.not17.i33, label %gcd.exit40, label %while.body.i34
while.body.i34: ; preds = %if.else.i30, %while.body.i34
%r.019.i35 = phi i32 [ %rem4.i37, %while.body.i34 ], [ %rem.i32, %if.else.i30 ]
%n2.addr.118.i36 = phi i32 [ %r.019.i35, %while.body.i34 ], [ %spec.select16.i28, %if.else.i30 ]
%rem4.i37 = srem i32 %n2.addr.118.i36, %r.019.i35
%cmp3.not.i38 = icmp eq i32 %rem4.i37, 0
br i1 %cmp3.not.i38, label %gcd.exit40, label %while.body.i34, !llvm.loop !5
gcd.exit40: ; preds = %while.body.i34, %gcd.exit, %if.else.i30
%retval.0.i39 = phi i32 [ 1, %gcd.exit ], [ %spec.select16.i28, %if.else.i30 ], [ %r.019.i35, %while.body.i34 ]
%conv = sext i32 %retval.0.i39 to i64
%add13 = add nsw i64 %ans.242, %conv
%inc = add nuw i32 %c.043, 1
%exitcond.not = icmp eq i32 %c.043, %0
br i1 %exitcond.not, label %for.cond6.for.cond.cleanup9_crit_edge, label %for.body10, !llvm.loop !13
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; 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 nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define F(i,a,n) for(int i=a; i<n; i++)
int gcd(int x, int y)
{
int r;
while((r = x % y) != 0)
{
x = y;
y = r;
}
return y;
}
int main(){
int n;
scanf("%d",&n);
int sum=0;
F(i,1,n+1){
F(j,1,n+1){
F(k,1,n+1){
sum+=gcd(gcd(i,j),gcd(j,k));
}
}
}
printf("%d",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126738/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126738/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%y.addr.0 = phi i32 [ %y, %entry ], [ %rem, %while.cond ]
%x.addr.0 = phi i32 [ %x, %entry ], [ %y.addr.0, %while.cond ]
%rem = srem i32 %x.addr.0, %y.addr.0
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !5
while.end: ; preds = %while.cond
ret i32 %y.addr.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !7
%cmp.not49 = icmp slt i32 %0, 1
br i1 %cmp.not49, label %for.cond.cleanup, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.for.cond.cleanup4_crit_edge.split
%i.051 = phi i32 [ %inc19, %for.cond1.for.cond.cleanup4_crit_edge.split ], [ 1, %entry ]
%sum.050 = phi i32 [ %add14, %for.cond1.for.cond.cleanup4_crit_edge.split ], [ 0, %entry ]
br label %for.cond6.preheader
for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup4_crit_edge.split, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add14, %for.cond1.for.cond.cleanup4_crit_edge.split ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.cond6.preheader: ; preds = %for.cond1.preheader, %for.cond6.for.cond.cleanup9_crit_edge
%j.047 = phi i32 [ 1, %for.cond1.preheader ], [ %inc16, %for.cond6.for.cond.cleanup9_crit_edge ]
%sum.146 = phi i32 [ %sum.050, %for.cond1.preheader ], [ %add14, %for.cond6.for.cond.cleanup9_crit_edge ]
br label %while.cond.i.preheader
for.cond1.for.cond.cleanup4_crit_edge.split: ; preds = %for.cond6.for.cond.cleanup9_crit_edge
%inc19 = add nuw i32 %i.051, 1
%exitcond54.not = icmp eq i32 %i.051, %0
br i1 %exitcond54.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !11
while.cond.i.preheader: ; preds = %for.cond6.preheader, %gcd.exit41
%k.044 = phi i32 [ 1, %for.cond6.preheader ], [ %inc, %gcd.exit41 ]
%sum.243 = phi i32 [ %sum.146, %for.cond6.preheader ], [ %add14, %gcd.exit41 ]
br label %while.cond.i
for.cond6.for.cond.cleanup9_crit_edge: ; preds = %gcd.exit41
%inc16 = add nuw i32 %j.047, 1
%exitcond53.not = icmp eq i32 %j.047, %0
br i1 %exitcond53.not, label %for.cond1.for.cond.cleanup4_crit_edge.split, label %for.cond6.preheader, !llvm.loop !12
while.cond.i: ; preds = %while.cond.i.preheader, %while.cond.i
%y.addr.0.i = phi i32 [ %rem.i, %while.cond.i ], [ %j.047, %while.cond.i.preheader ]
%x.addr.0.i = phi i32 [ %y.addr.0.i, %while.cond.i ], [ %i.051, %while.cond.i.preheader ]
%rem.i = srem i32 %x.addr.0.i, %y.addr.0.i
%cmp.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp.not.i, label %while.cond.i30, label %while.cond.i, !llvm.loop !5
while.cond.i30: ; preds = %while.cond.i, %while.cond.i30
%y.addr.0.i31 = phi i32 [ %rem.i33, %while.cond.i30 ], [ %k.044, %while.cond.i ]
%x.addr.0.i32 = phi i32 [ %y.addr.0.i31, %while.cond.i30 ], [ %j.047, %while.cond.i ]
%rem.i33 = srem i32 %x.addr.0.i32, %y.addr.0.i31
%cmp.not.i34 = icmp eq i32 %rem.i33, 0
br i1 %cmp.not.i34, label %while.cond.i36, label %while.cond.i30, !llvm.loop !5
while.cond.i36: ; preds = %while.cond.i30, %while.cond.i36
%y.addr.0.i37 = phi i32 [ %rem.i39, %while.cond.i36 ], [ %y.addr.0.i31, %while.cond.i30 ]
%x.addr.0.i38 = phi i32 [ %y.addr.0.i37, %while.cond.i36 ], [ %y.addr.0.i, %while.cond.i30 ]
%rem.i39 = srem i32 %x.addr.0.i38, %y.addr.0.i37
%cmp.not.i40 = icmp eq i32 %rem.i39, 0
br i1 %cmp.not.i40, label %gcd.exit41, label %while.cond.i36, !llvm.loop !5
gcd.exit41: ; preds = %while.cond.i36
%add14 = add nsw i32 %y.addr.0.i37, %sum.243
%inc = add nuw i32 %k.044, 1
%exitcond.not = icmp eq i32 %k.044, %0
br i1 %exitcond.not, label %for.cond6.for.cond.cleanup9_crit_edge, label %while.cond.i.preheader, !llvm.loop !13
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
//*
ll fact[200010];
ll invfact[200010];
void makefact(int n,ll m){
fact[0]=1;
rep(i,0,n)fact[i+1]=fact[i]*(i+1)%m;
invfact[n]=invp(fact[n],m);
for(int i=n;i>0;i--)invfact[i-1]=invfact[i]*i%m;
}
ll choose(int n,int r,int m){return n<0||r<0||n-r<0?0:fact[n]*invfact[r]%m*invfact[n-r]%m;}
//*/
int main(){
ll n,a,b,c;
scanf("%lld%lld%lld%lld",&n,&a,&b,&c);
a=a*invp(100-c,MOD)%MOD;
b=b*invp(100-c,MOD)%MOD;
c=c*invp(100,MOD)%MOD;
makefact(2*n+5,MOD);
ll ans=0;
rep(i,0,n){
//Aがかつ
ans=(ans+(n+i)*choose(n-1+i,i,MOD)%MOD*pom(a,n,MOD)%MOD*pom(b,i,MOD)%MOD)%MOD;
//Bがかつ
ans=(ans+(n+i)*choose(n-1+i,i,MOD)%MOD*pom(b,n,MOD)%MOD*pom(a,i,MOD)%MOD)%MOD;
}
printf("%lld",(ans*invp(1-c,MOD)%MOD+MOD)%MOD);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126781/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126781/source.c"
target datalayout = "e-m:e-p270: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 [200010 x i64] zeroinitializer, align 16
@invfact = dso_local local_unnamed_addr global [200010 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [17 x i8] c"%lld%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\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) #8
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) #8
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 norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @makefact(i32 noundef %n, i64 noundef %m) local_unnamed_addr #5 {
entry:
store i64 1, ptr @fact, align 16, !tbaa !5
%conv = sext i32 %n to i64
%cmp38 = icmp sgt i32 %n, 0
br i1 %cmp38, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %conv, 1
%0 = icmp eq i32 %n, 1
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %conv, -2
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa.loopexit: ; preds = %for.body
%1 = add nuw nsw i64 %i.039, 3
br label %for.cond.cleanup.loopexit.unr-lcssa
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.cond.cleanup.loopexit.unr-lcssa.loopexit, %for.body.preheader
%.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.1, %for.cond.cleanup.loopexit.unr-lcssa.loopexit ]
%i.039.unr = phi i64 [ 1, %for.body.preheader ], [ %1, %for.cond.cleanup.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%mul.epil = mul nsw i64 %.unr, %i.039.unr
%rem.epil = srem i64 %mul.epil, %m
%arrayidx3.epil = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %i.039.unr
store i64 %rem.epil, ptr %arrayidx3.epil, align 8, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry
%sub = add nsw i64 %m, -2
%sext = shl i64 %m, 32
%conv.i = ashr exact i64 %sext, 32
%tobool.not16.i = icmp eq i64 %sub, 0
br i1 %tobool.not16.i, label %pom.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.cond.cleanup
%arrayidx4 = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %conv
%2 = load i64, ptr %arrayidx4, align 8, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %cond.end.i
%mul4.pn.i = phi i64 [ %mul4.i, %cond.end.i ], [ %2, %for.body.i.preheader ]
%x.018.i = phi i64 [ %x.1.i, %cond.end.i ], [ 1, %for.body.i.preheader ]
%n.addr.017.i = phi i64 [ %div.i, %cond.end.i ], [ %sub, %for.body.i.preheader ]
%a.addr.019.i = srem i64 %mul4.pn.i, %conv.i
%and.i = and i64 %n.addr.017.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %cond.end.i, label %cond.true.i
cond.true.i: ; preds = %for.body.i
%mul.i = mul nsw i64 %a.addr.019.i, %x.018.i
%rem3.i = srem i64 %mul.i, %conv.i
br label %cond.end.i
cond.end.i: ; preds = %cond.true.i, %for.body.i
%x.1.i = phi i64 [ %rem3.i, %cond.true.i ], [ %x.018.i, %for.body.i ]
%mul4.i = mul nsw i64 %a.addr.019.i, %a.addr.019.i
%div.i = sdiv i64 %n.addr.017.i, 2
%n.addr.017.off.i = add i64 %n.addr.017.i, 1
%tobool.not.i = icmp ult i64 %n.addr.017.off.i, 3
br i1 %tobool.not.i, label %pom.exit, label %for.body.i, !llvm.loop !9
pom.exit: ; preds = %cond.end.i, %for.cond.cleanup
%x.0.lcssa.i = phi i64 [ 1, %for.cond.cleanup ], [ %x.1.i, %cond.end.i ]
%arrayidx7 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %conv
store i64 %x.0.lcssa.i, ptr %arrayidx7, align 8, !tbaa !5
br i1 %cmp38, label %for.body13.preheader, label %for.cond.cleanup12
for.body13.preheader: ; preds = %pom.exit
%3 = zext i32 %n to i64
%xtraiter43 = and i64 %3, 1
%lcmp.mod44.not = icmp eq i64 %xtraiter43, 0
br i1 %lcmp.mod44.not, label %for.body13.prol.loopexit, label %for.body13.prol
for.body13.prol: ; preds = %for.body13.preheader
%arrayidx15.prol = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %3
%4 = load i64, ptr %arrayidx15.prol, align 8, !tbaa !5
%mul17.prol = mul nsw i64 %4, %3
%rem18.prol = srem i64 %mul17.prol, %m
%indvars.iv.next.prol = add nsw i64 %3, -1
%idxprom20.prol = and i64 %indvars.iv.next.prol, 4294967295
%arrayidx21.prol = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom20.prol
store i64 %rem18.prol, ptr %arrayidx21.prol, align 8, !tbaa !5
br label %for.body13.prol.loopexit
for.body13.prol.loopexit: ; preds = %for.body13.prol, %for.body13.preheader
%indvars.iv.unr = phi i64 [ %3, %for.body13.preheader ], [ %indvars.iv.next.prol, %for.body13.prol ]
%5 = icmp eq i32 %n, 1
br i1 %5, label %for.cond.cleanup12, label %for.body13
for.body: ; preds = %for.body, %for.body.preheader.new
%6 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.1, %for.body ]
%i.039 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%add = or i64 %i.039, 1
%mul = mul nsw i64 %6, %add
%rem = srem i64 %mul, %m
%arrayidx3 = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %add
store i64 %rem, ptr %arrayidx3, align 8, !tbaa !5
%add.1 = add nuw nsw i64 %i.039, 2
%mul.1 = mul nsw i64 %rem, %add.1
%rem.1 = srem i64 %mul.1, %m
%arrayidx3.1 = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %add.1
store i64 %rem.1, ptr %arrayidx3.1, align 16, !tbaa !5
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !11
for.cond.cleanup12: ; preds = %for.body13.prol.loopexit, %for.body13, %pom.exit
ret void
for.body13: ; preds = %for.body13.prol.loopexit, %for.body13
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body13 ], [ %indvars.iv.unr, %for.body13.prol.loopexit ]
%arrayidx15 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %indvars.iv
%7 = load i64, ptr %arrayidx15, align 8, !tbaa !5
%mul17 = mul nsw i64 %7, %indvars.iv
%rem18 = srem i64 %mul17, %m
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%idxprom20 = and i64 %indvars.iv.next, 4294967295
%arrayidx21 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom20
store i64 %rem18, ptr %arrayidx21, align 8, !tbaa !5
%arrayidx15.1 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %indvars.iv.next
%8 = load i64, ptr %arrayidx15.1, align 8, !tbaa !5
%mul17.1 = mul nsw i64 %8, %indvars.iv.next
%rem18.1 = srem i64 %mul17.1, %m
%indvars.iv.next.1 = add nsw i64 %indvars.iv, -2
%idxprom20.1 = and i64 %indvars.iv.next.1, 4294967295
%arrayidx21.1 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom20.1
store i64 %rem18.1, ptr %arrayidx21.1, align 8, !tbaa !5
%cmp10.1 = icmp ugt i64 %indvars.iv.next, 1
br i1 %cmp10.1, label %for.body13, label %for.cond.cleanup12, !llvm.loop !12
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @choose(i32 noundef %n, i32 noundef %r, i32 noundef %m) local_unnamed_addr #6 {
entry:
%0 = or i32 %r, %n
%or.cond.not = icmp sgt i32 %0, -1
br i1 %or.cond.not, label %lor.lhs.false2, label %cond.end
lor.lhs.false2: ; preds = %entry
%sub = sub nsw i32 %n, %r
%cmp3 = icmp slt i32 %sub, 0
br i1 %cmp3, label %cond.end, label %cond.false
cond.false: ; preds = %lor.lhs.false2
%idxprom = zext i32 %n to i64
%arrayidx = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%idxprom4 = zext i32 %r to i64
%arrayidx5 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom4
%2 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%mul = mul nsw i64 %2, %1
%conv = sext i32 %m to i64
%rem = srem i64 %mul, %conv
%idxprom7 = zext i32 %sub to i64
%arrayidx8 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom7
%3 = load i64, ptr %arrayidx8, align 8, !tbaa !5
%mul9 = mul nsw i64 %3, %rem
%rem11 = srem i64 %mul9, %conv
br label %cond.end
cond.end: ; preds = %entry, %lor.lhs.false2, %cond.false
%cond = phi i64 [ %rem11, %cond.false ], [ 0, %lor.lhs.false2 ], [ 0, %entry ]
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %c, align 8, !tbaa !5
%sub = sub nsw i64 100, %1
br label %for.body.i
for.body.i: ; preds = %cond.end.i, %entry
%mul4.pn.i = phi i64 [ %mul4.i, %cond.end.i ], [ %sub, %entry ]
%x.018.i = phi i64 [ %x.1.i, %cond.end.i ], [ 1, %entry ]
%n.addr.017.i = phi i64 [ %div.i, %cond.end.i ], [ 1000000005, %entry ]
%a.addr.019.i = srem i64 %mul4.pn.i, 1000000007
%and.i = and i64 %n.addr.017.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %cond.end.i, label %cond.true.i
cond.true.i: ; preds = %for.body.i
%mul.i = mul nsw i64 %a.addr.019.i, %x.018.i
%rem3.i = srem i64 %mul.i, 1000000007
br label %cond.end.i
cond.end.i: ; preds = %cond.true.i, %for.body.i
%x.1.i = phi i64 [ %rem3.i, %cond.true.i ], [ %x.018.i, %for.body.i ]
%mul4.i = mul nsw i64 %a.addr.019.i, %a.addr.019.i
%div.i = sdiv i64 %n.addr.017.i, 2
%n.addr.017.off.i = add nsw i64 %n.addr.017.i, 1
%tobool.not.i = icmp ult i64 %n.addr.017.off.i, 3
br i1 %tobool.not.i, label %pom.exit, label %for.body.i, !llvm.loop !9
pom.exit: ; preds = %cond.end.i
%mul = mul nsw i64 %x.1.i, %0
%rem = srem i64 %mul, 1000000007
store i64 %rem, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
br label %for.body.i61
for.body.i61: ; preds = %cond.end.i71, %pom.exit
%mul4.pn.i62 = phi i64 [ %mul4.i73, %cond.end.i71 ], [ %sub, %pom.exit ]
%x.018.i63 = phi i64 [ %x.1.i72, %cond.end.i71 ], [ 1, %pom.exit ]
%n.addr.017.i64 = phi i64 [ %div.i74, %cond.end.i71 ], [ 1000000005, %pom.exit ]
%a.addr.019.i65 = srem i64 %mul4.pn.i62, 1000000007
%and.i66 = and i64 %n.addr.017.i64, 1
%tobool1.not.i67 = icmp eq i64 %and.i66, 0
br i1 %tobool1.not.i67, label %cond.end.i71, label %cond.true.i68
cond.true.i68: ; preds = %for.body.i61
%mul.i69 = mul nsw i64 %a.addr.019.i65, %x.018.i63
%rem3.i70 = srem i64 %mul.i69, 1000000007
br label %cond.end.i71
cond.end.i71: ; preds = %cond.true.i68, %for.body.i61
%x.1.i72 = phi i64 [ %rem3.i70, %cond.true.i68 ], [ %x.018.i63, %for.body.i61 ]
%mul4.i73 = mul nsw i64 %a.addr.019.i65, %a.addr.019.i65
%div.i74 = sdiv i64 %n.addr.017.i64, 2
%n.addr.017.off.i75 = add nsw i64 %n.addr.017.i64, 1
%tobool.not.i76 = icmp ult i64 %n.addr.017.off.i75, 3
br i1 %tobool.not.i76, label %pom.exit77, label %for.body.i61, !llvm.loop !9
pom.exit77: ; preds = %cond.end.i71
%mul4 = mul nsw i64 %x.1.i72, %2
%rem5 = srem i64 %mul4, 1000000007
store i64 %rem5, ptr %b, align 8, !tbaa !5
br label %for.body.i78
for.body.i78: ; preds = %cond.end.i88, %pom.exit77
%mul4.pn.i79 = phi i64 [ %mul4.i90, %cond.end.i88 ], [ 100, %pom.exit77 ]
%x.018.i80 = phi i64 [ %x.1.i89, %cond.end.i88 ], [ 1, %pom.exit77 ]
%n.addr.017.i81 = phi i64 [ %div.i91, %cond.end.i88 ], [ 1000000005, %pom.exit77 ]
%a.addr.019.i82 = urem i64 %mul4.pn.i79, 1000000007
%and.i83 = and i64 %n.addr.017.i81, 1
%tobool1.not.i84 = icmp eq i64 %and.i83, 0
br i1 %tobool1.not.i84, label %cond.end.i88, label %cond.true.i85
cond.true.i85: ; preds = %for.body.i78
%mul.i86 = mul nsw i64 %a.addr.019.i82, %x.018.i80
%rem3.i87 = srem i64 %mul.i86, 1000000007
br label %cond.end.i88
cond.end.i88: ; preds = %cond.true.i85, %for.body.i78
%x.1.i89 = phi i64 [ %rem3.i87, %cond.true.i85 ], [ %x.018.i80, %for.body.i78 ]
%mul4.i90 = mul nuw nsw i64 %a.addr.019.i82, %a.addr.019.i82
%div.i91 = sdiv i64 %n.addr.017.i81, 2
%n.addr.017.off.i92 = add nsw i64 %n.addr.017.i81, 1
%tobool.not.i93 = icmp ult i64 %n.addr.017.off.i92, 3
br i1 %tobool.not.i93, label %pom.exit94, label %for.body.i78, !llvm.loop !9
pom.exit94: ; preds = %cond.end.i88
%mul7 = mul nsw i64 %x.1.i89, %1
%rem8 = srem i64 %mul7, 1000000007
store i64 %rem8, ptr %c, align 8, !tbaa !5
%3 = load i64, ptr %n, align 8, !tbaa !5
%.tr = trunc i64 %3 to i32
%4 = shl i32 %.tr, 1
%conv = add i32 %4, 5
store i64 1, ptr @fact, align 16, !tbaa !5
%conv.i = sext i32 %conv to i64
%cmp38.i = icmp sgt i32 %conv, 0
br i1 %cmp38.i, label %for.body.i95.preheader, label %for.cond.cleanup.i
for.body.i95.preheader: ; preds = %pom.exit94
%5 = icmp eq i32 %4, -4
br i1 %5, label %for.body.i95.epil, label %for.body.i95.preheader.new
for.body.i95.preheader.new: ; preds = %for.body.i95.preheader
%6 = add nsw i64 %conv.i, -3
br label %for.body.i95
for.cond.cleanup.i.loopexit.unr-lcssa.loopexit: ; preds = %for.body.i95
%7 = add nuw nsw i64 %i.039.i, 3
br label %for.body.i95.epil
for.body.i95.epil: ; preds = %for.cond.cleanup.i.loopexit.unr-lcssa.loopexit, %for.body.i95.preheader
%.unr = phi i64 [ 1, %for.body.i95.preheader ], [ %rem.i.1, %for.cond.cleanup.i.loopexit.unr-lcssa.loopexit ]
%i.039.i.unr = phi i64 [ 1, %for.body.i95.preheader ], [ %7, %for.cond.cleanup.i.loopexit.unr-lcssa.loopexit ]
%mul.i96.epil = mul nsw i64 %i.039.i.unr, %.unr
%rem.i.epil = srem i64 %mul.i96.epil, 1000000007
%arrayidx3.i.epil = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %i.039.i.unr
store i64 %rem.i.epil, ptr %arrayidx3.i.epil, align 8, !tbaa !5
br label %for.cond.cleanup.i
for.cond.cleanup.i: ; preds = %for.body.i95.epil, %pom.exit94
%arrayidx4.i = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %conv.i
%8 = load i64, ptr %arrayidx4.i, align 8, !tbaa !5
br label %for.body.i.i
for.body.i.i: ; preds = %cond.end.i.i, %for.cond.cleanup.i
%mul4.pn.i.i = phi i64 [ %mul4.i.i, %cond.end.i.i ], [ %8, %for.cond.cleanup.i ]
%x.018.i.i = phi i64 [ %x.1.i.i, %cond.end.i.i ], [ 1, %for.cond.cleanup.i ]
%n.addr.017.i.i = phi i64 [ %div.i.i, %cond.end.i.i ], [ 1000000005, %for.cond.cleanup.i ]
%a.addr.019.i.i = srem i64 %mul4.pn.i.i, 1000000007
%and.i.i = and i64 %n.addr.017.i.i, 1
%tobool1.not.i.i = icmp eq i64 %and.i.i, 0
br i1 %tobool1.not.i.i, label %cond.end.i.i, label %cond.true.i.i
cond.true.i.i: ; preds = %for.body.i.i
%mul.i.i = mul nsw i64 %a.addr.019.i.i, %x.018.i.i
%rem3.i.i = srem i64 %mul.i.i, 1000000007
br label %cond.end.i.i
cond.end.i.i: ; preds = %cond.true.i.i, %for.body.i.i
%x.1.i.i = phi i64 [ %rem3.i.i, %cond.true.i.i ], [ %x.018.i.i, %for.body.i.i ]
%mul4.i.i = mul nsw i64 %a.addr.019.i.i, %a.addr.019.i.i
%div.i.i = sdiv i64 %n.addr.017.i.i, 2
%n.addr.017.off.i.i = add nsw i64 %n.addr.017.i.i, 1
%tobool.not.i.i = icmp ult i64 %n.addr.017.off.i.i, 3
br i1 %tobool.not.i.i, label %pom.exit.i, label %for.body.i.i, !llvm.loop !9
pom.exit.i: ; preds = %cond.end.i.i
%arrayidx7.i = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %conv.i
store i64 %x.1.i.i, ptr %arrayidx7.i, align 8, !tbaa !5
br i1 %cmp38.i, label %for.body13.i.ph, label %makefact.exit
for.body13.i.ph: ; preds = %pom.exit.i
%9 = zext i32 %conv to i64
%10 = add i32 %4, 4
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 3
%13 = or i64 %12, 8
%scevgep = getelementptr i8, ptr @invfact, i64 %13
%load_initial = load i64, ptr %scevgep, align 8
%mul17.i.prol = mul nsw i64 %load_initial, %9
%rem18.i.prol = srem i64 %mul17.i.prol, 1000000007
%indvars.iv.next.i.prol = add nsw i64 %9, -1
%arrayidx21.i.prol = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %indvars.iv.next.i.prol
store i64 %rem18.i.prol, ptr %arrayidx21.i.prol, align 16, !tbaa !5
%14 = icmp eq i32 %10, 0
br i1 %14, label %makefact.exit, label %for.body13.i
for.body.i95: ; preds = %for.body.i95, %for.body.i95.preheader.new
%15 = phi i64 [ 1, %for.body.i95.preheader.new ], [ %rem.i.1, %for.body.i95 ]
%i.039.i = phi i64 [ 0, %for.body.i95.preheader.new ], [ %add.i.1, %for.body.i95 ]
%niter = phi i64 [ 0, %for.body.i95.preheader.new ], [ %niter.next.1, %for.body.i95 ]
%add.i = or i64 %i.039.i, 1
%mul.i96 = mul nsw i64 %add.i, %15
%rem.i = srem i64 %mul.i96, 1000000007
%arrayidx3.i = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %add.i
store i64 %rem.i, ptr %arrayidx3.i, align 8, !tbaa !5
%add.i.1 = add nuw nsw i64 %i.039.i, 2
%mul.i96.1 = mul nsw i64 %add.i.1, %rem.i
%rem.i.1 = srem i64 %mul.i96.1, 1000000007
%arrayidx3.i.1 = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %add.i.1
store i64 %rem.i.1, ptr %arrayidx3.i.1, align 16, !tbaa !5
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter, %6
br i1 %niter.ncmp.1, label %for.cond.cleanup.i.loopexit.unr-lcssa.loopexit, label %for.body.i95, !llvm.loop !11
for.body13.i: ; preds = %for.body13.i.ph, %for.body13.i
%store_forwarded = phi i64 [ %rem18.i.1, %for.body13.i ], [ %rem18.i.prol, %for.body13.i.ph ]
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body13.i ], [ %indvars.iv.next.i.prol, %for.body13.i.ph ]
%mul17.i = mul nsw i64 %store_forwarded, %indvars.iv.i
%rem18.i = srem i64 %mul17.i, 1000000007
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%idxprom20.i = and i64 %indvars.iv.next.i, 4294967295
%arrayidx21.i = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom20.i
store i64 %rem18.i, ptr %arrayidx21.i, align 8, !tbaa !5
%mul17.i.1 = mul nsw i64 %rem18.i, %indvars.iv.next.i
%rem18.i.1 = srem i64 %mul17.i.1, 1000000007
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, -2
%idxprom20.i.1 = and i64 %indvars.iv.next.i.1, 4294967295
%arrayidx21.i.1 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom20.i.1
store i64 %rem18.i.1, ptr %arrayidx21.i.1, align 8, !tbaa !5
%cmp10.i.1 = icmp ugt i64 %indvars.iv.next.i, 1
br i1 %cmp10.i.1, label %for.body13.i, label %makefact.exit, !llvm.loop !12
makefact.exit: ; preds = %for.body13.i.ph, %for.body13.i, %pom.exit.i
%cmp209 = icmp sgt i64 %3, 0
br i1 %cmp209, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %makefact.exit
%sub12 = add nuw i64 %3, 4294967295
br label %for.body
for.cond.cleanup: ; preds = %pom.exit208, %makefact.exit
%ans.0.lcssa = phi i64 [ 0, %makefact.exit ], [ %rem42, %pom.exit208 ]
%sub43 = sub nsw i64 1, %rem8
br label %for.body.i97
for.body.i97: ; preds = %cond.end.i107, %for.cond.cleanup
%mul4.pn.i98 = phi i64 [ %mul4.i109, %cond.end.i107 ], [ %sub43, %for.cond.cleanup ]
%x.018.i99 = phi i64 [ %x.1.i108, %cond.end.i107 ], [ 1, %for.cond.cleanup ]
%n.addr.017.i100 = phi i64 [ %div.i110, %cond.end.i107 ], [ 1000000005, %for.cond.cleanup ]
%a.addr.019.i101 = srem i64 %mul4.pn.i98, 1000000007
%and.i102 = and i64 %n.addr.017.i100, 1
%tobool1.not.i103 = icmp eq i64 %and.i102, 0
br i1 %tobool1.not.i103, label %cond.end.i107, label %cond.true.i104
cond.true.i104: ; preds = %for.body.i97
%mul.i105 = mul nsw i64 %a.addr.019.i101, %x.018.i99
%rem3.i106 = srem i64 %mul.i105, 1000000007
br label %cond.end.i107
cond.end.i107: ; preds = %cond.true.i104, %for.body.i97
%x.1.i108 = phi i64 [ %rem3.i106, %cond.true.i104 ], [ %x.018.i99, %for.body.i97 ]
%mul4.i109 = mul nsw i64 %a.addr.019.i101, %a.addr.019.i101
%div.i110 = sdiv i64 %n.addr.017.i100, 2
%n.addr.017.off.i111 = add nsw i64 %n.addr.017.i100, 1
%tobool.not.i112 = icmp ult i64 %n.addr.017.off.i111, 3
br i1 %tobool.not.i112, label %pom.exit113, label %for.body.i97, !llvm.loop !9
pom.exit113: ; preds = %cond.end.i107
%mul45 = mul nsw i64 %x.1.i108, %ans.0.lcssa
%mul45.fr = freeze i64 %mul45
%rem46 = srem i64 %mul45.fr, 1000000007
%add47 = add nsw i64 %rem46, 1000000007
%rem48.cmp = icmp ugt i64 %rem46, -1000000008
%rem48 = select i1 %rem48.cmp, i64 %add47, i64 %rem46
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %rem48)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #8
ret i32 0
for.body: ; preds = %for.body.lr.ph, %pom.exit208
%i.0211 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %pom.exit208 ]
%ans.0210 = phi i64 [ 0, %for.body.lr.ph ], [ %rem42, %pom.exit208 ]
%add11 = add nsw i64 %i.0211, %3
%add13 = add i64 %sub12, %i.0211
%conv14 = trunc i64 %add13 to i32
%conv15 = trunc i64 %i.0211 to i32
%16 = or i32 %conv14, %conv15
%or.cond.not.i = icmp sgt i32 %16, -1
br i1 %or.cond.not.i, label %lor.lhs.false2.i, label %for.body.i117.preheader
lor.lhs.false2.i: ; preds = %for.body
%sub.i = sub nsw i32 %conv14, %conv15
%cmp3.i = icmp slt i32 %sub.i, 0
br i1 %cmp3.i, label %for.body.i117.preheader, label %cond.false.i
cond.false.i: ; preds = %lor.lhs.false2.i
%idxprom.i = and i64 %add13, 4294967295
%arrayidx.i = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %idxprom.i
%17 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%idxprom4.i = and i64 %i.0211, 4294967295
%arrayidx5.i = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom4.i
%18 = load i64, ptr %arrayidx5.i, align 8, !tbaa !5
%mul.i115 = mul nsw i64 %18, %17
%rem.i116 = srem i64 %mul.i115, 1000000007
%idxprom7.i = zext i32 %sub.i to i64
%arrayidx8.i = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom7.i
%19 = load i64, ptr %arrayidx8.i, align 8, !tbaa !5
%mul9.i = mul nsw i64 %rem.i116, %19
%rem11.i = srem i64 %mul9.i, 1000000007
br label %for.body.i117.preheader
for.body.i117.preheader: ; preds = %cond.false.i, %lor.lhs.false2.i, %for.body
%cond.i = phi i64 [ %rem11.i, %cond.false.i ], [ 0, %lor.lhs.false2.i ], [ 0, %for.body ]
%mul17 = mul nsw i64 %cond.i, %add11
%rem18 = srem i64 %mul17, 1000000007
br label %for.body.i117
for.body.i117: ; preds = %for.body.i117.preheader, %cond.end.i127
%mul4.pn.i118 = phi i64 [ %mul4.i129, %cond.end.i127 ], [ %rem, %for.body.i117.preheader ]
%x.018.i119 = phi i64 [ %x.1.i128, %cond.end.i127 ], [ 1, %for.body.i117.preheader ]
%n.addr.017.i120 = phi i64 [ %div.i130, %cond.end.i127 ], [ %3, %for.body.i117.preheader ]
%a.addr.019.i121 = srem i64 %mul4.pn.i118, 1000000007
%and.i122 = and i64 %n.addr.017.i120, 1
%tobool1.not.i123 = icmp eq i64 %and.i122, 0
br i1 %tobool1.not.i123, label %cond.end.i127, label %cond.true.i124
cond.true.i124: ; preds = %for.body.i117
%mul.i125 = mul nsw i64 %a.addr.019.i121, %x.018.i119
%rem3.i126 = srem i64 %mul.i125, 1000000007
br label %cond.end.i127
cond.end.i127: ; preds = %cond.true.i124, %for.body.i117
%x.1.i128 = phi i64 [ %rem3.i126, %cond.true.i124 ], [ %x.018.i119, %for.body.i117 ]
%mul4.i129 = mul nsw i64 %a.addr.019.i121, %a.addr.019.i121
%div.i130 = sdiv i64 %n.addr.017.i120, 2
%n.addr.017.off.i131 = add i64 %n.addr.017.i120, 1
%tobool.not.i132 = icmp ult i64 %n.addr.017.off.i131, 3
br i1 %tobool.not.i132, label %pom.exit133, label %for.body.i117, !llvm.loop !9
pom.exit133: ; preds = %cond.end.i127
%mul20 = mul nsw i64 %x.1.i128, %rem18
%rem21 = srem i64 %mul20, 1000000007
%tobool.not16.i134 = icmp eq i64 %i.0211, 0
br i1 %tobool.not16.i134, label %pom.exit152, label %for.body.i135
for.body.i135: ; preds = %pom.exit133, %cond.end.i145
%mul4.pn.i136 = phi i64 [ %mul4.i147, %cond.end.i145 ], [ %rem5, %pom.exit133 ]
%x.018.i137 = phi i64 [ %x.1.i146, %cond.end.i145 ], [ 1, %pom.exit133 ]
%n.addr.017.i138 = phi i64 [ %div.i148, %cond.end.i145 ], [ %i.0211, %pom.exit133 ]
%a.addr.019.i139 = srem i64 %mul4.pn.i136, 1000000007
%and.i140 = and i64 %n.addr.017.i138, 1
%tobool1.not.i141 = icmp eq i64 %and.i140, 0
br i1 %tobool1.not.i141, label %cond.end.i145, label %cond.true.i142
cond.true.i142: ; preds = %for.body.i135
%mul.i143 = mul nsw i64 %a.addr.019.i139, %x.018.i137
%rem3.i144 = srem i64 %mul.i143, 1000000007
br label %cond.end.i145
cond.end.i145: ; preds = %cond.true.i142, %for.body.i135
%x.1.i146 = phi i64 [ %rem3.i144, %cond.true.i142 ], [ %x.018.i137, %for.body.i135 ]
%mul4.i147 = mul nsw i64 %a.addr.019.i139, %a.addr.019.i139
%div.i148 = sdiv i64 %n.addr.017.i138, 2
%n.addr.017.off.i149 = add nsw i64 %n.addr.017.i138, 1
%tobool.not.i150 = icmp ult i64 %n.addr.017.off.i149, 3
br i1 %tobool.not.i150, label %pom.exit152, label %for.body.i135, !llvm.loop !9
pom.exit152: ; preds = %cond.end.i145, %pom.exit133
%x.0.lcssa.i151 = phi i64 [ 1, %pom.exit133 ], [ %x.1.i146, %cond.end.i145 ]
%mul23 = mul nsw i64 %x.0.lcssa.i151, %rem21
%rem24 = srem i64 %mul23, 1000000007
%add25 = add nsw i64 %rem24, %ans.0210
%rem26 = srem i64 %add25, 1000000007
br i1 %or.cond.not.i, label %lor.lhs.false2.i156, label %for.body.i172.preheader
lor.lhs.false2.i156: ; preds = %pom.exit152
%sub.i157 = sub nsw i32 %conv14, %conv15
%cmp3.i158 = icmp slt i32 %sub.i157, 0
br i1 %cmp3.i158, label %for.body.i172.preheader, label %cond.false.i159
cond.false.i159: ; preds = %lor.lhs.false2.i156
%idxprom.i160 = and i64 %add13, 4294967295
%arrayidx.i161 = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %idxprom.i160
%20 = load i64, ptr %arrayidx.i161, align 8, !tbaa !5
%idxprom4.i162 = and i64 %i.0211, 4294967295
%arrayidx5.i163 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom4.i162
%21 = load i64, ptr %arrayidx5.i163, align 8, !tbaa !5
%mul.i164 = mul nsw i64 %21, %20
%rem.i165 = srem i64 %mul.i164, 1000000007
%idxprom7.i166 = zext i32 %sub.i157 to i64
%arrayidx8.i167 = getelementptr inbounds [200010 x i64], ptr @invfact, i64 0, i64 %idxprom7.i166
%22 = load i64, ptr %arrayidx8.i167, align 8, !tbaa !5
%mul9.i168 = mul nsw i64 %rem.i165, %22
%rem11.i169 = srem i64 %mul9.i168, 1000000007
br label %for.body.i172.preheader
for.body.i172.preheader: ; preds = %cond.false.i159, %lor.lhs.false2.i156, %pom.exit152
%cond.i155 = phi i64 [ %rem11.i169, %cond.false.i159 ], [ 0, %lor.lhs.false2.i156 ], [ 0, %pom.exit152 ]
%mul33 = mul nsw i64 %cond.i155, %add11
%rem34 = srem i64 %mul33, 1000000007
br label %for.body.i172
for.body.i172: ; preds = %for.body.i172.preheader, %cond.end.i182
%mul4.pn.i173 = phi i64 [ %mul4.i184, %cond.end.i182 ], [ %rem5, %for.body.i172.preheader ]
%x.018.i174 = phi i64 [ %x.1.i183, %cond.end.i182 ], [ 1, %for.body.i172.preheader ]
%n.addr.017.i175 = phi i64 [ %div.i185, %cond.end.i182 ], [ %3, %for.body.i172.preheader ]
%a.addr.019.i176 = srem i64 %mul4.pn.i173, 1000000007
%and.i177 = and i64 %n.addr.017.i175, 1
%tobool1.not.i178 = icmp eq i64 %and.i177, 0
br i1 %tobool1.not.i178, label %cond.end.i182, label %cond.true.i179
cond.true.i179: ; preds = %for.body.i172
%mul.i180 = mul nsw i64 %a.addr.019.i176, %x.018.i174
%rem3.i181 = srem i64 %mul.i180, 1000000007
br label %cond.end.i182
cond.end.i182: ; preds = %cond.true.i179, %for.body.i172
%x.1.i183 = phi i64 [ %rem3.i181, %cond.true.i179 ], [ %x.018.i174, %for.body.i172 ]
%mul4.i184 = mul nsw i64 %a.addr.019.i176, %a.addr.019.i176
%div.i185 = sdiv i64 %n.addr.017.i175, 2
%n.addr.017.off.i186 = add i64 %n.addr.017.i175, 1
%tobool.not.i187 = icmp ult i64 %n.addr.017.off.i186, 3
br i1 %tobool.not.i187, label %pom.exit189, label %for.body.i172, !llvm.loop !9
pom.exit189: ; preds = %cond.end.i182
%mul36 = mul nsw i64 %x.1.i183, %rem34
%rem37 = srem i64 %mul36, 1000000007
br i1 %tobool.not16.i134, label %pom.exit208, label %for.body.i191
for.body.i191: ; preds = %pom.exit189, %cond.end.i201
%mul4.pn.i192 = phi i64 [ %mul4.i203, %cond.end.i201 ], [ %rem, %pom.exit189 ]
%x.018.i193 = phi i64 [ %x.1.i202, %cond.end.i201 ], [ 1, %pom.exit189 ]
%n.addr.017.i194 = phi i64 [ %div.i204, %cond.end.i201 ], [ %i.0211, %pom.exit189 ]
%a.addr.019.i195 = srem i64 %mul4.pn.i192, 1000000007
%and.i196 = and i64 %n.addr.017.i194, 1
%tobool1.not.i197 = icmp eq i64 %and.i196, 0
br i1 %tobool1.not.i197, label %cond.end.i201, label %cond.true.i198
cond.true.i198: ; preds = %for.body.i191
%mul.i199 = mul nsw i64 %a.addr.019.i195, %x.018.i193
%rem3.i200 = srem i64 %mul.i199, 1000000007
br label %cond.end.i201
cond.end.i201: ; preds = %cond.true.i198, %for.body.i191
%x.1.i202 = phi i64 [ %rem3.i200, %cond.true.i198 ], [ %x.018.i193, %for.body.i191 ]
%mul4.i203 = mul nsw i64 %a.addr.019.i195, %a.addr.019.i195
%div.i204 = sdiv i64 %n.addr.017.i194, 2
%n.addr.017.off.i205 = add nsw i64 %n.addr.017.i194, 1
%tobool.not.i206 = icmp ult i64 %n.addr.017.off.i205, 3
br i1 %tobool.not.i206, label %pom.exit208, label %for.body.i191, !llvm.loop !9
pom.exit208: ; preds = %cond.end.i201, %pom.exit189
%x.0.lcssa.i207 = phi i64 [ 1, %pom.exit189 ], [ %x.1.i202, %cond.end.i201 ]
%mul39 = mul nsw i64 %x.0.lcssa.i207, %rem37
%rem40 = srem i64 %mul39, 1000000007
%add41 = add nsw i64 %rem40, %rem26
%rem42 = srem i64 %add41, 1000000007
%inc = add nuw nsw i64 %i.0211, 1
%exitcond.not = icmp eq i64 %inc, %3
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 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 #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 <string.h>
#define HWRC 1000
int main()
{
char HW[HWRC][HWRC];
char RC[HWRC][HWRC];
int H,W,R,C,i,j,k,cnt = 0;
int Ck[HWRC];
int Cn[HWRC];
scanf("%d%d",&H,&W);
for(i=0;i<H;i++) scanf("%s",&HW[i]);
scanf("%d%d",&R,&C);
for(i=0;i<R;i++) scanf("%s",&RC[i]);
for(i=0;i<R;i++)
{
k = 0;
Cn[i] = 0;
for(j=0;j<C;j++)
{
if(RC[i][j]==RC[i][0])
{
k++; /* 0列目と同じなのは何列目までか */
Cn[i] = k-1; /* 比較済みとなり得る列数 */
}
else
{
break;
}
}
Ck[i] = C-k+1; /* 必ず比較しなければならない列数 */
}
/* テーブルAの行を検索 */
for(i=0;i<=H-R;i++)
{
/* テーブルAの列を検索 */
for(j=0;j<=W-C;j++)
{
/* テーブルBの行と一致する列を検索 */
for(cnt = 0;cnt < R;cnt++)
{
if(memcmp(&HW[i+cnt][j],&RC[cnt][0],C)!=0)
{
break;
}
}
while(cnt == R)
{
printf("%d %d\n",i,j);
j++;
if(j<=W-C)
{
for(cnt = 0;cnt < R;cnt++)
{
if(memcmp(&HW[i+cnt][j+Cn[cnt]],&RC[cnt][Cn[cnt]],Ck[cnt])!=0)
{
break;
}
}
}
else
{
break;
}
}
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126831/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126831/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%HW = alloca [1000 x [1000 x i8]], align 16
%RC = alloca [1000 x [1000 x i8]], align 16
%H = alloca i32, align 4
%W = alloca i32, align 4
%R = alloca i32, align 4
%C = alloca i32, align 4
%Ck = alloca [1000 x i32], align 16
%Cn = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %HW) #5
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %RC) #5
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 4, ptr nonnull %R) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %Ck) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %Cn) #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
%cmp159 = icmp sgt i32 %0, 0
br i1 %cmp159, 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 [1000 x [1000 x i8]], ptr %HW, 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 %H, 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 %R, ptr noundef nonnull %C)
%3 = load i32, ptr %R, align 4, !tbaa !5
%cmp4161 = icmp sgt i32 %3, 0
br i1 %cmp4161, label %for.body5, label %for.cond42.preheader
for.cond12.preheader: ; preds = %for.body5
%cmp13170 = icmp sgt i32 %12, 0
br i1 %cmp13170, label %for.body14.lr.ph, label %for.cond42.preheader
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %C, align 4, !tbaa !5
%cmp18163 = icmp sgt i32 %4, 0
br i1 %cmp18163, label %for.body14.us.preheader, label %for.body14.lr.ph.split
for.body14.us.preheader: ; preds = %for.body14.lr.ph
%wide.trip.count208 = zext i32 %12 to i64
%wide.trip.count203 = zext i32 %4 to i64
br label %for.body14.us
for.body14.us: ; preds = %for.body14.us.preheader, %for.end35.us
%indvars.iv205 = phi i64 [ 0, %for.body14.us.preheader ], [ %indvars.iv.next206, %for.end35.us ]
%arrayidx16.us = getelementptr inbounds [1000 x i32], ptr %Cn, i64 0, i64 %indvars.iv205
store i32 0, ptr %arrayidx16.us, align 4, !tbaa !5
%arrayidx21.us = getelementptr inbounds [1000 x [1000 x i8]], ptr %RC, i64 0, i64 %indvars.iv205
%5 = load i8, ptr %arrayidx21.us, align 8, !tbaa !11
br label %for.body19.us
for.body19.us: ; preds = %for.body14.us, %if.then.us
%indvars.iv198 = phi i64 [ 0, %for.body14.us ], [ %indvars.iv.next199, %if.then.us ]
%indvars200 = trunc i64 %indvars.iv198 to i32
%arrayidx23.us = getelementptr inbounds [1000 x [1000 x i8]], ptr %RC, i64 0, i64 %indvars.iv205, i64 %indvars.iv198
%6 = load i8, ptr %arrayidx23.us, align 1, !tbaa !11
%cmp28.us = icmp eq i8 %6, %5
br i1 %cmp28.us, label %if.then.us, label %for.end35.us
for.end35.us: ; preds = %if.then.us, %for.body19.us
%k.0.lcssa.us = phi i32 [ %indvars200, %for.body19.us ], [ %4, %if.then.us ]
%reass.sub = sub i32 %4, %k.0.lcssa.us
%add.us = add i32 %reass.sub, 1
%arrayidx38.us = getelementptr inbounds [1000 x i32], ptr %Ck, i64 0, i64 %indvars.iv205
store i32 %add.us, ptr %arrayidx38.us, align 4, !tbaa !5
%indvars.iv.next206 = add nuw nsw i64 %indvars.iv205, 1
%exitcond209.not = icmp eq i64 %indvars.iv.next206, %wide.trip.count208
br i1 %exitcond209.not, label %for.cond42.preheader, label %for.body14.us, !llvm.loop !12
if.then.us: ; preds = %for.body19.us
%indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
store i32 %indvars200, ptr %arrayidx16.us, align 4, !tbaa !5
%exitcond204.not = icmp eq i64 %indvars.iv.next199, %wide.trip.count203
br i1 %exitcond204.not, label %for.end35.us, label %for.body19.us, !llvm.loop !13
for.body14.lr.ph.split: ; preds = %for.body14.lr.ph
%add = add nsw i32 %4, 1
%7 = zext i32 %12 to i64
%8 = shl nuw nsw i64 %7, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %Cn, i8 0, i64 %8, i1 false), !tbaa !5
%min.iters.check = icmp ult i32 %12, 8
br i1 %min.iters.check, label %for.body14.preheader, label %vector.ph
vector.ph: ; preds = %for.body14.lr.ph.split
%n.vec = and i64 %7, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, 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 ]
%9 = getelementptr inbounds [1000 x i32], ptr %Ck, i64 0, i64 %index
store <4 x i32> %broadcast.splat, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
store <4 x i32> %broadcast.splat, ptr %10, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %7
br i1 %cmp.n, label %for.cond42.preheader, label %for.body14.preheader
for.body14.preheader: ; preds = %for.body14.lr.ph.split, %middle.block
%indvars.iv195.ph = phi i64 [ 0, %for.body14.lr.ph.split ], [ %n.vec, %middle.block ]
br label %for.body14
for.body5: ; preds = %for.end, %for.body5
%indvars.iv192 = phi i64 [ %indvars.iv.next193, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [1000 x [1000 x i8]], ptr %RC, i64 0, i64 %indvars.iv192
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
%12 = load i32, ptr %R, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp4 = icmp slt i64 %indvars.iv.next193, %13
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !17
for.cond42.preheader: ; preds = %for.body14, %for.end35.us, %middle.block, %for.end, %for.cond12.preheader
%14 = phi i32 [ %12, %for.cond12.preheader ], [ %3, %for.end ], [ %12, %middle.block ], [ %12, %for.end35.us ], [ %12, %for.body14 ]
%15 = load i32, ptr %H, align 4, !tbaa !5
%cmp44.not188 = icmp slt i32 %15, %14
br i1 %cmp44.not188, label %for.end117, label %for.cond47.preheader.preheader
for.cond47.preheader.preheader: ; preds = %for.cond42.preheader
%.pre = load i32, ptr %W, align 4, !tbaa !5
%.pre225 = load i32, ptr %C, align 4, !tbaa !5
br label %for.cond47.preheader
for.body14: ; preds = %for.body14.preheader, %for.body14
%indvars.iv195 = phi i64 [ %indvars.iv.next196, %for.body14 ], [ %indvars.iv195.ph, %for.body14.preheader ]
%arrayidx38 = getelementptr inbounds [1000 x i32], ptr %Ck, i64 0, i64 %indvars.iv195
store i32 %add, ptr %arrayidx38, align 4, !tbaa !5
%indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1
%exitcond.not = icmp eq i64 %indvars.iv.next196, %7
br i1 %exitcond.not, label %for.cond42.preheader, label %for.body14, !llvm.loop !18
for.cond47.preheader: ; preds = %for.cond47.preheader.preheader, %for.inc115
%16 = phi i32 [ %14, %for.cond47.preheader.preheader ], [ %38, %for.inc115 ]
%17 = phi i32 [ %15, %for.cond47.preheader.preheader ], [ %39, %for.inc115 ]
%18 = phi i32 [ %.pre225, %for.cond47.preheader.preheader ], [ %40, %for.inc115 ]
%19 = phi i32 [ %.pre, %for.cond47.preheader.preheader ], [ %41, %for.inc115 ]
%20 = phi i32 [ %.pre225, %for.cond47.preheader.preheader ], [ %42, %for.inc115 ]
%21 = phi i32 [ %.pre, %for.cond47.preheader.preheader ], [ %43, %for.inc115 ]
%indvars.iv222 = phi i64 [ 0, %for.cond47.preheader.preheader ], [ %indvars.iv.next223, %for.inc115 ]
%cmp49.not185 = icmp slt i32 %21, %20
br i1 %cmp49.not185, label %for.inc115, label %for.cond52.preheader.preheader
for.cond52.preheader.preheader: ; preds = %for.cond47.preheader
%22 = trunc i64 %indvars.iv222 to i32
br label %for.cond52.preheader
for.cond52.preheader: ; preds = %for.cond52.preheader.preheader, %for.inc112
%23 = phi i32 [ %36, %for.inc112 ], [ %18, %for.cond52.preheader.preheader ]
%24 = phi i32 [ %37, %for.inc112 ], [ %19, %for.cond52.preheader.preheader ]
%25 = phi i32 [ %36, %for.inc112 ], [ %20, %for.cond52.preheader.preheader ]
%j.1186 = phi i32 [ %inc113, %for.inc112 ], [ 0, %for.cond52.preheader.preheader ]
%26 = load i32, ptr %R, align 4, !tbaa !5
%cmp53172 = icmp sgt i32 %26, 0
br i1 %cmp53172, label %for.body55.lr.ph, label %for.end72
for.body55.lr.ph: ; preds = %for.cond52.preheader
%idxprom59 = sext i32 %j.1186 to i64
%conv64 = sext i32 %25 to i64
%wide.trip.count214 = zext i32 %26 to i64
br label %for.body55
for.body55: ; preds = %for.body55.lr.ph, %for.inc70
%indvars.iv210 = phi i64 [ 0, %for.body55.lr.ph ], [ %indvars.iv.next211, %for.inc70 ]
%27 = add nuw nsw i64 %indvars.iv210, %indvars.iv222
%arrayidx60 = getelementptr inbounds [1000 x [1000 x i8]], ptr %HW, i64 0, i64 %27, i64 %idxprom59
%arrayidx62 = getelementptr inbounds [1000 x [1000 x i8]], ptr %RC, i64 0, i64 %indvars.iv210
%bcmp = call i32 @bcmp(ptr nonnull %arrayidx60, ptr nonnull %arrayidx62, i64 %conv64)
%cmp66.not = icmp eq i32 %bcmp, 0
br i1 %cmp66.not, label %for.inc70, label %for.end72.loopexit
for.inc70: ; preds = %for.body55
%indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1
%exitcond215.not = icmp eq i64 %indvars.iv.next211, %wide.trip.count214
br i1 %exitcond215.not, label %while.body.preheader, label %for.body55, !llvm.loop !19
for.end72.loopexit: ; preds = %for.body55
%28 = trunc i64 %indvars.iv210 to i32
br label %for.end72
for.end72: ; preds = %for.end72.loopexit, %for.cond52.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond52.preheader ], [ %28, %for.end72.loopexit ]
%cmp73180 = icmp eq i32 %cnt.0.lcssa, %26
br i1 %cmp73180, label %while.body.preheader, label %for.end72.for.inc112_crit_edge
while.body.preheader: ; preds = %for.inc70, %for.end72
br label %while.body
for.end72.for.inc112_crit_edge: ; preds = %for.end72
%.pre228 = sub nsw i32 %24, %23
br label %for.inc112
while.body: ; preds = %while.body.preheader, %if.end111
%j.2181 = phi i32 [ %inc76, %if.end111 ], [ %j.1186, %while.body.preheader ]
%call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22, i32 noundef %j.2181)
%inc76 = add nsw i32 %j.2181, 1
%29 = load i32, ptr %W, align 4, !tbaa !5
%30 = load i32, ptr %C, align 4, !tbaa !5
%sub77 = sub nsw i32 %29, %30
%cmp78.not.not = icmp slt i32 %j.2181, %sub77
br i1 %cmp78.not.not, label %for.cond81.preheader, label %for.inc112
for.cond81.preheader: ; preds = %while.body
%31 = load i32, ptr %R, align 4, !tbaa !5
%cmp82176 = icmp sgt i32 %31, 0
br i1 %cmp82176, label %for.body84.preheader, label %if.end111
for.body84.preheader: ; preds = %for.cond81.preheader
%wide.trip.count220 = zext i32 %31 to i64
br label %for.body84
for.body84: ; preds = %for.body84.preheader, %for.inc107
%indvars.iv216 = phi i64 [ 0, %for.body84.preheader ], [ %indvars.iv.next217, %for.inc107 ]
%32 = add nuw nsw i64 %indvars.iv216, %indvars.iv222
%arrayidx89 = getelementptr inbounds [1000 x i32], ptr %Cn, i64 0, i64 %indvars.iv216
%33 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%add90 = add nsw i32 %33, %inc76
%idxprom91 = sext i32 %add90 to i64
%arrayidx92 = getelementptr inbounds [1000 x [1000 x i8]], ptr %HW, i64 0, i64 %32, i64 %idxprom91
%idxprom97 = sext i32 %33 to i64
%arrayidx98 = getelementptr inbounds [1000 x [1000 x i8]], ptr %RC, i64 0, i64 %indvars.iv216, i64 %idxprom97
%arrayidx100 = getelementptr inbounds [1000 x i32], ptr %Ck, i64 0, i64 %indvars.iv216
%34 = load i32, ptr %arrayidx100, align 4, !tbaa !5
%conv101 = sext i32 %34 to i64
%bcmp157 = call i32 @bcmp(ptr nonnull %arrayidx92, ptr nonnull %arrayidx98, i64 %conv101)
%cmp103.not = icmp eq i32 %bcmp157, 0
br i1 %cmp103.not, label %for.inc107, label %if.end111.loopexit.split.loop.exit239
for.inc107: ; preds = %for.body84
%indvars.iv.next217 = add nuw nsw i64 %indvars.iv216, 1
%exitcond221.not = icmp eq i64 %indvars.iv.next217, %wide.trip.count220
br i1 %exitcond221.not, label %if.end111, label %for.body84, !llvm.loop !20
if.end111.loopexit.split.loop.exit239: ; preds = %for.body84
%35 = trunc i64 %indvars.iv216 to i32
br label %if.end111
if.end111: ; preds = %for.inc107, %if.end111.loopexit.split.loop.exit239, %for.cond81.preheader
%cnt.2.lcssa = phi i32 [ 0, %for.cond81.preheader ], [ %35, %if.end111.loopexit.split.loop.exit239 ], [ %31, %for.inc107 ]
%cmp73 = icmp eq i32 %cnt.2.lcssa, %31
br i1 %cmp73, label %while.body, label %for.inc112, !llvm.loop !21
for.inc112: ; preds = %while.body, %if.end111, %for.end72.for.inc112_crit_edge
%sub48.pre-phi = phi i32 [ %.pre228, %for.end72.for.inc112_crit_edge ], [ %sub77, %if.end111 ], [ %sub77, %while.body ]
%36 = phi i32 [ %23, %for.end72.for.inc112_crit_edge ], [ %30, %if.end111 ], [ %30, %while.body ]
%37 = phi i32 [ %24, %for.end72.for.inc112_crit_edge ], [ %29, %if.end111 ], [ %29, %while.body ]
%j.3 = phi i32 [ %j.1186, %for.end72.for.inc112_crit_edge ], [ %inc76, %if.end111 ], [ %inc76, %while.body ]
%inc113 = add nsw i32 %j.3, 1
%cmp49.not.not = icmp slt i32 %j.3, %sub48.pre-phi
br i1 %cmp49.not.not, label %for.cond52.preheader, label %for.inc115.loopexit, !llvm.loop !22
for.inc115.loopexit: ; preds = %for.inc112
%.pre226 = load i32, ptr %H, align 4, !tbaa !5
%.pre227 = load i32, ptr %R, align 4, !tbaa !5
br label %for.inc115
for.inc115: ; preds = %for.inc115.loopexit, %for.cond47.preheader
%38 = phi i32 [ %.pre227, %for.inc115.loopexit ], [ %16, %for.cond47.preheader ]
%39 = phi i32 [ %.pre226, %for.inc115.loopexit ], [ %17, %for.cond47.preheader ]
%40 = phi i32 [ %36, %for.inc115.loopexit ], [ %18, %for.cond47.preheader ]
%41 = phi i32 [ %37, %for.inc115.loopexit ], [ %19, %for.cond47.preheader ]
%42 = phi i32 [ %36, %for.inc115.loopexit ], [ %20, %for.cond47.preheader ]
%43 = phi i32 [ %37, %for.inc115.loopexit ], [ %21, %for.cond47.preheader ]
%indvars.iv.next223 = add nuw nsw i64 %indvars.iv222, 1
%sub43 = sub nsw i32 %39, %38
%44 = sext i32 %sub43 to i64
%cmp44.not.not = icmp slt i64 %indvars.iv222, %44
br i1 %cmp44.not.not, label %for.cond47.preheader, label %for.end117, !llvm.loop !23
for.end117: ; preds = %for.inc115, %for.cond42.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %Cn) #5
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %Ck) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #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
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %RC) #5
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %HW) #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 willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind willreturn memory(argmem: read) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !16, !15}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
|
#include<stdio.h>
#include<stdlib.h>
int comp(const void *a, const void *b) {
return *(int *)a - *(int *)b;
}
int main(){
int n,a[200000],b,i;
long long int ans;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
a[i]-=i+1;
}
qsort(a,n,sizeof(int),comp);
b=a[n/2];
ans=0;
for(i=0;i<n;i++)
ans+=abs(a[i]-b);
printf("%lld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126903/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126903/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%a = alloca [200000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %a) #7
%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 %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 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 %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv.next to i32
%sub = sub nsw i32 %1, %2
store i32 %sub, ptr %arrayidx, align 4, !tbaa !5
%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.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 ], [ %4, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @comp) #7
%5 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %5, 2
%idxprom4 = sext i32 %div to i64
%arrayidx5 = getelementptr inbounds [200000 x i32], ptr %a, i64 0, i64 %idxprom4
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp729 = icmp sgt i32 %5, 0
br i1 %cmp729, label %for.body9.preheader, label %for.end17
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %5, 4
br i1 %min.iters.check, label %for.body9.preheader40, label %vector.ph
vector.ph: ; preds = %for.body9.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
%broadcast.splatinsert = insertelement <2 x i32> poison, i32 %6, i64 0
%broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi38 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%7 = getelementptr inbounds [200000 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <2 x i32>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 2
%wide.load39 = load <2 x i32>, ptr %8, align 8, !tbaa !5
%9 = sub nsw <2 x i32> %wide.load, %broadcast.splat
%10 = sub nsw <2 x i32> %wide.load39, %broadcast.splat
%11 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %9, i1 true)
%12 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %10, i1 true)
%13 = zext <2 x i32> %11 to <2 x i64>
%14 = zext <2 x i32> %12 to <2 x i64>
%15 = add <2 x i64> %vec.phi, %13
%16 = add <2 x i64> %vec.phi38, %14
%index.next = add nuw i64 %index, 4
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %16, %15
%18 = 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 %for.end17, label %for.body9.preheader40
for.body9.preheader40: ; preds = %for.body9.preheader, %middle.block
%indvars.iv35.ph = phi i64 [ 0, %for.body9.preheader ], [ %n.vec, %middle.block ]
%ans.031.ph = phi i64 [ 0, %for.body9.preheader ], [ %18, %middle.block ]
br label %for.body9
for.body9: ; preds = %for.body9.preheader40, %for.body9
%indvars.iv35 = phi i64 [ %indvars.iv.next36, %for.body9 ], [ %indvars.iv35.ph, %for.body9.preheader40 ]
%ans.031 = phi i64 [ %add14, %for.body9 ], [ %ans.031.ph, %for.body9.preheader40 ]
%arrayidx11 = getelementptr inbounds [200000 x i32], ptr %a, i64 0, i64 %indvars.iv35
%19 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%sub12 = sub nsw i32 %19, %6
%20 = call i32 @llvm.abs.i32(i32 %sub12, i1 true)
%conv13 = zext i32 %20 to i64
%add14 = add nuw nsw i64 %ans.031, %conv13
%indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
%exitcond.not = icmp eq i64 %indvars.iv.next36, %wide.trip.count
br i1 %exitcond.not, label %for.end17, label %for.body9, !llvm.loop !14
for.end17: ; preds = %for.body9, %middle.block, %for.end
%ans.0.lcssa = phi i64 [ 0, %for.end ], [ %18, %middle.block ], [ %add14, %for.body9 ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.abs.v2i32(<2 x i32>, i1 immarg) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x 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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!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}
|
#include <stdio.h>
#include <assert.h>
int e,i,n,q,a,v,aa,vv,f[1000000],prev[100000],next[100000],aaa[100000],vvv[100000],head=0;
int main(void){
scanf("%d %d",&n,&q);
for(i=0;i<n;i++)f[i]=0; prev[0]=-1;
for(e=0;e<q;e++){
scanf("%d %d",&a,&v);a--;
f[a]+=v;
prev[e+1]=e;
next[e]=e+1;
aaa[e]=a;
vvv[e]=f[a];
if(v>0){if(f[a]>vv || (f[a]==vv && a<aa)){vv=f[a];aa=a;}}
else if(a==aa){
i=head;aa=0;vv=0;
while(i<=e){
if(vvv[i]!=f[aaa[i]]){
if(prev[i]<0)head=next[i]; else next[prev[i]]=next[i];
prev[next[i]]=prev[i];
}
else{
if(vvv[i]>vv || (vvv[i]==vv && aaa[i]<aa)){vv=vvv[i];aa=aaa[i];}
}
i=next[i];
}
}
printf("%d %d\n",aa+1,vv);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126947/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126947/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@head = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@n = dso_local global i32 0, align 4
@q = dso_local global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@f = dso_local local_unnamed_addr global [1000000 x i32] zeroinitializer, align 16
@prev = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@e = dso_local local_unnamed_addr global i32 0, align 4
@a = dso_local global i32 0, align 4
@v = dso_local global i32 0, align 4
@next = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@aaa = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@vvv = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@vv = dso_local local_unnamed_addr global i32 0, align 4
@aa = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @q)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp97 = icmp sgt i32 %0, 0
br i1 %cmp97, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @f, i8 0, i64 %2, i1 false), !tbaa !5
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%storemerge.lcssa = phi i32 [ 0, %entry ], [ %0, %for.body.preheader ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5
store i32 -1, ptr @prev, align 16, !tbaa !5
store i32 0, ptr @e, align 4, !tbaa !5
%3 = load i32, ptr @q, align 4, !tbaa !5
%cmp2100 = icmp sgt i32 %3, 0
br i1 %cmp2100, label %for.body3, label %for.end88
for.body3: ; preds = %for.end, %if.end83
%call4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @v)
%4 = load i32, ptr @a, align 4, !tbaa !5
%dec = add nsw i32 %4, -1
store i32 %dec, ptr @a, align 4, !tbaa !5
%5 = load i32, ptr @v, align 4, !tbaa !5
%idxprom5 = sext i32 %dec to i64
%arrayidx6 = getelementptr inbounds [1000000 x i32], ptr @f, i64 0, i64 %idxprom5
%6 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %6, %5
store i32 %add, ptr %arrayidx6, align 4, !tbaa !5
%7 = load i32, ptr @e, align 4, !tbaa !5
%add7 = add nsw i32 %7, 1
%idxprom8 = sext i32 %add7 to i64
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr @prev, i64 0, i64 %idxprom8
store i32 %7, ptr %arrayidx9, align 4, !tbaa !5
%idxprom11 = sext i32 %7 to i64
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr @next, i64 0, i64 %idxprom11
store i32 %add7, ptr %arrayidx12, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @aaa, i64 0, i64 %idxprom11
store i32 %dec, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [100000 x i32], ptr @vvv, i64 0, i64 %idxprom11
store i32 %add, ptr %arrayidx18, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %5, 0
br i1 %cmp19, label %if.then, label %if.else
if.then: ; preds = %for.body3
%8 = load i32, ptr @vv, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %add, %8
br i1 %cmp22, label %if.then27, label %lor.lhs.false
lor.lhs.false: ; preds = %if.then
%cmp25 = icmp eq i32 %add, %8
%9 = load i32, ptr @aa, align 4
%cmp26 = icmp sle i32 %4, %9
%or.cond = select i1 %cmp25, i1 %cmp26, i1 false
br i1 %or.cond, label %if.then27, label %if.end83
if.then27: ; preds = %lor.lhs.false, %if.then
store i32 %add, ptr @vv, align 4, !tbaa !5
store i32 %dec, ptr @aa, align 4, !tbaa !5
br label %if.end83
if.else: ; preds = %for.body3
%10 = load i32, ptr @aa, align 4, !tbaa !5
%cmp30 = icmp eq i32 %dec, %10
br i1 %cmp30, label %if.then31, label %if.else.if.end83_crit_edge
if.else.if.end83_crit_edge: ; preds = %if.else
%.pre102 = load i32, ptr @vv, align 4, !tbaa !5
br label %if.end83
if.then31: ; preds = %if.else
%11 = load i32, ptr @head, align 4, !tbaa !5
store i32 %11, ptr @i, align 4, !tbaa !5
store i32 0, ptr @aa, align 4, !tbaa !5
store i32 0, ptr @vv, align 4, !tbaa !5
%cmp32.not99 = icmp sgt i32 %11, %7
br i1 %cmp32.not99, label %if.end83, label %while.body
while.body: ; preds = %if.then31, %if.end79
%12 = phi i32 [ %23, %if.end79 ], [ %11, %if.then31 ]
%13 = phi i32 [ %22, %if.end79 ], [ 0, %if.then31 ]
%14 = phi i32 [ %21, %if.end79 ], [ 0, %if.then31 ]
%idxprom33 = sext i32 %12 to i64
%arrayidx34 = getelementptr inbounds [100000 x i32], ptr @vvv, i64 0, i64 %idxprom33
%15 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%arrayidx36 = getelementptr inbounds [100000 x i32], ptr @aaa, i64 0, i64 %idxprom33
%16 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%idxprom37 = sext i32 %16 to i64
%arrayidx38 = getelementptr inbounds [1000000 x i32], ptr @f, i64 0, i64 %idxprom37
%17 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%cmp39.not = icmp eq i32 %15, %17
br i1 %cmp39.not, label %if.else61, label %if.then40
if.then40: ; preds = %while.body
%arrayidx42 = getelementptr inbounds [100000 x i32], ptr @prev, i64 0, i64 %idxprom33
%18 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%cmp43 = icmp slt i32 %18, 0
%arrayidx46 = getelementptr inbounds [100000 x i32], ptr @next, i64 0, i64 %idxprom33
%19 = load i32, ptr %arrayidx46, align 4, !tbaa !5
br i1 %cmp43, label %if.then44, label %if.else47
if.then44: ; preds = %if.then40
store i32 %19, ptr @head, align 4, !tbaa !5
br label %if.end54
if.else47: ; preds = %if.then40
%idxprom52 = zext i32 %18 to i64
%arrayidx53 = getelementptr inbounds [100000 x i32], ptr @next, i64 0, i64 %idxprom52
store i32 %19, ptr %arrayidx53, align 4, !tbaa !5
%.pre = load i32, ptr %arrayidx46, align 4, !tbaa !5
br label %if.end54
if.end54: ; preds = %if.else47, %if.then44
%20 = phi i32 [ %.pre, %if.else47 ], [ %19, %if.then44 ]
%idxprom59 = sext i32 %20 to i64
%arrayidx60 = getelementptr inbounds [100000 x i32], ptr @prev, i64 0, i64 %idxprom59
store i32 %18, ptr %arrayidx60, align 4, !tbaa !5
br label %if.end79
if.else61: ; preds = %while.body
%cmp64 = icmp sgt i32 %15, %13
br i1 %cmp64, label %if.then73, label %lor.lhs.false65
lor.lhs.false65: ; preds = %if.else61
%cmp68 = icmp eq i32 %15, %13
%cmp72 = icmp slt i32 %16, %14
%or.cond96 = select i1 %cmp68, i1 %cmp72, i1 false
br i1 %or.cond96, label %if.then73, label %if.end79
if.then73: ; preds = %lor.lhs.false65, %if.else61
store i32 %15, ptr @vv, align 4, !tbaa !5
store i32 %16, ptr @aa, align 4, !tbaa !5
br label %if.end79
if.end79: ; preds = %lor.lhs.false65, %if.then73, %if.end54
%21 = phi i32 [ %14, %lor.lhs.false65 ], [ %16, %if.then73 ], [ %14, %if.end54 ]
%22 = phi i32 [ %13, %lor.lhs.false65 ], [ %15, %if.then73 ], [ %13, %if.end54 ]
%arrayidx81 = getelementptr inbounds [100000 x i32], ptr @next, i64 0, i64 %idxprom33
%23 = load i32, ptr %arrayidx81, align 4, !tbaa !5
%cmp32.not = icmp sgt i32 %23, %7
br i1 %cmp32.not, label %while.cond.if.end83.loopexit_crit_edge, label %while.body, !llvm.loop !9
while.cond.if.end83.loopexit_crit_edge: ; preds = %if.end79
store i32 %23, ptr @i, align 4, !tbaa !5
br label %if.end83
if.end83: ; preds = %if.else.if.end83_crit_edge, %if.then31, %while.cond.if.end83.loopexit_crit_edge, %lor.lhs.false, %if.then27
%24 = phi i32 [ 0, %if.then31 ], [ %22, %while.cond.if.end83.loopexit_crit_edge ], [ %.pre102, %if.else.if.end83_crit_edge ], [ %8, %lor.lhs.false ], [ %add, %if.then27 ]
%25 = phi i32 [ 0, %if.then31 ], [ %21, %while.cond.if.end83.loopexit_crit_edge ], [ %10, %if.else.if.end83_crit_edge ], [ %9, %lor.lhs.false ], [ %dec, %if.then27 ]
%add84 = add nsw i32 %25, 1
%call85 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add84, i32 noundef %24)
%26 = load i32, ptr @e, align 4, !tbaa !5
%inc87 = add nsw i32 %26, 1
store i32 %inc87, ptr @e, align 4, !tbaa !5
%27 = load i32, ptr @q, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc87, %27
br i1 %cmp2, label %for.body3, label %for.end88, !llvm.loop !11
for.end88: ; preds = %if.end83, %for.end
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
char s[1000000];
int i;
scanf("%s",s);
for(i=0;s[i]!='\0';i++){
if(i%2 == 0){
printf("%c",s[i]);
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126990/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126990/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1000000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not14 = icmp eq i8 %0, 0
br i1 %cmp.not14, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%conv16.in = phi i8 [ %1, %for.inc ], [ %0, %entry ]
%rem17 = and i64 %indvars.iv, 1
%cmp2 = icmp eq i64 %rem17, 0
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
%conv16 = sext i8 %conv16.in to i32
%putchar12 = call i32 @putchar(i32 %conv16)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [1000000 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %1, 0
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>
/*以下便利なマクロを定義する。*/
#define rep(i, min, max) for(i=min; i<=max; i=i+1)
#define if_forall(i, min, max, prop)\
\
rep(i, min, max)\
{\
if(!(prop))\
{\
break;\
}\
}\
\
if(i==max+1)\
#define if_exists(i, min, max, prop)\
\
rep(i, min, max)\
{\
if(prop)\
{\
break;\
}\
}\
\
if(i<max+1)\
#define sum(i, min, max, sequence, answer)\
{\
answer=0;\
rep(i, min, max)\
{\
answer=answer+sequence;\
}\
}\
#define prod(i, min, max, sequence, answer)\
{\
answer=1;\
rep(i, min, max)\
{\
answer=answer*sequence;\
}\
}\
/*以下便利な関数を定義する。*/
void fill_int(int array[], int min, int max, int element)
{
int i=min;
rep(i, min, max)
{
array[i]=element;
}
}
void fill_char(char array[], int min, int max, char element)
{
int i=min;
rep(i, min, max)
{
array[i]=element;
}
}
void swap_int(int* x, int* y)
{
int tmp;
tmp = *x;
*x = *y;
*y = tmp;
}
void swap_int_array(int x[], int y[], int min, int max)
{
int i;
rep(i, min, max)
{
swap_int(&x[i], &y[i]);
}
}
void swap_char(char* x, char* y)
{
char tmp;
tmp = *x;
*x = *y;
*y = tmp;
}
void swap_char_array(char x[], char y[], int min, int max)
{
int i;
rep(i, min, max)
{
swap_char(&x[i], &y[i]);
}
}
void reverse_char(char array[], int min, int max)
{
int i;
rep(i, min, (min+max)/2)
{
swap_char(&array[i], &array[min+max-i]);
}
}
int max_int(int var1, int var2)
{
int answer=var1;
if(answer<var2)
{
answer=var2;
}
return answer;
}
int min_int(int var1, int var2)
{
int answer=var1;
if(answer>var2)
{
answer=var2;
}
return answer;
}
long int pow_int(int base, unsigned int exponent)
{
long int answer=1;
answer=(long int)pow((double)base, (double)exponent);
return answer;
}
long int pow_int_mod(int base, unsigned int exponent, int mod)
{
long int answer=1;
while (exponent>0)
{
if (exponent&1)
{
answer=(answer*(base%mod))%mod;
if(answer==0)
{
break;
}
}
base=(base*base)%mod;
exponent=exponent>>1;
}
return answer;
}
unsigned long int factorial(unsigned int num)
{
unsigned int i=0;
unsigned long int answer=1;
rep(i, 2, num)
{
answer=answer*i;
}
return answer;
}
unsigned long int factorial_mod(unsigned int num, int mod)
{
unsigned int i=0;
unsigned long int answer=1;
rep(i, 2, num)
{
answer=(answer*(i%mod))%mod;
if(answer==0)
{
break;
}
}
return answer;
}
unsigned long int combination(unsigned int n, unsigned int k)
{
unsigned int i=0;
unsigned long int numerator=1;
unsigned long int denominator=1;
k=min_int(k, n-k);
rep(i, 2, k)
{
numerator=numerator*(n+1-i);
denominator=denominator*i;
}
return numerator/denominator;
}
double combination_general(double alpha, unsigned int k)
{
unsigned int i;
double numerator=1;
unsigned long int denominator=1;
rep(i, 1, k)
{
numerator=numerator*(alpha+1-i);
denominator=denominator*i;
}
return numerator/denominator;
}
int gcd(int a, int b)
{
if(a<b)
{
swap_int(&a, &b);
}
int r=a%b;
while(r!=0)
{
a=b;
b=r;
r=a%b;
}
return b;
}
int lcm(int a, int b)
{
return (a/gcd(a, b))*b;
}
int order(long int num)
{
int answer=-1;
while(num!=0)
{
num=num/10;
answer=answer+1;
}
return answer;
}
long int convert_adic_int(char num[], unsigned int p_adic, unsigned int q_adic)
{
int i=0;
long int answer=0;
bool sgn=0;
long int tmp=strtol(num, NULL, p_adic);
if(tmp<0)
{
sgn=1;
tmp=-tmp;
}
while(tmp>0)
{
answer=answer+(tmp%q_adic)*pow_int(10, i);
tmp=tmp/q_adic;
i=i+1;
}
if(sgn==0)
{
return answer;
}
else
{
return -answer;
}
}
void convert_adic_char(char num[], unsigned int p_adic, unsigned int q_adic)
{
int i=0;
int mod[32]={0};
bool sgn=0;
int digit=0;
long int tmp=strtol(num, NULL, p_adic);
if(tmp<0)
{
sgn=1;
tmp=-tmp;
}
while(tmp>0)
{
mod[i]=tmp%q_adic;
digit=i;
tmp=tmp/q_adic;
i=i+1;
}
fill_char(num, 0, strlen(num)-1, '\0');
if(sgn==1)
{
num[0]='-';
}
rep(i, 0, digit)
{
if(mod[i]<10)
{
num[sgn+digit-i]='0'+mod[i];
}
else if(mod[i]<q_adic)
{
num[sgn+digit-i]='a'+(mod[i]-10);
}
}
}
int count_mod(int min, int max, int num)
{
if(min>0)
{
return max/num-(min-1)/num;
}
else if(min==0)
{
return max/num+1;
}
else
{
return -1;
}
}
void shift_char(char array[], int min, int max, int num)
{
int i;
for(i=max; i>=min; i=i-1)
{
array[i+num]=array[i];
}
rep(i, min, min+num-1)
{
array[i]='\0';
}
}
void convert_char(char array[], int min, int max, char pre, char post)
{
int i=min;
rep(i, min, max)
{
if(array[i]==pre)
{
array[i]=post;
}
}
}
void sort_asc_int(int array[], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(array[i]>array[j])
{
swap_int(&array[i], &array[j]);
}
}
}
}
void sort_des_int(int array[], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(array[i]<array[j])
{
swap_int(&array[i], &array[j]);
}
}
}
}
void sort_asc_char_dic(int size, char array[][size], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(strcmp(array[i], array[j])>0)
{
swap_char_array(array[i], array[j], 0, size-1);
}
}
}
}
void sort_des_char_dic(int size, char array[][size], int min, int max)
{
int i, j;
rep(i, min, max)
{
rep(j, i+1, max)
{
if(strcmp(array[i], array[j])<0)
{
swap_char_array(array[i], array[j], 0, size-1);
}
}
}
}
int max_int_array(int array[], int min, int max)
{
int i;
int answer;
answer=array[min];
for(i=min+1; i<=max; i=i+1)
{
answer=max_int(answer, array[i]);
}
return answer;
}
void max_int_array_num(int array[], int min, int max, int answer[])
{
int i=min;
int count=0;
int max_value=max_int_array(array, min, max);
fill_int(answer, 0, max-min, -1);
rep(i, min, max)
{
if(array[i]==max_value)
{
answer[count]=i;
count=count+1;
}
}
}
int min_int_array(int array[], int min, int max)
{
int i;
int answer;
answer=array[min];
for(i=min+1; i<=max; i=i+1)
{
answer=min_int(answer, array[i]);
}
return answer;
}
void min_int_array_num(int array[], int min, int max, int answer[])
{
int i=min;
int count=0;
int min_value=min_int_array(array, min, max);
fill_int(answer, 0, max-min, -1);
rep(i, min, max)
{
if(array[i]==min_value)
{
answer[count]=i;
count=count+1;
}
}
}
int max_char_dic(int size, char array[][size], int min, int max)
{
int i;
int answer=min;
rep(i, min+1, max)
{
if(strcmp(array[answer], array[i])<0)
{
answer=i;
}
}
return answer;
}
int min_char_dic(int size, char array[][size], int min, int max)
{
int i;
int answer=min;
rep(i, min+1, max)
{
if(strcmp(array[answer], array[i])>0)
{
answer=i;
}
}
return answer;
}
int sum_array(int array[], int min, int max)
{
int i=min;
int answer=0;
rep(i, min, max)
{
answer=answer+array[i];
}
return answer;
}
bool detect_int(int array[], int min, int max, int element)
{
int i;
bool answer=0;
if_exists(i, min, max, array[i]==element)
{
answer=1;
}
return answer;
}
bool detect_char(char array[], int min, int max, char element[], int start, int goal)
{
int i, j;
bool answer=0;
if(goal-start<=max-min)
{
for(i=min; i<=max-(goal-start); i=i+1)
{
if_forall(j, start, goal, array[i+j-start]==element[j])
{
answer=1;
break;
}
}
}
return answer;
}
int count_differentelement_int(int array[], int min, int max)
{
int i=min;
int pickup[max];
fill_int(pickup, 0, max, 0);
int answer=0;
rep(i, min, max)
{
if(detect_int(pickup, 0, answer-1, array[i])==0)
{
pickup[answer]=array[i];
answer=answer+1;
}
}
return answer;
}
int count_differentelement_char(char array[], int min, int max)
{
int i=min;
char pickup[max];
fill_char(pickup, 0, max, '\0');
int answer=0;
rep(i, min, max)
{
if(detect_char(pickup, 0, answer-1, array, i, i)==0)
{
pickup[answer]=array[i];
answer=answer+1;
}
}
return answer;
}
int count_equalelement_int(int array[], int min, int max, int element)
{
int i;
int answer=0;
rep(i, min, max)
{
if(array[i]==element)
{
answer=answer+1;
}
}
return answer;
}
int count_equalelement_char(char array[], int min, int max, char element)
{
int i;
int answer=0;
rep(i, min, max)
{
if(array[i]==element)
{
answer=answer+1;
}
}
return answer;
}
void scanf_int_array(int array[], int min, int max)
{
int i;
rep(i, min, max)
{
scanf("%d", &array[i]);
}
}
void scanf_int_array_2(int array1[], int array2[], int min, int max)
{
int i;
rep(i, min, max)
{
scanf("%d %d", &array1[i], &array2[i]);
}
}
void scanf_int_array_3(int array1[], int array2[], int array3[], int min, int max)
{
int i;
rep(i, min, max)
{
scanf("%d %d %d", &array1[i], &array2[i], &array3[i]);
}
}
void scanf_char_array(char array[], int num)
{
scanf("%s", array);
shift_char(array, 0, strlen(array)-1, num);
}
void printf_int_array(int array[], int min, int max)
{
int i;
rep(i, min, max)
{
printf("%d\n", array[i]);
}
}
void printf_char_array(char array[], int min, int max)
{
int i;
for(i=min; i<=max; i=i+1)
{
printf("%c", array[i]);
}
}
int main()
{
int i;
char s[100002]={};
scanf("%s", s);
char odd[strlen(s)/2+2];
fill_char(odd, 0, strlen(s)/2+1, '\0');
rep(i, 0, strlen(s)/2+1)
{
odd[i]=s[2*i];
}
printf_char_array(odd, 0, strlen(odd)-1);
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127032/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127032/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable
define dso_local void @fill_int(ptr nocapture noundef writeonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp sgt i32 %min, %max
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
store <4 x i32> %broadcast.splat, ptr %gep, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %gep, i64 4
store <4 x i32> %broadcast.splat, ptr %5, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader7 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
store i32 %element, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @fill_char(ptr nocapture noundef writeonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp sgt i32 %min, %max
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%scevgep = getelementptr i8, ptr %array, i64 %0
%1 = sub i32 %max, %min
%2 = zext i32 %1 to i64
%3 = add nuw nsw i64 %2, 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 %element, i64 %3, i1 false), !tbaa !14
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap_int(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @swap_int_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 15
br i1 %min.iters.check, label %for.body.preheader15, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%5 = shl nsw i64 %0, 2
%scevgep = getelementptr i8, ptr %x, i64 %5
%6 = sub i32 %max, %min
%7 = zext i32 %6 to i64
%8 = add nsw i64 %0, %7
%9 = shl nsw i64 %8, 2
%10 = add nsw i64 %9, 4
%scevgep9 = getelementptr i8, ptr %x, i64 %10
%scevgep10 = getelementptr i8, ptr %y, i64 %5
%scevgep11 = getelementptr i8, ptr %y, i64 %10
%bound0 = icmp ult ptr %scevgep, %scevgep11
%bound1 = icmp ult ptr %scevgep10, %scevgep9
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = add i64 %index, %0
%11 = getelementptr inbounds i32, ptr %x, i64 %offset.idx
%12 = getelementptr inbounds i32, ptr %y, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5, !alias.scope !15, !noalias !18
%13 = getelementptr inbounds i32, ptr %11, i64 4
%wide.load12 = load <4 x i32>, ptr %13, align 4, !tbaa !5, !alias.scope !15, !noalias !18
%wide.load13 = load <4 x i32>, ptr %12, align 4, !tbaa !5, !alias.scope !18
%14 = getelementptr inbounds i32, ptr %12, i64 4
%wide.load14 = load <4 x i32>, ptr %14, align 4, !tbaa !5, !alias.scope !18
store <4 x i32> %wide.load13, ptr %11, align 4, !tbaa !5, !alias.scope !15, !noalias !18
store <4 x i32> %wide.load14, ptr %13, align 4, !tbaa !5, !alias.scope !15, !noalias !18
store <4 x i32> %wide.load, ptr %12, align 4, !tbaa !5, !alias.scope !18
store <4 x i32> %wide.load12, ptr %14, align 4, !tbaa !5, !alias.scope !18
%index.next = add nuw i64 %index, 8
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %vector.memcheck ], [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%16 = add i32 %max, 1
%17 = trunc i64 %indvars.iv.ph to i32
%18 = sub i32 %16, %17
%xtraiter = and i32 %18, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader15
%arrayidx.prol = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.ph
%arrayidx2.prol = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.ph
%19 = load i32, ptr %arrayidx.prol, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
store i32 %20, ptr %arrayidx.prol, align 4, !tbaa !5
store i32 %19, ptr %arrayidx2.prol, align 4, !tbaa !5
%indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader15
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader15 ], [ %indvars.iv.next.prol, %for.body.prol ]
%21 = icmp eq i32 %17, %max
br i1 %21, label %for.end, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv
%22 = load i32, ptr %arrayidx, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %23, ptr %arrayidx, align 4, !tbaa !5
store i32 %22, ptr %arrayidx2, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next
%arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next
%24 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
store i32 %25, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %24, ptr %arrayidx2.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
%exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !21
for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap_char(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %x, align 1, !tbaa !14
%1 = load i8, ptr %y, align 1, !tbaa !14
store i8 %1, ptr %x, align 1, !tbaa !14
store i8 %0, ptr %y, align 1, !tbaa !14
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @swap_char_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck
vector.memcheck: ; preds = %iter.check
%scevgep = getelementptr i8, ptr %x, i64 %0
%5 = sub i32 %max, %min
%6 = zext i32 %5 to i64
%7 = add nsw i64 %0, %6
%8 = add nsw i64 %7, 1
%scevgep9 = getelementptr i8, ptr %x, i64 %8
%scevgep10 = getelementptr i8, ptr %y, i64 %0
%scevgep11 = getelementptr i8, ptr %y, i64 %8
%bound0 = icmp ult ptr %scevgep, %scevgep11
%bound1 = icmp ult ptr %scevgep10, %scevgep9
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check12 = icmp ult i32 %2, 31
br i1 %min.iters.check12, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %4, 8589934560
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = add i64 %index, %0
%9 = getelementptr inbounds i8, ptr %x, i64 %offset.idx
%10 = getelementptr inbounds i8, ptr %y, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %9, align 1, !tbaa !14, !alias.scope !22, !noalias !25
%11 = getelementptr inbounds i8, ptr %9, i64 16
%wide.load13 = load <16 x i8>, ptr %11, align 1, !tbaa !14, !alias.scope !22, !noalias !25
%wide.load14 = load <16 x i8>, ptr %10, align 1, !tbaa !14, !alias.scope !25
%12 = getelementptr inbounds i8, ptr %10, i64 16
%wide.load15 = load <16 x i8>, ptr %12, align 1, !tbaa !14, !alias.scope !25
store <16 x i8> %wide.load14, ptr %9, align 1, !tbaa !14, !alias.scope !22, !noalias !25
store <16 x i8> %wide.load15, ptr %11, align 1, !tbaa !14, !alias.scope !22, !noalias !25
store <16 x i8> %wide.load, ptr %10, align 1, !tbaa !14, !alias.scope !25
store <16 x i8> %wide.load13, ptr %12, align 1, !tbaa !14, !alias.scope !25
%index.next = add nuw i64 %index, 32
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !27
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end18 = add nsw i64 %n.vec, %0
%n.vec.remaining = and i64 %4, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec17 = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec17, %0
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index20 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next24, %vec.epilog.vector.body ]
%offset.idx21 = add i64 %index20, %0
%14 = getelementptr inbounds i8, ptr %x, i64 %offset.idx21
%15 = getelementptr inbounds i8, ptr %y, i64 %offset.idx21
%wide.load22 = load <8 x i8>, ptr %14, align 1, !tbaa !14, !alias.scope !28, !noalias !31
%wide.load23 = load <8 x i8>, ptr %15, align 1, !tbaa !14, !alias.scope !31
store <8 x i8> %wide.load23, ptr %14, align 1, !tbaa !14, !alias.scope !28, !noalias !31
store <8 x i8> %wide.load22, ptr %15, align 1, !tbaa !14, !alias.scope !31
%index.next24 = add nuw i64 %index20, 8
%16 = icmp eq i64 %index.next24, %n.vec17
br i1 %16, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !33
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n19 = icmp eq i64 %4, %n.vec17
br i1 %cmp.n19, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %ind.end18, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
%17 = add i32 %max, 1
%18 = trunc i64 %indvars.iv.ph to i32
%19 = sub i32 %17, %18
%xtraiter = and i32 %19, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx.prol = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.ph
%arrayidx2.prol = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.ph
%20 = load i8, ptr %arrayidx.prol, align 1, !tbaa !14
%21 = load i8, ptr %arrayidx2.prol, align 1, !tbaa !14
store i8 %21, ptr %arrayidx.prol, align 1, !tbaa !14
store i8 %20, ptr %arrayidx2.prol, align 1, !tbaa !14
%indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ]
%22 = icmp eq i32 %18, %max
br i1 %22, label %for.end, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds i8, ptr %x, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv
%23 = load i8, ptr %arrayidx, align 1, !tbaa !14
%24 = load i8, ptr %arrayidx2, align 1, !tbaa !14
store i8 %24, ptr %arrayidx, align 1, !tbaa !14
store i8 %23, ptr %arrayidx2, align 1, !tbaa !14
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.next
%arrayidx2.1 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.next
%25 = load i8, ptr %arrayidx.1, align 1, !tbaa !14
%26 = load i8, ptr %arrayidx2.1, align 1, !tbaa !14
store i8 %26, ptr %arrayidx.1, align 1, !tbaa !14
store i8 %25, ptr %arrayidx2.1, align 1, !tbaa !14
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
%exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !34
for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @reverse_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%add = add nsw i32 %max, %min
%div = sdiv i32 %add, 2
%cmp.not12 = icmp slt i32 %div, %min
br i1 %cmp.not12, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = sext i32 %add to i64
%2 = add nsw i32 %div, 1
%3 = add nsw i32 %div, 1
%4 = sub i32 %3, %min
%xtraiter = and i32 %4, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx.prol = getelementptr inbounds i8, ptr %array, i64 %0
%5 = sub nsw i64 %1, %0
%arrayidx3.prol = getelementptr inbounds i8, ptr %array, i64 %5
%6 = load i8, ptr %arrayidx.prol, align 1, !tbaa !14
%7 = load i8, ptr %arrayidx3.prol, align 1, !tbaa !14
store i8 %7, ptr %arrayidx.prol, align 1, !tbaa !14
store i8 %6, ptr %arrayidx3.prol, align 1, !tbaa !14
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ]
%8 = icmp eq i32 %div, %min
br i1 %8, label %for.end, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%9 = sub nsw i64 %1, %indvars.iv
%arrayidx3 = getelementptr inbounds i8, ptr %array, i64 %9
%10 = load i8, ptr %arrayidx, align 1, !tbaa !14
%11 = load i8, ptr %arrayidx3, align 1, !tbaa !14
store i8 %11, ptr %arrayidx, align 1, !tbaa !14
store i8 %10, ptr %arrayidx3, align 1, !tbaa !14
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next
%12 = sub nsw i64 %1, %indvars.iv.next
%arrayidx3.1 = getelementptr inbounds i8, ptr %array, i64 %12
%13 = load i8, ptr %arrayidx.1, align 1, !tbaa !14
%14 = load i8, ptr %arrayidx3.1, align 1, !tbaa !14
store i8 %14, ptr %arrayidx.1, align 1, !tbaa !14
store i8 %13, ptr %arrayidx3.1, align 1, !tbaa !14
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
%exitcond.not.1 = icmp eq i32 %2, %lftr.wideiv.1
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !35
for.end: ; preds = %for.body.prol.loopexit, %for.body, %entry
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max_int(i32 noundef %var1, i32 noundef %var2) local_unnamed_addr #5 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %var1, i32 %var2)
ret i32 %spec.select
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min_int(i32 noundef %var1, i32 noundef %var2) local_unnamed_addr #5 {
entry:
%spec.select = tail call i32 @llvm.smin.i32(i32 %var1, i32 %var2)
ret i32 %spec.select
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @pow_int(i32 noundef %base, i32 noundef %exponent) local_unnamed_addr #6 {
entry:
%conv = sitofp i32 %base to double
%conv1 = uitofp i32 %exponent to double
%call = tail call double @pow(double noundef %conv, double noundef %conv1) #24
%conv2 = fptosi double %call to i64
ret i64 %conv2
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #7
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @pow_int_mod(i32 noundef %base, i32 noundef %exponent, i32 noundef %mod) local_unnamed_addr #8 {
entry:
%cmp.not17 = icmp eq i32 %exponent, 0
br i1 %cmp.not17, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%conv1 = sext i32 %mod to i64
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end6
%answer.020 = phi i64 [ 1, %while.body.lr.ph ], [ %answer.1, %if.end6 ]
%base.addr.019 = phi i32 [ %base, %while.body.lr.ph ], [ %rem8, %if.end6 ]
%exponent.addr.018 = phi i32 [ %exponent, %while.body.lr.ph ], [ %shr, %if.end6 ]
%and = and i32 %exponent.addr.018, 1
%tobool.not = icmp eq i32 %and, 0
br i1 %tobool.not, label %if.end6, label %if.then
if.then: ; preds = %while.body
%rem = srem i32 %base.addr.019, %mod
%conv = sext i32 %rem to i64
%mul = mul nsw i64 %answer.020, %conv
%rem2 = srem i64 %mul, %conv1
%cmp3 = icmp eq i64 %rem2, 0
br i1 %cmp3, label %while.end, label %if.end6
if.end6: ; preds = %if.then, %while.body
%answer.1 = phi i64 [ %rem2, %if.then ], [ %answer.020, %while.body ]
%mul7 = mul nsw i32 %base.addr.019, %base.addr.019
%rem8 = srem i32 %mul7, %mod
%shr = lshr i32 %exponent.addr.018, 1
%cmp.not = icmp ult i32 %exponent.addr.018, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !36
while.end: ; preds = %if.end6, %if.then, %entry
%answer.2 = phi i64 [ 1, %entry ], [ 0, %if.then ], [ %answer.1, %if.end6 ]
ret i64 %answer.2
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @factorial(i32 noundef %num) local_unnamed_addr #9 {
entry:
%cmp.not4 = icmp ult i32 %num, 2
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = add i32 %num, 1
%umax = tail call i32 @llvm.umax.i32(i32 %0, i32 3)
%wide.trip.count = zext i32 %umax to i64
%1 = add nsw i64 %wide.trip.count, -2
%2 = add nsw i64 %wide.trip.count, -3
%xtraiter = and i64 %1, 7
%3 = icmp ult i64 %2, 7
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %1, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next.7, %for.body ]
%answer.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul i64 %answer.06, %indvars.iv
%indvars.iv.next = or i64 %indvars.iv, 1
%mul.1 = mul i64 %mul, %indvars.iv.next
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul i64 %mul.1, %indvars.iv.next.1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul i64 %mul.2, %indvars.iv.next.2
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%mul.4 = mul i64 %mul.3, %indvars.iv.next.3
%indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5
%mul.5 = mul i64 %mul.4, %indvars.iv.next.4
%indvars.iv.next.5 = add nuw nsw i64 %indvars.iv, 6
%mul.6 = mul i64 %mul.5, %indvars.iv.next.5
%indvars.iv.next.6 = add nuw nsw i64 %indvars.iv, 7
%mul.7 = mul i64 %mul.6, %indvars.iv.next.6
%indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !37
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%indvars.iv.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next.7, %for.body ]
%answer.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%answer.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %answer.06.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul i64 %answer.06.epil, %indvars.iv.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !38
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%answer.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @factorial_mod(i32 noundef %num, i32 noundef %mod) local_unnamed_addr #8 {
entry:
%cmp.not10 = icmp ult i32 %num, 2
br i1 %cmp.not10, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%conv1 = sext i32 %mod to i64
br label %for.body
for.cond: ; preds = %for.body
%add = add i32 %i.011, 1
%cmp.not = icmp ugt i32 %add, %num
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !40
for.body: ; preds = %for.body.lr.ph, %for.cond
%answer.012 = phi i64 [ 1, %for.body.lr.ph ], [ %rem2, %for.cond ]
%i.011 = phi i32 [ 2, %for.body.lr.ph ], [ %add, %for.cond ]
%rem = urem i32 %i.011, %mod
%conv = zext i32 %rem to i64
%mul = mul i64 %answer.012, %conv
%rem2 = urem i64 %mul, %conv1
%cmp3 = icmp eq i64 %rem2, 0
br i1 %cmp3, label %for.end, label %for.cond
for.end: ; preds = %for.cond, %for.body, %entry
%answer.1 = phi i64 [ 1, %entry ], [ 0, %for.body ], [ %rem2, %for.cond ]
ret i64 %answer.1
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @combination(i32 noundef %n, i32 noundef %k) local_unnamed_addr #9 {
entry:
%sub = sub i32 %n, %k
%spec.select.i = tail call i32 @llvm.smin.i32(i32 %k, i32 %sub)
%cmp.not13 = icmp ult i32 %spec.select.i, 2
br i1 %cmp.not13, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add i32 %n, 1
%0 = add i32 %spec.select.i, 1
%umax = tail call i32 @llvm.umax.i32(i32 %0, i32 3)
%wide.trip.count = zext i32 %umax to i64
%1 = add nsw i64 %wide.trip.count, -2
%2 = add nsw i64 %wide.trip.count, -3
%xtraiter = and i64 %1, 3
%3 = icmp ult i64 %2, 3
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %1, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 2, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ]
%denominator.016 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul3.3, %for.body ]
%numerator.015 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul.3, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%4 = trunc i64 %indvars.iv to i32
%sub1 = sub i32 %add, %4
%conv = zext i32 %sub1 to i64
%mul = mul i64 %numerator.015, %conv
%mul3 = mul i64 %denominator.016, %indvars.iv
%indvars.iv.next = or i64 %indvars.iv, 1
%5 = trunc i64 %indvars.iv.next to i32
%sub1.1 = sub i32 %add, %5
%conv.1 = zext i32 %sub1.1 to i64
%mul.1 = mul i64 %mul, %conv.1
%mul3.1 = mul i64 %mul3, %indvars.iv.next
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%6 = trunc i64 %indvars.iv.next.1 to i32
%sub1.2 = sub i32 %add, %6
%conv.2 = zext i32 %sub1.2 to i64
%mul.2 = mul i64 %mul.1, %conv.2
%mul3.2 = mul i64 %mul3.1, %indvars.iv.next.1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%7 = trunc i64 %indvars.iv.next.2 to i32
%sub1.3 = sub i32 %add, %7
%conv.3 = zext i32 %sub1.3 to i64
%mul.3 = mul i64 %mul.2, %conv.3
%mul3.3 = mul i64 %mul3.2, %indvars.iv.next.2
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !41
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul.3, %for.body ]
%mul3.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul3.3, %for.body ]
%indvars.iv.unr = phi i64 [ 2, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ]
%denominator.016.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul3.3, %for.body ]
%numerator.015.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%denominator.016.epil = phi i64 [ %mul3.epil, %for.body.epil ], [ %denominator.016.unr, %for.end.loopexit.unr-lcssa ]
%numerator.015.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %numerator.015.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%8 = trunc i64 %indvars.iv.epil to i32
%sub1.epil = sub i32 %add, %8
%conv.epil = zext i32 %sub1.epil to i64
%mul.epil = mul i64 %numerator.015.epil, %conv.epil
%mul3.epil = mul i64 %denominator.016.epil, %indvars.iv.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end.loopexit, label %for.body.epil, !llvm.loop !42
for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa
%mul.lcssa = phi i64 [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
%mul3.lcssa = phi i64 [ %mul3.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul3.epil, %for.body.epil ]
%9 = udiv i64 %mul.lcssa, %mul3.lcssa
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%div = phi i64 [ 1, %entry ], [ %9, %for.end.loopexit ]
ret i64 %div
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local double @combination_general(double noundef %alpha, i32 noundef %k) local_unnamed_addr #9 {
entry:
%cmp.not10 = icmp eq i32 %k, 0
br i1 %cmp.not10, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = fadd double %alpha, 1.000000e+00
%0 = add i32 %k, 1
%umax = tail call i32 @llvm.umax.i32(i32 %0, i32 2)
%wide.trip.count = zext i32 %umax to i64
%1 = add nsw i64 %wide.trip.count, -1
%2 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %1, 3
%3 = icmp ult i64 %2, 3
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %1, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 1, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ]
%denominator.013 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul2.3, %for.body ]
%numerator.012 = phi double [ 1.000000e+00, %for.body.lr.ph.new ], [ %mul.3, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%4 = trunc i64 %indvars.iv to i32
%conv = uitofp i32 %4 to double
%sub = fsub double %add, %conv
%mul = fmul double %numerator.012, %sub
%mul2 = mul i64 %denominator.013, %indvars.iv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = trunc i64 %indvars.iv.next to i32
%conv.1 = uitofp i32 %5 to double
%sub.1 = fsub double %add, %conv.1
%mul.1 = fmul double %mul, %sub.1
%mul2.1 = mul i64 %mul2, %indvars.iv.next
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%6 = trunc i64 %indvars.iv.next.1 to i32
%conv.2 = uitofp i32 %6 to double
%sub.2 = fsub double %add, %conv.2
%mul.2 = fmul double %mul.1, %sub.2
%mul2.2 = mul i64 %mul2.1, %indvars.iv.next.1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%7 = trunc i64 %indvars.iv.next.2 to i32
%conv.3 = uitofp i32 %7 to double
%sub.3 = fsub double %add, %conv.3
%mul.3 = fmul double %mul.2, %sub.3
%mul2.3 = mul i64 %mul2.2, %indvars.iv.next.2
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !43
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.lcssa.ph = phi double [ undef, %for.body.lr.ph ], [ %mul.3, %for.body ]
%mul2.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul2.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ]
%denominator.013.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul2.3, %for.body ]
%numerator.012.unr = phi double [ 1.000000e+00, %for.body.lr.ph ], [ %mul.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%denominator.013.epil = phi i64 [ %mul2.epil, %for.body.epil ], [ %denominator.013.unr, %for.end.loopexit.unr-lcssa ]
%numerator.012.epil = phi double [ %mul.epil, %for.body.epil ], [ %numerator.012.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%8 = trunc i64 %indvars.iv.epil to i32
%conv.epil = uitofp i32 %8 to double
%sub.epil = fsub double %add, %conv.epil
%mul.epil = fmul double %numerator.012.epil, %sub.epil
%mul2.epil = mul i64 %denominator.013.epil, %indvars.iv.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end.loopexit, label %for.body.epil, !llvm.loop !44
for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa
%mul.lcssa = phi double [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
%mul2.lcssa = phi i64 [ %mul2.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul2.epil, %for.body.epil ]
%9 = uitofp i64 %mul2.lcssa to double
%10 = fdiv double %mul.lcssa, %9
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%div = phi double [ 1.000000e+00, %entry ], [ %10, %for.end.loopexit ]
ret double %div
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #9 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
%spec.select8 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%rem = srem i32 %spec.select, %spec.select8
%cmp1.not9 = icmp eq i32 %rem, 0
br i1 %cmp1.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.011 = phi i32 [ %rem2, %while.body ], [ %rem, %entry ]
%b.addr.110 = phi i32 [ %r.011, %while.body ], [ %spec.select8, %entry ]
%rem2 = srem i32 %b.addr.110, %r.011
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !45
while.end: ; preds = %while.body, %entry
%b.addr.1.lcssa = phi i32 [ %spec.select8, %entry ], [ %r.011, %while.body ]
ret i32 %b.addr.1.lcssa
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #9 {
entry:
%spec.select.i = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
%spec.select8.i = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%rem.i = srem i32 %spec.select.i, %spec.select8.i
%cmp1.not9.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.not9.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%r.011.i = phi i32 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ]
%b.addr.110.i = phi i32 [ %r.011.i, %while.body.i ], [ %spec.select8.i, %entry ]
%rem2.i = srem i32 %b.addr.110.i, %r.011.i
%cmp1.not.i = icmp eq i32 %rem2.i, 0
br i1 %cmp1.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !45
gcd.exit: ; preds = %while.body.i, %entry
%b.addr.1.lcssa.i = phi i32 [ %spec.select8.i, %entry ], [ %r.011.i, %while.body.i ]
%div = sdiv i32 %a, %b.addr.1.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @order(i64 noundef %num) local_unnamed_addr #8 {
entry:
%cmp.not3 = icmp eq i64 %num, 0
br i1 %cmp.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%answer.05 = phi i32 [ %add, %while.body ], [ -1, %entry ]
%num.addr.04 = phi i64 [ %div, %while.body ], [ %num, %entry ]
%div = sdiv i64 %num.addr.04, 10
%add = add nsw i32 %answer.05, 1
%num.addr.04.off = add i64 %num.addr.04, 9
%cmp.not = icmp ult i64 %num.addr.04.off, 19
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !46
while.end: ; preds = %while.body, %entry
%answer.0.lcssa = phi i32 [ -1, %entry ], [ %add, %while.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @convert_adic_int(ptr nocapture noundef readonly %num, i32 noundef %p_adic, i32 noundef %q_adic) local_unnamed_addr #10 {
entry:
%call = tail call i64 @strtol(ptr nocapture noundef %num, ptr noundef null, i32 noundef %p_adic) #24
%cmp122.not = icmp eq i64 %call, 0
br i1 %cmp122.not, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%spec.select = tail call i64 @llvm.abs.i64(i64 %call, i1 true)
%conv = zext i32 %q_adic to i64
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%tmp.125 = phi i64 [ %spec.select, %while.body.lr.ph ], [ %div, %while.body ]
%answer.024 = phi i64 [ 0, %while.body.lr.ph ], [ %add, %while.body ]
%i.023 = phi i32 [ 0, %while.body.lr.ph ], [ %add4, %while.body ]
%rem = urem i64 %tmp.125, %conv
%conv1.i = uitofp i32 %i.023 to double
%call.i = tail call double @pow(double noundef 1.000000e+01, double noundef %conv1.i) #24
%conv2.i = fptosi double %call.i to i64
%mul = mul nsw i64 %rem, %conv2.i
%add = add nsw i64 %mul, %answer.024
%div = udiv i64 %tmp.125, %conv
%add4 = add nuw nsw i32 %i.023, 1
%cmp1.not = icmp ult i64 %tmp.125, %conv
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !47
while.end: ; preds = %while.body, %entry
%answer.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
%sub9 = sub nsw i64 0, %answer.0.lcssa
%cmp621 = icmp slt i64 %call, 0
%retval.0 = select i1 %cmp621, i64 %sub9, i64 %answer.0.lcssa
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #11
; Function Attrs: nofree nounwind uwtable
define dso_local void @convert_adic_char(ptr nocapture noundef %num, i32 noundef %p_adic, i32 noundef %q_adic) local_unnamed_addr #10 {
entry:
%mod = alloca [32 x i32], align 16
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %mod) #24
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %mod, i8 0, i64 128, i1 false)
%call = tail call i64 @strtol(ptr nocapture noundef %num, ptr noundef null, i32 noundef %p_adic) #24
%cmp = icmp slt i64 %call, 0
%cmp174.not = icmp eq i64 %call, 0
br i1 %cmp174.not, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%spec.select = tail call i64 @llvm.abs.i64(i64 %call, i1 true)
%conv = zext i32 %q_adic to i64
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next, %while.body ]
%tmp.176 = phi i64 [ %spec.select, %while.body.lr.ph ], [ %div, %while.body ]
%rem = urem i64 %tmp.176, %conv
%conv2 = trunc i64 %rem to i32
%arrayidx = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv
store i32 %conv2, ptr %arrayidx, align 4, !tbaa !5
%div = udiv i64 %tmp.176, %conv
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%cmp1.not = icmp ult i64 %tmp.176, %conv
br i1 %cmp1.not, label %while.end.loopexit, label %while.body, !llvm.loop !48
while.end.loopexit: ; preds = %while.body
%0 = trunc i64 %indvars.iv to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%digit.0.lcssa = phi i32 [ 0, %entry ], [ %0, %while.end.loopexit ]
%call4 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num) #25
%1 = trunc i64 %call4 to i32
%conv6 = add i32 %1, -1
%cmp.not4.i = icmp slt i32 %conv6, 0
br i1 %cmp.not4.i, label %fill_char.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %while.end
%2 = zext i32 %conv6 to i64
%3 = add nuw nsw i64 %2, 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %num, i8 0, i64 %3, i1 false), !tbaa !14
br label %fill_char.exit
fill_char.exit: ; preds = %while.end, %for.body.preheader.i
%call.lobit = lshr i64 %call, 63
%conv7 = trunc i64 %call.lobit to i32
br i1 %cmp, label %if.then10, label %if.end12
if.then10: ; preds = %fill_char.exit
store i8 45, ptr %num, align 1, !tbaa !14
br label %if.end12
if.end12: ; preds = %if.then10, %fill_char.exit
%add42 = add nuw nsw i32 %digit.0.lcssa, %conv7
%4 = add i32 %digit.0.lcssa, 1
%wide.trip.count = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 16
br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %if.end12
%5 = add nsw i64 %wide.trip.count, -1
%6 = add i32 %digit.0.lcssa, %conv7
%7 = trunc i64 %5 to i32
%8 = sub i32 %6, %7
%9 = icmp sgt i32 %8, %6
%10 = icmp ugt i64 %5, 4294967295
%11 = or i1 %9, %10
br i1 %11, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %wide.trip.count, 4294967292
%ind.end = sub nsw i64 0, %n.vec
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %q_adic, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %pred.store.continue95, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue95 ]
%12 = trunc i64 %index to i32
%13 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %13, align 16, !tbaa !5
%14 = icmp slt <4 x i32> %wide.load, <i32 10, i32 10, i32 10, i32 10>
%15 = icmp ult <4 x i32> %wide.load, %broadcast.splat
%16 = xor <4 x i1> %14, <i1 true, i1 true, i1 true, i1 true>
%17 = select <4 x i1> %16, <4 x i1> %15, <4 x i1> zeroinitializer
%predphi = select <4 x i1> %17, <4 x i8> <i8 87, i8 87, i8 87, i8 87>, <4 x i8> <i8 48, i8 48, i8 48, i8 48>
%18 = or <4 x i1> %17, %14
%19 = extractelement <4 x i1> %18, i64 0
br i1 %19, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%20 = sub i32 %add42, %12
%21 = sext i32 %20 to i64
%22 = bitcast <4 x i32> %wide.load to <16 x i8>
%23 = extractelement <16 x i8> %22, i64 0
%24 = getelementptr inbounds i8, ptr %num, i64 %21
%25 = extractelement <4 x i8> %predphi, i64 0
%26 = add i8 %25, %23
store i8 %26, ptr %24, align 1, !tbaa !14
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%27 = extractelement <4 x i1> %18, i64 1
br i1 %27, label %pred.store.if90, label %pred.store.continue91
pred.store.if90: ; preds = %pred.store.continue
%28 = xor i32 %12, -1
%29 = add i32 %add42, %28
%30 = sext i32 %29 to i64
%31 = bitcast <4 x i32> %wide.load to <16 x i8>
%32 = extractelement <16 x i8> %31, i64 4
%33 = getelementptr inbounds i8, ptr %num, i64 %30
%34 = extractelement <4 x i8> %predphi, i64 1
%35 = add i8 %34, %32
store i8 %35, ptr %33, align 1, !tbaa !14
br label %pred.store.continue91
pred.store.continue91: ; preds = %pred.store.if90, %pred.store.continue
%36 = extractelement <4 x i1> %18, i64 2
br i1 %36, label %pred.store.if92, label %pred.store.continue93
pred.store.if92: ; preds = %pred.store.continue91
%reass.sub = sub i32 %add42, %12
%37 = add i32 %reass.sub, -2
%38 = sext i32 %37 to i64
%39 = bitcast <4 x i32> %wide.load to <16 x i8>
%40 = extractelement <16 x i8> %39, i64 8
%41 = getelementptr inbounds i8, ptr %num, i64 %38
%42 = extractelement <4 x i8> %predphi, i64 2
%43 = add i8 %42, %40
store i8 %43, ptr %41, align 1, !tbaa !14
br label %pred.store.continue93
pred.store.continue93: ; preds = %pred.store.if92, %pred.store.continue91
%44 = extractelement <4 x i1> %18, i64 3
br i1 %44, label %pred.store.if94, label %pred.store.continue95
pred.store.if94: ; preds = %pred.store.continue93
%reass.sub96 = sub i32 %add42, %12
%45 = add i32 %reass.sub96, -3
%46 = sext i32 %45 to i64
%47 = bitcast <4 x i32> %wide.load to <16 x i8>
%48 = extractelement <16 x i8> %47, i64 12
%49 = getelementptr inbounds i8, ptr %num, i64 %46
%50 = extractelement <4 x i8> %predphi, i64 3
%51 = add i8 %50, %48
store i8 %51, ptr %49, align 1, !tbaa !14
br label %pred.store.continue95
pred.store.continue95: ; preds = %pred.store.if94, %pred.store.continue93
%index.next = add nuw i64 %index, 4
%52 = icmp eq i64 %index.next, %n.vec
br i1 %52, label %middle.block, label %vector.body, !llvm.loop !49
middle.block: ; preds = %pred.store.continue95
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %vector.scevcheck, %if.end12, %middle.block
%indvars.iv82.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %if.end12 ], [ %n.vec, %middle.block ]
%indvars.iv80.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %if.end12 ], [ %ind.end, %middle.block ]
%xtraiter = and i64 %wide.trip.count, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx16.prol = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv82.ph
%53 = load i32, ptr %arrayidx16.prol, align 16, !tbaa !5
%cmp17.prol = icmp slt i32 %53, 10
br i1 %cmp17.prol, label %for.inc.sink.split.prol, label %if.else.prol
if.else.prol: ; preds = %for.body.prol
%cmp32.prol = icmp ult i32 %53, %q_adic
br i1 %cmp32.prol, label %for.inc.sink.split.prol, label %for.inc.prol
for.inc.sink.split.prol: ; preds = %if.else.prol, %for.body.prol
%.sink88.prol = phi i8 [ 48, %for.body.prol ], [ 87, %if.else.prol ]
%54 = trunc i32 %53 to i8
%conv23.prol = add i8 %.sink88.prol, %54
%55 = trunc i64 %indvars.iv80.ph to i32
%sub27.prol = add i32 %add42, %55
%idxprom28.prol = sext i32 %sub27.prol to i64
%arrayidx29.prol = getelementptr inbounds i8, ptr %num, i64 %idxprom28.prol
store i8 %conv23.prol, ptr %arrayidx29.prol, align 1, !tbaa !14
br label %for.inc.prol
for.inc.prol: ; preds = %for.inc.sink.split.prol, %if.else.prol
%indvars.iv.next83.prol = or i64 %indvars.iv82.ph, 1
%indvars.iv.next81.prol = add nsw i64 %indvars.iv80.ph, -1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%indvars.iv82.unr = phi i64 [ %indvars.iv82.ph, %for.body.preheader ], [ %indvars.iv.next83.prol, %for.inc.prol ]
%indvars.iv80.unr = phi i64 [ %indvars.iv80.ph, %for.body.preheader ], [ %indvars.iv.next81.prol, %for.inc.prol ]
%56 = sub nsw i64 0, %wide.trip.count
%57 = xor i64 %indvars.iv82.ph, %56
%58 = icmp eq i64 %57, -1
br i1 %58, label %for.end, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv82 = phi i64 [ %indvars.iv.next83.1, %for.inc.1 ], [ %indvars.iv82.unr, %for.body.prol.loopexit ]
%indvars.iv80 = phi i64 [ %indvars.iv.next81.1, %for.inc.1 ], [ %indvars.iv80.unr, %for.body.prol.loopexit ]
%arrayidx16 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv82
%59 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp slt i32 %59, 10
br i1 %cmp17, label %for.inc.sink.split, label %if.else
if.else: ; preds = %for.body
%cmp32 = icmp ult i32 %59, %q_adic
br i1 %cmp32, label %for.inc.sink.split, label %for.inc
for.inc.sink.split: ; preds = %if.else, %for.body
%.sink88 = phi i8 [ 48, %for.body ], [ 87, %if.else ]
%60 = trunc i32 %59 to i8
%conv23 = add i8 %.sink88, %60
%61 = trunc i64 %indvars.iv80 to i32
%sub27 = add i32 %add42, %61
%idxprom28 = sext i32 %sub27 to i64
%arrayidx29 = getelementptr inbounds i8, ptr %num, i64 %idxprom28
store i8 %conv23, ptr %arrayidx29, align 1, !tbaa !14
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %if.else
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%arrayidx16.1 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv.next83
%62 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
%cmp17.1 = icmp slt i32 %62, 10
br i1 %cmp17.1, label %for.inc.sink.split.1, label %if.else.1
if.else.1: ; preds = %for.inc
%cmp32.1 = icmp ult i32 %62, %q_adic
br i1 %cmp32.1, label %for.inc.sink.split.1, label %for.inc.1
for.inc.sink.split.1: ; preds = %if.else.1, %for.inc
%.sink88.1 = phi i8 [ 48, %for.inc ], [ 87, %if.else.1 ]
%63 = trunc i32 %62 to i8
%conv23.1 = add i8 %.sink88.1, %63
%64 = trunc i64 %indvars.iv80 to i32
%65 = add i32 %64, -1
%sub27.1 = add i32 %add42, %65
%idxprom28.1 = sext i32 %sub27.1 to i64
%arrayidx29.1 = getelementptr inbounds i8, ptr %num, i64 %idxprom28.1
store i8 %conv23.1, ptr %arrayidx29.1, align 1, !tbaa !14
br label %for.inc.1
for.inc.1: ; preds = %for.inc.sink.split.1, %if.else.1
%indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2
%indvars.iv.next81.1 = add nsw i64 %indvars.iv80, -2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next83.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !50
for.end: ; preds = %for.body.prol.loopexit, %for.inc.1, %middle.block
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %mod) #24
ret void
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @count_mod(i32 noundef %min, i32 noundef %max, i32 noundef %num) local_unnamed_addr #14 {
entry:
%cmp = icmp sgt i32 %min, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %max, %num
%sub = add nsw i32 %min, -1
%div1 = sdiv i32 %sub, %num
%sub2 = sub nsw i32 %div, %div1
br label %return
if.else: ; preds = %entry
%cmp3 = icmp eq i32 %min, 0
br i1 %cmp3, label %if.then4, label %return
if.then4: ; preds = %if.else
%div5 = sdiv i32 %max, %num
%add = add nsw i32 %div5, 1
br label %return
return: ; preds = %if.else, %if.then4, %if.then
%retval.0 = phi i32 [ %sub2, %if.then ], [ %add, %if.then4 ], [ -1, %if.else ]
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @shift_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max, i32 noundef %num) local_unnamed_addr #15 {
entry:
%array39 = ptrtoint ptr %array to i64
%cmp.not24 = icmp slt i32 %max, %min
br i1 %cmp.not24, label %for.cond3.preheader, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %num to i64
%2 = sext i32 %min to i64
%invariant.gep = getelementptr i8, ptr %array, i64 %1
%3 = add nsw i64 %0, 1
%4 = sub nsw i64 %3, %2
%min.iters.check = icmp ult i64 %4, 4
br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %iter.check
%5 = sub nsw i64 %0, %2
%6 = getelementptr i8, ptr %array, i64 %1
%scevgep34 = getelementptr i8, ptr %6, i64 %0
%7 = sub nsw i64 0, %5
%8 = getelementptr i8, ptr %scevgep34, i64 %7
%9 = icmp ugt ptr %8, %scevgep34
%scevgep35 = getelementptr i8, ptr %array, i64 %0
%10 = sub nsw i64 0, %5
%11 = getelementptr i8, ptr %scevgep35, i64 %10
%12 = icmp ugt ptr %11, %scevgep35
%13 = or i1 %9, %12
br i1 %13, label %for.body.preheader, label %vector.memcheck
vector.memcheck: ; preds = %vector.scevcheck
%14 = add i64 %array39, %0
%15 = add i64 %array39, %1
%16 = add i64 %15, %0
%17 = sub i64 %14, %16
%diff.check = icmp ult i64 %17, 16
br i1 %diff.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check40 = icmp ult i64 %4, 16
br i1 %min.iters.check40, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %4, -16
%invariant.gep52 = getelementptr i8, ptr %array, i64 -15
%invariant.gep54 = getelementptr i8, ptr %invariant.gep, i64 -15
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = sub i64 %0, %index
%gep53 = getelementptr i8, ptr %invariant.gep52, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %gep53, align 1, !tbaa !14
%gep55 = getelementptr i8, ptr %invariant.gep54, i64 %offset.idx
store <16 x i8> %wide.load, ptr %gep55, align 1, !tbaa !14
%index.next = add nuw i64 %index, 16
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !51
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.cond3.preheader, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end44 = sub nsw i64 %0, %n.vec
%n.vec.remaining = and i64 %4, 12
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec43 = and i64 %4, -4
%ind.end = sub nsw i64 %0, %n.vec43
%invariant.gep56 = getelementptr i8, ptr %array, i64 -3
%invariant.gep58 = getelementptr i8, ptr %invariant.gep, i64 -3
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index46 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next51, %vec.epilog.vector.body ]
%offset.idx47 = sub i64 %0, %index46
%gep57 = getelementptr i8, ptr %invariant.gep56, i64 %offset.idx47
%wide.load48 = load <4 x i8>, ptr %gep57, align 1, !tbaa !14
%gep59 = getelementptr i8, ptr %invariant.gep58, i64 %offset.idx47
store <4 x i8> %wide.load48, ptr %gep59, align 1, !tbaa !14
%index.next51 = add nuw i64 %index46, 4
%19 = icmp eq i64 %index.next51, %n.vec43
br i1 %19, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !52
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n45 = icmp eq i64 %4, %n.vec43
br i1 %cmp.n45, label %for.cond3.preheader, label %for.body.preheader
for.body.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %0, %vector.scevcheck ], [ %ind.end44, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body
for.cond3.preheader: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry
%cmp6.not.not26 = icmp sgt i32 %num, 0
br i1 %cmp6.not.not26, label %for.body7.preheader, label %for.end12
for.body7.preheader: ; preds = %for.cond3.preheader
%add4 = add i32 %num, %min
%20 = sext i32 %min to i64
%scevgep = getelementptr i8, ptr %array, i64 %20
%21 = add i32 %min, 1
%smax = tail call i32 @llvm.smax.i32(i32 %add4, i32 %21)
%22 = xor i32 %min, -1
%23 = add i32 %smax, %22
%24 = zext i32 %23 to i64
%25 = add nuw nsw i64 %24, 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 0, i64 %25, i1 false), !tbaa !14
br label %for.end12
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%26 = load i8, ptr %arrayidx, align 1, !tbaa !14
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv
store i8 %26, ptr %gep, align 1, !tbaa !14
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%cmp.not.not = icmp sgt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !53
for.end12: ; preds = %for.body7.preheader, %for.cond3.preheader
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @convert_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %pre, i8 noundef signext %post) local_unnamed_addr #4 {
entry:
%cmp.not11 = icmp sgt i32 %min, %max
br i1 %cmp.not11, label %for.end, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check14 = icmp ult i32 %2, 31
br i1 %min.iters.check14, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %4, 8589934560
%broadcast.splatinsert = insertelement <16 x i8> poison, i8 %pre, i64 0
%broadcast.splat = shufflevector <16 x i8> %broadcast.splatinsert, <16 x i8> poison, <16 x i32> zeroinitializer
%invariant.gep = getelementptr i8, ptr %array, i64 1
%invariant.gep104 = getelementptr i8, ptr %array, i64 2
%invariant.gep106 = getelementptr i8, ptr %array, i64 3
%invariant.gep108 = getelementptr i8, ptr %array, i64 4
%invariant.gep110 = getelementptr i8, ptr %array, i64 5
%invariant.gep112 = getelementptr i8, ptr %array, i64 6
%invariant.gep114 = getelementptr i8, ptr %array, i64 7
%invariant.gep116 = getelementptr i8, ptr %array, i64 8
%invariant.gep118 = getelementptr i8, ptr %array, i64 9
%invariant.gep120 = getelementptr i8, ptr %array, i64 10
%invariant.gep122 = getelementptr i8, ptr %array, i64 11
%invariant.gep124 = getelementptr i8, ptr %array, i64 12
%invariant.gep126 = getelementptr i8, ptr %array, i64 13
%invariant.gep128 = getelementptr i8, ptr %array, i64 14
%invariant.gep130 = getelementptr i8, ptr %array, i64 15
%invariant.gep132 = getelementptr i8, ptr %array, i64 16
%invariant.gep134 = getelementptr i8, ptr %array, i64 17
%invariant.gep136 = getelementptr i8, ptr %array, i64 18
%invariant.gep138 = getelementptr i8, ptr %array, i64 19
%invariant.gep140 = getelementptr i8, ptr %array, i64 20
%invariant.gep142 = getelementptr i8, ptr %array, i64 21
%invariant.gep144 = getelementptr i8, ptr %array, i64 22
%invariant.gep146 = getelementptr i8, ptr %array, i64 23
%invariant.gep148 = getelementptr i8, ptr %array, i64 24
%invariant.gep150 = getelementptr i8, ptr %array, i64 25
%invariant.gep152 = getelementptr i8, ptr %array, i64 26
%invariant.gep154 = getelementptr i8, ptr %array, i64 27
%invariant.gep156 = getelementptr i8, ptr %array, i64 28
%invariant.gep158 = getelementptr i8, ptr %array, i64 29
%invariant.gep160 = getelementptr i8, ptr %array, i64 30
%invariant.gep162 = getelementptr i8, ptr %array, i64 31
br label %vector.body
vector.body: ; preds = %pred.store.continue77, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue77 ]
%offset.idx = add i64 %index, %0
%5 = getelementptr inbounds i8, ptr %array, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %5, align 1, !tbaa !14
%6 = getelementptr inbounds i8, ptr %5, i64 16
%wide.load15 = load <16 x i8>, ptr %6, align 1, !tbaa !14
%7 = icmp eq <16 x i8> %wide.load, %broadcast.splat
%8 = icmp eq <16 x i8> %wide.load15, %broadcast.splat
%9 = extractelement <16 x i1> %7, i64 0
br i1 %9, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%10 = getelementptr inbounds i8, ptr %array, i64 %offset.idx
store i8 %post, ptr %10, align 1, !tbaa !14
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%11 = extractelement <16 x i1> %7, i64 1
br i1 %11, label %pred.store.if16, label %pred.store.continue17
pred.store.if16: ; preds = %pred.store.continue
%gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx
store i8 %post, ptr %gep, align 1, !tbaa !14
br label %pred.store.continue17
pred.store.continue17: ; preds = %pred.store.if16, %pred.store.continue
%12 = extractelement <16 x i1> %7, i64 2
br i1 %12, label %pred.store.if18, label %pred.store.continue19
pred.store.if18: ; preds = %pred.store.continue17
%gep105 = getelementptr i8, ptr %invariant.gep104, i64 %offset.idx
store i8 %post, ptr %gep105, align 1, !tbaa !14
br label %pred.store.continue19
pred.store.continue19: ; preds = %pred.store.if18, %pred.store.continue17
%13 = extractelement <16 x i1> %7, i64 3
br i1 %13, label %pred.store.if20, label %pred.store.continue21
pred.store.if20: ; preds = %pred.store.continue19
%gep107 = getelementptr i8, ptr %invariant.gep106, i64 %offset.idx
store i8 %post, ptr %gep107, align 1, !tbaa !14
br label %pred.store.continue21
pred.store.continue21: ; preds = %pred.store.if20, %pred.store.continue19
%14 = extractelement <16 x i1> %7, i64 4
br i1 %14, label %pred.store.if22, label %pred.store.continue23
pred.store.if22: ; preds = %pred.store.continue21
%gep109 = getelementptr i8, ptr %invariant.gep108, i64 %offset.idx
store i8 %post, ptr %gep109, align 1, !tbaa !14
br label %pred.store.continue23
pred.store.continue23: ; preds = %pred.store.if22, %pred.store.continue21
%15 = extractelement <16 x i1> %7, i64 5
br i1 %15, label %pred.store.if24, label %pred.store.continue25
pred.store.if24: ; preds = %pred.store.continue23
%gep111 = getelementptr i8, ptr %invariant.gep110, i64 %offset.idx
store i8 %post, ptr %gep111, align 1, !tbaa !14
br label %pred.store.continue25
pred.store.continue25: ; preds = %pred.store.if24, %pred.store.continue23
%16 = extractelement <16 x i1> %7, i64 6
br i1 %16, label %pred.store.if26, label %pred.store.continue27
pred.store.if26: ; preds = %pred.store.continue25
%gep113 = getelementptr i8, ptr %invariant.gep112, i64 %offset.idx
store i8 %post, ptr %gep113, align 1, !tbaa !14
br label %pred.store.continue27
pred.store.continue27: ; preds = %pred.store.if26, %pred.store.continue25
%17 = extractelement <16 x i1> %7, i64 7
br i1 %17, label %pred.store.if28, label %pred.store.continue29
pred.store.if28: ; preds = %pred.store.continue27
%gep115 = getelementptr i8, ptr %invariant.gep114, i64 %offset.idx
store i8 %post, ptr %gep115, align 1, !tbaa !14
br label %pred.store.continue29
pred.store.continue29: ; preds = %pred.store.if28, %pred.store.continue27
%18 = extractelement <16 x i1> %7, i64 8
br i1 %18, label %pred.store.if30, label %pred.store.continue31
pred.store.if30: ; preds = %pred.store.continue29
%gep117 = getelementptr i8, ptr %invariant.gep116, i64 %offset.idx
store i8 %post, ptr %gep117, align 1, !tbaa !14
br label %pred.store.continue31
pred.store.continue31: ; preds = %pred.store.if30, %pred.store.continue29
%19 = extractelement <16 x i1> %7, i64 9
br i1 %19, label %pred.store.if32, label %pred.store.continue33
pred.store.if32: ; preds = %pred.store.continue31
%gep119 = getelementptr i8, ptr %invariant.gep118, i64 %offset.idx
store i8 %post, ptr %gep119, align 1, !tbaa !14
br label %pred.store.continue33
pred.store.continue33: ; preds = %pred.store.if32, %pred.store.continue31
%20 = extractelement <16 x i1> %7, i64 10
br i1 %20, label %pred.store.if34, label %pred.store.continue35
pred.store.if34: ; preds = %pred.store.continue33
%gep121 = getelementptr i8, ptr %invariant.gep120, i64 %offset.idx
store i8 %post, ptr %gep121, align 1, !tbaa !14
br label %pred.store.continue35
pred.store.continue35: ; preds = %pred.store.if34, %pred.store.continue33
%21 = extractelement <16 x i1> %7, i64 11
br i1 %21, label %pred.store.if36, label %pred.store.continue37
pred.store.if36: ; preds = %pred.store.continue35
%gep123 = getelementptr i8, ptr %invariant.gep122, i64 %offset.idx
store i8 %post, ptr %gep123, align 1, !tbaa !14
br label %pred.store.continue37
pred.store.continue37: ; preds = %pred.store.if36, %pred.store.continue35
%22 = extractelement <16 x i1> %7, i64 12
br i1 %22, label %pred.store.if38, label %pred.store.continue39
pred.store.if38: ; preds = %pred.store.continue37
%gep125 = getelementptr i8, ptr %invariant.gep124, i64 %offset.idx
store i8 %post, ptr %gep125, align 1, !tbaa !14
br label %pred.store.continue39
pred.store.continue39: ; preds = %pred.store.if38, %pred.store.continue37
%23 = extractelement <16 x i1> %7, i64 13
br i1 %23, label %pred.store.if40, label %pred.store.continue41
pred.store.if40: ; preds = %pred.store.continue39
%gep127 = getelementptr i8, ptr %invariant.gep126, i64 %offset.idx
store i8 %post, ptr %gep127, align 1, !tbaa !14
br label %pred.store.continue41
pred.store.continue41: ; preds = %pred.store.if40, %pred.store.continue39
%24 = extractelement <16 x i1> %7, i64 14
br i1 %24, label %pred.store.if42, label %pred.store.continue43
pred.store.if42: ; preds = %pred.store.continue41
%gep129 = getelementptr i8, ptr %invariant.gep128, i64 %offset.idx
store i8 %post, ptr %gep129, align 1, !tbaa !14
br label %pred.store.continue43
pred.store.continue43: ; preds = %pred.store.if42, %pred.store.continue41
%25 = extractelement <16 x i1> %7, i64 15
br i1 %25, label %pred.store.if44, label %pred.store.continue45
pred.store.if44: ; preds = %pred.store.continue43
%gep131 = getelementptr i8, ptr %invariant.gep130, i64 %offset.idx
store i8 %post, ptr %gep131, align 1, !tbaa !14
br label %pred.store.continue45
pred.store.continue45: ; preds = %pred.store.if44, %pred.store.continue43
%26 = extractelement <16 x i1> %8, i64 0
br i1 %26, label %pred.store.if46, label %pred.store.continue47
pred.store.if46: ; preds = %pred.store.continue45
%gep133 = getelementptr i8, ptr %invariant.gep132, i64 %offset.idx
store i8 %post, ptr %gep133, align 1, !tbaa !14
br label %pred.store.continue47
pred.store.continue47: ; preds = %pred.store.if46, %pred.store.continue45
%27 = extractelement <16 x i1> %8, i64 1
br i1 %27, label %pred.store.if48, label %pred.store.continue49
pred.store.if48: ; preds = %pred.store.continue47
%gep135 = getelementptr i8, ptr %invariant.gep134, i64 %offset.idx
store i8 %post, ptr %gep135, align 1, !tbaa !14
br label %pred.store.continue49
pred.store.continue49: ; preds = %pred.store.if48, %pred.store.continue47
%28 = extractelement <16 x i1> %8, i64 2
br i1 %28, label %pred.store.if50, label %pred.store.continue51
pred.store.if50: ; preds = %pred.store.continue49
%gep137 = getelementptr i8, ptr %invariant.gep136, i64 %offset.idx
store i8 %post, ptr %gep137, align 1, !tbaa !14
br label %pred.store.continue51
pred.store.continue51: ; preds = %pred.store.if50, %pred.store.continue49
%29 = extractelement <16 x i1> %8, i64 3
br i1 %29, label %pred.store.if52, label %pred.store.continue53
pred.store.if52: ; preds = %pred.store.continue51
%gep139 = getelementptr i8, ptr %invariant.gep138, i64 %offset.idx
store i8 %post, ptr %gep139, align 1, !tbaa !14
br label %pred.store.continue53
pred.store.continue53: ; preds = %pred.store.if52, %pred.store.continue51
%30 = extractelement <16 x i1> %8, i64 4
br i1 %30, label %pred.store.if54, label %pred.store.continue55
pred.store.if54: ; preds = %pred.store.continue53
%gep141 = getelementptr i8, ptr %invariant.gep140, i64 %offset.idx
store i8 %post, ptr %gep141, align 1, !tbaa !14
br label %pred.store.continue55
pred.store.continue55: ; preds = %pred.store.if54, %pred.store.continue53
%31 = extractelement <16 x i1> %8, i64 5
br i1 %31, label %pred.store.if56, label %pred.store.continue57
pred.store.if56: ; preds = %pred.store.continue55
%gep143 = getelementptr i8, ptr %invariant.gep142, i64 %offset.idx
store i8 %post, ptr %gep143, align 1, !tbaa !14
br label %pred.store.continue57
pred.store.continue57: ; preds = %pred.store.if56, %pred.store.continue55
%32 = extractelement <16 x i1> %8, i64 6
br i1 %32, label %pred.store.if58, label %pred.store.continue59
pred.store.if58: ; preds = %pred.store.continue57
%gep145 = getelementptr i8, ptr %invariant.gep144, i64 %offset.idx
store i8 %post, ptr %gep145, align 1, !tbaa !14
br label %pred.store.continue59
pred.store.continue59: ; preds = %pred.store.if58, %pred.store.continue57
%33 = extractelement <16 x i1> %8, i64 7
br i1 %33, label %pred.store.if60, label %pred.store.continue61
pred.store.if60: ; preds = %pred.store.continue59
%gep147 = getelementptr i8, ptr %invariant.gep146, i64 %offset.idx
store i8 %post, ptr %gep147, align 1, !tbaa !14
br label %pred.store.continue61
pred.store.continue61: ; preds = %pred.store.if60, %pred.store.continue59
%34 = extractelement <16 x i1> %8, i64 8
br i1 %34, label %pred.store.if62, label %pred.store.continue63
pred.store.if62: ; preds = %pred.store.continue61
%gep149 = getelementptr i8, ptr %invariant.gep148, i64 %offset.idx
store i8 %post, ptr %gep149, align 1, !tbaa !14
br label %pred.store.continue63
pred.store.continue63: ; preds = %pred.store.if62, %pred.store.continue61
%35 = extractelement <16 x i1> %8, i64 9
br i1 %35, label %pred.store.if64, label %pred.store.continue65
pred.store.if64: ; preds = %pred.store.continue63
%gep151 = getelementptr i8, ptr %invariant.gep150, i64 %offset.idx
store i8 %post, ptr %gep151, align 1, !tbaa !14
br label %pred.store.continue65
pred.store.continue65: ; preds = %pred.store.if64, %pred.store.continue63
%36 = extractelement <16 x i1> %8, i64 10
br i1 %36, label %pred.store.if66, label %pred.store.continue67
pred.store.if66: ; preds = %pred.store.continue65
%gep153 = getelementptr i8, ptr %invariant.gep152, i64 %offset.idx
store i8 %post, ptr %gep153, align 1, !tbaa !14
br label %pred.store.continue67
pred.store.continue67: ; preds = %pred.store.if66, %pred.store.continue65
%37 = extractelement <16 x i1> %8, i64 11
br i1 %37, label %pred.store.if68, label %pred.store.continue69
pred.store.if68: ; preds = %pred.store.continue67
%gep155 = getelementptr i8, ptr %invariant.gep154, i64 %offset.idx
store i8 %post, ptr %gep155, align 1, !tbaa !14
br label %pred.store.continue69
pred.store.continue69: ; preds = %pred.store.if68, %pred.store.continue67
%38 = extractelement <16 x i1> %8, i64 12
br i1 %38, label %pred.store.if70, label %pred.store.continue71
pred.store.if70: ; preds = %pred.store.continue69
%gep157 = getelementptr i8, ptr %invariant.gep156, i64 %offset.idx
store i8 %post, ptr %gep157, align 1, !tbaa !14
br label %pred.store.continue71
pred.store.continue71: ; preds = %pred.store.if70, %pred.store.continue69
%39 = extractelement <16 x i1> %8, i64 13
br i1 %39, label %pred.store.if72, label %pred.store.continue73
pred.store.if72: ; preds = %pred.store.continue71
%gep159 = getelementptr i8, ptr %invariant.gep158, i64 %offset.idx
store i8 %post, ptr %gep159, align 1, !tbaa !14
br label %pred.store.continue73
pred.store.continue73: ; preds = %pred.store.if72, %pred.store.continue71
%40 = extractelement <16 x i1> %8, i64 14
br i1 %40, label %pred.store.if74, label %pred.store.continue75
pred.store.if74: ; preds = %pred.store.continue73
%gep161 = getelementptr i8, ptr %invariant.gep160, i64 %offset.idx
store i8 %post, ptr %gep161, align 1, !tbaa !14
br label %pred.store.continue75
pred.store.continue75: ; preds = %pred.store.if74, %pred.store.continue73
%41 = extractelement <16 x i1> %8, i64 15
br i1 %41, label %pred.store.if76, label %pred.store.continue77
pred.store.if76: ; preds = %pred.store.continue75
%gep163 = getelementptr i8, ptr %invariant.gep162, i64 %offset.idx
store i8 %post, ptr %gep163, align 1, !tbaa !14
br label %pred.store.continue77
pred.store.continue77: ; preds = %pred.store.if76, %pred.store.continue75
%index.next = add nuw i64 %index, 32
%42 = icmp eq i64 %index.next, %n.vec
br i1 %42, label %middle.block, label %vector.body, !llvm.loop !54
middle.block: ; preds = %pred.store.continue77
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end80 = add nsw i64 %n.vec, %0
%n.vec.remaining = and i64 %4, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec79 = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec79, %0
%broadcast.splatinsert85 = insertelement <8 x i8> poison, i8 %pre, i64 0
%broadcast.splat86 = shufflevector <8 x i8> %broadcast.splatinsert85, <8 x i8> poison, <8 x i32> zeroinitializer
%invariant.gep164 = getelementptr i8, ptr %array, i64 1
%invariant.gep166 = getelementptr i8, ptr %array, i64 2
%invariant.gep168 = getelementptr i8, ptr %array, i64 3
%invariant.gep170 = getelementptr i8, ptr %array, i64 4
%invariant.gep172 = getelementptr i8, ptr %array, i64 5
%invariant.gep174 = getelementptr i8, ptr %array, i64 6
%invariant.gep176 = getelementptr i8, ptr %array, i64 7
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %pred.store.continue102, %vec.epilog.ph
%index82 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next103, %pred.store.continue102 ]
%offset.idx83 = add i64 %index82, %0
%43 = getelementptr inbounds i8, ptr %array, i64 %offset.idx83
%wide.load84 = load <8 x i8>, ptr %43, align 1, !tbaa !14
%44 = icmp eq <8 x i8> %wide.load84, %broadcast.splat86
%45 = extractelement <8 x i1> %44, i64 0
br i1 %45, label %pred.store.if87, label %pred.store.continue88
pred.store.if87: ; preds = %vec.epilog.vector.body
%46 = getelementptr inbounds i8, ptr %array, i64 %offset.idx83
store i8 %post, ptr %46, align 1, !tbaa !14
br label %pred.store.continue88
pred.store.continue88: ; preds = %pred.store.if87, %vec.epilog.vector.body
%47 = extractelement <8 x i1> %44, i64 1
br i1 %47, label %pred.store.if89, label %pred.store.continue90
pred.store.if89: ; preds = %pred.store.continue88
%gep165 = getelementptr i8, ptr %invariant.gep164, i64 %offset.idx83
store i8 %post, ptr %gep165, align 1, !tbaa !14
br label %pred.store.continue90
pred.store.continue90: ; preds = %pred.store.if89, %pred.store.continue88
%48 = extractelement <8 x i1> %44, i64 2
br i1 %48, label %pred.store.if91, label %pred.store.continue92
pred.store.if91: ; preds = %pred.store.continue90
%gep167 = getelementptr i8, ptr %invariant.gep166, i64 %offset.idx83
store i8 %post, ptr %gep167, align 1, !tbaa !14
br label %pred.store.continue92
pred.store.continue92: ; preds = %pred.store.if91, %pred.store.continue90
%49 = extractelement <8 x i1> %44, i64 3
br i1 %49, label %pred.store.if93, label %pred.store.continue94
pred.store.if93: ; preds = %pred.store.continue92
%gep169 = getelementptr i8, ptr %invariant.gep168, i64 %offset.idx83
store i8 %post, ptr %gep169, align 1, !tbaa !14
br label %pred.store.continue94
pred.store.continue94: ; preds = %pred.store.if93, %pred.store.continue92
%50 = extractelement <8 x i1> %44, i64 4
br i1 %50, label %pred.store.if95, label %pred.store.continue96
pred.store.if95: ; preds = %pred.store.continue94
%gep171 = getelementptr i8, ptr %invariant.gep170, i64 %offset.idx83
store i8 %post, ptr %gep171, align 1, !tbaa !14
br label %pred.store.continue96
pred.store.continue96: ; preds = %pred.store.if95, %pred.store.continue94
%51 = extractelement <8 x i1> %44, i64 5
br i1 %51, label %pred.store.if97, label %pred.store.continue98
pred.store.if97: ; preds = %pred.store.continue96
%gep173 = getelementptr i8, ptr %invariant.gep172, i64 %offset.idx83
store i8 %post, ptr %gep173, align 1, !tbaa !14
br label %pred.store.continue98
pred.store.continue98: ; preds = %pred.store.if97, %pred.store.continue96
%52 = extractelement <8 x i1> %44, i64 6
br i1 %52, label %pred.store.if99, label %pred.store.continue100
pred.store.if99: ; preds = %pred.store.continue98
%gep175 = getelementptr i8, ptr %invariant.gep174, i64 %offset.idx83
store i8 %post, ptr %gep175, align 1, !tbaa !14
br label %pred.store.continue100
pred.store.continue100: ; preds = %pred.store.if99, %pred.store.continue98
%53 = extractelement <8 x i1> %44, i64 7
br i1 %53, label %pred.store.if101, label %pred.store.continue102
pred.store.if101: ; preds = %pred.store.continue100
%gep177 = getelementptr i8, ptr %invariant.gep176, i64 %offset.idx83
store i8 %post, ptr %gep177, align 1, !tbaa !14
br label %pred.store.continue102
pred.store.continue102: ; preds = %pred.store.if101, %pred.store.continue100
%index.next103 = add nuw i64 %index82, 8
%54 = icmp eq i64 %index.next103, %n.vec79
br i1 %54, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !55
vec.epilog.middle.block: ; preds = %pred.store.continue102
%cmp.n81 = icmp eq i64 %4, %n.vec79
br i1 %cmp.n81, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %ind.end80, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %indvars.iv.ph, %for.body.preheader ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%55 = load i8, ptr %arrayidx, align 1, !tbaa !14
%cmp2 = icmp eq i8 %55, %pre
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
store i8 %post, ptr %arrayidx, align 1, !tbaa !14
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !56
for.end: ; preds = %for.inc, %middle.block, %vec.epilog.middle.block, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_asc_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%cmp.not28 = icmp sgt i32 %min, %max
br i1 %cmp.not28, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next34 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !57
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next34 = add nsw i64 %indvars.iv33, 1
%cmp2.not26.not = icmp slt i64 %indvars.iv33, %0
br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%3 = sext i32 %indvars.iv to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ]
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv30
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %4, %5
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
store i32 %5, ptr %arrayidx, align 4, !tbaa !5
store i32 %4, ptr %arrayidx5, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%indvars.iv.next31 = add nsw i64 %indvars.iv30, 1
%cmp2.not.not = icmp slt i64 %indvars.iv30, %0
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !58
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_des_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 {
entry:
%cmp.not28 = icmp sgt i32 %min, %max
br i1 %cmp.not28, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next34 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !59
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next34 = add nsw i64 %indvars.iv33, 1
%cmp2.not26.not = icmp slt i64 %indvars.iv33, %0
br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%3 = sext i32 %indvars.iv to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ]
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv30
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp slt i32 %4, %5
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
store i32 %5, ptr %arrayidx, align 4, !tbaa !5
store i32 %4, ptr %arrayidx5, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%indvars.iv.next31 = add nsw i64 %indvars.iv30, 1
%cmp2.not.not = icmp slt i64 %indvars.iv30, %0
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !60
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_asc_char_dic(i32 noundef %size, ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #16 {
entry:
%0 = zext i32 %size to i64
%cmp.not29 = icmp sgt i32 %min, %max
%cmp.not6.i = icmp slt i32 %size, 1
%or.cond = or i1 %cmp.not29, %cmp.not6.i
br i1 %or.cond, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = sext i32 %max to i64
%2 = sext i32 %min to i64
%3 = add i32 %max, 1
%4 = add nsw i64 %2, 1
%5 = add i32 %min, 1
%min.iters.check = icmp ult i32 %size, 8
%min.iters.check45 = icmp ult i32 %size, 32
%n.vec = and i64 %0, 4294967264
%cmp.n = icmp eq i64 %n.vec, %0
%n.vec.remaining = and i64 %0, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
%n.vec50 = and i64 %0, 4294967288
%cmp.n51 = icmp eq i64 %n.vec50, %0
%xtraiter = and i64 %0, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%6 = sub nsw i64 0, %0
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next38 to i32
%exitcond.not = icmp eq i32 %3, %lftr.wideiv
%indvar.next = add i64 %indvar, 1
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !61
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ]
%indvars.iv37 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next38, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%7 = add i64 %indvar, %2
%8 = mul i64 %7, %0
%scevgep = getelementptr i8, ptr %array, i64 %8
%9 = add i64 %4, %indvar
%10 = mul i64 %9, %0
%scevgep40 = getelementptr i8, ptr %array, i64 %10
%11 = trunc i64 %indvar to i32
%12 = add i32 %5, %11
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, 1
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next38 = add nsw i64 %indvars.iv37, 1
%cmp2.not27.not = icmp slt i64 %indvars.iv37, %1
br i1 %cmp2.not27.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%15 = sext i32 %indvars.iv to i64
%16 = mul nsw i64 %indvars.iv37, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %16
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvar41 = phi i64 [ 0, %for.body3.lr.ph ], [ %indvar.next42, %for.inc ]
%indvars.iv34 = phi i64 [ %15, %for.body3.lr.ph ], [ %indvars.iv.next35, %for.inc ]
%17 = add i64 %indvar41, %13
%18 = mul i64 %17, %0
%scevgep43 = getelementptr i8, ptr %array, i64 %18
%19 = add i64 %14, %indvar41
%20 = mul i64 %19, %0
%scevgep44 = getelementptr i8, ptr %array, i64 %20
%21 = mul nsw i64 %indvars.iv34, %0
%arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %21
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #25
%cmp6 = icmp slt i32 %call, 1
br i1 %cmp6, label %for.inc, label %iter.check
iter.check: ; preds = %for.body3
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %iter.check
%bound0 = icmp ult ptr %scevgep, %scevgep44
%bound1 = icmp ult ptr %scevgep43, %scevgep40
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body.i.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
br i1 %min.iters.check45, label %vec.epilog.ph, label %vector.body
vector.body: ; preds = %vector.main.loop.iter.check, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ]
%22 = getelementptr inbounds i8, ptr %arrayidx, i64 %index
%23 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index
%wide.load = load <16 x i8>, ptr %22, align 1, !tbaa !14, !alias.scope !62, !noalias !65
%24 = getelementptr inbounds i8, ptr %22, i64 16
%wide.load46 = load <16 x i8>, ptr %24, align 1, !tbaa !14, !alias.scope !62, !noalias !65
%wide.load47 = load <16 x i8>, ptr %23, align 1, !tbaa !14, !alias.scope !65
%25 = getelementptr inbounds i8, ptr %23, i64 16
%wide.load48 = load <16 x i8>, ptr %25, align 1, !tbaa !14, !alias.scope !65
store <16 x i8> %wide.load47, ptr %22, align 1, !tbaa !14, !alias.scope !62, !noalias !65
store <16 x i8> %wide.load48, ptr %24, align 1, !tbaa !14, !alias.scope !62, !noalias !65
store <16 x i8> %wide.load, ptr %23, align 1, !tbaa !14, !alias.scope !65
store <16 x i8> %wide.load46, ptr %25, align 1, !tbaa !14, !alias.scope !65
%index.next = add nuw i64 %index, 32
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !67
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.inc, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ]
%27 = getelementptr inbounds i8, ptr %arrayidx, i64 %index52
%28 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index52
%wide.load53 = load <8 x i8>, ptr %27, align 1, !tbaa !14, !alias.scope !68, !noalias !71
%wide.load54 = load <8 x i8>, ptr %28, align 1, !tbaa !14, !alias.scope !71
store <8 x i8> %wide.load54, ptr %27, align 1, !tbaa !14, !alias.scope !68, !noalias !71
store <8 x i8> %wide.load53, ptr %28, align 1, !tbaa !14, !alias.scope !71
%index.next55 = add nuw i64 %index52, 8
%29 = icmp eq i64 %index.next55, %n.vec50
br i1 %29, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !73
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
br i1 %cmp.n51, label %for.inc, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.i.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ]
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader
%arrayidx.i.prol = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i.ph
%arrayidx2.i.prol = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i.ph
%30 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14
%31 = load i8, ptr %arrayidx2.i.prol, align 1, !tbaa !14
store i8 %31, ptr %arrayidx.i.prol, align 1, !tbaa !14
store i8 %30, ptr %arrayidx2.i.prol, align 1, !tbaa !14
%indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%32 = xor i64 %indvars.iv.i.ph, %6
%33 = icmp eq i64 %32, -1
br i1 %33, label %for.inc, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i
%arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i
%34 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%35 = load i8, ptr %arrayidx2.i, align 1, !tbaa !14
store i8 %35, ptr %arrayidx.i, align 1, !tbaa !14
store i8 %34, ptr %arrayidx2.i, align 1, !tbaa !14
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.next.i
%arrayidx2.i.1 = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.next.i
%36 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14
%37 = load i8, ptr %arrayidx2.i.1, align 1, !tbaa !14
store i8 %37, ptr %arrayidx.i.1, align 1, !tbaa !14
store i8 %36, ptr %arrayidx2.i.1, align 1, !tbaa !14
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%38 = icmp eq i64 %indvars.iv.next.i.1, %0
br i1 %38, label %for.inc, label %for.body.i, !llvm.loop !74
for.inc: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %for.body3
%indvars.iv.next35 = add nsw i64 %indvars.iv34, 1
%cmp2.not.not = icmp slt i64 %indvars.iv34, %1
%indvar.next42 = add i64 %indvar41, 1
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !75
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort_des_char_dic(i32 noundef %size, ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #16 {
entry:
%0 = zext i32 %size to i64
%cmp.not29 = icmp sgt i32 %min, %max
%cmp.not6.i = icmp slt i32 %size, 1
%or.cond = or i1 %cmp.not29, %cmp.not6.i
br i1 %or.cond, label %for.end14, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = sext i32 %max to i64
%2 = sext i32 %min to i64
%3 = add i32 %max, 1
%4 = add nsw i64 %2, 1
%5 = add i32 %min, 1
%min.iters.check = icmp ult i32 %size, 8
%min.iters.check45 = icmp ult i32 %size, 32
%n.vec = and i64 %0, 4294967264
%cmp.n = icmp eq i64 %n.vec, %0
%n.vec.remaining = and i64 %0, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
%n.vec50 = and i64 %0, 4294967288
%cmp.n51 = icmp eq i64 %n.vec50, %0
%xtraiter = and i64 %0, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%6 = sub nsw i64 0, %0
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%lftr.wideiv = trunc i64 %indvars.iv.next38 to i32
%exitcond.not = icmp eq i32 %3, %lftr.wideiv
%indvar.next = add i64 %indvar, 1
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !76
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ]
%indvars.iv37 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next38, %for.cond.loopexit ]
%indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ]
%7 = add i64 %indvar, %2
%8 = mul i64 %7, %0
%scevgep = getelementptr i8, ptr %array, i64 %8
%9 = add i64 %4, %indvar
%10 = mul i64 %9, %0
%scevgep40 = getelementptr i8, ptr %array, i64 %10
%11 = trunc i64 %indvar to i32
%12 = add i32 %5, %11
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, 1
%indvars.iv = add i32 %indvars.iv.in, 1
%indvars.iv.next38 = add nsw i64 %indvars.iv37, 1
%cmp2.not27.not = icmp slt i64 %indvars.iv37, %1
br i1 %cmp2.not27.not, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%15 = sext i32 %indvars.iv to i64
%16 = mul nsw i64 %indvars.iv37, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %16
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvar41 = phi i64 [ 0, %for.body3.lr.ph ], [ %indvar.next42, %for.inc ]
%indvars.iv34 = phi i64 [ %15, %for.body3.lr.ph ], [ %indvars.iv.next35, %for.inc ]
%17 = add i64 %indvar41, %13
%18 = mul i64 %17, %0
%scevgep43 = getelementptr i8, ptr %array, i64 %18
%19 = add i64 %14, %indvar41
%20 = mul i64 %19, %0
%scevgep44 = getelementptr i8, ptr %array, i64 %20
%21 = mul nsw i64 %indvars.iv34, %0
%arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %21
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #25
%cmp6 = icmp sgt i32 %call, -1
br i1 %cmp6, label %for.inc, label %iter.check
iter.check: ; preds = %for.body3
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %iter.check
%bound0 = icmp ult ptr %scevgep, %scevgep44
%bound1 = icmp ult ptr %scevgep43, %scevgep40
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body.i.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
br i1 %min.iters.check45, label %vec.epilog.ph, label %vector.body
vector.body: ; preds = %vector.main.loop.iter.check, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ]
%22 = getelementptr inbounds i8, ptr %arrayidx, i64 %index
%23 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index
%wide.load = load <16 x i8>, ptr %22, align 1, !tbaa !14, !alias.scope !77, !noalias !80
%24 = getelementptr inbounds i8, ptr %22, i64 16
%wide.load46 = load <16 x i8>, ptr %24, align 1, !tbaa !14, !alias.scope !77, !noalias !80
%wide.load47 = load <16 x i8>, ptr %23, align 1, !tbaa !14, !alias.scope !80
%25 = getelementptr inbounds i8, ptr %23, i64 16
%wide.load48 = load <16 x i8>, ptr %25, align 1, !tbaa !14, !alias.scope !80
store <16 x i8> %wide.load47, ptr %22, align 1, !tbaa !14, !alias.scope !77, !noalias !80
store <16 x i8> %wide.load48, ptr %24, align 1, !tbaa !14, !alias.scope !77, !noalias !80
store <16 x i8> %wide.load, ptr %23, align 1, !tbaa !14, !alias.scope !80
store <16 x i8> %wide.load46, ptr %25, align 1, !tbaa !14, !alias.scope !80
%index.next = add nuw i64 %index, 32
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !82
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.inc, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ]
%27 = getelementptr inbounds i8, ptr %arrayidx, i64 %index52
%28 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index52
%wide.load53 = load <8 x i8>, ptr %27, align 1, !tbaa !14, !alias.scope !83, !noalias !86
%wide.load54 = load <8 x i8>, ptr %28, align 1, !tbaa !14, !alias.scope !86
store <8 x i8> %wide.load54, ptr %27, align 1, !tbaa !14, !alias.scope !83, !noalias !86
store <8 x i8> %wide.load53, ptr %28, align 1, !tbaa !14, !alias.scope !86
%index.next55 = add nuw i64 %index52, 8
%29 = icmp eq i64 %index.next55, %n.vec50
br i1 %29, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !88
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
br i1 %cmp.n51, label %for.inc, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.i.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ]
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader
%arrayidx.i.prol = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i.ph
%arrayidx2.i.prol = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i.ph
%30 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14
%31 = load i8, ptr %arrayidx2.i.prol, align 1, !tbaa !14
store i8 %31, ptr %arrayidx.i.prol, align 1, !tbaa !14
store i8 %30, ptr %arrayidx2.i.prol, align 1, !tbaa !14
%indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%32 = xor i64 %indvars.iv.i.ph, %6
%33 = icmp eq i64 %32, -1
br i1 %33, label %for.inc, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i
%arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i
%34 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%35 = load i8, ptr %arrayidx2.i, align 1, !tbaa !14
store i8 %35, ptr %arrayidx.i, align 1, !tbaa !14
store i8 %34, ptr %arrayidx2.i, align 1, !tbaa !14
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.next.i
%arrayidx2.i.1 = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.next.i
%36 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14
%37 = load i8, ptr %arrayidx2.i.1, align 1, !tbaa !14
store i8 %37, ptr %arrayidx.i.1, align 1, !tbaa !14
store i8 %36, ptr %arrayidx2.i.1, align 1, !tbaa !14
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%38 = icmp eq i64 %indvars.iv.next.i.1, %0
br i1 %38, label %for.inc, label %for.body.i, !llvm.loop !89
for.inc: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %for.body3
%indvars.iv.next35 = add nsw i64 %indvars.iv34, 1
%cmp2.not.not = icmp slt i64 %indvars.iv34, %1
%indvar.next42 = add i64 %indvar41, 1
br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !90
for.end14: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @max_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 {
entry:
%idxprom = sext i32 %min to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not.not9 = icmp slt i32 %min, %max
br i1 %cmp.not.not9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = sext i32 %max to i64
%1 = sub nsw i64 %wide.trip.count, %idxprom
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %1, -8
%ind.end = add nsw i64 %n.vec, %idxprom
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %idxprom
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi13 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%2 = getelementptr i32, ptr %gep, i64 1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr i32, ptr %gep, i64 5
%wide.load14 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi13, <4 x i32> %wide.load14)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !91
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.011.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ]
%answer.011 = phi i32 [ %spec.select.i, %for.body ], [ %answer.011.ph, %for.body.preheader15 ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%spec.select.i = tail call i32 @llvm.smax.i32(i32 %answer.011, i32 %8)
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !92
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @max_int_array_num(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef writeonly %answer) local_unnamed_addr #15 {
entry:
%idxprom.i = sext i32 %min to i64
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %idxprom.i
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.not.not9.i = icmp slt i32 %min, %max
br i1 %cmp.not.not9.i, label %for.body.preheader.i, label %max_int_array.exit
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = sext i32 %max to i64
%1 = sub nsw i64 %wide.trip.count.i, %idxprom.i
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %1, -8
%ind.end = add nsw i64 %n.vec, %idxprom.i
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %idxprom.i
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi26 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%2 = getelementptr i32, ptr %gep, i64 1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr i32, ptr %gep, i64 5
%wide.load27 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi26, <4 x i32> %wide.load27)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !93
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %max_int_array.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ %idxprom.i, %for.body.preheader.i ], [ %ind.end, %middle.block ]
%answer.011.i.ph = phi i32 [ %0, %for.body.preheader.i ], [ %7, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%answer.011.i = phi i32 [ %spec.select.i.i, %for.body.i ], [ %answer.011.i.ph, %for.body.i.preheader ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%spec.select.i.i = tail call i32 @llvm.smax.i32(i32 %answer.011.i, i32 %8)
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %max_int_array.exit, label %for.body.i, !llvm.loop !94
max_int_array.exit: ; preds = %for.body.i, %middle.block, %entry
%answer.0.lcssa.i = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i.i, %for.body.i ]
%sub = sub nsw i32 %max, %min
%cmp.not4.i = icmp slt i32 %sub, 0
br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i16
for.body.preheader.i16: ; preds = %max_int_array.exit
%9 = add nuw i32 %sub, 1
%10 = zext i32 %9 to i64
%11 = shl nuw nsw i64 %10, 2
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %answer, i8 -1, i64 %11, i1 false), !tbaa !5
br label %fill_int.exit
fill_int.exit: ; preds = %for.body.preheader.i16, %max_int_array.exit
%cmp.not22 = icmp sgt i32 %min, %max
br i1 %cmp.not22, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %fill_int.exit
%12 = add i32 %max, 1
%13 = sub i32 %12, %min
%xtraiter = and i32 %13, 1
%14 = icmp eq i32 %max, %min
br i1 %14, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %13, -2
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %idxprom.i, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%count.023 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%15 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %15, %answer.0.lcssa.i
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%idxprom2 = sext i32 %count.023 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2
%16 = trunc i64 %indvars.iv to i32
store i32 %16, ptr %arrayidx3, align 4, !tbaa !5
%add = add nsw i32 %count.023, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%count.1 = phi i32 [ %add, %if.then ], [ %count.023, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp1.1 = icmp eq i32 %17, %answer.0.lcssa.i
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%idxprom2.1 = sext i32 %count.1 to i64
%arrayidx3.1 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2.1
%18 = trunc i64 %indvars.iv.next to i32
store i32 %18, ptr %arrayidx3.1, align 4, !tbaa !5
%add.1 = add nsw i32 %count.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%count.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %count.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !95
for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1
%19 = sext i32 %count.1.1 to i64
br label %for.end.loopexit.unr-lcssa
for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader
%indvars.iv.unr = phi i64 [ %idxprom.i, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ]
%count.023.unr = phi i64 [ 0, %for.body.preheader ], [ %19, %for.end.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.unr
%20 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%cmp1.epil = icmp eq i32 %20, %answer.0.lcssa.i
br i1 %cmp1.epil, label %if.then.epil, label %for.end
if.then.epil: ; preds = %for.body.epil
%arrayidx3.epil = getelementptr inbounds i32, ptr %answer, i64 %count.023.unr
%21 = trunc i64 %indvars.iv.unr to i32
store i32 %21, ptr %arrayidx3.epil, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %fill_int.exit
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @min_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 {
entry:
%idxprom = sext i32 %min to i64
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not.not9 = icmp slt i32 %min, %max
br i1 %cmp.not.not9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = sext i32 %max to i64
%1 = sub nsw i64 %wide.trip.count, %idxprom
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %1, -8
%ind.end = add nsw i64 %n.vec, %idxprom
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %idxprom
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi13 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%2 = getelementptr i32, ptr %gep, i64 1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr i32, ptr %gep, i64 5
%wide.load14 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi13, <4 x i32> %wide.load14)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !96
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.011.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ]
%answer.011 = phi i32 [ %spec.select.i, %for.body ], [ %answer.011.ph, %for.body.preheader15 ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%spec.select.i = tail call i32 @llvm.smin.i32(i32 %answer.011, i32 %8)
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !97
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @min_int_array_num(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef writeonly %answer) local_unnamed_addr #15 {
entry:
%idxprom.i = sext i32 %min to i64
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %idxprom.i
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.not.not9.i = icmp slt i32 %min, %max
br i1 %cmp.not.not9.i, label %for.body.preheader.i, label %min_int_array.exit
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = sext i32 %max to i64
%1 = sub nsw i64 %wide.trip.count.i, %idxprom.i
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %1, -8
%ind.end = add nsw i64 %n.vec, %idxprom.i
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %idxprom.i
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi26 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%2 = getelementptr i32, ptr %gep, i64 1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr i32, ptr %gep, i64 5
%wide.load27 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi26, <4 x i32> %wide.load27)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !98
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %min_int_array.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ %idxprom.i, %for.body.preheader.i ], [ %ind.end, %middle.block ]
%answer.011.i.ph = phi i32 [ %0, %for.body.preheader.i ], [ %7, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%answer.011.i = phi i32 [ %spec.select.i.i, %for.body.i ], [ %answer.011.i.ph, %for.body.i.preheader ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%spec.select.i.i = tail call i32 @llvm.smin.i32(i32 %answer.011.i, i32 %8)
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %min_int_array.exit, label %for.body.i, !llvm.loop !99
min_int_array.exit: ; preds = %for.body.i, %middle.block, %entry
%answer.0.lcssa.i = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i.i, %for.body.i ]
%sub = sub nsw i32 %max, %min
%cmp.not4.i = icmp slt i32 %sub, 0
br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i16
for.body.preheader.i16: ; preds = %min_int_array.exit
%9 = add nuw i32 %sub, 1
%10 = zext i32 %9 to i64
%11 = shl nuw nsw i64 %10, 2
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %answer, i8 -1, i64 %11, i1 false), !tbaa !5
br label %fill_int.exit
fill_int.exit: ; preds = %for.body.preheader.i16, %min_int_array.exit
%cmp.not22 = icmp sgt i32 %min, %max
br i1 %cmp.not22, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %fill_int.exit
%12 = add i32 %max, 1
%13 = sub i32 %12, %min
%xtraiter = and i32 %13, 1
%14 = icmp eq i32 %max, %min
br i1 %14, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %13, -2
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %idxprom.i, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%count.023 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%15 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %15, %answer.0.lcssa.i
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%idxprom2 = sext i32 %count.023 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2
%16 = trunc i64 %indvars.iv to i32
store i32 %16, ptr %arrayidx3, align 4, !tbaa !5
%add = add nsw i32 %count.023, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%count.1 = phi i32 [ %add, %if.then ], [ %count.023, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp1.1 = icmp eq i32 %17, %answer.0.lcssa.i
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%idxprom2.1 = sext i32 %count.1 to i64
%arrayidx3.1 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2.1
%18 = trunc i64 %indvars.iv.next to i32
store i32 %18, ptr %arrayidx3.1, align 4, !tbaa !5
%add.1 = add nsw i32 %count.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%count.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %count.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !100
for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1
%19 = sext i32 %count.1.1 to i64
br label %for.end.loopexit.unr-lcssa
for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader
%indvars.iv.unr = phi i64 [ %idxprom.i, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ]
%count.023.unr = phi i64 [ 0, %for.body.preheader ], [ %19, %for.end.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.unr
%20 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%cmp1.epil = icmp eq i32 %20, %answer.0.lcssa.i
br i1 %cmp1.epil, label %if.then.epil, label %for.end
if.then.epil: ; preds = %for.body.epil
%arrayidx3.epil = getelementptr inbounds i32, ptr %answer, i64 %count.023.unr
%21 = trunc i64 %indvars.iv.unr to i32
store i32 %21, ptr %arrayidx3.epil, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %fill_int.exit
ret void
}
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i32 @max_char_dic(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 {
entry:
%0 = zext i32 %size to i64
%cmp.not.not11 = icmp slt i32 %min, %max
br i1 %cmp.not.not11, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = sext i32 %min to i64
%wide.trip.count = sext i32 %max to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%answer.013 = phi i32 [ %min, %for.body.preheader ], [ %spec.select, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%idxprom = sext i32 %answer.013 to i64
%2 = mul nsw i64 %idxprom, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %2
%3 = mul nsw i64 %indvars.iv.next, %0
%arrayidx2 = getelementptr inbounds i8, ptr %array, i64 %3
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #25
%cmp3 = icmp slt i32 %call, 0
%4 = trunc i64 %indvars.iv.next to i32
%spec.select = select i1 %cmp3, i32 %4, i32 %answer.013
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !101
for.end: ; preds = %for.body, %entry
%answer.0.lcssa = phi i32 [ %min, %entry ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i32 @min_char_dic(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 {
entry:
%0 = zext i32 %size to i64
%cmp.not.not11 = icmp slt i32 %min, %max
br i1 %cmp.not.not11, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = sext i32 %min to i64
%wide.trip.count = sext i32 %max to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%answer.013 = phi i32 [ %min, %for.body.preheader ], [ %spec.select, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%idxprom = sext i32 %answer.013 to i64
%2 = mul nsw i64 %idxprom, %0
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %2
%3 = mul nsw i64 %indvars.iv.next, %0
%arrayidx2 = getelementptr inbounds i8, ptr %array, i64 %3
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #25
%cmp3 = icmp sgt i32 %call, 0
%4 = trunc i64 %indvars.iv.next to i32
%spec.select = select i1 %cmp3, i32 %4, i32 %answer.013
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !102
for.end: ; preds = %for.body, %entry
%answer.0.lcssa = phi i32 [ %min, %entry ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @sum_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #19 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%invariant.gep = getelementptr i32, ptr %array, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %gep, i64 4
%wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = add <4 x i32> %wide.load, %vec.phi
%7 = add <4 x i32> %wide.load11, %vec.phi10
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !103
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader12
for.body.preheader12: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader12, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ]
%answer.08 = phi i32 [ %add, %for.body ], [ %answer.08.ph, %for.body.preheader12 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%10 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %10, %answer.08
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !104
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local zeroext i1 @detect_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #19 {
entry:
%cmp.not10 = icmp sgt i32 %min, %max
br i1 %cmp.not10, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %2, %element
br i1 %cmp1, label %for.end.loopexit.split.loop.exit, label %for.inc
for.inc: ; preds = %for.body
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !105
for.end.loopexit.split.loop.exit: ; preds = %for.body
%3 = trunc i64 %indvars.iv to i32
br label %for.end
for.end: ; preds = %for.inc, %for.end.loopexit.split.loop.exit, %entry
%i.0.lcssa = phi i32 [ %min, %entry ], [ %3, %for.end.loopexit.split.loop.exit ], [ %1, %for.inc ]
%cmp3.not = icmp sle i32 %i.0.lcssa, %max
ret i1 %cmp3.not
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local zeroext i1 @detect_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef readonly %element, i32 noundef %start, i32 noundef %goal) local_unnamed_addr #19 {
entry:
%sub = sub nsw i32 %goal, %start
%sub1 = sub nsw i32 %max, %min
%cmp.not = icmp sgt i32 %sub, %sub1
br i1 %cmp.not, label %if.end24, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub3 = sub nsw i32 %max, %sub
%cmp4.not42 = icmp slt i32 %sub3, %min
br i1 %cmp4.not42, label %if.end24, label %for.cond5.preheader.lr.ph
for.cond5.preheader.lr.ph: ; preds = %for.cond.preheader
%cmp6.not39 = icmp sgt i32 %start, %goal
%add16 = add i32 %goal, 1
br i1 %cmp6.not39, label %for.cond5.preheader.lr.ph.split.us, label %for.cond5.preheader.preheader
for.cond5.preheader.preheader: ; preds = %for.cond5.preheader.lr.ph
%0 = sext i32 %start to i64
br label %for.cond5.preheader
for.cond5.preheader.lr.ph.split.us: ; preds = %for.cond5.preheader.lr.ph
%cmp17.us = icmp eq i32 %add16, %start
br label %if.end24
for.cond5.preheader: ; preds = %for.end, %for.cond5.preheader.preheader
%i.043 = phi i32 [ %min, %for.cond5.preheader.preheader ], [ %add22, %for.end ]
%add = sub i32 %i.043, %start
br label %for.body7
for.body7: ; preds = %for.cond5.preheader, %for.inc
%indvars.iv = phi i64 [ %0, %for.cond5.preheader ], [ %indvars.iv.next, %for.inc ]
%1 = trunc i64 %indvars.iv to i32
%sub8 = add i32 %add, %1
%idxprom = sext i32 %sub8 to i64
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %idxprom
%2 = load i8, ptr %arrayidx, align 1, !tbaa !14
%arrayidx10 = getelementptr inbounds i8, ptr %element, i64 %indvars.iv
%3 = load i8, ptr %arrayidx10, align 1, !tbaa !14
%cmp12 = icmp eq i8 %2, %3
br i1 %cmp12, label %for.inc, label %for.end
for.inc: ; preds = %for.body7
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %add16, %lftr.wideiv
br i1 %exitcond.not, label %if.end24, label %for.body7, !llvm.loop !106
for.end: ; preds = %for.body7
%cmp17 = icmp eq i32 %add16, %1
%add22 = add nsw i32 %i.043, 1
%cmp4.not.not = icmp sge i32 %i.043, %sub3
%or.cond.not = or i1 %cmp4.not.not, %cmp17
br i1 %or.cond.not, label %if.end24, label %for.cond5.preheader, !llvm.loop !107
if.end24: ; preds = %for.end, %for.inc, %for.cond5.preheader.lr.ph.split.us, %for.cond.preheader, %entry
%answer.0 = phi i1 [ false, %entry ], [ false, %for.cond.preheader ], [ %cmp17.us, %for.cond5.preheader.lr.ph.split.us ], [ true, %for.inc ], [ %cmp17, %for.end ]
ret i1 %answer.0
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @count_differentelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 {
entry:
%0 = zext i32 %max to i64
%vla = alloca i32, i64 %0, align 16
%cmp.not4.i = icmp slt i32 %max, 0
br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%1 = add nuw i32 %max, 1
%2 = zext i32 %1 to i64
%3 = shl nuw nsw i64 %2, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %3, i1 false), !tbaa !5
br label %fill_int.exit
fill_int.exit: ; preds = %for.body.preheader.i, %entry
%cmp.not28 = icmp sgt i32 %min, %max
br i1 %cmp.not28, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %fill_int.exit
%4 = sext i32 %min to i64
%5 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %4, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%answer.030 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not10.i = icmp slt i32 %answer.030, 1
br i1 %cmp.not10.i, label %detect_int.exit, label %for.body.i19.preheader
for.body.i19.preheader: ; preds = %for.body
%zext = zext i32 %answer.030 to i64
br label %for.body.i19
for.body.i19: ; preds = %for.body.i19.preheader, %for.inc.i
%indvars.iv.i20 = phi i64 [ %indvars.iv.next.i22, %for.inc.i ], [ 0, %for.body.i19.preheader ]
%arrayidx.i21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i20
%7 = load i32, ptr %arrayidx.i21, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %7, %6
br i1 %cmp1.i, label %for.end.loopexit.split.loop.exit.i, label %for.inc.i
for.inc.i: ; preds = %for.body.i19
%indvars.iv.next.i22 = add nuw nsw i64 %indvars.iv.i20, 1
%8 = icmp eq i64 %indvars.iv.next.i22, %zext
br i1 %8, label %if.then, label %for.body.i19, !llvm.loop !105
for.end.loopexit.split.loop.exit.i: ; preds = %for.body.i19
%9 = trunc i64 %indvars.iv.i20 to i32
br label %detect_int.exit
detect_int.exit: ; preds = %for.body, %for.end.loopexit.split.loop.exit.i
%i.0.lcssa.i = phi i32 [ 0, %for.body ], [ %9, %for.end.loopexit.split.loop.exit.i ]
%cmp3.not.i.not.not = icmp slt i32 %i.0.lcssa.i, %answer.030
br i1 %cmp3.not.i.not.not, label %for.inc, label %if.then
if.then: ; preds = %for.inc.i, %detect_int.exit
%idxprom5 = sext i32 %answer.030 to i64
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5
store i32 %6, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %answer.030, 1
br label %for.inc
for.inc: ; preds = %detect_int.exit, %if.then
%answer.1 = phi i32 [ %add, %if.then ], [ %answer.030, %detect_int.exit ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %5, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !108
for.end: ; preds = %for.inc, %fill_int.exit
%answer.0.lcssa = phi i32 [ 0, %fill_int.exit ], [ %answer.1, %for.inc ]
ret i32 %answer.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #20
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #20
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @count_differentelement_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 {
entry:
%0 = zext i32 %max to i64
%vla = alloca i8, i64 %0, align 16
%cmp.not4.i = icmp slt i32 %max, 0
br i1 %cmp.not4.i, label %fill_char.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%1 = add nuw nsw i64 %0, 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %1, i1 false), !tbaa !14
br label %fill_char.exit
fill_char.exit: ; preds = %entry, %for.body.preheader.i
%cmp.not20 = icmp sgt i32 %min, %max
br i1 %cmp.not20, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %fill_char.exit
%2 = sext i32 %min to i64
%3 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv26 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next27, %for.inc ]
%answer.022 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ]
%cmp.not.i = icmp slt i32 %answer.022, 1
br i1 %cmp.not.i, label %for.body.if.then_crit_edge, label %for.cond5.preheader.lr.ph.i
for.body.if.then_crit_edge: ; preds = %for.body
%arrayidx.phi.trans.insert = getelementptr inbounds i8, ptr %array, i64 %indvars.iv26
%.pre30 = load i8, ptr %arrayidx.phi.trans.insert, align 1, !tbaa !14
br label %if.then
for.cond5.preheader.lr.ph.i: ; preds = %for.body
%4 = zext i32 %answer.022 to i64
%arrayidx10.i.phi.trans.insert = getelementptr inbounds i8, ptr %array, i64 %indvars.iv26
%.pre = load i8, ptr %arrayidx10.i.phi.trans.insert, align 1, !tbaa !14
br label %for.cond5.preheader.i
for.cond.i: ; preds = %for.cond5.preheader.i
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %4
br i1 %exitcond.not, label %if.then, label %for.cond5.preheader.i, !llvm.loop !107
for.cond5.preheader.i: ; preds = %for.cond.i, %for.cond5.preheader.lr.ph.i
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond.i ], [ 0, %for.cond5.preheader.lr.ph.i ]
%arrayidx.i = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%5 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%cmp12.i = icmp eq i8 %5, %.pre
br i1 %cmp12.i, label %for.inc, label %for.cond.i
if.then: ; preds = %for.cond.i, %for.body.if.then_crit_edge
%6 = phi i8 [ %.pre30, %for.body.if.then_crit_edge ], [ %.pre, %for.cond.i ]
%idxprom3 = sext i32 %answer.022 to i64
%arrayidx4 = getelementptr inbounds i8, ptr %vla, i64 %idxprom3
store i8 %6, ptr %arrayidx4, align 1, !tbaa !14
%add = add nsw i32 %answer.022, 1
br label %for.inc
for.inc: ; preds = %for.cond5.preheader.i, %if.then
%answer.1 = phi i32 [ %add, %if.then ], [ %answer.022, %for.cond5.preheader.i ]
%indvars.iv.next27 = add nsw i64 %indvars.iv26, 1
%lftr.wideiv = trunc i64 %indvars.iv.next27 to i32
%exitcond29.not = icmp eq i32 %3, %lftr.wideiv
br i1 %exitcond29.not, label %for.end, label %for.body, !llvm.loop !109
for.end: ; preds = %for.inc, %fill_char.exit
%answer.0.lcssa = phi i32 [ 0, %fill_char.exit ], [ %answer.1, %for.inc ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @count_equalelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #19 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i32, ptr %array, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %gep, i64 4
%wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = icmp eq <4 x i32> %wide.load, %broadcast.splat
%7 = icmp eq <4 x i32> %wide.load11, %broadcast.splat
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = add <4 x i32> %vec.phi, %8
%11 = add <4 x i32> %vec.phi10, %9
%index.next = add nuw i64 %index, 8
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !110
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %11, %10
%13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader12
for.body.preheader12: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader12, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ]
%answer.08 = phi i32 [ %spec.select, %for.body ], [ %answer.08.ph, %for.body.preheader12 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%14 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %14, %element
%add = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %answer.08, %add
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !111
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @count_equalelement_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #19 {
entry:
%cmp.not8 = icmp sgt i32 %min, %max
br i1 %cmp.not8, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
%2 = sub i32 %max, %min
%3 = zext i32 %2 to i64
%4 = add nuw nsw i64 %3, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader14, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec, %0
%broadcast.splatinsert = insertelement <4 x i8> poison, i8 %element, i64 0
%broadcast.splat = shufflevector <4 x i8> %broadcast.splatinsert, <4 x i8> poison, <4 x i32> zeroinitializer
%invariant.gep = getelementptr i8, ptr %array, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi12 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%gep = getelementptr i8, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i8>, ptr %gep, align 1, !tbaa !14
%5 = getelementptr inbounds i8, ptr %gep, i64 4
%wide.load13 = load <4 x i8>, ptr %5, align 1, !tbaa !14
%6 = icmp eq <4 x i8> %wide.load, %broadcast.splat
%7 = icmp eq <4 x i8> %wide.load13, %broadcast.splat
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = add <4 x i32> %vec.phi, %8
%11 = add <4 x i32> %vec.phi12, %9
%index.next = add nuw i64 %index, 8
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !112
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %11, %10
%13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader14
for.body.preheader14: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%answer.010.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader14, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader14 ]
%answer.010 = phi i32 [ %spec.select, %for.body ], [ %answer.010.ph, %for.body.preheader14 ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%14 = load i8, ptr %arrayidx, align 1, !tbaa !14
%cmp2 = icmp eq i8 %14, %element
%add = zext i1 %cmp2 to i32
%spec.select = add nuw nsw i32 %answer.010, %add
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !113
for.end: ; preds = %for.body, %middle.block, %entry
%answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ]
ret i32 %answer.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @scanf_int_array(ptr noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not3 = icmp sgt i32 %min, %max
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !114
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #21
; Function Attrs: nofree nounwind uwtable
define dso_local void @scanf_int_array_2(ptr noundef %array1, ptr noundef %array2, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not6 = icmp sgt i32 %min, %max
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %array1, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds i32, ptr %array2, i64 %indvars.iv
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef %arrayidx2)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !115
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @scanf_int_array_3(ptr noundef %array1, ptr noundef %array2, ptr noundef %array3, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not9 = icmp sgt i32 %min, %max
br i1 %cmp.not9, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %array1, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds i32, ptr %array2, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds i32, ptr %array3, i64 %indvars.iv
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx, ptr noundef %arrayidx2, ptr noundef %arrayidx4)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !116
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @scanf_char_array(ptr noundef %array, i32 noundef %num) local_unnamed_addr #10 {
entry:
%array8 = ptrtoint ptr %array to i64
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %array)
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %array) #25
%0 = trunc i64 %call1 to i32
%conv = add i32 %0, -1
%cmp.not24.i = icmp slt i32 %conv, 0
br i1 %cmp.not24.i, label %for.cond3.preheader.i, label %iter.check
iter.check: ; preds = %entry
%1 = zext i32 %conv to i64
%2 = sext i32 %num to i64
%invariant.gep.i = getelementptr i8, ptr %array, i64 %2
%3 = add nuw nsw i64 %1, 1
%min.iters.check = icmp ult i32 %conv, 3
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %iter.check
%4 = getelementptr i8, ptr %array, i64 %2
%scevgep = getelementptr i8, ptr %4, i64 %1
%5 = icmp ugt ptr %4, %scevgep
%scevgep4 = getelementptr i8, ptr %array, i64 %1
%6 = icmp ult ptr %scevgep4, %array
%7 = or i1 %5, %6
br i1 %7, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %vector.scevcheck
%8 = add i64 %array8, %1
%9 = add i64 %array8, %2
%10 = add i64 %9, %1
%11 = sub i64 %8, %10
%diff.check = icmp ult i64 %11, 16
br i1 %diff.check, label %for.body.i.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check9 = icmp ult i32 %conv, 15
br i1 %min.iters.check9, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %3, 8589934576
%invariant.gep = getelementptr i8, ptr %array, i64 -15
%invariant.gep21 = getelementptr i8, ptr %invariant.gep.i, i64 -15
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = sub i64 %1, %index
%gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %gep, align 1, !tbaa !14
%gep22 = getelementptr i8, ptr %invariant.gep21, i64 %offset.idx
store <16 x i8> %wide.load, ptr %gep22, align 1, !tbaa !14
%index.next = add nuw i64 %index, 16
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !117
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %3, %n.vec
br i1 %cmp.n, label %for.cond3.preheader.i, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end13 = sub nsw i64 %1, %n.vec
%n.vec.remaining = and i64 %3, 12
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec12 = and i64 %3, 8589934588
%ind.end = sub nsw i64 %1, %n.vec12
%invariant.gep23 = getelementptr i8, ptr %array, i64 -3
%invariant.gep25 = getelementptr i8, ptr %invariant.gep.i, i64 -3
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index15 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next20, %vec.epilog.vector.body ]
%offset.idx16 = sub i64 %1, %index15
%gep24 = getelementptr i8, ptr %invariant.gep23, i64 %offset.idx16
%wide.load17 = load <4 x i8>, ptr %gep24, align 1, !tbaa !14
%gep26 = getelementptr i8, ptr %invariant.gep25, i64 %offset.idx16
store <4 x i8> %wide.load17, ptr %gep26, align 1, !tbaa !14
%index.next20 = add nuw i64 %index15, 4
%13 = icmp eq i64 %index.next20, %n.vec12
br i1 %13, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !118
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n14 = icmp eq i64 %3, %n.vec12
br i1 %cmp.n14, label %for.cond3.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.i.ph = phi i64 [ %1, %iter.check ], [ %1, %vector.memcheck ], [ %1, %vector.scevcheck ], [ %ind.end13, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
%14 = add nsw i64 %indvars.iv.i.ph, 1
%xtraiter = and i64 %14, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.i.prol
%15 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14
%gep.i.prol = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
store i8 %15, ptr %gep.i.prol, align 1, !tbaa !14
%indvars.iv.next.i.prol = add nsw i64 %indvars.iv.i.prol, -1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !119
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%16 = icmp ult i64 %indvars.iv.i.ph, 3
br i1 %16, label %for.cond3.preheader.i, label %for.body.i
for.cond3.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %entry
%cmp6.not.not26.i = icmp sgt i32 %num, 0
br i1 %cmp6.not.not26.i, label %for.body7.preheader.i, label %shift_char.exit
for.body7.preheader.i: ; preds = %for.cond3.preheader.i
%17 = zext i32 %num to i64
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %array, i8 0, i64 %17, i1 false), !tbaa !14
br label %shift_char.exit
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.i
%18 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%gep.i = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i
store i8 %18, ptr %gep.i, align 1, !tbaa !14
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i
%19 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14
%gep.i.1 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i
store i8 %19, ptr %gep.i.1, align 1, !tbaa !14
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, -2
%arrayidx.i.2 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i.1
%20 = load i8, ptr %arrayidx.i.2, align 1, !tbaa !14
%gep.i.2 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
store i8 %20, ptr %gep.i.2, align 1, !tbaa !14
%indvars.iv.next.i.2 = add nsw i64 %indvars.iv.i, -3
%arrayidx.i.3 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i.2
%21 = load i8, ptr %arrayidx.i.3, align 1, !tbaa !14
%gep.i.3 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
store i8 %21, ptr %gep.i.3, align 1, !tbaa !14
%indvars.iv.next.i.3 = add nsw i64 %indvars.iv.i, -4
%cmp.not.not.i.not.3 = icmp eq i64 %indvars.iv.next.i.2, 0
br i1 %cmp.not.not.i.not.3, label %for.cond3.preheader.i, label %for.body.i, !llvm.loop !120
shift_char.exit: ; preds = %for.cond3.preheader.i, %for.body7.preheader.i
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printf_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not3 = icmp sgt i32 %min, %max
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %2)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !121
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #21
; Function Attrs: nofree nounwind uwtable
define dso_local void @printf_char_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 {
entry:
%cmp.not3 = icmp sgt i32 %min, %max
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %min to i64
%1 = add i32 %max, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !14
%conv = sext i8 %2 to i32
%putchar = tail call i32 @putchar(i32 %conv)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !122
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #10 {
entry:
%s = alloca [100002 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100002, ptr nonnull %s) #24
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100002) %s, i8 0, i64 100002, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #25
%div22 = lshr i64 %call2, 1
%add = add nuw i64 %div22, 2
%0 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %add, align 16
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #25
%div523 = lshr i64 %call4, 1
%1 = trunc i64 %div523 to i32
%conv = add i32 %1, 1
%cmp.not4.i = icmp slt i32 %conv, 0
br i1 %cmp.not4.i, label %iter.check, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%2 = zext i32 %conv to i64
%3 = add nuw nsw i64 %2, 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %3, i1 false), !tbaa !14
br label %iter.check
iter.check: ; preds = %entry, %for.body.preheader.i
%4 = add nuw i64 %div523, 1
%5 = add nuw i64 %div523, 2
%min.iters.check = icmp ult i64 %call4, 14
br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check31 = icmp ult i64 %call4, 30
br i1 %min.iters.check31, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.mod.vf = and i64 %5, 15
%6 = icmp eq i64 %n.mod.vf, 0
%7 = select i1 %6, i64 16, i64 %n.mod.vf
%n.vec = sub i64 %5, %7
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%8 = shl nuw nsw i64 %index, 1
%9 = getelementptr inbounds [100002 x i8], ptr %s, i64 0, i64 %8
%wide.vec = load <32 x i8>, ptr %9, align 16, !tbaa !14
%strided.vec = shufflevector <32 x i8> %wide.vec, <32 x i8> poison, <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 20, i32 22, i32 24, i32 26, i32 28, i32 30>
%10 = getelementptr inbounds i8, ptr %vla, i64 %index
store <16 x i8> %strided.vec, ptr %10, align 16, !tbaa !14
%index.next = add nuw i64 %index, 16
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %vec.epilog.iter.check, label %vector.body, !llvm.loop !123
vec.epilog.iter.check: ; preds = %vector.body
%min.epilog.iters.check = icmp ult i64 %7, 9
br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.mod.vf32 = and i64 %5, 7
%12 = icmp eq i64 %n.mod.vf32, 0
%13 = select i1 %12, i64 8, i64 %n.mod.vf32
%n.vec33 = sub i64 %5, %13
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index34 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next37, %vec.epilog.vector.body ]
%14 = shl nuw nsw i64 %index34, 1
%15 = getelementptr inbounds [100002 x i8], ptr %s, i64 0, i64 %14
%wide.vec35 = load <16 x i8>, ptr %15, align 2, !tbaa !14
%strided.vec36 = shufflevector <16 x i8> %wide.vec35, <16 x i8> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
%16 = getelementptr inbounds i8, ptr %vla, i64 %index34
store <8 x i8> %strided.vec36, ptr %16, align 1, !tbaa !14
%index.next37 = add nuw i64 %index34, 8
%17 = icmp eq i64 %index.next37, %n.vec33
br i1 %17, label %for.body.preheader, label %vec.epilog.vector.body, !llvm.loop !124
for.body.preheader: ; preds = %vec.epilog.vector.body, %iter.check, %vec.epilog.iter.check
%indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec33, %vec.epilog.vector.body ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ]
%18 = shl nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100002 x i8], ptr %s, i64 0, i64 %18
%19 = load i8, ptr %arrayidx, align 2, !tbaa !14
%arrayidx14 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
store i8 %19, ptr %arrayidx14, align 1, !tbaa !14
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv, %4
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !125
for.end: ; preds = %for.body
%call16 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %vla) #25
%20 = trunc i64 %call16 to i32
%conv17 = add i32 %20, -1
%cmp.not3.i = icmp slt i32 %conv17, 0
br i1 %cmp.not3.i, label %printf_char_array.exit, label %for.body.i
for.body.i: ; preds = %for.end, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %for.end ]
%arrayidx.i = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.i
%21 = load i8, ptr %arrayidx.i, align 1, !tbaa !14
%conv.i = sext i8 %21 to i32
%putchar.i = call i32 @putchar(i32 %conv.i)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%lftr.wideiv = trunc i64 %indvars.iv.next.i to i32
%exitcond30 = icmp eq i32 %lftr.wideiv, %20
br i1 %exitcond30, label %printf_char_array.exit, label %for.body.i, !llvm.loop !122
printf_char_array.exit: ; preds = %for.body.i, %for.end
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %0)
call void @llvm.lifetime.end.p0(i64 100002, ptr nonnull %s) #24
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #22
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #23
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #23
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { mustprogress 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 #15 = { 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 #16 = { nofree nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #17 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #18 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #19 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #20 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #21 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #22 = { nofree nounwind }
attributes #23 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #24 = { nounwind }
attributes #25 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = !{!7, !7, i64 0}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !10, !11, !12}
!21 = distinct !{!21, !10, !11}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !10, !11, !12}
!28 = !{!29}
!29 = distinct !{!29, !30}
!30 = distinct !{!30, !"LVerDomain"}
!31 = !{!32}
!32 = distinct !{!32, !30}
!33 = distinct !{!33, !10, !11, !12}
!34 = distinct !{!34, !10, !11}
!35 = distinct !{!35, !10}
!36 = distinct !{!36, !10}
!37 = distinct !{!37, !10}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.unroll.disable"}
!40 = distinct !{!40, !10}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !39}
!43 = distinct !{!43, !10}
!44 = distinct !{!44, !39}
!45 = distinct !{!45, !10}
!46 = distinct !{!46, !10}
!47 = distinct !{!47, !10}
!48 = distinct !{!48, !10}
!49 = distinct !{!49, !10, !11, !12}
!50 = distinct !{!50, !10, !11}
!51 = distinct !{!51, !10, !11, !12}
!52 = distinct !{!52, !10, !11, !12}
!53 = distinct !{!53, !10, !11}
!54 = distinct !{!54, !10, !11, !12}
!55 = distinct !{!55, !10, !11, !12}
!56 = distinct !{!56, !10, !12, !11}
!57 = distinct !{!57, !10}
!58 = distinct !{!58, !10}
!59 = distinct !{!59, !10}
!60 = distinct !{!60, !10}
!61 = distinct !{!61, !10}
!62 = !{!63}
!63 = distinct !{!63, !64}
!64 = distinct !{!64, !"LVerDomain"}
!65 = !{!66}
!66 = distinct !{!66, !64}
!67 = distinct !{!67, !10, !11, !12}
!68 = !{!69}
!69 = distinct !{!69, !70}
!70 = distinct !{!70, !"LVerDomain"}
!71 = !{!72}
!72 = distinct !{!72, !70}
!73 = distinct !{!73, !10, !11, !12}
!74 = distinct !{!74, !10, !11}
!75 = distinct !{!75, !10}
!76 = distinct !{!76, !10}
!77 = !{!78}
!78 = distinct !{!78, !79}
!79 = distinct !{!79, !"LVerDomain"}
!80 = !{!81}
!81 = distinct !{!81, !79}
!82 = distinct !{!82, !10, !11, !12}
!83 = !{!84}
!84 = distinct !{!84, !85}
!85 = distinct !{!85, !"LVerDomain"}
!86 = !{!87}
!87 = distinct !{!87, !85}
!88 = distinct !{!88, !10, !11, !12}
!89 = distinct !{!89, !10, !11}
!90 = distinct !{!90, !10}
!91 = distinct !{!91, !10, !11, !12}
!92 = distinct !{!92, !10, !12, !11}
!93 = distinct !{!93, !10, !11, !12}
!94 = distinct !{!94, !10, !12, !11}
!95 = distinct !{!95, !10}
!96 = distinct !{!96, !10, !11, !12}
!97 = distinct !{!97, !10, !12, !11}
!98 = distinct !{!98, !10, !11, !12}
!99 = distinct !{!99, !10, !12, !11}
!100 = distinct !{!100, !10}
!101 = distinct !{!101, !10}
!102 = distinct !{!102, !10}
!103 = distinct !{!103, !10, !11, !12}
!104 = distinct !{!104, !10, !12, !11}
!105 = distinct !{!105, !10}
!106 = distinct !{!106, !10}
!107 = distinct !{!107, !10}
!108 = distinct !{!108, !10}
!109 = distinct !{!109, !10}
!110 = distinct !{!110, !10, !11, !12}
!111 = distinct !{!111, !10, !12, !11}
!112 = distinct !{!112, !10, !11, !12}
!113 = distinct !{!113, !10, !12, !11}
!114 = distinct !{!114, !10}
!115 = distinct !{!115, !10}
!116 = distinct !{!116, !10}
!117 = distinct !{!117, !10, !11, !12}
!118 = distinct !{!118, !10, !11, !12}
!119 = distinct !{!119, !39}
!120 = distinct !{!120, !10, !11}
!121 = distinct !{!121, !10}
!122 = distinct !{!122, !10}
!123 = distinct !{!123, !10, !11, !12}
!124 = distinct !{!124, !10, !11, !12}
!125 = distinct !{!125, !10, !12, !11}
|
#include<stdio.h>
int main(void)
{
int i,n=0;
char s[100000];
scanf("%s",s);
while(s[n]!='\0'){
n++;
}
for(i=0;i<n;i=i+2){
printf("%c",s[i]);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127098/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127098/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %for.cond.preheader, label %while.cond, !llvm.loop !8
for.cond.preheader: ; preds = %while.cond
%1 = and i64 %indvars.iv, 4294967295
%cmp214.not = icmp eq i64 %1, 0
br i1 %cmp214.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%2 = and i64 %indvars.iv, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv17 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next18, %for.body ]
%arrayidx5 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv17
%3 = load i8, ptr %arrayidx5, align 2, !tbaa !5
%conv6 = sext i8 %3 to i32
%putchar13 = call i32 @putchar(i32 %conv6)
%indvars.iv.next18 = add nuw nsw i64 %indvars.iv17, 2
%cmp2 = icmp ult i64 %indvars.iv.next18, %2
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdio.h>
#include <string.h>
#define MAX 100001
void Calc(char s[MAX], char ans[MAX/2 + 1]);
int main(){
char s[MAX];
char ans[MAX/2 + 1] = "";
if(scanf("%s", s) != 1){
scanf("%*s");
return -1;
}
Calc(s, ans);
printf("%s\n", ans);
return 0;
}
void Calc(char s[MAX/2 + 1], char ans[MAX/2 + 1]){
int count, gusu = 0;
for(count = 0; count < strlen(s); count++)
if(count % 2 == 0){
ans[gusu] = s[count];
gusu++;
} else if(s[count] == '\0'){
ans[gusu] = '\0';
gusu++;
}
return;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127155/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127155/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%*s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100001 x i8], align 16
%ans = alloca [50001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #8
call void @llvm.lifetime.start.p0(i64 50001, ptr nonnull %ans) #8
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(50001) %ans, i8 0, i64 50001, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1)
br label %cleanup
if.end: ; preds = %entry
%char0.i = load i8, ptr %s, align 16
%cmp28.not.i = icmp eq i8 %char0.i, 0
br i1 %cmp28.not.i, label %Calc.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %if.end
%call.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #9
%umax = call i64 @llvm.umax.i64(i64 %call.i, i64 1)
%xtraiter = and i64 %umax, 1
%0 = icmp ult i64 %call.i, 2
br i1 %0, label %Calc.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %umax, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%gusu.030.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %gusu.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.i
%1 = load i8, ptr %arrayidx.i, align 2, !tbaa !5
%idxprom4.i = sext i32 %gusu.030.i to i64
%arrayidx5.i = getelementptr inbounds i8, ptr %ans, i64 %idxprom4.i
store i8 %1, ptr %arrayidx5.i, align 1, !tbaa !5
%inc.i = add nsw i32 %gusu.030.i, 1
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next.i
%2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5
%cmp9.i.1 = icmp eq i8 %2, 0
br i1 %cmp9.i.1, label %for.inc.sink.split.i.1, label %for.inc.i.1
for.inc.sink.split.i.1: ; preds = %for.body.i
%idxprom4.i.1 = sext i32 %inc.i to i64
%arrayidx5.i.1 = getelementptr inbounds i8, ptr %ans, i64 %idxprom4.i.1
store i8 0, ptr %arrayidx5.i.1, align 1, !tbaa !5
%inc.i.1 = add nsw i32 %inc.i, 1
br label %for.inc.i.1
for.inc.i.1: ; preds = %for.inc.sink.split.i.1, %for.body.i
%gusu.1.i.1 = phi i32 [ %inc.i, %for.body.i ], [ %inc.i.1, %for.inc.sink.split.i.1 ]
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %Calc.exit.loopexit.unr-lcssa.loopexit, label %for.body.i, !llvm.loop !8
Calc.exit.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.i.1
%3 = sext i32 %gusu.1.i.1 to i64
br label %Calc.exit.loopexit.unr-lcssa
Calc.exit.loopexit.unr-lcssa: ; preds = %Calc.exit.loopexit.unr-lcssa.loopexit, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %Calc.exit.loopexit.unr-lcssa.loopexit ]
%gusu.030.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %3, %Calc.exit.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %Calc.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %Calc.exit.loopexit.unr-lcssa
%rem33.i.epil = and i64 %indvars.iv.i.unr, 1
%cmp2.i.epil = icmp eq i64 %rem33.i.epil, 0
%arrayidx.i.epil = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.i.unr
%4 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5
br i1 %cmp2.i.epil, label %for.inc.sink.split.i.epil, label %if.else.i.epil
if.else.i.epil: ; preds = %for.body.i.epil
%cmp9.i.epil = icmp eq i8 %4, 0
br i1 %cmp9.i.epil, label %for.inc.sink.split.i.epil, label %Calc.exit
for.inc.sink.split.i.epil: ; preds = %if.else.i.epil, %for.body.i.epil
%.sink.i.epil = phi i8 [ %4, %for.body.i.epil ], [ 0, %if.else.i.epil ]
%arrayidx5.i.epil = getelementptr inbounds i8, ptr %ans, i64 %gusu.030.i.unr
store i8 %.sink.i.epil, ptr %arrayidx5.i.epil, align 1, !tbaa !5
br label %Calc.exit
Calc.exit: ; preds = %Calc.exit.loopexit.unr-lcssa, %for.inc.sink.split.i.epil, %if.else.i.epil, %if.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans)
br label %cleanup
cleanup: ; preds = %Calc.exit, %if.then
%retval.0 = phi i32 [ -1, %if.then ], [ 0, %Calc.exit ]
call void @llvm.lifetime.end.p0(i64 50001, ptr nonnull %ans) #8
call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #8
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 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 memory(argmem: readwrite) uwtable
define dso_local void @Calc(ptr nocapture noundef readonly %s, ptr nocapture noundef writeonly %ans) local_unnamed_addr #4 {
entry:
%char0 = load i8, ptr %s, align 1
%cmp28.not = icmp eq i8 %char0, 0
br i1 %cmp28.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%gusu.030 = phi i32 [ %gusu.1, %for.inc ], [ 0, %entry ]
%rem33 = and i64 %indvars.iv, 1
%cmp2 = icmp eq i64 %rem33, 0
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
br i1 %cmp2, label %for.inc.sink.split, label %if.else
if.else: ; preds = %for.body
%cmp9 = icmp eq i8 %0, 0
br i1 %cmp9, label %for.inc.sink.split, label %for.inc
for.inc.sink.split: ; preds = %if.else, %for.body
%.sink = phi i8 [ %0, %for.body ], [ 0, %if.else ]
%idxprom4 = sext i32 %gusu.030 to i64
%arrayidx5 = getelementptr inbounds i8, ptr %ans, i64 %idxprom4
store i8 %.sink, ptr %arrayidx5, align 1, !tbaa !5
%inc = add nsw i32 %gusu.030, 1
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %if.else
%gusu.1 = phi i32 [ %gusu.030, %if.else ], [ %inc, %for.inc.sink.split ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #9
%cmp = icmp ugt i64 %call, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8
for.end: ; preds = %for.inc, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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 nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int R=1,C=1,H[2000010],N[2000010];
//評価関数(いまはMIN)
int hyouka(int a,int b){
if(C<b)return 1;
if(C<a||b==0)return 0;
return N[H[a]]<N[H[b]]?1:0;
}
//挿入関数
void hin(int a){
int i=C++;
for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
H[i]=R++;
}
//取り出す関数
int hout(){
int rt=H[1],i,j=2,k=H[--C];
for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
H[j/2]=k;
return rt;
}
int main(){
int n,m,i,j,d[300010];
long long max=-1e18,a[300010],b[300010];
scanf("%d",&n);
m=3*n-1;
for(i=0;i<3*n;i++)scanf("%d",&d[i]);
for(i=0;i<3*n;i++)a[i]=b[i]=0;
//kimeuti
//for(i=0;i<3*n;i++)printf("%4lld %4lld\n",a[i],b[i]);printf("\n");
for(i=0;i<n;i++){
hin(d[i]);
a[i]+=d[i];
a[i+1]+=a[i];
}
//for(i=0;i<3*n;i++)printf("%4lld %4lld\n",a[i],b[i]);printf("\n");
for(i=n;i<2*n;i++){
hin(d[i]);
a[i]+=d[i];
a[i]-=N[hout()];
a[i+1]+=a[i];
}
R=C=1;
for(i=0;i<n;i++){
hin(-d[m-i]);
b[m-i]+=d[m-i];
b[m-i-1]+=b[m-i];
}
for(i=n;i<2*n;i++){
hin(-d[m-i]);
b[m-i]+=d[m-i];
b[m-i]+=N[hout()];
b[m-i-1]+=b[m-i];
}
//for(i=0;i<3*n;i++)printf("%4lld %4lld\n",a[i],b[i]);
for(i=0;i<=n;i++){
if(max<a[i+n-1]-b[i+n])max=a[i+n-1]-b[i+n];
}
printf("%lld\n",max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127205/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127205/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@R = dso_local local_unnamed_addr global i32 1, align 4
@C = dso_local local_unnamed_addr global i32 1, align 4
@N = dso_local local_unnamed_addr global [2000010 x i32] zeroinitializer, align 16
@H = dso_local local_unnamed_addr global [2000010 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @hyouka(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @C, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %b
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%cmp1 = icmp slt i32 %0, %a
%cmp2 = icmp eq i32 %b, 0
%or.cond = or i1 %cmp2, %cmp1
br i1 %or.cond, label %return, label %if.end4
if.end4: ; preds = %if.end
%idxprom = sext i32 %a to i64
%arrayidx = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom5 = sext i32 %1 to i64
%arrayidx6 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%idxprom7 = sext i32 %b to i64
%arrayidx8 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%idxprom9 = sext i32 %3 to i64
%arrayidx10 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9
%4 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp slt i32 %2, %4
%cond = zext i1 %cmp11 to i32
br label %return
return: ; preds = %if.end, %entry, %if.end4
%retval.0 = phi i32 [ %cond, %if.end4 ], [ 1, %entry ], [ 0, %if.end ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @hin(i32 noundef %a) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr @C, align 4, !tbaa !5
%.fr = freeze i32 %0
%inc = add nsw i32 %.fr, 1
store i32 %inc, ptr @C, align 4, !tbaa !5
%1 = load i32, ptr @R, align 4, !tbaa !5
store i32 %1, ptr @H, align 16, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom
store i32 %a, ptr %arrayidx, align 4, !tbaa !5
%cmp1.i = icmp slt i32 %.fr, -1
br i1 %cmp1.i, label %entry.split.us, label %for.cond
entry.split.us: ; preds = %entry
%.fr.nonneg = sub i32 0, %.fr
%div.us192426 = lshr i32 %.fr.nonneg, 1
%div.us1924.neg = sub nsw i32 0, %div.us192426
%cmp.i.us20 = icmp ult i32 %inc, %div.us1924.neg
br i1 %cmp.i.us20, label %for.body.us, label %for.end
for.body.us: ; preds = %entry.split.us, %for.body.us
%div.us22 = phi i32 [ %div.us, %for.body.us ], [ %div.us1924.neg, %entry.split.us ]
%i.0.us21 = phi i32 [ %div.us22, %for.body.us ], [ %.fr, %entry.split.us ]
%idxprom2.us = sext i32 %div.us22 to i64
%arrayidx3.us = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.us
%2 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%idxprom4.us = sext i32 %i.0.us21 to i64
%arrayidx5.us = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.us
store i32 %2, ptr %arrayidx5.us, align 4, !tbaa !5
%div.us = sdiv i32 %div.us22, 2
%cmp.i.us = icmp slt i32 %inc, %div.us
br i1 %cmp.i.us, label %for.body.us, label %for.end, !llvm.loop !9
for.cond: ; preds = %entry, %for.body
%i.0 = phi i32 [ %div, %for.body ], [ %.fr, %entry ]
%div = sdiv i32 %i.0, 2
%cmp.i = icmp slt i32 %inc, %div
br i1 %cmp.i, label %for.cond.for.body_crit_edge, label %if.end.i
for.cond.for.body_crit_edge: ; preds = %for.cond
%idxprom2.phi.trans.insert = sext i32 %div to i64
%arrayidx3.phi.trans.insert = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.phi.trans.insert
%.pre = load i32, ptr %arrayidx3.phi.trans.insert, align 4, !tbaa !5
br label %for.body
if.end.i: ; preds = %for.cond
%i.0.off = add i32 %i.0, 1
%cmp2.i = icmp ult i32 %i.0.off, 3
br i1 %cmp2.i, label %for.end, label %hyouka.exit
hyouka.exit: ; preds = %if.end.i
%3 = load i32, ptr @H, align 16, !tbaa !5
%idxprom5.i = sext i32 %3 to i64
%arrayidx6.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i
%4 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
%idxprom7.i = sext i32 %div to i64
%arrayidx8.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i
%5 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5
%idxprom9.i = sext i32 %5 to i64
%arrayidx10.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i
%6 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5
%cmp11.i.not = icmp slt i32 %4, %6
br i1 %cmp11.i.not, label %for.body, label %for.end
for.body: ; preds = %for.cond.for.body_crit_edge, %hyouka.exit
%7 = phi i32 [ %.pre, %for.cond.for.body_crit_edge ], [ %5, %hyouka.exit ]
%idxprom4 = sext i32 %i.0 to i64
%arrayidx5 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4
store i32 %7, ptr %arrayidx5, align 4, !tbaa !5
br label %for.cond, !llvm.loop !9
for.end: ; preds = %hyouka.exit, %if.end.i, %for.body.us, %entry.split.us
%.us-phi = phi i32 [ %.fr, %entry.split.us ], [ %div.us22, %for.body.us ], [ %i.0, %if.end.i ], [ %i.0, %hyouka.exit ]
%inc7 = add nsw i32 %1, 1
store i32 %inc7, ptr @R, align 4, !tbaa !5
%idxprom8 = sext i32 %.us-phi to i64
%arrayidx9 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom8
store i32 %1, ptr %arrayidx9, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @hout() local_unnamed_addr #1 {
entry:
%0 = load i32, ptr getelementptr inbounds ([2000010 x i32], ptr @H, i64 0, i64 1), align 4, !tbaa !5
%1 = load i32, ptr @C, align 4, !tbaa !5
%.fr = freeze i32 %1
%dec = add i32 %.fr, -1
store i32 %dec, ptr @C, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%or.cond.i35 = icmp slt i32 %.fr, 2
br i1 %or.cond.i35, label %for.end, label %hyouka.exit.lr.ph.split
hyouka.exit.lr.ph.split: ; preds = %entry
%idxprom5.i40 = sext i32 %0 to i64
%arrayidx6.i41 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i40
%3 = load i32, ptr %arrayidx6.i41, align 4, !tbaa !5
%idxprom9.i42 = sext i32 %2 to i64
%arrayidx10.i43 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i42
%4 = load i32, ptr %arrayidx10.i43, align 4, !tbaa !5
%cmp11.i.not44 = icmp slt i32 %3, %4
br i1 %cmp11.i.not44, label %for.body, label %for.end
hyouka.exit: ; preds = %hyouka.exit31
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%idxprom5.i = sext i32 %5 to i64
%arrayidx6.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i
%6 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom9.i = sext i32 %7 to i64
%arrayidx10.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i
%8 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5
%cmp11.i.not = icmp slt i32 %6, %8
br i1 %cmp11.i.not, label %for.body, label %for.end.loopexit, !llvm.loop !11
for.body: ; preds = %hyouka.exit.lr.ph.split, %hyouka.exit
%i.03745 = phi i32 [ %sub, %hyouka.exit ], [ 1, %hyouka.exit.lr.ph.split ]
%mul = shl nsw i32 %i.03745, 1
%add = or i32 %mul, 1
%cmp.i16.not = icmp sgt i32 %.fr, %add
br i1 %cmp.i16.not, label %if.end.i17, label %hyouka.exit31
if.end.i17: ; preds = %for.body
%cmp1.i18.not = icmp sgt i32 %.fr, %mul
br i1 %cmp1.i18.not, label %if.end4.i19, label %hyouka.exit31
if.end4.i19: ; preds = %if.end.i17
%idxprom.i20 = sext i32 %mul to i64
%arrayidx.i21 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom.i20
%9 = load i32, ptr %arrayidx.i21, align 8, !tbaa !5
%idxprom5.i22 = sext i32 %9 to i64
%arrayidx6.i23 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i22
%10 = load i32, ptr %arrayidx6.i23, align 4, !tbaa !5
%idxprom7.i24 = sext i32 %add to i64
%arrayidx8.i25 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i24
%11 = load i32, ptr %arrayidx8.i25, align 4, !tbaa !5
%idxprom9.i26 = sext i32 %11 to i64
%arrayidx10.i27 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i26
%12 = load i32, ptr %arrayidx10.i27, align 4, !tbaa !5
%cmp11.i28 = icmp slt i32 %10, %12
%cond.i29.neg = sext i1 %cmp11.i28 to i32
br label %hyouka.exit31
hyouka.exit31: ; preds = %for.body, %if.end.i17, %if.end4.i19
%retval.0.i30.neg = phi i32 [ %cond.i29.neg, %if.end4.i19 ], [ -1, %for.body ], [ 0, %if.end.i17 ]
%sub = add i32 %retval.0.i30.neg, %add
%idxprom5 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom5
%13 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%idxprom7 = sext i32 %i.03745 to i64
%arrayidx8 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7
store i32 %13, ptr %arrayidx8, align 4, !tbaa !5
%cmp1.i.not = icmp sgt i32 %.fr, %sub
br i1 %cmp1.i.not, label %hyouka.exit, label %for.end.loopexit, !llvm.loop !11
for.end.loopexit: ; preds = %hyouka.exit31, %hyouka.exit
%14 = sdiv i32 %sub, 2
%15 = sext i32 %14 to i64
br label %for.end
for.end: ; preds = %for.end.loopexit, %hyouka.exit.lr.ph.split, %entry
%j.0.lcssa = phi i64 [ 1, %entry ], [ 1, %hyouka.exit.lr.ph.split ], [ %15, %for.end.loopexit ]
%arrayidx10 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %j.0.lcssa
store i32 %2, ptr %arrayidx10, align 4, !tbaa !5
ret i32 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%d = alloca [300010 x i32], align 16
%a = alloca [300010 x i64], align 16
%b = alloca [300010 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 1200040, ptr nonnull %d) #7
call void @llvm.lifetime.start.p0(i64 2400080, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 2400080, ptr nonnull %b) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul = mul nsw i32 %0, 3
%sub = add nsw i32 %mul, -1
%cmp405 = icmp sgt i32 %0, 0
br i1 %cmp405, label %for.body, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
%mul1.lcssa = phi i32 [ %mul, %entry ], [ %mul1, %for.body ]
%cmp5408 = icmp sgt i32 %mul1.lcssa, 0
br i1 %cmp5408, label %for.body6.preheader, label %for.cond14.preheader
for.body6.preheader: ; preds = %for.cond3.preheader
%1 = zext i32 %mul1.lcssa to i64
%2 = shl nuw nsw i64 %1, 3
call void @llvm.memset.p0.i64(ptr nonnull align 16 %b, i8 0, i64 %2, i1 false), !tbaa !12
call void @llvm.memset.p0.i64(ptr nonnull align 16 %a, i8 0, i64 %2, i1 false), !tbaa !12
br label %for.cond14.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [300010 x i32], ptr %d, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%mul1 = mul nsw i32 %3, 3
%4 = sext i32 %mul1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !14
for.cond14.preheader: ; preds = %for.body6.preheader, %for.cond3.preheader
%C.promoted = load i32, ptr @C, align 4, !tbaa !5
%R.promoted = load i32, ptr @R, align 4, !tbaa !5
%cmp15412 = icmp sgt i32 %.lcssa, 0
%C.promoted.fr = freeze i32 %C.promoted
br i1 %cmp15412, label %for.body16.preheader, label %for.cond32.preheader
for.body16.preheader: ; preds = %for.cond14.preheader
%5 = sext i32 %R.promoted to i64
%wide.trip.count = zext i32 %.lcssa to i64
br label %for.body16
for.cond14.for.cond32.preheader_crit_edge: ; preds = %hin.exit
%6 = trunc i64 %indvars.iv.next458 to i32
br label %for.cond32.preheader
for.cond32.preheader: ; preds = %for.cond14.for.cond32.preheader_crit_edge, %for.cond14.preheader
%C.promoted416.fr.pre-phi = phi i32 [ %inc.i, %for.cond14.for.cond32.preheader_crit_edge ], [ %C.promoted.fr, %for.cond14.preheader ]
%R.promoted418 = phi i32 [ %6, %for.cond14.for.cond32.preheader_crit_edge ], [ %R.promoted, %for.cond14.preheader ]
%mul33 = shl nsw i32 %.lcssa, 1
%cmp34420 = icmp slt i32 %.lcssa, %mul33
br i1 %cmp34420, label %for.body36.preheader, label %for.end60
for.body36.preheader: ; preds = %for.cond32.preheader
%7 = sext i32 %.lcssa to i64
%8 = sext i32 %R.promoted418 to i64
%wide.trip.count469 = sext i32 %mul33 to i64
%inc.i206 = add i32 %C.promoted416.fr.pre-phi, 1
%cmp1.i.i209 = icmp slt i32 %C.promoted416.fr.pre-phi, -1
%.fr.nonneg.i237 = sub i32 0, %C.promoted416.fr.pre-phi
%div.us192426.i238 = lshr i32 %.fr.nonneg.i237, 1
%div.us1924.neg.i239 = sub nsw i32 0, %div.us192426.i238
%cmp.i.us20.i240 = icmp ult i32 %inc.i206, %div.us1924.neg.i239
%idxprom.i252 = sext i32 %C.promoted416.fr.pre-phi to i64
%arrayidx.i253 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom.i252
%or.cond.i35.i = icmp slt i32 %inc.i206, 2
br label %for.body36
for.body16: ; preds = %for.body16.preheader, %hin.exit
%indvars.iv457 = phi i64 [ %5, %for.body16.preheader ], [ %indvars.iv.next458, %hin.exit ]
%indvars.iv455 = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next456, %hin.exit ]
%inc.i410414 = phi i32 [ %C.promoted.fr, %for.body16.preheader ], [ %inc.i, %hin.exit ]
%arrayidx18 = getelementptr inbounds [300010 x i32], ptr %d, i64 0, i64 %indvars.iv455
%9 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%inc.i = add i32 %inc.i410414, 1
%10 = trunc i64 %indvars.iv457 to i32
store i32 %10, ptr @H, align 16, !tbaa !5
%arrayidx.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %indvars.iv457
store i32 %9, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i.i = icmp slt i32 %inc.i410414, -1
br i1 %cmp1.i.i, label %entry.split.us.i, label %for.cond.i
entry.split.us.i: ; preds = %for.body16
%.fr.nonneg.i = sub i32 0, %inc.i410414
%div.us192426.i = lshr i32 %.fr.nonneg.i, 1
%div.us1924.neg.i = sub nsw i32 0, %div.us192426.i
%cmp.i.us20.i = icmp ult i32 %inc.i, %div.us1924.neg.i
br i1 %cmp.i.us20.i, label %for.body.us.i, label %hin.exit
for.body.us.i: ; preds = %entry.split.us.i, %for.body.us.i
%div.us22.i = phi i32 [ %div.us.i, %for.body.us.i ], [ %div.us1924.neg.i, %entry.split.us.i ]
%i.0.us21.i = phi i32 [ %div.us22.i, %for.body.us.i ], [ %inc.i410414, %entry.split.us.i ]
%idxprom2.us.i = sext i32 %div.us22.i to i64
%arrayidx3.us.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.us.i
%11 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%idxprom4.us.i = sext i32 %i.0.us21.i to i64
%arrayidx5.us.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.us.i
store i32 %11, ptr %arrayidx5.us.i, align 4, !tbaa !5
%div.us.i = sdiv i32 %div.us22.i, 2
%cmp.i.us.i = icmp slt i32 %inc.i, %div.us.i
br i1 %cmp.i.us.i, label %for.body.us.i, label %hin.exit, !llvm.loop !9
for.cond.i: ; preds = %for.body16, %for.body.i
%i.0.i = phi i32 [ %div.i, %for.body.i ], [ %inc.i410414, %for.body16 ]
%div.i = sdiv i32 %i.0.i, 2
%cmp.i.i = icmp slt i32 %inc.i, %div.i
br i1 %cmp.i.i, label %for.cond.for.body_crit_edge.i, label %if.end.i.i
for.cond.for.body_crit_edge.i: ; preds = %for.cond.i
%idxprom2.phi.trans.insert.i = sext i32 %div.i to i64
%arrayidx3.phi.trans.insert.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.phi.trans.insert.i
%.pre.i = load i32, ptr %arrayidx3.phi.trans.insert.i, align 4, !tbaa !5
br label %for.body.i
if.end.i.i: ; preds = %for.cond.i
%i.0.off.i = add i32 %i.0.i, 1
%cmp2.i.i = icmp ult i32 %i.0.off.i, 3
br i1 %cmp2.i.i, label %hin.exit, label %hyouka.exit.i
hyouka.exit.i: ; preds = %if.end.i.i
%12 = load i32, ptr @H, align 16, !tbaa !5
%idxprom5.i.i = sext i32 %12 to i64
%arrayidx6.i.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i.i
%13 = load i32, ptr %arrayidx6.i.i, align 4, !tbaa !5
%idxprom7.i.i = sext i32 %div.i to i64
%arrayidx8.i.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i.i
%14 = load i32, ptr %arrayidx8.i.i, align 4, !tbaa !5
%idxprom9.i.i = sext i32 %14 to i64
%arrayidx10.i.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i.i
%15 = load i32, ptr %arrayidx10.i.i, align 4, !tbaa !5
%cmp11.i.not.i = icmp slt i32 %13, %15
br i1 %cmp11.i.not.i, label %for.body.i, label %hin.exit
for.body.i: ; preds = %hyouka.exit.i, %for.cond.for.body_crit_edge.i
%16 = phi i32 [ %.pre.i, %for.cond.for.body_crit_edge.i ], [ %14, %hyouka.exit.i ]
%idxprom4.i = sext i32 %i.0.i to i64
%arrayidx5.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.i
store i32 %16, ptr %arrayidx5.i, align 4, !tbaa !5
br label %for.cond.i, !llvm.loop !9
hin.exit: ; preds = %if.end.i.i, %hyouka.exit.i, %for.body.us.i, %entry.split.us.i
%.us-phi.i = phi i32 [ %inc.i410414, %entry.split.us.i ], [ %div.us22.i, %for.body.us.i ], [ %i.0.i, %hyouka.exit.i ], [ %i.0.i, %if.end.i.i ]
%indvars.iv.next458 = add nsw i64 %indvars.iv457, 1
%idxprom8.i = sext i32 %.us-phi.i to i64
%arrayidx9.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom8.i
store i32 %10, ptr %arrayidx9.i, align 4, !tbaa !5
%conv = sext i32 %9 to i64
%arrayidx22 = getelementptr inbounds [300010 x i64], ptr %a, i64 0, i64 %indvars.iv455
%17 = load i64, ptr %arrayidx22, align 8, !tbaa !12
%add = add nsw i64 %17, %conv
store i64 %add, ptr %arrayidx22, align 8, !tbaa !12
%indvars.iv.next456 = add nuw nsw i64 %indvars.iv455, 1
%arrayidx27 = getelementptr inbounds [300010 x i64], ptr %a, i64 0, i64 %indvars.iv.next456
%18 = load i64, ptr %arrayidx27, align 8, !tbaa !12
%add28 = add nsw i64 %18, %add
store i64 %add28, ptr %arrayidx27, align 8, !tbaa !12
%exitcond.not = icmp eq i64 %indvars.iv.next456, %wide.trip.count
br i1 %exitcond.not, label %for.cond14.for.cond32.preheader_crit_edge, label %for.body16, !llvm.loop !15
for.body36: ; preds = %for.body36.preheader, %hout.exit
%indvars.iv464 = phi i64 [ %8, %for.body36.preheader ], [ %indvars.iv.next465, %hout.exit ]
%indvars.iv462 = phi i64 [ %7, %for.body36.preheader ], [ %indvars.iv.next463, %hout.exit ]
%arrayidx38 = getelementptr inbounds [300010 x i32], ptr %d, i64 0, i64 %indvars.iv462
%19 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%20 = trunc i64 %indvars.iv464 to i32
store i32 %20, ptr @H, align 16, !tbaa !5
%arrayidx.i208 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %indvars.iv464
store i32 %19, ptr %arrayidx.i208, align 4, !tbaa !5
br i1 %cmp1.i.i209, label %entry.split.us.i236, label %for.cond.i210
entry.split.us.i236: ; preds = %for.body36
br i1 %cmp.i.us20.i240, label %for.body.us.i241, label %hin.exit250
for.body.us.i241: ; preds = %entry.split.us.i236, %for.body.us.i241
%div.us22.i242 = phi i32 [ %div.us.i248, %for.body.us.i241 ], [ %div.us1924.neg.i239, %entry.split.us.i236 ]
%i.0.us21.i243 = phi i32 [ %div.us22.i242, %for.body.us.i241 ], [ %C.promoted416.fr.pre-phi, %entry.split.us.i236 ]
%idxprom2.us.i244 = sext i32 %div.us22.i242 to i64
%arrayidx3.us.i245 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.us.i244
%21 = load i32, ptr %arrayidx3.us.i245, align 4, !tbaa !5
%idxprom4.us.i246 = sext i32 %i.0.us21.i243 to i64
%arrayidx5.us.i247 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.us.i246
store i32 %21, ptr %arrayidx5.us.i247, align 4, !tbaa !5
%div.us.i248 = sdiv i32 %div.us22.i242, 2
%cmp.i.us.i249 = icmp slt i32 %inc.i206, %div.us.i248
br i1 %cmp.i.us.i249, label %for.body.us.i241, label %hin.exit250, !llvm.loop !9
for.cond.i210: ; preds = %for.body36, %for.body.i229
%i.0.i211 = phi i32 [ %div.i212, %for.body.i229 ], [ %C.promoted416.fr.pre-phi, %for.body36 ]
%div.i212 = sdiv i32 %i.0.i211, 2
%cmp.i.i213 = icmp slt i32 %inc.i206, %div.i212
br i1 %cmp.i.i213, label %for.cond.for.body_crit_edge.i232, label %if.end.i.i214
for.cond.for.body_crit_edge.i232: ; preds = %for.cond.i210
%idxprom2.phi.trans.insert.i233 = sext i32 %div.i212 to i64
%arrayidx3.phi.trans.insert.i234 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.phi.trans.insert.i233
%.pre.i235 = load i32, ptr %arrayidx3.phi.trans.insert.i234, align 4, !tbaa !5
br label %for.body.i229
if.end.i.i214: ; preds = %for.cond.i210
%i.0.off.i215 = add i32 %i.0.i211, 1
%cmp2.i.i216 = icmp ult i32 %i.0.off.i215, 3
br i1 %cmp2.i.i216, label %hin.exit250, label %hyouka.exit.i217
hyouka.exit.i217: ; preds = %if.end.i.i214
%22 = load i32, ptr @H, align 16, !tbaa !5
%idxprom5.i.i218 = sext i32 %22 to i64
%arrayidx6.i.i219 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i.i218
%23 = load i32, ptr %arrayidx6.i.i219, align 4, !tbaa !5
%idxprom7.i.i220 = sext i32 %div.i212 to i64
%arrayidx8.i.i221 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i.i220
%24 = load i32, ptr %arrayidx8.i.i221, align 4, !tbaa !5
%idxprom9.i.i222 = sext i32 %24 to i64
%arrayidx10.i.i223 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i.i222
%25 = load i32, ptr %arrayidx10.i.i223, align 4, !tbaa !5
%cmp11.i.not.i224 = icmp slt i32 %23, %25
br i1 %cmp11.i.not.i224, label %for.body.i229, label %hin.exit250
for.body.i229: ; preds = %hyouka.exit.i217, %for.cond.for.body_crit_edge.i232
%26 = phi i32 [ %.pre.i235, %for.cond.for.body_crit_edge.i232 ], [ %24, %hyouka.exit.i217 ]
%idxprom4.i230 = sext i32 %i.0.i211 to i64
%arrayidx5.i231 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.i230
store i32 %26, ptr %arrayidx5.i231, align 4, !tbaa !5
br label %for.cond.i210, !llvm.loop !9
hin.exit250: ; preds = %if.end.i.i214, %hyouka.exit.i217, %for.body.us.i241, %entry.split.us.i236
%.us-phi.i225 = phi i32 [ %C.promoted416.fr.pre-phi, %entry.split.us.i236 ], [ %div.us22.i242, %for.body.us.i241 ], [ %i.0.i211, %hyouka.exit.i217 ], [ %i.0.i211, %if.end.i.i214 ]
%indvars.iv.next465 = add nsw i64 %indvars.iv464, 1
%idxprom8.i227 = sext i32 %.us-phi.i225 to i64
%arrayidx9.i228 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom8.i227
store i32 %20, ptr %arrayidx9.i228, align 4, !tbaa !5
%conv41 = sext i32 %19 to i64
%arrayidx43 = getelementptr inbounds [300010 x i64], ptr %a, i64 0, i64 %indvars.iv462
%27 = load i64, ptr %arrayidx43, align 8, !tbaa !12
%add44 = add nsw i64 %27, %conv41
%28 = load i32, ptr getelementptr inbounds ([2000010 x i32], ptr @H, i64 0, i64 1), align 4, !tbaa !5
%29 = load i32, ptr %arrayidx.i253, align 4, !tbaa !5
%idxprom46.phi.trans.insert = sext i32 %28 to i64
%arrayidx47.phi.trans.insert = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom46.phi.trans.insert
%.pre = load i32, ptr %arrayidx47.phi.trans.insert, align 4, !tbaa !5
br i1 %or.cond.i35.i, label %hout.exit, label %hyouka.exit.lr.ph.split.i
hyouka.exit.lr.ph.split.i: ; preds = %hin.exit250
%idxprom9.i42.i = sext i32 %29 to i64
%arrayidx10.i43.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i42.i
%30 = load i32, ptr %arrayidx10.i43.i, align 4, !tbaa !5
%cmp11.i.not44.i = icmp slt i32 %.pre, %30
br i1 %cmp11.i.not44.i, label %for.body.i254, label %hout.exit
hyouka.exit.i255: ; preds = %hyouka.exit31.i
%31 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
%idxprom5.i.i256 = sext i32 %31 to i64
%arrayidx6.i.i257 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i.i256
%32 = load i32, ptr %arrayidx6.i.i257, align 4, !tbaa !5
%33 = load i32, ptr %arrayidx.i253, align 4, !tbaa !5
%idxprom9.i.i258 = sext i32 %33 to i64
%arrayidx10.i.i259 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i.i258
%34 = load i32, ptr %arrayidx10.i.i259, align 4, !tbaa !5
%cmp11.i.not.i260 = icmp slt i32 %32, %34
br i1 %cmp11.i.not.i260, label %for.body.i254, label %for.end.loopexit.i, !llvm.loop !11
for.body.i254: ; preds = %hyouka.exit.lr.ph.split.i, %hyouka.exit.i255
%i.03745.i = phi i32 [ %sub.i, %hyouka.exit.i255 ], [ 1, %hyouka.exit.lr.ph.split.i ]
%mul.i = shl nsw i32 %i.03745.i, 1
%add.i = or i32 %mul.i, 1
%cmp.i16.not.i = icmp sgt i32 %inc.i206, %add.i
br i1 %cmp.i16.not.i, label %if.end.i17.i, label %hyouka.exit31.i
if.end.i17.i: ; preds = %for.body.i254
%cmp1.i18.not.i = icmp sgt i32 %inc.i206, %mul.i
br i1 %cmp1.i18.not.i, label %if.end4.i19.i, label %hyouka.exit31.i
if.end4.i19.i: ; preds = %if.end.i17.i
%idxprom.i20.i = sext i32 %mul.i to i64
%arrayidx.i21.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom.i20.i
%35 = load i32, ptr %arrayidx.i21.i, align 8, !tbaa !5
%idxprom5.i22.i = sext i32 %35 to i64
%arrayidx6.i23.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i22.i
%36 = load i32, ptr %arrayidx6.i23.i, align 4, !tbaa !5
%idxprom7.i24.i = sext i32 %add.i to i64
%arrayidx8.i25.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i24.i
%37 = load i32, ptr %arrayidx8.i25.i, align 4, !tbaa !5
%idxprom9.i26.i = sext i32 %37 to i64
%arrayidx10.i27.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i26.i
%38 = load i32, ptr %arrayidx10.i27.i, align 4, !tbaa !5
%cmp11.i28.i = icmp slt i32 %36, %38
%cond.i29.neg.i = sext i1 %cmp11.i28.i to i32
br label %hyouka.exit31.i
hyouka.exit31.i: ; preds = %if.end4.i19.i, %if.end.i17.i, %for.body.i254
%retval.0.i30.neg.i = phi i32 [ %cond.i29.neg.i, %if.end4.i19.i ], [ -1, %for.body.i254 ], [ 0, %if.end.i17.i ]
%sub.i = add i32 %retval.0.i30.neg.i, %add.i
%idxprom5.i = sext i32 %sub.i to i64
%arrayidx6.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom5.i
%39 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
%idxprom7.i = sext i32 %i.03745.i to i64
%arrayidx8.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i
store i32 %39, ptr %arrayidx8.i, align 4, !tbaa !5
%cmp1.i.not.i = icmp sgt i32 %inc.i206, %sub.i
br i1 %cmp1.i.not.i, label %hyouka.exit.i255, label %for.end.loopexit.i, !llvm.loop !11
for.end.loopexit.i: ; preds = %hyouka.exit31.i, %hyouka.exit.i255
%40 = sdiv i32 %sub.i, 2
%41 = sext i32 %40 to i64
br label %hout.exit
hout.exit: ; preds = %hin.exit250, %hyouka.exit.lr.ph.split.i, %for.end.loopexit.i
%j.0.lcssa.i = phi i64 [ 1, %hyouka.exit.lr.ph.split.i ], [ %41, %for.end.loopexit.i ], [ 1, %hin.exit250 ]
%arrayidx10.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %j.0.lcssa.i
store i32 %29, ptr %arrayidx10.i, align 4, !tbaa !5
%conv48 = sext i32 %.pre to i64
%sub51 = sub nsw i64 %add44, %conv48
store i64 %sub51, ptr %arrayidx43, align 8, !tbaa !12
%indvars.iv.next463 = add nsw i64 %indvars.iv462, 1
%arrayidx56 = getelementptr inbounds [300010 x i64], ptr %a, i64 0, i64 %indvars.iv.next463
%42 = load i64, ptr %arrayidx56, align 8, !tbaa !12
%add57 = add nsw i64 %42, %sub51
store i64 %add57, ptr %arrayidx56, align 8, !tbaa !12
%exitcond470.not = icmp eq i64 %indvars.iv.next463, %wide.trip.count469
br i1 %exitcond470.not, label %for.end60, label %for.body36, !llvm.loop !16
for.end60: ; preds = %hout.exit, %for.cond32.preheader
store i32 1, ptr @C, align 4, !tbaa !5
store i32 1, ptr @R, align 4, !tbaa !5
br i1 %cmp15412, label %for.body64.preheader, label %for.cond88.preheader
for.body64.preheader: ; preds = %for.end60
%43 = sext i32 %sub to i64
%wide.trip.count482 = zext i32 %.lcssa to i64
br label %for.cond.i266.preheader
for.cond61.for.cond88.preheader_crit_edge: ; preds = %hin.exit306
store i32 %indvars478, ptr @C, align 4, !tbaa !5
store i32 %indvars478, ptr @R, align 4, !tbaa !5
br label %for.cond88.preheader
for.cond88.preheader: ; preds = %for.cond61.for.cond88.preheader_crit_edge, %for.end60
%R.promoted435 = phi i32 [ %indvars478, %for.cond61.for.cond88.preheader_crit_edge ], [ 1, %for.end60 ]
br i1 %cmp34420, label %for.body92.preheader, label %for.cond124.preheader
for.body92.preheader: ; preds = %for.cond88.preheader
%44 = sext i32 %.lcssa to i64
%45 = sext i32 %sub to i64
%46 = sext i32 %R.promoted435 to i64
%wide.trip.count493 = sext i32 %mul33 to i64
%inc.i308 = add i32 %R.promoted435, 1
%cmp1.i.i311 = icmp slt i32 %R.promoted435, -1
%.fr.nonneg.i339 = sub i32 0, %R.promoted435
%div.us192426.i340 = lshr i32 %.fr.nonneg.i339, 1
%div.us1924.neg.i341 = sub nsw i32 0, %div.us192426.i340
%cmp.i.us20.i342 = icmp ult i32 %inc.i308, %div.us1924.neg.i341
%idxprom.i355 = sext i32 %R.promoted435 to i64
%arrayidx.i356 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom.i355
%or.cond.i35.i357 = icmp slt i32 %inc.i308, 2
br label %for.body92
for.cond.i266.preheader: ; preds = %hin.exit306, %for.body64.preheader
%indvars.iv475 = phi i64 [ 1, %for.body64.preheader ], [ %indvars.iv.next476, %hin.exit306 ]
%indvars.iv471 = phi i64 [ 0, %for.body64.preheader ], [ %indvars.iv.next472, %hin.exit306 ]
%indvars479 = trunc i64 %indvars.iv475 to i32
%47 = sub nsw i64 %43, %indvars.iv471
%arrayidx67 = getelementptr inbounds [300010 x i32], ptr %d, i64 0, i64 %47
%48 = load i32, ptr %arrayidx67, align 4, !tbaa !5
%sub68 = sub nsw i32 0, %48
%indvars.iv.next476 = add i64 %indvars.iv475, 1
%indvars478 = trunc i64 %indvars.iv.next476 to i32
store i32 %indvars479, ptr @H, align 16, !tbaa !5
%arrayidx.i264 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %indvars.iv475
store i32 %sub68, ptr %arrayidx.i264, align 4, !tbaa !5
br label %for.cond.i266
for.cond.i266: ; preds = %for.cond.i266.preheader, %for.body.i285
%i.0.i267 = phi i32 [ %div.i268, %for.body.i285 ], [ %indvars479, %for.cond.i266.preheader ]
%div.i268 = sdiv i32 %i.0.i267, 2
%cmp.i.i269 = icmp sgt i32 %div.i268, %indvars478
br i1 %cmp.i.i269, label %for.cond.for.body_crit_edge.i288, label %if.end.i.i270
for.cond.for.body_crit_edge.i288: ; preds = %for.cond.i266
%idxprom2.phi.trans.insert.i289 = sext i32 %div.i268 to i64
%arrayidx3.phi.trans.insert.i290 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.phi.trans.insert.i289
%.pre.i291 = load i32, ptr %arrayidx3.phi.trans.insert.i290, align 4, !tbaa !5
br label %for.body.i285
if.end.i.i270: ; preds = %for.cond.i266
%i.0.off.i271 = add i32 %i.0.i267, 1
%cmp2.i.i272 = icmp ult i32 %i.0.off.i271, 3
br i1 %cmp2.i.i272, label %hin.exit306, label %hyouka.exit.i273
hyouka.exit.i273: ; preds = %if.end.i.i270
%49 = load i32, ptr @H, align 16, !tbaa !5
%idxprom5.i.i274 = sext i32 %49 to i64
%arrayidx6.i.i275 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i.i274
%50 = load i32, ptr %arrayidx6.i.i275, align 4, !tbaa !5
%idxprom7.i.i276 = sext i32 %div.i268 to i64
%arrayidx8.i.i277 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i.i276
%51 = load i32, ptr %arrayidx8.i.i277, align 4, !tbaa !5
%idxprom9.i.i278 = sext i32 %51 to i64
%arrayidx10.i.i279 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i.i278
%52 = load i32, ptr %arrayidx10.i.i279, align 4, !tbaa !5
%cmp11.i.not.i280 = icmp slt i32 %50, %52
br i1 %cmp11.i.not.i280, label %for.body.i285, label %hin.exit306
for.body.i285: ; preds = %hyouka.exit.i273, %for.cond.for.body_crit_edge.i288
%53 = phi i32 [ %.pre.i291, %for.cond.for.body_crit_edge.i288 ], [ %51, %hyouka.exit.i273 ]
%idxprom4.i286 = sext i32 %i.0.i267 to i64
%arrayidx5.i287 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.i286
store i32 %53, ptr %arrayidx5.i287, align 4, !tbaa !5
br label %for.cond.i266, !llvm.loop !9
hin.exit306: ; preds = %if.end.i.i270, %hyouka.exit.i273
%idxprom8.i283 = sext i32 %i.0.i267 to i64
%arrayidx9.i284 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom8.i283
store i32 %indvars479, ptr %arrayidx9.i284, align 4, !tbaa !5
%conv72 = sext i32 %48 to i64
%arrayidx75 = getelementptr inbounds [300010 x i64], ptr %b, i64 0, i64 %47
%54 = load i64, ptr %arrayidx75, align 8, !tbaa !12
%add76 = add nsw i64 %54, %conv72
store i64 %add76, ptr %arrayidx75, align 8, !tbaa !12
%55 = add nsw i64 %47, -1
%arrayidx83 = getelementptr inbounds [300010 x i64], ptr %b, i64 0, i64 %55
%56 = load i64, ptr %arrayidx83, align 8, !tbaa !12
%add84 = add nsw i64 %56, %add76
store i64 %add84, ptr %arrayidx83, align 8, !tbaa !12
%indvars.iv.next472 = add nuw nsw i64 %indvars.iv471, 1
%exitcond483.not = icmp eq i64 %indvars.iv.next472, %wide.trip.count482
br i1 %exitcond483.not, label %for.cond61.for.cond88.preheader_crit_edge, label %for.cond.i266.preheader, !llvm.loop !17
for.cond88.for.cond124.preheader_crit_edge: ; preds = %hout.exit399
%57 = trunc i64 %indvars.iv.next489 to i32
store i32 %R.promoted435, ptr @C, align 4, !tbaa !5
store i32 %57, ptr @R, align 4, !tbaa !5
br label %for.cond124.preheader
for.cond124.preheader: ; preds = %for.cond88.for.cond124.preheader_crit_edge, %for.cond88.preheader
%cmp125.not441 = icmp slt i32 %.lcssa, 0
br i1 %cmp125.not441, label %for.end148, label %for.body127.preheader
for.body127.preheader: ; preds = %for.cond124.preheader
%58 = zext i32 %.lcssa to i64
%59 = add nuw i32 %.lcssa, 1
%wide.trip.count500 = zext i32 %59 to i64
%min.iters.check = icmp ult i32 %.lcssa, 3
br i1 %min.iters.check, label %for.body127.preheader521, label %vector.ph
vector.ph: ; preds = %for.body127.preheader
%n.vec = and i64 %wide.trip.count500, 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> [ <i64 -1000000000000000000, i64 -1000000000000000000>, %vector.ph ], [ %68, %vector.body ]
%vec.phi517 = phi <2 x i64> [ <i64 -1000000000000000000, i64 -1000000000000000000>, %vector.ph ], [ %69, %vector.body ]
%60 = add nuw nsw i64 %index, %58
%61 = add nsw i64 %60, -1
%62 = getelementptr inbounds [300010 x i64], ptr %a, i64 0, i64 %61
%wide.load = load <2 x i64>, ptr %62, align 8, !tbaa !12
%63 = getelementptr inbounds i64, ptr %62, i64 2
%wide.load518 = load <2 x i64>, ptr %63, align 8, !tbaa !12
%64 = getelementptr inbounds [300010 x i64], ptr %b, i64 0, i64 %60
%wide.load519 = load <2 x i64>, ptr %64, align 8, !tbaa !12
%65 = getelementptr inbounds i64, ptr %64, i64 2
%wide.load520 = load <2 x i64>, ptr %65, align 8, !tbaa !12
%66 = sub nsw <2 x i64> %wide.load, %wide.load519
%67 = sub nsw <2 x i64> %wide.load518, %wide.load520
%68 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %66)
%69 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi517, <2 x i64> %67)
%index.next = add nuw i64 %index, 4
%70 = icmp eq i64 %index.next, %n.vec
br i1 %70, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %68, <2 x i64> %69)
%71 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count500
br i1 %cmp.n, label %for.end148, label %for.body127.preheader521
for.body127.preheader521: ; preds = %for.body127.preheader, %middle.block
%indvars.iv495.ph = phi i64 [ 0, %for.body127.preheader ], [ %n.vec, %middle.block ]
%max.0443.ph = phi i64 [ -1000000000000000000, %for.body127.preheader ], [ %71, %middle.block ]
br label %for.body127
for.body92: ; preds = %for.body92.preheader, %hout.exit399
%indvars.iv488 = phi i64 [ %46, %for.body92.preheader ], [ %indvars.iv.next489, %hout.exit399 ]
%indvars.iv484 = phi i64 [ %44, %for.body92.preheader ], [ %indvars.iv.next485, %hout.exit399 ]
%72 = sub nsw i64 %45, %indvars.iv484
%arrayidx95 = getelementptr inbounds [300010 x i32], ptr %d, i64 0, i64 %72
%73 = load i32, ptr %arrayidx95, align 4, !tbaa !5
%sub96 = sub nsw i32 0, %73
%74 = trunc i64 %indvars.iv488 to i32
store i32 %74, ptr @H, align 16, !tbaa !5
%arrayidx.i310 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %indvars.iv488
store i32 %sub96, ptr %arrayidx.i310, align 4, !tbaa !5
br i1 %cmp1.i.i311, label %entry.split.us.i338, label %for.cond.i312
entry.split.us.i338: ; preds = %for.body92
br i1 %cmp.i.us20.i342, label %for.body.us.i343, label %hin.exit352
for.body.us.i343: ; preds = %entry.split.us.i338, %for.body.us.i343
%div.us22.i344 = phi i32 [ %div.us.i350, %for.body.us.i343 ], [ %div.us1924.neg.i341, %entry.split.us.i338 ]
%i.0.us21.i345 = phi i32 [ %div.us22.i344, %for.body.us.i343 ], [ %R.promoted435, %entry.split.us.i338 ]
%idxprom2.us.i346 = sext i32 %div.us22.i344 to i64
%arrayidx3.us.i347 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.us.i346
%75 = load i32, ptr %arrayidx3.us.i347, align 4, !tbaa !5
%idxprom4.us.i348 = sext i32 %i.0.us21.i345 to i64
%arrayidx5.us.i349 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.us.i348
store i32 %75, ptr %arrayidx5.us.i349, align 4, !tbaa !5
%div.us.i350 = sdiv i32 %div.us22.i344, 2
%cmp.i.us.i351 = icmp slt i32 %inc.i308, %div.us.i350
br i1 %cmp.i.us.i351, label %for.body.us.i343, label %hin.exit352, !llvm.loop !9
for.cond.i312: ; preds = %for.body92, %for.body.i331
%i.0.i313 = phi i32 [ %div.i314, %for.body.i331 ], [ %R.promoted435, %for.body92 ]
%div.i314 = sdiv i32 %i.0.i313, 2
%cmp.i.i315 = icmp slt i32 %inc.i308, %div.i314
br i1 %cmp.i.i315, label %for.cond.for.body_crit_edge.i334, label %if.end.i.i316
for.cond.for.body_crit_edge.i334: ; preds = %for.cond.i312
%idxprom2.phi.trans.insert.i335 = sext i32 %div.i314 to i64
%arrayidx3.phi.trans.insert.i336 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.phi.trans.insert.i335
%.pre.i337 = load i32, ptr %arrayidx3.phi.trans.insert.i336, align 4, !tbaa !5
br label %for.body.i331
if.end.i.i316: ; preds = %for.cond.i312
%i.0.off.i317 = add i32 %i.0.i313, 1
%cmp2.i.i318 = icmp ult i32 %i.0.off.i317, 3
br i1 %cmp2.i.i318, label %hin.exit352, label %hyouka.exit.i319
hyouka.exit.i319: ; preds = %if.end.i.i316
%76 = load i32, ptr @H, align 16, !tbaa !5
%idxprom5.i.i320 = sext i32 %76 to i64
%arrayidx6.i.i321 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i.i320
%77 = load i32, ptr %arrayidx6.i.i321, align 4, !tbaa !5
%idxprom7.i.i322 = sext i32 %div.i314 to i64
%arrayidx8.i.i323 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i.i322
%78 = load i32, ptr %arrayidx8.i.i323, align 4, !tbaa !5
%idxprom9.i.i324 = sext i32 %78 to i64
%arrayidx10.i.i325 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i.i324
%79 = load i32, ptr %arrayidx10.i.i325, align 4, !tbaa !5
%cmp11.i.not.i326 = icmp slt i32 %77, %79
br i1 %cmp11.i.not.i326, label %for.body.i331, label %hin.exit352
for.body.i331: ; preds = %hyouka.exit.i319, %for.cond.for.body_crit_edge.i334
%80 = phi i32 [ %.pre.i337, %for.cond.for.body_crit_edge.i334 ], [ %78, %hyouka.exit.i319 ]
%idxprom4.i332 = sext i32 %i.0.i313 to i64
%arrayidx5.i333 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.i332
store i32 %80, ptr %arrayidx5.i333, align 4, !tbaa !5
br label %for.cond.i312, !llvm.loop !9
hin.exit352: ; preds = %if.end.i.i316, %hyouka.exit.i319, %for.body.us.i343, %entry.split.us.i338
%.us-phi.i327 = phi i32 [ %R.promoted435, %entry.split.us.i338 ], [ %div.us22.i344, %for.body.us.i343 ], [ %i.0.i313, %hyouka.exit.i319 ], [ %i.0.i313, %if.end.i.i316 ]
%indvars.iv.next489 = add nsw i64 %indvars.iv488, 1
%idxprom8.i329 = sext i32 %.us-phi.i327 to i64
%arrayidx9.i330 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom8.i329
store i32 %74, ptr %arrayidx9.i330, align 4, !tbaa !5
%conv100 = sext i32 %73 to i64
%arrayidx103 = getelementptr inbounds [300010 x i64], ptr %b, i64 0, i64 %72
%81 = load i64, ptr %arrayidx103, align 8, !tbaa !12
%add104 = add nsw i64 %81, %conv100
%82 = load i32, ptr getelementptr inbounds ([2000010 x i32], ptr @H, i64 0, i64 1), align 4, !tbaa !5
%83 = load i32, ptr %arrayidx.i356, align 4, !tbaa !5
%idxprom106.phi.trans.insert = sext i32 %82 to i64
%arrayidx107.phi.trans.insert = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom106.phi.trans.insert
%.pre505 = load i32, ptr %arrayidx107.phi.trans.insert, align 4, !tbaa !5
br i1 %or.cond.i35.i357, label %hout.exit399, label %hyouka.exit.lr.ph.split.i358
hyouka.exit.lr.ph.split.i358: ; preds = %hin.exit352
%idxprom9.i42.i361 = sext i32 %83 to i64
%arrayidx10.i43.i362 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i42.i361
%84 = load i32, ptr %arrayidx10.i43.i362, align 4, !tbaa !5
%cmp11.i.not44.i363 = icmp slt i32 %.pre505, %84
br i1 %cmp11.i.not44.i363, label %for.body.i366, label %hout.exit399
hyouka.exit.i380: ; preds = %hyouka.exit31.i371
%85 = load i32, ptr %arrayidx6.i375, align 4, !tbaa !5
%idxprom5.i.i381 = sext i32 %85 to i64
%arrayidx6.i.i382 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i.i381
%86 = load i32, ptr %arrayidx6.i.i382, align 4, !tbaa !5
%87 = load i32, ptr %arrayidx.i356, align 4, !tbaa !5
%idxprom9.i.i383 = sext i32 %87 to i64
%arrayidx10.i.i384 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i.i383
%88 = load i32, ptr %arrayidx10.i.i384, align 4, !tbaa !5
%cmp11.i.not.i385 = icmp slt i32 %86, %88
br i1 %cmp11.i.not.i385, label %for.body.i366, label %for.end.loopexit.i379, !llvm.loop !11
for.body.i366: ; preds = %hyouka.exit.lr.ph.split.i358, %hyouka.exit.i380
%i.03745.i367 = phi i32 [ %sub.i373, %hyouka.exit.i380 ], [ 1, %hyouka.exit.lr.ph.split.i358 ]
%mul.i368 = shl nsw i32 %i.03745.i367, 1
%add.i369 = or i32 %mul.i368, 1
%cmp.i16.not.i370 = icmp sgt i32 %inc.i308, %add.i369
br i1 %cmp.i16.not.i370, label %if.end.i17.i386, label %hyouka.exit31.i371
if.end.i17.i386: ; preds = %for.body.i366
%cmp1.i18.not.i387 = icmp sgt i32 %inc.i308, %mul.i368
br i1 %cmp1.i18.not.i387, label %if.end4.i19.i388, label %hyouka.exit31.i371
if.end4.i19.i388: ; preds = %if.end.i17.i386
%idxprom.i20.i389 = sext i32 %mul.i368 to i64
%arrayidx.i21.i390 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom.i20.i389
%89 = load i32, ptr %arrayidx.i21.i390, align 8, !tbaa !5
%idxprom5.i22.i391 = sext i32 %89 to i64
%arrayidx6.i23.i392 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i22.i391
%90 = load i32, ptr %arrayidx6.i23.i392, align 4, !tbaa !5
%idxprom7.i24.i393 = sext i32 %add.i369 to i64
%arrayidx8.i25.i394 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i24.i393
%91 = load i32, ptr %arrayidx8.i25.i394, align 4, !tbaa !5
%idxprom9.i26.i395 = sext i32 %91 to i64
%arrayidx10.i27.i396 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i26.i395
%92 = load i32, ptr %arrayidx10.i27.i396, align 4, !tbaa !5
%cmp11.i28.i397 = icmp slt i32 %90, %92
%cond.i29.neg.i398 = sext i1 %cmp11.i28.i397 to i32
br label %hyouka.exit31.i371
hyouka.exit31.i371: ; preds = %if.end4.i19.i388, %if.end.i17.i386, %for.body.i366
%retval.0.i30.neg.i372 = phi i32 [ %cond.i29.neg.i398, %if.end4.i19.i388 ], [ -1, %for.body.i366 ], [ 0, %if.end.i17.i386 ]
%sub.i373 = add i32 %retval.0.i30.neg.i372, %add.i369
%idxprom5.i374 = sext i32 %sub.i373 to i64
%arrayidx6.i375 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom5.i374
%93 = load i32, ptr %arrayidx6.i375, align 4, !tbaa !5
%idxprom7.i376 = sext i32 %i.03745.i367 to i64
%arrayidx8.i377 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i376
store i32 %93, ptr %arrayidx8.i377, align 4, !tbaa !5
%cmp1.i.not.i378 = icmp sgt i32 %inc.i308, %sub.i373
br i1 %cmp1.i.not.i378, label %hyouka.exit.i380, label %for.end.loopexit.i379, !llvm.loop !11
for.end.loopexit.i379: ; preds = %hyouka.exit31.i371, %hyouka.exit.i380
%94 = sdiv i32 %sub.i373, 2
%95 = sext i32 %94 to i64
br label %hout.exit399
hout.exit399: ; preds = %hin.exit352, %hyouka.exit.lr.ph.split.i358, %for.end.loopexit.i379
%j.0.lcssa.i364 = phi i64 [ 1, %hyouka.exit.lr.ph.split.i358 ], [ %95, %for.end.loopexit.i379 ], [ 1, %hin.exit352 ]
%arrayidx10.i365 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %j.0.lcssa.i364
store i32 %83, ptr %arrayidx10.i365, align 4, !tbaa !5
%conv108 = sext i32 %.pre505 to i64
%add112 = add nsw i64 %add104, %conv108
store i64 %add112, ptr %arrayidx103, align 8, !tbaa !12
%96 = add nsw i64 %72, -1
%arrayidx119 = getelementptr inbounds [300010 x i64], ptr %b, i64 0, i64 %96
%97 = load i64, ptr %arrayidx119, align 8, !tbaa !12
%add120 = add nsw i64 %97, %add112
store i64 %add120, ptr %arrayidx119, align 8, !tbaa !12
%indvars.iv.next485 = add nsw i64 %indvars.iv484, 1
%exitcond494.not = icmp eq i64 %indvars.iv.next485, %wide.trip.count493
br i1 %exitcond494.not, label %for.cond88.for.cond124.preheader_crit_edge, label %for.body92, !llvm.loop !21
for.body127: ; preds = %for.body127.preheader521, %for.body127
%indvars.iv495 = phi i64 [ %indvars.iv.next496, %for.body127 ], [ %indvars.iv495.ph, %for.body127.preheader521 ]
%max.0443 = phi i64 [ %spec.select, %for.body127 ], [ %max.0443.ph, %for.body127.preheader521 ]
%98 = add nuw nsw i64 %indvars.iv495, %58
%99 = add nsw i64 %98, -1
%arrayidx131 = getelementptr inbounds [300010 x i64], ptr %a, i64 0, i64 %99
%100 = load i64, ptr %arrayidx131, align 8, !tbaa !12
%arrayidx134 = getelementptr inbounds [300010 x i64], ptr %b, i64 0, i64 %98
%101 = load i64, ptr %arrayidx134, align 8, !tbaa !12
%sub135 = sub nsw i64 %100, %101
%spec.select = call i64 @llvm.smax.i64(i64 %max.0443, i64 %sub135)
%indvars.iv.next496 = add nuw nsw i64 %indvars.iv495, 1
%exitcond501.not = icmp eq i64 %indvars.iv.next496, %wide.trip.count500
br i1 %exitcond501.not, label %for.end148, label %for.body127, !llvm.loop !22
for.end148: ; preds = %for.body127, %middle.block, %for.cond124.preheader
%max.0.lcssa = phi i64 [ -1000000000000000000, %for.cond124.preheader ], [ %71, %middle.block ], [ %spec.select, %for.body127 ]
%call149 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %max.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2400080, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 2400080, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 1200040, ptr nonnull %d) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: 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.smax.i64(i64, i64) #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #5
attributes #0 = { 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 #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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !20, !19}
|
#include<stdio.h>
#include<string.h>
int main(void){
int i, len;
char s[4096];
while(scanf("%s", s) != EOF){
if(s[0] == '0'){
break;
}
int ans = 0;
len = strlen(s);
for(i = 0; i < len; i++) {
ans += s[i]-'0';
}
printf("%d\n",ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127249/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127249/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [4096 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %s) #5
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%cmp18 = icmp eq i32 %call17, -1
%0 = load i8, ptr %s, align 16
%cmp119 = icmp eq i8 %0, 48
%or.cond20 = select i1 %cmp18, i1 true, i1 %cmp119
br i1 %or.cond20, label %while.end, label %if.end
if.end: ; preds = %entry, %for.end
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv5 = trunc i64 %call4 to i32
%cmp614 = icmp sgt i32 %conv5, 0
br i1 %cmp614, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %if.end
%wide.trip.count = and i64 %call4, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader24, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call4, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi22 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%1 = getelementptr inbounds [4096 x i8], ptr %s, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load23 = load <4 x i8>, ptr %2, align 4, !tbaa !5
%3 = sext <4 x i8> %wide.load to <4 x i32>
%4 = sext <4 x i8> %wide.load23 to <4 x i32>
%5 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48>
%6 = add <4 x i32> %vec.phi22, <i32 -48, i32 -48, i32 -48, i32 -48>
%7 = add <4 x i32> %5, %3
%8 = add <4 x i32> %6, %4
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %8, %7
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.end, label %for.body.preheader24
for.body.preheader24: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ans.016.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader24, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader24 ]
%ans.016 = phi i32 [ %add, %for.body ], [ %ans.016.ph, %for.body.preheader24 ]
%arrayidx8 = getelementptr inbounds [4096 x i8], ptr %s, i64 0, i64 %indvars.iv
%11 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%conv9 = sext i8 %11 to i32
%sub = add i32 %ans.016, -48
%add = add i32 %sub, %conv9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body, %middle.block, %if.end
%ans.0.lcssa = phi i32 [ 0, %if.end ], [ %10, %middle.block ], [ %add, %for.body ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%cmp = icmp eq i32 %call, -1
%12 = load i8, ptr %s, align 16
%cmp1 = icmp eq i8 %12, 48
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %while.end, label %if.end, !llvm.loop !13
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
!13 = distinct !{!13, !9}
|
#include <stdio.h>
int main(){
int num, i;
char number[1001] = {};
while(1){
scanf("%s", number);
if(number[0] == '0')break;
num = 0;
for(i = 0; number[i] != '\0'; i++){
num += number[i] - '0';
}
printf("%d\n", num);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127292/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127292/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%number = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %number) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %number, i8 0, i64 1001, i1 false)
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number)
%0 = load i8, ptr %number, align 16, !tbaa !5
%cmp17 = icmp eq i8 %0, 48
br i1 %cmp17, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i8 [ %4, %for.end ], [ %0, %entry ]
%cmp4.not13 = icmp eq i8 %1, 0
br i1 %cmp4.not13, label %for.end, label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%2 = phi i8 [ %3, %for.body ], [ %1, %for.cond.preheader ]
%num.014 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ]
%conv3 = sext i8 %2 to i32
%sub = add i32 %num.014, -48
%add = add i32 %sub, %conv3
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds [1001 x i8], ptr %number, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp4.not = icmp eq i8 %3, 0
br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.body, %for.cond.preheader
%num.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number)
%4 = load i8, ptr %number, align 16, !tbaa !5
%cmp = icmp eq i8 %4, 48
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %number) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int i,y;
char a[1002];
while(1){
y=0;
scanf("%s",&a);
if(a[0] == '0')break;
for(i=0;a[i]!='\0';i++){
if('0'<=a[i] && a[i]<='9'){
y+=a[i]-'0';
}
}
printf("%d\n",y);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127342/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127342/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [1002 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1002, ptr nonnull %a) #3
%call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 16, !tbaa !5
%cmp31 = icmp eq i8 %0, 48
br i1 %cmp31, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i8 [ %5, %for.end ], [ %0, %entry ]
%cmp4.not27 = icmp eq i8 %1, 0
br i1 %cmp4.not27, label %for.end, label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%2 = phi i8 [ %4, %for.body ], [ %1, %for.cond.preheader ]
%y.029 = phi i32 [ %y.1, %for.body ], [ 0, %for.cond.preheader ]
%conv3 = sext i8 %2 to i32
%3 = add i8 %2, -48
%or.cond = icmp ult i8 %3, 10
%sub = add nsw i32 %conv3, -48
%add = select i1 %or.cond, i32 %sub, i32 0
%y.1 = add nsw i32 %add, %y.029
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds [1002 x i8], ptr %a, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp4.not = icmp eq i8 %4, 0
br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.body, %for.cond.preheader
%y.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %y.1, %for.body ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%5 = load i8, ptr %a, align 16, !tbaa !5
%cmp = icmp eq i8 %5, 48
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 1002, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int c,i,j,sum;
int x[1000];
i = 0;
while((c = getchar()) != EOF) {
if(c == '\n') {
sum = 0;
for(j = 0;j < i;j++) {
sum += x[j];
x[j] = 0;
}
printf("%d\n",sum);
i = 0;
}else{
if(i == 0 && c == '0') break;
x[i] = c-'0';
i++;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127386/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127386/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #4
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%i.0 = phi i32 [ 0, %entry ], [ %i.0.be, %while.cond.backedge ]
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
switch i32 %call.i, label %if.else [
i32 -1, label %while.end
i32 10, label %for.cond.preheader
]
for.cond.preheader: ; preds = %while.cond
%cmp222 = icmp sgt i32 %i.0, 0
br i1 %cmp222, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %i.0 to i64
%min.iters.check = icmp ult i32 %i.0, 8
br i1 %min.iters.check, label %for.body.preheader28, 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 ], [ %3, %vector.body ]
%vec.phi26 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !9
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load27 = load <4 x i32>, ptr %2, align 16, !tbaa !9
%3 = add <4 x i32> %wide.load, %vec.phi
%4 = add <4 x i32> %wide.load27, %vec.phi26
store <4 x i32> zeroinitializer, ptr %1, align 16, !tbaa !9
store <4 x i32> zeroinitializer, ptr %2, align 16, !tbaa !9
%index.next = add nuw i64 %index, 8
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %4, %3
%6 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader28
for.body.preheader28: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%sum.024.ph = phi i32 [ 0, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader28, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader28 ]
%sum.024 = phi i32 [ %add, %for.body ], [ %sum.024.ph, %for.body.preheader28 ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx, align 4, !tbaa !9
%add = add nsw i32 %7, %sum.024
store i32 0, ptr %arrayidx, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !15
for.end: ; preds = %for.body, %middle.block, %for.cond.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %6, %middle.block ], [ %add, %for.body ]
%call5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa)
br label %while.cond.backedge
if.else: ; preds = %while.cond
%cmp6 = icmp eq i32 %i.0, 0
%cmp7 = icmp eq i32 %call.i, 48
%or.cond = and i1 %cmp6, %cmp7
br i1 %or.cond, label %while.end, label %if.end
if.end: ; preds = %if.else
%sub = add nsw i32 %call.i, -48
%idxprom9 = sext i32 %i.0 to i64
%arrayidx10 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %idxprom9
store i32 %sub, ptr %arrayidx10, align 4, !tbaa !9
%inc11 = add nsw i32 %i.0, 1
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end, %for.end
%i.0.be = phi i32 [ 0, %for.end ], [ %inc11, %if.end ]
br label %while.cond, !llvm.loop !16
while.end: ; preds = %while.cond, %if.else
call void @llvm.lifetime.end.p0(i64 4000, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 @getc(ptr nocapture noundef) 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
|
#include <stdio.h>
int main() {
char number[1001];
int sum, i;
while (1)
{
sum = 0;
scanf("%s", number);
if (number[0] == '0') break;
for (i = 0; number[i] != '\0'; i++)
sum += number[i] - '0';
printf("%d\n", sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127436/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127436/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%number = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %number) #3
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number)
%0 = load i8, ptr %number, align 16, !tbaa !5
%cmp17 = icmp eq i8 %0, 48
br i1 %cmp17, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i8 [ %4, %for.end ], [ %0, %entry ]
%cmp4.not13 = icmp eq i8 %1, 0
br i1 %cmp4.not13, label %for.end, label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%2 = phi i8 [ %3, %for.body ], [ %1, %for.cond.preheader ]
%sum.014 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ]
%conv3 = sext i8 %2 to i32
%sub = add i32 %sum.014, -48
%add = add i32 %sub, %conv3
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds [1001 x i8], ptr %number, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp4.not = icmp eq i8 %3, 0
br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.body, %for.cond.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number)
%4 = load i8, ptr %number, align 16, !tbaa !5
%cmp = icmp eq i8 %4, 48
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %number) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
char x[1001];
while(1){scanf("%s", x);
int s = 0,i = 0;
if(x[0] == '0')
break;
while(x[i]) s += (x[i++] - '0');
printf("%d\n", s);}
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127494/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127494/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %x) #3
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i8, ptr %x, align 16, !tbaa !5
%cmp20 = icmp eq i8 %0, 48
br i1 %cmp20, label %while.end10, label %while.cond2.preheader
while.cond2.preheader: ; preds = %entry, %cleanup
%1 = phi i8 [ %4, %cleanup ], [ %0, %entry ]
%tobool.not16 = icmp eq i8 %1, 0
br i1 %tobool.not16, label %cleanup, label %while.body4
while.body4: ; preds = %while.cond2.preheader, %while.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body4 ], [ 0, %while.cond2.preheader ]
%2 = phi i8 [ %3, %while.body4 ], [ %1, %while.cond2.preheader ]
%s.017 = phi i32 [ %add, %while.body4 ], [ 0, %while.cond2.preheader ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%conv7 = sext i8 %2 to i32
%sub = add i32 %s.017, -48
%add = add i32 %sub, %conv7
%arrayidx3 = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%tobool.not = icmp eq i8 %3, 0
br i1 %tobool.not, label %cleanup, label %while.body4, !llvm.loop !8
cleanup: ; preds = %while.body4, %while.cond2.preheader
%s.0.lcssa = phi i32 [ 0, %while.cond2.preheader ], [ %add, %while.body4 ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%4 = load i8, ptr %x, align 16, !tbaa !5
%cmp = icmp eq i8 %4, 48
br i1 %cmp, label %while.end10, label %while.cond2.preheader
while.end10: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main()
{
int sum;
char str[1100];
int i;
for(i=0;i<1100;i++){
str[i]=0;
}
while(1){
scanf("%s",str);
if(strcmp(str,"0")==0){
break;
}
sum=0;
for(i=0;str[i]!='\0';i++){
sum+=str[i]-'0';
}
printf("%d\n",sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127537/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127537/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.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:
%str = alloca [1100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1100, ptr nonnull %str) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1100) %str, i8 0, i64 1100, i1 false), !tbaa !5
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%lhsv29 = load i16, ptr %str, align 16
%.not30 = icmp eq i16 %lhsv29, 48
br i1 %.not30, label %while.end, label %for.cond4.preheader
for.cond4.preheader: ; preds = %entry, %for.end15
%.in = phi i16 [ %lhsv, %for.end15 ], [ %lhsv29, %entry ]
%0 = trunc i16 %.in to i8
%cmp7.not25 = icmp eq i8 %0, 0
br i1 %cmp7.not25, label %for.end15, label %for.body9
for.body9: ; preds = %for.cond4.preheader, %for.body9
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body9 ], [ 0, %for.cond4.preheader ]
%1 = phi i8 [ %2, %for.body9 ], [ %0, %for.cond4.preheader ]
%sum.026 = phi i32 [ %add, %for.body9 ], [ 0, %for.cond4.preheader ]
%conv = sext i8 %1 to i32
%sub = add i32 %sum.026, -48
%add = add i32 %sub, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx6 = getelementptr inbounds [1100 x i8], ptr %str, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp7.not = icmp eq i8 %2, 0
br i1 %cmp7.not, label %for.end15, label %for.body9, !llvm.loop !8
for.end15: ; preds = %for.body9, %for.cond4.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ %add, %for.body9 ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%lhsv = load i16, ptr %str, align 16
%.not = icmp eq i16 %lhsv, 48
br i1 %.not, label %while.end, label %for.cond4.preheader
while.end: ; preds = %for.end15, %entry
call void @llvm.lifetime.end.p0(i64 1100, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main (void)
{
char in[1001];
int out,i;
for(;;)
{
scanf("%s",in);
if(in[0]=='0')
{
return 0;
}
out=0;
for(i=0;in[i]!='\0';i++)
{
out+=in[i]-'0';
}
printf("%d\n",out);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127588/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127588/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%in = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %in) #3
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in)
%0 = load i8, ptr %in, align 16, !tbaa !5
%cmp18 = icmp eq i8 %0, 48
br i1 %cmp18, label %if.then, label %for.cond2.preheader
for.cond2.preheader: ; preds = %entry, %for.end
%1 = phi i8 [ %4, %for.end ], [ %0, %entry ]
%cmp5.not14 = icmp eq i8 %1, 0
br i1 %cmp5.not14, label %for.end, label %for.body
if.then: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %in) #3
ret i32 0
for.body: ; preds = %for.cond2.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond2.preheader ]
%2 = phi i8 [ %3, %for.body ], [ %1, %for.cond2.preheader ]
%out.015 = phi i32 [ %add, %for.body ], [ 0, %for.cond2.preheader ]
%conv4 = sext i8 %2 to i32
%sub = add i32 %out.015, -48
%add = add i32 %sub, %conv4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx3 = getelementptr inbounds [1001 x i8], ptr %in, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%cmp5.not = icmp eq i8 %3, 0
br i1 %cmp5.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.body, %for.cond2.preheader
%out.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %add, %for.body ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %out.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in)
%4 = load i8, ptr %in, align 16, !tbaa !5
%cmp = icmp eq i8 %4, 48
br i1 %cmp, label %if.then, label %for.cond2.preheader
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
char x[1000] = {0};
int sum = 0;
int i;
while(1){
scanf("%s", x);
if(x[0] == '0')
break;
for(i = 0; i < 1000; i++){
if(x[i] == '\0')
break;
switch(x[i]){
case '0' : sum += 0; break;
case '1' : sum += 1; break;
case '2' : sum += 2; break;
case '3' : sum += 3; break;
case '4' : sum += 4; break;
case '5' : sum += 5; break;
case '6' : sum += 6; break;
case '7' : sum += 7; break;
case '8' : sum += 8; break;
case '9' : sum += 9; break;
}
}
printf("%d\n", sum);
sum = 0;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127652/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127652/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [1000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %x) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1000) %x, i8 0, i64 1000, i1 false)
%call47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i8, ptr %x, align 16, !tbaa !5
%cmp48 = icmp eq i8 %0, 48
br i1 %cmp48, label %while.end, label %for.body
for.body: ; preds = %entry, %for.body.backedge
%indvars.iv = phi i64 [ %indvars.iv.be, %for.body.backedge ], [ 0, %entry ]
%sum.145 = phi i32 [ %sum.145.be, %for.body.backedge ], [ 0, %entry ]
%arrayidx4 = getelementptr inbounds [1000 x i8], ptr %x, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%cmp6 = icmp eq i8 %1, 0
br i1 %cmp6, label %for.end, label %if.end9
if.end9: ; preds = %for.body
%conv5 = sext i8 %1 to i32
switch i32 %conv5, label %for.inc [
i32 57, label %sw.bb29
i32 49, label %sw.bb13
i32 50, label %sw.bb15
i32 51, label %sw.bb17
i32 52, label %sw.bb19
i32 53, label %sw.bb21
i32 54, label %sw.bb23
i32 55, label %sw.bb25
i32 56, label %sw.bb27
]
sw.bb13: ; preds = %if.end9
%add14 = add nsw i32 %sum.145, 1
br label %for.inc
sw.bb15: ; preds = %if.end9
%add16 = add nsw i32 %sum.145, 2
br label %for.inc
sw.bb17: ; preds = %if.end9
%add18 = add nsw i32 %sum.145, 3
br label %for.inc
sw.bb19: ; preds = %if.end9
%add20 = add nsw i32 %sum.145, 4
br label %for.inc
sw.bb21: ; preds = %if.end9
%add22 = add nsw i32 %sum.145, 5
br label %for.inc
sw.bb23: ; preds = %if.end9
%add24 = add nsw i32 %sum.145, 6
br label %for.inc
sw.bb25: ; preds = %if.end9
%add26 = add nsw i32 %sum.145, 7
br label %for.inc
sw.bb27: ; preds = %if.end9
%add28 = add nsw i32 %sum.145, 8
br label %for.inc
sw.bb29: ; preds = %if.end9
%add30 = add nsw i32 %sum.145, 9
br label %for.inc
for.inc: ; preds = %sw.bb13, %sw.bb15, %sw.bb17, %sw.bb19, %sw.bb21, %sw.bb23, %sw.bb25, %sw.bb27, %sw.bb29, %if.end9
%sum.2 = phi i32 [ %add30, %sw.bb29 ], [ %add28, %sw.bb27 ], [ %add26, %sw.bb25 ], [ %add24, %sw.bb23 ], [ %add22, %sw.bb21 ], [ %add20, %sw.bb19 ], [ %add18, %sw.bb17 ], [ %add16, %sw.bb15 ], [ %add14, %sw.bb13 ], [ %sum.145, %if.end9 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 1000
br i1 %exitcond.not, label %for.end, label %for.body.backedge
for.body.backedge: ; preds = %for.inc, %for.end
%indvars.iv.be = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.end ]
%sum.145.be = phi i32 [ %sum.2, %for.inc ], [ 0, %for.end ]
br label %for.body, !llvm.loop !8
for.end: ; preds = %for.body, %for.inc
%sum.1.lcssa = phi i32 [ %sum.145, %for.body ], [ %sum.2, %for.inc ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.1.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%2 = load i8, ptr %x, align 16, !tbaa !5
%cmp = icmp eq i8 %2, 48
br i1 %cmp, label %while.end, label %for.body.backedge
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 1000, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main()
{
char str[1001],c=0,idx=0;
scanf("%s",str);
int i=0;
while(str[i]){
if((str[i]=='h')&&(c==0))c++;
else if((str[i]=='e')&&(c==1))c++;
else if((str[i]=='i')&&(c==2))c++;
else if((str[i]=='d')&&(c==3))c++;
else if((str[i]=='i')&&(c==4))c++;
i++;
}
if(c==5)printf("YES\n");
else printf("NO\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12771/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12771/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%str = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%0 = load i8, ptr %str, align 16, !tbaa !5
%tobool.not88 = icmp eq i8 %0, 0
br i1 %tobool.not88, label %if.else64, label %while.body
while.body: ; preds = %entry, %if.end57
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end57 ], [ 0, %entry ]
%1 = phi i8 [ %2, %if.end57 ], [ %0, %entry ]
%c.089 = phi i8 [ %c.1, %if.end57 ], [ 0, %entry ]
%cmp = icmp eq i8 %1, 104
%cmp5 = icmp eq i8 %c.089, 0
%or.cond = select i1 %cmp, i1 %cmp5, i1 false
br i1 %or.cond, label %if.end57, label %if.else
if.else: ; preds = %while.body
%cmp10 = icmp eq i8 %1, 101
%cmp14 = icmp eq i8 %c.089, 1
%or.cond67 = select i1 %cmp10, i1 %cmp14, i1 false
br i1 %or.cond67, label %if.end57, label %if.else18
if.else18: ; preds = %if.else
%cmp22 = icmp eq i8 %1, 105
%cmp26 = icmp eq i8 %c.089, 2
%or.cond68 = select i1 %cmp22, i1 %cmp26, i1 false
br i1 %or.cond68, label %if.end57, label %if.else30
if.else30: ; preds = %if.else18
%cmp34 = icmp eq i8 %1, 100
%cmp38 = icmp eq i8 %c.089, 3
%or.cond69 = select i1 %cmp34, i1 %cmp38, i1 false
br i1 %or.cond69, label %if.end57, label %if.else42
if.else42: ; preds = %if.else30
%cmp50 = icmp eq i8 %c.089, 4
%or.cond70 = select i1 %cmp22, i1 %cmp50, i1 false
%inc53 = zext i1 %or.cond70 to i8
%spec.select = add i8 %c.089, %inc53
br label %if.end57
if.end57: ; preds = %if.else30, %if.else18, %if.else, %while.body, %if.else42
%c.1 = phi i8 [ %spec.select, %if.else42 ], [ 1, %while.body ], [ 2, %if.else ], [ 3, %if.else18 ], [ 4, %if.else30 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%tobool.not = icmp eq i8 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %if.end57
%3 = icmp eq i8 %c.1, 5
br i1 %3, label %if.end66, label %if.else64
if.else64: ; preds = %entry, %while.end
br label %if.end66
if.end66: ; preds = %while.end, %if.else64
%str.sink = phi ptr [ @str, %if.else64 ], [ @str.3, %while.end ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int i=0,t=0;
char s[1001]={};
for(;scanf("%s",s),s[0]!='0';printf("%d\n",t))
for(i=0,t=0;s[i]!='\0';i++){
t+=s[i]-'0';
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127753/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127753/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %s, i8 0, i64 1001, i1 false)
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not21 = icmp eq i8 %0, 48
br i1 %cmp.not21, label %for.end13, label %for.cond2.preheader
for.cond2.preheader: ; preds = %entry, %for.inc11
%1 = phi i8 [ %4, %for.inc11 ], [ %0, %entry ]
%cmp5.not17 = icmp eq i8 %1, 0
br i1 %cmp5.not17, label %for.inc11, label %for.body7
for.body7: ; preds = %for.cond2.preheader, %for.body7
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ 0, %for.cond2.preheader ]
%2 = phi i8 [ %3, %for.body7 ], [ %1, %for.cond2.preheader ]
%t.019 = phi i32 [ %add, %for.body7 ], [ 0, %for.cond2.preheader ]
%conv4 = sext i8 %2 to i32
%sub = add i32 %t.019, -48
%add = add i32 %sub, %conv4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx3 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%cmp5.not = icmp eq i8 %3, 0
br i1 %cmp5.not, label %for.inc11, label %for.body7, !llvm.loop !8
for.inc11: ; preds = %for.body7, %for.cond2.preheader
%t.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %add, %for.body7 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %t.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%4 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not = icmp eq i8 %4, 48
br i1 %cmp.not, label %for.end13, label %for.cond2.preheader, !llvm.loop !10
for.end13: ; preds = %for.inc11, %entry
call void @llvm.lifetime.end.p0(i64 1001, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdio.h>
#define STOI(a) ((a-'1')+1)
#define SUM(a,b) (a+b)
int main(void){
char x[1001];
int res[1000]={0},su=0,n=0,i=0,j;
while(1){
n=0, su=0;
scanf("%s",x);
if(x[0]=='0' && x[1]==NULL) break;
while(1){
if (x[n] == NULL) break;
su=SUM(su,STOI(x[n]));
n++;
}
res[i]=su, i++;
}
for(j=0;j<i;j++) printf("%d\n",res[j]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127803/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127803/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [1001 x i8], align 16
%res = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %res) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %res, i8 0, i64 4000, i1 false)
%call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i8, ptr %x, align 16, !tbaa !5
%cmp40 = icmp eq i8 %0, 48
%arrayidx2 = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1
%cmp441 = icmp eq i8 %1, 0
%or.cond42 = select i1 %cmp40, i1 %cmp441, i1 false
br i1 %or.cond42, label %for.end, label %while.cond6.preheader
while.cond6.preheader: ; preds = %entry, %while.end
%2 = phi i8 [ %6, %while.end ], [ %0, %entry ]
%indvars.iv47 = phi i64 [ %indvars.iv.next48, %while.end ], [ 0, %entry ]
%cmp1036 = icmp eq i8 %2, 0
br i1 %cmp1036, label %while.end, label %if.end13
for.cond.preheader: ; preds = %while.end
%3 = and i64 %indvars.iv.next48, 4294967295
%cmp2245.not = icmp eq i64 %3, 0
br i1 %cmp2245.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = and i64 %indvars.iv.next48, 4294967295
br label %for.body
if.end13: ; preds = %while.cond6.preheader, %if.end13
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end13 ], [ 0, %while.cond6.preheader ]
%4 = phi i8 [ %5, %if.end13 ], [ %2, %while.cond6.preheader ]
%su.037 = phi i32 [ %add17, %if.end13 ], [ 0, %while.cond6.preheader ]
%conv16 = sext i8 %4 to i32
%add = add i32 %su.037, -48
%add17 = add i32 %add, %conv16
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx8 = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 %indvars.iv.next
%5 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%cmp10 = icmp eq i8 %5, 0
br i1 %cmp10, label %while.end, label %if.end13
while.end: ; preds = %if.end13, %while.cond6.preheader
%su.0.lcssa = phi i32 [ 0, %while.cond6.preheader ], [ %add17, %if.end13 ]
%arrayidx19 = getelementptr inbounds [1000 x i32], ptr %res, i64 0, i64 %indvars.iv47
store i32 %su.0.lcssa, ptr %arrayidx19, align 4, !tbaa !8
%indvars.iv.next48 = add nuw i64 %indvars.iv47, 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%6 = load i8, ptr %x, align 16, !tbaa !5
%cmp = icmp eq i8 %6, 48
%7 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp eq i8 %7, 0
%or.cond = select i1 %cmp, i1 %cmp4, i1 false
br i1 %or.cond, label %for.cond.preheader, label %while.cond6.preheader
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv50 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next51, %for.body ]
%arrayidx25 = getelementptr inbounds [1000 x i32], ptr %res, i64 0, i64 %indvars.iv50
%8 = load i32, ptr %arrayidx25, align 4, !tbaa !8
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
%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.end, label %for.body, !llvm.loop !10
for.end: ; preds = %for.body, %entry, %for.cond.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %res) #4
call void @llvm.lifetime.end.p0(i64 1001, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int
main(void)
{
char ch;
while ((ch = getchar()) != '0' && ch != EOF) {
int n = 0;
while (ch >= '0' && ch <= '9') {
n += ch - '0';
ch = getchar();
}
printf("%d\n", n);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127854/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127854/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.end, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
%sext = shl i32 %call.i, 24
switch i32 %sext, label %while.cond6.preheader [
i32 -16777216, label %while.end20
i32 805306368, label %while.end20
]
while.cond6.preheader: ; preds = %while.cond
%1 = add i32 %sext, -788529153
%2 = icmp ult i32 %1, 184549375
br i1 %2, label %while.body15, label %while.end
while.body15: ; preds = %while.cond6.preheader, %while.body15
%n.029 = phi i32 [ %add, %while.body15 ], [ 0, %while.cond6.preheader ]
%ch.0.in28 = phi i32 [ %call.i26, %while.body15 ], [ %call.i, %while.cond6.preheader ]
%conv7 = and i32 %ch.0.in28, 255
%sub = add nsw i32 %conv7, -48
%add = add nsw i32 %sub, %n.029
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i26 = tail call i32 @getc(ptr noundef %3)
%sext25 = shl i32 %call.i26, 24
%4 = add i32 %sext25, -788529153
%5 = icmp ult i32 %4, 184549375
br i1 %5, label %while.body15, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body15, %while.cond6.preheader
%n.0.lcssa = phi i32 [ 0, %while.cond6.preheader ], [ %add, %while.body15 ]
%call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %n.0.lcssa)
br label %while.cond, !llvm.loop !11
while.end20: ; preds = %while.cond, %while.cond
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<string.h>
int main(){
int s,i,n;
while(1){
char b[1005]={};
s=0;
scanf("%s",b);
if(b[0]=='0')
break;
n=strlen(b);
for(i=0;i<n;i++)
s+=b[i]-'0';
printf("%d\n",s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127904/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127904/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca [1005 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1005, ptr nonnull %b) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1005) %b, i8 0, i64 1005, i1 false)
%call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %b, align 16, !tbaa !5
%cmp22 = icmp eq i8 %0, 48
br i1 %cmp22, label %while.end, label %if.end
if.end: ; preds = %entry, %cleanup
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #7
%conv4 = trunc i64 %call3 to i32
%cmp518 = icmp sgt i32 %conv4, 0
br i1 %cmp518, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %if.end
%wide.trip.count = and i64 %call3, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader26, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call3, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi24 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%1 = getelementptr inbounds [1005 x i8], ptr %b, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load25 = load <4 x i8>, ptr %2, align 4, !tbaa !5
%3 = sext <4 x i8> %wide.load to <4 x i32>
%4 = sext <4 x i8> %wide.load25 to <4 x i32>
%5 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48>
%6 = add <4 x i32> %vec.phi24, <i32 -48, i32 -48, i32 -48, i32 -48>
%7 = add <4 x i32> %5, %3
%8 = add <4 x i32> %6, %4
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %8, %7
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %cleanup, label %for.body.preheader26
for.body.preheader26: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%s.019.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader26, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader26 ]
%s.019 = phi i32 [ %add, %for.body ], [ %s.019.ph, %for.body.preheader26 ]
%arrayidx7 = getelementptr inbounds [1005 x i8], ptr %b, i64 0, i64 %indvars.iv
%11 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%conv8 = sext i8 %11 to i32
%sub = add i32 %s.019, -48
%add = add i32 %sub, %conv8
%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 !12
cleanup: ; preds = %for.body, %middle.block, %if.end
%s.0.lcssa = phi i32 [ 0, %if.end ], [ %10, %middle.block ], [ %add, %for.body ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1005, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 1005, ptr nonnull %b) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1005) %b, i8 0, i64 1005, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%12 = load i8, ptr %b, align 16, !tbaa !5
%cmp = icmp eq i8 %12, 48
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 1005, ptr nonnull %b) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
|
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int main()
{
char buf[1250];
char *p;
int s;
while (1)
{
fgets(buf, 1250, stdin);
p = buf;
while (isspace(*p))
p++;
s = 0;
while (isdigit(*p))
s += *p++ - '0';
if (s == 0)
break;
printf("%d\n", s);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127948/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127948/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%buf = alloca [1250 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1250, ptr nonnull %buf) #4
br label %while.cond
while.cond: ; preds = %if.end, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 1250, ptr noundef %0)
%call3 = tail call ptr @__ctype_b_loc() #5
%1 = load ptr, ptr %call3, align 8, !tbaa !5
br label %while.cond2
while.cond2: ; preds = %while.cond2, %while.cond
%p.0 = phi ptr [ %buf, %while.cond ], [ %incdec.ptr, %while.cond2 ]
%2 = load i8, ptr %p.0, align 1, !tbaa !9
%idxprom = sext i8 %2 to i64
%arrayidx = getelementptr inbounds i16, ptr %1, i64 %idxprom
%3 = load i16, ptr %arrayidx, align 2, !tbaa !10
%4 = and i16 %3, 8192
%tobool.not = icmp eq i16 %4, 0
%incdec.ptr = getelementptr inbounds i8, ptr %p.0, i64 1
br i1 %tobool.not, label %while.cond6.preheader, label %while.cond2, !llvm.loop !12
while.cond6.preheader: ; preds = %while.cond2
%5 = and i16 %3, 2048
%tobool13.not28 = icmp eq i16 %5, 0
br i1 %tobool13.not28, label %while.end20, label %while.body14
while.body14: ; preds = %while.cond6.preheader, %while.body14
%6 = phi i8 [ %7, %while.body14 ], [ %2, %while.cond6.preheader ]
%s.030 = phi i32 [ %add, %while.body14 ], [ 0, %while.cond6.preheader ]
%p.129 = phi ptr [ %incdec.ptr15, %while.body14 ], [ %p.0, %while.cond6.preheader ]
%conv8 = sext i8 %6 to i32
%incdec.ptr15 = getelementptr inbounds i8, ptr %p.129, i64 1
%sub = add i32 %s.030, -48
%add = add i32 %sub, %conv8
%7 = load i8, ptr %incdec.ptr15, align 1, !tbaa !9
%idxprom9 = sext i8 %7 to i64
%arrayidx10 = getelementptr inbounds i16, ptr %1, i64 %idxprom9
%8 = load i16, ptr %arrayidx10, align 2, !tbaa !10
%9 = and i16 %8, 2048
%tobool13.not = icmp eq i16 %9, 0
br i1 %tobool13.not, label %while.end17, label %while.body14, !llvm.loop !14
while.end17: ; preds = %while.body14
%cmp = icmp eq i32 %add, 0
br i1 %cmp, label %while.end20, label %if.end
if.end: ; preds = %while.end17
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
br label %while.cond
while.end20: ; preds = %while.cond6.preheader, %while.end17
call void @llvm.lifetime.end.p0(i64 1250, ptr nonnull %buf) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() 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 nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !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}
|
#include <stdio.h>
#include<string.h>
char digit[1000];
int main() {
while(1){
scanf("%s",digit);
if(digit[0] == '0' )
break;
int len = strlen(digit);
int sum = 0;
int ro = len * 48;
for(int i=0;i<len;i++){
sum += digit[i];
}
printf ("%d\n",(sum-ro));
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127991/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127991/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@digit = dso_local global [1000 x i8] 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:
%call15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @digit)
%0 = load i8, ptr @digit, align 16, !tbaa !5
%cmp16 = icmp eq i8 %0, 48
br i1 %cmp16, label %while.end, label %if.end
if.end: ; preds = %entry, %for.cond.cleanup
%call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @digit) #4
%conv3 = trunc i64 %call2 to i32
%mul.neg = mul i32 %conv3, -48
%cmp412 = icmp sgt i32 %conv3, 0
br i1 %cmp412, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %if.end
%wide.trip.count = and i64 %call2, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader20, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call2, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi18 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%1 = getelementptr inbounds [1000 x i8], ptr @digit, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load19 = load <4 x i8>, ptr %2, align 4, !tbaa !5
%3 = sext <4 x i8> %wide.load to <4 x i32>
%4 = sext <4 x i8> %wide.load19 to <4 x i32>
%5 = add <4 x i32> %vec.phi, %3
%6 = add <4 x i32> %vec.phi18, %4
%index.next = add nuw i64 %index, 8
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %6, %5
%8 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader20
for.body.preheader20: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%sum.013.ph = phi i32 [ 0, %for.body.preheader ], [ %8, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %if.end
%sum.0.lcssa = phi i32 [ 0, %if.end ], [ %8, %middle.block ], [ %add, %for.body ]
%sub = add i32 %sum.0.lcssa, %mul.neg
%call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @digit)
%9 = load i8, ptr @digit, align 16, !tbaa !5
%cmp = icmp eq i8 %9, 48
br i1 %cmp, label %while.end, label %if.end
for.body: ; preds = %for.body.preheader20, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader20 ]
%sum.013 = phi i32 [ %add, %for.body ], [ %sum.013.ph, %for.body.preheader20 ]
%arrayidx = getelementptr inbounds [1000 x i8], ptr @digit, i64 0, i64 %indvars.iv
%10 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv6 = sext i8 %10 to i32
%add = add nsw i32 %sum.013, %conv6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12
while.end: ; preds = %for.cond.cleanup, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
|
#include<stdio.h>
#include<string.h>
int main(void)
{
char x[10000];
int k,n,a,i;
while(1)
{
scanf("%s", x);
if(x[0]=='0')
break;
k=0;
n=strlen(x);
for(i=0; i<n; i++)
{
a=x[i]-'0';
k+=a;
}
printf("%d\n", k);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128033/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128033/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [10000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %x) #5
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i8, ptr %x, align 16, !tbaa !5
%cmp17 = icmp eq i8 %0, 48
br i1 %cmp17, label %while.end, label %if.end
if.end: ; preds = %entry, %for.end
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %x) #6
%conv4 = trunc i64 %call3 to i32
%cmp513 = icmp sgt i32 %conv4, 0
br i1 %cmp513, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %if.end
%wide.trip.count = and i64 %call3, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader21, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call3, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi19 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%1 = getelementptr inbounds [10000 x i8], ptr %x, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load20 = load <4 x i8>, ptr %2, align 4, !tbaa !5
%3 = sext <4 x i8> %wide.load to <4 x i32>
%4 = sext <4 x i8> %wide.load20 to <4 x i32>
%5 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48>
%6 = add <4 x i32> %vec.phi19, <i32 -48, i32 -48, i32 -48, i32 -48>
%7 = add <4 x i32> %5, %3
%8 = add <4 x i32> %6, %4
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %8, %7
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.end, label %for.body.preheader21
for.body.preheader21: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%k.014.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader21, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader21 ]
%k.014 = phi i32 [ %add, %for.body ], [ %k.014.ph, %for.body.preheader21 ]
%arrayidx7 = getelementptr inbounds [10000 x i8], ptr %x, i64 0, i64 %indvars.iv
%11 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%conv8 = sext i8 %11 to i32
%sub = add i32 %k.014, -48
%add = add i32 %sub, %conv8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body, %middle.block, %if.end
%k.0.lcssa = phi i32 [ 0, %if.end ], [ %10, %middle.block ], [ %add, %for.body ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%12 = load i8, ptr %x, align 16, !tbaa !5
%cmp = icmp eq i8 %12, 48
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 10000, 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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
|
#include <stdio.h>
int main(int argc, const char * argv[]) {
char ch[1001];
int i;
int sum;
int num;
while (1) {
scanf("%s", ch);
if (ch[0] == '0') {
break;
}
//一文字ずつ見る
sum = 0;
for (i=0; i<1001; i++) {
if (ch[i] == '\0') break; //文末なら終わる
num = ch[i] - 48; //アスキーコードをint型に変換
sum += num;
}
printf("%d\n", sum);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128077/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128077/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%ch = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %ch) #3
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%0 = load i8, ptr %ch, align 16, !tbaa !5
%cmp21 = icmp eq i8 %0, 48
br i1 %cmp21, label %while.end, label %for.body
for.body: ; preds = %entry, %for.body.backedge
%indvars.iv = phi i64 [ %indvars.iv.be, %for.body.backedge ], [ 0, %entry ]
%sum.018 = phi i32 [ %sum.018.be, %for.body.backedge ], [ 0, %entry ]
%arrayidx4 = getelementptr inbounds [1001 x i8], ptr %ch, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%cmp6 = icmp eq i8 %1, 0
br i1 %cmp6, label %for.end, label %if.end9
if.end9: ; preds = %for.body
%conv5 = sext i8 %1 to i32
%sub = add i32 %sum.018, -48
%add = add i32 %sub, %conv5
%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.end, label %for.body.backedge
for.body.backedge: ; preds = %if.end9, %for.end
%indvars.iv.be = phi i64 [ %indvars.iv.next, %if.end9 ], [ 0, %for.end ]
%sum.018.be = phi i32 [ %add, %if.end9 ], [ 0, %for.end ]
br label %for.body, !llvm.loop !8
for.end: ; preds = %for.body, %if.end9
%sum.0.lcssa = phi i32 [ %sum.018, %for.body ], [ %add, %if.end9 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%2 = load i8, ptr %ch, align 16, !tbaa !5
%cmp = icmp eq i8 %2, 48
br i1 %cmp, label %while.end, label %for.body.backedge
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %ch) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
int a[5],i,j,i1,i2,i3,i4,i5,b[5][5],max=0,temp;
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
scanf("%d ",&b[i][j]);
}
for(i1=0;i1<5;i1++)
{
for(i2=0;i2<5;i2++)
{
for(i3=0;i3<5;i3++)
{
for(i4=0;i4<5;i4++)
{
for(i5=0;i5<5;i5++)
{
// printf("ff");
// a[0]=a[1]=a[2]=a[3]=a[4]=0;
temp=0;
a[0]=i1;
if(i2!=i1)
a[1]=i2;
else continue;
if(i3!=i1&&i3!=i2)
a[2]=i3;
else continue;
if(i4!=i1&&i4!=i2&&i4!=i3)
a[3]=i4;
else continue;
if(i5!=i1&&i5!=i2&&i5!=i3&&i5!=i4)
a[4]=i5;
else continue;
temp=b[a[0]][a[1]]+b[a[1]][a[0]]+b[a[2]][a[3]]+b[a[3]][a[2]]+b[a[1]][a[2]]+b[a[2]][a[1]]+b[a[3]][a[4]]+b[a[4]][a[3]]+b[a[2]][a[3]]+b[a[3]][a[2]]+b[a[3]][a[4]]+b[a[4]][a[3]];
if(temp>max)
max=temp;
}
}
}
}
}
printf("%d",max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12812/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12812/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca [5 x [5 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%arrayidx5.1 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.1237 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 1, i64 0
%call.1238 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1237)
%arrayidx5.1.1 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 1, i64 1
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.1)
%arrayidx5.2.1 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 1, i64 2
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.1)
%arrayidx5.3.1 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 1, i64 3
%call.3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3.1)
%arrayidx5.4.1 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 1, i64 4
%call.4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4.1)
%arrayidx5.2239 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 2, i64 0
%call.2240 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2239)
%arrayidx5.1.2 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 2, i64 1
%call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.2)
%arrayidx5.2.2 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 2, i64 2
%call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.2)
%arrayidx5.3.2 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 2, i64 3
%call.3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3.2)
%arrayidx5.4.2 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 2, i64 4
%call.4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4.2)
%arrayidx5.3241 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 3, i64 0
%call.3242 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3241)
%arrayidx5.1.3 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 3, i64 1
%call.1.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.3)
%arrayidx5.2.3 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 3, i64 2
%call.2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.3)
%arrayidx5.3.3 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 3, i64 3
%call.3.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3.3)
%arrayidx5.4.3 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 3, i64 4
%call.4.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4.3)
%arrayidx5.4243 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 4, i64 0
%call.4244 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4243)
%arrayidx5.1.4 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 4, i64 1
%call.1.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.4)
%arrayidx5.2.4 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 4, i64 2
%call.2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.4)
%arrayidx5.3.4 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 4, i64 3
%call.3.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3.4)
%arrayidx5.4.4 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 4, i64 4
%call.4.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4.4)
br label %for.cond12.preheader
for.cond12.preheader: ; preds = %entry, %for.inc150
%indvars.iv255 = phi i64 [ 0, %entry ], [ %indvars.iv.next256, %for.inc150 ]
%max.0233 = phi i32 [ 0, %entry ], [ %.us-phi, %for.inc150 ]
%cmp42.not = icmp eq i64 %indvars.iv255, 0
%cmp42.not.1 = icmp eq i64 %indvars.iv255, 1
%cmp42.not.2 = icmp eq i64 %indvars.iv255, 2
%cmp42.not.3 = icmp eq i64 %indvars.iv255, 3
%cmp42.not.4 = icmp eq i64 %indvars.iv255, 4
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond12.preheader, %for.inc147
%indvars.iv251 = phi i64 [ 0, %for.cond12.preheader ], [ %indvars.iv.next252, %for.inc147 ]
%max.1231 = phi i32 [ %max.0233, %for.cond12.preheader ], [ %.us-phi, %for.inc147 ]
%cmp25.not = icmp eq i64 %indvars.iv251, %indvars.iv255
%arrayidx58 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv255, i64 %indvars.iv251
%arrayidx64 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv251, i64 %indvars.iv255
%cmp44.not = icmp eq i64 %indvars.iv251, 0
%or.cond214 = or i1 %cmp44.not, %cmp42.not
%cmp44.not.1 = icmp eq i64 %indvars.iv251, 1
%or.cond214.1 = or i1 %cmp44.not.1, %cmp42.not.1
%cmp44.not.2 = icmp eq i64 %indvars.iv251, 2
%or.cond214.2 = or i1 %cmp44.not.2, %cmp42.not.2
%cmp44.not.3 = icmp eq i64 %indvars.iv251, 3
%or.cond214.3 = or i1 %cmp44.not.3, %cmp42.not.3
%cmp44.not.4 = icmp eq i64 %indvars.iv251, 4
%or.cond214.4 = or i1 %cmp44.not.4, %cmp42.not.4
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.cond15.preheader, %for.inc144
%indvars.iv247 = phi i64 [ 0, %for.cond15.preheader ], [ %indvars.iv.next248, %for.inc144 ]
%max.2229 = phi i32 [ %max.1231, %for.cond15.preheader ], [ %.us-phi, %for.inc144 ]
%cmp27.not = icmp eq i64 %indvars.iv247, %indvars.iv255
%or.cond = or i1 %cmp25.not, %cmp27.not
%cmp28.not = icmp eq i64 %indvars.iv247, %indvars.iv251
%or.cond209 = or i1 %cmp28.not, %or.cond
%arrayidx84 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv251, i64 %indvars.iv247
%arrayidx91 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv247, i64 %indvars.iv251
%cmp46.not = icmp eq i64 %indvars.iv247, 0
%or.cond215 = or i1 %cmp46.not, %or.cond214
%cmp46.not.1 = icmp eq i64 %indvars.iv247, 1
%or.cond215.1 = or i1 %cmp46.not.1, %or.cond214.1
%cmp46.not.2 = icmp eq i64 %indvars.iv247, 2
%or.cond215.2 = or i1 %cmp46.not.2, %or.cond214.2
%cmp46.not.3 = icmp eq i64 %indvars.iv247, 3
%or.cond215.3 = or i1 %cmp46.not.3, %or.cond214.3
%cmp46.not.4 = icmp eq i64 %indvars.iv247, 4
%or.cond215.4 = or i1 %cmp46.not.4, %or.cond214.4
br label %for.cond21.preheader
for.cond21.preheader: ; preds = %for.cond18.preheader, %for.inc141
%indvars.iv = phi i64 [ 0, %for.cond18.preheader ], [ %indvars.iv.next, %for.inc141 ]
%max.3227 = phi i32 [ %max.2229, %for.cond18.preheader ], [ %.us-phi, %for.inc141 ]
%cmp33.not = icmp eq i64 %indvars.iv, %indvars.iv255
%or.cond210 = or i1 %or.cond209, %cmp33.not
%cmp35.not = icmp eq i64 %indvars.iv, %indvars.iv251
%or.cond211 = or i1 %cmp35.not, %or.cond210
%cmp37.not = icmp eq i64 %indvars.iv, %indvars.iv247
%or.cond212 = or i1 %cmp37.not, %or.cond211
%arrayidx70 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv247, i64 %indvars.iv
%arrayidx77 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 %indvars.iv247
%or.cond212.fr = freeze i1 %or.cond212
br i1 %or.cond212.fr, label %for.inc141, label %for.body23.preheader
for.body23.preheader: ; preds = %for.cond21.preheader
%cmp48.not = icmp eq i64 %indvars.iv, 0
%or.cond216 = or i1 %cmp48.not, %or.cond215
br i1 %or.cond216, label %for.inc138, label %if.then49
if.then49: ; preds = %for.body23.preheader
%0 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%arrayidx98 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 0
%6 = load i32, ptr %arrayidx98, align 4, !tbaa !5
%arrayidx105 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx105, align 4, !tbaa !5
%reass.add = add i32 %3, %2
%reass.add220 = add i32 %reass.add, %6
%reass.add221 = add i32 %reass.add220, %7
%reass.mul = shl i32 %reass.add221, 1
%add113 = add i32 %1, %0
%add120 = add i32 %add113, %4
%add127 = add i32 %add120, %5
%add134 = add i32 %add127, %reass.mul
%spec.select = call i32 @llvm.smax.i32(i32 %add134, i32 %max.3227)
br label %for.inc138
for.inc138: ; preds = %if.then49, %for.body23.preheader
%max.5 = phi i32 [ %max.3227, %for.body23.preheader ], [ %spec.select, %if.then49 ]
%cmp48.not.1 = icmp eq i64 %indvars.iv, 1
%or.cond216.1 = or i1 %cmp48.not.1, %or.cond215.1
br i1 %or.cond216.1, label %for.inc138.1, label %if.then49.1
if.then49.1: ; preds = %for.inc138
%8 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%13 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%arrayidx98.1 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 1
%14 = load i32, ptr %arrayidx98.1, align 4, !tbaa !5
%arrayidx105.1 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 1, i64 %indvars.iv
%15 = load i32, ptr %arrayidx105.1, align 4, !tbaa !5
%reass.add.1 = add i32 %11, %10
%reass.add220.1 = add i32 %reass.add.1, %14
%reass.add221.1 = add i32 %reass.add220.1, %15
%reass.mul.1 = shl i32 %reass.add221.1, 1
%add113.1 = add i32 %9, %8
%add120.1 = add i32 %add113.1, %12
%add127.1 = add i32 %add120.1, %13
%add134.1 = add i32 %add127.1, %reass.mul.1
%spec.select.1 = call i32 @llvm.smax.i32(i32 %add134.1, i32 %max.5)
br label %for.inc138.1
for.inc138.1: ; preds = %if.then49.1, %for.inc138
%max.5.1 = phi i32 [ %max.5, %for.inc138 ], [ %spec.select.1, %if.then49.1 ]
%cmp48.not.2 = icmp eq i64 %indvars.iv, 2
%or.cond216.2 = or i1 %cmp48.not.2, %or.cond215.2
br i1 %or.cond216.2, label %for.inc138.2, label %if.then49.2
if.then49.2: ; preds = %for.inc138.1
%16 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%18 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%21 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%arrayidx98.2 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 2
%22 = load i32, ptr %arrayidx98.2, align 4, !tbaa !5
%arrayidx105.2 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 2, i64 %indvars.iv
%23 = load i32, ptr %arrayidx105.2, align 4, !tbaa !5
%reass.add.2 = add i32 %19, %18
%reass.add220.2 = add i32 %reass.add.2, %22
%reass.add221.2 = add i32 %reass.add220.2, %23
%reass.mul.2 = shl i32 %reass.add221.2, 1
%add113.2 = add i32 %17, %16
%add120.2 = add i32 %add113.2, %20
%add127.2 = add i32 %add120.2, %21
%add134.2 = add i32 %add127.2, %reass.mul.2
%spec.select.2 = call i32 @llvm.smax.i32(i32 %add134.2, i32 %max.5.1)
br label %for.inc138.2
for.inc138.2: ; preds = %if.then49.2, %for.inc138.1
%max.5.2 = phi i32 [ %max.5.1, %for.inc138.1 ], [ %spec.select.2, %if.then49.2 ]
%cmp48.not.3 = icmp eq i64 %indvars.iv, 3
%or.cond216.3 = or i1 %cmp48.not.3, %or.cond215.3
br i1 %or.cond216.3, label %for.inc138.3, label %if.then49.3
if.then49.3: ; preds = %for.inc138.2
%24 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%26 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%27 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%28 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%29 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%arrayidx98.3 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 3
%30 = load i32, ptr %arrayidx98.3, align 4, !tbaa !5
%arrayidx105.3 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 3, i64 %indvars.iv
%31 = load i32, ptr %arrayidx105.3, align 4, !tbaa !5
%reass.add.3 = add i32 %27, %26
%reass.add220.3 = add i32 %reass.add.3, %30
%reass.add221.3 = add i32 %reass.add220.3, %31
%reass.mul.3 = shl i32 %reass.add221.3, 1
%add113.3 = add i32 %25, %24
%add120.3 = add i32 %add113.3, %28
%add127.3 = add i32 %add120.3, %29
%add134.3 = add i32 %add127.3, %reass.mul.3
%spec.select.3 = call i32 @llvm.smax.i32(i32 %add134.3, i32 %max.5.2)
br label %for.inc138.3
for.inc138.3: ; preds = %if.then49.3, %for.inc138.2
%max.5.3 = phi i32 [ %max.5.2, %for.inc138.2 ], [ %spec.select.3, %if.then49.3 ]
%cmp48.not.4 = icmp eq i64 %indvars.iv, 4
%or.cond216.4 = or i1 %cmp48.not.4, %or.cond215.4
br i1 %or.cond216.4, label %for.inc141, label %if.then49.4
if.then49.4: ; preds = %for.inc138.3
%32 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%33 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%34 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%35 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%36 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%37 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%arrayidx98.4 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 4
%38 = load i32, ptr %arrayidx98.4, align 4, !tbaa !5
%arrayidx105.4 = getelementptr inbounds [5 x [5 x i32]], ptr %b, i64 0, i64 4, i64 %indvars.iv
%39 = load i32, ptr %arrayidx105.4, align 4, !tbaa !5
%reass.add.4 = add i32 %35, %34
%reass.add220.4 = add i32 %reass.add.4, %38
%reass.add221.4 = add i32 %reass.add220.4, %39
%reass.mul.4 = shl i32 %reass.add221.4, 1
%add113.4 = add i32 %33, %32
%add120.4 = add i32 %add113.4, %36
%add127.4 = add i32 %add120.4, %37
%add134.4 = add i32 %add127.4, %reass.mul.4
%spec.select.4 = call i32 @llvm.smax.i32(i32 %add134.4, i32 %max.5.3)
br label %for.inc141
for.inc141: ; preds = %for.inc138.3, %if.then49.4, %for.cond21.preheader
%.us-phi = phi i32 [ %max.3227, %for.cond21.preheader ], [ %max.5.3, %for.inc138.3 ], [ %spec.select.4, %if.then49.4 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 5
br i1 %exitcond.not, label %for.inc144, label %for.cond21.preheader, !llvm.loop !9
for.inc144: ; preds = %for.inc141
%indvars.iv.next248 = add nuw nsw i64 %indvars.iv247, 1
%exitcond250.not = icmp eq i64 %indvars.iv.next248, 5
br i1 %exitcond250.not, label %for.inc147, label %for.cond18.preheader, !llvm.loop !11
for.inc147: ; preds = %for.inc144
%indvars.iv.next252 = add nuw nsw i64 %indvars.iv251, 1
%exitcond254.not = icmp eq i64 %indvars.iv.next252, 5
br i1 %exitcond254.not, label %for.inc150, label %for.cond15.preheader, !llvm.loop !12
for.inc150: ; preds = %for.inc147
%indvars.iv.next256 = add nuw nsw i64 %indvars.iv255, 1
%exitcond258.not = icmp eq i64 %indvars.iv.next256, 5
br i1 %exitcond258.not, label %for.end152, label %for.cond12.preheader, !llvm.loop !13
for.end152: ; preds = %for.inc150
%call153 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %b) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main()
{
int n,i;
scanf("%d", &n);
int a[n],b[n];
for(i=0;i<=n;i++)
{b[i]=0;a[i]=0;}
for(i=1;i<n;i++)
{
scanf("%d",&a[i]);
}
//for(i=0;i<=n;i++)
//{printf("%d ",a[i]);}
//printf("\n");
for(i=1;i<=n;i++)
{
b[a[i]-1]=b[a[i]-1]+1;
}
for(i=0;i<n;i++)
{
printf("%d\n",b[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128163/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128163/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp.not50 = icmp slt i32 %3, 0
br i1 %cmp.not50, label %for.end36, label %for.cond4.preheader
for.cond4.preheader: ; preds = %entry
%5 = add nuw i32 %3, 1
%6 = zext i32 %5 to i64
%7 = shl nuw nsw i64 %6, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla1, i8 0, i64 %7, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %7, i1 false), !tbaa !5
%cmp552 = icmp ugt i32 %3, 1
br i1 %cmp552, label %for.body6, label %for.cond13.preheader
for.cond13.preheader: ; preds = %for.body6, %for.cond4.preheader
%8 = phi i32 [ %3, %for.cond4.preheader ], [ %11, %for.body6 ]
%cmp14.not54 = icmp slt i32 %8, 1
br i1 %cmp14.not54, label %for.end36, label %for.body15.preheader
for.body15.preheader: ; preds = %for.cond13.preheader
%9 = zext i32 %8 to i64
%xtraiter = and i64 %9, 1
%10 = icmp eq i32 %8, 1
br i1 %10, label %for.cond28.preheader.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter = and i64 %9, 4294967294
%invariant.gep = getelementptr i32, ptr %vla, i64 1
br label %for.body15
for.body6: ; preds = %for.cond4.preheader, %for.body6
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body6 ], [ 1, %for.cond4.preheader ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp5 = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !9
for.cond28.preheader.unr-lcssa: ; preds = %for.body15, %for.body15.preheader
%indvars.iv61.unr = phi i64 [ 1, %for.body15.preheader ], [ %indvars.iv.next62.1, %for.body15 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond28.preheader, label %for.body15.epil
for.body15.epil: ; preds = %for.cond28.preheader.unr-lcssa
%arrayidx17.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv61.unr
%13 = load i32, ptr %arrayidx17.epil, align 4, !tbaa !5
%sub.epil = add nsw i32 %13, -1
%idxprom18.epil = sext i32 %sub.epil to i64
%arrayidx19.epil = getelementptr inbounds i32, ptr %vla1, i64 %idxprom18.epil
%14 = load i32, ptr %arrayidx19.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %14, 1
store i32 %add.epil, ptr %arrayidx19.epil, align 4, !tbaa !5
br label %for.cond28.preheader
for.cond28.preheader: ; preds = %for.cond28.preheader.unr-lcssa, %for.body15.epil
%cmp2956 = icmp sgt i32 %8, 0
br i1 %cmp2956, label %for.body30, label %for.end36
for.body15: ; preds = %for.body15, %for.body15.preheader.new
%indvars.iv61 = phi i64 [ 1, %for.body15.preheader.new ], [ %indvars.iv.next62.1, %for.body15 ]
%niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.1, %for.body15 ]
%arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv61
%15 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%sub = add nsw i32 %15, -1
%idxprom18 = sext i32 %sub to i64
%arrayidx19 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom18
%16 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%add = add nsw i32 %16, 1
store i32 %add, ptr %arrayidx19, align 4, !tbaa !5
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv61
%17 = load i32, ptr %gep, align 4, !tbaa !5
%sub.1 = add nsw i32 %17, -1
%idxprom18.1 = sext i32 %sub.1 to i64
%arrayidx19.1 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom18.1
%18 = load i32, ptr %arrayidx19.1, align 4, !tbaa !5
%add.1 = add nsw i32 %18, 1
store i32 %add.1, ptr %arrayidx19.1, align 4, !tbaa !5
%indvars.iv.next62.1 = add nuw nsw i64 %indvars.iv61, 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.cond28.preheader.unr-lcssa, label %for.body15, !llvm.loop !11
for.body30: ; preds = %for.cond28.preheader, %for.body30
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.body30 ], [ 0, %for.cond28.preheader ]
%arrayidx32 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv64
%19 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19)
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%20 = load i32, ptr %n, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp29 = icmp slt i64 %indvars.iv.next65, %21
br i1 %cmp29, label %for.body30, label %for.end36, !llvm.loop !12
for.end36: ; preds = %for.body30, %entry, %for.cond13.preheader, %for.cond28.preheader
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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define rep(i,n) for(i=0;i<n;i++)
#define PI 3.14159265358979323846264338327950L
int main(){
int n,i;
scanf("%d",&n);
int a[n],cnt[200010]={0};
for(i=2;i<=n;i++){
scanf("%d",&a[n]);
cnt[a[n]]=cnt[a[n]]+1;
}
for(i=1;i<=n;i++){
printf("%d\n",cnt[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128206/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128206/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cnt = alloca [200010 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)
%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
call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %cnt) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800040) %cnt, i8 0, i64 800040, i1 false)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not23 = icmp slt i32 %3, 2
br i1 %cmp.not23, label %for.cond10.preheader, label %for.body
for.cond10.preheader: ; preds = %for.body, %entry
%4 = phi i32 [ %3, %entry ], [ %6, %for.body ]
%cmp11.not25 = icmp slt i32 %4, 1
br i1 %cmp11.not25, label %for.end18, label %for.body12
for.body: ; preds = %entry, %for.body
%5 = phi i32 [ %6, %for.body ], [ %3, %entry ]
%i.024 = phi i32 [ %inc, %for.body ], [ 2, %entry ]
%idxprom = sext i32 %5 to i64
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %idxprom
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%6 = load i32, ptr %n, align 4, !tbaa !5
%idxprom2 = sext i32 %6 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %vla, i64 %idxprom2
%7 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%idxprom4 = sext i32 %7 to i64
%arrayidx5 = getelementptr inbounds [200010 x i32], ptr %cnt, i64 0, i64 %idxprom4
%8 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%add = add nsw i32 %8, 1
store i32 %add, ptr %arrayidx5, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.024, 1
%cmp.not.not = icmp slt i32 %i.024, %6
br i1 %cmp.not.not, label %for.body, label %for.cond10.preheader, !llvm.loop !9
for.body12: ; preds = %for.cond10.preheader, %for.body12
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body12 ], [ 1, %for.cond10.preheader ]
%arrayidx14 = getelementptr inbounds [200010 x i32], ptr %cnt, i64 0, i64 %indvars.iv
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp11.not.not = icmp slt i64 %indvars.iv, %11
br i1 %cmp11.not.not, label %for.body12, label %for.end18, !llvm.loop !11
for.end18: ; preds = %for.body12, %for.cond10.preheader
call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %cnt) #5
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int c[4],i,t=0;
char s[100001];
for(i=0;i<4;i++)
scanf("%d",c+i);
scanf("%s",s);
for(i=0;s[i];i++)
t+=c[s[i]-49];
printf("%d\n",t);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12825/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12825/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca [4 x i32], align 16
%s = alloca [100001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%add.ptr.1 = getelementptr inbounds i32, ptr %c, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1)
%add.ptr.2 = getelementptr inbounds i32, ptr %c, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.2)
%add.ptr.3 = getelementptr inbounds i32, ptr %c, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.3)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%tobool.not20 = icmp eq i8 %0, 0
br i1 %tobool.not20, label %for.end11, label %for.body4
for.body4: ; preds = %entry, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %entry ]
%1 = phi i8 [ %3, %for.body4 ], [ %0, %entry ]
%t.022 = phi i32 [ %add, %for.body4 ], [ 0, %entry ]
%conv = sext i8 %1 to i64
%sub = add nsw i64 %conv, -49
%arrayidx8 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 %sub
%2 = load i32, ptr %arrayidx8, align 4, !tbaa !8
%add = add nsw i32 %2, %t.022
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx, align 1, !tbaa !5
%tobool.not = icmp eq i8 %3, 0
br i1 %tobool.not, label %for.end11, label %for.body4, !llvm.loop !10
for.end11: ; preds = %for.body4, %entry
%t.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body4 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %t.0.lcssa)
call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %c) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int N;
scanf("%d", &N);
int A[N-1], ans[N], i;
for(i=0; i<N-1; i++){
scanf("%d", &A[i]);
ans[i] = 0;
}
ans[N-1] = 0;
for(i=0; i<N-1; i++){
ans[A[i]-1]++;
}
for(i=0; i<N; i++){
printf("%d\n", ans[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128314/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128314/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%1 = zext i32 %sub to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp41 = icmp sgt i32 %3, 1
br i1 %cmp41, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub240 = add nsw i32 %3, -1
%.pre = sext i32 %sub240 to i64
%arrayidx857 = getelementptr inbounds i32, ptr %vla1, i64 %.pre
store i32 0, ptr %arrayidx857, align 4, !tbaa !5
br label %for.cond22.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%arrayidx5 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
store i32 0, ptr %arrayidx5, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%sub2 = add nsw i32 %5, -1
%6 = sext i32 %sub2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%arrayidx8 = getelementptr inbounds i32, ptr %vla1, i64 %6
store i32 0, ptr %arrayidx8, align 4, !tbaa !5
%cmp1143 = icmp sgt i32 %5, 1
br i1 %cmp1143, label %for.body12.preheader, label %for.cond22.preheader
for.body12.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %sub2 to i64
%xtraiter = and i64 %wide.trip.count, 1
%7 = icmp eq i32 %sub2, 1
br i1 %7, label %for.cond22.preheader.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body12
for.cond22.preheader.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%indvars.iv49.unr = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next50.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond22.preheader, label %for.body12.epil
for.body12.epil: ; preds = %for.cond22.preheader.loopexit.unr-lcssa
%arrayidx14.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv49.unr
%8 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5
%sub15.epil = add nsw i32 %8, -1
%idxprom16.epil = sext i32 %sub15.epil to i64
%arrayidx17.epil = getelementptr inbounds i32, ptr %vla1, i64 %idxprom16.epil
%9 = load i32, ptr %arrayidx17.epil, align 4, !tbaa !5
%inc18.epil = add nsw i32 %9, 1
store i32 %inc18.epil, ptr %arrayidx17.epil, align 4, !tbaa !5
br label %for.cond22.preheader
for.cond22.preheader: ; preds = %for.body12.epil, %for.cond22.preheader.loopexit.unr-lcssa, %for.end.thread, %for.end
%10 = phi i32 [ %3, %for.end.thread ], [ %5, %for.end ], [ %5, %for.cond22.preheader.loopexit.unr-lcssa ], [ %5, %for.body12.epil ]
%cmp2345 = icmp sgt i32 %10, 0
br i1 %cmp2345, label %for.body24, label %for.end30
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%indvars.iv49 = phi i64 [ 0, %for.body12.preheader.new ], [ %indvars.iv.next50.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%arrayidx14 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv49
%11 = load i32, ptr %arrayidx14, align 8, !tbaa !5
%sub15 = add nsw i32 %11, -1
%idxprom16 = sext i32 %sub15 to i64
%arrayidx17 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom16
%12 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%inc18 = add nsw i32 %12, 1
store i32 %inc18, ptr %arrayidx17, align 4, !tbaa !5
%indvars.iv.next50 = or i64 %indvars.iv49, 1
%arrayidx14.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next50
%13 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5
%sub15.1 = add nsw i32 %13, -1
%idxprom16.1 = sext i32 %sub15.1 to i64
%arrayidx17.1 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom16.1
%14 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5
%inc18.1 = add nsw i32 %14, 1
store i32 %inc18.1, ptr %arrayidx17.1, align 4, !tbaa !5
%indvars.iv.next50.1 = add nuw nsw i64 %indvars.iv49, 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.cond22.preheader.loopexit.unr-lcssa, label %for.body12, !llvm.loop !11
for.body24: ; preds = %for.cond22.preheader, %for.body24
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body24 ], [ 0, %for.cond22.preheader ]
%arrayidx26 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv52
%15 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%16 = load i32, ptr %N, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp23 = icmp slt i64 %indvars.iv.next53, %17
br i1 %cmp23, label %for.body24, label %for.end30, !llvm.loop !12
for.end30: ; preds = %for.body24, %for.cond22.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void) {
int n;
scanf("%d", &n);
int a[n], b[n];
for(int i = 0; i < n; i++) {
if(i == 0) {
b[0] = 0;
continue;
}
scanf("%d", &a[i]);
b[i] = 0;
}
for(int i = 1; i < n; i++) {
b[a[i]-1]++;
}
for(int i = 0; i < n; i++) {
printf("%d\n", b[i]);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128358/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128358/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp39 = icmp sgt i32 %3, 0
br i1 %cmp39, label %for.inc.peel, label %for.cond.cleanup23
for.inc.peel: ; preds = %entry
store i32 0, ptr %vla1, align 16, !tbaa !5
%cmp.peel.not = icmp eq i32 %3, 1
br i1 %cmp.peel.not, label %for.body24.preheader, label %for.inc
for.cond8.preheader: ; preds = %for.inc
%cmp941 = icmp sgt i32 %.pre, 1
br i1 %cmp941, label %for.body11.preheader, label %for.cond21.preheader
for.body11.preheader: ; preds = %for.cond8.preheader
%wide.trip.count = zext i32 %.pre to i64
%5 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %5, 1
%6 = icmp eq i32 %.pre, 2
br i1 %6, label %for.cond21.preheader.loopexit.unr-lcssa, label %for.body11.preheader.new
for.body11.preheader.new: ; preds = %for.body11.preheader
%unroll_iter = and i64 %5, -2
%invariant.gep = getelementptr i32, ptr %vla, i64 1
br label %for.body11
for.inc: ; preds = %for.inc.peel, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.inc.peel ]
%arrayidx3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx3)
%arrayidx6 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
store i32 0, ptr %arrayidx6, align 4, !tbaa !5
%.pre = load i32, ptr %n, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = sext i32 %.pre to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.inc, label %for.cond8.preheader, !llvm.loop !9
for.cond21.preheader.loopexit.unr-lcssa: ; preds = %for.body11, %for.body11.preheader
%indvars.iv48.unr = phi i64 [ 1, %for.body11.preheader ], [ %indvars.iv.next49.1, %for.body11 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond21.preheader, label %for.body11.epil
for.body11.epil: ; preds = %for.cond21.preheader.loopexit.unr-lcssa
%arrayidx13.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv48.unr
%8 = load i32, ptr %arrayidx13.epil, align 4, !tbaa !5
%sub.epil = add nsw i32 %8, -1
%idxprom14.epil = sext i32 %sub.epil to i64
%arrayidx15.epil = getelementptr inbounds i32, ptr %vla1, i64 %idxprom14.epil
%9 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !5
%inc16.epil = add nsw i32 %9, 1
store i32 %inc16.epil, ptr %arrayidx15.epil, align 4, !tbaa !5
br label %for.cond21.preheader
for.cond21.preheader: ; preds = %for.body11.epil, %for.cond21.preheader.loopexit.unr-lcssa, %for.cond8.preheader
%cmp2243 = icmp sgt i32 %.pre, 0
br i1 %cmp2243, label %for.body24.preheader, label %for.cond.cleanup23
for.body24.preheader: ; preds = %for.inc.peel, %for.cond21.preheader
br label %for.body24
for.body11: ; preds = %for.body11, %for.body11.preheader.new
%indvars.iv48 = phi i64 [ 1, %for.body11.preheader.new ], [ %indvars.iv.next49.1, %for.body11 ]
%niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.body11 ]
%arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv48
%10 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%sub = add nsw i32 %10, -1
%idxprom14 = sext i32 %sub to i64
%arrayidx15 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom14
%11 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%inc16 = add nsw i32 %11, 1
store i32 %inc16, ptr %arrayidx15, align 4, !tbaa !5
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv48
%12 = load i32, ptr %gep, align 4, !tbaa !5
%sub.1 = add nsw i32 %12, -1
%idxprom14.1 = sext i32 %sub.1 to i64
%arrayidx15.1 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom14.1
%13 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%inc16.1 = add nsw i32 %13, 1
store i32 %inc16.1, ptr %arrayidx15.1, align 4, !tbaa !5
%indvars.iv.next49.1 = add nuw nsw i64 %indvars.iv48, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond21.preheader.loopexit.unr-lcssa, label %for.body11, !llvm.loop !12
for.cond.cleanup23: ; preds = %for.body24, %entry, %for.cond21.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body24: ; preds = %for.body24.preheader, %for.body24
%indvars.iv51 = phi i64 [ %indvars.iv.next52, %for.body24 ], [ 0, %for.body24.preheader ]
%arrayidx26 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv51
%14 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp22 = icmp slt i64 %indvars.iv.next52, %16
br i1 %cmp22, label %for.body24, label %for.cond.cleanup23, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void){
int n;
int a[200000];
int sum[200000];
for(int i=0;i<200000;i++){
sum[i]=0;
}
scanf("%d", &n);
for(int i=0;i<n-1;i++){
scanf("%d", &a[i]);
sum[a[i]-1]++;
}
for(int i=0;i<n;i++){
printf("%d\n", sum[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128400/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128400/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [200000 x i32], align 16
%sum = alloca [200000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %sum) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) %sum, i8 0, i64 800000, i1 false), !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
%cmp338 = icmp sgt i32 %0, 1
br i1 %cmp338, label %for.body5, label %for.cond19.preheader
for.cond19.preheader: ; preds = %for.body5, %entry
%1 = phi i32 [ %0, %entry ], [ %4, %for.body5 ]
%cmp2040 = icmp sgt i32 %1, 0
br i1 %cmp2040, label %for.body22, label %for.cond.cleanup21
for.body5: ; preds = %entry, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %entry ]
%arrayidx7 = getelementptr inbounds [200000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%2 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%sub11 = add nsw i32 %2, -1
%idxprom12 = sext i32 %sub11 to i64
%arrayidx13 = getelementptr inbounds [200000 x i32], ptr %sum, i64 0, i64 %idxprom12
%3 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%inc14 = add nsw i32 %3, 1
store i32 %inc14, ptr %arrayidx13, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
%5 = sext i32 %sub to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp3, label %for.body5, label %for.cond19.preheader, !llvm.loop !9
for.cond.cleanup21: ; preds = %for.body22, %for.cond19.preheader
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %sum) #4
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body22: ; preds = %for.cond19.preheader, %for.body22
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body22 ], [ 0, %for.cond19.preheader ]
%arrayidx24 = getelementptr inbounds [200000 x i32], ptr %sum, i64 0, i64 %indvars.iv44
%6 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6)
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp20 = icmp slt i64 %indvars.iv.next45, %8
br i1 %cmp20, label %for.body22, label %for.cond.cleanup21, !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: 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 @__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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main()
{
long int num;
long int joshi;
long int buka[200001] = {0};
scanf("%ld", &num);
for (int i = 0; i < num-1; ++i){
scanf("%ld", &joshi);
buka[joshi-1]++;
}
for (int i = 0; i < num; ++i){
printf("%ld\n", buka[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128444/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128444/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca i64, align 8
%joshi = alloca i64, align 8
%buka = alloca [200001 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %num) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %joshi) #4
call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %buka) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600008) %buka, i8 0, i64 1600008, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i64, ptr %num, align 8, !tbaa !5
%cmp21 = icmp sgt i64 %0, 1
br i1 %cmp21, label %for.body, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body, %entry
%1 = phi i64 [ %0, %entry ], [ %4, %for.body ]
%cmp823 = icmp sgt i64 %1, 0
br i1 %cmp823, label %for.body11, label %for.cond.cleanup10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %joshi)
%2 = load i64, ptr %joshi, align 8, !tbaa !5
%sub3 = add nsw i64 %2, -1
%arrayidx = getelementptr inbounds [200001 x i64], ptr %buka, i64 0, i64 %sub3
%3 = load i64, ptr %arrayidx, align 8, !tbaa !5
%inc = add nsw i64 %3, 1
store i64 %inc, ptr %arrayidx, align 8, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i64, ptr %num, align 8, !tbaa !5
%sub = add nsw i64 %4, -1
%cmp = icmp sgt i64 %sub, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.cond.cleanup10: ; preds = %for.body11, %for.cond6.preheader
call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %buka) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %joshi) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num) #4
ret i32 0
for.body11: ; preds = %for.cond6.preheader, %for.body11
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body11 ], [ 0, %for.cond6.preheader ]
%arrayidx12 = getelementptr inbounds [200001 x i64], ptr %buka, i64 0, i64 %indvars.iv27
%5 = load i64, ptr %arrayidx12, align 8, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %5)
%indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1
%6 = load i64, ptr %num, align 8, !tbaa !5
%cmp8 = icmp sgt i64 %6, %indvars.iv.next28
br i1 %cmp8, label %for.body11, label %for.cond.cleanup10, !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: 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main( int argc, char *argv[] )
{
int n, m;
int k;
int a[2*100000+1];
scanf( "%d", &n );
for( int i=0; i<n; i++ ) a[i] = 0;
for( int i=1; i<n; i++ ) {
scanf( "%d", &k );
a[k-1] ++;
}
for( int i=0; i<n; i++ ) printf( "%d\n", a[i] );
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128488/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128488/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%a = alloca [200001 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 %k) #4
call void @llvm.lifetime.start.p0(i64 800004, 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
%cmp29 = icmp sgt i32 %0, 0
br i1 %cmp29, label %for.cond2.preheader, label %for.cond.cleanup16
for.cond2.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %a, i8 0, i64 %2, i1 false), !tbaa !5
%cmp331.not = icmp eq i32 %0, 1
br i1 %cmp331.not, label %for.body17.preheader, label %for.body5
for.cond14.preheader: ; preds = %for.body5
%cmp1533 = icmp sgt i32 %5, 0
br i1 %cmp1533, label %for.body17.preheader, label %for.cond.cleanup16
for.body17.preheader: ; preds = %for.cond2.preheader, %for.cond14.preheader
br label %for.body17
for.body5: ; preds = %for.cond2.preheader, %for.body5
%i1.032 = phi i32 [ %inc11, %for.body5 ], [ 1, %for.cond2.preheader ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%3 = load i32, ptr %k, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%idxprom7 = sext i32 %sub to i64
%arrayidx8 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %idxprom7
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%inc9 = add nsw i32 %4, 1
store i32 %inc9, ptr %arrayidx8, align 4, !tbaa !5
%inc11 = add nuw nsw i32 %i1.032, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc11, %5
br i1 %cmp3, label %for.body5, label %for.cond14.preheader, !llvm.loop !9
for.cond.cleanup16: ; preds = %for.body17, %entry, %for.cond14.preheader
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %a) #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
for.body17: ; preds = %for.body17.preheader, %for.body17
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body17 ], [ 0, %for.body17.preheader ]
%arrayidx19 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp15 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp15, label %for.body17, label %for.cond.cleanup16, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
int main(){
int N,i,super;
int A[200000];
scanf("%d",&N);
for(i=0;i<200000;i++) A[i]=0;
for(i=0;i<N-1;i++){
scanf("%d",&super);
A[super-1]++;
}
for(i=0;i<N;i++) printf("%d\n",A[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128530/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128530/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%super = alloca i32, align 4
%A = alloca [200000 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 %super) #4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) %A, i8 0, i64 800000, i1 false), !tbaa !5
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp230 = icmp sgt i32 %0, 1
br i1 %cmp230, label %for.body3, label %for.cond12.preheader
for.cond12.preheader: ; preds = %for.body3, %entry
%1 = phi i32 [ %0, %entry ], [ %4, %for.body3 ]
%cmp1332 = icmp sgt i32 %1, 0
br i1 %cmp1332, label %for.body14, label %for.end20
for.body3: ; preds = %entry, %for.body3
%i.131 = phi i32 [ %inc10, %for.body3 ], [ 0, %entry ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %super)
%2 = load i32, ptr %super, align 4, !tbaa !5
%sub5 = add nsw i32 %2, -1
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds [200000 x i32], ptr %A, i64 0, i64 %idxprom6
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%inc8 = add nsw i32 %3, 1
store i32 %inc8, ptr %arrayidx7, align 4, !tbaa !5
%inc10 = add nuw nsw i32 %i.131, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
%cmp2 = icmp slt i32 %inc10, %sub
br i1 %cmp2, label %for.body3, label %for.cond12.preheader, !llvm.loop !9
for.body14: ; preds = %for.cond12.preheader, %for.body14
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body14 ], [ 0, %for.cond12.preheader ]
%arrayidx16 = getelementptr inbounds [200000 x i32], ptr %A, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
%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
%cmp13 = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp13, label %for.body14, label %for.end20, !llvm.loop !11
for.end20: ; preds = %for.body14, %for.cond12.preheader
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %super) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
int i;
int a[200005];
for (i = 1; i < n; i++)
scanf("%d", &a[i]);
int cnt[200005];
for (i = 0; i < n; i++)
cnt[i] = 0;
for (i = 1; i < n; i++)
cnt[a[i] - 1]++;
for (i = 0; i < n; i++)
printf("%d\n", cnt[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128574/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128574/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [200005 x i32], align 16
%cnt = alloca [200005 x i32], align 16
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)
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %a) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp41 = icmp sgt i32 %0, 1
br i1 %cmp41, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [200005 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
%3 = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %cnt) #4
%cmp343 = icmp sgt i32 %3, 0
br i1 %cmp343, label %for.cond10.preheader, label %for.end29
for.cond10.preheader: ; preds = %for.end
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %cnt, i8 0, i64 %5, i1 false), !tbaa !5
%cmp1145.not = icmp eq i32 %3, 1
br i1 %cmp1145.not, label %for.body23.preheader, label %for.body12.preheader
for.body12.preheader: ; preds = %for.cond10.preheader
%wide.trip.count = zext i32 %3 to i64
%6 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %6, 1
%7 = icmp eq i32 %3, 2
br i1 %7, label %for.cond21.preheader.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %6, -2
br label %for.body12
for.cond21.preheader.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%indvars.iv54.unr = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next55.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond21.preheader, label %for.body12.epil
for.body12.epil: ; preds = %for.cond21.preheader.unr-lcssa
%arrayidx14.epil = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %indvars.iv54.unr
%8 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5
%sub.epil = add nsw i32 %8, -1
%idxprom15.epil = sext i32 %sub.epil to i64
%arrayidx16.epil = getelementptr inbounds [200005 x i32], ptr %cnt, i64 0, i64 %idxprom15.epil
%9 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
%inc17.epil = add nsw i32 %9, 1
store i32 %inc17.epil, ptr %arrayidx16.epil, align 4, !tbaa !5
br label %for.cond21.preheader
for.cond21.preheader: ; preds = %for.cond21.preheader.unr-lcssa, %for.body12.epil
br i1 %cmp343, label %for.body23.preheader, label %for.end29
for.body23.preheader: ; preds = %for.cond10.preheader, %for.cond21.preheader
br label %for.body23
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%indvars.iv54 = phi i64 [ 1, %for.body12.preheader.new ], [ %indvars.iv.next55.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%arrayidx14 = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %indvars.iv54
%10 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%sub = add nsw i32 %10, -1
%idxprom15 = sext i32 %sub to i64
%arrayidx16 = getelementptr inbounds [200005 x i32], ptr %cnt, i64 0, i64 %idxprom15
%11 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%inc17 = add nsw i32 %11, 1
store i32 %inc17, ptr %arrayidx16, align 4, !tbaa !5
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%arrayidx14.1 = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %indvars.iv.next55
%12 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5
%sub.1 = add nsw i32 %12, -1
%idxprom15.1 = sext i32 %sub.1 to i64
%arrayidx16.1 = getelementptr inbounds [200005 x i32], ptr %cnt, i64 0, i64 %idxprom15.1
%13 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
%inc17.1 = add nsw i32 %13, 1
store i32 %inc17.1, ptr %arrayidx16.1, align 4, !tbaa !5
%indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond21.preheader.unr-lcssa, label %for.body12, !llvm.loop !11
for.body23: ; preds = %for.body23.preheader, %for.body23
%indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.body23 ], [ 0, %for.body23.preheader ]
%arrayidx25 = getelementptr inbounds [200005 x i32], ptr %cnt, i64 0, i64 %indvars.iv57
%14 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp22 = icmp slt i64 %indvars.iv.next58, %16
br i1 %cmp22, label %for.body23, label %for.end29, !llvm.loop !12
for.end29: ; preds = %for.body23, %for.end, %for.cond21.preheader
call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %cnt) #4
call void @llvm.lifetime.end.p0(i64 800020, 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void)
{
int i,j,a,b,c[10000];
while(1){
scanf("%d",&a);
if(a==0) break;
for(i=0;i<10;i++){
c[i]=0;
}
for(i=0;i<a;i++){
scanf("%d",&b);
c[b]+=1;
}
for(i=0;i<10;i++){
if(c[i]>0){
for(j=0;j<c[i];j++){
printf("*");
}
printf("\n");
}
else{
printf("-\n");
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128617/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128617/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"-\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 [10000 x i32], align 16
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 40000, ptr nonnull %c) #5
%call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp49 = icmp eq i32 %0, 0
br i1 %cmp49, label %while.end, label %for.cond.preheader.preheader
for.cond.preheader.preheader: ; preds = %entry
%arrayidx15.1 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 1
%arrayidx15.2 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 2
%arrayidx15.3 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 3
%arrayidx15.4 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 4
%arrayidx15.5 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 5
%arrayidx15.6 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 6
%arrayidx15.7 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 7
%arrayidx15.8 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 8
%arrayidx15.9 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 9
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.inc30.9
%1 = phi i32 [ %0, %for.cond.preheader.preheader ], [ %14, %for.inc30.9 ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %c, i8 0, i64 40, i1 false), !tbaa !5
%cmp344 = icmp sgt i32 %1, 0
br i1 %cmp344, label %for.body4, label %if.else
for.cond11.preheader: ; preds = %for.body4
%.pre = load i32, ptr %c, align 16, !tbaa !5
%cmp16 = icmp sgt i32 %.pre, 0
br i1 %cmp16, label %for.body22, label %if.else
for.body4: ; preds = %for.cond.preheader, %for.body4
%i.145 = phi i32 [ %inc9, %for.body4 ], [ 0, %for.cond.preheader ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%2 = load i32, ptr %b, align 4, !tbaa !5
%idxprom6 = sext i32 %2 to i64
%arrayidx7 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 %idxprom6
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add = add nsw i32 %3, 1
store i32 %add, ptr %arrayidx7, align 4, !tbaa !5
%inc9 = add nuw nsw i32 %i.145, 1
%4 = load i32, ptr %a, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc9, %4
br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !9
for.body22: ; preds = %for.cond11.preheader, %for.body22
%j.046 = phi i32 [ %inc25, %for.body22 ], [ 0, %for.cond11.preheader ]
%putchar42 = call i32 @putchar(i32 42)
%inc25 = add nuw nsw i32 %j.046, 1
%exitcond.not = icmp eq i32 %inc25, %.pre
br i1 %exitcond.not, label %for.end26, label %for.body22, !llvm.loop !11
for.end26: ; preds = %for.body22
%putchar = call i32 @putchar(i32 10)
br label %for.inc30
if.else: ; preds = %for.cond.preheader, %for.cond11.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30
for.inc30: ; preds = %for.end26, %if.else
%5 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%cmp16.1 = icmp sgt i32 %5, 0
br i1 %cmp16.1, label %for.body22.1, label %if.else.1
if.else.1: ; preds = %for.inc30
%puts.1 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.1
for.body22.1: ; preds = %for.inc30, %for.body22.1
%j.046.1 = phi i32 [ %inc25.1, %for.body22.1 ], [ 0, %for.inc30 ]
%putchar42.1 = call i32 @putchar(i32 42)
%inc25.1 = add nuw nsw i32 %j.046.1, 1
%exitcond.1.not = icmp eq i32 %inc25.1, %5
br i1 %exitcond.1.not, label %for.end26.1, label %for.body22.1, !llvm.loop !11
for.end26.1: ; preds = %for.body22.1
%putchar.1 = call i32 @putchar(i32 10)
br label %for.inc30.1
for.inc30.1: ; preds = %for.end26.1, %if.else.1
%6 = load i32, ptr %arrayidx15.2, align 8, !tbaa !5
%cmp16.2 = icmp sgt i32 %6, 0
br i1 %cmp16.2, label %for.body22.2, label %if.else.2
if.else.2: ; preds = %for.inc30.1
%puts.2 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.2
for.body22.2: ; preds = %for.inc30.1, %for.body22.2
%j.046.2 = phi i32 [ %inc25.2, %for.body22.2 ], [ 0, %for.inc30.1 ]
%putchar42.2 = call i32 @putchar(i32 42)
%inc25.2 = add nuw nsw i32 %j.046.2, 1
%exitcond.2.not = icmp eq i32 %inc25.2, %6
br i1 %exitcond.2.not, label %for.end26.2, label %for.body22.2, !llvm.loop !11
for.end26.2: ; preds = %for.body22.2
%putchar.2 = call i32 @putchar(i32 10)
br label %for.inc30.2
for.inc30.2: ; preds = %for.end26.2, %if.else.2
%7 = load i32, ptr %arrayidx15.3, align 4, !tbaa !5
%cmp16.3 = icmp sgt i32 %7, 0
br i1 %cmp16.3, label %for.body22.3, label %if.else.3
if.else.3: ; preds = %for.inc30.2
%puts.3 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.3
for.body22.3: ; preds = %for.inc30.2, %for.body22.3
%j.046.3 = phi i32 [ %inc25.3, %for.body22.3 ], [ 0, %for.inc30.2 ]
%putchar42.3 = call i32 @putchar(i32 42)
%inc25.3 = add nuw nsw i32 %j.046.3, 1
%exitcond.3.not = icmp eq i32 %inc25.3, %7
br i1 %exitcond.3.not, label %for.end26.3, label %for.body22.3, !llvm.loop !11
for.end26.3: ; preds = %for.body22.3
%putchar.3 = call i32 @putchar(i32 10)
br label %for.inc30.3
for.inc30.3: ; preds = %for.end26.3, %if.else.3
%8 = load i32, ptr %arrayidx15.4, align 16, !tbaa !5
%cmp16.4 = icmp sgt i32 %8, 0
br i1 %cmp16.4, label %for.body22.4, label %if.else.4
if.else.4: ; preds = %for.inc30.3
%puts.4 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.4
for.body22.4: ; preds = %for.inc30.3, %for.body22.4
%j.046.4 = phi i32 [ %inc25.4, %for.body22.4 ], [ 0, %for.inc30.3 ]
%putchar42.4 = call i32 @putchar(i32 42)
%inc25.4 = add nuw nsw i32 %j.046.4, 1
%exitcond.4.not = icmp eq i32 %inc25.4, %8
br i1 %exitcond.4.not, label %for.end26.4, label %for.body22.4, !llvm.loop !11
for.end26.4: ; preds = %for.body22.4
%putchar.4 = call i32 @putchar(i32 10)
br label %for.inc30.4
for.inc30.4: ; preds = %for.end26.4, %if.else.4
%9 = load i32, ptr %arrayidx15.5, align 4, !tbaa !5
%cmp16.5 = icmp sgt i32 %9, 0
br i1 %cmp16.5, label %for.body22.5, label %if.else.5
if.else.5: ; preds = %for.inc30.4
%puts.5 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.5
for.body22.5: ; preds = %for.inc30.4, %for.body22.5
%j.046.5 = phi i32 [ %inc25.5, %for.body22.5 ], [ 0, %for.inc30.4 ]
%putchar42.5 = call i32 @putchar(i32 42)
%inc25.5 = add nuw nsw i32 %j.046.5, 1
%exitcond.5.not = icmp eq i32 %inc25.5, %9
br i1 %exitcond.5.not, label %for.end26.5, label %for.body22.5, !llvm.loop !11
for.end26.5: ; preds = %for.body22.5
%putchar.5 = call i32 @putchar(i32 10)
br label %for.inc30.5
for.inc30.5: ; preds = %for.end26.5, %if.else.5
%10 = load i32, ptr %arrayidx15.6, align 8, !tbaa !5
%cmp16.6 = icmp sgt i32 %10, 0
br i1 %cmp16.6, label %for.body22.6, label %if.else.6
if.else.6: ; preds = %for.inc30.5
%puts.6 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.6
for.body22.6: ; preds = %for.inc30.5, %for.body22.6
%j.046.6 = phi i32 [ %inc25.6, %for.body22.6 ], [ 0, %for.inc30.5 ]
%putchar42.6 = call i32 @putchar(i32 42)
%inc25.6 = add nuw nsw i32 %j.046.6, 1
%exitcond.6.not = icmp eq i32 %inc25.6, %10
br i1 %exitcond.6.not, label %for.end26.6, label %for.body22.6, !llvm.loop !11
for.end26.6: ; preds = %for.body22.6
%putchar.6 = call i32 @putchar(i32 10)
br label %for.inc30.6
for.inc30.6: ; preds = %for.end26.6, %if.else.6
%11 = load i32, ptr %arrayidx15.7, align 4, !tbaa !5
%cmp16.7 = icmp sgt i32 %11, 0
br i1 %cmp16.7, label %for.body22.7, label %if.else.7
if.else.7: ; preds = %for.inc30.6
%puts.7 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.7
for.body22.7: ; preds = %for.inc30.6, %for.body22.7
%j.046.7 = phi i32 [ %inc25.7, %for.body22.7 ], [ 0, %for.inc30.6 ]
%putchar42.7 = call i32 @putchar(i32 42)
%inc25.7 = add nuw nsw i32 %j.046.7, 1
%exitcond.7.not = icmp eq i32 %inc25.7, %11
br i1 %exitcond.7.not, label %for.end26.7, label %for.body22.7, !llvm.loop !11
for.end26.7: ; preds = %for.body22.7
%putchar.7 = call i32 @putchar(i32 10)
br label %for.inc30.7
for.inc30.7: ; preds = %for.end26.7, %if.else.7
%12 = load i32, ptr %arrayidx15.8, align 16, !tbaa !5
%cmp16.8 = icmp sgt i32 %12, 0
br i1 %cmp16.8, label %for.body22.8, label %if.else.8
if.else.8: ; preds = %for.inc30.7
%puts.8 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.8
for.body22.8: ; preds = %for.inc30.7, %for.body22.8
%j.046.8 = phi i32 [ %inc25.8, %for.body22.8 ], [ 0, %for.inc30.7 ]
%putchar42.8 = call i32 @putchar(i32 42)
%inc25.8 = add nuw nsw i32 %j.046.8, 1
%exitcond.8.not = icmp eq i32 %inc25.8, %12
br i1 %exitcond.8.not, label %for.end26.8, label %for.body22.8, !llvm.loop !11
for.end26.8: ; preds = %for.body22.8
%putchar.8 = call i32 @putchar(i32 10)
br label %for.inc30.8
for.inc30.8: ; preds = %for.end26.8, %if.else.8
%13 = load i32, ptr %arrayidx15.9, align 4, !tbaa !5
%cmp16.9 = icmp sgt i32 %13, 0
br i1 %cmp16.9, label %for.body22.9, label %if.else.9
if.else.9: ; preds = %for.inc30.8
%puts.9 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc30.9
for.body22.9: ; preds = %for.inc30.8, %for.body22.9
%j.046.9 = phi i32 [ %inc25.9, %for.body22.9 ], [ 0, %for.inc30.8 ]
%putchar42.9 = call i32 @putchar(i32 42)
%inc25.9 = add nuw nsw i32 %j.046.9, 1
%exitcond.9.not = icmp eq i32 %inc25.9, %13
br i1 %exitcond.9.not, label %for.end26.9, label %for.body22.9, !llvm.loop !11
for.end26.9: ; preds = %for.body22.9
%putchar.9 = call i32 @putchar(i32 10)
br label %for.inc30.9
for.inc30.9: ; preds = %for.end26.9, %if.else.9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%14 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %14, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.inc30.9, %entry
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main(void)
{
int n;
while(scanf("%d",&n)){
int count[10]={0};
int i;
int no;
if(n==0)
break;
for(i=0;i<n;i++){
scanf("%d",&no);
count[no]++;
}
for(i=0;i<10;i++){
int j;
for(j=0;j<count[i];j++)
putchar('*');
if(count[i]==0)
putchar('-');
putchar('\n');
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128682/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128682/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%count = alloca [10 x i32], align 16
%no = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool.not45 = icmp eq i32 %call44, 0
br i1 %tobool.not45, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%arrayidx9.1 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 1
%arrayidx9.2 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 2
%arrayidx9.3 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 3
%arrayidx9.4 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 4
%arrayidx9.5 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 5
%arrayidx9.6 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 6
%arrayidx9.7 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 7
%arrayidx9.8 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 8
%arrayidx9.9 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 9
br label %while.body
while.body: ; preds = %while.body.preheader, %if.end21.9
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %count) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %count, i8 0, i64 40, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %cleanup.thread, label %for.cond.preheader
for.cond.preheader: ; preds = %while.body
%cmp139 = icmp sgt i32 %0, 0
br i1 %cmp139, label %for.body, label %if.then19
cleanup.thread: ; preds = %while.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no) #4
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %count) #4
br label %while.end
for.cond4.preheader: ; preds = %for.body
%.pre = load i32, ptr %count, align 16, !tbaa !5
%cmp1041 = icmp sgt i32 %.pre, 0
br i1 %cmp1041, label %for.body11, label %for.end15
for.body: ; preds = %for.cond.preheader, %for.body
%i.040 = phi i32 [ %inc3, %for.body ], [ 0, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %no)
%1 = load i32, ptr %no, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%inc3 = add nuw nsw i32 %i.040, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc3, %3
br i1 %cmp1, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body11: ; preds = %for.cond4.preheader, %for.body11
%j.042 = phi i32 [ %inc14, %for.body11 ], [ 0, %for.cond4.preheader ]
%4 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i = call i32 @putc(i32 noundef 42, ptr noundef %4)
%inc14 = add nuw nsw i32 %j.042, 1
%exitcond.not = icmp eq i32 %inc14, %.pre
br i1 %exitcond.not, label %for.end15, label %for.body11, !llvm.loop !13
for.end15: ; preds = %for.body11, %for.cond4.preheader
%cmp18 = icmp eq i32 %.pre, 0
br i1 %cmp18, label %if.then19, label %if.end21
if.then19: ; preds = %for.cond.preheader, %for.end15
%5 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35 = call i32 @putc(i32 noundef 45, ptr noundef %5)
br label %if.end21
if.end21: ; preds = %if.then19, %for.end15
%6 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36 = call i32 @putc(i32 noundef 10, ptr noundef %6)
%7 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%cmp1041.1 = icmp sgt i32 %7, 0
br i1 %cmp1041.1, label %for.body11.1, label %for.end15.1
for.body11.1: ; preds = %if.end21, %for.body11.1
%j.042.1 = phi i32 [ %inc14.1, %for.body11.1 ], [ 0, %if.end21 ]
%8 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.1 = call i32 @putc(i32 noundef 42, ptr noundef %8)
%inc14.1 = add nuw nsw i32 %j.042.1, 1
%exitcond.1.not = icmp eq i32 %inc14.1, %7
br i1 %exitcond.1.not, label %for.end15.1, label %for.body11.1, !llvm.loop !13
for.end15.1: ; preds = %for.body11.1, %if.end21
%cmp18.1 = icmp eq i32 %7, 0
br i1 %cmp18.1, label %if.then19.1, label %if.end21.1
if.then19.1: ; preds = %for.end15.1
%9 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.1 = call i32 @putc(i32 noundef 45, ptr noundef %9)
br label %if.end21.1
if.end21.1: ; preds = %if.then19.1, %for.end15.1
%10 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.1 = call i32 @putc(i32 noundef 10, ptr noundef %10)
%11 = load i32, ptr %arrayidx9.2, align 8, !tbaa !5
%cmp1041.2 = icmp sgt i32 %11, 0
br i1 %cmp1041.2, label %for.body11.2, label %for.end15.2
for.body11.2: ; preds = %if.end21.1, %for.body11.2
%j.042.2 = phi i32 [ %inc14.2, %for.body11.2 ], [ 0, %if.end21.1 ]
%12 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.2 = call i32 @putc(i32 noundef 42, ptr noundef %12)
%inc14.2 = add nuw nsw i32 %j.042.2, 1
%exitcond.2.not = icmp eq i32 %inc14.2, %11
br i1 %exitcond.2.not, label %for.end15.2, label %for.body11.2, !llvm.loop !13
for.end15.2: ; preds = %for.body11.2, %if.end21.1
%cmp18.2 = icmp eq i32 %11, 0
br i1 %cmp18.2, label %if.then19.2, label %if.end21.2
if.then19.2: ; preds = %for.end15.2
%13 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.2 = call i32 @putc(i32 noundef 45, ptr noundef %13)
br label %if.end21.2
if.end21.2: ; preds = %if.then19.2, %for.end15.2
%14 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.2 = call i32 @putc(i32 noundef 10, ptr noundef %14)
%15 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5
%cmp1041.3 = icmp sgt i32 %15, 0
br i1 %cmp1041.3, label %for.body11.3, label %for.end15.3
for.body11.3: ; preds = %if.end21.2, %for.body11.3
%j.042.3 = phi i32 [ %inc14.3, %for.body11.3 ], [ 0, %if.end21.2 ]
%16 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.3 = call i32 @putc(i32 noundef 42, ptr noundef %16)
%inc14.3 = add nuw nsw i32 %j.042.3, 1
%exitcond.3.not = icmp eq i32 %inc14.3, %15
br i1 %exitcond.3.not, label %for.end15.3, label %for.body11.3, !llvm.loop !13
for.end15.3: ; preds = %for.body11.3, %if.end21.2
%cmp18.3 = icmp eq i32 %15, 0
br i1 %cmp18.3, label %if.then19.3, label %if.end21.3
if.then19.3: ; preds = %for.end15.3
%17 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.3 = call i32 @putc(i32 noundef 45, ptr noundef %17)
br label %if.end21.3
if.end21.3: ; preds = %if.then19.3, %for.end15.3
%18 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.3 = call i32 @putc(i32 noundef 10, ptr noundef %18)
%19 = load i32, ptr %arrayidx9.4, align 16, !tbaa !5
%cmp1041.4 = icmp sgt i32 %19, 0
br i1 %cmp1041.4, label %for.body11.4, label %for.end15.4
for.body11.4: ; preds = %if.end21.3, %for.body11.4
%j.042.4 = phi i32 [ %inc14.4, %for.body11.4 ], [ 0, %if.end21.3 ]
%20 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.4 = call i32 @putc(i32 noundef 42, ptr noundef %20)
%inc14.4 = add nuw nsw i32 %j.042.4, 1
%exitcond.4.not = icmp eq i32 %inc14.4, %19
br i1 %exitcond.4.not, label %for.end15.4, label %for.body11.4, !llvm.loop !13
for.end15.4: ; preds = %for.body11.4, %if.end21.3
%cmp18.4 = icmp eq i32 %19, 0
br i1 %cmp18.4, label %if.then19.4, label %if.end21.4
if.then19.4: ; preds = %for.end15.4
%21 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.4 = call i32 @putc(i32 noundef 45, ptr noundef %21)
br label %if.end21.4
if.end21.4: ; preds = %if.then19.4, %for.end15.4
%22 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.4 = call i32 @putc(i32 noundef 10, ptr noundef %22)
%23 = load i32, ptr %arrayidx9.5, align 4, !tbaa !5
%cmp1041.5 = icmp sgt i32 %23, 0
br i1 %cmp1041.5, label %for.body11.5, label %for.end15.5
for.body11.5: ; preds = %if.end21.4, %for.body11.5
%j.042.5 = phi i32 [ %inc14.5, %for.body11.5 ], [ 0, %if.end21.4 ]
%24 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.5 = call i32 @putc(i32 noundef 42, ptr noundef %24)
%inc14.5 = add nuw nsw i32 %j.042.5, 1
%exitcond.5.not = icmp eq i32 %inc14.5, %23
br i1 %exitcond.5.not, label %for.end15.5, label %for.body11.5, !llvm.loop !13
for.end15.5: ; preds = %for.body11.5, %if.end21.4
%cmp18.5 = icmp eq i32 %23, 0
br i1 %cmp18.5, label %if.then19.5, label %if.end21.5
if.then19.5: ; preds = %for.end15.5
%25 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.5 = call i32 @putc(i32 noundef 45, ptr noundef %25)
br label %if.end21.5
if.end21.5: ; preds = %if.then19.5, %for.end15.5
%26 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.5 = call i32 @putc(i32 noundef 10, ptr noundef %26)
%27 = load i32, ptr %arrayidx9.6, align 8, !tbaa !5
%cmp1041.6 = icmp sgt i32 %27, 0
br i1 %cmp1041.6, label %for.body11.6, label %for.end15.6
for.body11.6: ; preds = %if.end21.5, %for.body11.6
%j.042.6 = phi i32 [ %inc14.6, %for.body11.6 ], [ 0, %if.end21.5 ]
%28 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.6 = call i32 @putc(i32 noundef 42, ptr noundef %28)
%inc14.6 = add nuw nsw i32 %j.042.6, 1
%exitcond.6.not = icmp eq i32 %inc14.6, %27
br i1 %exitcond.6.not, label %for.end15.6, label %for.body11.6, !llvm.loop !13
for.end15.6: ; preds = %for.body11.6, %if.end21.5
%cmp18.6 = icmp eq i32 %27, 0
br i1 %cmp18.6, label %if.then19.6, label %if.end21.6
if.then19.6: ; preds = %for.end15.6
%29 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.6 = call i32 @putc(i32 noundef 45, ptr noundef %29)
br label %if.end21.6
if.end21.6: ; preds = %if.then19.6, %for.end15.6
%30 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.6 = call i32 @putc(i32 noundef 10, ptr noundef %30)
%31 = load i32, ptr %arrayidx9.7, align 4, !tbaa !5
%cmp1041.7 = icmp sgt i32 %31, 0
br i1 %cmp1041.7, label %for.body11.7, label %for.end15.7
for.body11.7: ; preds = %if.end21.6, %for.body11.7
%j.042.7 = phi i32 [ %inc14.7, %for.body11.7 ], [ 0, %if.end21.6 ]
%32 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.7 = call i32 @putc(i32 noundef 42, ptr noundef %32)
%inc14.7 = add nuw nsw i32 %j.042.7, 1
%exitcond.7.not = icmp eq i32 %inc14.7, %31
br i1 %exitcond.7.not, label %for.end15.7, label %for.body11.7, !llvm.loop !13
for.end15.7: ; preds = %for.body11.7, %if.end21.6
%cmp18.7 = icmp eq i32 %31, 0
br i1 %cmp18.7, label %if.then19.7, label %if.end21.7
if.then19.7: ; preds = %for.end15.7
%33 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.7 = call i32 @putc(i32 noundef 45, ptr noundef %33)
br label %if.end21.7
if.end21.7: ; preds = %if.then19.7, %for.end15.7
%34 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.7 = call i32 @putc(i32 noundef 10, ptr noundef %34)
%35 = load i32, ptr %arrayidx9.8, align 16, !tbaa !5
%cmp1041.8 = icmp sgt i32 %35, 0
br i1 %cmp1041.8, label %for.body11.8, label %for.end15.8
for.body11.8: ; preds = %if.end21.7, %for.body11.8
%j.042.8 = phi i32 [ %inc14.8, %for.body11.8 ], [ 0, %if.end21.7 ]
%36 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.8 = call i32 @putc(i32 noundef 42, ptr noundef %36)
%inc14.8 = add nuw nsw i32 %j.042.8, 1
%exitcond.8.not = icmp eq i32 %inc14.8, %35
br i1 %exitcond.8.not, label %for.end15.8, label %for.body11.8, !llvm.loop !13
for.end15.8: ; preds = %for.body11.8, %if.end21.7
%cmp18.8 = icmp eq i32 %35, 0
br i1 %cmp18.8, label %if.then19.8, label %if.end21.8
if.then19.8: ; preds = %for.end15.8
%37 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.8 = call i32 @putc(i32 noundef 45, ptr noundef %37)
br label %if.end21.8
if.end21.8: ; preds = %if.then19.8, %for.end15.8
%38 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.8 = call i32 @putc(i32 noundef 10, ptr noundef %38)
%39 = load i32, ptr %arrayidx9.9, align 4, !tbaa !5
%cmp1041.9 = icmp sgt i32 %39, 0
br i1 %cmp1041.9, label %for.body11.9, label %for.end15.9
for.body11.9: ; preds = %if.end21.8, %for.body11.9
%j.042.9 = phi i32 [ %inc14.9, %for.body11.9 ], [ 0, %if.end21.8 ]
%40 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i.9 = call i32 @putc(i32 noundef 42, ptr noundef %40)
%inc14.9 = add nuw nsw i32 %j.042.9, 1
%exitcond.9.not = icmp eq i32 %inc14.9, %39
br i1 %exitcond.9.not, label %for.end15.9, label %for.body11.9, !llvm.loop !13
for.end15.9: ; preds = %for.body11.9, %if.end21.8
%cmp18.9 = icmp eq i32 %39, 0
br i1 %cmp18.9, label %if.then19.9, label %if.end21.9
if.then19.9: ; preds = %for.end15.9
%41 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i35.9 = call i32 @putc(i32 noundef 45, ptr noundef %41)
br label %if.end21.9
if.end21.9: ; preds = %if.then19.9, %for.end15.9
%42 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i36.9 = call i32 @putc(i32 noundef 10, ptr noundef %42)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no) #4
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %count) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %while.end, label %while.body
while.end: ; preds = %if.end21.9, %entry, %cleanup.thread
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main (void) {
int i , input , rand , n , j;
scanf("%d",&n);
for ( i = 0; i < n; i++ ) {
scanf("%d",&rand);
printf("Case %d:\n",i+1);
for ( j = 0; j < 10; j++ ) {
rand *= rand;
rand /= 100;
rand %= 10000;
printf("%d\n",rand);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128732/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128732/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"Case %d:\0A\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:
%rand = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %rand) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %0, 0
br i1 %cmp14, label %for.body, label %for.end9
for.body: ; preds = %entry, %for.body
%i.015 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %rand)
%add = add nuw nsw i32 %i.015, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%1 = load i32, ptr %rand, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%div = udiv i32 %mul, 100
%rem = urem i32 %div, 10000
store i32 %rem, ptr %rand, align 4, !tbaa !5
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem)
%2 = load i32, ptr %rand, align 4, !tbaa !5
%mul.1 = mul nsw i32 %2, %2
%div.1 = udiv i32 %mul.1, 100
%rem.1 = urem i32 %div.1, 10000
store i32 %rem.1, ptr %rand, align 4, !tbaa !5
%call6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.1)
%3 = load i32, ptr %rand, align 4, !tbaa !5
%mul.2 = mul nsw i32 %3, %3
%div.2 = udiv i32 %mul.2, 100
%rem.2 = urem i32 %div.2, 10000
store i32 %rem.2, ptr %rand, align 4, !tbaa !5
%call6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.2)
%4 = load i32, ptr %rand, align 4, !tbaa !5
%mul.3 = mul nsw i32 %4, %4
%div.3 = udiv i32 %mul.3, 100
%rem.3 = urem i32 %div.3, 10000
store i32 %rem.3, ptr %rand, align 4, !tbaa !5
%call6.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.3)
%5 = load i32, ptr %rand, align 4, !tbaa !5
%mul.4 = mul nsw i32 %5, %5
%div.4 = udiv i32 %mul.4, 100
%rem.4 = urem i32 %div.4, 10000
store i32 %rem.4, ptr %rand, align 4, !tbaa !5
%call6.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.4)
%6 = load i32, ptr %rand, align 4, !tbaa !5
%mul.5 = mul nsw i32 %6, %6
%div.5 = udiv i32 %mul.5, 100
%rem.5 = urem i32 %div.5, 10000
store i32 %rem.5, ptr %rand, align 4, !tbaa !5
%call6.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.5)
%7 = load i32, ptr %rand, align 4, !tbaa !5
%mul.6 = mul nsw i32 %7, %7
%div.6 = udiv i32 %mul.6, 100
%rem.6 = urem i32 %div.6, 10000
store i32 %rem.6, ptr %rand, align 4, !tbaa !5
%call6.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.6)
%8 = load i32, ptr %rand, align 4, !tbaa !5
%mul.7 = mul nsw i32 %8, %8
%div.7 = udiv i32 %mul.7, 100
%rem.7 = urem i32 %div.7, 10000
store i32 %rem.7, ptr %rand, align 4, !tbaa !5
%call6.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.7)
%9 = load i32, ptr %rand, align 4, !tbaa !5
%mul.8 = mul nsw i32 %9, %9
%div.8 = udiv i32 %mul.8, 100
%rem.8 = urem i32 %div.8, 10000
store i32 %rem.8, ptr %rand, align 4, !tbaa !5
%call6.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.8)
%10 = load i32, ptr %rand, align 4, !tbaa !5
%mul.9 = mul nsw i32 %10, %10
%div.9 = udiv i32 %mul.9, 100
%rem.9 = urem i32 %div.9, 10000
store i32 %rem.9, ptr %rand, align 4, !tbaa !5
%call6.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem.9)
%11 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %add, %11
br i1 %cmp, label %for.body, label %for.end9, !llvm.loop !9
for.end9: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %rand) #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 a, b, r;
scanf("%d %d", &a, &b);
r = a+b;
if( r<10 )
{
printf("%d", r);
}
else
{
printf("error");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128776/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128776/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp slt i32 %add, 10
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
br label %if.end
if.else: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
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,ans;
scanf("%d%d",&A,&B);
if(A+B>=10) printf("error\n");
else printf("%d\n",A+B);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128819/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128819/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp sgt i32 %add, 9
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a, &b);
if(a+b < 10) printf("%d\n", a+b);
else printf("error\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128862/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128862/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@str = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp slt i32 %add, 10
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, i32 noundef %add)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a, b, c;
scanf("%d %d", &a, &b);
c = a + b;
if(c <= 9) printf("%d\n", c);
else printf("error\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128905/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128905/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@str = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp slt i32 %add, 10
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int A, B;
scanf("%d%d", &A, &B);
if (A+B>=10) {
printf("error\n");
} else {
printf("%d\n", A+B);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128949/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128949/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp sgt i32 %add, 9
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if((a+b)<10)
printf("%d\n",a+b);
else
printf("error\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128992/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128992/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@str = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp slt i32 %add, 10
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, i32 noundef %add)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a=0,b=0;
scanf("%d%d",&a,&b);
if(a+b>=10)
printf("error\n") ;
else
printf("%d\n",a+b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129034/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129034/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
store i32 0, ptr %b, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp sgt i32 %add, 9
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int A,B,sum=0;
scanf("%d %d",&A,&B);
sum=A+B;
if(sum>=10)
printf("error");
else
printf("%d",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129078/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129078/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"error\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp sgt i32 %add, 9
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
int a, b;
scanf("%d %d", &a, &b);
if (a+b < 10) {
printf("%d", a+b);
} else {
printf("error");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129120/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129120/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp slt i32 %add, 10
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, i32 noundef %add)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
printf("%d",a+a*a+a*a*a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129171/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129171/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%add = add nsw i32 %mul, %0
%mul2 = mul nsw i32 %mul, %0
%add3 = add nsw i32 %add, %mul2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);
printf("%d\n",a+(a*a)+(a*a*a));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129214/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129214/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%add = add nsw i32 %mul, %0
%mul2 = mul nsw i32 %mul, %0
%add3 = add nsw i32 %add, %mul2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3)
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;
scanf("%d", &a);
printf("%d", a+(a*a)+(a*a*a));
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129258/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129258/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%add = add nsw i32 %mul, %0
%mul2 = mul nsw i32 %mul, %0
%add3 = add nsw i32 %add, %mul2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add3)
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;
scanf("%d", &a);
printf("%d\n", a + a*a + a*a*a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129300/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129300/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%add = add nsw i32 %mul, %0
%mul2 = mul nsw i32 %mul, %0
%add3 = add nsw i32 %add, %mul2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a>=0 && a<=10){
int b=a+a*a+a*a*a;
printf("%d\n",b);
}
else{
printf("1<=a<=10で入力してください\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129344/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129344/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [36 x i8] c"1<=a<=10\E3\81\A7\E5\85\A5\E5\8A\9B\E3\81\97\E3\81\A6\E3\81\8F\E3\81\A0\E3\81\95\E3\81\84\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4
%or.cond = icmp ult i32 %0, 11
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nuw nsw i32 %0, %0
%add = add nuw nsw i32 %mul, %0
%mul3 = mul nuw nsw i32 %mul, %0
%add4 = add nuw nsw i32 %add, %mul3
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add4)
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 %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)"}
|
#include <stdio.h>
#include <math.h>
int main()
{
int a;
scanf("%d", &a);
printf("%d\n",a+(a*a)+(a*a*a));
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129388/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129388/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%add = add nsw i32 %mul, %0
%mul2 = mul nsw i32 %mul, %0
%add3 = add nsw i32 %add, %mul2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a;
scanf("%d",&a);
printf("%d\n",a+(a*a)+(a*a*a));
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129430/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129430/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%add = add nsw i32 %mul, %0
%mul2 = mul nsw i32 %mul, %0
%add3 = add nsw i32 %add, %mul2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3)
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,num;
a = 0;
num = 0;
while(1){
char buf[128];
fgets(buf, 128, stdin);
sscanf(buf, "%d", &a);
num = a + a*a + a*a*a;
printf("%d\n",num);
break;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129474/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129474/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [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
%buf = alloca [128 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %buf) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 128, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %a) #3
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%add = add nsw i32 %mul, %1
%mul4 = mul nsw i32 %mul, %1
%add5 = add nsw i32 %add, %mul4
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5)
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %buf) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
|
#include <stdio.h>
int main(void){
int a;
scanf("%d",&a );
printf("%d\n",a+a*a+a*a*a);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129517/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129517/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%add = add nsw i32 %mul, %0
%mul2 = mul nsw i32 %mul, %0
%add3 = add nsw i32 %add, %mul2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3)
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"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.