Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#define PI 3.14159265358979323846
int main(void) {
char S[4];
scanf("%s", &S);
int count1 = 0;
int count2 = 0;
int count3 = 0;
for (int i = 0; i < 3; i++) {
if (S[i] == 'a') {
count1++;
}
else if (S[i] == 'b') {
count2++;
}
else if (S[i] == 'c') {
count3++;
}
}
if (count1 == 1 && count2 == 1 && count3 == 1) {
printf("Yes");
}
else {
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176490/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176490/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@switch.table.main = private unnamed_addr constant [3 x i32] [i32 1, i32 0, i32 0], align 4
@switch.table.main.3 = private unnamed_addr constant [3 x i32] [i32 0, i32 1, i32 0], align 4
@switch.table.main.4 = private unnamed_addr constant [3 x i32] [i32 0, i32 0, i32 1], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i8, ptr %S, align 1, !tbaa !5
%switch.tableidx = add i8 %0, -97
%1 = icmp ult i8 %switch.tableidx, 3
br i1 %1, label %switch.lookup, label %for.inc
switch.lookup: ; preds = %entry
%2 = sext i8 %switch.tableidx to i64
%switch.gep = getelementptr inbounds [3 x i32], ptr @switch.table.main, i64 0, i64 %2
%switch.load = load i32, ptr %switch.gep, align 4
%3 = sext i8 %switch.tableidx to i64
%switch.gep46 = getelementptr inbounds [3 x i32], ptr @switch.table.main.3, i64 0, i64 %3
%switch.load47 = load i32, ptr %switch.gep46, align 4
%4 = sext i8 %switch.tableidx to i64
%switch.gep48 = getelementptr inbounds [3 x i32], ptr @switch.table.main.4, i64 0, i64 %4
%switch.load49 = load i32, ptr %switch.gep48, align 4
br label %for.inc
for.inc: ; preds = %switch.lookup, %entry
%count1.1 = phi i32 [ 0, %entry ], [ %switch.load, %switch.lookup ]
%count2.1 = phi i32 [ 0, %entry ], [ %switch.load47, %switch.lookup ]
%count3.1 = phi i32 [ 0, %entry ], [ %switch.load49, %switch.lookup ]
%arrayidx.1 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 1
%5 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
switch i8 %5, label %for.inc.1 [
i8 97, label %if.then.1
i8 98, label %if.then8.1
i8 99, label %if.then16.1
]
if.then16.1: ; preds = %for.inc
%inc17.1 = add nuw nsw i32 %count3.1, 1
br label %for.inc.1
if.then8.1: ; preds = %for.inc
%inc9.1 = add nuw nsw i32 %count2.1, 1
br label %for.inc.1
if.then.1: ; preds = %for.inc
%inc.1 = add nuw nsw i32 %count1.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.then8.1, %if.then16.1, %for.inc
%count1.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %count1.1, %if.then8.1 ], [ %count1.1, %if.then16.1 ], [ %count1.1, %for.inc ]
%count2.1.1 = phi i32 [ %count2.1, %if.then.1 ], [ %inc9.1, %if.then8.1 ], [ %count2.1, %if.then16.1 ], [ %count2.1, %for.inc ]
%count3.1.1 = phi i32 [ %count3.1, %if.then.1 ], [ %count3.1, %if.then8.1 ], [ %inc17.1, %if.then16.1 ], [ %count3.1, %for.inc ]
%arrayidx.2 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 2
%6 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
switch i8 %6, label %for.inc.2 [
i8 97, label %if.then.2
i8 98, label %if.then8.2
i8 99, label %if.then16.2
]
if.then16.2: ; preds = %for.inc.1
%inc17.2 = add nuw nsw i32 %count3.1.1, 1
br label %for.inc.2
if.then8.2: ; preds = %for.inc.1
%inc9.2 = add nuw nsw i32 %count2.1.1, 1
br label %for.inc.2
if.then.2: ; preds = %for.inc.1
%inc.2 = add nuw nsw i32 %count1.1.1, 1
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %if.then8.2, %if.then16.2, %for.inc.1
%count1.1.2 = phi i32 [ %inc.2, %if.then.2 ], [ %count1.1.1, %if.then8.2 ], [ %count1.1.1, %if.then16.2 ], [ %count1.1.1, %for.inc.1 ]
%count2.1.2 = phi i32 [ %count2.1.1, %if.then.2 ], [ %inc9.2, %if.then8.2 ], [ %count2.1.1, %if.then16.2 ], [ %count2.1.1, %for.inc.1 ]
%count3.1.2 = phi i32 [ %count3.1.1, %if.then.2 ], [ %count3.1.1, %if.then8.2 ], [ %inc17.2, %if.then16.2 ], [ %count3.1.1, %for.inc.1 ]
%cmp21 = icmp eq i32 %count1.1.2, 1
%cmp23 = icmp eq i32 %count2.1.2, 1
%or.cond = select i1 %cmp21, i1 %cmp23, i1 false
%cmp26 = icmp eq i32 %count3.1.2, 1
%or.cond33 = select i1 %or.cond, i1 %cmp26, i1 false
%.str.1..str.2 = select i1 %or.cond33, ptr @.str.1, ptr @.str.2
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
char s[4];
scanf("%s",s);
int a=0,b=0,c=0;
int i;
for(i=0;i<3;i++){
switch(s[i]){
case 'a':
a=1;
break;
case 'b':
b=1;
break;
case 'c':
c=1;
break;
}
}
if(a==1&&b==1&&c==1){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176577/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176577/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@switch.table.main = private unnamed_addr constant [3 x i32] [i32 1, i32 0, i32 0], align 4
@switch.table.main.4 = private unnamed_addr constant [3 x i32] [i32 0, i32 1, i32 0], align 4
@switch.table.main.5 = private unnamed_addr constant [3 x i32] [i32 0, i32 0, i32 1], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%switch.tableidx = add nsw i32 %conv, -97
%1 = icmp ult i32 %switch.tableidx, 3
br i1 %1, label %switch.lookup, label %for.inc
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%switch.gep = getelementptr inbounds [3 x i32], ptr @switch.table.main, i64 0, i64 %2
%switch.load = load i32, ptr %switch.gep, align 4
%3 = sext i32 %switch.tableidx to i64
%switch.gep21 = getelementptr inbounds [3 x i32], ptr @switch.table.main.4, i64 0, i64 %3
%switch.load22 = load i32, ptr %switch.gep21, align 4
%4 = sext i32 %switch.tableidx to i64
%switch.gep23 = getelementptr inbounds [3 x i32], ptr @switch.table.main.5, i64 0, i64 %4
%switch.load24 = load i32, ptr %switch.gep23, align 4
br label %for.inc
for.inc: ; preds = %switch.lookup, %entry
%a.1 = phi i32 [ 0, %entry ], [ %switch.load, %switch.lookup ]
%b.1 = phi i32 [ 0, %entry ], [ %switch.load22, %switch.lookup ]
%c.1 = phi i32 [ 0, %entry ], [ %switch.load24, %switch.lookup ]
%arrayidx.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%5 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.1 = sext i8 %5 to i32
switch i32 %conv.1, label %for.inc.1 [
i32 97, label %sw.bb.1
i32 98, label %sw.bb1.1
i32 99, label %sw.bb2.1
]
sw.bb2.1: ; preds = %for.inc
br label %for.inc.1
sw.bb1.1: ; preds = %for.inc
br label %for.inc.1
sw.bb.1: ; preds = %for.inc
br label %for.inc.1
for.inc.1: ; preds = %sw.bb.1, %sw.bb1.1, %sw.bb2.1, %for.inc
%a.1.1 = phi i32 [ %a.1, %for.inc ], [ %a.1, %sw.bb2.1 ], [ %a.1, %sw.bb1.1 ], [ 1, %sw.bb.1 ]
%b.1.1 = phi i32 [ %b.1, %for.inc ], [ %b.1, %sw.bb2.1 ], [ 1, %sw.bb1.1 ], [ %b.1, %sw.bb.1 ]
%c.1.1 = phi i32 [ %c.1, %for.inc ], [ 1, %sw.bb2.1 ], [ %c.1, %sw.bb1.1 ], [ %c.1, %sw.bb.1 ]
%arrayidx.2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%6 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%conv.2 = sext i8 %6 to i32
switch i32 %conv.2, label %for.inc.2 [
i32 97, label %sw.bb.2
i32 98, label %sw.bb1.2
i32 99, label %sw.bb2.2
]
sw.bb2.2: ; preds = %for.inc.1
br label %for.inc.2
sw.bb1.2: ; preds = %for.inc.1
br label %for.inc.2
sw.bb.2: ; preds = %for.inc.1
br label %for.inc.2
for.inc.2: ; preds = %sw.bb.2, %sw.bb1.2, %sw.bb2.2, %for.inc.1
%a.1.2 = phi i32 [ %a.1.1, %for.inc.1 ], [ %a.1.1, %sw.bb2.2 ], [ %a.1.1, %sw.bb1.2 ], [ 1, %sw.bb.2 ]
%b.1.2 = phi i32 [ %b.1.1, %for.inc.1 ], [ %b.1.1, %sw.bb2.2 ], [ 1, %sw.bb1.2 ], [ %b.1.1, %sw.bb.2 ]
%c.1.2 = phi i32 [ %c.1.1, %for.inc.1 ], [ 1, %sw.bb2.2 ], [ %c.1.1, %sw.bb1.2 ], [ %c.1.1, %sw.bb.2 ]
%cmp3 = icmp eq i32 %a.1.2, 1
%cmp5 = icmp eq i32 %b.1.2, 1
%or.cond = and i1 %cmp3, %cmp5
%cmp8 = icmp eq i32 %c.1.2, 1
%or.cond12 = and i1 %or.cond, %cmp8
%str.3.str = select i1 %or.cond12, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int m,n,z,i,ans;
while(scanf("%d %d %d",&n,&m,&z)!=EOF)
{
ans=0;
for(i=1;i<=z;i++)
{
if(i%n==0 && i%m==0)
ans++;
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17662/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17662/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%n = alloca i32, align 4
%z = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %z)
%cmp.not15 = icmp eq i32 %call14, -1
br i1 %cmp.not15, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%0 = load i32, ptr %z, align 4, !tbaa !5
%cmp1.not11 = icmp slt i32 %0, 1
br i1 %cmp1.not11, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %for.cond.preheader
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = load i32, ptr %m, align 4
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%ans.013 = phi i32 [ 0, %for.body.lr.ph ], [ %ans.1, %for.inc ]
%i.012 = phi i32 [ 1, %for.body.lr.ph ], [ %inc5, %for.inc ]
%rem = srem i32 %i.012, %1
%cmp2 = icmp eq i32 %rem, 0
br i1 %cmp2, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%rem3 = srem i32 %i.012, %2
%cmp4 = icmp eq i32 %rem3, 0
%inc = zext i1 %cmp4 to i32
%spec.select = add nsw i32 %ans.013, %inc
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body
%ans.1 = phi i32 [ %ans.013, %for.body ], [ %spec.select, %land.lhs.true ]
%inc5 = add nuw i32 %i.012, 1
%exitcond.not = icmp eq i32 %i.012, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc, %for.cond.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %ans.1, %for.inc ]
%call6 = 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 %n, ptr noundef nonnull %m, ptr noundef nonnull %z)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<string.h>
int main(void){
char a[4];
scanf("%s",a);
if(a[0]=='a'||a[0]=='b'||a[0]=='c'){
if((a[1]=='a'||a[1]=='b'||a[1]=='c')&&(a[1]!=a[0])){
if((a[2]=='a'||a[2]=='b'||a[2]=='c')&&(a[2]!=a[0])&&(a[2]!=a[1])){
printf("Yes\n");
}
else{
printf("No\n");
}
}
else{
printf("No\n");
}
}
else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176663/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176663/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x i8], align 1
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 i8, ptr %a, align 1
%1 = add i8 %0, -97
%or.cond69 = icmp ult i8 %1, 3
br i1 %or.cond69, label %if.then, label %if.end68
if.then: ; preds = %entry
%arrayidx11 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 1
%2 = load i8, ptr %arrayidx11, align 1
%3 = add i8 %2, -100
%or.cond71 = icmp ult i8 %3, -3
%cmp29.not = icmp eq i8 %2, %0
%or.cond = or i1 %cmp29.not, %or.cond71
br i1 %or.cond, label %if.end68, label %if.then31
if.then31: ; preds = %if.then
%arrayidx32 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 2
%4 = load i8, ptr %arrayidx32, align 1
%5 = add i8 %4, -100
%or.cond73 = icmp ult i8 %5, -3
%cmp51.not = icmp eq i8 %4, %0
%or.cond77 = or i1 %cmp51.not, %or.cond73
%cmp58.not = icmp eq i8 %4, %2
%or.cond78 = or i1 %cmp58.not, %or.cond77
%str.4.str.5 = select i1 %or.cond78, ptr @str.4, ptr @str.5
br label %if.end68
if.end68: ; preds = %entry, %if.then, %if.then31
%str.3.sink = phi ptr [ %str.4.str.5, %if.then31 ], [ @str.4, %if.then ], [ @str.4, %entry ]
%puts74 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
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)"}
|
#include <stdio.h>
int main()
{
char s[4];
scanf("%s", s);
if(s[0]==s[1] || s[0]==s[2] || s[1]==s[2])
printf("No\n");
else
printf("Yes\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176720/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176720/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%arrayidx6 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8 = icmp eq i8 %0, %2
%cmp15 = icmp eq i8 %1, %2
%or.cond = or i1 %cmp8, %cmp15
%spec.select = select i1 %or.cond, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ %spec.select, %lor.lhs.false ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define LINE_BUF_SIZE 256
int main(){
int M,N,A,B,C;
int i,j,k;
char line[LINE_BUF_SIZE];
fgets(line,sizeof(line),stdin);
if(strncmp(line,"abc",3) == 0 || strncmp(line,"bac",3) == 0 || strncmp(line,"acb",3) == 0 || strncmp(line,"cab",3) == 0 || strncmp(line,"cba",3) == 0 || strncmp(line,"bca",3) == 0){
printf("Yes");
return 0;
}
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176771/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176771/source.c"
target datalayout = "e-m:e-p270: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"abc\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"bac\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"acb\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"cab\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"cba\00", align 1
@.str.5 = private unnamed_addr constant [4 x i8] c"bca\00", align 1
@.str.6 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.7 = 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:
%line = alloca [256 x i8], align 16
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %line) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 256, ptr noundef %0)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %line, ptr noundef nonnull dereferenceable(3) @.str, i64 3)
%cmp = icmp eq i32 %bcmp, 0
br i1 %cmp, label %cleanup, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%bcmp32 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %line, ptr noundef nonnull dereferenceable(3) @.str.1, i64 3)
%cmp5 = icmp eq i32 %bcmp32, 0
br i1 %cmp5, label %cleanup, label %lor.lhs.false6
lor.lhs.false6: ; preds = %lor.lhs.false
%bcmp33 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %line, ptr noundef nonnull dereferenceable(3) @.str.2, i64 3)
%cmp9 = icmp eq i32 %bcmp33, 0
br i1 %cmp9, label %cleanup, label %lor.lhs.false10
lor.lhs.false10: ; preds = %lor.lhs.false6
%bcmp34 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %line, ptr noundef nonnull dereferenceable(3) @.str.3, i64 3)
%cmp13 = icmp eq i32 %bcmp34, 0
br i1 %cmp13, label %cleanup, label %lor.lhs.false14
lor.lhs.false14: ; preds = %lor.lhs.false10
%bcmp35 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %line, ptr noundef nonnull dereferenceable(3) @.str.4, i64 3)
%cmp17 = icmp eq i32 %bcmp35, 0
br i1 %cmp17, label %cleanup, label %lor.lhs.false18
lor.lhs.false18: ; preds = %lor.lhs.false14
%bcmp36 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %line, ptr noundef nonnull dereferenceable(3) @.str.5, i64 3)
%cmp21 = icmp eq i32 %bcmp36, 0
%spec.select = select i1 %cmp21, ptr @.str.6, ptr @.str.7
br label %cleanup
cleanup: ; preds = %lor.lhs.false18, %entry, %lor.lhs.false, %lor.lhs.false6, %lor.lhs.false10, %lor.lhs.false14
%.str.7.sink = phi ptr [ @.str.6, %lor.lhs.false14 ], [ @.str.6, %lor.lhs.false10 ], [ @.str.6, %lor.lhs.false6 ], [ @.str.6, %lor.lhs.false ], [ @.str.6, %entry ], [ %spec.select, %lor.lhs.false18 ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7.sink)
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %line) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
long gcdf(long a,long b){
long p = a;
long q = b;
long c = 0;
c = a%b;
while(c != 0){
p = q;
q = c;
c = p%q;
}
return q;
}
int main(){
long n=0;
long a[100000] = {};
long i = 0;
long gcd = 0;
scanf("%ld",&n);
for(i=0;i<n;i++){
scanf("%ld",&a[i]);
}
for(i=0;i<n;i++){
if(i==0){
gcd = a[i];
}else{
gcd = gcdf(gcd,a[i]);
}
}
printf("%ld",gcd);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176814/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176814/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcdf(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%rem = srem i64 %a, %b
%cmp.not7 = icmp eq i64 %rem, 0
br i1 %cmp.not7, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%c.09 = phi i64 [ %rem1, %while.body ], [ %rem, %entry ]
%q.08 = phi i64 [ %c.09, %while.body ], [ %b, %entry ]
%rem1 = srem i64 %q.08, %c.09
%cmp.not = icmp eq i64 %rem1, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%q.0.lcssa = phi i64 [ %b, %entry ], [ %c.09, %while.body ]
ret i64 %q.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
%a = alloca [100000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
store i64 0, ptr %n, align 8, !tbaa !7
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) %a, i8 0, i64 800000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !7
%cmp21 = icmp sgt i64 %0, 0
br i1 %cmp21, label %for.body, label %for.end11
for.cond2.preheader: ; preds = %for.body
%cmp323 = icmp sgt i64 %2, 0
br i1 %cmp323, label %for.body4.lr.ph, label %for.end11
for.body4.lr.ph: ; preds = %for.cond2.preheader
%1 = load i64, ptr %a, align 16
br label %for.body4
for.body: ; preds = %entry, %for.body
%i.022 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %i.022
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.022, 1
%2 = load i64, ptr %n, align 8, !tbaa !7
%cmp = icmp slt i64 %inc, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !11
for.body4: ; preds = %for.body4.lr.ph, %for.inc9
%gcd.025 = phi i64 [ 0, %for.body4.lr.ph ], [ %gcd.1, %for.inc9 ]
%i.124 = phi i64 [ 0, %for.body4.lr.ph ], [ %inc10, %for.inc9 ]
%cmp5 = icmp eq i64 %i.124, 0
br i1 %cmp5, label %for.inc9, label %if.else
if.else: ; preds = %for.body4
%arrayidx7 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %i.124
%3 = load i64, ptr %arrayidx7, align 8, !tbaa !7
%rem.i = srem i64 %gcd.025, %3
%cmp.not7.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not7.i, label %for.inc9, label %while.body.i
while.body.i: ; preds = %if.else, %while.body.i
%c.09.i = phi i64 [ %rem1.i, %while.body.i ], [ %rem.i, %if.else ]
%q.08.i = phi i64 [ %c.09.i, %while.body.i ], [ %3, %if.else ]
%rem1.i = srem i64 %q.08.i, %c.09.i
%cmp.not.i = icmp eq i64 %rem1.i, 0
br i1 %cmp.not.i, label %for.inc9, label %while.body.i, !llvm.loop !5
for.inc9: ; preds = %while.body.i, %for.body4, %if.else
%gcd.1 = phi i64 [ %3, %if.else ], [ %1, %for.body4 ], [ %c.09.i, %while.body.i ]
%inc10 = add nuw nsw i64 %i.124, 1
%exitcond.not = icmp eq i64 %inc10, %2
br i1 %exitcond.not, label %for.end11, label %for.body4, !llvm.loop !12
for.end11: ; preds = %for.inc9, %entry, %for.cond2.preheader
%gcd.0.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %gcd.1, %for.inc9 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %gcd.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
|
#include <stdio.h>
#include <stdlib.h>
int Findgcd_by_Euclid(int a, int b);
int main()
{
int monster;
int d;
int i;
int gcd = 0;
scanf("%d", &d);
for (i = 0; i < d; i++)
{
scanf("%d", &monster);
gcd = Findgcd_by_Euclid(gcd ,monster);
}
printf("%d\n", gcd);
return 0;
}
int Findgcd_by_Euclid(int a, int b)
{
int c;
while (b)
{
c = a % b;
a = b;
b = c;
}
return a;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176858/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176858/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%monster = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %monster) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%0 = load i32, ptr %d, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body, label %for.end
for.body: ; preds = %entry, %Findgcd_by_Euclid.exit
%gcd.08 = phi i32 [ %a.addr.0.lcssa.i, %Findgcd_by_Euclid.exit ], [ 0, %entry ]
%i.07 = phi i32 [ %inc, %Findgcd_by_Euclid.exit ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %monster)
%1 = load i32, ptr %monster, align 4, !tbaa !5
%tobool.not4.i = icmp eq i32 %1, 0
br i1 %tobool.not4.i, label %Findgcd_by_Euclid.exit, label %while.body.i
while.body.i: ; preds = %for.body, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %gcd.08, %for.body ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %1, %for.body ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.i
%tobool.not.i = icmp eq i32 %rem.i, 0
br i1 %tobool.not.i, label %Findgcd_by_Euclid.exit, label %while.body.i, !llvm.loop !9
Findgcd_by_Euclid.exit: ; preds = %while.body.i, %for.body
%a.addr.0.lcssa.i = phi i32 [ %gcd.08, %for.body ], [ %b.addr.05.i, %while.body.i ]
%inc = add nuw nsw i32 %i.07, 1
%2 = load i32, ptr %d, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %Findgcd_by_Euclid.exit, %entry
%gcd.0.lcssa = phi i32 [ 0, %entry ], [ %a.addr.0.lcssa.i, %Findgcd_by_Euclid.exit ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %gcd.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %monster) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @Findgcd_by_Euclid(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%tobool.not4 = icmp eq i32 %b, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int gcd(int a, int b){
while(1){
if(a>b)a%=b;
else b%=a;
if(a==0)return b;
if(b==0)return a;
}
}
int main(void){
int n,i,e=0,o=0,r,g=0;
scanf("%d",&n);
int a;
for(i=0;i<n;i++){
scanf("%d",&a);
if(a==1){
printf("1");
return 0;
}
else{
if(g)g=gcd(a,g);else g=a;
if(a%2){
if(a!=o&&o){o=-1;}
else o=a;
}
else if(a!=e&&e){e=-1;}
else e=a;
}
}
if(g>1) r=g;
else if(o&&e)r=1;
else if(o==-1)r=1;
else if(e==-1)r=2;
else r=(e>o)?e:o;
printf("%d",r);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176900/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176900/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
br label %while.body
while.body: ; preds = %if.end4, %entry
%a.addr.0 = phi i32 [ %a, %entry ], [ %a.addr.1, %if.end4 ]
%b.addr.0 = phi i32 [ %b, %entry ], [ %b.addr.1, %if.end4 ]
%cmp = icmp sgt i32 %a.addr.0, %b.addr.0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %while.body
%rem = srem i32 %a.addr.0, %b.addr.0
br label %if.end
if.else: ; preds = %while.body
%rem1 = srem i32 %b.addr.0, %a.addr.0
br label %if.end
if.end: ; preds = %if.else, %if.then
%a.addr.1 = phi i32 [ %rem, %if.then ], [ %a.addr.0, %if.else ]
%b.addr.1 = phi i32 [ %b.addr.0, %if.then ], [ %rem1, %if.else ]
%cmp2 = icmp eq i32 %a.addr.1, 0
br i1 %cmp2, label %return, label %if.end4
if.end4: ; preds = %if.end
%cmp5 = icmp eq i32 %b.addr.1, 0
br i1 %cmp5, label %return, label %while.body
return: ; preds = %if.end4, %if.end
%retval.0 = phi i32 [ %b.addr.1, %if.end ], [ %a.addr.1, %if.end4 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp70 = icmp sgt i32 %0, 0
br i1 %cmp70, label %for.body, label %if.else36
for.body: ; preds = %entry, %for.inc
%g.074 = phi i32 [ %g.1, %for.inc ], [ 0, %entry ]
%o.073 = phi i32 [ %o.1, %for.inc ], [ 0, %entry ]
%e.072 = phi i32 [ %e.1, %for.inc ], [ 0, %entry ]
%i.071 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp eq i32 %1, 1
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.body
%putchar = call i32 @putchar(i32 49)
br label %cleanup
if.else: ; preds = %for.body
%tobool.not = icmp eq i32 %g.074, 0
br i1 %tobool.not, label %if.end, label %while.body.i
while.body.i: ; preds = %if.else, %if.end4.i
%a.addr.0.i = phi i32 [ %a.addr.1.i, %if.end4.i ], [ %1, %if.else ]
%b.addr.0.i = phi i32 [ %b.addr.1.i, %if.end4.i ], [ %g.074, %if.else ]
%cmp.i = icmp sgt i32 %a.addr.0.i, %b.addr.0.i
br i1 %cmp.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %while.body.i
%rem.i = srem i32 %a.addr.0.i, %b.addr.0.i
br label %if.end.i
if.else.i: ; preds = %while.body.i
%rem1.i = srem i32 %b.addr.0.i, %a.addr.0.i
br label %if.end.i
if.end.i: ; preds = %if.else.i, %if.then.i
%a.addr.1.i = phi i32 [ %rem.i, %if.then.i ], [ %a.addr.0.i, %if.else.i ]
%b.addr.1.i = phi i32 [ %b.addr.0.i, %if.then.i ], [ %rem1.i, %if.else.i ]
%cmp2.i = icmp eq i32 %a.addr.1.i, 0
br i1 %cmp2.i, label %if.end, label %if.end4.i
if.end4.i: ; preds = %if.end.i
%cmp5.i = icmp eq i32 %b.addr.1.i, 0
br i1 %cmp5.i, label %if.end, label %while.body.i
if.end: ; preds = %if.end4.i, %if.end.i, %if.else
%g.1 = phi i32 [ %1, %if.else ], [ %a.addr.1.i, %if.end4.i ], [ %b.addr.1.i, %if.end.i ]
%2 = and i32 %1, 1
%tobool7.not = icmp eq i32 %2, 0
br i1 %tobool7.not, label %if.else14, label %if.then8
if.then8: ; preds = %if.end
%cmp9 = icmp ne i32 %1, %o.073
%tobool10 = icmp ne i32 %o.073, 0
%or.cond = and i1 %tobool10, %cmp9
%. = select i1 %or.cond, i32 -1, i32 %1
br label %for.inc
if.else14: ; preds = %if.end
%cmp15 = icmp ne i32 %1, %e.072
%tobool17 = icmp ne i32 %e.072, 0
%or.cond49 = and i1 %tobool17, %cmp15
%.65 = select i1 %or.cond49, i32 -1, i32 %1
br label %for.inc
for.inc: ; preds = %if.else14, %if.then8
%e.1 = phi i32 [ %e.072, %if.then8 ], [ %.65, %if.else14 ]
%o.1 = phi i32 [ %., %if.then8 ], [ %o.073, %if.else14 ]
%inc = add nuw nsw i32 %i.071, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc
%cmp23 = icmp sgt i32 %g.1, 1
br i1 %cmp23, label %if.end41, label %if.else25
if.else25: ; preds = %for.end
%tobool26 = icmp ne i32 %o.1, 0
%tobool28 = icmp ne i32 %e.1, 0
%or.cond50 = select i1 %tobool26, i1 %tobool28, i1 false
%cmp31 = icmp eq i32 %o.1, -1
%or.cond66 = or i1 %cmp31, %or.cond50
br i1 %or.cond66, label %if.end41, label %if.else33
if.else33: ; preds = %if.else25
%cmp34 = icmp eq i32 %e.1, -1
br i1 %cmp34, label %if.end41, label %if.else36
if.else36: ; preds = %entry, %if.else33
%o.0.lcssa829096 = phi i32 [ %o.1, %if.else33 ], [ 0, %entry ]
%e.0.lcssa819195 = phi i32 [ %e.1, %if.else33 ], [ 0, %entry ]
%cond = call i32 @llvm.smax.i32(i32 %e.0.lcssa819195, i32 %o.0.lcssa829096)
br label %if.end41
if.end41: ; preds = %if.else33, %if.else25, %for.end, %if.else36
%r.0 = phi i32 [ %cond, %if.else36 ], [ %g.1, %for.end ], [ 1, %if.else25 ], [ 2, %if.else33 ]
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %r.0)
br label %cleanup
cleanup: ; preds = %if.end41, %if.then
call void @llvm.lifetime.end.p0(i64 4, 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 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) #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#define ll long long int
#define lim 100010
#define INF 1e9
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define ABS(x) ((x)>0?(x):-(x))
typedef struct{
ll dX,dY;
}P;
int main(void){
int n;
scanf("%d",&n);
ll x[n],y[n];
P diff[2500];
for(int i=0;i<n;i++){
scanf("%lld%lld",&x[i],&y[i]);
}
int c=0;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(i==j)continue;
diff[c].dX = x[i]-x[j];
diff[c++].dY = y[i]-y[j];
}
}
int cMAX =c;
c=0;
int ans=0;
while(c<cMAX){
int num=0;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(j==i)continue;
if(x[i]-x[j]==diff[c].dX && y[i]-y[j]==diff[c].dY)num++;
}
}
c++;
ans = MAX(ans,num);
}
if(ans==n)printf("1");
else printf("%d",n-ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176951/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176951/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.P = type { i64, i64 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%diff = alloca [2500 x %struct.P], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i64, i64 %4, align 16
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %diff) #6
%cmp114 = icmp sgt i32 %3, 0
br i1 %cmp114, label %for.body, label %while.end
for.cond6.preheader: ; preds = %for.body
%cmp7120 = icmp slt i32 %9, 1
br i1 %cmp7120, label %while.end, label %for.cond10.preheader.us.preheader
for.cond10.preheader.us.preheader: ; preds = %for.cond6.preheader
%wide.trip.count147 = zext i32 %9 to i64
br label %for.cond10.preheader.us
for.cond10.preheader.us: ; preds = %for.cond10.preheader.us.preheader, %for.cond10.for.cond.cleanup12_crit_edge.us
%indvars.iv144 = phi i64 [ 0, %for.cond10.preheader.us.preheader ], [ %indvars.iv.next145, %for.cond10.for.cond.cleanup12_crit_edge.us ]
%c.0121.us = phi i32 [ 0, %for.cond10.preheader.us.preheader ], [ %c.2.us, %for.cond10.for.cond.cleanup12_crit_edge.us ]
%arrayidx16.us = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv144
%arrayidx22.us = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv144
br label %for.body13.us
for.body13.us: ; preds = %for.cond10.preheader.us, %for.inc29.us
%indvars.iv141 = phi i64 [ 0, %for.cond10.preheader.us ], [ %indvars.iv.next142, %for.inc29.us ]
%c.1117.us = phi i32 [ %c.0121.us, %for.cond10.preheader.us ], [ %c.2.us, %for.inc29.us ]
%cmp14.us = icmp eq i64 %indvars.iv144, %indvars.iv141
br i1 %cmp14.us, label %for.inc29.us, label %if.end.us
if.end.us: ; preds = %for.body13.us
%5 = load i64, ptr %arrayidx16.us, align 8, !tbaa !9
%arrayidx18.us = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv141
%6 = load i64, ptr %arrayidx18.us, align 8, !tbaa !9
%sub.us = sub nsw i64 %5, %6
%idxprom19.us = sext i32 %c.1117.us to i64
%arrayidx20.us = getelementptr inbounds [2500 x %struct.P], ptr %diff, i64 0, i64 %idxprom19.us
store i64 %sub.us, ptr %arrayidx20.us, align 16, !tbaa !11
%7 = load i64, ptr %arrayidx22.us, align 8, !tbaa !9
%arrayidx24.us = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv141
%8 = load i64, ptr %arrayidx24.us, align 8, !tbaa !9
%sub25.us = sub nsw i64 %7, %8
%inc26.us = add nsw i32 %c.1117.us, 1
%dY.us = getelementptr inbounds [2500 x %struct.P], ptr %diff, i64 0, i64 %idxprom19.us, i32 1
store i64 %sub25.us, ptr %dY.us, align 8, !tbaa !13
br label %for.inc29.us
for.inc29.us: ; preds = %if.end.us, %for.body13.us
%c.2.us = phi i32 [ %c.1117.us, %for.body13.us ], [ %inc26.us, %if.end.us ]
%indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
%exitcond.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count147
br i1 %exitcond.not, label %for.cond10.for.cond.cleanup12_crit_edge.us, label %for.body13.us, !llvm.loop !14
for.cond10.for.cond.cleanup12_crit_edge.us: ; preds = %for.inc29.us
%indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
%exitcond148.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count147
br i1 %exitcond148.not, label %while.cond.preheader, label %for.cond10.preheader.us, !llvm.loop !16
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%arrayidx3 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !17
while.cond.preheader: ; preds = %for.cond10.for.cond.cleanup12_crit_edge.us
%cmp35133 = icmp slt i32 %c.2.us, 1
%brmerge = or i1 %cmp35133, %cmp7120
br i1 %brmerge, label %while.end, label %for.cond37.preheader.us.preheader
for.cond37.preheader.us.preheader: ; preds = %while.cond.preheader
%wide.trip.count162 = zext i32 %c.2.us to i64
%wide.trip.count157 = zext i32 %9 to i64
br label %for.cond37.preheader.us
for.cond37.preheader.us: ; preds = %for.cond37.preheader.us.preheader, %for.cond37.for.cond.cleanup39_crit_edge.split.us.us
%indvars.iv159 = phi i64 [ 0, %for.cond37.preheader.us.preheader ], [ %indvars.iv.next160, %for.cond37.for.cond.cleanup39_crit_edge.split.us.us ]
%ans.0135.us = phi i32 [ 0, %for.cond37.preheader.us.preheader ], [ %cond.us, %for.cond37.for.cond.cleanup39_crit_edge.split.us.us ]
%arrayidx55.us = getelementptr inbounds [2500 x %struct.P], ptr %diff, i64 0, i64 %indvars.iv159
%dY65.us = getelementptr inbounds [2500 x %struct.P], ptr %diff, i64 0, i64 %indvars.iv159, i32 1
br label %for.cond42.preheader.us.us
for.cond42.preheader.us.us: ; preds = %for.cond42.for.cond.cleanup44_crit_edge.us.us, %for.cond37.preheader.us
%indvars.iv154 = phi i64 [ %indvars.iv.next155, %for.cond42.for.cond.cleanup44_crit_edge.us.us ], [ 0, %for.cond37.preheader.us ]
%num.0129.us.us = phi i32 [ %num.2.us.us, %for.cond42.for.cond.cleanup44_crit_edge.us.us ], [ 0, %for.cond37.preheader.us ]
%arrayidx50.us.us = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv154
%arrayidx59.us.us = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv154
br label %for.body45.us.us
for.body45.us.us: ; preds = %for.inc70.us.us, %for.cond42.preheader.us.us
%indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.inc70.us.us ], [ 0, %for.cond42.preheader.us.us ]
%num.1125.us.us = phi i32 [ %num.2.us.us, %for.inc70.us.us ], [ %num.0129.us.us, %for.cond42.preheader.us.us ]
%cmp46.us.us = icmp eq i64 %indvars.iv149, %indvars.iv154
br i1 %cmp46.us.us, label %for.inc70.us.us, label %if.end48.us.us
if.end48.us.us: ; preds = %for.body45.us.us
%11 = load i64, ptr %arrayidx50.us.us, align 8, !tbaa !9
%arrayidx52.us.us = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv149
%12 = load i64, ptr %arrayidx52.us.us, align 8, !tbaa !9
%sub53.us.us = sub nsw i64 %11, %12
%13 = load i64, ptr %arrayidx55.us, align 16, !tbaa !11
%cmp57.us.us = icmp eq i64 %sub53.us.us, %13
br i1 %cmp57.us.us, label %land.lhs.true.us.us, label %for.inc70.us.us
land.lhs.true.us.us: ; preds = %if.end48.us.us
%14 = load i64, ptr %arrayidx59.us.us, align 8, !tbaa !9
%arrayidx61.us.us = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv149
%15 = load i64, ptr %arrayidx61.us.us, align 8, !tbaa !9
%sub62.us.us = sub nsw i64 %14, %15
%16 = load i64, ptr %dY65.us, align 8, !tbaa !13
%cmp66.us.us = icmp eq i64 %sub62.us.us, %16
%inc68.us.us = zext i1 %cmp66.us.us to i32
%spec.select.us.us = add nsw i32 %num.1125.us.us, %inc68.us.us
br label %for.inc70.us.us
for.inc70.us.us: ; preds = %land.lhs.true.us.us, %if.end48.us.us, %for.body45.us.us
%num.2.us.us = phi i32 [ %num.1125.us.us, %for.body45.us.us ], [ %num.1125.us.us, %if.end48.us.us ], [ %spec.select.us.us, %land.lhs.true.us.us ]
%indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
%exitcond153.not = icmp eq i64 %indvars.iv.next150, %wide.trip.count157
br i1 %exitcond153.not, label %for.cond42.for.cond.cleanup44_crit_edge.us.us, label %for.body45.us.us, !llvm.loop !18
for.cond42.for.cond.cleanup44_crit_edge.us.us: ; preds = %for.inc70.us.us
%indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
%exitcond158.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count157
br i1 %exitcond158.not, label %for.cond37.for.cond.cleanup39_crit_edge.split.us.us, label %for.cond42.preheader.us.us, !llvm.loop !19
for.cond37.for.cond.cleanup39_crit_edge.split.us.us: ; preds = %for.cond42.for.cond.cleanup44_crit_edge.us.us
%indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
%cond.us = call i32 @llvm.smax.i32(i32 %ans.0135.us, i32 %num.2.us.us)
%exitcond163.not = icmp eq i64 %indvars.iv.next160, %wide.trip.count162
br i1 %exitcond163.not, label %while.end, label %for.cond37.preheader.us, !llvm.loop !20
while.end: ; preds = %for.cond37.for.cond.cleanup39_crit_edge.split.us.us, %while.cond.preheader, %entry, %for.cond6.preheader
%.lcssa166172 = phi i32 [ %9, %while.cond.preheader ], [ %9, %for.cond6.preheader ], [ %3, %entry ], [ %9, %for.cond37.for.cond.cleanup39_crit_edge.split.us.us ]
%ans.0.lcssa = phi i32 [ 0, %while.cond.preheader ], [ 0, %for.cond6.preheader ], [ 0, %entry ], [ %cond.us, %for.cond37.for.cond.cleanup39_crit_edge.split.us.us ]
%cmp78 = icmp eq i32 %ans.0.lcssa, %.lcssa166172
br i1 %cmp78, label %if.then79, label %if.else
if.then79: ; preds = %while.end
%putchar = call i32 @putchar(i32 49)
br label %if.end83
if.else: ; preds = %while.end
%sub81 = sub nsw i32 %.lcssa166172, %ans.0.lcssa
%call82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub81)
br label %if.end83
if.end83: ; preds = %if.else, %if.then79
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %diff) #6
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
|
// AOJ 0623: Zombie Island
// 2017.11.18 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define QMAX 200000
typedef struct { int node; long long t; } QUE;
QUE que[QMAX]; int qsize;
#define PARENT(i) ((i)>>1)
#define LEFT(i) ((i)<<1)
#define RIGHT(i) (((i)<<1)+1)
void min_heapify(int i)
{
int l, r, min;
QUE qt;
l = LEFT(i), r = RIGHT(i);
if (l < qsize && que[l].t < que[i].t) min = l; else min = i;
if (r < qsize && que[r].t < que[min].t) min = r;
if (min != i) {
qt = que[i], que[i] = que[min], que[min] = qt;
min_heapify(min);
}
}
void deq()
{
// if (qsize == 0) return 0;
// *n = que[0].node, *t = que[0].t, *c = que[0].c;
que[0] = que[--qsize];
min_heapify(0);
// return 1;
}
void enq(int n, long long t)
{
int i, min;
QUE qt;
i = qsize++;
que[i].node = n, que[i].t = t;
while (i > 0 && que[min = PARENT(i)].t > que[i].t) {
qt = que[i], que[i] = que[min], que[min] = qt;
i = min;
}
}
#define MAX 100000
typedef struct { int len, to[20]; } TBL;
TBL tbl[MAX+1];
int len[MAX+1];
int zombie[MAX+1];
char visited[MAX+1];
int N, S, P, Q;
void dijkstra1()
{
int i, s, e, d;
while (qsize) {
s = que[0].node, d = (int)que[0].t, deq();
if (visited[s]) continue;
visited[s] = 1;
zombie[s] = d;
for (i = 0; i < len[s]; i++) {
e = tbl[s].to[i];
if (visited[e]) continue;
enq(e, d+1);
}
}
}
long long fee[MAX+1];
long long dijkstra2(int start, int goal)
{
int i, s, e;
long long d = 0;
qsize = 0;
for (i = 0; i < N; i++) visited[i] = (zombie[i] == 0);
enq(start, 0);
while (qsize) {
s = que[0].node, d = que[0].t, deq();
if (s == goal) break;
if (visited[s]) continue;
visited[s] = 1;
for (i = 0; i < len[s]; i++) {
e = tbl[s].to[i];
if (visited[e]) continue;
if (e == goal) enq(e, d);
else if (zombie[e] <= S) enq(e, d+Q);
else enq(e, d+P);
}
}
return d;
}
char buf[40], *p;
int getint()
{
int n = 0;
while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
return n;
}
int main()
{
int M, K, i, a, b, c;
fgets(p=buf, 40, stdin);
N = getint(), p++, M = getint(), p++, K = getint(), p++, S = getint();
fgets(p=buf, 40, stdin);
P = getint(), p++, Q = getint();
qsize = 0;
for (i = 0; i < K; i++) {
fgets(p=buf, 40, stdin);
c = getint()-1, enq(c, 0);
}
for (i = 0; i < M; i++) {
fgets(p=buf, 40, stdin);
a = getint()-1, p++, b = getint()-1;
tbl[a].to[len[a]++] = b;
tbl[b].to[len[b]++] = a;
}
dijkstra1();
printf("%lld\n", dijkstra2(0, N-1));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176995/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176995/source.c"
target datalayout = "e-m:e-p270: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.QUE = type { i32, i64 }
%struct.TBL = type { i32, [20 x i32] }
@qsize = dso_local local_unnamed_addr global i32 0, align 4
@que = dso_local local_unnamed_addr global [200000 x %struct.QUE] zeroinitializer, align 16
@visited = dso_local local_unnamed_addr global [100001 x i8] zeroinitializer, align 16
@zombie = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@len = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@tbl = dso_local local_unnamed_addr global [100001 x %struct.TBL] zeroinitializer, align 16
@N = dso_local local_unnamed_addr global i32 0, align 4
@S = dso_local local_unnamed_addr global i32 0, align 4
@Q = dso_local local_unnamed_addr global i32 0, align 4
@P = dso_local local_unnamed_addr global i32 0, align 4
@p = dso_local local_unnamed_addr global ptr null, align 8
@buf = dso_local global [40 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@fee = dso_local local_unnamed_addr global [100001 x i64] zeroinitializer, align 16
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @min_heapify(i32 noundef %i) local_unnamed_addr #0 {
entry:
%qt = alloca %struct.QUE, align 8
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %qt)
%shl = shl i32 %i, 1
%add = or i32 %shl, 1
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%cmp = icmp slt i32 %shl, %0
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%idxprom = sext i32 %shl to i64
%t = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1
%1 = load i64, ptr %t, align 8, !tbaa !9
%idxprom2 = sext i32 %i to i64
%t4 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2, i32 1
%2 = load i64, ptr %t4, align 8, !tbaa !9
%cmp5 = icmp slt i64 %1, %2
br i1 %cmp5, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%min.0 = phi i32 [ %i, %if.else ], [ %shl, %land.lhs.true ]
%cmp6 = icmp slt i32 %add, %0
br i1 %cmp6, label %land.lhs.true7, label %if.end16
land.lhs.true7: ; preds = %if.end
%idxprom8 = sext i32 %add to i64
%t10 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8, i32 1
%3 = load i64, ptr %t10, align 8, !tbaa !9
%idxprom11 = sext i32 %min.0 to i64
%t13 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11, i32 1
%4 = load i64, ptr %t13, align 8, !tbaa !9
%cmp14 = icmp slt i64 %3, %4
%spec.select = select i1 %cmp14, i32 %add, i32 %min.0
br label %if.end16
if.end16: ; preds = %land.lhs.true7, %if.end
%min.1 = phi i32 [ %min.0, %if.end ], [ %spec.select, %land.lhs.true7 ]
%cmp17.not = icmp eq i32 %min.1, %i
br i1 %cmp17.not, label %if.end27, label %if.then18
if.then18: ; preds = %if.end16
%idxprom19 = sext i32 %i to i64
%arrayidx20 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %qt, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx20, i64 16, i1 false), !tbaa.struct !12
%idxprom23 = sext i32 %min.1 to i64
%arrayidx24 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx20, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx24, i64 16, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx24, ptr noundef nonnull align 8 dereferenceable(16) %qt, i64 16, i1 false), !tbaa.struct !12
tail call void @min_heapify(i32 noundef %min.1)
br label %if.end27
if.end27: ; preds = %if.then18, %if.end16
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %qt)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @deq() local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @que, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx, i64 16, i1 false), !tbaa.struct !12
tail call void @min_heapify(i32 noundef 0)
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @enq(i32 noundef %n, i64 noundef %t) local_unnamed_addr #0 {
entry:
%qt = alloca %struct.QUE, align 8
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %qt)
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
store i32 %n, ptr %arrayidx, align 16, !tbaa !14
%t3 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1
store i64 %t, ptr %t3, align 8, !tbaa !9
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %land.rhs, label %while.end
land.rhs: ; preds = %entry, %while.body
%i.028 = phi i32 [ %shr, %while.body ], [ %0, %entry ]
%shr = lshr i32 %i.028, 1
%idxprom4 = zext i32 %shr to i64
%t6 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4, i32 1
%1 = load i64, ptr %t6, align 8, !tbaa !9
%idxprom7 = zext i32 %i.028 to i64
%t9 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7, i32 1
%2 = load i64, ptr %t9, align 8, !tbaa !9
%cmp10 = icmp sgt i64 %1, %2
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx8 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7
%arrayidx5 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %qt, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8, i64 16, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5, i64 16, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5, ptr noundef nonnull align 8 dereferenceable(16) %qt, i64 16, i1 false), !tbaa.struct !12
%cmp.not = icmp ult i32 %i.028, 2
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !15
while.end: ; preds = %land.rhs, %while.body, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %qt)
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @dijkstra1() local_unnamed_addr #3 {
entry:
%qt.i = alloca %struct.QUE, align 8
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%tobool.not34 = icmp eq i32 %0, 0
br i1 %tobool.not34, label %while.end, label %while.body
while.body: ; preds = %entry, %while.cond.backedge
%1 = phi i32 [ %5, %while.cond.backedge ], [ %0, %entry ]
%2 = load i32, ptr @que, align 16, !tbaa !14
%3 = load i64, ptr getelementptr inbounds ([200000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 8, !tbaa !9
%dec.i = add nsw i32 %1, -1
store i32 %dec.i, ptr @qsize, align 4, !tbaa !5
%idxprom.i = sext i32 %dec.i to i64
%arrayidx.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @que, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i, i64 16, i1 false), !tbaa.struct !12
tail call void @min_heapify(i32 noundef 0)
%idxprom = sext i32 %2 to i64
%arrayidx = getelementptr inbounds [100001 x i8], ptr @visited, i64 0, i64 %idxprom
%4 = load i8, ptr %arrayidx, align 1, !tbaa !17
%tobool1.not = icmp eq i8 %4, 0
br i1 %tobool1.not, label %if.end, label %while.cond.backedge
while.cond.backedge: ; preds = %for.inc, %if.end, %while.body
%5 = load i32, ptr @qsize, align 4, !tbaa !5
%tobool.not = icmp eq i32 %5, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !18
if.end: ; preds = %while.body
%conv = trunc i64 %3 to i32
store i8 1, ptr %arrayidx, align 1, !tbaa !17
%arrayidx5 = getelementptr inbounds [100001 x i32], ptr @zombie, i64 0, i64 %idxprom
store i32 %conv, ptr %arrayidx5, align 4, !tbaa !5
%arrayidx7 = getelementptr inbounds [100001 x i32], ptr @len, i64 0, i64 %idxprom
%6 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %6, 0
br i1 %cmp31, label %for.body.lr.ph, label %while.cond.backedge, !llvm.loop !18
for.body.lr.ph: ; preds = %if.end
%qsize.promoted = load i32, ptr @qsize, align 4, !tbaa !5
%add = shl i64 %3, 32
%sext = add i64 %add, 4294967296
%conv18 = ashr exact i64 %sext, 32
%wide.trip.count = zext i32 %6 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%inc.i3032 = phi i32 [ %qsize.promoted, %for.body.lr.ph ], [ %inc.i29, %for.inc ]
%arrayidx12 = getelementptr inbounds [100001 x %struct.TBL], ptr @tbl, i64 0, i64 %idxprom, i32 1, i64 %indvars.iv
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%idxprom13 = sext i32 %7 to i64
%arrayidx14 = getelementptr inbounds [100001 x i8], ptr @visited, i64 0, i64 %idxprom13
%8 = load i8, ptr %arrayidx14, align 1, !tbaa !17
%tobool15.not = icmp eq i8 %8, 0
br i1 %tobool15.not, label %if.end17, label %for.inc
if.end17: ; preds = %for.body
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %qt.i)
%inc.i = add nsw i32 %inc.i3032, 1
store i32 %inc.i, ptr @qsize, align 4, !tbaa !5
%idxprom.i27 = sext i32 %inc.i3032 to i64
%arrayidx.i28 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i27
store i32 %7, ptr %arrayidx.i28, align 16, !tbaa !14
%t3.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i27, i32 1
store i64 %conv18, ptr %t3.i, align 8, !tbaa !9
%cmp27.i = icmp sgt i32 %inc.i3032, 0
br i1 %cmp27.i, label %land.rhs.i, label %enq.exit
land.rhs.i: ; preds = %if.end17, %while.body.i
%i.028.i = phi i32 [ %shr.i, %while.body.i ], [ %inc.i3032, %if.end17 ]
%shr.i = lshr i32 %i.028.i, 1
%idxprom4.i = zext i32 %shr.i to i64
%t6.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i, i32 1
%9 = load i64, ptr %t6.i, align 8, !tbaa !9
%idxprom7.i = zext i32 %i.028.i to i64
%t9.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i, i32 1
%10 = load i64, ptr %t9.i, align 8, !tbaa !9
%cmp10.i = icmp sgt i64 %9, %10
br i1 %cmp10.i, label %while.body.i, label %enq.exit
while.body.i: ; preds = %land.rhs.i
%arrayidx8.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i
%arrayidx5.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %qt.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i, i64 16, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i, i64 16, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i, ptr noundef nonnull align 8 dereferenceable(16) %qt.i, i64 16, i1 false), !tbaa.struct !12
%cmp.not.i = icmp ult i32 %i.028.i, 2
br i1 %cmp.not.i, label %enq.exit, label %land.rhs.i, !llvm.loop !15
enq.exit: ; preds = %land.rhs.i, %while.body.i, %if.end17
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %qt.i)
br label %for.inc
for.inc: ; preds = %for.body, %enq.exit
%inc.i29 = phi i32 [ %inc.i3032, %for.body ], [ %inc.i, %enq.exit ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %while.cond.backedge, label %for.body, !llvm.loop !19
while.end: ; preds = %while.cond.backedge, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @dijkstra2(i32 noundef %start, i32 noundef %goal) local_unnamed_addr #3 {
entry:
%qt.i106 = alloca %struct.QUE, align 8
%qt.i87 = alloca %struct.QUE, align 8
%qt.i68 = alloca %struct.QUE, align 8
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp125 = icmp sgt i32 %0, 0
br i1 %cmp125, label %for.body.preheader, label %enq.exit
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader139, 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 ]
%1 = getelementptr inbounds [100001 x i32], ptr @zombie, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load138 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = icmp eq <4 x i32> %wide.load, zeroinitializer
%4 = icmp eq <4 x i32> %wide.load138, zeroinitializer
%5 = zext <4 x i1> %3 to <4 x i8>
%6 = zext <4 x i1> %4 to <4 x i8>
%7 = getelementptr inbounds [100001 x i8], ptr @visited, i64 0, i64 %index
store <4 x i8> %5, ptr %7, align 8, !tbaa !17
%8 = getelementptr inbounds i8, ptr %7, i64 4
store <4 x i8> %6, ptr %8, align 4, !tbaa !17
%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 !20
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %enq.exit, label %for.body.preheader139
for.body.preheader139: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader139, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader139 ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr @zombie, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %10, 0
%conv2 = zext i1 %cmp1 to i8
%arrayidx4 = getelementptr inbounds [100001 x i8], ptr @visited, i64 0, i64 %indvars.iv
store i8 %conv2, ptr %arrayidx4, align 1, !tbaa !17
%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 %enq.exit, label %for.body, !llvm.loop !23
enq.exit: ; preds = %for.body, %middle.block, %entry
store i32 %start, ptr @que, align 16, !tbaa !14
store i64 0, ptr getelementptr inbounds ([200000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 8, !tbaa !9
br label %while.body
while.condthread-pre-split: ; preds = %for.inc43, %if.end11, %if.end
%.pr = load i32, ptr @qsize, align 4, !tbaa !5
%tobool.not = icmp eq i32 %.pr, 0
br i1 %tobool.not, label %while.end, label %while.body
while.body: ; preds = %enq.exit, %while.condthread-pre-split
%11 = phi i32 [ 1, %enq.exit ], [ %.pr, %while.condthread-pre-split ]
%12 = load i32, ptr @que, align 16, !tbaa !14
%13 = load i64, ptr getelementptr inbounds ([200000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 8, !tbaa !9
%dec.i = add nsw i32 %11, -1
store i32 %dec.i, ptr @qsize, align 4, !tbaa !5
%idxprom.i66 = sext i32 %dec.i to i64
%arrayidx.i67 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i66
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @que, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i67, i64 16, i1 false), !tbaa.struct !12
tail call void @min_heapify(i32 noundef 0)
%cmp5 = icmp eq i32 %12, %goal
br i1 %cmp5, label %while.end, label %if.end
if.end: ; preds = %while.body
%idxprom7 = sext i32 %12 to i64
%arrayidx8 = getelementptr inbounds [100001 x i8], ptr @visited, i64 0, i64 %idxprom7
%14 = load i8, ptr %arrayidx8, align 1, !tbaa !17
%tobool9.not = icmp eq i8 %14, 0
br i1 %tobool9.not, label %if.end11, label %while.condthread-pre-split, !llvm.loop !24
if.end11: ; preds = %if.end
store i8 1, ptr %arrayidx8, align 1, !tbaa !17
%arrayidx16 = getelementptr inbounds [100001 x i32], ptr @len, i64 0, i64 %idxprom7
%15 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17129 = icmp sgt i32 %15, 0
br i1 %cmp17129, label %for.body19.lr.ph, label %while.condthread-pre-split, !llvm.loop !24
for.body19.lr.ph: ; preds = %if.end11
%qsize.promoted = load i32, ptr @qsize, align 4, !tbaa !5
%16 = load i32, ptr @S, align 4
%17 = load i32, ptr @Q, align 4
%conv37 = sext i32 %17 to i64
%add = add nsw i64 %13, %conv37
%18 = load i32, ptr @P, align 4
%conv39 = sext i32 %18 to i64
%add40 = add nsw i64 %13, %conv39
%wide.trip.count136 = zext i32 %15 to i64
br label %for.body19
for.body19: ; preds = %for.body19.lr.ph, %for.inc43
%indvars.iv133 = phi i64 [ 0, %for.body19.lr.ph ], [ %indvars.iv.next134, %for.inc43 ]
%inc.i107128130 = phi i32 [ %qsize.promoted, %for.body19.lr.ph ], [ %inc.i107127, %for.inc43 ]
%arrayidx23 = getelementptr inbounds [100001 x %struct.TBL], ptr @tbl, i64 0, i64 %idxprom7, i32 1, i64 %indvars.iv133
%19 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%idxprom24 = sext i32 %19 to i64
%arrayidx25 = getelementptr inbounds [100001 x i8], ptr @visited, i64 0, i64 %idxprom24
%20 = load i8, ptr %arrayidx25, align 1, !tbaa !17
%tobool26.not = icmp eq i8 %20, 0
br i1 %tobool26.not, label %if.end28, label %for.inc43
if.end28: ; preds = %for.body19
%cmp29 = icmp eq i32 %19, %goal
br i1 %cmp29, label %if.then31, label %if.else
if.then31: ; preds = %if.end28
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %qt.i68)
%inc.i69 = add nsw i32 %inc.i107128130, 1
store i32 %inc.i69, ptr @qsize, align 4, !tbaa !5
%idxprom.i70 = sext i32 %inc.i107128130 to i64
%arrayidx.i71 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i70
store i32 %goal, ptr %arrayidx.i71, align 16, !tbaa !14
%t3.i72 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i70, i32 1
store i64 %13, ptr %t3.i72, align 8, !tbaa !9
%cmp27.i73 = icmp sgt i32 %inc.i107128130, 0
br i1 %cmp27.i73, label %land.rhs.i74, label %enq.exit86
land.rhs.i74: ; preds = %if.then31, %while.body.i82
%i.028.i75 = phi i32 [ %shr.i76, %while.body.i82 ], [ %inc.i107128130, %if.then31 ]
%shr.i76 = lshr i32 %i.028.i75, 1
%idxprom4.i77 = zext i32 %shr.i76 to i64
%t6.i78 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i77, i32 1
%21 = load i64, ptr %t6.i78, align 8, !tbaa !9
%idxprom7.i79 = zext i32 %i.028.i75 to i64
%t9.i80 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i79, i32 1
%22 = load i64, ptr %t9.i80, align 8, !tbaa !9
%cmp10.i81 = icmp sgt i64 %21, %22
br i1 %cmp10.i81, label %while.body.i82, label %enq.exit86
while.body.i82: ; preds = %land.rhs.i74
%arrayidx8.i83 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i79
%arrayidx5.i84 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i77
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %qt.i68, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i83, i64 16, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i83, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i84, i64 16, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i84, ptr noundef nonnull align 8 dereferenceable(16) %qt.i68, i64 16, i1 false), !tbaa.struct !12
%cmp.not.i85 = icmp ult i32 %i.028.i75, 2
br i1 %cmp.not.i85, label %enq.exit86, label %land.rhs.i74, !llvm.loop !15
enq.exit86: ; preds = %land.rhs.i74, %while.body.i82, %if.then31
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %qt.i68)
br label %for.inc43
if.else: ; preds = %if.end28
%arrayidx33 = getelementptr inbounds [100001 x i32], ptr @zombie, i64 0, i64 %idxprom24
%23 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%cmp34.not = icmp sgt i32 %23, %16
%inc.i107 = add nsw i32 %inc.i107128130, 1
%idxprom.i108 = sext i32 %inc.i107128130 to i64
%arrayidx.i109 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i108
%t3.i110 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i108, i32 1
%cmp27.i111 = icmp sgt i32 %inc.i107128130, 0
br i1 %cmp34.not, label %if.else38, label %if.then36
if.then36: ; preds = %if.else
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %qt.i87)
store i32 %inc.i107, ptr @qsize, align 4, !tbaa !5
store i32 %19, ptr %arrayidx.i109, align 16, !tbaa !14
store i64 %add, ptr %t3.i110, align 8, !tbaa !9
br i1 %cmp27.i111, label %land.rhs.i93, label %enq.exit105
land.rhs.i93: ; preds = %if.then36, %while.body.i101
%i.028.i94 = phi i32 [ %shr.i95, %while.body.i101 ], [ %inc.i107128130, %if.then36 ]
%shr.i95 = lshr i32 %i.028.i94, 1
%idxprom4.i96 = zext i32 %shr.i95 to i64
%t6.i97 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i96, i32 1
%24 = load i64, ptr %t6.i97, align 8, !tbaa !9
%idxprom7.i98 = zext i32 %i.028.i94 to i64
%t9.i99 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i98, i32 1
%25 = load i64, ptr %t9.i99, align 8, !tbaa !9
%cmp10.i100 = icmp sgt i64 %24, %25
br i1 %cmp10.i100, label %while.body.i101, label %enq.exit105
while.body.i101: ; preds = %land.rhs.i93
%arrayidx8.i102 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i98
%arrayidx5.i103 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i96
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %qt.i87, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i102, i64 16, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i102, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i103, i64 16, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i103, ptr noundef nonnull align 8 dereferenceable(16) %qt.i87, i64 16, i1 false), !tbaa.struct !12
%cmp.not.i104 = icmp ult i32 %i.028.i94, 2
br i1 %cmp.not.i104, label %enq.exit105, label %land.rhs.i93, !llvm.loop !15
enq.exit105: ; preds = %land.rhs.i93, %while.body.i101, %if.then36
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %qt.i87)
br label %for.inc43
if.else38: ; preds = %if.else
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %qt.i106)
store i32 %inc.i107, ptr @qsize, align 4, !tbaa !5
store i32 %19, ptr %arrayidx.i109, align 16, !tbaa !14
store i64 %add40, ptr %t3.i110, align 8, !tbaa !9
br i1 %cmp27.i111, label %land.rhs.i112, label %enq.exit124
land.rhs.i112: ; preds = %if.else38, %while.body.i120
%i.028.i113 = phi i32 [ %shr.i114, %while.body.i120 ], [ %inc.i107128130, %if.else38 ]
%shr.i114 = lshr i32 %i.028.i113, 1
%idxprom4.i115 = zext i32 %shr.i114 to i64
%t6.i116 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i115, i32 1
%26 = load i64, ptr %t6.i116, align 8, !tbaa !9
%idxprom7.i117 = zext i32 %i.028.i113 to i64
%t9.i118 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i117, i32 1
%27 = load i64, ptr %t9.i118, align 8, !tbaa !9
%cmp10.i119 = icmp sgt i64 %26, %27
br i1 %cmp10.i119, label %while.body.i120, label %enq.exit124
while.body.i120: ; preds = %land.rhs.i112
%arrayidx8.i121 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i117
%arrayidx5.i122 = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i115
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %qt.i106, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i121, i64 16, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i121, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i122, i64 16, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i122, ptr noundef nonnull align 8 dereferenceable(16) %qt.i106, i64 16, i1 false), !tbaa.struct !12
%cmp.not.i123 = icmp ult i32 %i.028.i113, 2
br i1 %cmp.not.i123, label %enq.exit124, label %land.rhs.i112, !llvm.loop !15
enq.exit124: ; preds = %land.rhs.i112, %while.body.i120, %if.else38
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %qt.i106)
br label %for.inc43
for.inc43: ; preds = %enq.exit86, %enq.exit124, %enq.exit105, %for.body19
%inc.i107127 = phi i32 [ %inc.i69, %enq.exit86 ], [ %inc.i107, %enq.exit124 ], [ %inc.i107, %enq.exit105 ], [ %inc.i107128130, %for.body19 ]
%indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
%exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136
br i1 %exitcond137.not, label %while.condthread-pre-split, label %for.body19, !llvm.loop !25
while.end: ; preds = %while.body, %while.condthread-pre-split
ret i64 %13
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @getint() local_unnamed_addr #4 {
entry:
%p.promoted = load ptr, ptr @p, align 8, !tbaa !26
%0 = load i8, ptr %p.promoted, align 1, !tbaa !17
%cmp8 = icmp sgt i8 %0, 47
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%n.010 = phi i32 [ %add4, %while.body ], [ 0, %entry ]
%incdec.ptr79 = phi ptr [ %incdec.ptr, %while.body ], [ %p.promoted, %entry ]
%add = mul i32 %n.010, 10
%incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr79, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !26
%1 = load i8, ptr %incdec.ptr79, align 1, !tbaa !17
%2 = and i8 %1, 15
%and = zext i8 %2 to i32
%add4 = add nsw i32 %add, %and
%3 = load i8, ptr %incdec.ptr, align 1, !tbaa !17
%cmp = icmp sgt i8 %3, 47
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !28
while.end: ; preds = %while.body, %entry
%n.0.lcssa = phi i32 [ 0, %entry ], [ %add4, %while.body ]
ret i32 %n.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%qt.i = alloca %struct.QUE, align 8
store ptr @buf, ptr @p, align 8, !tbaa !26
%0 = load ptr, ptr @stdin, align 8, !tbaa !26
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 40, ptr noundef %0)
%p.promoted.i = load ptr, ptr @p, align 8, !tbaa !26
%1 = load i8, ptr %p.promoted.i, align 1, !tbaa !17
%cmp8.i = icmp sgt i8 %1, 47
br i1 %cmp8.i, label %while.body.i, label %getint.exit
while.body.i: ; preds = %entry, %while.body.i
%n.010.i = phi i32 [ %add4.i, %while.body.i ], [ 0, %entry ]
%incdec.ptr79.i = phi ptr [ %incdec.ptr.i, %while.body.i ], [ %p.promoted.i, %entry ]
%add.i = mul i32 %n.010.i, 10
%incdec.ptr.i = getelementptr inbounds i8, ptr %incdec.ptr79.i, i64 1
store ptr %incdec.ptr.i, ptr @p, align 8, !tbaa !26
%2 = load i8, ptr %incdec.ptr79.i, align 1, !tbaa !17
%3 = and i8 %2, 15
%and.i = zext i8 %3 to i32
%add4.i = add nsw i32 %add.i, %and.i
%4 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !17
%cmp.i = icmp sgt i8 %4, 47
br i1 %cmp.i, label %while.body.i, label %getint.exit, !llvm.loop !28
getint.exit: ; preds = %while.body.i, %entry
%5 = phi ptr [ %p.promoted.i, %entry ], [ %incdec.ptr.i, %while.body.i ]
%n.0.lcssa.i = phi i32 [ 0, %entry ], [ %add4.i, %while.body.i ]
store i32 %n.0.lcssa.i, ptr @N, align 4, !tbaa !5
%incdec.ptr = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !26
%6 = load i8, ptr %incdec.ptr, align 1, !tbaa !17
%cmp8.i49 = icmp sgt i8 %6, 47
br i1 %cmp8.i49, label %while.body.i51, label %getint.exit59
while.body.i51: ; preds = %getint.exit, %while.body.i51
%n.010.i52 = phi i32 [ %add4.i57, %while.body.i51 ], [ 0, %getint.exit ]
%incdec.ptr79.i53 = phi ptr [ %incdec.ptr.i55, %while.body.i51 ], [ %incdec.ptr, %getint.exit ]
%add.i54 = mul i32 %n.010.i52, 10
%incdec.ptr.i55 = getelementptr inbounds i8, ptr %incdec.ptr79.i53, i64 1
store ptr %incdec.ptr.i55, ptr @p, align 8, !tbaa !26
%7 = load i8, ptr %incdec.ptr79.i53, align 1, !tbaa !17
%8 = and i8 %7, 15
%and.i56 = zext i8 %8 to i32
%add4.i57 = add nsw i32 %add.i54, %and.i56
%9 = load i8, ptr %incdec.ptr.i55, align 1, !tbaa !17
%cmp.i58 = icmp sgt i8 %9, 47
br i1 %cmp.i58, label %while.body.i51, label %getint.exit59, !llvm.loop !28
getint.exit59: ; preds = %while.body.i51, %getint.exit
%10 = phi ptr [ %5, %getint.exit ], [ %incdec.ptr79.i53, %while.body.i51 ]
%n.0.lcssa.i50 = phi i32 [ 0, %getint.exit ], [ %add4.i57, %while.body.i51 ]
%incdec.ptr3 = getelementptr inbounds i8, ptr %10, i64 2
store ptr %incdec.ptr3, ptr @p, align 8, !tbaa !26
%11 = load i8, ptr %incdec.ptr3, align 1, !tbaa !17
%cmp8.i61 = icmp sgt i8 %11, 47
br i1 %cmp8.i61, label %while.body.i63, label %getint.exit71
while.body.i63: ; preds = %getint.exit59, %while.body.i63
%n.010.i64 = phi i32 [ %add4.i69, %while.body.i63 ], [ 0, %getint.exit59 ]
%incdec.ptr79.i65 = phi ptr [ %incdec.ptr.i67, %while.body.i63 ], [ %incdec.ptr3, %getint.exit59 ]
%add.i66 = mul i32 %n.010.i64, 10
%incdec.ptr.i67 = getelementptr inbounds i8, ptr %incdec.ptr79.i65, i64 1
store ptr %incdec.ptr.i67, ptr @p, align 8, !tbaa !26
%12 = load i8, ptr %incdec.ptr79.i65, align 1, !tbaa !17
%13 = and i8 %12, 15
%and.i68 = zext i8 %13 to i32
%add4.i69 = add nsw i32 %add.i66, %and.i68
%14 = load i8, ptr %incdec.ptr.i67, align 1, !tbaa !17
%cmp.i70 = icmp sgt i8 %14, 47
br i1 %cmp.i70, label %while.body.i63, label %getint.exit71, !llvm.loop !28
getint.exit71: ; preds = %while.body.i63, %getint.exit59
%15 = phi ptr [ %incdec.ptr3, %getint.exit59 ], [ %incdec.ptr.i67, %while.body.i63 ]
%n.0.lcssa.i62 = phi i32 [ 0, %getint.exit59 ], [ %add4.i69, %while.body.i63 ]
%incdec.ptr5 = getelementptr inbounds i8, ptr %15, i64 1
store ptr %incdec.ptr5, ptr @p, align 8, !tbaa !26
%16 = load i8, ptr %incdec.ptr5, align 1, !tbaa !17
%cmp8.i73 = icmp sgt i8 %16, 47
br i1 %cmp8.i73, label %while.body.i75, label %getint.exit83
while.body.i75: ; preds = %getint.exit71, %while.body.i75
%n.010.i76 = phi i32 [ %add4.i81, %while.body.i75 ], [ 0, %getint.exit71 ]
%incdec.ptr79.i77 = phi ptr [ %incdec.ptr.i79, %while.body.i75 ], [ %incdec.ptr5, %getint.exit71 ]
%add.i78 = mul i32 %n.010.i76, 10
%incdec.ptr.i79 = getelementptr inbounds i8, ptr %incdec.ptr79.i77, i64 1
store ptr %incdec.ptr.i79, ptr @p, align 8, !tbaa !26
%17 = load i8, ptr %incdec.ptr79.i77, align 1, !tbaa !17
%18 = and i8 %17, 15
%and.i80 = zext i8 %18 to i32
%add4.i81 = add nsw i32 %add.i78, %and.i80
%19 = load i8, ptr %incdec.ptr.i79, align 1, !tbaa !17
%cmp.i82 = icmp sgt i8 %19, 47
br i1 %cmp.i82, label %while.body.i75, label %getint.exit83, !llvm.loop !28
getint.exit83: ; preds = %while.body.i75, %getint.exit71
%n.0.lcssa.i74 = phi i32 [ 0, %getint.exit71 ], [ %add4.i81, %while.body.i75 ]
store i32 %n.0.lcssa.i74, ptr @S, align 4, !tbaa !5
store ptr @buf, ptr @p, align 8, !tbaa !26
%20 = load ptr, ptr @stdin, align 8, !tbaa !26
%call7 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 40, ptr noundef %20)
%p.promoted.i84 = load ptr, ptr @p, align 8, !tbaa !26
%21 = load i8, ptr %p.promoted.i84, align 1, !tbaa !17
%cmp8.i85 = icmp sgt i8 %21, 47
br i1 %cmp8.i85, label %while.body.i87, label %getint.exit95
while.body.i87: ; preds = %getint.exit83, %while.body.i87
%n.010.i88 = phi i32 [ %add4.i93, %while.body.i87 ], [ 0, %getint.exit83 ]
%incdec.ptr79.i89 = phi ptr [ %incdec.ptr.i91, %while.body.i87 ], [ %p.promoted.i84, %getint.exit83 ]
%add.i90 = mul i32 %n.010.i88, 10
%incdec.ptr.i91 = getelementptr inbounds i8, ptr %incdec.ptr79.i89, i64 1
store ptr %incdec.ptr.i91, ptr @p, align 8, !tbaa !26
%22 = load i8, ptr %incdec.ptr79.i89, align 1, !tbaa !17
%23 = and i8 %22, 15
%and.i92 = zext i8 %23 to i32
%add4.i93 = add nsw i32 %add.i90, %and.i92
%24 = load i8, ptr %incdec.ptr.i91, align 1, !tbaa !17
%cmp.i94 = icmp sgt i8 %24, 47
br i1 %cmp.i94, label %while.body.i87, label %getint.exit95, !llvm.loop !28
getint.exit95: ; preds = %while.body.i87, %getint.exit83
%25 = phi ptr [ %p.promoted.i84, %getint.exit83 ], [ %incdec.ptr.i91, %while.body.i87 ]
%n.0.lcssa.i86 = phi i32 [ 0, %getint.exit83 ], [ %add4.i93, %while.body.i87 ]
store i32 %n.0.lcssa.i86, ptr @P, align 4, !tbaa !5
%incdec.ptr9 = getelementptr inbounds i8, ptr %25, i64 1
store ptr %incdec.ptr9, ptr @p, align 8, !tbaa !26
%26 = load i8, ptr %incdec.ptr9, align 1, !tbaa !17
%cmp8.i97 = icmp sgt i8 %26, 47
br i1 %cmp8.i97, label %while.body.i99, label %getint.exit107
while.body.i99: ; preds = %getint.exit95, %while.body.i99
%n.010.i100 = phi i32 [ %add4.i105, %while.body.i99 ], [ 0, %getint.exit95 ]
%incdec.ptr79.i101 = phi ptr [ %incdec.ptr.i103, %while.body.i99 ], [ %incdec.ptr9, %getint.exit95 ]
%add.i102 = mul i32 %n.010.i100, 10
%incdec.ptr.i103 = getelementptr inbounds i8, ptr %incdec.ptr79.i101, i64 1
store ptr %incdec.ptr.i103, ptr @p, align 8, !tbaa !26
%27 = load i8, ptr %incdec.ptr79.i101, align 1, !tbaa !17
%28 = and i8 %27, 15
%and.i104 = zext i8 %28 to i32
%add4.i105 = add nsw i32 %add.i102, %and.i104
%29 = load i8, ptr %incdec.ptr.i103, align 1, !tbaa !17
%cmp.i106 = icmp sgt i8 %29, 47
br i1 %cmp.i106, label %while.body.i99, label %getint.exit107, !llvm.loop !28
getint.exit107: ; preds = %while.body.i99, %getint.exit95
%n.0.lcssa.i98 = phi i32 [ 0, %getint.exit95 ], [ %add4.i105, %while.body.i99 ]
store i32 %n.0.lcssa.i98, ptr @Q, align 4, !tbaa !5
store i32 0, ptr @qsize, align 4, !tbaa !5
%cmp145 = icmp sgt i32 %n.0.lcssa.i62, 0
br i1 %cmp145, label %for.body, label %for.cond13.preheader
for.cond13.preheader: ; preds = %enq.exit, %getint.exit107
%cmp14147 = icmp sgt i32 %n.0.lcssa.i50, 0
br i1 %cmp14147, label %for.body15, label %for.end37
for.body: ; preds = %getint.exit107, %enq.exit
%i.0146 = phi i32 [ %inc, %enq.exit ], [ 0, %getint.exit107 ]
store ptr @buf, ptr @p, align 8, !tbaa !26
%30 = load ptr, ptr @stdin, align 8, !tbaa !26
%call11 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 40, ptr noundef %30)
%p.promoted.i108 = load ptr, ptr @p, align 8, !tbaa !26
%31 = load i8, ptr %p.promoted.i108, align 1, !tbaa !17
%cmp8.i109 = icmp sgt i8 %31, 47
br i1 %cmp8.i109, label %while.body.i111, label %getint.exit119
while.body.i111: ; preds = %for.body, %while.body.i111
%n.010.i112 = phi i32 [ %add4.i117, %while.body.i111 ], [ 0, %for.body ]
%incdec.ptr79.i113 = phi ptr [ %incdec.ptr.i115, %while.body.i111 ], [ %p.promoted.i108, %for.body ]
%add.i114 = mul i32 %n.010.i112, 10
%incdec.ptr.i115 = getelementptr inbounds i8, ptr %incdec.ptr79.i113, i64 1
store ptr %incdec.ptr.i115, ptr @p, align 8, !tbaa !26
%32 = load i8, ptr %incdec.ptr79.i113, align 1, !tbaa !17
%33 = and i8 %32, 15
%and.i116 = zext i8 %33 to i32
%add4.i117 = add nsw i32 %add.i114, %and.i116
%34 = load i8, ptr %incdec.ptr.i115, align 1, !tbaa !17
%cmp.i118 = icmp sgt i8 %34, 47
br i1 %cmp.i118, label %while.body.i111, label %getint.exit119, !llvm.loop !28
getint.exit119: ; preds = %while.body.i111, %for.body
%n.0.lcssa.i110 = phi i32 [ 0, %for.body ], [ %add4.i117, %while.body.i111 ]
%sub = add nsw i32 %n.0.lcssa.i110, -1
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %qt.i)
%35 = load i32, ptr @qsize, align 4, !tbaa !5
%inc.i = add nsw i32 %35, 1
store i32 %inc.i, ptr @qsize, align 4, !tbaa !5
%idxprom.i = sext i32 %35 to i64
%arrayidx.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i
store i32 %sub, ptr %arrayidx.i, align 16, !tbaa !14
%t3.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i, i32 1
store i64 0, ptr %t3.i, align 8, !tbaa !9
%cmp27.i = icmp sgt i32 %35, 0
br i1 %cmp27.i, label %land.rhs.i, label %enq.exit
land.rhs.i: ; preds = %getint.exit119, %while.body.i120
%i.028.i = phi i32 [ %shr.i, %while.body.i120 ], [ %35, %getint.exit119 ]
%shr.i = lshr i32 %i.028.i, 1
%idxprom4.i = zext i32 %shr.i to i64
%t6.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i, i32 1
%36 = load i64, ptr %t6.i, align 8, !tbaa !9
%idxprom7.i = zext i32 %i.028.i to i64
%t9.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i, i32 1
%37 = load i64, ptr %t9.i, align 8, !tbaa !9
%cmp10.i = icmp sgt i64 %36, %37
br i1 %cmp10.i, label %while.body.i120, label %enq.exit
while.body.i120: ; preds = %land.rhs.i
%arrayidx8.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i
%arrayidx5.i = getelementptr inbounds [200000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %qt.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i, i64 16, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx8.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i, i64 16, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx5.i, ptr noundef nonnull align 8 dereferenceable(16) %qt.i, i64 16, i1 false), !tbaa.struct !12
%cmp.not.i = icmp ult i32 %i.028.i, 2
br i1 %cmp.not.i, label %enq.exit, label %land.rhs.i, !llvm.loop !15
enq.exit: ; preds = %land.rhs.i, %while.body.i120, %getint.exit119
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %qt.i)
%inc = add nuw nsw i32 %i.0146, 1
%exitcond.not = icmp eq i32 %inc, %n.0.lcssa.i62
br i1 %exitcond.not, label %for.cond13.preheader, label %for.body, !llvm.loop !29
for.body15: ; preds = %for.cond13.preheader, %getint.exit144
%i.1148 = phi i32 [ %inc36, %getint.exit144 ], [ 0, %for.cond13.preheader ]
store ptr @buf, ptr @p, align 8, !tbaa !26
%38 = load ptr, ptr @stdin, align 8, !tbaa !26
%call16 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 40, ptr noundef %38)
%p.promoted.i121 = load ptr, ptr @p, align 8, !tbaa !26
%39 = load i8, ptr %p.promoted.i121, align 1, !tbaa !17
%cmp8.i122 = icmp sgt i8 %39, 47
br i1 %cmp8.i122, label %while.body.i124, label %getint.exit132
while.body.i124: ; preds = %for.body15, %while.body.i124
%n.010.i125 = phi i32 [ %add4.i130, %while.body.i124 ], [ 0, %for.body15 ]
%incdec.ptr79.i126 = phi ptr [ %incdec.ptr.i128, %while.body.i124 ], [ %p.promoted.i121, %for.body15 ]
%add.i127 = mul i32 %n.010.i125, 10
%incdec.ptr.i128 = getelementptr inbounds i8, ptr %incdec.ptr79.i126, i64 1
store ptr %incdec.ptr.i128, ptr @p, align 8, !tbaa !26
%40 = load i8, ptr %incdec.ptr79.i126, align 1, !tbaa !17
%41 = and i8 %40, 15
%and.i129 = zext i8 %41 to i32
%add4.i130 = add nsw i32 %add.i127, %and.i129
%42 = load i8, ptr %incdec.ptr.i128, align 1, !tbaa !17
%cmp.i131 = icmp sgt i8 %42, 47
br i1 %cmp.i131, label %while.body.i124, label %getint.exit132, !llvm.loop !28
getint.exit132: ; preds = %while.body.i124, %for.body15
%43 = phi ptr [ %p.promoted.i121, %for.body15 ], [ %incdec.ptr.i128, %while.body.i124 ]
%n.0.lcssa.i123 = phi i32 [ 0, %for.body15 ], [ %add4.i130, %while.body.i124 ]
%sub18 = add nsw i32 %n.0.lcssa.i123, -1
%incdec.ptr19 = getelementptr inbounds i8, ptr %43, i64 1
store ptr %incdec.ptr19, ptr @p, align 8, !tbaa !26
%44 = load i8, ptr %incdec.ptr19, align 1, !tbaa !17
%cmp8.i134 = icmp sgt i8 %44, 47
br i1 %cmp8.i134, label %while.body.i136, label %getint.exit144
while.body.i136: ; preds = %getint.exit132, %while.body.i136
%n.010.i137 = phi i32 [ %add4.i142, %while.body.i136 ], [ 0, %getint.exit132 ]
%incdec.ptr79.i138 = phi ptr [ %incdec.ptr.i140, %while.body.i136 ], [ %incdec.ptr19, %getint.exit132 ]
%add.i139 = mul i32 %n.010.i137, 10
%incdec.ptr.i140 = getelementptr inbounds i8, ptr %incdec.ptr79.i138, i64 1
store ptr %incdec.ptr.i140, ptr @p, align 8, !tbaa !26
%45 = load i8, ptr %incdec.ptr79.i138, align 1, !tbaa !17
%46 = and i8 %45, 15
%and.i141 = zext i8 %46 to i32
%add4.i142 = add nsw i32 %add.i139, %and.i141
%47 = load i8, ptr %incdec.ptr.i140, align 1, !tbaa !17
%cmp.i143 = icmp sgt i8 %47, 47
br i1 %cmp.i143, label %while.body.i136, label %getint.exit144, !llvm.loop !28
getint.exit144: ; preds = %while.body.i136, %getint.exit132
%n.0.lcssa.i135 = phi i32 [ 0, %getint.exit132 ], [ %add4.i142, %while.body.i136 ]
%sub21 = add nsw i32 %n.0.lcssa.i135, -1
%idxprom = sext i32 %sub18 to i64
%arrayidx23 = getelementptr inbounds [100001 x i32], ptr @len, i64 0, i64 %idxprom
%48 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%inc24 = add nsw i32 %48, 1
store i32 %inc24, ptr %arrayidx23, align 4, !tbaa !5
%idxprom25 = sext i32 %48 to i64
%arrayidx26 = getelementptr inbounds [100001 x %struct.TBL], ptr @tbl, i64 0, i64 %idxprom, i32 1, i64 %idxprom25
store i32 %sub21, ptr %arrayidx26, align 4, !tbaa !5
%idxprom27 = sext i32 %sub21 to i64
%arrayidx31 = getelementptr inbounds [100001 x i32], ptr @len, i64 0, i64 %idxprom27
%49 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%inc32 = add nsw i32 %49, 1
store i32 %inc32, ptr %arrayidx31, align 4, !tbaa !5
%idxprom33 = sext i32 %49 to i64
%arrayidx34 = getelementptr inbounds [100001 x %struct.TBL], ptr @tbl, i64 0, i64 %idxprom27, i32 1, i64 %idxprom33
store i32 %sub18, ptr %arrayidx34, align 4, !tbaa !5
%inc36 = add nuw nsw i32 %i.1148, 1
%exitcond149.not = icmp eq i32 %inc36, %n.0.lcssa.i50
br i1 %exitcond149.not, label %for.end37, label %for.body15, !llvm.loop !30
for.end37: ; preds = %getint.exit144, %for.cond13.preheader
tail call void @dijkstra1()
%50 = load i32, ptr @N, align 4, !tbaa !5
%sub38 = add nsw i32 %50, -1
%call39 = tail call i64 @dijkstra2(i32 noundef 0, i32 noundef %sub38)
%call40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %call39)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !11, i64 8}
!10 = !{!"", !6, i64 0, !11, i64 8}
!11 = !{!"long long", !7, i64 0}
!12 = !{i64 0, i64 4, !5, i64 8, i64 8, !13}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !16, !22, !21}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !16}
!26 = !{!27, !27, i64 0}
!27 = !{!"any pointer", !7, i64 0}
!28 = distinct !{!28, !16}
!29 = distinct !{!29, !16}
!30 = distinct !{!30, !16}
|
#include <stdio.h>
#include <string.h>
char s[100005];
int dist[30][100005];
int alpha[30];
int main(void) {
scanf("%s", s);
int i, j;
int len=strlen(s);
for(i=0;i<len;i++){
dist[s[i]-'a'][alpha[s[i]-'a']]=i+1;
alpha[s[i]-'a']++;
}
int a=-1;
int b=-1;
for(i=0;i<26;i++){
for(j=0;j<len;j++){
if(dist[i][j]==0 || dist[i][j+1]==0)
break;
if(dist[i][j+1]-dist[i][j]<=2){
a=dist[i][j];
b=dist[i][j+1];
}
}
if(a!=-1 && b!=-1)
break;
}
printf("%d %d", a, b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177037/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177037/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@s = dso_local global [100005 x i8] zeroinitializer, align 16
@dist = dso_local local_unnamed_addr global [30 x [100005 x i32]] zeroinitializer, align 16
@alpha = dso_local local_unnamed_addr global [30 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s)
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #3
%conv = trunc i64 %call1 to i32
%cmp103 = icmp sgt i32 %conv, 0
br i1 %cmp103, label %for.body.preheader, label %for.end76
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call1, 4294967295
%xtraiter = and i64 %call1, 1
%0 = icmp eq i64 %wide.trip.count, 1
br i1 %0, label %for.cond21.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body
for.cond21.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond21.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond21.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [100005 x i8], ptr @s, i64 0, i64 %indvars.iv.unr
%1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%conv3.epil = sext i8 %1 to i64
%sub.epil = add nsw i64 %conv3.epil, -97
%arrayidx11.epil = getelementptr inbounds [30 x i32], ptr @alpha, i64 0, i64 %sub.epil
%2 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !8
%idxprom12.epil = sext i32 %2 to i64
%arrayidx13.epil = getelementptr inbounds [30 x [100005 x i32]], ptr @dist, i64 0, i64 %sub.epil, i64 %idxprom12.epil
%3 = trunc i64 %indvars.iv.unr to i32
%4 = add i32 %3, 1
store i32 %4, ptr %arrayidx13.epil, align 4, !tbaa !8
%inc.epil = add nsw i32 %2, 1
store i32 %inc.epil, ptr %arrayidx11.epil, align 4, !tbaa !8
br label %for.cond21.preheader
for.cond21.preheader: ; preds = %for.cond21.preheader.unr-lcssa, %for.body.epil
br i1 %cmp103, label %for.cond25.preheader.us.preheader, label %for.end76
for.cond25.preheader.us.preheader: ; preds = %for.cond21.preheader
%wide.trip.count124 = and i64 %call1, 4294967295
br label %for.cond25.preheader.us
for.cond25.preheader.us: ; preds = %for.cond25.preheader.us.preheader, %for.end67.us
%indvars.iv126 = phi i64 [ 0, %for.cond25.preheader.us.preheader ], [ %indvars.iv.next127, %for.end67.us ]
%b.0116.us = phi i32 [ -1, %for.cond25.preheader.us.preheader ], [ %b.1.lcssa.us, %for.end67.us ]
%a.0115.us = phi i32 [ -1, %for.cond25.preheader.us.preheader ], [ %a.1.lcssa.us, %for.end67.us ]
%arrayidx32.us.phi.trans.insert = getelementptr inbounds [30 x [100005 x i32]], ptr @dist, i64 0, i64 %indvars.iv126, i64 0
%.pre = load i32, ptr %arrayidx32.us.phi.trans.insert, align 4, !tbaa !8
br label %for.body28.us
for.body28.us: ; preds = %for.cond25.preheader.us, %if.end.us
%5 = phi i32 [ %.pre, %for.cond25.preheader.us ], [ %6, %if.end.us ]
%indvars.iv121 = phi i64 [ 0, %for.cond25.preheader.us ], [ %indvars.iv.next122, %if.end.us ]
%b.1108.us = phi i32 [ %b.0116.us, %for.cond25.preheader.us ], [ %spec.select102.us, %if.end.us ]
%a.1107.us = phi i32 [ %a.0115.us, %for.cond25.preheader.us ], [ %spec.select.us, %if.end.us ]
%cmp33.us = icmp eq i32 %5, 0
br i1 %cmp33.us, label %for.end67.us, label %lor.lhs.false.us
lor.lhs.false.us: ; preds = %for.body28.us
%indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
%arrayidx39.us = getelementptr inbounds [30 x [100005 x i32]], ptr @dist, i64 0, i64 %indvars.iv126, i64 %indvars.iv.next122
%6 = load i32, ptr %arrayidx39.us, align 4, !tbaa !8
%cmp40.us = icmp eq i32 %6, 0
br i1 %cmp40.us, label %for.end67.us, label %if.end.us
if.end.us: ; preds = %lor.lhs.false.us
%sub51.us = sub nsw i32 %6, %5
%cmp52.us = icmp slt i32 %sub51.us, 3
%spec.select.us = select i1 %cmp52.us, i32 %5, i32 %a.1107.us
%spec.select102.us = select i1 %cmp52.us, i32 %6, i32 %b.1108.us
%exitcond125.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count124
br i1 %exitcond125.not, label %for.end67.us, label %for.body28.us, !llvm.loop !10
for.end67.us: ; preds = %if.end.us, %lor.lhs.false.us, %for.body28.us
%a.1.lcssa.us = phi i32 [ %a.1107.us, %for.body28.us ], [ %a.1107.us, %lor.lhs.false.us ], [ %spec.select.us, %if.end.us ]
%b.1.lcssa.us = phi i32 [ %b.1108.us, %for.body28.us ], [ %b.1108.us, %lor.lhs.false.us ], [ %spec.select102.us, %if.end.us ]
%cmp68.us = icmp eq i32 %a.1.lcssa.us, -1
%cmp70.us = icmp eq i32 %b.1.lcssa.us, -1
%or.cond.us.not118 = select i1 %cmp68.us, i1 true, i1 %cmp70.us
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%cmp22.us = icmp ult i64 %indvars.iv126, 25
%or.cond = and i1 %or.cond.us.not118, %cmp22.us
br i1 %or.cond, label %for.cond25.preheader.us, label %for.end76, !llvm.loop !12
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100005 x i8], ptr @s, i64 0, i64 %indvars.iv
%7 = load i8, ptr %arrayidx, align 2, !tbaa !5
%conv3 = sext i8 %7 to i64
%sub = add nsw i64 %conv3, -97
%arrayidx11 = getelementptr inbounds [30 x i32], ptr @alpha, i64 0, i64 %sub
%8 = load i32, ptr %arrayidx11, align 4, !tbaa !8
%idxprom12 = sext i32 %8 to i64
%arrayidx13 = getelementptr inbounds [30 x [100005 x i32]], ptr @dist, i64 0, i64 %sub, i64 %idxprom12
%9 = trunc i64 %indvars.iv.next to i32
store i32 %9, ptr %arrayidx13, align 4, !tbaa !8
%inc = add nsw i32 %8, 1
store i32 %inc, ptr %arrayidx11, align 4, !tbaa !8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.1 = getelementptr inbounds [100005 x i8], ptr @s, i64 0, i64 %indvars.iv.next
%10 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv3.1 = sext i8 %10 to i64
%sub.1 = add nsw i64 %conv3.1, -97
%arrayidx11.1 = getelementptr inbounds [30 x i32], ptr @alpha, i64 0, i64 %sub.1
%11 = load i32, ptr %arrayidx11.1, align 4, !tbaa !8
%idxprom12.1 = sext i32 %11 to i64
%arrayidx13.1 = getelementptr inbounds [30 x [100005 x i32]], ptr @dist, i64 0, i64 %sub.1, i64 %idxprom12.1
%12 = trunc i64 %indvars.iv.next.1 to i32
store i32 %12, ptr %arrayidx13.1, align 4, !tbaa !8
%inc.1 = add nsw i32 %11, 1
store i32 %inc.1, ptr %arrayidx11.1, align 4, !tbaa !8
%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.body, !llvm.loop !13
for.end76: ; preds = %for.end67.us, %entry, %for.cond21.preheader
%.us-phi = phi i32 [ -1, %for.cond21.preheader ], [ -1, %entry ], [ %a.1.lcssa.us, %for.end67.us ]
%.us-phi117 = phi i32 [ -1, %for.cond21.preheader ], [ -1, %entry ], [ %b.1.lcssa.us, %for.end67.us ]
%call77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi, i32 noundef %.us-phi117)
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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { 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 = !{!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}
|
#include <stdio.h>
int arr[10000001];
int main(int argc, const char * argv[]){
int n,q,flag,i,count=0;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%d",&flag);
arr[flag]=1;
}
scanf("%d",&q);
for(i=0; i<q; i++){
scanf("%d",&flag);
if(arr[flag]==1){
count++;
}
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177088/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177088/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@arr = dso_local local_unnamed_addr global [10000001 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%flag = 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 %q) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %flag) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.020 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %flag)
%1 = load i32, ptr %flag, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [10000001 x i32], ptr @arr, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.020, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp421 = icmp sgt i32 %3, 0
br i1 %cmp421, label %for.body5, label %for.end13
for.body5: ; preds = %for.end, %for.body5
%count.023 = phi i32 [ %spec.select, %for.body5 ], [ 0, %for.end ]
%i.122 = phi i32 [ %inc12, %for.body5 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %flag)
%4 = load i32, ptr %flag, align 4, !tbaa !5
%idxprom7 = sext i32 %4 to i64
%arrayidx8 = getelementptr inbounds [10000001 x i32], ptr @arr, i64 0, i64 %idxprom7
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %5, 1
%inc10 = zext i1 %cmp9 to i32
%spec.select = add nuw nsw i32 %count.023, %inc10
%inc12 = add nuw nsw i32 %i.122, 1
%6 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc12, %6
br i1 %cmp4, label %for.body5, label %for.end13, !llvm.loop !11
for.end13: ; preds = %for.body5, %for.end
%count.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %for.body5 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %flag) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
int int_cmp(const void *, const void *);
int main(void)
{
int n, q;
int *s, *t;
int c = 0;
int i, j;
scanf("%d", &n);
s = (int *) malloc(sizeof(int) * n);
for (i = 0; i < n; i++)
scanf(" %d", &s[i]);
scanf("%d", &q);
t = (int *) malloc(sizeof(int) * q);
for (i = 0; i < q; i++)
scanf(" %d", &t[i]);
qsort(s, n, sizeof(int), int_cmp);
qsort(t, q, sizeof(int), int_cmp);
for (i = 0; i < q; i++) {
if (t[i] > s[j])
while (t[i] > s[j])
j++;
else if (t[i] < s[j])
while (t[i] < s[j])
i++;
if (t[i] == s[j]) {
c++;
while (t[i] == s[j])
j++;
}
}
printf("%d\n", c);
return 0;
}
int int_cmp(const void *x, const void *y)
{
if (*(int *)x > *(int *)y)
return 1;
else if (*(int *)x == *(int *)y)
return 0;
else
return -1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177130/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177130/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #7
%cmp116 = icmp sgt i32 %0, 0
br i1 %cmp116, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%conv5 = sext i32 %3 to i64
%mul6 = shl nsw i64 %conv5, 2
%call7 = call noalias ptr @malloc(i64 noundef %mul6) #7
%cmp9118 = icmp sgt i32 %3, 0
br i1 %cmp9118, label %for.body11, label %for.end17
for.body11: ; preds = %for.end, %for.body11
%indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.body11 ], [ 0, %for.end ]
%arrayidx13 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv126
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx13)
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%4 = load i32, ptr %q, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp9 = icmp slt i64 %indvars.iv.next127, %5
br i1 %cmp9, label %for.body11, label %for.end17, !llvm.loop !11
for.end17: ; preds = %for.body11, %for.end
%6 = load i32, ptr %n, align 4, !tbaa !5
%conv18 = sext i32 %6 to i64
call void @qsort(ptr noundef %call1, i64 noundef %conv18, i64 noundef 4, ptr noundef nonnull @int_cmp) #6
%7 = load i32, ptr %q, align 4, !tbaa !5
%conv19 = sext i32 %7 to i64
call void @qsort(ptr noundef %call7, i64 noundef %conv19, i64 noundef 4, ptr noundef nonnull @int_cmp) #6
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp21120 = icmp sgt i32 %8, 0
br i1 %cmp21120, label %for.body23, label %for.end76
for.body23: ; preds = %for.end17, %for.inc74
%j.0123 = phi i32 [ %j.4, %for.inc74 ], [ undef, %for.end17 ]
%i.2122 = phi i32 [ %inc75, %for.inc74 ], [ 0, %for.end17 ]
%c.0121 = phi i32 [ %c.1, %for.inc74 ], [ 0, %for.end17 ]
%idxprom24 = sext i32 %i.2122 to i64
%arrayidx25 = getelementptr inbounds i32, ptr %call7, i64 %idxprom24
%9 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%idxprom26 = sext i32 %j.0123 to i64
%arrayidx27 = getelementptr inbounds i32, ptr %call1, i64 %idxprom26
%10 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %9, %10
br i1 %cmp28, label %while.cond, label %if.else
while.cond: ; preds = %for.body23, %while.cond
%indvars.iv132 = phi i64 [ %indvars.iv.next133, %while.cond ], [ %idxprom26, %for.body23 ]
%arrayidx33 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv132
%11 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %9, %11
%indvars.iv.next133 = add i64 %indvars.iv132, 1
br i1 %cmp34, label %while.cond, label %if.end54.loopexit, !llvm.loop !12
if.else: ; preds = %for.body23
%cmp41 = icmp slt i32 %9, %10
br i1 %cmp41, label %while.cond44, label %if.end54
while.cond44: ; preds = %if.else, %while.cond44
%indvars.iv129 = phi i64 [ %indvars.iv.next130, %while.cond44 ], [ %idxprom24, %if.else ]
%arrayidx46 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv129
%12 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%cmp49 = icmp slt i32 %12, %10
%indvars.iv.next130 = add i64 %indvars.iv129, 1
br i1 %cmp49, label %while.cond44, label %if.end54.loopexit124, !llvm.loop !13
if.end54.loopexit: ; preds = %while.cond
%13 = trunc i64 %indvars.iv132 to i32
%sext141 = shl i64 %indvars.iv132, 32
%.pre139 = ashr exact i64 %sext141, 32
%arrayidx58.phi.trans.insert = getelementptr inbounds i32, ptr %call1, i64 %.pre139
%.pre140 = load i32, ptr %arrayidx58.phi.trans.insert, align 4, !tbaa !5
br label %if.end54
if.end54.loopexit124: ; preds = %while.cond44
%14 = trunc i64 %indvars.iv129 to i32
%sext = shl i64 %indvars.iv129, 32
%.pre = ashr exact i64 %sext, 32
%arrayidx56.phi.trans.insert = getelementptr inbounds i32, ptr %call7, i64 %.pre
%.pre138 = load i32, ptr %arrayidx56.phi.trans.insert, align 4, !tbaa !5
br label %if.end54
if.end54: ; preds = %if.end54.loopexit124, %if.end54.loopexit, %if.else
%15 = phi i32 [ %10, %if.end54.loopexit124 ], [ %.pre140, %if.end54.loopexit ], [ %10, %if.else ]
%idxprom57.pre-phi = phi i64 [ %idxprom26, %if.end54.loopexit124 ], [ %.pre139, %if.end54.loopexit ], [ %idxprom26, %if.else ]
%16 = phi i32 [ %.pre138, %if.end54.loopexit124 ], [ %9, %if.end54.loopexit ], [ %9, %if.else ]
%i.4 = phi i32 [ %14, %if.end54.loopexit124 ], [ %i.2122, %if.end54.loopexit ], [ %i.2122, %if.else ]
%j.2 = phi i32 [ %j.0123, %if.end54.loopexit124 ], [ %13, %if.end54.loopexit ], [ %j.0123, %if.else ]
%cmp59 = icmp eq i32 %16, %15
br i1 %cmp59, label %while.cond63, label %for.inc74
while.cond63: ; preds = %if.end54, %while.cond63
%indvars.iv135 = phi i64 [ %indvars.iv.next136, %while.cond63 ], [ %idxprom57.pre-phi, %if.end54 ]
%arrayidx67 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv135
%17 = load i32, ptr %arrayidx67, align 4, !tbaa !5
%cmp68 = icmp eq i32 %15, %17
%indvars.iv.next136 = add i64 %indvars.iv135, 1
br i1 %cmp68, label %while.cond63, label %for.inc74.loopexit, !llvm.loop !14
for.inc74.loopexit: ; preds = %while.cond63
%inc62 = add nsw i32 %c.0121, 1
%18 = trunc i64 %indvars.iv135 to i32
br label %for.inc74
for.inc74: ; preds = %for.inc74.loopexit, %if.end54
%c.1 = phi i32 [ %c.0121, %if.end54 ], [ %inc62, %for.inc74.loopexit ]
%j.4 = phi i32 [ %j.2, %if.end54 ], [ %18, %for.inc74.loopexit ]
%inc75 = add nsw i32 %i.4, 1
%cmp21 = icmp slt i32 %inc75, %8
br i1 %cmp21, label %for.body23, label %for.end76, !llvm.loop !15
for.end76: ; preds = %for.inc74, %for.end17
%c.0.lcssa = phi i32 [ 0, %for.end17 ], [ %c.1, %for.inc74 ]
%call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @int_cmp(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #5 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#include <stdlib.h>
int comp(const void *a, const void *b)
{
int *x = (int *)a, *y = (int *)b;
return (*x - *y);
}
int main(void)
{
int n, q;
int S[100000], T[50000];
int C;
int i, j;
int left, right, center;
C = 0;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%d", &S[i]);
}
qsort(S, n, sizeof(int), comp);
scanf("%d", &q);
for (i = 0; i < q; i++){
scanf("%d", &T[i]);
}
for (i = 0; i < q; i++){
left = 0;
right = n - 1;
while (left <= right){
center = (left + right) / 2;
if (S[center] == T[i]){
C++;
break;
}
if (S[center] > T[i]){
right = center - 1;
}
else {
left = center + 1;
}
}
}
printf("%d\n", C);
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177189/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177189/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [100000 x i32], align 16
%T = alloca [50000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %S) #5
call void @llvm.lifetime.start.p0(i64 200000, ptr nonnull %T) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp58 = icmp sgt i32 %0, 0
br i1 %cmp58, 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 [100000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull %S, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @comp) #5
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp460 = icmp sgt i32 %3, 0
br i1 %cmp460, label %for.body6, label %for.end38
for.cond13.preheader: ; preds = %for.body6
%cmp1466 = icmp sgt i32 %5, 0
br i1 %cmp1466, label %for.body16.lr.ph, label %for.end38
for.body16.lr.ph: ; preds = %for.cond13.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
%cmp17.not63 = icmp slt i32 %4, 1
br i1 %cmp17.not63, label %for.end38, label %for.body16.preheader
for.body16.preheader: ; preds = %for.body16.lr.ph
%wide.trip.count = zext i32 %5 to i64
br label %for.body16
for.body6: ; preds = %for.end, %for.body6
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds [50000 x i32], ptr %T, i64 0, i64 %indvars.iv75
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%5 = load i32, ptr %q, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp4 = icmp slt i64 %indvars.iv.next76, %6
br i1 %cmp4, label %for.body6, label %for.cond13.preheader, !llvm.loop !11
for.body16: ; preds = %for.body16.preheader, %for.inc36
%indvars.iv78 = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next79, %for.inc36 ]
%C.069 = phi i32 [ 0, %for.body16.preheader ], [ %C.1, %for.inc36 ]
%arrayidx22 = getelementptr inbounds [50000 x i32], ptr %T, i64 0, i64 %indvars.iv78
%7 = load i32, ptr %arrayidx22, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %for.body16, %if.end
%right.065 = phi i32 [ %sub, %for.body16 ], [ %right.1, %if.end ]
%left.064 = phi i32 [ 0, %for.body16 ], [ %left.1, %if.end ]
%add = add nsw i32 %right.065, %left.064
%div = sdiv i32 %add, 2
%idxprom19 = sext i32 %div to i64
%arrayidx20 = getelementptr inbounds [100000 x i32], ptr %S, i64 0, i64 %idxprom19
%8 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%cmp23 = icmp eq i32 %8, %7
br i1 %cmp23, label %if.then, label %if.end
if.then: ; preds = %while.body
%inc25 = add nsw i32 %C.069, 1
br label %for.inc36
if.end: ; preds = %while.body
%cmp30 = icmp sgt i32 %8, %7
%sub33 = add nsw i32 %div, -1
%add34 = add nsw i32 %div, 1
%left.1 = select i1 %cmp30, i32 %left.064, i32 %add34
%right.1 = select i1 %cmp30, i32 %sub33, i32 %right.065
%cmp17.not = icmp sgt i32 %left.1, %right.1
br i1 %cmp17.not, label %for.inc36, label %while.body, !llvm.loop !12
for.inc36: ; preds = %if.end, %if.then
%C.1 = phi i32 [ %inc25, %if.then ], [ %C.069, %if.end ]
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%exitcond.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count
br i1 %exitcond.not, label %for.end38, label %for.body16, !llvm.loop !13
for.end38: ; preds = %for.inc36, %for.end, %for.body16.lr.ph, %for.cond13.preheader
%C.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %for.body16.lr.ph ], [ 0, %for.end ], [ %C.1, %for.inc36 ]
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %C.0.lcssa)
call void @llvm.lifetime.end.p0(i64 200000, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %S) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !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 argc, char const *argv[]) {
int N, K, R, S, P;
char T[100000];
scanf("%d", &N);
scanf("%d", &K);
scanf("%d", &R);
scanf("%d", &S);
scanf("%d", &P);
scanf("%s", T);
int pnt = 0;
for (int i = 0; i < N; i++) {
if (i < K) {
switch (T[i]) {
case 'r':
pnt = pnt + P;
break;
case 's':
pnt = pnt + R;
break;
case 'p':
pnt = pnt + S;
break;
}
}
if (i >= K) {
if (T[i] == T[i - K]) {
pnt += 0;
T[i] = 'n';
}else{
switch (T[i]) {
case 'r':
pnt = pnt + P;
break;
case 's':
pnt = pnt + R;
break;
case 'p':
pnt = pnt + S;
break;
}
}
}
}
printf("%d\n", pnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177246/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177246/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
%R = alloca i32, align 4
%S = alloca i32, align 4
%P = alloca i32, align 4
%T = alloca [100000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %P) #3
call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %P)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %T)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %K, align 4, !tbaa !5
%2 = load i32, ptr %S, align 4
%3 = load i32, ptr %R, align 4
%4 = load i32, ptr %P, align 4
%5 = sext i32 %1 to i64
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
%pnt.0.lcssa = phi i32 [ 0, %entry ], [ %pnt.2, %for.inc ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %pnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %P) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%pnt.056 = phi i32 [ 0, %for.body.lr.ph ], [ %pnt.2, %for.inc ]
%cmp6 = icmp slt i64 %indvars.iv, %5
%arrayidx = getelementptr inbounds [100000 x i8], ptr %T, i64 0, i64 %indvars.iv
%6 = load i8, ptr %arrayidx, align 1, !tbaa !9
br i1 %cmp6, label %if.then, label %if.then13
if.then: ; preds = %for.body
%conv = sext i8 %6 to i32
switch i32 %conv, label %for.inc [
i32 114, label %sw.bb
i32 115, label %sw.bb7
i32 112, label %sw.bb9
]
sw.bb: ; preds = %if.then
%add = add nsw i32 %4, %pnt.056
br label %for.inc
sw.bb7: ; preds = %if.then
%add8 = add nsw i32 %3, %pnt.056
br label %for.inc
sw.bb9: ; preds = %if.then
%add10 = add nsw i32 %2, %pnt.056
br label %for.inc
if.then13: ; preds = %for.body
%7 = sub nsw i64 %indvars.iv, %5
%arrayidx18 = getelementptr inbounds [100000 x i8], ptr %T, i64 0, i64 %7
%8 = load i8, ptr %arrayidx18, align 1, !tbaa !9
%cmp20 = icmp eq i8 %6, %8
br i1 %cmp20, label %if.then22, label %if.else
if.then22: ; preds = %if.then13
store i8 110, ptr %arrayidx, align 1, !tbaa !9
br label %for.inc
if.else: ; preds = %if.then13
%conv16 = sext i8 %6 to i32
switch i32 %conv16, label %for.inc [
i32 114, label %sw.bb29
i32 115, label %sw.bb31
i32 112, label %sw.bb33
]
sw.bb29: ; preds = %if.else
%add30 = add nsw i32 %4, %pnt.056
br label %for.inc
sw.bb31: ; preds = %if.else
%add32 = add nsw i32 %3, %pnt.056
br label %for.inc
sw.bb33: ; preds = %if.else
%add34 = add nsw i32 %2, %pnt.056
br label %for.inc
for.inc: ; preds = %if.then, %sw.bb9, %sw.bb7, %sw.bb, %sw.bb29, %sw.bb31, %sw.bb33, %if.else, %if.then22
%pnt.2 = phi i32 [ %pnt.056, %if.then22 ], [ %pnt.056, %if.else ], [ %add34, %sw.bb33 ], [ %add32, %sw.bb31 ], [ %add30, %sw.bb29 ], [ %add, %sw.bb ], [ %add8, %sw.bb7 ], [ %add10, %sw.bb9 ], [ %pnt.056, %if.then ]
%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 !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int x;
int y;
int check;
} S_POINT;
int cmpR(const void * n1, const void * n2)
{
if (((S_POINT *)n1)->y > ((S_POINT *)n2)->y)
{
return -1;
}
else if (((S_POINT *)n1)->y < ((S_POINT *)n2)->y)
{
return 1;
}
else
{
return 0;
}
}
int cmpB(const void * n1, const void * n2)
{
if (((S_POINT *)n1)->x > ((S_POINT *)n2)->x)
{
return 1;
}
else if (((S_POINT *)n1)->x < ((S_POINT *)n2)->x)
{
return -1;
}
else
{
return 0;
}
}
int main(void) {
int n;
scanf("%d", &n);
S_POINT red[n],blue[n];
for (int i = 0; i < n; i++) {
scanf("%d %d", &red[i].x, &red[i].y);
red[i].check = 0;
}
for (int i = 0; i < n; i++) {
scanf("%d %d", &blue[i].x, &blue[i].y);
blue[i].check = 0;
}
qsort(red, n, sizeof(S_POINT), cmpR);
qsort(blue, n, sizeof(S_POINT), cmpB);
int pairs = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (red[j].check == 0 && red[j].x < blue[i].x && red[j].y < blue[i].y) {
red[j].check = 1;
pairs++;
break;
}
}
}
printf("%d\n", pairs);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177303/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177303/source.c"
target datalayout = "e-m:e-p270: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.S_POINT = type { i32, i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmpR(ptr nocapture noundef readonly %n1, ptr nocapture noundef readonly %n2) #0 {
entry:
%y = getelementptr inbounds %struct.S_POINT, ptr %n1, i64 0, i32 1
%0 = load i32, ptr %y, align 4, !tbaa !5
%y1 = getelementptr inbounds %struct.S_POINT, ptr %n2, i64 0, i32 1
%1 = load i32, ptr %y1, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp4 = icmp slt i32 %0, %1
%. = zext i1 %cmp4 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmpB(ptr nocapture noundef readonly %n1, ptr nocapture noundef readonly %n2) #0 {
entry:
%0 = load i32, ptr %n1, align 4, !tbaa !10
%1 = load i32, ptr %n2, align 4, !tbaa !10
%cmp = icmp sgt i32 %0, %1
%cmp4 = icmp slt i32 %0, %1
%. = sext i1 %cmp4 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !11
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca %struct.S_POINT, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !11
%4 = zext i32 %3 to i64
%vla1 = alloca %struct.S_POINT, i64 %4, align 16
%cmp91 = icmp sgt i32 %3, 0
br i1 %cmp91, label %for.body, label %for.cond8.preheader.for.cond.cleanup10_crit_edge
for.cond8.preheader: ; preds = %for.body
%cmp993 = icmp sgt i32 %6, 0
br i1 %cmp993, label %for.body11, label %for.cond8.preheader.for.cond.cleanup10_crit_edge
for.cond8.preheader.for.cond.cleanup10_crit_edge: ; preds = %entry, %for.cond8.preheader
%5 = phi i32 [ %6, %for.cond8.preheader ], [ %3, %entry ]
%.pre = sext i32 %5 to i64
br label %for.cond.cleanup10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.S_POINT, ptr %vla, i64 %indvars.iv
%y = getelementptr inbounds %struct.S_POINT, ptr %vla, i64 %indvars.iv, i32 1
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %y)
%check = getelementptr inbounds %struct.S_POINT, ptr %vla, i64 %indvars.iv, i32 2
store i32 0, ptr %check, align 4, !tbaa !12
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !11
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond8.preheader, !llvm.loop !13
for.cond.cleanup10: ; preds = %for.body11, %for.cond8.preheader.for.cond.cleanup10_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %for.cond8.preheader.for.cond.cleanup10_crit_edge ], [ %16, %for.body11 ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 12, ptr noundef nonnull @cmpR) #6
%8 = load i32, ptr %n, align 4, !tbaa !11
%conv25 = sext i32 %8 to i64
call void @qsort(ptr noundef nonnull %vla1, i64 noundef %conv25, i64 noundef 12, ptr noundef nonnull @cmpB) #6
%9 = load i32, ptr %n, align 4, !tbaa !11
%cmp2897 = icmp sgt i32 %9, 0
br i1 %cmp2897, label %for.cond32.preheader.us.preheader, label %for.cond.cleanup30
for.cond32.preheader.us.preheader: ; preds = %for.cond.cleanup10
%wide.trip.count114 = zext i32 %9 to i64
br label %for.cond32.preheader.us
for.cond32.preheader.us: ; preds = %for.cond32.preheader.us.preheader, %cleanup.us
%indvars.iv111 = phi i64 [ 0, %for.cond32.preheader.us.preheader ], [ %indvars.iv.next112, %cleanup.us ]
%pairs.098.us = phi i32 [ 0, %for.cond32.preheader.us.preheader ], [ %pairs.1.us, %cleanup.us ]
%arrayidx46.us = getelementptr inbounds %struct.S_POINT, ptr %vla1, i64 %indvars.iv111
%y56.us = getelementptr inbounds %struct.S_POINT, ptr %vla1, i64 %indvars.iv111, i32 1
br label %for.body36.us
for.body36.us: ; preds = %for.cond32.preheader.us, %for.inc63.us
%indvars.iv108 = phi i64 [ 0, %for.cond32.preheader.us ], [ %indvars.iv.next109, %for.inc63.us ]
%check39.us = getelementptr inbounds %struct.S_POINT, ptr %vla, i64 %indvars.iv108, i32 2
%10 = load i32, ptr %check39.us, align 4, !tbaa !12
%cmp40.us = icmp eq i32 %10, 0
br i1 %cmp40.us, label %land.lhs.true.us, label %for.inc63.us
land.lhs.true.us: ; preds = %for.body36.us
%arrayidx38.us = getelementptr inbounds %struct.S_POINT, ptr %vla, i64 %indvars.iv108
%11 = load i32, ptr %arrayidx38.us, align 4, !tbaa !10
%12 = load i32, ptr %arrayidx46.us, align 4, !tbaa !10
%cmp48.us = icmp slt i32 %11, %12
br i1 %cmp48.us, label %land.lhs.true50.us, label %for.inc63.us
land.lhs.true50.us: ; preds = %land.lhs.true.us
%y53.us = getelementptr inbounds %struct.S_POINT, ptr %vla, i64 %indvars.iv108, i32 1
%13 = load i32, ptr %y53.us, align 4, !tbaa !5
%14 = load i32, ptr %y56.us, align 4, !tbaa !5
%cmp57.us = icmp slt i32 %13, %14
br i1 %cmp57.us, label %if.then.us, label %for.inc63.us
for.inc63.us: ; preds = %land.lhs.true50.us, %land.lhs.true.us, %for.body36.us
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count114
br i1 %exitcond.not, label %cleanup.us, label %for.body36.us, !llvm.loop !15
if.then.us: ; preds = %land.lhs.true50.us
store i32 1, ptr %check39.us, align 4, !tbaa !12
%inc62.us = add nsw i32 %pairs.098.us, 1
br label %cleanup.us
cleanup.us: ; preds = %for.inc63.us, %if.then.us
%pairs.1.us = phi i32 [ %inc62.us, %if.then.us ], [ %pairs.098.us, %for.inc63.us ]
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114
br i1 %exitcond115.not, label %for.cond.cleanup30, label %for.cond32.preheader.us, !llvm.loop !16
for.body11: ; preds = %for.cond8.preheader, %for.body11
%indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.body11 ], [ 0, %for.cond8.preheader ]
%arrayidx13 = getelementptr inbounds %struct.S_POINT, ptr %vla1, i64 %indvars.iv105
%y17 = getelementptr inbounds %struct.S_POINT, ptr %vla1, i64 %indvars.iv105, i32 1
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx13, ptr noundef nonnull %y17)
%check21 = getelementptr inbounds %struct.S_POINT, ptr %vla1, i64 %indvars.iv105, i32 2
store i32 0, ptr %check21, align 4, !tbaa !12
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%15 = load i32, ptr %n, align 4, !tbaa !11
%16 = sext i32 %15 to i64
%cmp9 = icmp slt i64 %indvars.iv.next106, %16
br i1 %cmp9, label %for.body11, label %for.cond.cleanup10, !llvm.loop !17
for.cond.cleanup30: ; preds = %cleanup.us, %for.cond.cleanup10
%pairs.0.lcssa = phi i32 [ 0, %for.cond.cleanup10 ], [ %pairs.1.us, %cleanup.us ]
%call70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %pairs.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !7, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
|
#include<stdio.h>
#define MAX 301
int main()
{
char array[MAX]={'\0'};
int i,j;
int count[4]={0};
int temp;
scanf("%s",&array);
for( i=0; i<MAX; i++ ){
if( array[i]=='K' ) count[0]++;
if( array[i]=='U' ) count[1]++;
if( array[i]=='P' ) count[2]++;
if( array[i]=='C' ) count[3]++;
}
for( i=0; i<4; i++ ){
for( j=2; j>=i; j-- ){
if( count[j]<count[j+1] ){
temp=count[j];
count[j]=count[j+1];
count[j+1]=temp;
}
}
}
printf("%d\n",count[3]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177347/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177347/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%array = alloca [301 x i8], align 16
call void @llvm.lifetime.start.p0(i64 301, ptr nonnull %array) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(301) %array, i8 0, i64 301, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %array)
br label %for.body
for.body: ; preds = %for.inc.1, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.1, %for.inc.1 ]
%inc1190 = phi i32 [ 0, %entry ], [ %inc1189.1, %for.inc.1 ]
%inc2088 = phi i32 [ 0, %entry ], [ %inc2087.1, %for.inc.1 ]
%inc2986 = phi i32 [ 0, %entry ], [ %inc2985.1, %for.inc.1 ]
%0 = phi i32 [ 0, %entry ], [ %4, %for.inc.1 ]
%arrayidx = getelementptr inbounds [301 x i8], ptr %array, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 2, !tbaa !5
switch i8 %1, label %for.inc [
i8 75, label %if.end.thread
i8 85, label %if.then9
i8 80, label %if.then18
i8 67, label %if.then27
]
if.end.thread: ; preds = %for.body
%inc = add nsw i32 %0, 1
br label %for.inc
if.then9: ; preds = %for.body
%inc11 = add nsw i32 %inc1190, 1
br label %for.inc
if.then18: ; preds = %for.body
%inc20 = add nsw i32 %inc2088, 1
br label %for.inc
if.then27: ; preds = %for.body
%inc29 = add nsw i32 %inc2986, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then9, %if.end.thread, %if.then18, %if.then27
%inc1189 = phi i32 [ %inc1190, %for.body ], [ %inc11, %if.then9 ], [ %inc1190, %if.end.thread ], [ %inc1190, %if.then18 ], [ %inc1190, %if.then27 ]
%inc2087 = phi i32 [ %inc2088, %for.body ], [ %inc2088, %if.then9 ], [ %inc2088, %if.end.thread ], [ %inc20, %if.then18 ], [ %inc2088, %if.then27 ]
%inc2985 = phi i32 [ %inc2986, %for.body ], [ %inc2986, %if.then9 ], [ %inc2986, %if.end.thread ], [ %inc2986, %if.then18 ], [ %inc29, %if.then27 ]
%2 = phi i32 [ %0, %for.body ], [ %0, %if.then9 ], [ %inc, %if.end.thread ], [ %0, %if.then18 ], [ %0, %if.then27 ]
%indvars.iv.next = or i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 301
br i1 %exitcond.not, label %for.body39.preheader, label %for.body.1, !llvm.loop !8
for.body.1: ; preds = %for.inc
%arrayidx.1 = getelementptr inbounds [301 x i8], ptr %array, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
switch i8 %3, label %for.inc.1 [
i8 75, label %if.end.thread.1
i8 85, label %if.then9.1
i8 80, label %if.then18.1
i8 67, label %if.then27.1
]
if.then27.1: ; preds = %for.body.1
%inc29.1 = add nsw i32 %inc2985, 1
br label %for.inc.1
if.then18.1: ; preds = %for.body.1
%inc20.1 = add nsw i32 %inc2087, 1
br label %for.inc.1
if.then9.1: ; preds = %for.body.1
%inc11.1 = add nsw i32 %inc1189, 1
br label %for.inc.1
if.end.thread.1: ; preds = %for.body.1
%inc.1 = add nsw i32 %2, 1
br label %for.inc.1
for.inc.1: ; preds = %if.end.thread.1, %if.then9.1, %if.then18.1, %if.then27.1, %for.body.1
%inc1189.1 = phi i32 [ %inc1189, %for.body.1 ], [ %inc11.1, %if.then9.1 ], [ %inc1189, %if.end.thread.1 ], [ %inc1189, %if.then18.1 ], [ %inc1189, %if.then27.1 ]
%inc2087.1 = phi i32 [ %inc2087, %for.body.1 ], [ %inc2087, %if.then9.1 ], [ %inc2087, %if.end.thread.1 ], [ %inc20.1, %if.then18.1 ], [ %inc2087, %if.then27.1 ]
%inc2985.1 = phi i32 [ %inc2985, %for.body.1 ], [ %inc2985, %if.then9.1 ], [ %inc2985, %if.end.thread.1 ], [ %inc2985, %if.then18.1 ], [ %inc29.1, %if.then27.1 ]
%4 = phi i32 [ %2, %for.body.1 ], [ %2, %if.then9.1 ], [ %inc.1, %if.end.thread.1 ], [ %2, %if.then18.1 ], [ %2, %if.then27.1 ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
br label %for.body
for.body39.preheader: ; preds = %for.inc
%spec.select = call i32 @llvm.smax.i32(i32 %inc2087, i32 %inc2985)
%spec.select133 = call i32 @llvm.smin.i32(i32 %inc2087, i32 %inc2985)
%count.sroa.6.0 = call i32 @llvm.smax.i32(i32 %inc1189, i32 %spec.select)
%count.sroa.14.1 = call i32 @llvm.smin.i32(i32 %inc1189, i32 %spec.select)
%count.sroa.6.1 = call i32 @llvm.smin.i32(i32 %2, i32 %count.sroa.6.0)
%cmp44.1 = icmp slt i32 %inc1189, %spec.select133
%count.sroa.14.3 = select i1 %cmp44.1, i32 %spec.select133, i32 %count.sroa.14.1
%count.sroa.26.2 = select i1 %cmp44.1, i32 %count.sroa.14.1, i32 %spec.select133
%count.sroa.14.4 = call i32 @llvm.smin.i32(i32 %count.sroa.6.1, i32 %count.sroa.14.3)
%count.sroa.26.4 = call i32 @llvm.smin.i32(i32 %count.sroa.14.4, i32 %count.sroa.26.2)
%call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.sroa.26.4)
call void @llvm.lifetime.end.p0(i64 301, ptr nonnull %array) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
int main(void){
long int a,b;
scanf("%ld %ld",&a,&b);
if(a <= 0 && b >= 0){
printf("Zero");
}else if(a > 0 && b > 0){
printf("Positive");
}else{
if(abs(a - b) % 2 ==0){
printf("Negative");
}else{
printf("Positive");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177398/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177398/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Zero\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"Positive\00", align 1
@.str.3 = private unnamed_addr constant [9 x i8] c"Negative\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%cmp = icmp slt i64 %0, 1
%1 = load i64, ptr %b, align 8
%cmp1 = icmp sgt i64 %1, -1
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.end16, label %if.else
if.else: ; preds = %entry
%cmp3 = icmp sgt i64 %0, 0
%cmp5 = icmp sgt i64 %1, 0
%or.cond17 = select i1 %cmp3, i1 %cmp5, i1 false
br i1 %or.cond17, label %if.end16, label %if.else8
if.else8: ; preds = %if.else
%sub = sub nsw i64 %0, %1
%rem18 = and i64 %sub, 1
%cmp9 = icmp eq i64 %rem18, 0
%.str.3..str.2 = select i1 %cmp9, ptr @.str.3, ptr @.str.2
br label %if.end16
if.end16: ; preds = %if.else8, %if.else, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.else ], [ %.str.3..str.2, %if.else8 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
long long int sgn(long long int a) {
return a >= 0 ? 1 : -1;
}
int main(void) {
long long int a, b;
scanf("%lld%lld", &a, &b);
if(a == 0 || b == 0 || sgn(a) != sgn(b))
puts("Zero");
else if(sgn(a) == 1)
puts("Positive");
else if(a == b)
puts("Negative");
else
puts((b - a) % 2 ? "Positive" : "Negative");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177440/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177440/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Zero\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"Positive\00", align 1
@.str.3 = private unnamed_addr constant [9 x i8] c"Negative\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sgn(i64 noundef %a) local_unnamed_addr #0 {
entry:
%cmp = icmp sgt i64 %a, -1
%conv = select i1 %cmp, i64 1, i64 -1
ret i64 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%cmp = icmp ne i64 %0, 0
%1 = load i64, ptr %b, align 8
%cmp1 = icmp ne i64 %1, 0
%or.cond.not27 = select i1 %cmp, i1 %cmp1, i1 false
%2 = xor i64 %1, %0
%cmp5.not = icmp sgt i64 %2, -1
%or.cond26 = select i1 %or.cond.not27, i1 %cmp5.not, i1 false
br i1 %or.cond26, label %if.else, label %if.end18
if.else: ; preds = %entry
%cmp.i = icmp slt i64 %0, 0
br i1 %cmp.i, label %if.else11, label %if.end18
if.else11: ; preds = %if.else
%cmp12 = icmp eq i64 %0, %1
br i1 %cmp12, label %if.end18, label %if.else15
if.else15: ; preds = %if.else11
%sub = sub nsw i64 %1, %0
%3 = and i64 %sub, 1
%tobool.not = icmp eq i64 %3, 0
%cond = select i1 %tobool.not, ptr @.str.3, ptr @.str.2
br label %if.end18
if.end18: ; preds = %if.else11, %if.else, %entry, %if.else15
%.str.2.sink = phi ptr [ %cond, %if.else15 ], [ @.str.1, %entry ], [ @.str.2, %if.else ], [ @.str.3, %if.else11 ]
%call10 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @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(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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a, b;
while( scanf("%d %d", &a, &b) != EOF ){
printf("%d\n", a + b);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177484/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177484/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not3 = icmp eq i32 %call2, -1
br i1 %cmp.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main (void){
int a,b,ans,ch;
ans = 0;
while(scanf("%d",&a) != EOF){
scanf("%d",&b);
ans = a+b;
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177527/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177527/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not4 = icmp eq i32 %call3, -1
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int a, b;
while (scanf("%d %d", &a, &b) != EOF)
printf("%d\n", a + b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177570/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not3 = icmp eq i32 %call2, -1
br i1 %cmp.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a, b;
while( scanf("%d %d", &a, &b) != EOF ){
printf("%d\n", a + b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177613/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177613/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not3 = icmp eq i32 %call2, -1
br i1 %cmp.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main() {
int a,b;
while(scanf("%d %d",&a,&b)!=EOF){
printf("%d\n",a+b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177679/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177679/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not3 = icmp eq i32 %call2, -1
br i1 %cmp.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <limits.h>
#define TEST_MODE 0
int main(void) {
#if TEST_MODE
long long a,b;
while(scanf("%lld%lld",&a,&b)==2) {
if(a+b>=(long long)INT_MAX || a+b<(long long)INT_MIN)return 1;
printf("%lld\n",a+b);
}
#else
int a,b;
while(scanf("%d%d",&a,&b)==2) {
printf("%d\n",a+b);
}
#endif
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177721/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177721/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp3 = icmp eq i32 %call2, 2
br i1 %cmp3, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp = icmp eq i32 %call, 2
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a, b;
while( scanf("%d %d", &a, &b) != EOF ){
printf("%d\n", a + b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177772/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177772/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not3 = icmp eq i32 %call2, -1
br i1 %cmp.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
int i, j;
int ans[302][302];
for (j = 0; j < n; j++)
{
if (j % 2 == 0)
{
for (i = 0; i < n; i++)
ans[i][j] = n * j+ i + 1;
}
else
{
for (i = 0; i < n; i++)
ans[n - i - 1][j] = n * j + i + 1;
}
}
for (i = 0; i < n; i++)
{
for (j = 0; j < n - 1; j++)
printf("%d ", ans[i][j]);
printf("%d\n", ans[i][n - 1]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17783/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17783/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%ans = alloca [302 x [302 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 364816, ptr nonnull %ans) #3
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp75 = icmp sgt i32 %0, 0
br i1 %cmp75, label %for.body.us.us.preheader, label %for.end48
for.body.us.us.preheader: ; preds = %entry
%wide.trip.count120 = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count120, 1
%1 = icmp eq i32 %0, 1
%unroll_iter = and i64 %wide.trip.count120, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%xtraiter131 = and i64 %wide.trip.count120, 3
%2 = icmp ult i32 %0, 4
%unroll_iter133 = and i64 %wide.trip.count120, 4294967292
%lcmp.mod132.not = icmp eq i64 %xtraiter131, 0
br label %for.body.us.us
for.body.us.us: ; preds = %for.body.us.us.preheader, %for.inc22.us.us
%indvars.iv117 = phi i64 [ 0, %for.body.us.us.preheader ], [ %indvars.iv.next118, %for.inc22.us.us ]
%3 = trunc i64 %indvars.iv117 to i32
%rem.us.us = and i32 %3, 1
%cmp1.us.us = icmp eq i32 %rem.us.us, 0
%mul.us.us = mul nsw i32 %0, %3
%add.us.us = add i32 %mul.us.us, 1
br i1 %cmp1.us.us, label %for.body4.us.us.preheader, label %for.body10.us.us.preheader
for.body10.us.us.preheader: ; preds = %for.body.us.us
br i1 %1, label %for.inc22.us.us.loopexit130.unr-lcssa, label %for.body10.us.us
for.body4.us.us.preheader: ; preds = %for.body.us.us
br i1 %2, label %for.inc22.us.us.loopexit.unr-lcssa, label %for.body4.us.us
for.body10.us.us: ; preds = %for.body10.us.us.preheader, %for.body10.us.us
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body10.us.us ], [ 0, %for.body10.us.us.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body10.us.us ], [ 0, %for.body10.us.us.preheader ]
%4 = trunc i64 %indvars.iv to i32
%add13.us.us = add i32 %add.us.us, %4
%5 = trunc i64 %indvars.iv to i32
%6 = xor i32 %5, -1
%sub14.us.us = add i32 %0, %6
%idxprom15.us.us = sext i32 %sub14.us.us to i64
%arrayidx18.us.us = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %idxprom15.us.us, i64 %indvars.iv117
store i32 %add13.us.us, ptr %arrayidx18.us.us, align 4, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%7 = trunc i64 %indvars.iv.next to i32
%add13.us.us.1 = add i32 %add.us.us, %7
%8 = trunc i64 %indvars.iv.next to i32
%9 = xor i32 %8, -1
%sub14.us.us.1 = add i32 %0, %9
%idxprom15.us.us.1 = sext i32 %sub14.us.us.1 to i64
%arrayidx18.us.us.1 = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %idxprom15.us.us.1, i64 %indvars.iv117
store i32 %add13.us.us.1, ptr %arrayidx18.us.us.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.inc22.us.us.loopexit130.unr-lcssa, label %for.body10.us.us, !llvm.loop !9
for.inc22.us.us.loopexit.unr-lcssa: ; preds = %for.body4.us.us, %for.body4.us.us.preheader
%indvars.iv112.unr = phi i64 [ 0, %for.body4.us.us.preheader ], [ %indvars.iv.next113.3, %for.body4.us.us ]
br i1 %lcmp.mod132.not, label %for.inc22.us.us, label %for.body4.us.us.epil
for.body4.us.us.epil: ; preds = %for.inc22.us.us.loopexit.unr-lcssa, %for.body4.us.us.epil
%indvars.iv112.epil = phi i64 [ %indvars.iv.next113.epil, %for.body4.us.us.epil ], [ %indvars.iv112.unr, %for.inc22.us.us.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body4.us.us.epil ], [ 0, %for.inc22.us.us.loopexit.unr-lcssa ]
%10 = trunc i64 %indvars.iv112.epil to i32
%add5.us.us.epil = add i32 %add.us.us, %10
%arrayidx7.us.us.epil = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %indvars.iv112.epil, i64 %indvars.iv117
store i32 %add5.us.us.epil, ptr %arrayidx7.us.us.epil, align 4, !tbaa !5
%indvars.iv.next113.epil = add nuw nsw i64 %indvars.iv112.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter131
br i1 %epil.iter.cmp.not, label %for.inc22.us.us, label %for.body4.us.us.epil, !llvm.loop !11
for.inc22.us.us.loopexit130.unr-lcssa: ; preds = %for.body10.us.us, %for.body10.us.us.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body10.us.us.preheader ], [ %indvars.iv.next.1, %for.body10.us.us ]
br i1 %lcmp.mod.not, label %for.inc22.us.us, label %for.body10.us.us.epil
for.body10.us.us.epil: ; preds = %for.inc22.us.us.loopexit130.unr-lcssa
%11 = trunc i64 %indvars.iv.unr to i32
%add13.us.us.epil = add i32 %add.us.us, %11
%12 = trunc i64 %indvars.iv.unr to i32
%13 = xor i32 %12, -1
%sub14.us.us.epil = add i32 %0, %13
%idxprom15.us.us.epil = sext i32 %sub14.us.us.epil to i64
%arrayidx18.us.us.epil = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %idxprom15.us.us.epil, i64 %indvars.iv117
store i32 %add13.us.us.epil, ptr %arrayidx18.us.us.epil, align 4, !tbaa !5
br label %for.inc22.us.us
for.inc22.us.us: ; preds = %for.body10.us.us.epil, %for.inc22.us.us.loopexit130.unr-lcssa, %for.inc22.us.us.loopexit.unr-lcssa, %for.body4.us.us.epil
%indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
%exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count120
br i1 %exitcond121.not, label %for.cond25.preheader, label %for.body.us.us, !llvm.loop !13
for.body4.us.us: ; preds = %for.body4.us.us.preheader, %for.body4.us.us
%indvars.iv112 = phi i64 [ %indvars.iv.next113.3, %for.body4.us.us ], [ 0, %for.body4.us.us.preheader ]
%niter134 = phi i64 [ %niter134.next.3, %for.body4.us.us ], [ 0, %for.body4.us.us.preheader ]
%14 = trunc i64 %indvars.iv112 to i32
%add5.us.us = add i32 %add.us.us, %14
%arrayidx7.us.us = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %indvars.iv112, i64 %indvars.iv117
store i32 %add5.us.us, ptr %arrayidx7.us.us, align 4, !tbaa !5
%indvars.iv.next113 = or i64 %indvars.iv112, 1
%15 = trunc i64 %indvars.iv.next113 to i32
%add5.us.us.1 = add i32 %add.us.us, %15
%arrayidx7.us.us.1 = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %indvars.iv.next113, i64 %indvars.iv117
store i32 %add5.us.us.1, ptr %arrayidx7.us.us.1, align 4, !tbaa !5
%indvars.iv.next113.1 = or i64 %indvars.iv112, 2
%16 = trunc i64 %indvars.iv.next113.1 to i32
%add5.us.us.2 = add i32 %add.us.us, %16
%arrayidx7.us.us.2 = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %indvars.iv.next113.1, i64 %indvars.iv117
store i32 %add5.us.us.2, ptr %arrayidx7.us.us.2, align 4, !tbaa !5
%indvars.iv.next113.2 = or i64 %indvars.iv112, 3
%17 = trunc i64 %indvars.iv.next113.2 to i32
%add5.us.us.3 = add i32 %add.us.us, %17
%arrayidx7.us.us.3 = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %indvars.iv.next113.2, i64 %indvars.iv117
store i32 %add5.us.us.3, ptr %arrayidx7.us.us.3, align 4, !tbaa !5
%indvars.iv.next113.3 = add nuw nsw i64 %indvars.iv112, 4
%niter134.next.3 = add i64 %niter134, 4
%niter134.ncmp.3 = icmp eq i64 %niter134.next.3, %unroll_iter133
br i1 %niter134.ncmp.3, label %for.inc22.us.us.loopexit.unr-lcssa, label %for.body4.us.us, !llvm.loop !14
for.cond25.preheader: ; preds = %for.inc22.us.us
br i1 %cmp75, label %for.cond28.preheader, label %for.end48
for.cond28.preheader: ; preds = %for.cond25.preheader, %for.end39
%18 = phi i32 [ %23, %for.end39 ], [ %0, %for.cond25.preheader ]
%indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.end39 ], [ 0, %for.cond25.preheader ]
%cmp30102 = icmp sgt i32 %18, 1
br i1 %cmp30102, label %for.body31, label %for.cond28.preheader.for.end39_crit_edge
for.cond28.preheader.for.end39_crit_edge: ; preds = %for.cond28.preheader
%sub29101 = add nsw i32 %18, -1
%.pre = sext i32 %sub29101 to i64
br label %for.end39
for.body31: ; preds = %for.cond28.preheader, %for.body31
%indvars.iv122 = phi i64 [ %indvars.iv.next123, %for.body31 ], [ 0, %for.cond28.preheader ]
%arrayidx35 = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %indvars.iv125, i64 %indvars.iv122
%19 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19)
%indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
%20 = load i32, ptr %n, align 4, !tbaa !5
%sub29 = add nsw i32 %20, -1
%21 = sext i32 %sub29 to i64
%cmp30 = icmp slt i64 %indvars.iv.next123, %21
br i1 %cmp30, label %for.body31, label %for.end39, !llvm.loop !15
for.end39: ; preds = %for.body31, %for.cond28.preheader.for.end39_crit_edge
%idxprom43.pre-phi = phi i64 [ %.pre, %for.cond28.preheader.for.end39_crit_edge ], [ %21, %for.body31 ]
%arrayidx44 = getelementptr inbounds [302 x [302 x i32]], ptr %ans, i64 0, i64 %indvars.iv125, i64 %idxprom43.pre-phi
%22 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
%indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
%23 = load i32, ptr %n, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp26 = icmp slt i64 %indvars.iv.next126, %24
br i1 %cmp26, label %for.cond28.preheader, label %for.end48, !llvm.loop !16
for.end48: ; preds = %for.end39, %entry, %for.cond25.preheader
call void @llvm.lifetime.end.p0(i64 364816, ptr nonnull %ans) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
/*
cat <<EOF >mistaken-paste
*/
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 200000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1000000
#define M_MAX 200000
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
// using namespace std; // HELL
using std::queue;
using std::priority_queue;
using std::stack;
using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
ull n, m;
ull h, w;
ull k;
ull q;
ull vua, vub, vuc, vud, vue, vuf;
sll vsa, vsb, vsc, vsd, vse, vsf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
size_t slen;
size_t tlen;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (x < y) {
return gcd(y, x);
} else if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
void printUquotient (ull left, ull right) {
const int32_t digits = 20;
printf("%llu.", left / right);
left %= right;
for (int32_t i = 0; i < digits; i++) {
left *= 10;
printf("%1d", left / right);
left %= right;
}
puts("");
return;
}
void printSquotient (sll left, sll right) {
if (left * right < 0) putchar('-');
printUquotient(sdiff(left, 0), sdiff(right, 0));
return;
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#ifdef __cplusplus
bool setfind (set<ull> s, ull x) {
return (s.find(x) != s.end());
}
#endif
// double distance (sll x1, sll y1, sll x2, sll y2) {
// double xdist2, ydist2, origindist, dist;
// xdist2 = (x1 - x2) * (x1 - x2);
// ydist2 = (y1 - y2) * (y1 - y2);
// return sqrt(xdist2 + ydist2);
// }
int32_t pullcomp (const void *left, const void *right) {
ull l = *(ull*)left;
ull r = *(ull*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t psllcomp (const void *left, const void *right) {
sll l = *(sll*)left;
sll r = *(sll*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pcharcomp (const void *left, const void *right) {
char l = *(char*)left;
char r = *(char*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
int32_t phwllABcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
return 0;
}
int32_t phwllREVcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
return 0;
}
int32_t ptriplecomp (const void *left, const void *right) {
hwllc l = *(hwllc*)left;
hwllc r = *(hwllc*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
if (l.c < r.c) {
return -1;
}
if (l.c > r.c) {
return +1;
}
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
ull parent[N_MAX];
ull rank[N_MAX];
void uf_init (ull n) {
for (sll i = 0; i < n; i++) {
parent[i] = i;
rank[i] = 0;
}
}
ull uf_find (ull x) {
if (parent[x] == x) return x;
return parent[x] = uf_find(parent[x]);
}
bool uf_union (ull a, ull b) {
a = uf_find(a);
b = uf_find(b);
if (a == b) return false;
if (rank[a] > rank[b]) {
parent[b] = a;
} else {
parent[a] = b;
if (rank[a] == rank[b]) {
rank[b]++;
}
}
return true;
}
sll a[N_MAX];
// sll a[3001][3001];
sll b[N_MAX];
sll c[N_MAX];
char s[N_MAX + 1];
// char s[3010][3010];
// char t[N_MAX + 1];
// char t[3010][3010];
// hwll xy[N_MAX];
hwll zeta[1 << 20];
void update (ull v, ull u) {
sll x[4] = {zeta[v].a, zeta[v].b, zeta[u].a, zeta[u].b};
qsort(x, 4, sizeof(sll), psllcomp);
zeta[v].a = x[3];
zeta[v].b = x[2];
}
ull zans (ull x) {
sll res = zeta[x].a + zeta[x].b;
for (sll i = n - 1; i >= 0; i--) {
if (x & (1 << i)) {
hwll maybe = zeta[(x & ~(1 << i)) | ((1 << i) - 1)];
sll hoge = maybe.a + maybe.b;
if (hoge > res) res = hoge;
}
}
return res;
}
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
ull *dpcell;
for (i = 0; !(i >> n); i++) {
zeta[i].a = a[i];
zeta[i].b = -VERYBIG;
}
for (i = 0; i < n; i++) {
for (j = 0; !(j >> n); j++) {
if ((j >> i & 1) == 1) {
// printf("%llu <= %llu\n", j, (j ^ (1 << i)));
update(j, (j ^ (1 << i)));
}
}
}
// for (i = 0; !(i >> n); i++) {
// printf("[%lld] %lld,%lld\n", i, zeta[i].a, zeta[i].b);
// }
for (i = 1; !(i >> n); i++) {
printf("%llu\n", zans(i));
}
// printf("%llu\n", result);
// printf("%.15lf\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
// puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("First");
return 0;
fail:
// puts("NO");
// puts("No");
// puts("0");
// puts("-1");
// puts("-1 -1 -1");
// puts("Second");
return 1;
}
int32_t main (void) {
int32_t i, j;
int32_t x, y;
// scanf("%lf%lf", &vda, &vdb, &vdc);
// scanf("%lld%lld", &vsa, &vsb, &vsc, &vsd);
// scanf("%llu%llu", &vua, &vub, &vuc, &vud);
// scanf("%*llu%*llu");
// scanf("%llu%llu", &h, &w);
scanf("%llu", &n, &m);
// scanf("%llu%llu", &k, &n);
// scanf("%llu%llu", &vua, &vub, &vuc, &vud, &vue, &vuf);
// vua--;
// vub--;
// vuc--;
// vud--;
// scanf("%lld%lld", &vsa, &vsb, &vsc);
// scanf("%s", s);
// scanf("%s", t);
// scanf("%llu", &k);
// scanf("%llu", &q);
for (i = 0; i < (1 << n); i++) {
scanf("%lld", &a[i]);
// scanf("%lld", &b[i]);
// scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld", &c[i]);
// a[i]--;
// b[i]--;
// c[i]--;
}
// scanf("%llu%llu", &m, &k);
// for (i = 0; i < n; i++) {
// scanf("%llu", &b[i]);
// // b[i]--;
// }
// scanf("%llu", &q);
// for (i = 0; i < n; i++) {
// for (j = 0; j < n; j++) {
// scanf("%llu", &a[i][j]);
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", &s[i]);
// }
// scanf("%llu", &k);
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177873/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177873/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.hwll = type { i64, i64 }
@.str = private unnamed_addr constant [6 x i8] c"%llu.\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%1d\00", align 1
@parent = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@rank = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@zeta = dso_local local_unnamed_addr global [1048576 x %struct.hwll] zeroinitializer, align 16
@n = dso_local global i64 0, align 8
@a = dso_local global [1000000 x i64] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@m = dso_local global i64 0, align 8
@.str.5 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@vua = dso_local local_unnamed_addr global i64 0, align 8
@vub = dso_local local_unnamed_addr global i64 0, align 8
@vuc = dso_local local_unnamed_addr global i64 0, align 8
@vud = dso_local local_unnamed_addr global i64 0, align 8
@vue = dso_local local_unnamed_addr global i64 0, align 8
@vuf = dso_local local_unnamed_addr global i64 0, align 8
@vsa = dso_local local_unnamed_addr global i64 0, align 8
@vsb = dso_local local_unnamed_addr global i64 0, align 8
@vsc = dso_local local_unnamed_addr global i64 0, align 8
@vsd = dso_local local_unnamed_addr global i64 0, align 8
@vse = dso_local local_unnamed_addr global i64 0, align 8
@vsf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@slen = dso_local local_unnamed_addr global i64 0, align 8
@tlen = dso_local local_unnamed_addr global i64 0, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@b = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ]
%y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ]
%cmp = icmp ult i64 %x.tr, %y.tr
br i1 %cmp, label %tailrecurse.backedge, label %if.else
if.else: ; preds = %tailrecurse
%cmp1 = icmp eq i64 %y.tr, 0
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%rem = urem i64 %x.tr, %y.tr
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.else3, %tailrecurse
%y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ]
br label %tailrecurse
return: ; preds = %if.else
ret i64 %x.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%tobool.not12 = icmp eq i64 %x, 0
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.015, %a.addr.014
%rem = urem i64 %mul, %modulo
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ]
%div11 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.014, %a.addr.014
%rem3 = urem i64 %mul2, %modulo
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: 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(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%sub = add i64 %modulo, -2
%tobool.not12.i = icmp eq i64 %sub, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %entry, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, %modulo
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, %modulo
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5
bitpow.exit: ; preds = %if.end.i, %entry
%result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ]
%mul = mul i64 %result.0.lcssa.i, %a
%rem = urem i64 %mul, %modulo
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cmp.not = icmp ult i64 %a, %b
%sub = sub i64 %a, %b
%sub1 = sub i64 %b, %a
%retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %a, %b
%retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printUquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #4 {
entry:
%div = udiv i64 %left, %right
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div)
%left.addr.0 = urem i64 %left, %right
%mul = mul i64 %left.addr.0, 10
%div1 = udiv i64 %mul, %right
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1)
%left.addr.0.1 = urem i64 %mul, %right
%mul.1 = mul i64 %left.addr.0.1, 10
%div1.1 = udiv i64 %mul.1, %right
%call2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.1)
%left.addr.0.2 = urem i64 %mul.1, %right
%mul.2 = mul i64 %left.addr.0.2, 10
%div1.2 = udiv i64 %mul.2, %right
%call2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.2)
%left.addr.0.3 = urem i64 %mul.2, %right
%mul.3 = mul i64 %left.addr.0.3, 10
%div1.3 = udiv i64 %mul.3, %right
%call2.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.3)
%left.addr.0.4 = urem i64 %mul.3, %right
%mul.4 = mul i64 %left.addr.0.4, 10
%div1.4 = udiv i64 %mul.4, %right
%call2.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.4)
%left.addr.0.5 = urem i64 %mul.4, %right
%mul.5 = mul i64 %left.addr.0.5, 10
%div1.5 = udiv i64 %mul.5, %right
%call2.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.5)
%left.addr.0.6 = urem i64 %mul.5, %right
%mul.6 = mul i64 %left.addr.0.6, 10
%div1.6 = udiv i64 %mul.6, %right
%call2.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.6)
%left.addr.0.7 = urem i64 %mul.6, %right
%mul.7 = mul i64 %left.addr.0.7, 10
%div1.7 = udiv i64 %mul.7, %right
%call2.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.7)
%left.addr.0.8 = urem i64 %mul.7, %right
%mul.8 = mul i64 %left.addr.0.8, 10
%div1.8 = udiv i64 %mul.8, %right
%call2.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.8)
%left.addr.0.9 = urem i64 %mul.8, %right
%mul.9 = mul i64 %left.addr.0.9, 10
%div1.9 = udiv i64 %mul.9, %right
%call2.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.9)
%left.addr.0.10 = urem i64 %mul.9, %right
%mul.10 = mul i64 %left.addr.0.10, 10
%div1.10 = udiv i64 %mul.10, %right
%call2.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.10)
%left.addr.0.11 = urem i64 %mul.10, %right
%mul.11 = mul i64 %left.addr.0.11, 10
%div1.11 = udiv i64 %mul.11, %right
%call2.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.11)
%left.addr.0.12 = urem i64 %mul.11, %right
%mul.12 = mul i64 %left.addr.0.12, 10
%div1.12 = udiv i64 %mul.12, %right
%call2.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.12)
%left.addr.0.13 = urem i64 %mul.12, %right
%mul.13 = mul i64 %left.addr.0.13, 10
%div1.13 = udiv i64 %mul.13, %right
%call2.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.13)
%left.addr.0.14 = urem i64 %mul.13, %right
%mul.14 = mul i64 %left.addr.0.14, 10
%div1.14 = udiv i64 %mul.14, %right
%call2.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.14)
%left.addr.0.15 = urem i64 %mul.14, %right
%mul.15 = mul i64 %left.addr.0.15, 10
%div1.15 = udiv i64 %mul.15, %right
%call2.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.15)
%left.addr.0.16 = urem i64 %mul.15, %right
%mul.16 = mul i64 %left.addr.0.16, 10
%div1.16 = udiv i64 %mul.16, %right
%call2.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.16)
%left.addr.0.17 = urem i64 %mul.16, %right
%mul.17 = mul i64 %left.addr.0.17, 10
%div1.17 = udiv i64 %mul.17, %right
%call2.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.17)
%left.addr.0.18 = urem i64 %mul.17, %right
%mul.18 = mul i64 %left.addr.0.18, 10
%div1.18 = udiv i64 %mul.18, %right
%call2.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.18)
%left.addr.0.19 = urem i64 %mul.18, %right
%mul.19 = mul i64 %left.addr.0.19, 10
%div1.19 = udiv i64 %mul.19, %right
%call2.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.19)
%0 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %0)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @printSquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #4 {
entry:
%mul = mul nsw i64 %right, %left
%cmp = icmp slt i64 %mul, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i = tail call noundef i32 @putc(i32 noundef 45, ptr noundef %0)
br label %if.end
if.end: ; preds = %if.then, %entry
%retval.0.i = tail call i64 @llvm.abs.i64(i64 %left, i1 true)
%retval.0.i5 = tail call i64 @llvm.abs.i64(i64 %right, i1 true)
tail call void @printUquotient(i64 noundef %retval.0.i, i64 noundef %retval.0.i5)
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 {
entry:
%tobool.not6 = icmp eq i64 %n, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ]
%0 = trunc i64 %n.addr.07 to i32
%1 = and i32 %0, 1
%spec.select = add i32 %1, %result.08
%div5 = lshr i64 %n.addr.07, 1
%tobool.not = icmp ult i64 %n.addr.07, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !12
%1 = load i64, ptr %right, align 8, !tbaa !12
%cmp = icmp ult i64 %0, %1
%cmp1 = icmp ugt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) #6 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !12
%1 = load i64, ptr %right, align 8, !tbaa !12
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 {
entry:
%0 = load i8, ptr %left, align 1, !tbaa !14
%1 = load i8, ptr %right, align 1, !tbaa !14
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp sgt i8 %0, %1
%. = zext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #7 {
entry:
%0 = load ptr, ptr %left, align 8, !tbaa !7
%1 = load ptr, ptr %right, align 8, !tbaa !7
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !15
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !15
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #3 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #3 {
entry:
%cmp.not = icmp sgt i64 %left, %x
%cmp1.not = icmp sgt i64 %x, %right
%or.cond = or i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %lor.rhs, label %lor.end
lor.rhs: ; preds = %entry
%cmp2 = icmp sge i64 %left, %x
%cmp3 = icmp sge i64 %x, %right
%0 = and i1 %cmp2, %cmp3
br label %lor.end
lor.end: ; preds = %entry, %lor.rhs
%1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ]
ret i1 %1
}
; Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @uf_init(i64 noundef %n) local_unnamed_addr #9 {
entry:
%cmp6.not = icmp eq i64 %n, 0
br i1 %cmp6.not, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = shl nuw i64 %n, 3
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @rank, i8 0, i64 %0, i1 false), !tbaa !12
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%1 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %index
store <2 x i64> %vec.ind, ptr %1, align 16, !tbaa !12
%2 = getelementptr inbounds i64, ptr %1, i64 2
store <2 x i64> %step.add, ptr %2, align 16, !tbaa !12
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
ret void
for.body: ; preds = %for.body.preheader9, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %i.07
store i64 %i.07, ptr %arrayidx, align 8, !tbaa !12
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !21
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @uf_find(i64 noundef %x) local_unnamed_addr #10 {
entry:
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %x
%0 = load i64, ptr %arrayidx, align 8, !tbaa !12
%cmp = icmp eq i64 %0, %x
br i1 %cmp, label %common.ret7, label %if.end
common.ret7: ; preds = %entry, %if.end
%common.ret7.op = phi i64 [ %call, %if.end ], [ %x, %entry ]
ret i64 %common.ret7.op
if.end: ; preds = %entry
%call = tail call i64 @uf_find(i64 noundef %0)
store i64 %call, ptr %arrayidx, align 8, !tbaa !12
br label %common.ret7
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local zeroext i1 @uf_union(i64 noundef %a, i64 noundef %b) local_unnamed_addr #11 {
entry:
%call = tail call i64 @uf_find(i64 noundef %a)
%call1 = tail call i64 @uf_find(i64 noundef %b)
%cmp = icmp ne i64 %call, %call1
br i1 %cmp, label %if.end, label %return
if.end: ; preds = %entry
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %call
%0 = load i64, ptr %arrayidx, align 8, !tbaa !12
%arrayidx2 = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %call1
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !12
%cmp3 = icmp ugt i64 %0, %1
br i1 %cmp3, label %if.then4, label %if.else
if.then4: ; preds = %if.end
%arrayidx5 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %call1
store i64 %call, ptr %arrayidx5, align 8, !tbaa !12
br label %return
if.else: ; preds = %if.end
%arrayidx6 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %call
store i64 %call1, ptr %arrayidx6, align 8, !tbaa !12
%cmp9 = icmp eq i64 %0, %1
br i1 %cmp9, label %if.then10, label %return
if.then10: ; preds = %if.else
%inc = add i64 %0, 1
store i64 %inc, ptr %arrayidx2, align 8, !tbaa !12
br label %return
return: ; preds = %if.then4, %if.then10, %if.else, %entry
ret i1 %cmp
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @update(i64 noundef %v, i64 noundef %u) local_unnamed_addr #4 {
entry:
%x = alloca [4 x i64], align 16
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %x) #17
%arrayidx = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %v
%0 = load <2 x i64>, ptr %arrayidx, align 16, !tbaa !12
store <2 x i64> %0, ptr %x, align 16, !tbaa !12
%arrayinit.element2 = getelementptr inbounds i64, ptr %x, i64 2
%arrayidx3 = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %u
%1 = load <2 x i64>, ptr %arrayidx3, align 16, !tbaa !12
store <2 x i64> %1, ptr %arrayinit.element2, align 16, !tbaa !12
call void @qsort(ptr noundef nonnull %x, i64 noundef 4, i64 noundef 8, ptr noundef nonnull @psllcomp) #17
%2 = load <2 x i64>, ptr %arrayinit.element2, align 16, !tbaa !12
%3 = shufflevector <2 x i64> %2, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
store <2 x i64> %3, ptr %arrayidx, align 16, !tbaa !12
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %x) #17
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @zans(i64 noundef %x) local_unnamed_addr #13 {
entry:
%arrayidx = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %x
%0 = load i64, ptr %arrayidx, align 16, !tbaa !22
%b = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %x, i32 1
%1 = load i64, ptr %b, align 8, !tbaa !24
%add = add nsw i64 %1, %0
%2 = load i64, ptr @n, align 8, !tbaa !12
%i.027 = add i64 %2, -1
%cmp28 = icmp sgt i64 %i.027, -1
br i1 %cmp28, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
%res.0.lcssa = phi i64 [ %add, %entry ], [ %res.2, %for.inc ]
ret i64 %res.0.lcssa
for.body: ; preds = %entry, %for.inc
%i.030 = phi i64 [ %i.0, %for.inc ], [ %i.027, %entry ]
%res.029 = phi i64 [ %res.2, %for.inc ], [ %add, %entry ]
%sh_prom = trunc i64 %i.030 to i32
%shl = shl nuw i32 1, %sh_prom
%conv = sext i32 %shl to i64
%and = and i64 %conv, %x
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%not = xor i32 %shl, -1
%conv4 = sext i32 %not to i64
%and5 = and i64 %conv4, %x
%sub8 = add nsw i32 %shl, -1
%conv9 = sext i32 %sub8 to i64
%or = or i64 %and5, %conv9
%arrayidx10 = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %or
%maybe.sroa.0.0.copyload = load i64, ptr %arrayidx10, align 16, !tbaa.struct !15
%maybe.sroa.4.0.arrayidx10.sroa_idx = getelementptr inbounds i8, ptr %arrayidx10, i64 8
%maybe.sroa.4.0.copyload = load i64, ptr %maybe.sroa.4.0.arrayidx10.sroa_idx, align 8, !tbaa.struct !16
%add13 = add nsw i64 %maybe.sroa.4.0.copyload, %maybe.sroa.0.0.copyload
%spec.select = tail call i64 @llvm.smax.i64(i64 %add13, i64 %res.029)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%res.2 = phi i64 [ %spec.select, %if.then ], [ %res.029, %for.body ]
%i.0 = add nsw i64 %i.030, -1
%cmp = icmp sgt i64 %i.030, 0
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !25
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #4 {
entry:
%x.i = alloca [4 x i64], align 16
%0 = load i64, ptr @n, align 8, !tbaa !12
br label %for.body
for.cond3.preheader: ; preds = %for.body
%cmp55.not = icmp eq i64 %0, 0
br i1 %cmp55.not, label %for.end26, label %for.cond5.preheader.lr.ph
for.cond5.preheader.lr.ph: ; preds = %for.cond3.preheader
%arrayinit.element2.i = getelementptr inbounds i64, ptr %x.i, i64 2
br label %for.cond5.preheader
for.body: ; preds = %entry, %for.body
%i.053 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %i.053
%1 = load i64, ptr %arrayidx, align 8, !tbaa !12
%arrayidx1 = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %i.053
store i64 %1, ptr %arrayidx1, align 16, !tbaa !22
%b = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %i.053, i32 1
store i64 -200000000000007, ptr %b, align 8, !tbaa !24
%inc = add nuw nsw i64 %i.053, 1
%shr = lshr i64 %inc, %0
%tobool.not = icmp eq i64 %shr, 0
br i1 %tobool.not, label %for.body, label %for.cond3.preheader, !llvm.loop !26
for.cond5.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.inc15
%2 = phi i64 [ %0, %for.cond5.preheader.lr.ph ], [ %11, %for.inc15 ]
%i.156 = phi i64 [ 0, %for.cond5.preheader.lr.ph ], [ %inc16, %for.inc15 ]
%3 = shl nuw i64 1, %i.156
%sh_prom = trunc i64 %i.156 to i32
%shl = shl nuw i32 1, %sh_prom
%conv = sext i32 %shl to i64
br label %for.body9
for.cond18.preheader: ; preds = %for.inc15
%tobool20.not58.not = icmp eq i64 %11, 0
br i1 %tobool20.not58.not, label %for.end26, label %for.body22
for.body9: ; preds = %for.cond5.preheader, %for.inc12
%4 = phi i64 [ %2, %for.cond5.preheader ], [ %11, %for.inc12 ]
%5 = phi i64 [ %2, %for.cond5.preheader ], [ %12, %for.inc12 ]
%j.054 = phi i64 [ 0, %for.cond5.preheader ], [ %inc13, %for.inc12 ]
%6 = and i64 %j.054, %3
%cmp11.not = icmp eq i64 %6, 0
br i1 %cmp11.not, label %for.inc12, label %if.then
if.then: ; preds = %for.body9
%xor = xor i64 %j.054, %conv
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %x.i) #17
%arrayidx.i = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %j.054
%7 = load <2 x i64>, ptr %arrayidx.i, align 16, !tbaa !12
store <2 x i64> %7, ptr %x.i, align 16, !tbaa !12
%arrayidx3.i = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %xor
%8 = load <2 x i64>, ptr %arrayidx3.i, align 16, !tbaa !12
store <2 x i64> %8, ptr %arrayinit.element2.i, align 16, !tbaa !12
call void @qsort(ptr noundef nonnull %x.i, i64 noundef 4, i64 noundef 8, ptr noundef nonnull @psllcomp) #17
%9 = load <2 x i64>, ptr %arrayinit.element2.i, align 16, !tbaa !12
%10 = shufflevector <2 x i64> %9, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
store <2 x i64> %10, ptr %arrayidx.i, align 16, !tbaa !12
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %x.i) #17
%.pre = load i64, ptr @n, align 8, !tbaa !12
br label %for.inc12
for.inc12: ; preds = %for.body9, %if.then
%11 = phi i64 [ %4, %for.body9 ], [ %.pre, %if.then ]
%12 = phi i64 [ %5, %for.body9 ], [ %.pre, %if.then ]
%inc13 = add nuw nsw i64 %j.054, 1
%shr6 = lshr i64 %inc13, %12
%tobool7.not = icmp eq i64 %shr6, 0
br i1 %tobool7.not, label %for.body9, label %for.inc15, !llvm.loop !27
for.inc15: ; preds = %for.inc12
%inc16 = add nuw nsw i64 %i.156, 1
%cmp = icmp ult i64 %inc16, %11
br i1 %cmp, label %for.cond5.preheader, label %for.cond18.preheader, !llvm.loop !28
for.body22: ; preds = %for.cond18.preheader, %zans.exit
%13 = phi i64 [ %16, %zans.exit ], [ %11, %for.cond18.preheader ]
%i.259 = phi i64 [ %inc25, %zans.exit ], [ 1, %for.cond18.preheader ]
%arrayidx.i51 = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %i.259
%14 = load i64, ptr %arrayidx.i51, align 16, !tbaa !22
%b.i52 = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %i.259, i32 1
%15 = load i64, ptr %b.i52, align 8, !tbaa !24
%add.i = add nsw i64 %15, %14
%i.027.i = add i64 %13, -1
%cmp28.i = icmp sgt i64 %i.027.i, -1
br i1 %cmp28.i, label %for.body.i, label %zans.exit
for.body.i: ; preds = %for.body22, %for.inc.i
%i.030.i = phi i64 [ %i.0.i, %for.inc.i ], [ %i.027.i, %for.body22 ]
%res.029.i = phi i64 [ %res.2.i, %for.inc.i ], [ %add.i, %for.body22 ]
%sh_prom.i = trunc i64 %i.030.i to i32
%shl.i = shl nuw i32 1, %sh_prom.i
%conv.i = sext i32 %shl.i to i64
%and.i = and i64 %i.259, %conv.i
%tobool.not.i = icmp eq i64 %and.i, 0
br i1 %tobool.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%not.i = xor i32 %shl.i, -1
%conv4.i = sext i32 %not.i to i64
%and5.i = and i64 %i.259, %conv4.i
%sub8.i = add nsw i32 %shl.i, -1
%conv9.i = sext i32 %sub8.i to i64
%or.i = or i64 %and5.i, %conv9.i
%arrayidx10.i = getelementptr inbounds [1048576 x %struct.hwll], ptr @zeta, i64 0, i64 %or.i
%maybe.sroa.0.0.copyload.i = load i64, ptr %arrayidx10.i, align 16, !tbaa.struct !15
%maybe.sroa.4.0.arrayidx10.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx10.i, i64 8
%maybe.sroa.4.0.copyload.i = load i64, ptr %maybe.sroa.4.0.arrayidx10.sroa_idx.i, align 8, !tbaa.struct !16
%add13.i = add nsw i64 %maybe.sroa.4.0.copyload.i, %maybe.sroa.0.0.copyload.i
%spec.select.i = call i64 @llvm.smax.i64(i64 %add13.i, i64 %res.029.i)
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%res.2.i = phi i64 [ %spec.select.i, %if.then.i ], [ %res.029.i, %for.body.i ]
%i.0.i = add nsw i64 %i.030.i, -1
%cmp.i = icmp sgt i64 %i.030.i, 0
br i1 %cmp.i, label %for.body.i, label %zans.exit, !llvm.loop !25
zans.exit: ; preds = %for.inc.i, %for.body22
%res.0.lcssa.i = phi i64 [ %add.i, %for.body22 ], [ %res.2.i, %for.inc.i ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %res.0.lcssa.i)
%inc25 = add nuw nsw i64 %i.259, 1
%16 = load i64, ptr @n, align 8, !tbaa !12
%shr19 = lshr i64 %inc25, %16
%tobool20.not = icmp eq i64 %shr19, 0
br i1 %tobool20.not, label %for.body22, label %for.end26, !llvm.loop !29
for.end26: ; preds = %zans.exit, %for.cond3.preheader, %for.cond18.preheader
ret i64 0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i64, ptr @n, align 8, !tbaa !12
%1 = and i64 %0, 4294967295
%cmp7.not = icmp eq i64 %1, 31
br i1 %cmp7.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @a, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i64, ptr @n, align 8, !tbaa !12
%sh_prom = trunc i64 %2 to i32
%shl = shl nuw i32 1, %sh_prom
%3 = sext i32 %shl to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !30
for.end: ; preds = %for.body, %entry
%call2 = tail call i64 @solve()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #14
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #15
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nofree 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 #12 = { 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 #13 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #15 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #16 = { nounwind willreturn memory(read) }
attributes #17 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{!9, !9, i64 0}
!15 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!16 = !{i64 0, i64 8, !12}
!17 = !{i64 0, i64 8, !12, i64 8, i64 8, !12, i64 16, i64 8, !12}
!18 = distinct !{!18, !6, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !6, !20, !19}
!22 = !{!23, !13, i64 0}
!23 = !{!"", !13, i64 0, !13, i64 8}
!24 = !{!23, !13, i64 8}
!25 = distinct !{!25, !6}
!26 = distinct !{!26, !6}
!27 = distinct !{!27, !6}
!28 = distinct !{!28, !6}
!29 = distinct !{!29, !6}
!30 = distinct !{!30, !6}
|
#include<stdio.h>
#include<stdlib.h>
typedef struct n{
char s[101];
}n;
int main(){
int a,b;
scanf("%d %d",&a,&b);
n c[a];
for(int i=0; i<a; i++){
scanf("%s",c[i].s);
}
for(int i=0; i<b+2; i++){
printf("#");
}
printf("\n");
for(int i=0; i<a; i++){
printf("#%s#\n",c[i].s);
}
for(int i=0; i<b+2; i++){
printf("#");
}
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177923/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177923/source.c"
target datalayout = "e-m:e-p270: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.n = type { [101 x i8] }
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"#%s#\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%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 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca %struct.n, i64 %1, align 16
%3 = load i32, ptr %a, align 4, !tbaa !5
%cmp43 = icmp sgt i32 %3, 0
br i1 %cmp43, label %for.body, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.body, %entry
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp446 = icmp sgt i32 %4, -2
br i1 %cmp446, label %for.body6, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.n, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %a, 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.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.body6, %for.cond3.preheader
%putchar = call i32 @putchar(i32 10)
%7 = load i32, ptr %a, align 4, !tbaa !5
%cmp1448 = icmp sgt i32 %7, 0
br i1 %cmp1448, label %for.body16, label %for.cond26.preheader
for.body6: ; preds = %for.cond3.preheader, %for.body6
%i2.047 = phi i32 [ %inc9, %for.body6 ], [ 0, %for.cond3.preheader ]
%putchar42 = call i32 @putchar(i32 35)
%inc9 = add nuw nsw i32 %i2.047, 1
%8 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %i2.047, %8
br i1 %cmp4.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !11
for.cond26.preheader: ; preds = %for.body16, %for.cond.cleanup5
%9 = load i32, ptr %b, align 4, !tbaa !5
%cmp2851 = icmp sgt i32 %9, -2
br i1 %cmp2851, label %for.body30, label %for.cond.cleanup29
for.body16: ; preds = %for.cond.cleanup5, %for.body16
%indvars.iv54 = phi i64 [ %indvars.iv.next55, %for.body16 ], [ 0, %for.cond.cleanup5 ]
%arrayidx18 = getelementptr inbounds %struct.n, ptr %vla, i64 %indvars.iv54
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %arrayidx18)
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%10 = load i32, ptr %a, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp14 = icmp slt i64 %indvars.iv.next55, %11
br i1 %cmp14, label %for.body16, label %for.cond26.preheader, !llvm.loop !12
for.cond.cleanup29: ; preds = %for.body30, %for.cond26.preheader
call void @llvm.stackrestore.p0(ptr %2)
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
for.body30: ; preds = %for.cond26.preheader, %for.body30
%i25.052 = phi i32 [ %inc33, %for.body30 ], [ 0, %for.cond26.preheader ]
%putchar41 = call i32 @putchar(i32 35)
%inc33 = add nuw nsw i32 %i25.052, 1
%12 = load i32, ptr %b, align 4, !tbaa !5
%cmp28.not = icmp sgt i32 %i25.052, %12
br i1 %cmp28.not, label %for.cond.cleanup29, label %for.body30, !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
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <stdbool.h>
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define PI 3.14159265358979323846;
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
/*
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r)
*/
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r)
#define TYPE long long
#define ll long long
#define MEMSET(a) memset(a,0,sizeof(a))
#define MEMSET_U(a) memset(a,-1,sizeof(a))
#define bool _Bool
const int mod = (int)1e09 + 7;
//#define DEBUG1
//#define DEBUG2
//#define DEBUGF
#define DUMMY
int in(void) { int i; scanf("%d", &i); return i; }
long long llin(void) { long long i; scanf("%lld", &i); return i; }
double din(void) { double i; scanf("%lf", &i); return i; }
void chin(char s[]) { scanf("%s", s); }
void print(int a) { printf("%d\n", a); }
void llprint(long long a) { printf("%lld\n", a); }
void dprint(double a) { printf("%.10f\n", a); }
void print2(int a, int b) { printf("%d %d\n", a, b); }
int Max(int a, int b) { if (a > b) { return a; }return b; }
int Min(int a, int b) { if (a < b) { return a; }return b; }
long long llmax(long long a, long long b) { return a > b ? a : b; }
long long llmin(long long a, long long b) { return a < b ? a : b; }
double dmax(double a, double b) { return a > b ? a : b; }
double dmin(double a, double b) { return a < b ? a : b; }
//long long llmax(long long a, long long b) { return a > b ? a : b; }
//long long llmin(long long a, long long b) { return a < b ? a : b; }
//double dmax(double a, double b) { return a > b ? a : b; }
int cmp(const void *a, const void *b) { return *(TYPE *)a - *(TYPE *)b; }
int cmp_r(const void *a, const void *b) { return *(TYPE *)b - *(TYPE *)a; }
int char_cmp(const void *a, const void *b) { return strcmp((char *)a, (char *)b); }
int char_cmp_r(const void *a, const void *b) { return strcmp((char *)b, (char *)a); }
void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; }
int main() {
int H, W;
scanf("%d%d", &H, &W);
char f[101][101];
for (int i = 0; i < H; i++) {
scanf("%s", f[i]);
}
for (int i = 0; i < H + 2; i++) {
if (i == 0 || i == H + 1) {
for (int j = 0; j < W + 2; j++) {
printf("#");
}
}
else {
printf("#%s#", f[i-1]);
}
printf("\n");
}
#ifdef DEBUGF
getch();
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177967/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177967/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@.str.8 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.10 = private unnamed_addr constant [5 x i8] c"#%s#\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #11
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @llin() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @din() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b)
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @Max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @Min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmin(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp olt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !9
%1 = load i64, ptr %a, align 8, !tbaa !9
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #12
ret i32 %call
}
; 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 #8 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
%f = alloca [101 x [101 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %H, ptr noundef nonnull %W)
call void @llvm.lifetime.start.p0(i64 10201, ptr nonnull %f) #11
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %2, %for.body ]
%cmp441 = icmp sgt i32 %1, -2
br i1 %cmp441, label %for.body6, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x [101 x i8]], ptr %f, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %H, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !13
for.cond.cleanup5: ; preds = %if.end, %for.cond3.preheader
call void @llvm.lifetime.end.p0(i64 10201, ptr nonnull %f) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #11
ret i32 0
for.body6: ; preds = %for.cond3.preheader, %if.end
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %if.end ], [ 0, %for.cond3.preheader ]
%4 = phi i32 [ %9, %if.end ], [ %1, %for.cond3.preheader ]
%cmp7 = icmp eq i64 %indvars.iv44, 0
%add8 = add nsw i32 %4, 1
%5 = zext i32 %add8 to i64
%cmp9 = icmp eq i64 %indvars.iv44, %5
%or.cond = select i1 %cmp7, i1 true, i1 %cmp9
br i1 %or.cond, label %for.cond10.preheader, label %if.else
for.cond10.preheader: ; preds = %for.body6
%6 = load i32, ptr %W, align 4, !tbaa !5
%cmp1238 = icmp sgt i32 %6, -2
br i1 %cmp1238, label %for.body14, label %if.end
for.body14: ; preds = %for.cond10.preheader, %for.body14
%j.039 = phi i32 [ %inc17, %for.body14 ], [ 0, %for.cond10.preheader ]
%putchar34 = call i32 @putchar(i32 35)
%inc17 = add nuw nsw i32 %j.039, 1
%7 = load i32, ptr %W, align 4, !tbaa !5
%cmp12.not = icmp sgt i32 %j.039, %7
br i1 %cmp12.not, label %if.end, label %for.body14, !llvm.loop !15
if.else: ; preds = %for.body6
%8 = add nsw i64 %indvars.iv44, -1
%arrayidx20 = getelementptr inbounds [101 x [101 x i8]], ptr %f, i64 0, i64 %8
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef nonnull %arrayidx20)
br label %if.end
if.end: ; preds = %for.body14, %for.cond10.preheader, %if.else
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%9 = load i32, ptr %H, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp4.not = icmp sgt i64 %indvars.iv44, %10
br i1 %cmp4.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !16
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #9
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #9
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-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(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 #8 = { 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nofree nounwind }
attributes #11 = { nounwind }
attributes #12 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
|
#include<stdio.h>
int main()
{
int a,b,i,j,m,l,q,r;
char ch[150][150];
while(scanf("%d%d",&a,&b)!=EOF)
{
getchar();
for(i=1;i<=a;i++)
{
for(j=1;j<=b;j++)
scanf("%c",&ch[i][j]);
getchar();
}
for(m=1;m<=b+2;m++)
printf("#");
printf("\n");
for(l=1;l<=a;l++)
{
printf("#");
for(q=1;q<=b;q++)
printf("%c",ch[l][q]);
printf("#");
printf("\n");
}
for(r=1;r<=b+2;r++)
printf("#");
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178030/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178030/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\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:
%a = alloca i32, align 4
%b = alloca i32, align 4
%ch = alloca [150 x [150 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 22500, ptr nonnull %ch) #4
%call83 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not84 = icmp eq i32 %call83, -1
br i1 %cmp.not84, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end49
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call i32 @getc(ptr noundef %0)
%1 = load i32, ptr %a, align 4, !tbaa !9
%cmp2.not71 = icmp slt i32 %1, 1
br i1 %cmp2.not71, label %for.cond13.preheader, label %for.cond3.preheader
for.cond13.preheader: ; preds = %for.end, %while.body
%2 = load i32, ptr %b, align 4, !tbaa !9
%cmp14.not74 = icmp slt i32 %2, -1
br i1 %cmp14.not74, label %for.end19, label %for.body15
for.cond3.preheader: ; preds = %while.body, %for.end
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.end ], [ 1, %while.body ]
%3 = load i32, ptr %b, align 4, !tbaa !9
%cmp4.not69 = icmp slt i32 %3, 1
br i1 %cmp4.not69, label %for.end, label %for.body5
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 1, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [150 x [150 x i8]], ptr %ch, i64 0, i64 %indvars.iv86, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %b, align 4, !tbaa !9
%5 = sext i32 %4 to i64
%cmp4.not.not = icmp slt i64 %indvars.iv, %5
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body5, %for.cond3.preheader
%6 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i68 = call i32 @getc(ptr noundef %6)
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%7 = load i32, ptr %a, align 4, !tbaa !9
%8 = sext i32 %7 to i64
%cmp2.not.not = icmp slt i64 %indvars.iv86, %8
br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.cond13.preheader, !llvm.loop !13
for.body15: ; preds = %for.cond13.preheader, %for.body15
%m.075 = phi i32 [ %inc18, %for.body15 ], [ 1, %for.cond13.preheader ]
%putchar67 = call i32 @putchar(i32 35)
%inc18 = add nuw nsw i32 %m.075, 1
%9 = load i32, ptr %b, align 4, !tbaa !9
%add = add nsw i32 %9, 2
%cmp14.not.not = icmp slt i32 %m.075, %add
br i1 %cmp14.not.not, label %for.body15, label %for.end19, !llvm.loop !14
for.end19: ; preds = %for.body15, %for.cond13.preheader
%putchar = call i32 @putchar(i32 10)
%10 = load i32, ptr %a, align 4, !tbaa !9
%cmp22.not78 = icmp slt i32 %10, 1
br i1 %cmp22.not78, label %for.cond41.preheader, label %for.body23
for.cond41.preheader: ; preds = %for.end35, %for.end19
%11 = load i32, ptr %b, align 4, !tbaa !9
%cmp43.not81 = icmp slt i32 %11, -1
br i1 %cmp43.not81, label %for.end49, label %for.body45
for.body23: ; preds = %for.end19, %for.end35
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.end35 ], [ 1, %for.end19 ]
%putchar63 = call i32 @putchar(i32 35)
%12 = load i32, ptr %b, align 4, !tbaa !9
%cmp26.not76 = icmp slt i32 %12, 1
br i1 %cmp26.not76, label %for.end35, label %for.body27
for.body27: ; preds = %for.body23, %for.body27
%indvars.iv89 = phi i64 [ %indvars.iv.next90, %for.body27 ], [ 1, %for.body23 ]
%arrayidx31 = getelementptr inbounds [150 x [150 x i8]], ptr %ch, i64 0, i64 %indvars.iv92, i64 %indvars.iv89
%13 = load i8, ptr %arrayidx31, align 1, !tbaa !15
%conv = sext i8 %13 to i32
%putchar66 = call i32 @putchar(i32 %conv)
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%14 = load i32, ptr %b, align 4, !tbaa !9
%15 = sext i32 %14 to i64
%cmp26.not.not = icmp slt i64 %indvars.iv89, %15
br i1 %cmp26.not.not, label %for.body27, label %for.end35, !llvm.loop !16
for.end35: ; preds = %for.body27, %for.body23
%putchar64 = call i32 @putchar(i32 35)
%putchar65 = call i32 @putchar(i32 10)
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%16 = load i32, ptr %a, align 4, !tbaa !9
%17 = sext i32 %16 to i64
%cmp22.not.not = icmp slt i64 %indvars.iv92, %17
br i1 %cmp22.not.not, label %for.body23, label %for.cond41.preheader, !llvm.loop !17
for.body45: ; preds = %for.cond41.preheader, %for.body45
%r.082 = phi i32 [ %inc48, %for.body45 ], [ 1, %for.cond41.preheader ]
%putchar62 = call i32 @putchar(i32 35)
%inc48 = add nuw nsw i32 %r.082, 1
%18 = load i32, ptr %b, align 4, !tbaa !9
%add42 = add nsw i32 %18, 2
%cmp43.not.not = icmp slt i32 %r.082, %add42
br i1 %cmp43.not.not, label %for.body45, label %for.end49, !llvm.loop !18
for.end49: ; preds = %for.body45, %for.cond41.preheader
%putchar61 = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !19
while.end: ; preds = %for.end49, %entry
call void @llvm.lifetime.end.p0(i64 22500, ptr nonnull %ch) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
; 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
|
#include <stdio.h>
int main()
{
int H,W,i;
scanf("%d %d",&H,&W);
char P[H][W+1];
for(i=0;i<H;i++) scanf("%s",P[i]);
for(i=0;i<W+2;i++) printf("#");
puts("");
for(i=0;i<H;i++) printf("#%s#\n",P[i]);
for(i=0;i<W+2;i++) printf("#");
puts("");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178096/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178096/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"#%s#\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = load i32, ptr %W, align 4, !tbaa !5
%add = add nsw i32 %2, 1
%3 = zext i32 %add to i64
%4 = call ptr @llvm.stacksave.p0()
%5 = mul nuw i64 %3, %1
%vla = alloca i8, i64 %5, align 16
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp41 = icmp sgt i32 %6, 0
br i1 %cmp41, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%7 = load i32, ptr %W, align 4, !tbaa !5
%cmp444 = icmp sgt i32 %7, -2
br i1 %cmp444, label %for.body5, label %for.end9
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%8 = mul nuw nsw i64 %indvars.iv, %3
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %8
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %H, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body5: ; preds = %for.cond2.preheader, %for.body5
%i.145 = phi i32 [ %inc8, %for.body5 ], [ 0, %for.cond2.preheader ]
%putchar40 = call i32 @putchar(i32 35)
%inc8 = add nuw nsw i32 %i.145, 1
%11 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %i.145, %11
br i1 %cmp4.not, label %for.end9, label %for.body5, !llvm.loop !11
for.end9: ; preds = %for.body5, %for.cond2.preheader
%putchar = call i32 @putchar(i32 10)
%12 = load i32, ptr %H, align 4, !tbaa !5
%cmp1246 = icmp sgt i32 %12, 0
br i1 %cmp1246, label %for.body13, label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.body13, %for.end9
%13 = load i32, ptr %W, align 4, !tbaa !5
%cmp2249 = icmp sgt i32 %13, -2
br i1 %cmp2249, label %for.body23, label %for.end27
for.body13: ; preds = %for.end9, %for.body13
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body13 ], [ 0, %for.end9 ]
%14 = mul nuw nsw i64 %indvars.iv52, %3
%arrayidx15 = getelementptr inbounds i8, ptr %vla, i64 %14
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %arrayidx15)
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%15 = load i32, ptr %H, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp12 = icmp slt i64 %indvars.iv.next53, %16
br i1 %cmp12, label %for.body13, label %for.cond20.preheader, !llvm.loop !12
for.body23: ; preds = %for.cond20.preheader, %for.body23
%i.350 = phi i32 [ %inc26, %for.body23 ], [ 0, %for.cond20.preheader ]
%putchar39 = call i32 @putchar(i32 35)
%inc26 = add nuw nsw i32 %i.350, 1
%17 = load i32, ptr %W, align 4, !tbaa !5
%cmp22.not = icmp sgt i32 %i.350, %17
br i1 %cmp22.not, label %for.end27, label %for.body23, !llvm.loop !13
for.end27: ; preds = %for.body23, %for.cond20.preheader
%putchar38 = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(){
int i, j, h, w;
char c[110][110];
scanf("%d %d", &h, &w);
for(i = 0; i < h; i++){
scanf("%s", c[i]);
// getchar();
// for(j = 0; j < w; j++){
// scanf("%c", &c[i][j]);
// }
}
for(i = -1; i <= h; i++){
for(j = -1; j <= w; j++){
if(i == -1 || i == h || j == -1 || j == w){
printf("#");
}else{
printf("%c", c[i][j]);
}
}
printf("\n");
getchar();
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178146/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178146/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%c = alloca [110 x [110 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 12100, ptr nonnull %c) #4
%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
%cmp42 = icmp sgt i32 %0, 0
br i1 %cmp42, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %2, %for.body ]
%cmp3.not47 = icmp slt i32 %1, -1
br i1 %cmp3.not47, label %for.end27, label %for.cond5.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [110 x [110 x i8]], ptr %c, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %h, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond5.preheader: ; preds = %for.cond2.preheader, %for.end22
%indvars.iv55 = phi i64 [ %indvars.iv.next56, %for.end22 ], [ -1, %for.cond2.preheader ]
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp6.not44 = icmp slt i32 %4, -1
br i1 %cmp6.not44, label %for.end22, label %for.body7.lr.ph
for.body7.lr.ph: ; preds = %for.cond5.preheader
%5 = icmp eq i64 %indvars.iv55, -1
br i1 %5, label %for.body7.us, label %for.body7.preheader
for.body7.preheader: ; preds = %for.body7.lr.ph
%6 = trunc i64 %indvars.iv55 to i32
br label %for.body7
for.body7.us: ; preds = %for.body7.lr.ph, %for.body7.us
%j.045.us = phi i32 [ %inc21.us, %for.body7.us ], [ -1, %for.body7.lr.ph ]
%putchar40.us = call i32 @putchar(i32 35)
%inc21.us = add nsw i32 %j.045.us, 1
%7 = load i32, ptr %w, align 4, !tbaa !5
%cmp6.not.us.not = icmp slt i32 %j.045.us, %7
br i1 %cmp6.not.us.not, label %for.body7.us, label %for.end22, !llvm.loop !11
for.body7: ; preds = %for.body7.preheader, %for.inc20
%indvars.iv52 = phi i64 [ -1, %for.body7.preheader ], [ %indvars.iv.next53, %for.inc20 ]
%8 = phi i32 [ %4, %for.body7.preheader ], [ %13, %for.inc20 ]
%9 = load i32, ptr %h, align 4, !tbaa !5
%cmp9 = icmp eq i32 %9, %6
%10 = icmp eq i64 %indvars.iv52, -1
%or.cond = or i1 %10, %cmp9
%11 = trunc i64 %indvars.iv52 to i32
%cmp13 = icmp eq i32 %8, %11
%or.cond41 = or i1 %cmp13, %or.cond
br i1 %or.cond41, label %for.inc20, label %if.else
if.else: ; preds = %for.body7
%arrayidx18 = getelementptr inbounds [110 x [110 x i8]], ptr %c, i64 0, i64 %indvars.iv55, i64 %indvars.iv52
%12 = load i8, ptr %arrayidx18, align 1, !tbaa !12
%conv = sext i8 %12 to i32
br label %for.inc20
for.inc20: ; preds = %for.body7, %if.else
%.sink = phi i32 [ %conv, %if.else ], [ 35, %for.body7 ]
%putchar40 = call i32 @putchar(i32 %.sink)
%indvars.iv.next53 = add nsw i64 %indvars.iv52, 1
%13 = load i32, ptr %w, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp6.not.not = icmp slt i64 %indvars.iv52, %14
br i1 %cmp6.not.not, label %for.body7, label %for.end22, !llvm.loop !11
for.end22: ; preds = %for.inc20, %for.body7.us, %for.cond5.preheader
%putchar = call i32 @putchar(i32 10)
%15 = load ptr, ptr @stdin, align 8, !tbaa !13
%call.i = call i32 @getc(ptr noundef %15)
%indvars.iv.next56 = add nsw i64 %indvars.iv55, 1
%16 = load i32, ptr %h, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv55, %17
br i1 %cmp3.not.not, label %for.cond5.preheader, label %for.end27, !llvm.loop !15
for.end27: ; preds = %for.end22, %for.cond2.preheader
call void @llvm.lifetime.end.p0(i64 12100, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main() {
unsigned long long n;
char str[16];
int ans, i, len, T;
scanf("%d", &T);
while (T--) {
scanf("%lld", &n);
if (n % 2050)
printf("-1\n");
else {
for (ans = 0, i = 0, len = sprintf(str, "%lld", n / 2050); i < len; ++i)
ans += (str[i] - '0');
printf("%d\n", ans);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17819/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17819/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%str = alloca [16 x i8], align 16
%T = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %str) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%dec12 = add nsw i32 %0, -1
store i32 %dec12, ptr %T, align 4, !tbaa !5
%tobool.not13 = icmp eq i32 %0, 0
br i1 %tobool.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !9
%rem = urem i64 %1, 2050
%div = udiv i64 %1, 2050
%tobool2.not = icmp eq i64 %rem, 0
br i1 %tobool2.not, label %if.else, label %if.then
if.then: ; preds = %while.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %while.body
%call4 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %str, ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) #5
%cmp9 = icmp sgt i32 %call4, 0
br i1 %cmp9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %if.else
%wide.trip.count = zext i32 %call4 to i64
%min.iters.check = icmp ult i32 %call4, 8
br i1 %min.iters.check, label %for.body.preheader17, 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 ], [ %8, %vector.body ]
%vec.phi15 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%2 = getelementptr inbounds [16 x i8], ptr %str, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %2, align 8, !tbaa !11
%3 = getelementptr inbounds i8, ptr %2, i64 4
%wide.load16 = load <4 x i8>, ptr %3, align 4, !tbaa !11
%4 = sext <4 x i8> %wide.load to <4 x i32>
%5 = sext <4 x i8> %wide.load16 to <4 x i32>
%6 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48>
%7 = add <4 x i32> %vec.phi15, <i32 -48, i32 -48, i32 -48, i32 -48>
%8 = add <4 x i32> %6, %4
%9 = add <4 x i32> %7, %5
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %9, %8
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader17
for.body.preheader17: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ans.011.ph = phi i32 [ 0, %for.body.preheader ], [ %11, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader17, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader17 ]
%ans.011 = phi i32 [ %add, %for.body ], [ %ans.011.ph, %for.body.preheader17 ]
%arrayidx = getelementptr inbounds [16 x i8], ptr %str, i64 0, i64 %indvars.iv
%12 = load i8, ptr %arrayidx, align 1, !tbaa !11
%conv = sext i8 %12 to i32
%sub = add i32 %ans.011, -48
%add = add i32 %sub, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !16
for.end: ; preds = %for.body, %middle.block, %if.else
%ans.0.lcssa = phi i32 [ 0, %if.else ], [ %11, %middle.block ], [ %add, %for.body ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %ans.0.lcssa)
br label %if.end
if.end: ; preds = %for.end, %if.then
%13 = load i32, ptr %T, align 4, !tbaa !5
%dec = add nsw i32 %13, -1
store i32 %dec, ptr %T, align 4, !tbaa !5
%tobool.not = icmp eq i32 %13, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !17
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %str) #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: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare 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 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13, !14, !15}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !13, !15, !14}
!17 = distinct !{!17, !13}
|
#include<stdio.h>
int main(){
int N,K,i,j,tmp,ans;
scanf("%d %d",&N,&K);
int p[N];
for(i = 0; i < N; i++){
scanf("%d",&p[i]);
}
for(i = 0; i < N; i++){
for(j = i + 1; j < N; j++){
if(p[i] > p[j]){
tmp = p[i];
p[i] = p[j];
p[j] = tmp;
}
}
}
ans = 0;
for(i = 0; i < K; i++){
ans += p[i];
}
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178232/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178232/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%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
%cmp54 = icmp sgt i32 %3, 0
br i1 %cmp54, label %for.body, label %for.cond27.preheader
for.cond2.preheader: ; preds = %for.body
%cmp358 = icmp sgt i32 %5, 0
br i1 %cmp358, label %for.body4.preheader, label %for.cond27.preheader
for.body4.preheader: ; preds = %for.cond2.preheader
%4 = zext i32 %5 to i64
%wide.trip.count74 = zext i32 %5 to i64
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond2.loopexit: ; preds = %for.inc21, %for.body4
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
br i1 %exitcond75.not, label %for.cond27.preheader, label %for.body4, !llvm.loop !11
for.cond27.preheader: ; preds = %for.cond2.loopexit, %entry, %for.cond2.preheader
%7 = load i32, ptr %K, align 4, !tbaa !5
%cmp2860 = icmp sgt i32 %7, 0
br i1 %cmp2860, label %for.body29.preheader, label %for.end35
for.body29.preheader: ; preds = %for.cond27.preheader
%wide.trip.count79 = zext i32 %7 to i64
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body29.preheader85, label %vector.ph
vector.ph: ; preds = %for.body29.preheader
%n.vec = and i64 %wide.trip.count79, 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 ], [ %10, %vector.body ]
%vec.phi83 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%8 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load84 = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = add <4 x i32> %wide.load, %vec.phi
%11 = add <4 x i32> %wide.load84, %vec.phi83
%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 !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %11, %10
%13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count79
br i1 %cmp.n, label %for.end35, label %for.body29.preheader85
for.body29.preheader85: ; preds = %for.body29.preheader, %middle.block
%indvars.iv76.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec, %middle.block ]
%ans.061.ph = phi i32 [ 0, %for.body29.preheader ], [ %13, %middle.block ]
br label %for.body29
for.body4: ; preds = %for.body4.preheader, %for.cond2.loopexit
%indvars.iv71 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next72, %for.cond2.loopexit ]
%indvars.iv66 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next67, %for.cond2.loopexit ]
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%cmp656 = icmp ult i64 %indvars.iv.next72, %4
br i1 %cmp656, label %for.body7.lr.ph, label %for.cond2.loopexit
for.body7.lr.ph: ; preds = %for.body4
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv71
br label %for.body7
for.body7: ; preds = %for.body7.lr.ph, %for.inc21
%indvars.iv68 = phi i64 [ %indvars.iv66, %for.body7.lr.ph ], [ %indvars.iv.next69, %for.inc21 ]
%14 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv68
%15 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %14, %15
br i1 %cmp12, label %if.then, label %for.inc21
if.then: ; preds = %for.body7
store i32 %15, ptr %arrayidx9, align 4, !tbaa !5
store i32 %14, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc21
for.inc21: ; preds = %for.body7, %if.then
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count74
br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body7, !llvm.loop !15
for.body29: ; preds = %for.body29.preheader85, %for.body29
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body29 ], [ %indvars.iv76.ph, %for.body29.preheader85 ]
%ans.061 = phi i32 [ %add32, %for.body29 ], [ %ans.061.ph, %for.body29.preheader85 ]
%arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv76
%16 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%add32 = add nsw i32 %16, %ans.061
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79
br i1 %exitcond80.not, label %for.end35, label %for.body29, !llvm.loop !16
for.end35: ; preds = %for.body29, %middle.block, %for.cond27.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond27.preheader ], [ %13, %middle.block ], [ %add32, %for.body29 ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
|
#include<stdio.h>
void swap(int *x,int *y){
int z;
z=*x;
*x=*y;
*y=z;
}
int main(void){
int N,K;
int p[1024];
int i,m,n,l;
int sum=0;
scanf("%d",&N);
scanf("%d",&K);
for(i=0;i<N;i++){
scanf("%d",&p[i]);
}
//バブルソート
for(m=0;m<N;m++){
for(n=m+1;n<=N;n++){
if(p[m]>=p[n]){
swap(&p[m],&p[n]);
}
}
}
/* printf("並び替えると");
for(i=0;i<N;i++){
printf("%d ",p[i]);
}
printf("\n");
*/
for(l=0;l<=K;l++){
sum+=p[l];
}
printf("%d",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178276/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178276/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 {
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: 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
%K = alloca i32, align 4
%p = 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 %K) #5
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %p) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp46 = icmp sgt i32 %0, 0
br i1 %cmp46, label %for.body, label %for.cond24.preheader
for.cond3.preheader: ; preds = %for.body
%cmp450 = icmp sgt i32 %2, 0
br i1 %cmp450, label %for.body5.preheader, label %for.cond24.preheader
for.body5.preheader: ; preds = %for.cond3.preheader
%1 = add nuw i32 %2, 1
%wide.trip.count66 = zext i32 %2 to i64
%wide.trip.count = zext i32 %1 to i64
br label %for.body8.lr.ph
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1024 x i32], ptr %p, 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
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond3.loopexit: ; preds = %for.inc18
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count66
br i1 %exitcond67.not, label %for.cond24.preheader, label %for.body8.lr.ph, !llvm.loop !11
for.cond24.preheader: ; preds = %for.cond3.loopexit, %entry, %for.cond3.preheader
%4 = load i32, ptr %K, align 4, !tbaa !5
%cmp25.not52 = icmp slt i32 %4, 0
br i1 %cmp25.not52, label %for.end32, label %for.body26.preheader
for.body26.preheader: ; preds = %for.cond24.preheader
%5 = add nuw i32 %4, 1
%wide.trip.count71 = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %4, 7
br i1 %min.iters.check, label %for.body26.preheader77, label %vector.ph
vector.ph: ; preds = %for.body26.preheader
%n.vec = and i64 %wide.trip.count71, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi75 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%6 = getelementptr inbounds [1024 x i32], ptr %p, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load76 = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = add <4 x i32> %wide.load, %vec.phi
%9 = add <4 x i32> %wide.load76, %vec.phi75
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %9, %8
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count71
br i1 %cmp.n, label %for.end32, label %for.body26.preheader77
for.body26.preheader77: ; preds = %for.body26.preheader, %middle.block
%indvars.iv68.ph = phi i64 [ 0, %for.body26.preheader ], [ %n.vec, %middle.block ]
%sum.054.ph = phi i32 [ 0, %for.body26.preheader ], [ %11, %middle.block ]
br label %for.body26
for.body8.lr.ph: ; preds = %for.cond3.loopexit, %for.body5.preheader
%indvars.iv63 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next64, %for.cond3.loopexit ]
%indvars.iv58 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next59, %for.cond3.loopexit ]
%indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
%arrayidx10 = getelementptr inbounds [1024 x i32], ptr %p, i64 0, i64 %indvars.iv63
br label %for.body8
for.body8: ; preds = %for.body8.lr.ph, %for.inc18
%indvars.iv60 = phi i64 [ %indvars.iv58, %for.body8.lr.ph ], [ %indvars.iv.next61, %for.inc18 ]
%12 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%arrayidx12 = getelementptr inbounds [1024 x i32], ptr %p, i64 0, i64 %indvars.iv60
%13 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13.not = icmp slt i32 %12, %13
br i1 %cmp13.not, label %for.inc18, label %if.then
if.then: ; preds = %for.body8
store i32 %13, ptr %arrayidx10, align 4, !tbaa !5
store i32 %12, ptr %arrayidx12, align 4, !tbaa !5
br label %for.inc18
for.inc18: ; preds = %for.body8, %if.then
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%exitcond.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count
br i1 %exitcond.not, label %for.cond3.loopexit, label %for.body8, !llvm.loop !15
for.body26: ; preds = %for.body26.preheader77, %for.body26
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.body26 ], [ %indvars.iv68.ph, %for.body26.preheader77 ]
%sum.054 = phi i32 [ %add29, %for.body26 ], [ %sum.054.ph, %for.body26.preheader77 ]
%arrayidx28 = getelementptr inbounds [1024 x i32], ptr %p, i64 0, i64 %indvars.iv68
%14 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%add29 = add nsw i32 %14, %sum.054
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond72.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count71
br i1 %exitcond72.not, label %for.end32, label %for.body26, !llvm.loop !16
for.end32: ; preds = %for.body26, %middle.block, %for.cond24.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond24.preheader ], [ %11, %middle.block ], [ %add29, %for.body26 ]
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: 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.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
|
#include<stdio.h>
signed main(){
int n,x[1001],k;
int i,j,min,temp;
scanf("%d %d",&n,&k);
for(i=0;i<n;i++){
scanf("%d",&x[i]);
}
for(i=0;i<n;i++){
min=i;
for(j=i+1;j<n;j++){
if(x[j]<x[min]){
min=j;
}
}
if(min!=i){
temp=x[i];
x[i]=x[min];
x[min]=temp;
}
}
int sum=0;
for(i=0;i<k;i++){
sum+=x[i];
}
printf("%d\n",sum);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178319/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178319/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%x = alloca [1001 x i32], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp59 = icmp sgt i32 %0, 0
br i1 %cmp59, label %for.body, label %for.cond30.preheader
for.cond2.preheader: ; preds = %for.body
%cmp365 = icmp sgt i32 %2, 0
br i1 %cmp365, label %for.body4.preheader, label %for.cond30.preheader
for.body4.preheader: ; preds = %for.cond2.preheader
%1 = zext i32 %2 to i64
%wide.trip.count81 = zext i32 %2 to i64
br label %for.body4
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)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond30.preheader: ; preds = %for.inc27, %entry, %for.cond2.preheader
%4 = load i32, ptr %k, align 4, !tbaa !5
%cmp3167 = icmp sgt i32 %4, 0
br i1 %cmp3167, label %for.body32.preheader, label %for.end38
for.body32.preheader: ; preds = %for.cond30.preheader
%wide.trip.count86 = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.body32.preheader92, label %vector.ph
vector.ph: ; preds = %for.body32.preheader
%n.vec = and i64 %wide.trip.count86, 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 ], [ %7, %vector.body ]
%vec.phi90 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%5 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load91 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = add <4 x i32> %wide.load, %vec.phi
%8 = add <4 x i32> %wide.load91, %vec.phi90
%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 !11
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.vec, %wide.trip.count86
br i1 %cmp.n, label %for.end38, label %for.body32.preheader92
for.body32.preheader92: ; preds = %for.body32.preheader, %middle.block
%indvars.iv83.ph = phi i64 [ 0, %for.body32.preheader ], [ %n.vec, %middle.block ]
%sum.069.ph = phi i32 [ 0, %for.body32.preheader ], [ %10, %middle.block ]
br label %for.body32
for.body4: ; preds = %for.body4.preheader, %for.inc27
%indvars.iv78 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next79, %for.inc27 ]
%indvars.iv73 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next74, %for.inc27 ]
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%cmp661 = icmp ult i64 %indvars.iv.next79, %1
%11 = trunc i64 %indvars.iv78 to i32
br i1 %cmp661, label %for.body7, label %for.end15
for.body7: ; preds = %for.body4, %for.body7
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body7 ], [ %indvars.iv73, %for.body4 ]
%min.063 = phi i32 [ %spec.select, %for.body7 ], [ %11, %for.body4 ]
%arrayidx9 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %indvars.iv75
%12 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%idxprom10 = sext i32 %min.063 to i64
%arrayidx11 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %idxprom10
%13 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp slt i32 %12, %13
%14 = trunc i64 %indvars.iv75 to i32
%spec.select = select i1 %cmp12, i32 %14, i32 %min.063
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count81
br i1 %exitcond.not, label %for.end15, label %for.body7, !llvm.loop !14
for.end15: ; preds = %for.body7, %for.body4
%min.0.lcssa = phi i32 [ %11, %for.body4 ], [ %spec.select, %for.body7 ]
%15 = zext i32 %min.0.lcssa to i64
%cmp16.not = icmp eq i64 %indvars.iv78, %15
br i1 %cmp16.not, label %for.inc27, label %if.then17
if.then17: ; preds = %for.end15
%arrayidx19 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %indvars.iv78
%16 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%idxprom20 = sext i32 %min.0.lcssa to i64
%arrayidx21 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %idxprom20
%17 = load i32, ptr %arrayidx21, align 4, !tbaa !5
store i32 %17, ptr %arrayidx19, align 4, !tbaa !5
store i32 %16, ptr %arrayidx21, align 4, !tbaa !5
br label %for.inc27
for.inc27: ; preds = %for.end15, %if.then17
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
br i1 %exitcond82.not, label %for.cond30.preheader, label %for.body4, !llvm.loop !15
for.body32: ; preds = %for.body32.preheader92, %for.body32
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body32 ], [ %indvars.iv83.ph, %for.body32.preheader92 ]
%sum.069 = phi i32 [ %add35, %for.body32 ], [ %sum.069.ph, %for.body32.preheader92 ]
%arrayidx34 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %indvars.iv83
%18 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%add35 = add nsw i32 %18, %sum.069
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
br i1 %exitcond87.not, label %for.end38, label %for.body32, !llvm.loop !16
for.end38: ; preds = %for.body32, %middle.block, %for.cond30.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond30.preheader ], [ %10, %middle.block ], [ %add35, %for.body32 ]
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4004, 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.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !13, !12}
|
#include<stdio.h>
int main(){
int n,k,i,j,l,t,ans=0;
int p[1000];
scanf("%d %d",&n,&k);
for(i=0;i<n;i++)
scanf("%d",&p[i]);
for(j=0;j<n-1;j++)
for(l=j+1;l<n;l++)
if(p[l]<p[j]){
t=p[j];
p[j]=p[l];
p[l]=t;
}
for(i=0;i<k;i++)
ans=ans+p[i];
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%p = alloca [1000 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 4000, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp53 = icmp sgt i32 %0, 0
br i1 %cmp53, label %for.body, label %for.cond27.preheader
for.cond2.preheader: ; preds = %for.body
%cmp357 = icmp sgt i32 %2, 1
br i1 %cmp357, label %for.body4.preheader, label %for.cond27.preheader
for.body4.preheader: ; preds = %for.cond2.preheader
%sub = add nsw i32 %2, -1
%1 = zext i32 %2 to i64
%wide.trip.count73 = zext i32 %sub to i64
%wide.trip.count = zext i32 %2 to i64
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond2.loopexit: ; preds = %for.inc21, %for.body4
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73
br i1 %exitcond74.not, label %for.cond27.preheader, label %for.body4, !llvm.loop !11
for.cond27.preheader: ; preds = %for.cond2.loopexit, %entry, %for.cond2.preheader
%4 = load i32, ptr %k, align 4, !tbaa !5
%cmp2859 = icmp sgt i32 %4, 0
br i1 %cmp2859, label %for.body29.preheader, label %for.end35
for.body29.preheader: ; preds = %for.cond27.preheader
%wide.trip.count78 = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.body29.preheader84, label %vector.ph
vector.ph: ; preds = %for.body29.preheader
%n.vec = and i64 %wide.trip.count78, 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 ], [ %7, %vector.body ]
%vec.phi82 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%5 = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load83 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = add <4 x i32> %wide.load, %vec.phi
%8 = add <4 x i32> %wide.load83, %vec.phi82
%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 !12
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.vec, %wide.trip.count78
br i1 %cmp.n, label %for.end35, label %for.body29.preheader84
for.body29.preheader84: ; preds = %for.body29.preheader, %middle.block
%indvars.iv75.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec, %middle.block ]
%ans.061.ph = phi i32 [ 0, %for.body29.preheader ], [ %10, %middle.block ]
br label %for.body29
for.body4: ; preds = %for.body4.preheader, %for.cond2.loopexit
%indvars.iv70 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next71, %for.cond2.loopexit ]
%indvars.iv65 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next66, %for.cond2.loopexit ]
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%cmp655 = icmp ult i64 %indvars.iv.next71, %1
br i1 %cmp655, label %for.body7.lr.ph, label %for.cond2.loopexit
for.body7.lr.ph: ; preds = %for.body4
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %indvars.iv70
br label %for.body7
for.body7: ; preds = %for.body7.lr.ph, %for.inc21
%indvars.iv67 = phi i64 [ %indvars.iv65, %for.body7.lr.ph ], [ %indvars.iv.next68, %for.inc21 ]
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %indvars.iv67
%11 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp slt i32 %11, %12
br i1 %cmp12, label %if.then, label %for.inc21
if.then: ; preds = %for.body7
store i32 %11, ptr %arrayidx11, align 4, !tbaa !5
store i32 %12, ptr %arrayidx9, align 4, !tbaa !5
br label %for.inc21
for.inc21: ; preds = %for.body7, %if.then
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%exitcond.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body7, !llvm.loop !15
for.body29: ; preds = %for.body29.preheader84, %for.body29
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body29 ], [ %indvars.iv75.ph, %for.body29.preheader84 ]
%ans.061 = phi i32 [ %add32, %for.body29 ], [ %ans.061.ph, %for.body29.preheader84 ]
%arrayidx31 = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %indvars.iv75
%13 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%add32 = add nsw i32 %13, %ans.061
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
br i1 %exitcond79.not, label %for.end35, label %for.body29, !llvm.loop !16
for.end35: ; preds = %for.body29, %middle.block, %for.cond27.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond27.preheader ], [ %10, %middle.block ], [ %add32, %for.body29 ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
|
#include <stdio.h>
void bsort(int a[],int n){
int i,j;
for(i = 0;i < n-1;i++){
for(j = n-1;j > i;j--){
if(a[j-1] > a[j]){
int temp = a[j];
a[j] = a[j-1];
a[j-1] = temp;
}
}
}
}
int main(void)
{
int i,n,k;
int sum=0;
int p[1000];
scanf("%d", &n);
scanf("%d", &k);
for(i = 0; i < n;i++){
scanf("%d", &p[i]);
}
bsort(p,n);
for(i = 0; i < k;i++)
sum +=p[i];
printf("%d", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178405/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(argmem: readwrite) uwtable
define dso_local void @bsort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp38 = icmp sgt i32 %n, 1
br i1 %cmp38, label %for.cond2.preheader.preheader, label %for.end20
for.cond2.preheader.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
%0 = zext i32 %n to i64
%1 = add nsw i64 %0, -1
%wide.trip.count = zext i32 %sub to i64
%arrayidx7.phi.trans.insert = getelementptr inbounds i32, ptr %a, i64 %1
br label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.inc19
%indvars.iv41 = phi i64 [ 0, %for.cond2.preheader.preheader ], [ %indvars.iv.next42, %for.inc19 ]
%.pre = load i32, ptr %arrayidx7.phi.trans.insert, align 4, !tbaa !5
br label %for.body4
for.body4: ; preds = %for.cond2.preheader, %for.inc
%2 = phi i32 [ %.pre, %for.cond2.preheader ], [ %4, %for.inc ]
%indvars.iv = phi i64 [ %1, %for.cond2.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %3, %2
br i1 %cmp8, label %if.then, label %for.inc
if.then: ; preds = %for.body4
%arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
store i32 %3, ptr %arrayidx7, align 4, !tbaa !5
store i32 %2, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body4, %if.then
%4 = phi i32 [ %3, %for.body4 ], [ %2, %if.then ]
%cmp3 = icmp sgt i64 %indvars.iv.next, %indvars.iv41
br i1 %cmp3, label %for.body4, label %for.inc19, !llvm.loop !9
for.inc19: ; preds = %for.inc
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%exitcond.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count
br i1 %exitcond.not, label %for.end20, label %for.cond2.preheader, !llvm.loop !11
for.end20: ; preds = %for.inc19, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%p = alloca [1000 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 %k) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %p) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %bsort.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %p, 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
%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 !12
for.end: ; preds = %for.body
%cmp38.i = icmp sgt i32 %1, 1
br i1 %cmp38.i, label %for.cond2.preheader.preheader.i, label %bsort.exit
for.cond2.preheader.preheader.i: ; preds = %for.end
%sub.i = add nsw i32 %1, -1
%3 = zext i32 %1 to i64
%4 = add nsw i64 %3, -1
%wide.trip.count.i = zext i32 %sub.i to i64
%arrayidx7.phi.trans.insert.i = getelementptr inbounds i32, ptr %p, i64 %4
br label %for.cond2.preheader.i
for.cond2.preheader.i: ; preds = %for.inc19.i, %for.cond2.preheader.preheader.i
%indvars.iv41.i = phi i64 [ 0, %for.cond2.preheader.preheader.i ], [ %indvars.iv.next42.i, %for.inc19.i ]
%.pre.i = load i32, ptr %arrayidx7.phi.trans.insert.i, align 4, !tbaa !5
br label %for.body4.i
for.body4.i: ; preds = %for.inc.i, %for.cond2.preheader.i
%5 = phi i32 [ %.pre.i, %for.cond2.preheader.i ], [ %7, %for.inc.i ]
%indvars.iv.i = phi i64 [ %4, %for.cond2.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%arrayidx.i = getelementptr inbounds i32, ptr %p, i64 %indvars.iv.next.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp8.i = icmp sgt i32 %6, %5
br i1 %cmp8.i, label %if.then.i, label %for.inc.i
if.then.i: ; preds = %for.body4.i
%arrayidx7.i = getelementptr inbounds i32, ptr %p, i64 %indvars.iv.i
store i32 %6, ptr %arrayidx7.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body4.i
%7 = phi i32 [ %6, %for.body4.i ], [ %5, %if.then.i ]
%cmp3.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv41.i
br i1 %cmp3.i, label %for.body4.i, label %for.inc19.i, !llvm.loop !9
for.inc19.i: ; preds = %for.inc.i
%indvars.iv.next42.i = add nuw nsw i64 %indvars.iv41.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next42.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %bsort.exit, label %for.cond2.preheader.i, !llvm.loop !11
bsort.exit: ; preds = %for.inc19.i, %entry, %for.end
%8 = load i32, ptr %k, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %8, 0
br i1 %cmp420, label %for.body5.preheader, label %for.end10
for.body5.preheader: ; preds = %bsort.exit
%wide.trip.count = zext i32 %8 to i64
%min.iters.check = icmp ult i32 %8, 8
br i1 %min.iters.check, label %for.body5.preheader33, label %vector.ph
vector.ph: ; preds = %for.body5.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 ], [ %11, %vector.body ]
%vec.phi31 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%9 = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load32 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = add <4 x i32> %wide.load, %vec.phi
%12 = add <4 x i32> %wide.load32, %vec.phi31
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %12, %11
%14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end10, label %for.body5.preheader33
for.body5.preheader33: ; preds = %for.body5.preheader, %middle.block
%indvars.iv26.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ]
%sum.022.ph = phi i32 [ 0, %for.body5.preheader ], [ %14, %middle.block ]
br label %for.body5
for.body5: ; preds = %for.body5.preheader33, %for.body5
%indvars.iv26 = phi i64 [ %indvars.iv.next27, %for.body5 ], [ %indvars.iv26.ph, %for.body5.preheader33 ]
%sum.022 = phi i32 [ %add, %for.body5 ], [ %sum.022.ph, %for.body5.preheader33 ]
%arrayidx7 = getelementptr inbounds [1000 x i32], ptr %p, i64 0, i64 %indvars.iv26
%15 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add = add nsw i32 %15, %sum.022
%indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1
%exitcond.not = icmp eq i64 %indvars.iv.next27, %wide.trip.count
br i1 %exitcond.not, label %for.end10, label %for.body5, !llvm.loop !16
for.end10: ; preds = %for.body5, %middle.block, %bsort.exit
%sum.0.lcssa = phi i32 [ 0, %bsort.exit ], [ %14, %middle.block ], [ %add, %for.body5 ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: 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.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
|
#include<stdio.h>
int main(void){
int n,k;
int p[1005];
scanf("%d %d",&n,&k);
int i,j;
for(i=0;i<n;i++){
scanf("%d",&p[i]);
}
int tmp;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(p[i] < p[j]){
tmp = p[i];
p[i] = p[j];
p[j] = tmp;
}
}
}
int ans=0;
for(i=0;i<k;i++){
ans = ans + p[i];
// printf("%d,",p[i]);
}
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178456/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178456/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%p = alloca [1005 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 4020, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp52 = icmp sgt i32 %0, 0
br i1 %cmp52, label %for.body, label %for.cond27.preheader
for.cond2.preheader: ; preds = %for.body
%cmp356 = icmp sgt i32 %8, 0
br i1 %cmp356, label %for.cond5.preheader.us.preheader, label %for.cond27.preheader
for.cond5.preheader.us.preheader: ; preds = %for.cond2.preheader
%wide.trip.count70 = zext i32 %8 to i64
%xtraiter = and i64 %wide.trip.count70, 1
%1 = icmp eq i32 %8, 1
%unroll_iter = and i64 %wide.trip.count70, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond5.preheader.us
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc24_crit_edge.us
%indvars.iv67 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next68, %for.cond5.for.inc24_crit_edge.us ]
%arrayidx9.us = getelementptr inbounds [1005 x i32], ptr %p, i64 0, i64 %indvars.iv67
br i1 %1, label %for.cond5.for.inc24_crit_edge.us.unr-lcssa, label %for.body7.us
for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc21.us.1
%indvars.iv64 = phi i64 [ %indvars.iv.next65.1, %for.inc21.us.1 ], [ 0, %for.cond5.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc21.us.1 ], [ 0, %for.cond5.preheader.us ]
%2 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5
%arrayidx11.us = getelementptr inbounds [1005 x i32], ptr %p, i64 0, i64 %indvars.iv64
%3 = load i32, ptr %arrayidx11.us, align 8, !tbaa !5
%cmp12.us = icmp slt i32 %2, %3
br i1 %cmp12.us, label %if.then.us, label %for.inc21.us
if.then.us: ; preds = %for.body7.us
store i32 %3, ptr %arrayidx9.us, align 4, !tbaa !5
store i32 %2, ptr %arrayidx11.us, align 8, !tbaa !5
br label %for.inc21.us
for.inc21.us: ; preds = %if.then.us, %for.body7.us
%indvars.iv.next65 = or i64 %indvars.iv64, 1
%4 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5
%arrayidx11.us.1 = getelementptr inbounds [1005 x i32], ptr %p, i64 0, i64 %indvars.iv.next65
%5 = load i32, ptr %arrayidx11.us.1, align 4, !tbaa !5
%cmp12.us.1 = icmp slt i32 %4, %5
br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc21.us.1
if.then.us.1: ; preds = %for.inc21.us
store i32 %5, ptr %arrayidx9.us, align 4, !tbaa !5
store i32 %4, ptr %arrayidx11.us.1, align 4, !tbaa !5
br label %for.inc21.us.1
for.inc21.us.1: ; preds = %if.then.us.1, %for.inc21.us
%indvars.iv.next65.1 = add nuw nsw i64 %indvars.iv64, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond5.for.inc24_crit_edge.us.unr-lcssa, label %for.body7.us, !llvm.loop !9
for.cond5.for.inc24_crit_edge.us.unr-lcssa: ; preds = %for.inc21.us.1, %for.cond5.preheader.us
%indvars.iv64.unr = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next65.1, %for.inc21.us.1 ]
br i1 %lcmp.mod.not, label %for.cond5.for.inc24_crit_edge.us, label %for.body7.us.epil
for.body7.us.epil: ; preds = %for.cond5.for.inc24_crit_edge.us.unr-lcssa
%6 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5
%arrayidx11.us.epil = getelementptr inbounds [1005 x i32], ptr %p, i64 0, i64 %indvars.iv64.unr
%7 = load i32, ptr %arrayidx11.us.epil, align 4, !tbaa !5
%cmp12.us.epil = icmp slt i32 %6, %7
br i1 %cmp12.us.epil, label %if.then.us.epil, label %for.cond5.for.inc24_crit_edge.us
if.then.us.epil: ; preds = %for.body7.us.epil
store i32 %7, ptr %arrayidx9.us, align 4, !tbaa !5
store i32 %6, ptr %arrayidx11.us.epil, align 4, !tbaa !5
br label %for.cond5.for.inc24_crit_edge.us
for.cond5.for.inc24_crit_edge.us: ; preds = %for.body7.us.epil, %if.then.us.epil, %for.cond5.for.inc24_crit_edge.us.unr-lcssa
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70
br i1 %exitcond71.not, label %for.cond27.preheader, label %for.cond5.preheader.us, !llvm.loop !11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1005 x i32], ptr %p, 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
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !12
for.cond27.preheader: ; preds = %for.cond5.for.inc24_crit_edge.us, %entry, %for.cond2.preheader
%10 = load i32, ptr %k, align 4, !tbaa !5
%cmp2858 = icmp sgt i32 %10, 0
br i1 %cmp2858, label %for.body29.preheader, label %for.end34
for.body29.preheader: ; preds = %for.cond27.preheader
%wide.trip.count75 = zext i32 %10 to i64
%min.iters.check = icmp ult i32 %10, 8
br i1 %min.iters.check, label %for.body29.preheader81, label %vector.ph
vector.ph: ; preds = %for.body29.preheader
%n.vec = and i64 %wide.trip.count75, 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 ], [ %13, %vector.body ]
%vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%11 = getelementptr inbounds [1005 x i32], ptr %p, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %11, align 16, !tbaa !5
%12 = getelementptr inbounds i32, ptr %11, i64 4
%wide.load80 = load <4 x i32>, ptr %12, align 16, !tbaa !5
%13 = add <4 x i32> %wide.load, %vec.phi
%14 = add <4 x i32> %wide.load80, %vec.phi79
%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 !13
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %14, %13
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count75
br i1 %cmp.n, label %for.end34, label %for.body29.preheader81
for.body29.preheader81: ; preds = %for.body29.preheader, %middle.block
%indvars.iv72.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec, %middle.block ]
%ans.060.ph = phi i32 [ 0, %for.body29.preheader ], [ %16, %middle.block ]
br label %for.body29
for.body29: ; preds = %for.body29.preheader81, %for.body29
%indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body29 ], [ %indvars.iv72.ph, %for.body29.preheader81 ]
%ans.060 = phi i32 [ %add, %for.body29 ], [ %ans.060.ph, %for.body29.preheader81 ]
%arrayidx31 = getelementptr inbounds [1005 x i32], ptr %p, i64 0, i64 %indvars.iv72
%17 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%add = add nsw i32 %17, %ans.060
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75
br i1 %exitcond76.not, label %for.end34, label %for.body29, !llvm.loop !16
for.end34: ; preds = %for.body29, %middle.block, %for.cond27.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond27.preheader ], [ %16, %middle.block ], [ %add, %for.body29 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
|
#include <stdio.h>
int main(void)
{
int c[4];
int i, sum=0;
for(i=0;i<4;i++)
{
scanf("%d",&c[i]);
}
if((c[0]+c[1])==(c[2]+c[3]))
printf("YES");
else if((c[0]+c[2])==(c[1]+c[3]))
printf("YES");
else if((c[0]+c[3])==(c[1]+c[2]))
printf("YES");
else if(c[0]==c[1]+c[2]+c[3])
printf("YES");
else if(c[1]==c[0]+c[2]+c[3])
printf("YES");
else if(c[2]==c[0]+c[1]+c[3])
printf("YES");
else if(c[3]==c[0]+c[1]+c[2])
printf("YES");
else
printf("NO");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1785/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1785/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%c = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%arrayidx.1 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%0 = load i32, ptr %c, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%add5 = add nsw i32 %3, %2
%cmp6 = icmp eq i32 %add, %add5
br i1 %cmp6, label %if.end74, label %if.else
if.else: ; preds = %entry
%add10 = add nsw i32 %2, %0
%add13 = add nsw i32 %3, %1
%cmp14 = icmp eq i32 %add10, %add13
br i1 %cmp14, label %if.end74, label %if.else17
if.else17: ; preds = %if.else
%add20 = add nsw i32 %3, %0
%add23 = add nsw i32 %2, %1
%cmp24 = icmp eq i32 %add20, %add23
%add33 = add nsw i32 %add23, %3
%cmp34 = icmp eq i32 %0, %add33
%or.cond = select i1 %cmp24, i1 true, i1 %cmp34
%add43 = add nsw i32 %add10, %3
%cmp44 = icmp eq i32 %1, %add43
%or.cond79 = select i1 %or.cond, i1 true, i1 %cmp44
%add53 = add nsw i32 %3, %add
%cmp54 = icmp eq i32 %2, %add53
%or.cond80 = select i1 %or.cond79, i1 true, i1 %cmp54
br i1 %or.cond80, label %if.end74, label %if.else57
if.else57: ; preds = %if.else17
%add63 = add nsw i32 %add, %2
%cmp64 = icmp eq i32 %3, %add63
%.str.1..str.2 = select i1 %cmp64, ptr @.str.1, ptr @.str.2
br label %if.end74
if.end74: ; preds = %if.else57, %if.else17, %if.else, %entry
%.str.1.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %if.else ], [ @.str.1, %if.else17 ], [ %.str.1..str.2, %if.else57 ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n, k;
scanf("%d %d", &n, &k);
int i;
int p[1003];
for (i = 0; i < n; i++)
scanf("%d", &p[i]);
for (i = 0; i < n - 1; i++)
{
if (p[i] > p[i + 1])
{
p[i] ^= p[i + 1];
p[i + 1] ^= p[i];
p[i] ^= p[i + 1];
if (i > 0)
i -= 2;
}
}
int ans = 0;
for (i = 0; i < k; i++)
ans += p[i];
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178542/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178542/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%k = alloca i32, align 4
%p = alloca [1003 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
call void @llvm.lifetime.start.p0(i64 4012, ptr nonnull %p) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.cond34.preheader
for.cond2.preheader: ; preds = %for.body
%sub = add nsw i32 %1, -1
%cmp365 = icmp sgt i32 %1, 1
br i1 %cmp365, label %for.body4, label %for.cond34.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond34.preheader: ; preds = %for.inc31, %entry, %for.cond2.preheader
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp3567 = icmp sgt i32 %3, 0
br i1 %cmp3567, label %for.body36.preheader, label %for.end42
for.body36.preheader: ; preds = %for.cond34.preheader
%wide.trip.count = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body36.preheader81, label %vector.ph
vector.ph: ; preds = %for.body36.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 ], [ %6, %vector.body ]
%vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%4 = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load80 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = add <4 x i32> %wide.load, %vec.phi
%7 = add <4 x i32> %wide.load80, %vec.phi79
%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 !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end42, label %for.body36.preheader81
for.body36.preheader81: ; preds = %for.body36.preheader, %middle.block
%indvars.iv73.ph = phi i64 [ 0, %for.body36.preheader ], [ %n.vec, %middle.block ]
%ans.069.ph = phi i32 [ 0, %for.body36.preheader ], [ %9, %middle.block ]
br label %for.body36
for.body4: ; preds = %for.cond2.preheader, %for.inc31
%i.166 = phi i32 [ %inc32.pre-phi, %for.inc31 ], [ 0, %for.cond2.preheader ]
%idxprom5 = sext i32 %i.166 to i64
%arrayidx6 = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %idxprom5
%10 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %i.166, 1
%idxprom7 = sext i32 %add to i64
%arrayidx8 = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %idxprom7
%11 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %10, %11
br i1 %cmp9, label %if.then, label %for.inc31
if.then: ; preds = %for.body4
store i32 %10, ptr %arrayidx8, align 4, !tbaa !5
store i32 %11, ptr %arrayidx6, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %i.166, 0
%sub29 = add nsw i32 %i.166, -2
%spec.select = select i1 %cmp27, i32 %sub29, i32 %i.166
%.pre = add nsw i32 %spec.select, 1
br label %for.inc31
for.inc31: ; preds = %if.then, %for.body4
%inc32.pre-phi = phi i32 [ %.pre, %if.then ], [ %add, %for.body4 ]
%cmp3 = icmp slt i32 %inc32.pre-phi, %sub
br i1 %cmp3, label %for.body4, label %for.cond34.preheader, !llvm.loop !14
for.body36: ; preds = %for.body36.preheader81, %for.body36
%indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body36 ], [ %indvars.iv73.ph, %for.body36.preheader81 ]
%ans.069 = phi i32 [ %add39, %for.body36 ], [ %ans.069.ph, %for.body36.preheader81 ]
%arrayidx38 = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %indvars.iv73
%12 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%add39 = add nsw i32 %12, %ans.069
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%exitcond.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count
br i1 %exitcond.not, label %for.end42, label %for.body36, !llvm.loop !15
for.end42: ; preds = %for.body36, %middle.block, %for.cond34.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond34.preheader ], [ %9, %middle.block ], [ %add39, %for.body36 ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4012, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13, !12}
|
#include <stdio.h>
#include <string.h>
int main (int argc,char **argv)
{
int m = 0;
int n = 0;
scanf("%d",&m);
m = 24 - m;
n = 24 + m;
printf("%d\n",n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178737/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178737/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
store i32 0, ptr %m, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%sub = sub nsw i32 24, %0
store i32 %sub, ptr %m, align 4, !tbaa !5
%add = sub i32 48, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define TYPE int
#define MEMSET(a) memset(a,0,sizeof(a))
const int mod=(int)1e09+7;
int in(void){
int i;scanf("%d",&i);
return i;
}
long long llin(void){
long long i;scanf("%lld",&i);
return i;
}
double din(void){
double i;scanf("%lf",&i);
return i;
}
void chin(char s[]){
scanf("%s",s);
}
void print(int a){
printf("%d\n",a);
}
void llprint(long long a){
printf("%lld\n",a);
}
void dprint(double a){
printf("%.10f\n",a);
}
void print2(int a,int b){
printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
return a>b?a:b;
}
long long min(long long a,long long b){
return a<b?a:b;
}
long long llabs(long long a){
return a>0?a:-a;
}
double dmax(double a,double b){
return a>b?a:b;
}
int cmp(const void *a,const void *b){
return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
return *(TYPE *)b-*(TYPE *)a;
}
int main(void){
int m=in();
print(48-m);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #7
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @llin() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #7
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @din() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #7
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b)
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llabs(i64 noundef %a) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
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 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
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 #0 {
entry:
%i.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #7
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i)
%0 = load i32, ptr %i.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #7
%sub = sub nsw i32 48, %0
%call.i1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %sub)
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
|
#include <stdio.h>
int main(){
int m = 0;
scanf("%d",&m);
printf("%d\n",48-m);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
store i32 0, ptr %m, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%sub = sub nsw i32 48, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include <string.h>
int main(void) {
int n;
char str[1001] = "";
char command[10] = "";
char command_word1[10] = "print";
char command_word2[10] = "reverse";
char command_word3[10] = "replace";
char replace[1000] = "";
scanf("%s", str);
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%s", command);
if (strcmp(command, command_word1) == 0) {
//print
int start, end;
scanf("%d %d", &start, &end);
for (; start <= end; start++) {
printf("%c", str[start]);
}
printf("\n");
}
else if (strcmp(command, command_word2) == 0) {
//reverse
int start, end;
char temp;
scanf("%d %d", &start, &end);
for (; start <= end; start++, end--) {
temp = str[start];
str[start] = str[end];
str[end] = temp;
}
}
else if (strcmp(command, command_word3) == 0) {
//replace
int start, end;
scanf("%d %d %s", &start, &end, replace);
for (int j = 0; start <= end; j++, start++) {
str[start] = replace[j];
}
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178924/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178924/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.command_word1 = private unnamed_addr constant [10 x i8] c"print\00\00\00\00\00", align 1
@__const.main.command_word2 = private unnamed_addr constant [10 x i8] c"reverse\00\00\00", align 1
@__const.main.command_word3 = private unnamed_addr constant [10 x i8] c"replace\00\00\00", align 1
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.5 = private unnamed_addr constant [9 x i8] c"%d %d %s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%str = alloca [1001 x i8], align 16
%command = alloca [10 x i8], align 1
%replace = alloca [1000 x i8], align 16
%start = alloca i32, align 4
%end = alloca i32, align 4
%start20 = alloca i32, align 4
%end21 = alloca i32, align 4
%start45 = alloca i32, align 4
%end46 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %str, i8 0, i64 1001, i1 false)
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %command) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %command, i8 0, i64 10, i1 false)
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %replace) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1000) %replace, i8 0, i64 1000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp85 = icmp sgt i32 %0, 0
br i1 %cmp85, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc64, %entry
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %replace) #7
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %command) #7
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
for.body: ; preds = %entry, %for.inc64
%i.086 = phi i32 [ %inc65, %for.inc64 ], [ 0, %entry ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %command)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %command, ptr noundef nonnull dereferenceable(6) @__const.main.command_word1, i64 6)
%cmp7 = icmp eq i32 %bcmp, 0
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %for.body
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end) #7
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %start, ptr noundef nonnull %end)
%1 = load i32, ptr %start, align 4, !tbaa !5
%2 = load i32, ptr %end, align 4, !tbaa !5
%cmp10.not84 = icmp sgt i32 %1, %2
br i1 %cmp10.not84, label %for.end, label %for.body11
for.body11: ; preds = %if.then, %for.body11
%3 = phi i32 [ %inc, %for.body11 ], [ %1, %if.then ]
%idxprom = sext i32 %3 to i64
%arrayidx = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %4 to i32
%putchar74 = call i32 @putchar(i32 %conv)
%5 = load i32, ptr %start, align 4, !tbaa !5
%inc = add nsw i32 %5, 1
store i32 %inc, ptr %start, align 4, !tbaa !5
%6 = load i32, ptr %end, align 4, !tbaa !5
%cmp10.not.not = icmp slt i32 %5, %6
br i1 %cmp10.not.not, label %for.body11, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body11, %if.then
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start) #7
br label %for.inc64
if.else: ; preds = %for.body
%bcmp72 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %command, ptr noundef nonnull dereferenceable(8) @__const.main.command_word2, i64 8)
%cmp17 = icmp eq i32 %bcmp72, 0
br i1 %cmp17, label %if.then19, label %if.else38
if.then19: ; preds = %if.else
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start20) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end21) #7
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %start20, ptr noundef nonnull %end21)
%start20.promoted = load i32, ptr %start20, align 4, !tbaa !5
%end21.promoted = load i32, ptr %end21, align 4, !tbaa !5
%cmp24.not81 = icmp sgt i32 %start20.promoted, %end21.promoted
br i1 %cmp24.not81, label %for.end37, label %for.body26.preheader
for.body26.preheader: ; preds = %if.then19
%7 = sext i32 %start20.promoted to i64
%8 = sext i32 %end21.promoted to i64
br label %for.body26
for.body26: ; preds = %for.body26.preheader, %for.body26
%indvars.iv92 = phi i64 [ %8, %for.body26.preheader ], [ %indvars.iv.next93, %for.body26 ]
%indvars.iv = phi i64 [ %7, %for.body26.preheader ], [ %indvars.iv.next, %for.body26 ]
%arrayidx28 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv
%9 = load i8, ptr %arrayidx28, align 1, !tbaa !9
%arrayidx30 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv92
%10 = load i8, ptr %arrayidx30, align 1, !tbaa !9
store i8 %10, ptr %arrayidx28, align 1, !tbaa !9
store i8 %9, ptr %arrayidx30, align 1, !tbaa !9
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%indvars.iv.next93 = add nsw i64 %indvars.iv92, -1
%cmp24.not.not = icmp slt i64 %indvars.iv, %indvars.iv.next93
br i1 %cmp24.not.not, label %for.body26, label %for.end37, !llvm.loop !12
for.end37: ; preds = %for.body26, %if.then19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end21) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start20) #7
br label %for.inc64
if.else38: ; preds = %if.else
%bcmp73 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %command, ptr noundef nonnull dereferenceable(8) @__const.main.command_word3, i64 8)
%cmp42 = icmp eq i32 %bcmp73, 0
br i1 %cmp42, label %if.then44, label %for.inc64
if.then44: ; preds = %if.else38
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start45) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end46) #7
%call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %start45, ptr noundef nonnull %end46, ptr noundef nonnull %replace)
%11 = load i32, ptr %end46, align 4, !tbaa !5
%start45.promoted = load i32, ptr %start45, align 4, !tbaa !5
%cmp50.not76 = icmp sgt i32 %start45.promoted, %11
br i1 %cmp50.not76, label %for.cond.cleanup52, label %for.body53.preheader
for.body53.preheader: ; preds = %if.then44
%12 = sext i32 %start45.promoted to i64
%scevgep = getelementptr i8, ptr %str, i64 %12
%13 = sub i32 %11, %start45.promoted
%14 = zext i32 %13 to i64
%15 = add nuw nsw i64 %14, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 16 dereferenceable(1) %replace, i64 %15, i1 false), !tbaa !9
br label %for.cond.cleanup52
for.cond.cleanup52: ; preds = %for.body53.preheader, %if.then44
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end46) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start45) #7
br label %for.inc64
for.inc64: ; preds = %for.end, %if.else38, %for.cond.cleanup52, %for.end37
%inc65 = add nuw nsw i32 %i.086, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc65, %16
br i1 %cmp, label %for.body, label %for.cond.cleanup, !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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include<stdio.h>
#include<string.h>
int main()
{
int a,b,c,d,i,j;
char x[1001],y[10],z[1001];
scanf("%s",&x);
scanf("%d",&a);
for(i=0;i<a;i++){
scanf("%s",&y);
if(strcmp(y,"print")==0){
scanf("%d%d",&b,&c);
for(j=b;j<c+1;j++){
putchar(x[j]);
}
puts("");
}
else if(strcmp(y,"reverse")==0){
scanf("%d%d",&b,&c);
for(j=0;j<c-b+1;j++){
z[j]=x[c-j];
}
for(j=0;j<c-b+1;j++){
x[b+j]=z[j];
}
}
else if(strcmp(y,"replace")==0){
scanf("%d%d%s",&b,&c,&z);
for(j=0;j<c-b+1;j++){
x[b+j]=z[j];
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178982/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178982/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"print\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.5 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1
@.str.6 = private unnamed_addr constant [8 x i8] c"replace\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d%d%s\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:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%x = alloca [1001 x i8], align 16
%y = alloca [10 x i8], align 1
%z = alloca [1001 x i8], 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 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %y) #5
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %z) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp98 = icmp sgt i32 %0, 0
br i1 %cmp98, label %for.body.preheader, label %for.end69
for.body.preheader: ; preds = %entry
%invariant.gep = getelementptr i8, ptr %x, i64 -7
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc67
%i.099 = phi i32 [ %inc68, %for.inc67 ], [ 0, %for.body.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %y, ptr noundef nonnull dereferenceable(6) @.str.2, i64 6)
%cmp4 = icmp eq i32 %bcmp, 0
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %for.body
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%cmp7.not96 = icmp sgt i32 %1, %2
br i1 %cmp7.not96, label %for.end, label %for.body8.preheader
for.body8.preheader: ; preds = %if.then
%3 = sext i32 %1 to i64
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv110 = phi i64 [ %3, %for.body8.preheader ], [ %indvars.iv.next111, %for.body8 ]
%arrayidx = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 %indvars.iv110
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %4 to i32
%5 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i = call noundef i32 @putc(i32 noundef %conv, ptr noundef %5)
%indvars.iv.next111 = add nsw i64 %indvars.iv110, 1
%6 = load i32, ptr %c, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp7.not.not = icmp slt i64 %indvars.iv110, %7
br i1 %cmp7.not.not, label %for.body8, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body8, %if.then
%8 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i87 = call noundef i32 @putc(i32 noundef 10, ptr noundef %8)
br label %for.inc67
if.else: ; preds = %for.body
%bcmp85 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %y, ptr noundef nonnull dereferenceable(8) @.str.5, i64 8)
%cmp13 = icmp eq i32 %bcmp85, 0
br i1 %cmp13, label %if.then15, label %if.else44
if.then15: ; preds = %if.else
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %b, ptr noundef nonnull %c)
%9 = load i32, ptr %c, align 4, !tbaa !5
%10 = load i32, ptr %b, align 4, !tbaa !5
%cmp19.not91 = icmp slt i32 %9, %10
br i1 %cmp19.not91, label %for.inc67, label %iter.check
iter.check: ; preds = %if.then15
%11 = sext i32 %9 to i64
%12 = add i32 %9, 1
%13 = sub i32 %12, %10
%wide.trip.count = zext i32 %13 to i64
%min.iters.check = icmp ult i32 %13, 8
br i1 %min.iters.check, label %for.body21.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check113 = icmp ult i32 %13, 32
br i1 %min.iters.check113, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %wide.trip.count, 4294967264
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%14 = sub nsw i64 %11, %index
%15 = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 %14
%16 = getelementptr inbounds i8, ptr %15, i64 -15
%wide.load = load <16 x i8>, ptr %16, align 1, !tbaa !9
%reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%17 = getelementptr inbounds i8, ptr %15, i64 -31
%wide.load114 = load <16 x i8>, ptr %17, align 1, !tbaa !9
%reverse115 = shufflevector <16 x i8> %wide.load114, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%18 = getelementptr inbounds [1001 x i8], ptr %z, i64 0, i64 %index
store <16 x i8> %reverse, ptr %18, align 16, !tbaa !9
%19 = getelementptr inbounds i8, ptr %18, i64 16
store <16 x i8> %reverse115, ptr %19, align 16, !tbaa !9
%index.next = add nuw i64 %index, 32
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond30.preheader, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%n.vec.remaining = and i64 %wide.trip.count, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body21.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.vec117 = and i64 %wide.trip.count, 4294967288
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index119 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next122, %vec.epilog.vector.body ]
%21 = sub nsw i64 %11, %index119
%gep = getelementptr [1001 x i8], ptr %invariant.gep, i64 0, i64 %21
%wide.load120 = load <8 x i8>, ptr %gep, align 1, !tbaa !9
%reverse121 = shufflevector <8 x i8> %wide.load120, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%22 = getelementptr inbounds [1001 x i8], ptr %z, i64 0, i64 %index119
store <8 x i8> %reverse121, ptr %22, align 8, !tbaa !9
%index.next122 = add nuw i64 %index119, 8
%23 = icmp eq i64 %index.next122, %n.vec117
br i1 %23, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !17
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n118 = icmp eq i64 %n.vec117, %wide.trip.count
br i1 %cmp.n118, label %for.cond30.preheader, label %for.body21.preheader
for.body21.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec117, %vec.epilog.middle.block ]
br label %for.body21
for.cond30.preheader: ; preds = %for.body21, %vec.epilog.middle.block, %middle.block
br i1 %cmp19.not91, label %for.inc67, label %for.body35.preheader
for.body35.preheader: ; preds = %for.cond30.preheader
%24 = sext i32 %10 to i64
%scevgep105 = getelementptr i8, ptr %x, i64 %24
%25 = add i32 %9, 1
%26 = sub i32 %25, %10
%27 = zext i32 %26 to i64
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep105, ptr nonnull align 16 %z, i64 %27, i1 false), !tbaa !9
br label %for.inc67
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body21 ], [ %indvars.iv.ph, %for.body21.preheader ]
%28 = sub nsw i64 %11, %indvars.iv
%arrayidx24 = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 %28
%29 = load i8, ptr %arrayidx24, align 1, !tbaa !9
%arrayidx26 = getelementptr inbounds [1001 x i8], ptr %z, i64 0, i64 %indvars.iv
store i8 %29, ptr %arrayidx26, align 1, !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.cond30.preheader, label %for.body21, !llvm.loop !18
if.else44: ; preds = %if.else
%bcmp86 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %y, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8)
%cmp47 = icmp eq i32 %bcmp86, 0
br i1 %cmp47, label %if.then49, label %for.inc67
if.then49: ; preds = %if.else44
%call50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %z)
%30 = load i32, ptr %c, align 4, !tbaa !5
%31 = load i32, ptr %b, align 4, !tbaa !5
%cmp54.not89 = icmp slt i32 %30, %31
br i1 %cmp54.not89, label %for.inc67, label %for.body56.preheader
for.body56.preheader: ; preds = %if.then49
%32 = sext i32 %31 to i64
%scevgep = getelementptr i8, ptr %x, i64 %32
%33 = add i32 %30, 1
%34 = sub i32 %33, %31
%35 = zext i32 %34 to i64
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 %z, i64 %35, i1 false), !tbaa !9
br label %for.inc67
for.inc67: ; preds = %if.then15, %for.body56.preheader, %for.body35.preheader, %if.then49, %for.cond30.preheader, %for.end, %if.else44
%inc68 = add nuw nsw i32 %i.099, 1
%36 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %inc68, %36
br i1 %cmp, label %for.body, label %for.end69, !llvm.loop !19
for.end69: ; preds = %for.inc67, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %z) #5
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, 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: readwrite) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !13, !15, !16}
!18 = distinct !{!18, !13, !16, !15}
!19 = distinct !{!19, !13}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
char s[1024];
int q;
int i;
scanf("%s", s);
scanf("%d", &q);
while (q--){
char query[16];
int a, b;
scanf("%s %d %d", query, &a, &b);
if (!strcmp(query, "print")){
for (i = a; i <= b; ++i) putchar(s[i]);
puts("");
}
else if (!strcmp(query, "reverse")){
for (i = 0; i <= (b - a) / 2; ++i){
char tmp = s[a + i];
s[a + i] = s[b - i];
s[b - i] = tmp;
}
}
else {
char p[1024];
scanf("%s", p);
strncpy(s + a, p, b - a + 1);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179039/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179039/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%s %d %d\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"print\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:
%s = alloca [1024 x i8], align 16
%q = alloca i32, align 4
%query = alloca [16 x i8], align 16
%a = alloca i32, align 4
%b = alloca i32, align 4
%p = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%dec55 = add nsw i32 %0, -1
store i32 %dec55, ptr %q, align 4, !tbaa !5
%tobool.not56 = icmp eq i32 %0, 0
br i1 %tobool.not56, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end40
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %query) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %query, ptr noundef nonnull %a, ptr noundef nonnull %b)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %query, ptr noundef nonnull dereferenceable(6) @.str.3, i64 6)
%tobool6.not = icmp eq i32 %bcmp, 0
br i1 %tobool6.not, label %if.then, label %if.else
if.then: ; preds = %while.body
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not53 = icmp sgt i32 %1, %2
br i1 %cmp.not53, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %if.then
%3 = sext i32 %1 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv60 = phi i64 [ %3, %for.body.preheader ], [ %indvars.iv.next61, %for.body ]
%arrayidx = getelementptr inbounds [1024 x i8], ptr %s, i64 0, i64 %indvars.iv60
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %4 to i32
%5 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i = call noundef i32 @putc(i32 noundef %conv, ptr noundef %5)
%indvars.iv.next61 = add nsw i64 %indvars.iv60, 1
%6 = load i32, ptr %b, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp.not.not = icmp slt i64 %indvars.iv60, %7
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body, %if.then
%8 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i50 = call noundef i32 @putc(i32 noundef 10, ptr noundef %8)
br label %if.end40
if.else: ; preds = %while.body
%lhsv = load i64, ptr %query, align 16
%.not = icmp eq i64 %lhsv, 28555907813500274
br i1 %.not, label %for.cond13.preheader, label %if.else31
for.cond13.preheader: ; preds = %if.else
%9 = load i32, ptr %b, align 4, !tbaa !5
%10 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %9, %10
%cmp14.not51 = icmp slt i32 %sub, -1
br i1 %cmp14.not51, label %if.end40, label %for.body16.preheader
for.body16.preheader: ; preds = %for.cond13.preheader
%div = sdiv i32 %sub, 2
%11 = sext i32 %10 to i64
%12 = sext i32 %9 to i64
%13 = add nuw nsw i32 %div, 1
%wide.trip.count = zext i32 %13 to i64
%xtraiter = and i64 %wide.trip.count, 1
%sub.off = add i32 %sub, 1
%14 = icmp ult i32 %sub.off, 3
br i1 %14, label %if.end40.loopexit.unr-lcssa, label %for.body16.preheader.new
for.body16.preheader.new: ; preds = %for.body16.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body16
for.body16: ; preds = %for.body16, %for.body16.preheader.new
%indvars.iv = phi i64 [ 0, %for.body16.preheader.new ], [ %indvars.iv.next.1, %for.body16 ]
%niter = phi i64 [ 0, %for.body16.preheader.new ], [ %niter.next.1, %for.body16 ]
%15 = add nsw i64 %indvars.iv, %11
%arrayidx18 = getelementptr inbounds [1024 x i8], ptr %s, i64 0, i64 %15
%16 = load i8, ptr %arrayidx18, align 1, !tbaa !9
%17 = sub nsw i64 %12, %indvars.iv
%arrayidx21 = getelementptr inbounds [1024 x i8], ptr %s, i64 0, i64 %17
%18 = load i8, ptr %arrayidx21, align 1, !tbaa !9
store i8 %18, ptr %arrayidx18, align 1, !tbaa !9
store i8 %16, ptr %arrayidx21, align 1, !tbaa !9
%indvars.iv.next = or i64 %indvars.iv, 1
%19 = add nsw i64 %indvars.iv.next, %11
%arrayidx18.1 = getelementptr inbounds [1024 x i8], ptr %s, i64 0, i64 %19
%20 = load i8, ptr %arrayidx18.1, align 1, !tbaa !9
%21 = sub nsw i64 %12, %indvars.iv.next
%arrayidx21.1 = getelementptr inbounds [1024 x i8], ptr %s, i64 0, i64 %21
%22 = load i8, ptr %arrayidx21.1, align 1, !tbaa !9
store i8 %22, ptr %arrayidx18.1, align 1, !tbaa !9
store i8 %20, ptr %arrayidx21.1, align 1, !tbaa !9
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %if.end40.loopexit.unr-lcssa, label %for.body16, !llvm.loop !14
if.else31: ; preds = %if.else
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %p) #5
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%23 = load i32, ptr %a, align 4, !tbaa !5
%idx.ext = sext i32 %23 to i64
%add.ptr = getelementptr inbounds i8, ptr %s, i64 %idx.ext
%24 = load i32, ptr %b, align 4, !tbaa !5
%reass.sub = sub i32 %24, %23
%add37 = add i32 %reass.sub, 1
%conv38 = sext i32 %add37 to i64
%call39 = call ptr @strncpy(ptr noundef nonnull %add.ptr, ptr noundef nonnull %p, i64 noundef %conv38) #5
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %p) #5
br label %if.end40
if.end40.loopexit.unr-lcssa: ; preds = %for.body16, %for.body16.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next.1, %for.body16 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %if.end40, label %for.body16.epil
for.body16.epil: ; preds = %if.end40.loopexit.unr-lcssa
%25 = add nsw i64 %indvars.iv.unr, %11
%arrayidx18.epil = getelementptr inbounds [1024 x i8], ptr %s, i64 0, i64 %25
%26 = load i8, ptr %arrayidx18.epil, align 1, !tbaa !9
%27 = sub nsw i64 %12, %indvars.iv.unr
%arrayidx21.epil = getelementptr inbounds [1024 x i8], ptr %s, i64 0, i64 %27
%28 = load i8, ptr %arrayidx21.epil, align 1, !tbaa !9
store i8 %28, ptr %arrayidx18.epil, align 1, !tbaa !9
store i8 %26, ptr %arrayidx21.epil, align 1, !tbaa !9
br label %if.end40
if.end40: ; preds = %for.body16.epil, %if.end40.loopexit.unr-lcssa, %for.cond13.preheader, %if.else31, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %query) #5
%29 = load i32, ptr %q, align 4, !tbaa !5
%dec = add nsw i32 %29, -1
store i32 %dec, ptr %q, align 4, !tbaa !5
%tobool.not = icmp eq i32 %29, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %if.end40, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int i;
int a[n+1];
a[0]=0;
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
int final = 0;
int flag = 0;
for(i=0;i<n;i++)
{
if(a[i+1]-a[i]>15)
{
final = a[i]+15;
flag = 1;
break;
}
}
if(flag == 0)
{
final = a[n]+15;
}
if(final<90)
printf("%d",final);
else
printf("90");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17909/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17909/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"90\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
store i32 0, ptr %vla, align 16, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not39 = icmp slt i32 %3, 1
br i1 %cmp.not39, label %for.cond3.preheader, label %for.body
for.cond3.preheader: ; preds = %for.body, %entry
%.lcssa38 = phi i32 [ %3, %entry ], [ %4, %for.body ]
%smax = call i32 @llvm.smax.i32(i32 %.lcssa38, i32 0)
%wide.trip.count = zext i32 %smax to i64
br label %for.cond3
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %5
br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond3: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv43 = phi i64 [ 0, %for.cond3.preheader ], [ %indvars.iv.next44, %for.body5 ]
%exitcond.not = icmp eq i64 %indvars.iv43, %wide.trip.count
br i1 %exitcond.not, label %if.then19, label %for.body5
for.body5: ; preds = %for.cond3
%indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next44
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv43
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%sub = sub nsw i32 %6, %7
%cmp11 = icmp sgt i32 %sub, 15
br i1 %cmp11, label %if.end23, label %for.cond3, !llvm.loop !11
if.then19: ; preds = %for.cond3
%idxprom20 = sext i32 %.lcssa38 to i64
%arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %idxprom20
%8 = load i32, ptr %arrayidx21, align 4, !tbaa !5
br label %if.end23
if.end23: ; preds = %for.body5, %if.then19
%final.1.in = phi i32 [ %8, %if.then19 ], [ %7, %for.body5 ]
%cmp24 = icmp slt i32 %final.1.in, 75
br i1 %cmp24, label %if.then25, label %if.else
if.then25: ; preds = %if.end23
%final.1 = add nsw i32 %final.1.in, 15
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %final.1)
br label %if.end28
if.else: ; preds = %if.end23
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end28
if.end28: ; preds = %if.else, %if.then25
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <string.h>
int print(char *s, int a, int b){
for(int i = a; i <= b; i++){
printf("%c", s[i]);
}
printf("\n");
return 0;
}
char *reverse(char *str, int a, int b){
char temp[1001];
int j = 0;
strcpy(temp, str);
for(int i = a; i <= b; i++){
temp[j] = str[i];
j++;
}
j = 0;
for(int i = b; i >= a; i--){
str[i] = temp[j];
j++;
}
return str;
}
char *replace(char *s, int a, int b, char *p){
for(int i = a; i <= b; i++){
s[i] = *p;
p++;
}
return s;
}
int main(){
char str[1001];
int q, a, b;
char cmd[10];
char p[1001];
scanf("%s", str);
scanf("%d", &q);
for(int i = 0; i < q; i++){
scanf("%s", cmd);
if(!strcmp(cmd,"print")){
scanf("%d", &a);
scanf("%d", &b);
print(str, a, b);
}else if(!strcmp(cmd,"reverse")){
scanf("%d", &a);
scanf("%d", &b);
reverse(str, a, b);
}else if(!strcmp(cmd,"replace")){
scanf("%d", &a);
scanf("%d", &b);
scanf("%s", p);
replace(str, a, b, p);
}else{
printf("ERROR\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179132/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179132/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"print\00", align 1
@.str.5 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1
@.str.6 = private unnamed_addr constant [8 x i8] c"replace\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 @print(ptr nocapture noundef readonly %s, i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp.not5 = icmp sgt i32 %a, %b
br i1 %cmp.not5, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %a to i64
%1 = add i32 %b, 1
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%putchar = tail call i32 @putchar(i32 10)
ret i32 0
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 %s, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv = sext i8 %2 to i32
%putchar4 = 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.cond.cleanup, label %for.body, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable
define dso_local ptr @reverse(ptr noundef returned %str, i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%temp = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %temp) #9
%call = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %temp, ptr noundef nonnull dereferenceable(1) %str) #9
%cmp.not28 = icmp sgt i32 %a, %b
br i1 %cmp.not28, label %for.cond.cleanup7, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %a to i64
%scevgep = getelementptr i8, ptr %str, i64 %0
%1 = sub i32 %b, %a
%2 = zext i32 %1 to i64
%3 = add nuw nsw i64 %2, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %temp, ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i64 %3, i1 false), !tbaa !5
%4 = sext i32 %b to i64
%5 = add i32 %b, 1
%6 = sub i32 %5, %a
%wide.trip.count = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 8
br i1 %min.iters.check, label %for.body8.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check44 = icmp ult i32 %6, 32
br i1 %min.iters.check44, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %wide.trip.count, 4294967264
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 %4, %index
%7 = getelementptr inbounds [1001 x i8], ptr %temp, i64 0, i64 %index
%wide.load = load <16 x i8>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i8, ptr %7, i64 16
%wide.load45 = load <16 x i8>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i8, ptr %str, i64 %offset.idx
%reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%10 = getelementptr inbounds i8, ptr %9, i64 -15
store <16 x i8> %reverse, ptr %10, align 1, !tbaa !5
%reverse46 = shufflevector <16 x i8> %wide.load45, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%11 = getelementptr inbounds i8, ptr %9, i64 -31
store <16 x i8> %reverse46, ptr %11, align 1, !tbaa !5
%index.next = add nuw i64 %index, 32
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup7, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end49 = sub nsw i64 %4, %n.vec
%n.vec.remaining = and i64 %wide.trip.count, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body8.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.vec48 = and i64 %wide.trip.count, 4294967288
%ind.end = sub nsw i64 %4, %n.vec48
%invariant.gep = getelementptr i8, ptr %str, i64 -7
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.next56, %vec.epilog.vector.body ]
%offset.idx53 = sub i64 %4, %index52
%13 = getelementptr inbounds [1001 x i8], ptr %temp, i64 0, i64 %index52
%wide.load54 = load <8 x i8>, ptr %13, align 8, !tbaa !5
%reverse55 = shufflevector <8 x i8> %wide.load54, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx53
store <8 x i8> %reverse55, ptr %gep, align 1, !tbaa !5
%index.next56 = add nuw i64 %index52, 8
%14 = icmp eq i64 %index.next56, %n.vec48
br i1 %14, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !13
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n51 = icmp eq i64 %n.vec48, %wide.trip.count
br i1 %cmp.n51, label %for.cond.cleanup7, label %for.body8.preheader
for.body8.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv39.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec48, %vec.epilog.middle.block ]
%indvars.iv.ph = phi i64 [ %4, %iter.check ], [ %ind.end49, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body8
for.cond.cleanup7: ; preds = %for.body8, %middle.block, %vec.epilog.middle.block, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %temp) #9
ret ptr %str
for.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body8 ], [ %indvars.iv39.ph, %for.body8.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ %indvars.iv.ph, %for.body8.preheader ]
%arrayidx10 = getelementptr inbounds [1001 x i8], ptr %temp, i64 0, i64 %indvars.iv39
%15 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%arrayidx12 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv
store i8 %15, ptr %arrayidx12, align 1, !tbaa !5
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%exitcond.not = icmp eq i64 %indvars.iv.next40, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup7, label %for.body8, !llvm.loop !14
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local ptr @replace(ptr noundef returned writeonly %s, i32 noundef %a, i32 noundef %b, ptr nocapture noundef readonly %p) local_unnamed_addr #4 {
entry:
%p10 = ptrtoint ptr %p to i64
%s9 = ptrtoint ptr %s to i64
%cmp.not5 = icmp sgt i32 %a, %b
br i1 %cmp.not5, label %for.cond.cleanup, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %a to i64
%1 = add i32 %b, 1
%2 = sub i32 %b, %a
%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
%5 = add i64 %s9, %0
%6 = sub i64 %5, %p10
%diff.check = icmp ult i64 %6, 32
br i1 %diff.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check11 = icmp ult i32 %2, 31
br i1 %min.iters.check11, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %4, 8589934560
%invariant.gep = getelementptr i8, ptr %s, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%next.gep = getelementptr i8, ptr %p, i64 %index
%wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !5
%7 = getelementptr i8, ptr %next.gep, i64 16
%wide.load13 = load <16 x i8>, ptr %7, align 1, !tbaa !5
%gep = getelementptr i8, ptr %invariant.gep, i64 %index
store <16 x i8> %wide.load, ptr %gep, align 1, !tbaa !5
%8 = getelementptr inbounds i8, ptr %gep, i64 16
store <16 x i8> %wide.load13, ptr %8, align 1, !tbaa !5
%index.next = add nuw i64 %index, 32
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end20 = getelementptr i8, ptr %p, i64 %n.vec
%ind.end17 = 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.vec15 = and i64 %4, 8589934584
%ind.end16 = add nsw i64 %n.vec15, %0
%ind.end19 = getelementptr i8, ptr %p, i64 %n.vec15
%invariant.gep28 = getelementptr i8, ptr %s, i64 %0
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index23 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next27, %vec.epilog.vector.body ]
%next.gep24 = getelementptr i8, ptr %p, i64 %index23
%wide.load26 = load <8 x i8>, ptr %next.gep24, align 1, !tbaa !5
%gep29 = getelementptr i8, ptr %invariant.gep28, i64 %index23
store <8 x i8> %wide.load26, ptr %gep29, align 1, !tbaa !5
%index.next27 = add nuw i64 %index23, 8
%10 = icmp eq i64 %index.next27, %n.vec15
br i1 %10, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !16
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n22 = icmp eq i64 %4, %n.vec15
br i1 %cmp.n22, label %for.cond.cleanup, 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.end17, %vec.epilog.iter.check ], [ %ind.end16, %vec.epilog.middle.block ]
%p.addr.06.ph = phi ptr [ %p, %iter.check ], [ %p, %vector.memcheck ], [ %ind.end20, %vec.epilog.iter.check ], [ %ind.end19, %vec.epilog.middle.block ]
%11 = add i32 %b, 1
%12 = trunc i64 %indvars.iv.ph to i32
%13 = sub i32 %11, %12
%14 = sub i32 %b, %12
%xtraiter = and i32 %13, 3
%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, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader ]
%p.addr.06.prol = phi ptr [ %incdec.ptr.prol, %for.body.prol ], [ %p.addr.06.ph, %for.body.preheader ]
%prol.iter = phi i32 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader ]
%15 = load i8, ptr %p.addr.06.prol, align 1, !tbaa !5
%arrayidx.prol = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.prol
store i8 %15, ptr %arrayidx.prol, align 1, !tbaa !5
%incdec.ptr.prol = getelementptr inbounds i8, ptr %p.addr.06.prol, i64 1
%indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i32 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !17
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 ]
%p.addr.06.unr = phi ptr [ %p.addr.06.ph, %for.body.preheader ], [ %incdec.ptr.prol, %for.body.prol ]
%16 = icmp ult i32 %14, 3
br i1 %16, label %for.cond.cleanup, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep30 = getelementptr i8, ptr %s, i64 1
%invariant.gep32 = getelementptr i8, ptr %s, i64 2
%invariant.gep34 = getelementptr i8, ptr %s, i64 3
br label %for.body
for.cond.cleanup: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry
ret ptr %s
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%p.addr.06 = phi ptr [ %p.addr.06.unr, %for.body.preheader.new ], [ %incdec.ptr.3, %for.body ]
%17 = load i8, ptr %p.addr.06, align 1, !tbaa !5
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
store i8 %17, ptr %arrayidx, align 1, !tbaa !5
%incdec.ptr = getelementptr inbounds i8, ptr %p.addr.06, i64 1
%18 = load i8, ptr %incdec.ptr, align 1, !tbaa !5
%gep31 = getelementptr i8, ptr %invariant.gep30, i64 %indvars.iv
store i8 %18, ptr %gep31, align 1, !tbaa !5
%incdec.ptr.1 = getelementptr inbounds i8, ptr %p.addr.06, i64 2
%19 = load i8, ptr %incdec.ptr.1, align 1, !tbaa !5
%gep33 = getelementptr i8, ptr %invariant.gep32, i64 %indvars.iv
store i8 %19, ptr %gep33, align 1, !tbaa !5
%incdec.ptr.2 = getelementptr inbounds i8, ptr %p.addr.06, i64 3
%20 = load i8, ptr %incdec.ptr.2, align 1, !tbaa !5
%gep35 = getelementptr i8, ptr %invariant.gep34, i64 %indvars.iv
store i8 %20, ptr %gep35, align 1, !tbaa !5
%incdec.ptr.3 = getelementptr inbounds i8, ptr %p.addr.06, i64 4
%indvars.iv.next.3 = add nsw i64 %indvars.iv, 4
%lftr.wideiv.3 = trunc i64 %indvars.iv.next.3 to i32
%exitcond.not.3 = icmp eq i32 %1, %lftr.wideiv.3
br i1 %exitcond.not.3, label %for.cond.cleanup, label %for.body, !llvm.loop !19
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%temp.i = alloca [1001 x i8], align 16
%str = alloca [1001 x i8], align 16
%q = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%cmd = alloca [10 x i8], align 1
%p = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #9
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %cmd) #9
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %p) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %str)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !20
%cmp48 = icmp sgt i32 %0, 0
br i1 %cmp48, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%invariant.gep = getelementptr i8, ptr %str, i64 -7
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %p) #9
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %cmd) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #9
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #9
ret i32 0
for.body: ; preds = %for.body.preheader, %for.inc
%i.049 = phi i32 [ %inc, %for.inc ], [ 0, %for.body.preheader ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %cmd)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %cmd, ptr noundef nonnull dereferenceable(6) @.str.4, i64 6)
%tobool.not = icmp eq i32 %bcmp, 0
br i1 %tobool.not, label %if.then, label %if.else
if.then: ; preds = %for.body
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a)
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !20
%2 = load i32, ptr %b, align 4, !tbaa !20
%cmp.not5.i = icmp sgt i32 %1, %2
br i1 %cmp.not5.i, label %print.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %if.then
%3 = sext i32 %1 to i64
%4 = add i32 %2, 1
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %3, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i
%5 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%conv.i = sext i8 %5 to i32
%putchar4.i = call i32 @putchar(i32 %conv.i)
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%lftr.wideiv.i = trunc i64 %indvars.iv.next.i to i32
%exitcond.not.i = icmp eq i32 %4, %lftr.wideiv.i
br i1 %exitcond.not.i, label %print.exit, label %for.body.i, !llvm.loop !8
print.exit: ; preds = %for.body.i, %if.then
%putchar.i = call i32 @putchar(i32 10)
br label %for.inc
if.else: ; preds = %for.body
%bcmp35 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %cmd, ptr noundef nonnull dereferenceable(8) @.str.5, i64 8)
%tobool12.not = icmp eq i32 %bcmp35, 0
br i1 %tobool12.not, label %if.then13, label %if.else18
if.then13: ; preds = %if.else
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a)
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %b)
%6 = load i32, ptr %a, align 4, !tbaa !20
%7 = load i32, ptr %b, align 4, !tbaa !20
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %temp.i) #9
%call.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %temp.i, ptr noundef nonnull dereferenceable(1) %str) #9
%cmp.not28.i = icmp sgt i32 %6, %7
br i1 %cmp.not28.i, label %reverse.exit, label %iter.check
iter.check: ; preds = %if.then13
%8 = sext i32 %6 to i64
%scevgep.i = getelementptr i8, ptr %str, i64 %8
%9 = sub i32 %7, %6
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %temp.i, ptr noundef nonnull align 1 dereferenceable(1) %scevgep.i, i64 %11, i1 false), !tbaa !5
%12 = sext i32 %7 to i64
%13 = add i32 %9, 1
%wide.trip.count.i = zext i32 %13 to i64
%min.iters.check = icmp ult i32 %13, 8
br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check50 = icmp ult i32 %13, 32
br i1 %min.iters.check50, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %wide.trip.count.i, 4294967264
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 %12, %index
%14 = getelementptr inbounds [1001 x i8], ptr %temp.i, i64 0, i64 %index
%wide.load = load <16 x i8>, ptr %14, align 16, !tbaa !5
%15 = getelementptr inbounds i8, ptr %14, i64 16
%wide.load51 = load <16 x i8>, ptr %15, align 16, !tbaa !5
%16 = getelementptr inbounds i8, ptr %str, i64 %offset.idx
%reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%17 = getelementptr inbounds i8, ptr %16, i64 -15
store <16 x i8> %reverse, ptr %17, align 1, !tbaa !5
%reverse52 = shufflevector <16 x i8> %wide.load51, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%18 = getelementptr inbounds i8, ptr %16, i64 -31
store <16 x i8> %reverse52, ptr %18, align 1, !tbaa !5
%index.next = add nuw i64 %index, 32
%19 = icmp eq i64 %index.next, %n.vec
br i1 %19, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %reverse.exit, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end55 = sub nsw i64 %12, %n.vec
%n.vec.remaining = and i64 %wide.trip.count.i, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body8.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.vec54 = and i64 %wide.trip.count.i, 4294967288
%ind.end = sub nsw i64 %12, %n.vec54
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index58 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next62, %vec.epilog.vector.body ]
%offset.idx59 = sub i64 %12, %index58
%20 = getelementptr inbounds [1001 x i8], ptr %temp.i, i64 0, i64 %index58
%wide.load60 = load <8 x i8>, ptr %20, align 8, !tbaa !5
%reverse61 = shufflevector <8 x i8> %wide.load60, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx59
store <8 x i8> %reverse61, ptr %gep, align 1, !tbaa !5
%index.next62 = add nuw i64 %index58, 8
%21 = icmp eq i64 %index.next62, %n.vec54
br i1 %21, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !23
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n57 = icmp eq i64 %n.vec54, %wide.trip.count.i
br i1 %cmp.n57, label %reverse.exit, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv39.i.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec54, %vec.epilog.middle.block ]
%indvars.iv.i37.ph = phi i64 [ %12, %iter.check ], [ %ind.end55, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i
%indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body8.i ], [ %indvars.iv39.i.ph, %for.body8.i.preheader ]
%indvars.iv.i37 = phi i64 [ %indvars.iv.next.i38, %for.body8.i ], [ %indvars.iv.i37.ph, %for.body8.i.preheader ]
%arrayidx10.i = getelementptr inbounds [1001 x i8], ptr %temp.i, i64 0, i64 %indvars.iv39.i
%22 = load i8, ptr %arrayidx10.i, align 1, !tbaa !5
%arrayidx12.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i37
store i8 %22, ptr %arrayidx12.i, align 1, !tbaa !5
%indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1
%indvars.iv.next.i38 = add nsw i64 %indvars.iv.i37, -1
%exitcond.not.i39 = icmp eq i64 %indvars.iv.next40.i, %wide.trip.count.i
br i1 %exitcond.not.i39, label %reverse.exit, label %for.body8.i, !llvm.loop !24
reverse.exit: ; preds = %for.body8.i, %middle.block, %vec.epilog.middle.block, %if.then13
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %temp.i) #9
br label %for.inc
if.else18: ; preds = %if.else
%bcmp36 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %cmd, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8)
%tobool21.not = icmp eq i32 %bcmp36, 0
br i1 %tobool21.not, label %if.then22, label %if.else30
if.then22: ; preds = %if.else18
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a)
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %b)
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %p)
%23 = load i32, ptr %a, align 4, !tbaa !20
%24 = load i32, ptr %b, align 4, !tbaa !20
%cmp.not5.i40 = icmp sgt i32 %23, %24
br i1 %cmp.not5.i40, label %for.inc, label %for.body.preheader.i41
for.body.preheader.i41: ; preds = %if.then22
%25 = sext i32 %23 to i64
%scevgep = getelementptr i8, ptr %str, i64 %25
%26 = sub i32 %24, %23
%27 = zext i32 %26 to i64
%28 = add nuw nsw i64 %27, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 16 dereferenceable(1) %p, i64 %28, i1 false), !tbaa !5
br label %for.inc
if.else30: ; preds = %if.else18
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
for.inc: ; preds = %for.body.preheader.i41, %if.then22, %print.exit, %if.else30, %reverse.exit
%inc = add nuw nsw i32 %i.049, 1
%29 = load i32, ptr %q, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %29
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !25
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nofree nounwind willreturn memory(argmem: read) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9, !11, !12}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !9, !11, !12}
!14 = distinct !{!14, !9, !12, !11}
!15 = distinct !{!15, !9, !11, !12}
!16 = distinct !{!16, !9, !11, !12}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !9, !11}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !6, i64 0}
!22 = distinct !{!22, !9, !11, !12}
!23 = distinct !{!23, !9, !11, !12}
!24 = distinct !{!24, !9, !12, !11}
!25 = distinct !{!25, !9}
|
/* ファイル名:ITP1_9_D.c */
/* 内容:文字列 str に対して、次の与えられた命令の列を実行する */
/* print a b: str の a 文字目から b 文字目までを出力する。 */
/* reverse a b: str の a 文字目から b 文字目までを逆順にする。 */
/* replace a b p: str の a 文字目から b 文字目までを p に置き換える。 */
/* include */
#include <stdio.h>
#include <string.h>
/* 外部変数宣言 */
/* プロトタイプ宣言 */
/* 関数名:main */
/* 処理内容:文字列 str に対して、与えられた命令の列を実行する */
int main( void )
{
/* 内部変数定義 */
/* 入力 */
char str[1001]; /* 入力される文字列 */
char cmd[8]; /* 命令文字列 */
int n; /* 与えられる命令の数 */
int a; /* 入力される文字の位置1 */
int b; /* 入力される文字の位置2 */
char p[1001]; /* 置き換える文字列 */
/* 処理 */
int i; /* ループ用変数1 */
int j; /* ループ用変数2 */
int inc; /* インクリメント変数 */
int dec; /* デクリメント変数 */
char rev; /* 入れ替え用変数 */
/* 入力処理 */
scanf("%s",str); /* 文字列の取得 */
scanf("%d",&n); /* 命令の数を取得 */
/* 命令の数だけループ */
for(i = 0; i < n; i++){
scanf("%s",cmd); /* 命令文字列を取得 */
/* 命令が"print"だった場合 */
if(strcmp(cmd,"print") == 0){
scanf("%d %d",&a, &b); /* aとbを取得 */
for(j = a; j <= b; j++){
printf("%c",str[j]); /* 文字列を1文字ずつ出力 */
}
printf("\n");
}
/* 命令が"reverse"だった場合 */
else if(strcmp(cmd,"reverse") == 0){
scanf("%d %d",&a, &b); /* aとbを取得 */
inc = a; /* インクリメント変数初期化 */
dec = b; /* デクリメント変数初期化 */
/* 文字列の逆順にする範囲の中心までループ */
while(inc < dec){
/* a番目からb番目の入れ替え */
rev = str[inc];
str[inc] = str[dec];
str[dec] = rev;
inc++;
dec--;
}
}
/* 命令が"replace"だった場合 */
else if(strcmp(cmd,"replace") == 0){
scanf("%d %d %s",&a, &b, p); /* aとbとpを取得 */
/* pの長さまでループ*/
for(j = 0; j < b - a + 1 ; j++){
str[a + j] = p[j]; /* pをstrのa番目からb番目にコピー */
}
}
/* 命令がどれにも該当しなかった場合 */
else{
/* 処理なし */
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179176/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179176/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"print\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.6 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1
@.str.7 = private unnamed_addr constant [8 x i8] c"replace\00", align 1
@.str.8 = private unnamed_addr constant [9 x i8] c"%d %d %s\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
%cmd = alloca [8 x i8], align 1
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%p = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %cmd) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %p) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp82 = icmp sgt i32 %0, 0
br i1 %cmp82, label %for.body, label %for.end57
for.body: ; preds = %entry, %for.inc55
%i.083 = phi i32 [ %inc56, %for.inc55 ], [ 0, %entry ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cmd)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %cmd, ptr noundef nonnull dereferenceable(6) @.str.2, i64 6)
%cmp6 = icmp eq i32 %bcmp, 0
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp9.not80 = icmp sgt i32 %1, %2
br i1 %cmp9.not80, label %for.end, label %for.body10.preheader
for.body10.preheader: ; preds = %if.then
%3 = sext i32 %1 to i64
br label %for.body10
for.body10: ; preds = %for.body10.preheader, %for.body10
%indvars.iv92 = phi i64 [ %3, %for.body10.preheader ], [ %indvars.iv.next93, %for.body10 ]
%arrayidx = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv92
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %4 to i32
%putchar73 = call i32 @putchar(i32 %conv)
%indvars.iv.next93 = add nsw i64 %indvars.iv92, 1
%5 = load i32, ptr %b, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp9.not.not = icmp slt i64 %indvars.iv92, %6
br i1 %cmp9.not.not, label %for.body10, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body10, %if.then
%putchar = call i32 @putchar(i32 10)
br label %for.inc55
if.else: ; preds = %for.body
%bcmp71 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %cmd, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8)
%cmp16 = icmp eq i32 %bcmp71, 0
br i1 %cmp16, label %if.then18, label %if.else32
if.then18: ; preds = %if.else
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a, ptr noundef nonnull %b)
%7 = load i32, ptr %a, align 4, !tbaa !5
%8 = load i32, ptr %b, align 4, !tbaa !5
%cmp2077 = icmp slt i32 %7, %8
br i1 %cmp2077, label %while.body.preheader, label %for.inc55
while.body.preheader: ; preds = %if.then18
%9 = sext i32 %8 to i64
%10 = sext i32 %7 to i64
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv87 = phi i64 [ %10, %while.body.preheader ], [ %indvars.iv.next88, %while.body ]
%indvars.iv = phi i64 [ %9, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%arrayidx23 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv87
%11 = load i8, ptr %arrayidx23, align 1, !tbaa !9
%arrayidx25 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv
%12 = load i8, ptr %arrayidx25, align 1, !tbaa !9
store i8 %12, ptr %arrayidx23, align 1, !tbaa !9
store i8 %11, ptr %arrayidx25, align 1, !tbaa !9
%indvars.iv.next88 = add nsw i64 %indvars.iv87, 1
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%cmp20 = icmp slt i64 %indvars.iv.next88, %indvars.iv.next
br i1 %cmp20, label %while.body, label %for.inc55, !llvm.loop !12
if.else32: ; preds = %if.else
%bcmp72 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %cmd, ptr noundef nonnull dereferenceable(8) @.str.7, i64 8)
%cmp35 = icmp eq i32 %bcmp72, 0
br i1 %cmp35, label %if.then37, label %for.inc55
if.then37: ; preds = %if.else32
%call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %p)
%13 = load i32, ptr %b, align 4, !tbaa !5
%14 = load i32, ptr %a, align 4, !tbaa !5
%cmp41.not75 = icmp slt i32 %13, %14
br i1 %cmp41.not75, label %for.inc55, label %for.body43.preheader
for.body43.preheader: ; preds = %if.then37
%15 = sext i32 %14 to i64
%scevgep = getelementptr i8, ptr %str, i64 %15
%16 = add i32 %13, 1
%17 = sub i32 %16, %14
%18 = zext i32 %17 to i64
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 %p, i64 %18, i1 false), !tbaa !9
br label %for.inc55
for.inc55: ; preds = %while.body, %for.body43.preheader, %if.then37, %if.then18, %for.end, %if.else32
%inc56 = add nuw nsw i32 %i.083, 1
%19 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc56, %19
br i1 %cmp, label %for.body, label %for.end57, !llvm.loop !13
for.end57: ; preds = %for.inc55, %entry
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %p) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %cmd) #6
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; 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 nounwind willreturn memory(argmem: read) }
attributes #4 = { nofree nounwind }
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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STRING_LIMIT 1001
#define COMMAND_LIMIT 100
#define REPLACE "replace"
#define REVERSE "reverse"
#define PRINT "print"
const char* CMD[] = { REPLACE, REVERSE, PRINT };
typedef struct {
char* keyword;
int start;
int end;
char* rep;
} Command;
typedef struct {
char str[STRING_LIMIT];
int count;
Command* command;
} DataSet;
void InputDataSet(DataSet* dataSet);
int InputCommand(Command* command, int strSize);
void Calculation(DataSet* dataSet);
void FreeDataSet(DataSet* dataSet);
int Contains(char* str, const char** checker);
int main(void) {
DataSet dataSet;
InputDataSet(&dataSet);
Calculation(&dataSet);
FreeDataSet(&dataSet);
}
void InputDataSet(DataSet* dataSet) {
char buf[STRING_LIMIT];
int strSize = 0;
int cmdCount;
int cmdFlag;
Command* cmd;
int idx;
do {
memset(buf, '\0', STRING_LIMIT);
scanf("%[^\n]s", buf);
for (strSize = 0; buf[strSize] != '\0'; strSize++);
} while(strSize < 1 || strSize >= STRING_LIMIT);
do {
scanf("%d", &cmdCount);
} while (cmdCount < 1 || cmdCount > COMMAND_LIMIT);
cmd = (Command*)malloc(sizeof(Command) * cmdCount);
for (idx = 0; idx < cmdCount; idx++) {
do {
cmdFlag = InputCommand((cmd + idx), strSize);
} while (cmdFlag != 1);
}
memcpy(dataSet->str, buf, STRING_LIMIT);
dataSet->count = cmdCount;
dataSet->command = cmd;
}
int InputCommand(Command* command, int strSize) {
char buf[COMMAND_LIMIT];
int cmdSize;
int start;
int end;
char* rep = NULL;
int repLimit;
memset(buf, '\0', COMMAND_LIMIT);
scanf(" %s", buf);
for (cmdSize = 0; buf[cmdSize] != '\0'; cmdSize++);
if (!Contains(buf, CMD)) {
return 0;
}
scanf("%d %d", &start, &end);
if ((start < 0 || start > end) ||
(end < start || end >= strSize)) {
return 0;
}
if (strcmp(buf, REPLACE) == 0) {
int repSize;
repLimit = (end - start + 1);
rep = (char*)malloc(sizeof(char) * repLimit);
memset(rep, '\0', repLimit);
scanf(" %s", rep);
for (repSize = 0; *(rep + repSize) != '\0'; repSize++);
if (repSize != repLimit) {
return 0;
}
}
command->keyword = (char*)malloc(sizeof(char) * cmdSize + 1);
memcpy(command->keyword, buf, cmdSize + 1);
command->start = start;
command->end = end;
command->rep = rep;
return 1;
}
void Calculation(DataSet* dataSet) {
int idx;
int idc;
char* str = dataSet->str;
for (idx = 0; idx < dataSet->count; idx++) {
Command* cmd = (dataSet->command + idx);
char* keyword = cmd->keyword;
int start = cmd->start;
int end = cmd->end;
if (strcmp(keyword, REPLACE) == 0) {
char* rep = cmd->rep;
for (idc = start; idc <= end; idc++) {
*(str + idc) = *(rep + idc - start);
}
} else
if (strcmp(keyword, REVERSE) == 0) {
for (idc = start; idc <= (start + end) / 2; idc++) {
char tmp = *(str + idc);
*(str + idc) = *(str + start + end - idc);
*(str + start + end - idc) = tmp;
}
} else
if (strcmp(keyword, PRINT) == 0) {
for (idc = start; idc <= end; idc++) {
printf("%c", *(str + idc));
}
printf("\n");
}
}
}
void FreeDataSet(DataSet* dataSet) {
int idx;
for (idx = 0; idx < dataSet->count; idx++) {
Command* command = dataSet->command + idx;
free(command->keyword);
if (command->rep != NULL) {
free(command->rep);
}
}
free(dataSet->command);
}
int Contains(char* str, const char** checker) {
int res = 0;
int idx = 0;
for (idx = 0; *(checker + idx); idx++) {
if (!(res = strcmp(str, *(checker + idx)))) {
res = 1;
break;
}
}
return res;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179219/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179219/source.c"
target datalayout = "e-m:e-p270: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.DataSet = type { [1001 x i8], i32, ptr }
%struct.Command = type { ptr, i32, i32, ptr }
@.str = private unnamed_addr constant [8 x i8] c"replace\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"print\00", align 1
@CMD = dso_local local_unnamed_addr global [3 x ptr] [ptr @.str, ptr @.str.1, ptr @.str.2], align 16
@.str.3 = private unnamed_addr constant [7 x i8] c"%[^\0A]s\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.5 = private unnamed_addr constant [4 x i8] c" %s\00", align 1
@.str.6 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%dataSet = alloca %struct.DataSet, align 8
call void @llvm.lifetime.start.p0(i64 1016, ptr nonnull %dataSet) #12
call void @InputDataSet(ptr noundef nonnull %dataSet)
call void @Calculation(ptr noundef nonnull %dataSet)
%count.i = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 1
%0 = load i32, ptr %count.i, align 4, !tbaa !5
%cmp11.i = icmp sgt i32 %0, 0
%command1.i = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 2
%1 = load ptr, ptr %command1.i, align 8, !tbaa !11
br i1 %cmp11.i, label %for.body.lr.ph.i, label %FreeDataSet.exit
for.body.lr.ph.i: ; preds = %entry
%2 = zext i32 %0 to i64
br label %for.body.i
for.body.i: ; preds = %if.end.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %if.end.i ]
%add.ptr.i = getelementptr inbounds %struct.Command, ptr %1, i64 %indvars.iv.i
%3 = load ptr, ptr %add.ptr.i, align 8, !tbaa !12
tail call void @free(ptr noundef %3) #12
%rep.i = getelementptr inbounds %struct.Command, ptr %1, i64 %indvars.iv.i, i32 3
%4 = load ptr, ptr %rep.i, align 8, !tbaa !14
%cmp2.not.i = icmp eq ptr %4, null
br i1 %cmp2.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %for.body.i
tail call void @free(ptr noundef nonnull %4) #12
br label %if.end.i
if.end.i: ; preds = %if.then.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not = icmp eq i64 %indvars.iv.next.i, %2
br i1 %exitcond.not, label %FreeDataSet.exit, label %for.body.i, !llvm.loop !15
FreeDataSet.exit: ; preds = %if.end.i, %entry
tail call void @free(ptr noundef %1) #12
call void @llvm.lifetime.end.p0(i64 1016, ptr nonnull %dataSet) #12
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @InputDataSet(ptr nocapture noundef writeonly %dataSet) local_unnamed_addr #2 {
entry:
%buf.i = alloca [100 x i8], align 16
%start.i = alloca i32, align 4
%end.i = alloca i32, align 4
%buf = alloca [1001 x i8], align 16
%cmdCount = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %buf) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %cmdCount) #12
br label %do.body
do.body: ; preds = %do.cond, %entry
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %buf, i8 0, i64 1001, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %buf)
br label %for.cond
for.cond: ; preds = %for.cond, %do.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %do.body ]
%arrayidx = getelementptr inbounds [1001 x i8], ptr %buf, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !17
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %do.cond, label %for.cond, !llvm.loop !18
do.cond: ; preds = %for.cond
%1 = trunc i64 %indvars.iv to i32
%2 = add nsw i32 %1, -1001
%3 = icmp ult i32 %2, -1000
br i1 %3, label %do.body, label %do.body7, !llvm.loop !19
do.body7: ; preds = %do.cond, %do.body7
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %cmdCount)
%4 = load i32, ptr %cmdCount, align 4
%5 = add i32 %4, -101
%6 = icmp ult i32 %5, -100
br i1 %6, label %do.body7, label %do.body23.preheader.preheader, !llvm.loop !20
do.body23.preheader.preheader: ; preds = %do.body7
%conv17 = zext i32 %4 to i64
%mul = mul nuw nsw i64 %conv17, 24
%call18 = call noalias ptr @malloc(i64 noundef %mul) #13
br label %do.body23.preheader
do.body23.preheader: ; preds = %do.body23.preheader.preheader, %for.inc29
%indvars.iv70 = phi i64 [ 0, %do.body23.preheader.preheader ], [ %indvars.iv.next71, %for.inc29 ]
br label %do.body23
do.body23: ; preds = %do.body23.preheader, %InputCommand.exit
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %buf.i) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start.i) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end.i) #12
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100) %buf.i, i8 0, i64 100, i1 false)
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %buf.i)
br label %for.cond.i
for.cond.i: ; preds = %for.cond.i, %do.body23
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.cond.i ], [ 0, %do.body23 ]
%arrayidx.i = getelementptr inbounds [100 x i8], ptr %buf.i, i64 0, i64 %indvars.iv.i
%7 = load i8, ptr %arrayidx.i, align 1, !tbaa !17
%cmp.not.i = icmp eq i8 %7, 0
%indvars.iv.next.i = add i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %for.end.i, label %for.cond.i, !llvm.loop !21
for.end.i: ; preds = %for.cond.i
%8 = load ptr, ptr @CMD, align 16, !tbaa !22
%tobool.not7.i.i = icmp eq ptr %8, null
br i1 %tobool.not7.i.i, label %InputCommand.exit, label %for.body.i.preheader.i
for.body.i.preheader.i: ; preds = %for.end.i
%call5.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %start.i, ptr noundef nonnull %end.i)
%9 = load i32, ptr %start.i, align 4, !tbaa !23
%cmp6.i = icmp slt i32 %9, 0
br i1 %cmp6.i, label %InputCommand.exit, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %for.body.i.preheader.i
%10 = load i32, ptr %end.i, align 4, !tbaa !23
%cmp8.i = icmp sle i32 %9, %10
%cmp14.not.i = icmp slt i32 %10, %1
%or.cond.i = and i1 %cmp8.i, %cmp14.not.i
br i1 %or.cond.i, label %if.end17.i, label %InputCommand.exit
if.end17.i: ; preds = %lor.lhs.false.i
%lhsv.i = load i64, ptr %buf.i, align 16
%.not.i = icmp eq i64 %lhsv.i, 28538242730059122
br i1 %.not.i, label %if.then22.i, label %for.inc29
if.then22.i: ; preds = %if.end17.i
%sub.i = sub nsw i32 %10, %9
%add.i = add nsw i32 %sub.i, 1
%conv23.i = sext i32 %add.i to i64
%calloc.i = call ptr @calloc(i64 1, i64 %conv23.i)
%call26.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef %calloc.i)
br label %for.cond27.i
for.cond27.i: ; preds = %for.cond27.i, %if.then22.i
%indvars.iv76.i = phi i64 [ %indvars.iv.next77.i, %for.cond27.i ], [ 0, %if.then22.i ]
%add.ptr.i = getelementptr inbounds i8, ptr %calloc.i, i64 %indvars.iv76.i
%11 = load i8, ptr %add.ptr.i, align 1, !tbaa !17
%cmp29.not.i = icmp eq i8 %11, 0
%indvars.iv.next77.i = add nuw i64 %indvars.iv76.i, 1
br i1 %cmp29.not.i, label %for.end34.i, label %for.cond27.i, !llvm.loop !24
for.end34.i: ; preds = %for.cond27.i
%12 = trunc i64 %indvars.iv76.i to i32
%cmp35.not.i = icmp eq i32 %add.i, %12
br i1 %cmp35.not.i, label %for.end34.if.end39_crit_edge.i, label %InputCommand.exit
for.end34.if.end39_crit_edge.i: ; preds = %for.end34.i
%.pre.i = load i32, ptr %start.i, align 4, !tbaa !23
%.pre79.i = load i32, ptr %end.i, align 4, !tbaa !23
br label %for.inc29
InputCommand.exit: ; preds = %for.end.i, %for.body.i.preheader.i, %lor.lhs.false.i, %for.end34.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end.i) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start.i) #12
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %buf.i) #12
br label %do.body23, !llvm.loop !25
for.inc29: ; preds = %if.end17.i, %for.end34.if.end39_crit_edge.i
%13 = phi i32 [ %.pre79.i, %for.end34.if.end39_crit_edge.i ], [ %10, %if.end17.i ]
%14 = phi i32 [ %.pre.i, %for.end34.if.end39_crit_edge.i ], [ %9, %if.end17.i ]
%rep.0.i = phi ptr [ %calloc.i, %for.end34.if.end39_crit_edge.i ], [ null, %if.end17.i ]
%add.ptr48 = getelementptr inbounds %struct.Command, ptr %call18, i64 %indvars.iv70
%call43.i = call noalias ptr @malloc(i64 noundef %indvars.iv.next.i) #13
store ptr %call43.i, ptr %add.ptr48, align 8, !tbaa !12
%conv47.i = and i64 %indvars.iv.next.i, 4294967295
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %call43.i, ptr noundef nonnull align 16 dereferenceable(1) %buf.i, i64 %conv47.i, i1 false)
%start48.i = getelementptr inbounds %struct.Command, ptr %call18, i64 %indvars.iv70, i32 1
store i32 %14, ptr %start48.i, align 8, !tbaa !26
%end49.i = getelementptr inbounds %struct.Command, ptr %call18, i64 %indvars.iv70, i32 2
store i32 %13, ptr %end49.i, align 4, !tbaa !27
%rep50.i = getelementptr inbounds %struct.Command, ptr %call18, i64 %indvars.iv70, i32 3
store ptr %rep.0.i, ptr %rep50.i, align 8, !tbaa !14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end.i) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start.i) #12
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %buf.i) #12
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%15 = load i32, ptr %cmdCount, align 4, !tbaa !23
%16 = sext i32 %15 to i64
%cmp20 = icmp slt i64 %indvars.iv.next71, %16
br i1 %cmp20, label %do.body23.preheader, label %for.end31, !llvm.loop !28
for.end31: ; preds = %for.inc29
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1001) %dataSet, ptr noundef nonnull align 16 dereferenceable(1001) %buf, i64 1001, i1 false)
%count = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 1
store i32 %15, ptr %count, align 4, !tbaa !5
%command = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 2
store ptr %call18, ptr %command, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %cmdCount) #12
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %buf) #12
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @Calculation(ptr nocapture noundef %dataSet) local_unnamed_addr #2 {
entry:
%dataSet125 = ptrtoint ptr %dataSet to i64
%count = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%cmp106 = icmp sgt i32 %0, 0
br i1 %cmp106, label %for.body.lr.ph, label %for.end61
for.body.lr.ph: ; preds = %entry
%command = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 2
%invariant.gep139 = getelementptr i8, ptr %dataSet, i64 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end58
%indvars.iv120 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next121, %if.end58 ]
%1 = load ptr, ptr %command, align 8, !tbaa !11
%add.ptr = getelementptr inbounds %struct.Command, ptr %1, i64 %indvars.iv120
%2 = load ptr, ptr %add.ptr, align 8, !tbaa !12
%start3 = getelementptr inbounds %struct.Command, ptr %1, i64 %indvars.iv120, i32 1
%3 = load i32, ptr %start3, align 8, !tbaa !26
%end4 = getelementptr inbounds %struct.Command, ptr %1, i64 %indvars.iv120, i32 2
%4 = load i32, ptr %end4, align 4, !tbaa !27
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(8) @.str) #14
%cmp5 = icmp eq i32 %call, 0
br i1 %cmp5, label %if.then, label %if.else
if.then: ; preds = %for.body
%cmp8.not104 = icmp sgt i32 %3, %4
br i1 %cmp8.not104, label %if.end58, label %iter.check
iter.check: ; preds = %if.then
%rep6 = getelementptr inbounds %struct.Command, ptr %1, i64 %indvars.iv120, i32 3
%5 = load ptr, ptr %rep6, align 8, !tbaa !14
%idx.ext12 = sext i32 %3 to i64
%idx.neg = sub nsw i64 0, %idx.ext12
%invariant.gep = getelementptr i8, ptr %5, i64 %idx.neg
%6 = add i32 %4, 1
%7 = sub i32 %4, %3
%8 = zext i32 %7 to i64
%9 = add nuw nsw i64 %8, 1
%min.iters.check = icmp ult i32 %7, 7
br i1 %min.iters.check, label %for.body9.preheader, label %vector.memcheck
vector.memcheck: ; preds = %iter.check
%10 = ptrtoint ptr %5 to i64
%11 = add i64 %dataSet125, %idx.ext12
%12 = sub i64 %11, %10
%diff.check = icmp ult i64 %12, 32
br i1 %diff.check, label %for.body9.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check126 = icmp ult i32 %7, 31
br i1 %min.iters.check126, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %9, 8589934560
%invariant.gep141 = getelementptr i8, ptr %dataSet, i64 %idx.ext12
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%13 = getelementptr i8, ptr %5, i64 %index
%wide.load = load <16 x i8>, ptr %13, align 1, !tbaa !17
%14 = getelementptr i8, ptr %13, i64 16
%wide.load127 = load <16 x i8>, ptr %14, align 1, !tbaa !17
%gep142 = getelementptr i8, ptr %invariant.gep141, i64 %index
store <16 x i8> %wide.load, ptr %gep142, align 1, !tbaa !17
%15 = getelementptr inbounds i8, ptr %gep142, i64 16
store <16 x i8> %wide.load127, ptr %15, align 1, !tbaa !17
%index.next = add nuw i64 %index, 32
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !29
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %9, %n.vec
br i1 %cmp.n, label %if.end58, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end130 = add nsw i64 %n.vec, %idx.ext12
%n.vec.remaining = and i64 %9, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body9.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.vec129 = and i64 %9, 8589934584
%ind.end = add nsw i64 %n.vec129, %idx.ext12
%invariant.gep143 = getelementptr i8, ptr %dataSet, i64 %idx.ext12
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index132 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next135, %vec.epilog.vector.body ]
%17 = getelementptr i8, ptr %5, i64 %index132
%wide.load134 = load <8 x i8>, ptr %17, align 1, !tbaa !17
%gep144 = getelementptr i8, ptr %invariant.gep143, i64 %index132
store <8 x i8> %wide.load134, ptr %gep144, align 1, !tbaa !17
%index.next135 = add nuw i64 %index132, 8
%18 = icmp eq i64 %index.next135, %n.vec129
br i1 %18, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !32
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n131 = icmp eq i64 %9, %n.vec129
br i1 %cmp.n131, label %if.end58, label %for.body9.preheader
for.body9.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv115.ph = phi i64 [ %idx.ext12, %iter.check ], [ %idx.ext12, %vector.memcheck ], [ %ind.end130, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
%19 = add i32 %4, 1
%20 = trunc i64 %indvars.iv115.ph to i32
%21 = sub i32 %19, %20
%22 = sub i32 %4, %20
%xtraiter137 = and i32 %21, 3
%lcmp.mod138.not = icmp eq i32 %xtraiter137, 0
br i1 %lcmp.mod138.not, label %for.body9.prol.loopexit, label %for.body9.prol
for.body9.prol: ; preds = %for.body9.preheader, %for.body9.prol
%indvars.iv115.prol = phi i64 [ %indvars.iv.next116.prol, %for.body9.prol ], [ %indvars.iv115.ph, %for.body9.preheader ]
%prol.iter = phi i32 [ %prol.iter.next, %for.body9.prol ], [ 0, %for.body9.preheader ]
%gep.prol = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv115.prol
%23 = load i8, ptr %gep.prol, align 1, !tbaa !17
%add.ptr15.prol = getelementptr inbounds i8, ptr %dataSet, i64 %indvars.iv115.prol
store i8 %23, ptr %add.ptr15.prol, align 1, !tbaa !17
%indvars.iv.next116.prol = add nsw i64 %indvars.iv115.prol, 1
%prol.iter.next = add i32 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter137
br i1 %prol.iter.cmp.not, label %for.body9.prol.loopexit, label %for.body9.prol, !llvm.loop !33
for.body9.prol.loopexit: ; preds = %for.body9.prol, %for.body9.preheader
%indvars.iv115.unr = phi i64 [ %indvars.iv115.ph, %for.body9.preheader ], [ %indvars.iv.next116.prol, %for.body9.prol ]
%24 = icmp ult i32 %22, 3
br i1 %24, label %if.end58, label %for.body9
for.body9: ; preds = %for.body9.prol.loopexit, %for.body9
%indvars.iv115 = phi i64 [ %indvars.iv.next116.3, %for.body9 ], [ %indvars.iv115.unr, %for.body9.prol.loopexit ]
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv115
%25 = load i8, ptr %gep, align 1, !tbaa !17
%add.ptr15 = getelementptr inbounds i8, ptr %dataSet, i64 %indvars.iv115
store i8 %25, ptr %add.ptr15, align 1, !tbaa !17
%indvars.iv.next116 = add nsw i64 %indvars.iv115, 1
%gep.1 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next116
%26 = load i8, ptr %gep.1, align 1, !tbaa !17
%add.ptr15.1 = getelementptr inbounds i8, ptr %dataSet, i64 %indvars.iv.next116
store i8 %26, ptr %add.ptr15.1, align 1, !tbaa !17
%indvars.iv.next116.1 = add nsw i64 %indvars.iv115, 2
%gep.2 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next116.1
%27 = load i8, ptr %gep.2, align 1, !tbaa !17
%add.ptr15.2 = getelementptr inbounds i8, ptr %dataSet, i64 %indvars.iv.next116.1
store i8 %27, ptr %add.ptr15.2, align 1, !tbaa !17
%indvars.iv.next116.2 = add nsw i64 %indvars.iv115, 3
%gep.3 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next116.2
%28 = load i8, ptr %gep.3, align 1, !tbaa !17
%add.ptr15.3 = getelementptr inbounds i8, ptr %dataSet, i64 %indvars.iv.next116.2
store i8 %28, ptr %add.ptr15.3, align 1, !tbaa !17
%indvars.iv.next116.3 = add nsw i64 %indvars.iv115, 4
%lftr.wideiv118.3 = trunc i64 %indvars.iv.next116.3 to i32
%exitcond119.not.3 = icmp eq i32 %6, %lftr.wideiv118.3
br i1 %exitcond119.not.3, label %if.end58, label %for.body9, !llvm.loop !35
if.else: ; preds = %for.body
%call16 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(8) @.str.1) #14
%cmp17 = icmp eq i32 %call16, 0
br i1 %cmp17, label %for.cond19.preheader, label %if.else43
for.cond19.preheader: ; preds = %if.else
%add = add nsw i32 %4, %3
%div = sdiv i32 %add, 2
%cmp20.not102 = icmp sgt i32 %3, %div
br i1 %cmp20.not102, label %if.end58, label %for.body21.lr.ph
for.body21.lr.ph: ; preds = %for.cond19.preheader
%idx.ext24 = sext i32 %3 to i64
%add.ptr25 = getelementptr inbounds i8, ptr %dataSet, i64 %idx.ext24
%idx.ext26 = sext i32 %4 to i64
%add.ptr27 = getelementptr inbounds i8, ptr %add.ptr25, i64 %idx.ext26
%29 = add nsw i32 %div, 1
%30 = add nsw i32 %div, 1
%31 = sub i32 %30, %3
%xtraiter = and i32 %31, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body21.prol.loopexit, label %for.body21.prol
for.body21.prol: ; preds = %for.body21.lr.ph
%add.ptr23.prol = getelementptr inbounds i8, ptr %dataSet, i64 %idx.ext24
%32 = load i8, ptr %add.ptr23.prol, align 1, !tbaa !17
%idx.neg29.prol = sub nsw i64 0, %idx.ext24
%add.ptr30.prol = getelementptr inbounds i8, ptr %add.ptr27, i64 %idx.neg29.prol
%33 = load i8, ptr %add.ptr30.prol, align 1, !tbaa !17
store i8 %33, ptr %add.ptr23.prol, align 1, !tbaa !17
store i8 %32, ptr %add.ptr30.prol, align 1, !tbaa !17
%indvars.iv.next111.prol = add nsw i64 %idx.ext24, 1
br label %for.body21.prol.loopexit
for.body21.prol.loopexit: ; preds = %for.body21.prol, %for.body21.lr.ph
%indvars.iv110.unr = phi i64 [ %idx.ext24, %for.body21.lr.ph ], [ %indvars.iv.next111.prol, %for.body21.prol ]
%34 = icmp eq i32 %div, %3
br i1 %34, label %if.end58, label %for.body21
for.body21: ; preds = %for.body21.prol.loopexit, %for.body21
%indvars.iv110 = phi i64 [ %indvars.iv.next111.1, %for.body21 ], [ %indvars.iv110.unr, %for.body21.prol.loopexit ]
%add.ptr23 = getelementptr inbounds i8, ptr %dataSet, i64 %indvars.iv110
%35 = load i8, ptr %add.ptr23, align 1, !tbaa !17
%idx.neg29 = sub nsw i64 0, %indvars.iv110
%add.ptr30 = getelementptr inbounds i8, ptr %add.ptr27, i64 %idx.neg29
%36 = load i8, ptr %add.ptr30, align 1, !tbaa !17
store i8 %36, ptr %add.ptr23, align 1, !tbaa !17
store i8 %35, ptr %add.ptr30, align 1, !tbaa !17
%gep140 = getelementptr i8, ptr %invariant.gep139, i64 %indvars.iv110
%37 = load i8, ptr %gep140, align 1, !tbaa !17
%idx.neg29.1 = xor i64 %indvars.iv110, -1
%add.ptr30.1 = getelementptr inbounds i8, ptr %add.ptr27, i64 %idx.neg29.1
%38 = load i8, ptr %add.ptr30.1, align 1, !tbaa !17
store i8 %38, ptr %gep140, align 1, !tbaa !17
store i8 %37, ptr %add.ptr30.1, align 1, !tbaa !17
%indvars.iv.next111.1 = add nsw i64 %indvars.iv110, 2
%lftr.wideiv113.1 = trunc i64 %indvars.iv.next111.1 to i32
%exitcond114.not.1 = icmp eq i32 %29, %lftr.wideiv113.1
br i1 %exitcond114.not.1, label %if.end58, label %for.body21, !llvm.loop !36
if.else43: ; preds = %if.else
%call44 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(6) @.str.2) #14
%cmp45 = icmp eq i32 %call44, 0
br i1 %cmp45, label %for.cond47.preheader, label %if.end58
for.cond47.preheader: ; preds = %if.else43
%cmp48.not100 = icmp sgt i32 %3, %4
br i1 %cmp48.not100, label %for.end55, label %for.body49.preheader
for.body49.preheader: ; preds = %for.cond47.preheader
%39 = sext i32 %3 to i64
%40 = add i32 %4, 1
br label %for.body49
for.body49: ; preds = %for.body49.preheader, %for.body49
%indvars.iv = phi i64 [ %39, %for.body49.preheader ], [ %indvars.iv.next, %for.body49 ]
%add.ptr51 = getelementptr inbounds i8, ptr %dataSet, i64 %indvars.iv
%41 = load i8, ptr %add.ptr51, align 1, !tbaa !17
%conv = sext i8 %41 to i32
%putchar98 = 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 %40, %lftr.wideiv
br i1 %exitcond.not, label %for.end55, label %for.body49, !llvm.loop !37
for.end55: ; preds = %for.body49, %for.cond47.preheader
%putchar = tail call i32 @putchar(i32 10)
br label %if.end58
if.end58: ; preds = %for.body21.prol.loopexit, %for.body21, %for.body9.prol.loopexit, %for.body9, %middle.block, %vec.epilog.middle.block, %for.cond19.preheader, %if.then, %for.end55, %if.else43
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
%42 = load i32, ptr %count, align 4, !tbaa !5
%43 = sext i32 %42 to i64
%cmp = icmp slt i64 %indvars.iv.next121, %43
br i1 %cmp, label %for.body, label %for.end61, !llvm.loop !38
for.end61: ; preds = %if.end58, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @FreeDataSet(ptr nocapture noundef readonly %dataSet) local_unnamed_addr #0 {
entry:
%count = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%command1 = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 2
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %if.end ]
%1 = load ptr, ptr %command1, align 8, !tbaa !11
%add.ptr = getelementptr inbounds %struct.Command, ptr %1, i64 %indvars.iv
%2 = load ptr, ptr %add.ptr, align 8, !tbaa !12
tail call void @free(ptr noundef %2) #12
%rep = getelementptr inbounds %struct.Command, ptr %1, i64 %indvars.iv, i32 3
%3 = load ptr, ptr %rep, align 8, !tbaa !14
%cmp2.not = icmp eq ptr %3, null
br i1 %cmp2.not, label %if.end, label %if.then
if.then: ; preds = %for.body
tail call void @free(ptr noundef nonnull %3) #12
br label %if.end
if.end: ; preds = %if.then, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %count, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !15
for.end: ; preds = %if.end, %entry
%command4 = getelementptr inbounds %struct.DataSet, ptr %dataSet, i64 0, i32 2
%6 = load ptr, ptr %command4, align 8, !tbaa !11
tail call void @free(ptr noundef %6) #12
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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @InputCommand(ptr nocapture noundef writeonly %command, i32 noundef %strSize) local_unnamed_addr #2 {
entry:
%buf = alloca [100 x i8], align 16
%start = alloca i32, align 4
%end = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %buf) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end) #12
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100) %buf, i8 0, i64 100, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %buf)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %buf, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !17
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %for.end, label %for.cond, !llvm.loop !21
for.end: ; preds = %for.cond
%1 = load ptr, ptr @CMD, align 16, !tbaa !22
%tobool.not7.i = icmp eq ptr %1, null
br i1 %tobool.not7.i, label %cleanup51, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.end
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %start, ptr noundef nonnull %end)
%2 = load i32, ptr %start, align 4, !tbaa !23
%cmp6 = icmp slt i32 %2, 0
br i1 %cmp6, label %cleanup51, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body.i.preheader
%3 = load i32, ptr %end, align 4, !tbaa !23
%cmp8 = icmp sle i32 %2, %3
%cmp14.not = icmp slt i32 %3, %strSize
%or.cond = and i1 %cmp8, %cmp14.not
br i1 %or.cond, label %if.end17, label %cleanup51
if.end17: ; preds = %lor.lhs.false
%lhsv = load i64, ptr %buf, align 16
%.not = icmp eq i64 %lhsv, 28538242730059122
br i1 %.not, label %if.then22, label %if.end39
if.then22: ; preds = %if.end17
%sub = sub nsw i32 %3, %2
%add = add nsw i32 %sub, 1
%conv23 = sext i32 %add to i64
%calloc = call ptr @calloc(i64 1, i64 %conv23)
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef %calloc)
br label %for.cond27
for.cond27: ; preds = %for.cond27, %if.then22
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.cond27 ], [ 0, %if.then22 ]
%add.ptr = getelementptr inbounds i8, ptr %calloc, i64 %indvars.iv76
%4 = load i8, ptr %add.ptr, align 1, !tbaa !17
%cmp29.not = icmp eq i8 %4, 0
%indvars.iv.next77 = add nuw i64 %indvars.iv76, 1
br i1 %cmp29.not, label %for.end34, label %for.cond27, !llvm.loop !24
for.end34: ; preds = %for.cond27
%5 = trunc i64 %indvars.iv76 to i32
%cmp35.not = icmp eq i32 %add, %5
br i1 %cmp35.not, label %for.end34.if.end39_crit_edge, label %cleanup51
for.end34.if.end39_crit_edge: ; preds = %for.end34
%.pre = load i32, ptr %start, align 4, !tbaa !23
%.pre79 = load i32, ptr %end, align 4, !tbaa !23
br label %if.end39
if.end39: ; preds = %for.end34.if.end39_crit_edge, %if.end17
%6 = phi i32 [ %.pre79, %for.end34.if.end39_crit_edge ], [ %3, %if.end17 ]
%7 = phi i32 [ %.pre, %for.end34.if.end39_crit_edge ], [ %2, %if.end17 ]
%rep.0 = phi ptr [ %calloc, %for.end34.if.end39_crit_edge ], [ null, %if.end17 ]
%call43 = call noalias ptr @malloc(i64 noundef %indvars.iv.next) #13
store ptr %call43, ptr %command, align 8, !tbaa !12
%add46 = add i64 %indvars.iv, 1
%conv47 = and i64 %add46, 4294967295
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %call43, ptr noundef nonnull align 16 dereferenceable(1) %buf, i64 %conv47, i1 false)
%start48 = getelementptr inbounds %struct.Command, ptr %command, i64 0, i32 1
store i32 %7, ptr %start48, align 8, !tbaa !26
%end49 = getelementptr inbounds %struct.Command, ptr %command, i64 0, i32 2
store i32 %6, ptr %end49, align 4, !tbaa !27
%rep50 = getelementptr inbounds %struct.Command, ptr %command, i64 0, i32 3
store ptr %rep.0, ptr %rep50, align 8, !tbaa !14
br label %cleanup51
cleanup51: ; preds = %for.end, %for.body.i.preheader, %lor.lhs.false, %for.end34, %if.end39
%retval.1 = phi i32 [ 1, %if.end39 ], [ 0, %for.end34 ], [ 0, %lor.lhs.false ], [ 0, %for.body.i.preheader ], [ 0, %for.end ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start) #12
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %buf) #12
ret i32 %retval.1
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @Contains(ptr nocapture noundef readonly %str, ptr nocapture noundef readonly %checker) local_unnamed_addr #7 {
entry:
%0 = load ptr, ptr %checker, align 8, !tbaa !22
%tobool.not7 = icmp eq ptr %0, null
br i1 %tobool.not7, label %for.end, label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%add.ptr = getelementptr inbounds ptr, ptr %checker, i64 %indvars.iv.next
%1 = load ptr, ptr %add.ptr, align 8, !tbaa !22
%tobool.not = icmp eq ptr %1, null
br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !39
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%2 = phi ptr [ %1, %for.cond ], [ %0, %entry ]
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %str, ptr noundef nonnull dereferenceable(1) %2) #14
%tobool3.not = icmp eq i32 %call, 0
br i1 %tobool3.not, label %for.end, label %for.cond
for.end: ; preds = %for.cond, %for.body, %entry
%res.1 = phi i32 [ 0, %entry ], [ 1, %for.body ], [ %call, %for.cond ]
ret i32 %res.1
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #10
; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #11
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { 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 #10 = { nofree nounwind }
attributes #11 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #12 = { nounwind }
attributes #13 = { nounwind allocsize(0) }
attributes #14 = { 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, !9, i64 1004}
!6 = !{!"", !7, i64 0, !9, i64 1004, !10, i64 1008}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!6, !10, i64 1008}
!12 = !{!13, !10, i64 0}
!13 = !{!"", !10, i64 0, !9, i64 8, !9, i64 12, !10, i64 16}
!14 = !{!13, !10, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = !{!10, !10, i64 0}
!23 = !{!9, !9, i64 0}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !16}
!26 = !{!13, !9, i64 8}
!27 = !{!13, !9, i64 12}
!28 = distinct !{!28, !16}
!29 = distinct !{!29, !16, !30, !31}
!30 = !{!"llvm.loop.isvectorized", i32 1}
!31 = !{!"llvm.loop.unroll.runtime.disable"}
!32 = distinct !{!32, !16, !30, !31}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.unroll.disable"}
!35 = distinct !{!35, !16, !30}
!36 = distinct !{!36, !16}
!37 = distinct !{!37, !16}
!38 = distinct !{!38, !16}
!39 = distinct !{!39, !16}
|
#include <stdio.h>
#include <string.h>
void printFunc(int a, int b ,char str[1001]) {
int i;
//printf("print");
for(i = a; i <= b; i++) {
printf("%c",str[i]);
}
printf("\n");
}
void replaceFunc(int a, int b, char str[1001], char p[1001]) {
int i;
//printf("replace");
for(i = a ; i <= b; i++) {
str[i] = p[i-a];
}
}
void reverseFunc(int a, int b, char str[1001]) {
int i;
char tmp;
//printf("reverse");
for(i = 0 ; i <(b-a+1)/2 ; i++) {
tmp = str[a+i];
str[a+i] = str[b-i];
str[b-i] = tmp;
}
}
int main(int argc, const char * argv[]) {
char str[1001],order[8],p[1001];
int q,i,a,b;
scanf("%s",str);
scanf("%d",&q);
for(i = 0 ; i < q ; i++){
//printf("%s\n",str);
scanf("%s",order);
if(strcmp(order, "replace") == 0){
scanf("%d %d",&a,&b);
scanf("%s",p);
replaceFunc(a,b,str,p);
} else if(strcmp(order, "reverse") == 0) {
scanf("%d %d",&a,&b);
reverseFunc(a,b,str);
} else if(strcmp(order, "print") == 0) {
scanf("%d %d",&a,&b);
printFunc(a,b,str);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179262/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179262/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [8 x i8] c"replace\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.6 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1
@.str.7 = private unnamed_addr constant [6 x i8] c"print\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @printFunc(i32 noundef %a, i32 noundef %b, ptr nocapture noundef readonly %str) local_unnamed_addr #0 {
entry:
%cmp.not5 = icmp sgt i32 %a, %b
br i1 %cmp.not5, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %a to i64
%1 = add i32 %b, 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 %str, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv = sext i8 %2 to i32
%putchar4 = 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 !8
for.end: ; preds = %for.body, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @replaceFunc(i32 noundef %a, i32 noundef %b, ptr nocapture noundef writeonly %str, ptr nocapture noundef readonly %p) local_unnamed_addr #2 {
entry:
%p12 = ptrtoint ptr %p to i64
%str11 = ptrtoint ptr %str to i64
%cmp.not7 = icmp sgt i32 %a, %b
br i1 %cmp.not7, label %for.end, label %iter.check
iter.check: ; preds = %entry
%0 = sext i32 %a to i64
%1 = add i32 %b, 1
%2 = sub i32 %b, %a
%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
%5 = add i64 %str11, %0
%6 = sub i64 %5, %p12
%diff.check = icmp ult i64 %6, 32
br i1 %diff.check, label %for.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check13 = icmp ult i32 %2, 31
br i1 %min.iters.check13, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %4, 8589934560
%invariant.gep = getelementptr i8, ptr %str, i64 %0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%7 = getelementptr inbounds i8, ptr %p, i64 %index
%wide.load = load <16 x i8>, ptr %7, align 1, !tbaa !5
%8 = getelementptr inbounds i8, ptr %7, i64 16
%wide.load14 = load <16 x i8>, ptr %8, align 1, !tbaa !5
%gep = getelementptr i8, ptr %invariant.gep, i64 %index
store <16 x i8> %wide.load, ptr %gep, align 1, !tbaa !5
%9 = getelementptr inbounds i8, ptr %gep, i64 16
store <16 x i8> %wide.load14, ptr %9, align 1, !tbaa !5
%index.next = add nuw i64 %index, 32
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !10
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.end17 = 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.vec16 = and i64 %4, 8589934584
%ind.end = add nsw i64 %n.vec16, %0
%invariant.gep23 = getelementptr i8, ptr %str, i64 %0
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index19 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next22, %vec.epilog.vector.body ]
%11 = getelementptr inbounds i8, ptr %p, i64 %index19
%wide.load21 = load <8 x i8>, ptr %11, align 1, !tbaa !5
%gep24 = getelementptr i8, ptr %invariant.gep23, i64 %index19
store <8 x i8> %wide.load21, ptr %gep24, align 1, !tbaa !5
%index.next22 = add nuw i64 %index19, 8
%12 = icmp eq i64 %index.next22, %n.vec16
br i1 %12, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !13
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n18 = icmp eq i64 %4, %n.vec16
br i1 %cmp.n18, 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.end17, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
%13 = add i32 %b, 1
%14 = trunc i64 %indvars.iv.ph to i32
%15 = sub i32 %13, %14
%16 = sub i32 %b, %14
%xtraiter = and i32 %15, 3
%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, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader ]
%prol.iter = phi i32 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader ]
%17 = sub nsw i64 %indvars.iv.prol, %0
%arrayidx.prol = getelementptr inbounds i8, ptr %p, i64 %17
%18 = load i8, ptr %arrayidx.prol, align 1, !tbaa !5
%arrayidx2.prol = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.prol
store i8 %18, ptr %arrayidx2.prol, align 1, !tbaa !5
%indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i32 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !14
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 ]
%19 = icmp ult i32 %16, 3
br i1 %19, label %for.end, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%20 = sub nsw i64 %indvars.iv, %0
%arrayidx = getelementptr inbounds i8, ptr %p, i64 %20
%21 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx2 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv
store i8 %21, ptr %arrayidx2, align 1, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%22 = sub nsw i64 %indvars.iv.next, %0
%arrayidx.1 = getelementptr inbounds i8, ptr %p, i64 %22
%23 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%arrayidx2.1 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next
store i8 %23, ptr %arrayidx2.1, align 1, !tbaa !5
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%24 = sub nsw i64 %indvars.iv.next.1, %0
%arrayidx.2 = getelementptr inbounds i8, ptr %p, i64 %24
%25 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%arrayidx2.2 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.1
store i8 %25, ptr %arrayidx2.2, align 1, !tbaa !5
%indvars.iv.next.2 = add nsw i64 %indvars.iv, 3
%26 = sub nsw i64 %indvars.iv.next.2, %0
%arrayidx.3 = getelementptr inbounds i8, ptr %p, i64 %26
%27 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%arrayidx2.3 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.2
store i8 %27, ptr %arrayidx2.3, align 1, !tbaa !5
%indvars.iv.next.3 = add nsw i64 %indvars.iv, 4
%lftr.wideiv.3 = trunc i64 %indvars.iv.next.3 to i32
%exitcond.not.3 = icmp eq i32 %1, %lftr.wideiv.3
br i1 %exitcond.not.3, label %for.end, label %for.body, !llvm.loop !16
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 @reverseFunc(i32 noundef %a, i32 noundef %b, ptr nocapture noundef %str) local_unnamed_addr #2 {
entry:
%reass.sub = sub i32 %b, %a
%add = add i32 %reass.sub, 1
%cmp23 = icmp sgt i32 %add, 1
br i1 %cmp23, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%div2829 = lshr i32 %add, 1
%0 = sext i32 %a to i64
%1 = sext i32 %b to i64
%wide.trip.count = zext i32 %div2829 to i64
%invariant.gep = getelementptr i8, ptr %str, i64 %0
%xtraiter = and i64 %wide.trip.count, 1
%2 = icmp eq i32 %div2829, 1
br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 2147483646
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv
%3 = load i8, ptr %gep, align 1, !tbaa !5
%4 = sub nsw i64 %1, %indvars.iv
%arrayidx4 = getelementptr inbounds i8, ptr %str, i64 %4
%5 = load i8, ptr %arrayidx4, align 1, !tbaa !5
store i8 %5, ptr %gep, align 1, !tbaa !5
store i8 %3, ptr %arrayidx4, align 1, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%gep.1 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next
%6 = load i8, ptr %gep.1, align 1, !tbaa !5
%7 = sub nsw i64 %1, %indvars.iv.next
%arrayidx4.1 = getelementptr inbounds i8, ptr %str, i64 %7
%8 = load i8, ptr %arrayidx4.1, align 1, !tbaa !5
store i8 %8, ptr %gep.1, align 1, !tbaa !5
store i8 %6, ptr %arrayidx4.1, align 1, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !17
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%gep.epil = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.unr
%9 = load i8, ptr %gep.epil, align 1, !tbaa !5
%10 = sub nsw i64 %1, %indvars.iv.unr
%arrayidx4.epil = getelementptr inbounds i8, ptr %str, i64 %10
%11 = load i8, ptr %arrayidx4.epil, align 1, !tbaa !5
store i8 %11, ptr %gep.epil, align 1, !tbaa !5
store i8 %9, ptr %arrayidx4.epil, align 1, !tbaa !5
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%str = alloca [1001 x i8], align 16
%order = alloca [8 x i8], align 1
%p = alloca [1001 x i8], align 16
%q = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %order) #7
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %p) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %str)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !18
%cmp43 = icmp sgt i32 %0, 0
br i1 %cmp43, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.044 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %order)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.4, i64 8)
%cmp6 = icmp eq i32 %bcmp, 0
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %a, ptr noundef nonnull %b)
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %p)
%1 = load i32, ptr %a, align 4, !tbaa !18
%2 = load i32, ptr %b, align 4, !tbaa !18
%cmp.not7.i = icmp sgt i32 %1, %2
br i1 %cmp.not7.i, label %for.inc, label %for.body.preheader.i
for.body.preheader.i: ; preds = %if.then
%3 = sext i32 %1 to i64
%scevgep = getelementptr i8, ptr %str, i64 %3
%4 = sub i32 %2, %1
%5 = zext i32 %4 to i64
%6 = add nuw nsw i64 %5, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 16 dereferenceable(1) %p, i64 %6, i1 false), !tbaa !5
br label %for.inc
if.else: ; preds = %for.body
%bcmp28 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8)
%cmp14 = icmp eq i32 %bcmp28, 0
br i1 %cmp14, label %if.then15, label %if.else18
if.then15: ; preds = %if.else
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %a, ptr noundef nonnull %b)
%7 = load i32, ptr %a, align 4, !tbaa !18
%8 = load i32, ptr %b, align 4, !tbaa !18
%reass.sub.i = sub i32 %8, %7
%add.i = add i32 %reass.sub.i, 1
%cmp23.i = icmp sgt i32 %add.i, 1
br i1 %cmp23.i, label %for.body.preheader.i30, label %for.inc
for.body.preheader.i30: ; preds = %if.then15
%div2829.i = lshr i32 %add.i, 1
%9 = sext i32 %7 to i64
%10 = sext i32 %8 to i64
%wide.trip.count.i = zext i32 %div2829.i to i64
%invariant.gep.i = getelementptr i8, ptr %str, i64 %9
%xtraiter = and i64 %wide.trip.count.i, 1
%11 = icmp eq i32 %div2829.i, 1
br i1 %11, label %for.inc.loopexit.unr-lcssa, label %for.body.preheader.i30.new
for.body.preheader.i30.new: ; preds = %for.body.preheader.i30
%unroll_iter = and i64 %wide.trip.count.i, 2147483646
br label %for.body.i31
for.body.i31: ; preds = %for.body.i31, %for.body.preheader.i30.new
%indvars.iv.i32 = phi i64 [ 0, %for.body.preheader.i30.new ], [ %indvars.iv.next.i33.1, %for.body.i31 ]
%niter = phi i64 [ 0, %for.body.preheader.i30.new ], [ %niter.next.1, %for.body.i31 ]
%gep.i = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i32
%12 = load i8, ptr %gep.i, align 1, !tbaa !5
%13 = sub nsw i64 %10, %indvars.iv.i32
%arrayidx4.i = getelementptr inbounds i8, ptr %str, i64 %13
%14 = load i8, ptr %arrayidx4.i, align 1, !tbaa !5
store i8 %14, ptr %gep.i, align 1, !tbaa !5
store i8 %12, ptr %arrayidx4.i, align 1, !tbaa !5
%indvars.iv.next.i33 = or i64 %indvars.iv.i32, 1
%gep.i.1 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i33
%15 = load i8, ptr %gep.i.1, align 1, !tbaa !5
%16 = sub nsw i64 %10, %indvars.iv.next.i33
%arrayidx4.i.1 = getelementptr inbounds i8, ptr %str, i64 %16
%17 = load i8, ptr %arrayidx4.i.1, align 1, !tbaa !5
store i8 %17, ptr %gep.i.1, align 1, !tbaa !5
store i8 %15, ptr %arrayidx4.i.1, align 1, !tbaa !5
%indvars.iv.next.i33.1 = add nuw nsw i64 %indvars.iv.i32, 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.inc.loopexit.unr-lcssa, label %for.body.i31, !llvm.loop !17
if.else18: ; preds = %if.else
%bcmp29 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %order, ptr noundef nonnull dereferenceable(6) @.str.7, i64 6)
%cmp21 = icmp eq i32 %bcmp29, 0
br i1 %cmp21, label %if.then22, label %for.inc
if.then22: ; preds = %if.else18
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %a, ptr noundef nonnull %b)
%18 = load i32, ptr %a, align 4, !tbaa !18
%19 = load i32, ptr %b, align 4, !tbaa !18
%cmp.not5.i = icmp sgt i32 %18, %19
br i1 %cmp.not5.i, label %printFunc.exit, label %for.body.preheader.i35
for.body.preheader.i35: ; preds = %if.then22
%20 = sext i32 %18 to i64
%21 = add i32 %19, 1
br label %for.body.i36
for.body.i36: ; preds = %for.body.i36, %for.body.preheader.i35
%indvars.iv.i37 = phi i64 [ %20, %for.body.preheader.i35 ], [ %indvars.iv.next.i39, %for.body.i36 ]
%arrayidx.i38 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i37
%22 = load i8, ptr %arrayidx.i38, align 1, !tbaa !5
%conv.i = sext i8 %22 to i32
%putchar4.i = call i32 @putchar(i32 %conv.i)
%indvars.iv.next.i39 = add nsw i64 %indvars.iv.i37, 1
%lftr.wideiv.i40 = trunc i64 %indvars.iv.next.i39 to i32
%exitcond.not.i41 = icmp eq i32 %21, %lftr.wideiv.i40
br i1 %exitcond.not.i41, label %printFunc.exit, label %for.body.i36, !llvm.loop !8
printFunc.exit: ; preds = %for.body.i36, %if.then22
%putchar.i = call i32 @putchar(i32 10)
br label %for.inc
for.inc.loopexit.unr-lcssa: ; preds = %for.body.i31, %for.body.preheader.i30
%indvars.iv.i32.unr = phi i64 [ 0, %for.body.preheader.i30 ], [ %indvars.iv.next.i33.1, %for.body.i31 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc, label %for.body.i31.epil
for.body.i31.epil: ; preds = %for.inc.loopexit.unr-lcssa
%gep.i.epil = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i32.unr
%23 = load i8, ptr %gep.i.epil, align 1, !tbaa !5
%24 = sub nsw i64 %10, %indvars.iv.i32.unr
%arrayidx4.i.epil = getelementptr inbounds i8, ptr %str, i64 %24
%25 = load i8, ptr %arrayidx4.i.epil, align 1, !tbaa !5
store i8 %25, ptr %gep.i.epil, align 1, !tbaa !5
store i8 %23, ptr %arrayidx4.i.epil, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body.i31.epil, %for.inc.loopexit.unr-lcssa, %for.body.preheader.i, %if.then15, %if.then, %if.else18, %printFunc.exit
%inc = add nuw nsw i32 %i.044, 1
%26 = load i32, ptr %q, align 4, !tbaa !18
%cmp = icmp slt i32 %inc, %26
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !20
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %p) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %order) #7
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9, !11, !12}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !9, !11, !12}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !9, !11}
!17 = distinct !{!17, !9}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !6, i64 0}
!20 = distinct !{!20, !9}
|
#include <stdio.h>
#include <string.h>
int main(void){
char s[1001], order[8], ch[1001];
int i, j, n, a, b;
scanf("%s\n%d", s, &n);
for(i=0;i<n;i++){
scanf("%s %d %d", order, &a, &b);
if(!strcmp(order, "reverse")){
for(j=a;j<=b;j++)
ch[b-j] = s[j];
for(j=a;j<=b;j++)
s[j] = ch[j-a];
}
if(!strcmp(order, "replace")){
scanf("%s", ch);
for(j=0;ch[j]!='\0';j++)
s[a+j] = ch[j];
}
if(!strcmp(order, "print")){
for(j=a;j<=b;j++)
printf("%c", s[j]);
printf("\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179312/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179312/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s\0A%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%s %d %d\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1
@.str.3 = private unnamed_addr constant [8 x i8] c"replace\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"print\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
%order = alloca [8 x i8], align 1
%ch = alloca [1001 x i8], align 16
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %order) #6
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %ch) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp87 = icmp sgt i32 %0, 0
br i1 %cmp87, label %for.body.preheader, label %for.end60
for.body.preheader: ; preds = %entry
%invariant.gep = getelementptr i8, ptr %ch, i64 -7
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc58
%i.088 = phi i32 [ %inc59, %for.inc58 ], [ 0, %for.body.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %order, ptr noundef nonnull %a, ptr noundef nonnull %b)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.2, i64 8)
%tobool.not = icmp eq i32 %bcmp, 0
br i1 %tobool.not, label %if.then, label %if.end
if.then: ; preds = %for.body
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp6.not79 = icmp sgt i32 %1, %2
br i1 %cmp6.not79, label %if.end, label %iter.check
iter.check: ; preds = %if.then
%3 = sext i32 %1 to i64
%4 = sext i32 %2 to i64
%5 = add i32 %2, 1
%6 = sub i32 %2, %1
%7 = zext i32 %6 to i64
%8 = add nuw nsw i64 %7, 1
%min.iters.check = icmp ult i32 %6, 7
br i1 %min.iters.check, label %for.body7.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check101 = icmp ult i32 %6, 31
br i1 %min.iters.check101, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %8, 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, %3
%9 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %offset.idx
%wide.load = load <16 x i8>, ptr %9, align 1, !tbaa !9
%10 = getelementptr inbounds i8, ptr %9, i64 16
%wide.load102 = load <16 x i8>, ptr %10, align 1, !tbaa !9
%11 = sub nsw i64 %4, %offset.idx
%12 = getelementptr inbounds [1001 x i8], ptr %ch, i64 0, i64 %11
%reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%13 = getelementptr inbounds i8, ptr %12, i64 -15
store <16 x i8> %reverse, ptr %13, align 1, !tbaa !9
%reverse103 = shufflevector <16 x i8> %wide.load102, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%14 = getelementptr inbounds i8, ptr %12, i64 -31
store <16 x i8> %reverse103, ptr %14, align 1, !tbaa !9
%index.next = add nuw i64 %index, 32
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %8, %n.vec
br i1 %cmp.n, label %for.cond10.preheader, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end106 = add nsw i64 %n.vec, %3
%n.vec.remaining = and i64 %8, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body7.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.vec105 = and i64 %8, 8589934584
%ind.end = add nsw i64 %n.vec105, %3
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index108 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next112, %vec.epilog.vector.body ]
%offset.idx109 = add i64 %index108, %3
%16 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %offset.idx109
%wide.load110 = load <8 x i8>, ptr %16, align 1, !tbaa !9
%17 = sub nsw i64 %4, %offset.idx109
%reverse111 = shufflevector <8 x i8> %wide.load110, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%gep = getelementptr [1001 x i8], ptr %invariant.gep, i64 0, i64 %17
store <8 x i8> %reverse111, ptr %gep, align 1, !tbaa !9
%index.next112 = add nuw i64 %index108, 8
%18 = icmp eq i64 %index.next112, %n.vec105
br i1 %18, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n107 = icmp eq i64 %8, %n.vec105
br i1 %cmp.n107, label %for.cond10.preheader, label %for.body7.preheader
for.body7.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ %3, %iter.check ], [ %ind.end106, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body7
for.cond10.preheader: ; preds = %for.body7, %vec.epilog.middle.block, %middle.block
br i1 %cmp6.not79, label %if.end, label %for.body12.preheader
for.body12.preheader: ; preds = %for.cond10.preheader
%19 = sext i32 %1 to i64
%scevgep = getelementptr i8, ptr %s, i64 %19
%20 = sub i32 %2, %1
%21 = zext i32 %20 to i64
%22 = add nuw nsw i64 %21, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 16 dereferenceable(1) %ch, i64 %22, i1 false), !tbaa !9
br label %if.end
for.body7: ; preds = %for.body7.preheader, %for.body7
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ %indvars.iv.ph, %for.body7.preheader ]
%arrayidx = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %indvars.iv
%23 = load i8, ptr %arrayidx, align 1, !tbaa !9
%24 = sub nsw i64 %4, %indvars.iv
%arrayidx9 = getelementptr inbounds [1001 x i8], ptr %ch, i64 0, i64 %24
store i8 %23, ptr %arrayidx9, align 1, !tbaa !9
%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.cond10.preheader, label %for.body7, !llvm.loop !15
if.end: ; preds = %if.then, %for.body12.preheader, %for.cond10.preheader, %for.body
%bcmp76 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.3, i64 8)
%tobool23.not = icmp eq i32 %bcmp76, 0
br i1 %tobool23.not, label %if.then24, label %if.end40
if.then24: ; preds = %if.end
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %ch)
%25 = load i8, ptr %ch, align 16, !tbaa !9
%cmp30.not83 = icmp eq i8 %25, 0
br i1 %cmp30.not83, label %if.end40, label %for.body32.lr.ph
for.body32.lr.ph: ; preds = %if.then24
%26 = load i32, ptr %a, align 4, !tbaa !5
%27 = sext i32 %26 to i64
br label %for.body32
for.body32: ; preds = %for.body32.lr.ph, %for.body32
%indvars.iv95 = phi i64 [ 0, %for.body32.lr.ph ], [ %indvars.iv.next96, %for.body32 ]
%28 = phi i8 [ %25, %for.body32.lr.ph ], [ %30, %for.body32 ]
%29 = add nsw i64 %indvars.iv95, %27
%arrayidx36 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %29
store i8 %28, ptr %arrayidx36, align 1, !tbaa !9
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%arrayidx29 = getelementptr inbounds [1001 x i8], ptr %ch, i64 0, i64 %indvars.iv.next96
%30 = load i8, ptr %arrayidx29, align 1, !tbaa !9
%cmp30.not = icmp eq i8 %30, 0
br i1 %cmp30.not, label %if.end40, label %for.body32, !llvm.loop !16
if.end40: ; preds = %for.body32, %if.then24, %if.end
%bcmp77 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %order, ptr noundef nonnull dereferenceable(6) @.str.5, i64 6)
%tobool43.not = icmp eq i32 %bcmp77, 0
br i1 %tobool43.not, label %if.then44, label %for.inc58
if.then44: ; preds = %if.end40
%31 = load i32, ptr %a, align 4, !tbaa !5
%32 = load i32, ptr %b, align 4, !tbaa !5
%cmp46.not85 = icmp sgt i32 %31, %32
br i1 %cmp46.not85, label %for.end55, label %for.body48.preheader
for.body48.preheader: ; preds = %if.then44
%33 = sext i32 %31 to i64
br label %for.body48
for.body48: ; preds = %for.body48.preheader, %for.body48
%indvars.iv98 = phi i64 [ %33, %for.body48.preheader ], [ %indvars.iv.next99, %for.body48 ]
%arrayidx50 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %indvars.iv98
%34 = load i8, ptr %arrayidx50, align 1, !tbaa !9
%conv51 = sext i8 %34 to i32
%putchar78 = call i32 @putchar(i32 %conv51)
%indvars.iv.next99 = add nsw i64 %indvars.iv98, 1
%35 = load i32, ptr %b, align 4, !tbaa !5
%36 = sext i32 %35 to i64
%cmp46.not.not = icmp slt i64 %indvars.iv98, %36
br i1 %cmp46.not.not, label %for.body48, label %for.end55, !llvm.loop !17
for.end55: ; preds = %for.body48, %if.then44
%putchar = call i32 @putchar(i32 10)
br label %for.inc58
for.inc58: ; preds = %if.end40, %for.end55
%inc59 = add nuw nsw i32 %i.088, 1
%37 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc59, %37
br i1 %cmp, label %for.body, label %for.end60, !llvm.loop !18
for.end60: ; preds = %for.inc58, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %ch) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %order) #6
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; 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 nounwind willreturn memory(argmem: read) }
attributes #4 = { nofree nounwind }
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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !11, !13, !12}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
|
#include<stdio.h>
#include<string.h>
int N,M[9][9],f[9][9],m[9][9],i,j,k;
void ch(int y,int x)
{
int i,j,mv[9][2]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,0},{0,1},{1,-1},{1,0},{1,1}};
for(i=0;i<9;i++)
for(j=0;j<9;j++)
if(i!=j&&M[y+mv[i][0]][x+mv[i][1]]==M[y+mv[j][0]][x+mv[j][1]])
f[y+mv[i][0]][x+mv[i][1]]=f[y+mv[j][0]][x+mv[j][1]]=1;
}
int main()
{
scanf("%d",&N);
for(;N--;)
{
memset(f,0,sizeof(f));
for(i=0;i<9;i++)
for(j=0;j<9;j++)
scanf("%d",&M[i][j]);
for(i=0;i<9;i++)
for(j=0;j<9;j++)
for(k=0;k<9;k++)
{
if(k!=i&&M[i][j]==M[k][j])f[i][j]=f[k][j]=1;
if(k!=j&&M[i][j]==M[i][k])f[i][j]=f[i][k]=1;
}
for(i=1;i<9;i+=3)
for(j=1;j<9;j+=3)
ch(i,j);
for(i=0;i<9;i++,puts(""))
for(j=0;j<9;j++)
printf("%c%d",f[i][j]?'*':' ',M[i][j]);
if(N>0)
puts("");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179356/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179356/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.ch.mv = private unnamed_addr constant [9 x [2 x i32]] [[2 x i32] [i32 -1, i32 -1], [2 x i32] [i32 -1, i32 0], [2 x i32] [i32 -1, i32 1], [2 x i32] [i32 0, i32 -1], [2 x i32] zeroinitializer, [2 x i32] [i32 0, i32 1], [2 x i32] [i32 1, i32 -1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 1]], align 16
@M = dso_local global [9 x [9 x i32]] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [9 x [9 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@N = 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 [5 x i8] c"%c%d\00", align 1
@m = dso_local local_unnamed_addr global [9 x [9 x i32]] zeroinitializer, align 16
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @ch(i32 noundef %y, i32 noundef %x) local_unnamed_addr #0 {
entry:
%add17 = add nsw i32 %y, -1
%idxprom18 = sext i32 %add17 to i64
%add23 = add nsw i32 %x, -1
%idxprom24 = sext i32 %add23 to i64
%arrayidx25 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom24
%arrayidx38 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18, i64 %idxprom24
%add17.1 = add nsw i32 %y, -1
%idxprom18.1 = sext i32 %add17.1 to i64
%idxprom24.1 = sext i32 %x to i64
%arrayidx25.1 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18.1, i64 %idxprom24.1
%arrayidx38.1 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18.1, i64 %idxprom24.1
%add17.2 = add nsw i32 %y, -1
%idxprom18.2 = sext i32 %add17.2 to i64
%add23.2 = add nsw i32 %x, 1
%idxprom24.2 = sext i32 %add23.2 to i64
%arrayidx25.2 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18.2, i64 %idxprom24.2
%arrayidx38.2 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18.2, i64 %idxprom24.2
%idxprom18.3 = sext i32 %y to i64
%add23.3 = add nsw i32 %x, -1
%idxprom24.3 = sext i32 %add23.3 to i64
%arrayidx25.3 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18.3, i64 %idxprom24.3
%arrayidx38.3 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18.3, i64 %idxprom24.3
%idxprom18.4 = sext i32 %y to i64
%idxprom24.4 = sext i32 %x to i64
%arrayidx25.4 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18.4, i64 %idxprom24.4
%arrayidx38.4 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18.4, i64 %idxprom24.4
%idxprom18.5 = sext i32 %y to i64
%add23.5 = add nsw i32 %x, 1
%idxprom24.5 = sext i32 %add23.5 to i64
%arrayidx25.5 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18.5, i64 %idxprom24.5
%arrayidx38.5 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18.5, i64 %idxprom24.5
%add17.6 = add nsw i32 %y, 1
%idxprom18.6 = sext i32 %add17.6 to i64
%add23.6 = add nsw i32 %x, -1
%idxprom24.6 = sext i32 %add23.6 to i64
%arrayidx25.6 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18.6, i64 %idxprom24.6
%arrayidx38.6 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18.6, i64 %idxprom24.6
%add17.7 = add nsw i32 %y, 1
%idxprom18.7 = sext i32 %add17.7 to i64
%idxprom24.7 = sext i32 %x to i64
%arrayidx25.7 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18.7, i64 %idxprom24.7
%arrayidx38.7 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18.7, i64 %idxprom24.7
%add17.8 = add nsw i32 %y, 1
%idxprom18.8 = sext i32 %add17.8 to i64
%add23.8 = add nsw i32 %x, 1
%idxprom24.8 = sext i32 %add23.8 to i64
%arrayidx25.8 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom18.8, i64 %idxprom24.8
%0 = load i32, ptr %arrayidx25.8, align 4, !tbaa !5
%arrayidx38.8 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom18.8, i64 %idxprom24.8
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.inc.8, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.8 ]
%arrayidx = getelementptr inbounds [9 x [2 x i32]], ptr @__const.ch.mv, i64 0, i64 %indvars.iv
%arrayidx10 = getelementptr inbounds [9 x [2 x i32]], ptr @__const.ch.mv, i64 0, i64 %indvars.iv, i64 1
%cmp4.not = icmp eq i64 %indvars.iv, 0
br i1 %cmp4.not, label %land.lhs.true.1, label %land.lhs.true
land.lhs.true: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add = add nsw i32 %1, %y
%idxprom6 = sext i32 %add to i64
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11 = add nsw i32 %2, %x
%idxprom12 = sext i32 %add11 to i64
%arrayidx13 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6, i64 %idxprom12
%3 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp26 = icmp eq i32 %3, %4
br i1 %cmp26, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
%arrayidx50 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6, i64 %idxprom12
store i32 1, ptr %arrayidx50, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %land.lhs.true, %if.then
%cmp4.not.1 = icmp eq i64 %indvars.iv, 1
br i1 %cmp4.not.1, label %land.lhs.true.2, label %land.lhs.true.1
land.lhs.true.1: ; preds = %for.cond1.preheader, %for.inc
%5 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add.1 = add nsw i32 %5, %y
%idxprom6.1 = sext i32 %add.1 to i64
%6 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11.1 = add nsw i32 %6, %x
%idxprom12.1 = sext i32 %add11.1 to i64
%arrayidx13.1 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6.1, i64 %idxprom12.1
%7 = load i32, ptr %arrayidx13.1, align 4, !tbaa !5
%8 = load i32, ptr %arrayidx25.1, align 4, !tbaa !5
%cmp26.1 = icmp eq i32 %7, %8
br i1 %cmp26.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %land.lhs.true.1
store i32 1, ptr %arrayidx38.1, align 4, !tbaa !5
%arrayidx50.1 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6.1, i64 %idxprom12.1
store i32 1, ptr %arrayidx50.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %land.lhs.true.1
%cmp4.not.2 = icmp eq i64 %indvars.iv, 2
br i1 %cmp4.not.2, label %land.lhs.true.3, label %land.lhs.true.2
land.lhs.true.2: ; preds = %for.inc, %for.inc.1
%9 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add.2 = add nsw i32 %9, %y
%idxprom6.2 = sext i32 %add.2 to i64
%10 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11.2 = add nsw i32 %10, %x
%idxprom12.2 = sext i32 %add11.2 to i64
%arrayidx13.2 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6.2, i64 %idxprom12.2
%11 = load i32, ptr %arrayidx13.2, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx25.2, align 4, !tbaa !5
%cmp26.2 = icmp eq i32 %11, %12
br i1 %cmp26.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %land.lhs.true.2
store i32 1, ptr %arrayidx38.2, align 4, !tbaa !5
%arrayidx50.2 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6.2, i64 %idxprom12.2
store i32 1, ptr %arrayidx50.2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %land.lhs.true.2
%cmp4.not.3 = icmp eq i64 %indvars.iv, 3
br i1 %cmp4.not.3, label %land.lhs.true.4, label %land.lhs.true.3
land.lhs.true.3: ; preds = %for.inc.1, %for.inc.2
%13 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add.3 = add nsw i32 %13, %y
%idxprom6.3 = sext i32 %add.3 to i64
%14 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11.3 = add nsw i32 %14, %x
%idxprom12.3 = sext i32 %add11.3 to i64
%arrayidx13.3 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6.3, i64 %idxprom12.3
%15 = load i32, ptr %arrayidx13.3, align 4, !tbaa !5
%16 = load i32, ptr %arrayidx25.3, align 4, !tbaa !5
%cmp26.3 = icmp eq i32 %15, %16
br i1 %cmp26.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %land.lhs.true.3
store i32 1, ptr %arrayidx38.3, align 4, !tbaa !5
%arrayidx50.3 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6.3, i64 %idxprom12.3
store i32 1, ptr %arrayidx50.3, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %land.lhs.true.3
%cmp4.not.4 = icmp eq i64 %indvars.iv, 4
br i1 %cmp4.not.4, label %land.lhs.true.5, label %land.lhs.true.4
land.lhs.true.4: ; preds = %for.inc.2, %for.inc.3
%17 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add.4 = add nsw i32 %17, %y
%idxprom6.4 = sext i32 %add.4 to i64
%18 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11.4 = add nsw i32 %18, %x
%idxprom12.4 = sext i32 %add11.4 to i64
%arrayidx13.4 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6.4, i64 %idxprom12.4
%19 = load i32, ptr %arrayidx13.4, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx25.4, align 4, !tbaa !5
%cmp26.4 = icmp eq i32 %19, %20
br i1 %cmp26.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %land.lhs.true.4
store i32 1, ptr %arrayidx38.4, align 4, !tbaa !5
%arrayidx50.4 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6.4, i64 %idxprom12.4
store i32 1, ptr %arrayidx50.4, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %land.lhs.true.4
%cmp4.not.5 = icmp eq i64 %indvars.iv, 5
br i1 %cmp4.not.5, label %land.lhs.true.6, label %land.lhs.true.5
land.lhs.true.5: ; preds = %for.inc.3, %for.inc.4
%21 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add.5 = add nsw i32 %21, %y
%idxprom6.5 = sext i32 %add.5 to i64
%22 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11.5 = add nsw i32 %22, %x
%idxprom12.5 = sext i32 %add11.5 to i64
%arrayidx13.5 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6.5, i64 %idxprom12.5
%23 = load i32, ptr %arrayidx13.5, align 4, !tbaa !5
%24 = load i32, ptr %arrayidx25.5, align 4, !tbaa !5
%cmp26.5 = icmp eq i32 %23, %24
br i1 %cmp26.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %land.lhs.true.5
store i32 1, ptr %arrayidx38.5, align 4, !tbaa !5
%arrayidx50.5 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6.5, i64 %idxprom12.5
store i32 1, ptr %arrayidx50.5, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %land.lhs.true.5
%cmp4.not.6 = icmp eq i64 %indvars.iv, 6
br i1 %cmp4.not.6, label %land.lhs.true.7, label %land.lhs.true.6
land.lhs.true.6: ; preds = %for.inc.4, %for.inc.5
%25 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add.6 = add nsw i32 %25, %y
%idxprom6.6 = sext i32 %add.6 to i64
%26 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11.6 = add nsw i32 %26, %x
%idxprom12.6 = sext i32 %add11.6 to i64
%arrayidx13.6 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6.6, i64 %idxprom12.6
%27 = load i32, ptr %arrayidx13.6, align 4, !tbaa !5
%28 = load i32, ptr %arrayidx25.6, align 4, !tbaa !5
%cmp26.6 = icmp eq i32 %27, %28
br i1 %cmp26.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %land.lhs.true.6
store i32 1, ptr %arrayidx38.6, align 4, !tbaa !5
%arrayidx50.6 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6.6, i64 %idxprom12.6
store i32 1, ptr %arrayidx50.6, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %land.lhs.true.6
%cmp4.not.7 = icmp eq i64 %indvars.iv, 7
br i1 %cmp4.not.7, label %land.lhs.true.8, label %land.lhs.true.7
land.lhs.true.7: ; preds = %for.inc.5, %for.inc.6
%29 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add.7 = add nsw i32 %29, %y
%idxprom6.7 = sext i32 %add.7 to i64
%30 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11.7 = add nsw i32 %30, %x
%idxprom12.7 = sext i32 %add11.7 to i64
%arrayidx13.7 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6.7, i64 %idxprom12.7
%31 = load i32, ptr %arrayidx13.7, align 4, !tbaa !5
%32 = load i32, ptr %arrayidx25.7, align 4, !tbaa !5
%cmp26.7 = icmp eq i32 %31, %32
br i1 %cmp26.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %land.lhs.true.7
store i32 1, ptr %arrayidx38.7, align 4, !tbaa !5
%arrayidx50.7 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6.7, i64 %idxprom12.7
store i32 1, ptr %arrayidx50.7, align 4, !tbaa !5
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %land.lhs.true.7
%cmp4.not.8 = icmp eq i64 %indvars.iv, 8
br i1 %cmp4.not.8, label %for.end53, label %land.lhs.true.8
land.lhs.true.8: ; preds = %for.inc.6, %for.inc.7
%33 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add.8 = add nsw i32 %33, %y
%idxprom6.8 = sext i32 %add.8 to i64
%34 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add11.8 = add nsw i32 %34, %x
%idxprom12.8 = sext i32 %add11.8 to i64
%arrayidx13.8 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom6.8, i64 %idxprom12.8
%35 = load i32, ptr %arrayidx13.8, align 4, !tbaa !5
%cmp26.8 = icmp eq i32 %35, %0
br i1 %cmp26.8, label %if.then.8, label %for.inc.8
if.then.8: ; preds = %land.lhs.true.8
store i32 1, ptr %arrayidx38.8, align 4, !tbaa !5
%arrayidx50.8 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom6.8, i64 %idxprom12.8
store i32 1, ptr %arrayidx50.8, align 4, !tbaa !5
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %land.lhs.true.8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.cond1.preheader
for.end53: ; preds = %for.inc.7
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%0 = load i32, ptr @N, align 4, !tbaa !5
%dec131 = add nsw i32 %0, -1
store i32 %dec131, ptr @N, align 4, !tbaa !5
%tobool.not132 = icmp eq i32 %0, 0
br i1 %tobool.not132, label %for.end107, label %for.body
for.body: ; preds = %entry, %if.end106
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(324) @f, i8 0, i64 324, i1 false)
store i32 0, ptr @i, align 4, !tbaa !5
br label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.body, %for.inc9
store i32 0, ptr @j, align 4, !tbaa !5
br label %for.body5
for.body5: ; preds = %for.cond3.preheader, %for.body5
%storemerge121122 = phi i32 [ 0, %for.cond3.preheader ], [ %inc, %for.body5 ]
%1 = load i32, ptr @i, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%idxprom6 = sext i32 %storemerge121122 to i64
%arrayidx7 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %idxprom6
%call8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%2 = load i32, ptr @j, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr @j, align 4, !tbaa !5
%cmp4 = icmp slt i32 %2, 8
br i1 %cmp4, label %for.body5, label %for.inc9, !llvm.loop !9
for.inc9: ; preds = %for.body5
%3 = load i32, ptr @i, align 4, !tbaa !5
%inc10 = add nsw i32 %3, 1
store i32 %inc10, ptr @i, align 4, !tbaa !5
%cmp = icmp slt i32 %3, 8
br i1 %cmp, label %for.cond3.preheader, label %for.cond15.preheader, !llvm.loop !11
for.cond69.preheader: ; preds = %for.inc66
store i32 9, ptr @k, align 4, !tbaa !5
store i32 1, ptr @i, align 4, !tbaa !5
br label %for.cond72.preheader
for.cond15.preheader: ; preds = %for.inc9, %for.inc66
%indvars.iv135 = phi i64 [ %indvars.iv.next136, %for.inc66 ], [ 0, %for.inc9 ]
%cmp21.not = icmp eq i64 %indvars.iv135, 0
%arrayidx48 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 0
%arrayidx54 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 0
%cmp21.not.1 = icmp eq i64 %indvars.iv135, 1
%arrayidx48.1 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 1
%arrayidx54.1 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 1
%cmp21.not.2 = icmp eq i64 %indvars.iv135, 2
%arrayidx48.2 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 2
%arrayidx54.2 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 2
%cmp21.not.3 = icmp eq i64 %indvars.iv135, 3
%arrayidx48.3 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 3
%arrayidx54.3 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 3
%cmp21.not.4 = icmp eq i64 %indvars.iv135, 4
%arrayidx48.4 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 4
%arrayidx54.4 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 4
%cmp21.not.5 = icmp eq i64 %indvars.iv135, 5
%arrayidx48.5 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 5
%arrayidx54.5 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 5
%cmp21.not.6 = icmp eq i64 %indvars.iv135, 6
%arrayidx48.6 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 6
%arrayidx54.6 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 6
%cmp21.not.7 = icmp eq i64 %indvars.iv135, 7
%arrayidx48.7 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 7
%arrayidx54.7 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 7
%cmp21.not.8 = icmp eq i64 %indvars.iv135, 8
%arrayidx48.8 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 8
%4 = load i32, ptr %arrayidx48.8, align 4, !tbaa !5
%arrayidx54.8 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 8
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.inc60.8, %for.cond15.preheader
%indvars.iv = phi i64 [ 0, %for.cond15.preheader ], [ %indvars.iv.next, %for.inc60.8 ]
%arrayidx25 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %indvars.iv135, i64 %indvars.iv
%arrayidx38 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %indvars.iv135, i64 %indvars.iv
br i1 %cmp21.not, label %if.end, label %land.lhs.true
land.lhs.true: ; preds = %for.cond18.preheader
%5 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp eq i32 %5, %6
br i1 %cmp30, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true
%arrayidx34 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 0, i64 %indvars.iv
store i32 1, ptr %arrayidx34, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %land.lhs.true, %for.cond18.preheader
%cmp39.not = icmp eq i64 %indvars.iv, 0
br i1 %cmp39.not, label %for.inc60, label %land.lhs.true40
land.lhs.true40: ; preds = %if.end
%7 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%8 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%cmp49 = icmp eq i32 %7, %8
br i1 %cmp49, label %if.then50, label %for.inc60
if.then50: ; preds = %land.lhs.true40
store i32 1, ptr %arrayidx54, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60
for.inc60: ; preds = %if.end, %land.lhs.true40, %if.then50
br i1 %cmp21.not.1, label %if.end.1, label %land.lhs.true.1
land.lhs.true.1: ; preds = %for.inc60
%9 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29.1 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 1, i64 %indvars.iv
%10 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5
%cmp30.1 = icmp eq i32 %9, %10
br i1 %cmp30.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %land.lhs.true.1
%arrayidx34.1 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 1, i64 %indvars.iv
store i32 1, ptr %arrayidx34.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end.1
if.end.1: ; preds = %if.then.1, %land.lhs.true.1, %for.inc60
%cmp39.not.1 = icmp eq i64 %indvars.iv, 1
br i1 %cmp39.not.1, label %for.inc60.1, label %land.lhs.true40.1
land.lhs.true40.1: ; preds = %if.end.1
%11 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx48.1, align 4, !tbaa !5
%cmp49.1 = icmp eq i32 %11, %12
br i1 %cmp49.1, label %if.then50.1, label %for.inc60.1
if.then50.1: ; preds = %land.lhs.true40.1
store i32 1, ptr %arrayidx54.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60.1
for.inc60.1: ; preds = %if.then50.1, %land.lhs.true40.1, %if.end.1
br i1 %cmp21.not.2, label %if.end.2, label %land.lhs.true.2
land.lhs.true.2: ; preds = %for.inc60.1
%13 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29.2 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 2, i64 %indvars.iv
%14 = load i32, ptr %arrayidx29.2, align 4, !tbaa !5
%cmp30.2 = icmp eq i32 %13, %14
br i1 %cmp30.2, label %if.then.2, label %if.end.2
if.then.2: ; preds = %land.lhs.true.2
%arrayidx34.2 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 2, i64 %indvars.iv
store i32 1, ptr %arrayidx34.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end.2
if.end.2: ; preds = %if.then.2, %land.lhs.true.2, %for.inc60.1
%cmp39.not.2 = icmp eq i64 %indvars.iv, 2
br i1 %cmp39.not.2, label %for.inc60.2, label %land.lhs.true40.2
land.lhs.true40.2: ; preds = %if.end.2
%15 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%16 = load i32, ptr %arrayidx48.2, align 4, !tbaa !5
%cmp49.2 = icmp eq i32 %15, %16
br i1 %cmp49.2, label %if.then50.2, label %for.inc60.2
if.then50.2: ; preds = %land.lhs.true40.2
store i32 1, ptr %arrayidx54.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60.2
for.inc60.2: ; preds = %if.then50.2, %land.lhs.true40.2, %if.end.2
br i1 %cmp21.not.3, label %if.end.3, label %land.lhs.true.3
land.lhs.true.3: ; preds = %for.inc60.2
%17 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29.3 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 3, i64 %indvars.iv
%18 = load i32, ptr %arrayidx29.3, align 4, !tbaa !5
%cmp30.3 = icmp eq i32 %17, %18
br i1 %cmp30.3, label %if.then.3, label %if.end.3
if.then.3: ; preds = %land.lhs.true.3
%arrayidx34.3 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 3, i64 %indvars.iv
store i32 1, ptr %arrayidx34.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end.3
if.end.3: ; preds = %if.then.3, %land.lhs.true.3, %for.inc60.2
%cmp39.not.3 = icmp eq i64 %indvars.iv, 3
br i1 %cmp39.not.3, label %for.inc60.3, label %land.lhs.true40.3
land.lhs.true40.3: ; preds = %if.end.3
%19 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx48.3, align 4, !tbaa !5
%cmp49.3 = icmp eq i32 %19, %20
br i1 %cmp49.3, label %if.then50.3, label %for.inc60.3
if.then50.3: ; preds = %land.lhs.true40.3
store i32 1, ptr %arrayidx54.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60.3
for.inc60.3: ; preds = %if.then50.3, %land.lhs.true40.3, %if.end.3
br i1 %cmp21.not.4, label %if.end.4, label %land.lhs.true.4
land.lhs.true.4: ; preds = %for.inc60.3
%21 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29.4 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 4, i64 %indvars.iv
%22 = load i32, ptr %arrayidx29.4, align 4, !tbaa !5
%cmp30.4 = icmp eq i32 %21, %22
br i1 %cmp30.4, label %if.then.4, label %if.end.4
if.then.4: ; preds = %land.lhs.true.4
%arrayidx34.4 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 4, i64 %indvars.iv
store i32 1, ptr %arrayidx34.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end.4
if.end.4: ; preds = %if.then.4, %land.lhs.true.4, %for.inc60.3
%cmp39.not.4 = icmp eq i64 %indvars.iv, 4
br i1 %cmp39.not.4, label %for.inc60.4, label %land.lhs.true40.4
land.lhs.true40.4: ; preds = %if.end.4
%23 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%24 = load i32, ptr %arrayidx48.4, align 4, !tbaa !5
%cmp49.4 = icmp eq i32 %23, %24
br i1 %cmp49.4, label %if.then50.4, label %for.inc60.4
if.then50.4: ; preds = %land.lhs.true40.4
store i32 1, ptr %arrayidx54.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60.4
for.inc60.4: ; preds = %if.then50.4, %land.lhs.true40.4, %if.end.4
br i1 %cmp21.not.5, label %if.end.5, label %land.lhs.true.5
land.lhs.true.5: ; preds = %for.inc60.4
%25 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29.5 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 5, i64 %indvars.iv
%26 = load i32, ptr %arrayidx29.5, align 4, !tbaa !5
%cmp30.5 = icmp eq i32 %25, %26
br i1 %cmp30.5, label %if.then.5, label %if.end.5
if.then.5: ; preds = %land.lhs.true.5
%arrayidx34.5 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 5, i64 %indvars.iv
store i32 1, ptr %arrayidx34.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end.5
if.end.5: ; preds = %if.then.5, %land.lhs.true.5, %for.inc60.4
%cmp39.not.5 = icmp eq i64 %indvars.iv, 5
br i1 %cmp39.not.5, label %for.inc60.5, label %land.lhs.true40.5
land.lhs.true40.5: ; preds = %if.end.5
%27 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%28 = load i32, ptr %arrayidx48.5, align 4, !tbaa !5
%cmp49.5 = icmp eq i32 %27, %28
br i1 %cmp49.5, label %if.then50.5, label %for.inc60.5
if.then50.5: ; preds = %land.lhs.true40.5
store i32 1, ptr %arrayidx54.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60.5
for.inc60.5: ; preds = %if.then50.5, %land.lhs.true40.5, %if.end.5
br i1 %cmp21.not.6, label %if.end.6, label %land.lhs.true.6
land.lhs.true.6: ; preds = %for.inc60.5
%29 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29.6 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 6, i64 %indvars.iv
%30 = load i32, ptr %arrayidx29.6, align 4, !tbaa !5
%cmp30.6 = icmp eq i32 %29, %30
br i1 %cmp30.6, label %if.then.6, label %if.end.6
if.then.6: ; preds = %land.lhs.true.6
%arrayidx34.6 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 6, i64 %indvars.iv
store i32 1, ptr %arrayidx34.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end.6
if.end.6: ; preds = %if.then.6, %land.lhs.true.6, %for.inc60.5
%cmp39.not.6 = icmp eq i64 %indvars.iv, 6
br i1 %cmp39.not.6, label %for.inc60.6, label %land.lhs.true40.6
land.lhs.true40.6: ; preds = %if.end.6
%31 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%32 = load i32, ptr %arrayidx48.6, align 4, !tbaa !5
%cmp49.6 = icmp eq i32 %31, %32
br i1 %cmp49.6, label %if.then50.6, label %for.inc60.6
if.then50.6: ; preds = %land.lhs.true40.6
store i32 1, ptr %arrayidx54.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60.6
for.inc60.6: ; preds = %if.then50.6, %land.lhs.true40.6, %if.end.6
br i1 %cmp21.not.7, label %if.end.7, label %land.lhs.true.7
land.lhs.true.7: ; preds = %for.inc60.6
%33 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29.7 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 7, i64 %indvars.iv
%34 = load i32, ptr %arrayidx29.7, align 4, !tbaa !5
%cmp30.7 = icmp eq i32 %33, %34
br i1 %cmp30.7, label %if.then.7, label %if.end.7
if.then.7: ; preds = %land.lhs.true.7
%arrayidx34.7 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 7, i64 %indvars.iv
store i32 1, ptr %arrayidx34.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end.7
if.end.7: ; preds = %if.then.7, %land.lhs.true.7, %for.inc60.6
%cmp39.not.7 = icmp eq i64 %indvars.iv, 7
br i1 %cmp39.not.7, label %for.inc60.7, label %land.lhs.true40.7
land.lhs.true40.7: ; preds = %if.end.7
%35 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%36 = load i32, ptr %arrayidx48.7, align 4, !tbaa !5
%cmp49.7 = icmp eq i32 %35, %36
br i1 %cmp49.7, label %if.then50.7, label %for.inc60.7
if.then50.7: ; preds = %land.lhs.true40.7
store i32 1, ptr %arrayidx54.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60.7
for.inc60.7: ; preds = %if.then50.7, %land.lhs.true40.7, %if.end.7
br i1 %cmp21.not.8, label %if.end.8, label %land.lhs.true.8
land.lhs.true.8: ; preds = %for.inc60.7
%37 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx29.8 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 8, i64 %indvars.iv
%38 = load i32, ptr %arrayidx29.8, align 4, !tbaa !5
%cmp30.8 = icmp eq i32 %37, %38
br i1 %cmp30.8, label %if.then.8, label %if.end.8
if.then.8: ; preds = %land.lhs.true.8
%arrayidx34.8 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 8, i64 %indvars.iv
store i32 1, ptr %arrayidx34.8, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %if.end.8
if.end.8: ; preds = %if.then.8, %land.lhs.true.8, %for.inc60.7
%cmp39.not.8 = icmp eq i64 %indvars.iv, 8
br i1 %cmp39.not.8, label %for.inc66, label %land.lhs.true40.8
land.lhs.true40.8: ; preds = %if.end.8
%39 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp49.8 = icmp eq i32 %39, %4
br i1 %cmp49.8, label %if.then50.8, label %for.inc60.8
if.then50.8: ; preds = %land.lhs.true40.8
store i32 1, ptr %arrayidx54.8, align 4, !tbaa !5
store i32 1, ptr %arrayidx38, align 4, !tbaa !5
br label %for.inc60.8
for.inc60.8: ; preds = %if.then50.8, %land.lhs.true40.8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.cond18.preheader
for.inc66: ; preds = %if.end.8
%indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
%exitcond138.not = icmp eq i64 %indvars.iv.next136, 9
br i1 %exitcond138.not, label %for.cond69.preheader, label %for.cond15.preheader, !llvm.loop !12
for.cond72.preheader: ; preds = %for.cond69.preheader, %for.inc77
store i32 1, ptr @j, align 4, !tbaa !5
br label %for.body74
for.body74: ; preds = %for.cond72.preheader, %for.body74
%storemerge118129 = phi i32 [ 1, %for.cond72.preheader ], [ %add, %for.body74 ]
%40 = load i32, ptr @i, align 4, !tbaa !5
tail call void @ch(i32 noundef %40, i32 noundef %storemerge118129)
%41 = load i32, ptr @j, align 4, !tbaa !5
%add = add nsw i32 %41, 3
store i32 %add, ptr @j, align 4, !tbaa !5
%cmp73 = icmp slt i32 %41, 6
br i1 %cmp73, label %for.body74, label %for.inc77, !llvm.loop !13
for.inc77: ; preds = %for.body74
%42 = load i32, ptr @i, align 4, !tbaa !5
%add78 = add nsw i32 %42, 3
store i32 %add78, ptr @i, align 4, !tbaa !5
%cmp70 = icmp slt i32 %42, 6
br i1 %cmp70, label %for.cond72.preheader, label %for.end79, !llvm.loop !14
for.end79: ; preds = %for.inc77
store i32 0, ptr @i, align 4, !tbaa !5
br label %for.cond83.preheader
for.cond83.preheader: ; preds = %for.end79, %for.inc99
store i32 0, ptr @j, align 4, !tbaa !5
br label %for.body85
for.body85: ; preds = %for.cond83.preheader, %for.body85
%storemerge116130 = phi i32 [ 0, %for.cond83.preheader ], [ %inc97, %for.body85 ]
%43 = load i32, ptr @i, align 4, !tbaa !5
%idxprom86 = sext i32 %43 to i64
%idxprom88 = sext i32 %storemerge116130 to i64
%arrayidx89 = getelementptr inbounds [9 x [9 x i32]], ptr @f, i64 0, i64 %idxprom86, i64 %idxprom88
%44 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%tobool90.not = icmp eq i32 %44, 0
%cond = select i1 %tobool90.not, i32 32, i32 42
%arrayidx94 = getelementptr inbounds [9 x [9 x i32]], ptr @M, i64 0, i64 %idxprom86, i64 %idxprom88
%45 = load i32, ptr %arrayidx94, align 4, !tbaa !5
%call95 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond, i32 noundef %45)
%46 = load i32, ptr @j, align 4, !tbaa !5
%inc97 = add nsw i32 %46, 1
store i32 %inc97, ptr @j, align 4, !tbaa !5
%cmp84 = icmp slt i32 %46, 8
br i1 %cmp84, label %for.body85, label %for.inc99, !llvm.loop !15
for.inc99: ; preds = %for.body85
%47 = load i32, ptr @i, align 4, !tbaa !5
%inc100 = add nsw i32 %47, 1
store i32 %inc100, ptr @i, align 4, !tbaa !5
%putchar117 = tail call i32 @putchar(i32 10)
%.pr = load i32, ptr @i, align 4, !tbaa !5
%cmp81 = icmp slt i32 %.pr, 9
br i1 %cmp81, label %for.cond83.preheader, label %for.end102, !llvm.loop !16
for.end102: ; preds = %for.inc99
%48 = load i32, ptr @N, align 4, !tbaa !5
%cmp103 = icmp sgt i32 %48, 0
br i1 %cmp103, label %if.then104, label %if.end106
if.then104: ; preds = %for.end102
%putchar = tail call i32 @putchar(i32 10)
%.pre = load i32, ptr @N, align 4, !tbaa !5
br label %if.end106
if.end106: ; preds = %if.then104, %for.end102
%49 = phi i32 [ %.pre, %if.then104 ], [ %48, %for.end102 ]
%dec = add nsw i32 %49, -1
store i32 %dec, ptr @N, align 4, !tbaa !5
%tobool.not = icmp eq i32 %49, 0
br i1 %tobool.not, label %for.end107, label %for.body, !llvm.loop !17
for.end107: ; preds = %if.end106, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { 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 #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
#include <string.h>
int main(){
char S[1001];
scanf("%s",&S);
int i=0;
i=strlen(S);
if(S[i-1]=='s'){
printf("%ses",S);
}
else{
printf("%ss",S);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179413/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179413/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ses\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%ss\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)
%call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #5
%sub = shl i64 %call1, 32
%sext = add i64 %sub, -4294967296
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds [1001 x i8], ptr %S, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 115
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, ptr noundef nonnull %S)
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: 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"}
|
#include<stdio.h>
int main()
{
char S[1001];
scanf("%s",&S);
int i=0;
while(S[i]!='\0') i++;
if(S[i-1]=='s'){printf("%ses",S);}else{printf("%ss",S);}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179464/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179464/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ses\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%ss\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) #3
%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 [1001 x i8], ptr %S, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !8
while.end: ; preds = %while.cond
%sub = shl i64 %indvars.iv, 32
%sext = add i64 %sub, -4294967296
%idxprom2 = ashr exact i64 %sext, 32
%arrayidx3 = getelementptr inbounds [1001 x i8], ptr %S, i64 0, i64 %idxprom2
%1 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%cmp5 = icmp eq i8 %1, 115
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, ptr noundef nonnull %S)
call void @llvm.lifetime.end.p0(i64 1001, 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() {
char s[1003];
char a[] = "s";
char b[] = "es";
scanf("%s", s);
if (s[strlen(s) - 1] == 's')
strcat(s, b);
else
strcat(s, a);
printf("%s", s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179521/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179521/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.b = private unnamed_addr constant [3 x i8] c"es\00", align 1
@.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 [1003 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1003, 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
%sub = add i64 %call2, -1
%arrayidx = getelementptr inbounds [1003 x i8], ptr %s, i64 0, i64 %sub
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 115
%strlen12 = call i64 @strlen(ptr nonnull dereferenceable(1) %s)
%endptr13 = getelementptr inbounds i8, ptr %s, i64 %strlen12
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %endptr13, ptr noundef nonnull align 1 dereferenceable(3) @__const.main.b, i64 3, i1 false)
br label %if.end
if.else: ; preds = %entry
store i16 115, ptr %endptr13, align 1
br label %if.end
if.end: ; preds = %if.else, %if.then
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 1003, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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: 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#define min(X, Y) ((X)<(Y)?(X):(Y))
#define max(X, Y) ((X)>(Y)?(X):(Y))
#define f(X, Y) (((X)-(Y))*((X)-(Y)))
unsigned dp[20001][256];
int C[16];
const unsigned inf=1u<<30;
int main(void)
{
int n, m;
while (scanf("%d%d", &n, &m), n) {
int i;
unsigned *prev, *curr, res;
for(i=0;i<m;++i) scanf("%d", C+i);
memset(dp, -1, sizeof(dp));
dp[0][128]=0;
for(i=0;i<n;++i) {
int x, j, k;
scanf("%d", &x);
prev=dp[i], curr=dp[i+1];
for(j=0;j<256;++j) if (prev[j]<inf) {
for(k=0;k<m;++k) {
int t=min(255, max(0, j+C[k]));
unsigned y=prev[j]+f(x, t);
curr[t]=min(curr[t], y);
}
}
}
res=inf;
for(i=0;i<256;++i) res=min(res, curr[i]);
printf("%u\n", res);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179572/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179572/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@inf = dso_local local_unnamed_addr constant i32 1073741824, align 4
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@C = dso_local global [16 x i32] zeroinitializer, align 16
@dp = dso_local local_unnamed_addr global [20001 x [256 x i32]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%u\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
%call128 = 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
%tobool.not129 = icmp eq i32 %0, 0
br i1 %tobool.not129, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %middle.block
%1 = phi i32 [ %12, %middle.block ], [ %0, %entry ]
%curr.0130 = phi ptr [ %curr.1.lcssa, %middle.block ], [ undef, %entry ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp118 = icmp sgt i32 %2, 0
br i1 %cmp118, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%add.ptr = getelementptr inbounds i32, ptr @C, 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 %m, 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.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %for.cond.preheader
%5 = phi i32 [ %.pre, %for.end.loopexit ], [ %1, %for.cond.preheader ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20481024) @dp, i8 -1, i64 20481024, i1 false)
store i32 0, ptr getelementptr inbounds ([20001 x [256 x i32]], ptr @dp, i64 0, i64 0, i64 128), align 16, !tbaa !5
%cmp3124 = icmp sgt i32 %5, 0
br i1 %cmp3124, label %for.body4, label %vector.ph
vector.ph: ; preds = %for.end61, %for.end
%curr.1.lcssa = phi ptr [ %curr.0130, %for.end ], [ %arrayidx7, %for.end61 ]
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1073741824, i32 1073741824, i32 1073741824, i32 1073741824>, %vector.ph ], [ %8, %vector.body ]
%vec.phi147 = phi <4 x i32> [ <i32 1073741824, i32 1073741824, i32 1073741824, i32 1073741824>, %vector.ph ], [ %9, %vector.body ]
%6 = getelementptr inbounds i32, ptr %curr.1.lcssa, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load148 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%9 = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %vec.phi147, <4 x i32> %wide.load148)
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, 256
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %8, <4 x i32> %9)
%11 = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> %rdx.minmax)
%call80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%12 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %12, 0
br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !14
for.body4: ; preds = %for.end, %for.end61
%indvars.iv140 = phi i64 [ %indvars.iv.next141, %for.end61 ], [ 0, %for.end ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%arrayidx = getelementptr inbounds [20001 x [256 x i32]], ptr @dp, i64 0, i64 %indvars.iv140
%indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
%arrayidx7 = getelementptr inbounds [20001 x [256 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next141
%13 = load i32, ptr %m, align 4
%.fr = freeze i32 %13
%cmp16120 = icmp sgt i32 %.fr, 0
%14 = load i32, ptr %x, align 4
br i1 %cmp16120, label %for.body11.us.preheader, label %for.end61
for.body11.us.preheader: ; preds = %for.body4
%wide.trip.count = zext i32 %.fr to i64
br label %for.body11.us
for.body11.us: ; preds = %for.body11.us.preheader, %for.inc59.us
%indvars.iv136 = phi i64 [ 0, %for.body11.us.preheader ], [ %indvars.iv.next137, %for.inc59.us ]
%arrayidx13.us = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv136
%15 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5
%cmp14.us = icmp ult i32 %15, 1073741824
br i1 %cmp14.us, label %for.body17.us.preheader, label %for.inc59.us
for.body17.us.preheader: ; preds = %for.body11.us
%16 = trunc i64 %indvars.iv136 to i32
br label %for.body17.us
for.inc59.us: ; preds = %for.body17.us, %for.body11.us
%indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
%exitcond139.not = icmp eq i64 %indvars.iv.next137, 256
br i1 %exitcond139.not, label %for.end61, label %for.body11.us, !llvm.loop !15
for.body17.us: ; preds = %for.body17.us.preheader, %for.body17.us
%indvars.iv133 = phi i64 [ 0, %for.body17.us.preheader ], [ %indvars.iv.next134, %for.body17.us ]
%arrayidx19.us = getelementptr inbounds [16 x i32], ptr @C, i64 0, i64 %indvars.iv133
%17 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
%add20.us = add nsw i32 %17, %16
%spec.select.us = call i32 @llvm.smax.i32(i32 %add20.us, i32 0)
%spec.select117.us = call i32 @llvm.umin.i32(i32 %spec.select.us, i32 255)
%18 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5
%sub.us = sub nsw i32 %14, %spec.select117.us
%mul.us = mul nsw i32 %sub.us, %sub.us
%add44.us = add i32 %mul.us, %18
%idxprom45.us = zext i32 %spec.select117.us to i64
%arrayidx46.us = getelementptr inbounds i32, ptr %arrayidx7, i64 %idxprom45.us
%19 = load i32, ptr %arrayidx46.us, align 4, !tbaa !5
%.add44.us = call i32 @llvm.umin.i32(i32 %19, i32 %add44.us)
store i32 %.add44.us, ptr %arrayidx46.us, align 4, !tbaa !5
%indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
%exitcond.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count
br i1 %exitcond.not, label %for.inc59.us, label %for.body17.us, !llvm.loop !16
for.end61: ; preds = %for.inc59.us, %for.body4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
%20 = load i32, ptr %n, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp3 = icmp slt i64 %indvars.iv.next141, %21
br i1 %cmp3, label %for.body4, label %vector.ph, !llvm.loop !17
while.end: ; preds = %middle.block, %entry
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: 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.umin.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
// Aizu 2188: Unit Converter
// 2017.9.20 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
char *pre[20] = {
"yotta", "zetta", "exa", "peta", "tera",
"giga", "mega", "kilo", "hecto", "deca",
"deci", "centi", "milli", "micro", "nano",
"pico", "femto", "ato", "zepto", "yocto" };
int idx[20] = {
24, 21, 18, 15, 12, 9, 6, 3, 2, 1,
-1, -2, -3, -6, -9,-12, -15, -18, -21, -24 };
char buf[1105], ans[1105];
int main()
{
int t, i, a, b, f;
char *p, *q, *w;
fgets(buf, 10, stdin); t = atoi(buf);
while (t-- > 0) {
fgets(buf, 1100, stdin); p = buf, q = ans;
while (isspace(*p)) p++;
while (*p == '0') p++;
a = b = 0, f = 0;
if (*p > '0') *q++ = *p++, f = 1;
while (isdigit(*p)) {
if (f == 1) *q++ = '.', f = 2;
*q++ = *p++, a++;
}
if (*p == '.') { if (f == 1) *q++ = '.', f = 2; p++; }
if (!f) a = -1;
while (*p == '0') {
if (f) *q++ = *p;
else a--;
p++;
}
if (isdigit(*p)) { if (!f) *q++ = *p++, f = 1; }
while (isdigit(*p)) {
if (f == 1) *q++ = '.', f = 2;
*q++ = *p++;
}
while (isspace(*p)) p++;
w = p; while (isalpha(*p)) p++;
*p = 0;
for (i = 0; i < 20; i++) if (!strcmp(w, pre[i])) { b = idx[i]; break; }
if (i < 20) { p++; while (isspace(*p)) p++; w = p; }
sprintf(q, " * 10^%d ", a + b);
q += strlen(q);
while (isalpha(*w)) *q++ = *w++;
*q = 0;
puts(ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"yotta\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"zetta\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"exa\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"peta\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"tera\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c"giga\00", align 1
@.str.6 = private unnamed_addr constant [5 x i8] c"mega\00", align 1
@.str.7 = private unnamed_addr constant [5 x i8] c"kilo\00", align 1
@.str.8 = private unnamed_addr constant [6 x i8] c"hecto\00", align 1
@.str.9 = private unnamed_addr constant [5 x i8] c"deca\00", align 1
@.str.10 = private unnamed_addr constant [5 x i8] c"deci\00", align 1
@.str.11 = private unnamed_addr constant [6 x i8] c"centi\00", align 1
@.str.12 = private unnamed_addr constant [6 x i8] c"milli\00", align 1
@.str.13 = private unnamed_addr constant [6 x i8] c"micro\00", align 1
@.str.14 = private unnamed_addr constant [5 x i8] c"nano\00", align 1
@.str.15 = private unnamed_addr constant [5 x i8] c"pico\00", align 1
@.str.16 = private unnamed_addr constant [6 x i8] c"femto\00", align 1
@.str.17 = private unnamed_addr constant [4 x i8] c"ato\00", align 1
@.str.18 = private unnamed_addr constant [6 x i8] c"zepto\00", align 1
@.str.19 = private unnamed_addr constant [6 x i8] c"yocto\00", align 1
@pre = dso_local local_unnamed_addr global [20 x ptr] [ptr @.str, ptr @.str.1, ptr @.str.2, ptr @.str.3, ptr @.str.4, ptr @.str.5, ptr @.str.6, ptr @.str.7, ptr @.str.8, ptr @.str.9, ptr @.str.10, ptr @.str.11, ptr @.str.12, ptr @.str.13, ptr @.str.14, ptr @.str.15, ptr @.str.16, ptr @.str.17, ptr @.str.18, ptr @.str.19], align 16
@idx = dso_local local_unnamed_addr global [20 x i32] [i32 24, i32 21, i32 18, i32 15, i32 12, i32 9, i32 6, i32 3, i32 2, i32 1, i32 -1, i32 -2, i32 -3, i32 -6, i32 -9, i32 -12, i32 -15, i32 -18, i32 -21, i32 -24], align 16
@buf = dso_local global [1105 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@ans = dso_local global [1105 x i8] zeroinitializer, align 16
@.str.20 = private unnamed_addr constant [10 x i8] c" * 10^%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 10, ptr noundef %0)
%call.i = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #5
%conv.i = trunc i64 %call.i to i32
%cmp254 = icmp sgt i32 %conv.i, 0
br i1 %cmp254, label %while.body, label %while.end157
while.body: ; preds = %entry, %while.end155
%dec255.in = phi i32 [ %dec255, %while.end155 ], [ %conv.i, %entry ]
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call2 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 1100, ptr noundef %1)
%call4 = tail call ptr @__ctype_b_loc() #6
%2 = load ptr, ptr %call4, align 8, !tbaa !5
br label %while.cond3
while.cond3: ; preds = %while.cond3, %while.body
%p.0 = phi ptr [ @buf, %while.body ], [ %incdec.ptr, %while.cond3 ]
%3 = load i8, ptr %p.0, align 1, !tbaa !9
%idxprom = sext i8 %3 to i64
%arrayidx = getelementptr inbounds i16, ptr %2, i64 %idxprom
%4 = load i16, ptr %arrayidx, align 2, !tbaa !10
%5 = and i16 %4, 8192
%tobool.not = icmp eq i16 %5, 0
%incdec.ptr = getelementptr inbounds i8, ptr %p.0, i64 1
br i1 %tobool.not, label %while.cond7, label %while.cond3, !llvm.loop !12
while.cond7: ; preds = %while.cond3, %while.cond7
%p.1 = phi ptr [ %incdec.ptr12, %while.cond7 ], [ %p.0, %while.cond3 ]
%6 = load i8, ptr %p.1, align 1, !tbaa !9
%cmp9 = icmp eq i8 %6, 48
%incdec.ptr12 = getelementptr inbounds i8, ptr %p.1, i64 1
br i1 %cmp9, label %while.cond7, label %while.end13, !llvm.loop !14
while.end13: ; preds = %while.cond7
%dec255 = add nsw i32 %dec255.in, -1
%cmp15 = icmp sgt i8 %6, 48
br i1 %cmp15, label %if.then, label %if.end
if.then: ; preds = %while.end13
store i8 %6, ptr @ans, align 16, !tbaa !9
%.pre = load ptr, ptr %call4, align 8, !tbaa !5
%.pre264 = load i8, ptr %incdec.ptr12, align 1, !tbaa !9
br label %if.end
if.end: ; preds = %if.then, %while.end13
%7 = phi i8 [ %.pre264, %if.then ], [ %6, %while.end13 ]
%8 = phi ptr [ %.pre, %if.then ], [ %2, %while.end13 ]
%f.0 = phi i32 [ 1, %if.then ], [ 0, %while.end13 ]
%p.2 = phi ptr [ %incdec.ptr12, %if.then ], [ %p.1, %while.end13 ]
%q.0 = phi ptr [ getelementptr inbounds ([1105 x i8], ptr @ans, i64 0, i64 1), %if.then ], [ @ans, %while.end13 ]
%idxprom22215 = sext i8 %7 to i64
%arrayidx23216 = getelementptr inbounds i16, ptr %8, i64 %idxprom22215
%9 = load i16, ptr %arrayidx23216, align 2, !tbaa !10
%10 = and i16 %9, 2048
%tobool26.not217 = icmp eq i16 %10, 0
br i1 %tobool26.not217, label %while.end35, label %while.body27
while.body27: ; preds = %if.end, %if.end32
%11 = phi i8 [ %14, %if.end32 ], [ %7, %if.end ]
%q.1221 = phi ptr [ %incdec.ptr34, %if.end32 ], [ %q.0, %if.end ]
%p.3220 = phi ptr [ %incdec.ptr33, %if.end32 ], [ %p.2, %if.end ]
%f.1219 = phi i32 [ %f.2, %if.end32 ], [ %f.0, %if.end ]
%a.0218 = phi i32 [ %inc, %if.end32 ], [ 0, %if.end ]
%cmp28 = icmp eq i32 %f.1219, 1
br i1 %cmp28, label %if.then30, label %if.end32
if.then30: ; preds = %while.body27
%incdec.ptr31 = getelementptr inbounds i8, ptr %q.1221, i64 1
store i8 46, ptr %q.1221, align 1, !tbaa !9
%.pre265 = load i8, ptr %p.3220, align 1, !tbaa !9
br label %if.end32
if.end32: ; preds = %if.then30, %while.body27
%12 = phi i8 [ %.pre265, %if.then30 ], [ %11, %while.body27 ]
%f.2 = phi i32 [ 2, %if.then30 ], [ %f.1219, %while.body27 ]
%q.2 = phi ptr [ %incdec.ptr31, %if.then30 ], [ %q.1221, %while.body27 ]
%incdec.ptr33 = getelementptr inbounds i8, ptr %p.3220, i64 1
%incdec.ptr34 = getelementptr inbounds i8, ptr %q.2, i64 1
store i8 %12, ptr %q.2, align 1, !tbaa !9
%inc = add nuw nsw i32 %a.0218, 1
%13 = load ptr, ptr %call4, align 8, !tbaa !5
%14 = load i8, ptr %incdec.ptr33, align 1, !tbaa !9
%idxprom22 = sext i8 %14 to i64
%arrayidx23 = getelementptr inbounds i16, ptr %13, i64 %idxprom22
%15 = load i16, ptr %arrayidx23, align 2, !tbaa !10
%16 = and i16 %15, 2048
%tobool26.not = icmp eq i16 %16, 0
br i1 %tobool26.not, label %while.end35, label %while.body27, !llvm.loop !15
while.end35: ; preds = %if.end32, %if.end
%a.0.lcssa = phi i32 [ 0, %if.end ], [ %inc, %if.end32 ]
%f.1.lcssa = phi i32 [ %f.0, %if.end ], [ %f.2, %if.end32 ]
%p.3.lcssa = phi ptr [ %p.2, %if.end ], [ %incdec.ptr33, %if.end32 ]
%q.1.lcssa = phi ptr [ %q.0, %if.end ], [ %incdec.ptr34, %if.end32 ]
%.lcssa212 = phi i8 [ %7, %if.end ], [ %14, %if.end32 ]
%cmp37 = icmp eq i8 %.lcssa212, 46
br i1 %cmp37, label %if.then39, label %if.end46
if.then39: ; preds = %while.end35
%cmp40 = icmp eq i32 %f.1.lcssa, 1
br i1 %cmp40, label %if.then42, label %if.end44
if.then42: ; preds = %if.then39
%incdec.ptr43 = getelementptr inbounds i8, ptr %q.1.lcssa, i64 1
store i8 46, ptr %q.1.lcssa, align 1, !tbaa !9
br label %if.end44
if.end44: ; preds = %if.then42, %if.then39
%f.3 = phi i32 [ 2, %if.then42 ], [ %f.1.lcssa, %if.then39 ]
%q.3 = phi ptr [ %incdec.ptr43, %if.then42 ], [ %q.1.lcssa, %if.then39 ]
%incdec.ptr45 = getelementptr inbounds i8, ptr %p.3.lcssa, i64 1
%.pre266 = load i8, ptr %incdec.ptr45, align 1, !tbaa !9
br label %if.end46
if.end46: ; preds = %if.end44, %while.end35
%17 = phi i8 [ %.pre266, %if.end44 ], [ %.lcssa212, %while.end35 ]
%f.4 = phi i32 [ %f.3, %if.end44 ], [ %f.1.lcssa, %while.end35 ]
%p.4 = phi ptr [ %incdec.ptr45, %if.end44 ], [ %p.3.lcssa, %while.end35 ]
%q.4 = phi ptr [ %q.3, %if.end44 ], [ %q.1.lcssa, %while.end35 ]
%tobool47 = icmp ne i32 %f.4, 0
%spec.select = select i1 %tobool47, i32 %a.0.lcssa, i32 -1
%cmp52226 = icmp eq i8 %17, 48
br i1 %cmp52226, label %while.body54.lr.ph, label %while.end61
while.body54.lr.ph: ; preds = %if.end46
br i1 %tobool47, label %while.body54.us, label %while.body54
while.body54.us: ; preds = %while.body54.lr.ph, %while.body54.us
%q.5229.us = phi ptr [ %incdec.ptr57.us, %while.body54.us ], [ %q.4, %while.body54.lr.ph ]
%p.5228.us = phi ptr [ %incdec.ptr60.us, %while.body54.us ], [ %p.4, %while.body54.lr.ph ]
%incdec.ptr57.us = getelementptr inbounds i8, ptr %q.5229.us, i64 1
store i8 48, ptr %q.5229.us, align 1, !tbaa !9
%incdec.ptr60.us = getelementptr inbounds i8, ptr %p.5228.us, i64 1
%18 = load i8, ptr %incdec.ptr60.us, align 1, !tbaa !9
%cmp52.us = icmp eq i8 %18, 48
br i1 %cmp52.us, label %while.body54.us, label %while.end61, !llvm.loop !16
while.body54: ; preds = %while.body54.lr.ph, %while.body54
%p.5228 = phi ptr [ %incdec.ptr60, %while.body54 ], [ %p.4, %while.body54.lr.ph ]
%a.2227 = phi i32 [ %dec58, %while.body54 ], [ -1, %while.body54.lr.ph ]
%dec58 = add nsw i32 %a.2227, -1
%incdec.ptr60 = getelementptr inbounds i8, ptr %p.5228, i64 1
%19 = load i8, ptr %incdec.ptr60, align 1, !tbaa !9
%cmp52 = icmp eq i8 %19, 48
br i1 %cmp52, label %while.body54, label %while.end61, !llvm.loop !16
while.end61: ; preds = %while.body54, %while.body54.us, %if.end46
%a.2.lcssa = phi i32 [ %spec.select, %if.end46 ], [ %spec.select, %while.body54.us ], [ %dec58, %while.body54 ]
%p.5.lcssa = phi ptr [ %p.4, %if.end46 ], [ %incdec.ptr60.us, %while.body54.us ], [ %incdec.ptr60, %while.body54 ]
%q.5.lcssa = phi ptr [ %q.4, %if.end46 ], [ %incdec.ptr57.us, %while.body54.us ], [ %q.4, %while.body54 ]
%.lcssa213 = phi i8 [ %17, %if.end46 ], [ %18, %while.body54.us ], [ %19, %while.body54 ]
%20 = load ptr, ptr %call4, align 8, !tbaa !5
%idxprom64 = sext i8 %.lcssa213 to i64
%arrayidx65 = getelementptr inbounds i16, ptr %20, i64 %idxprom64
%21 = load i16, ptr %arrayidx65, align 2, !tbaa !10
%22 = and i16 %21, 2048
%tobool68 = icmp eq i16 %22, 0
%or.cond = or i1 %tobool47, %tobool68
br i1 %or.cond, label %if.end75, label %if.then71
if.then71: ; preds = %while.end61
%incdec.ptr72 = getelementptr inbounds i8, ptr %p.5.lcssa, i64 1
%incdec.ptr73 = getelementptr inbounds i8, ptr %q.5.lcssa, i64 1
store i8 %.lcssa213, ptr %q.5.lcssa, align 1, !tbaa !9
%.pre267 = load ptr, ptr %call4, align 8, !tbaa !5
%.pre268 = load i8, ptr %incdec.ptr72, align 1, !tbaa !9
%idxprom79237.phi.trans.insert = sext i8 %.pre268 to i64
%arrayidx80238.phi.trans.insert = getelementptr inbounds i16, ptr %.pre267, i64 %idxprom79237.phi.trans.insert
%.pre269 = load i16, ptr %arrayidx80238.phi.trans.insert, align 2, !tbaa !10
%.pre271 = and i16 %.pre269, 2048
br label %if.end75
if.end75: ; preds = %if.then71, %while.end61
%.pre-phi = phi i16 [ %.pre271, %if.then71 ], [ %22, %while.end61 ]
%23 = phi i8 [ %.pre268, %if.then71 ], [ %.lcssa213, %while.end61 ]
%24 = phi ptr [ %.pre267, %if.then71 ], [ %20, %while.end61 ]
%f.5 = phi i32 [ 1, %if.then71 ], [ %f.4, %while.end61 ]
%p.6 = phi ptr [ %incdec.ptr72, %if.then71 ], [ %p.5.lcssa, %while.end61 ]
%q.7 = phi ptr [ %incdec.ptr73, %if.then71 ], [ %q.5.lcssa, %while.end61 ]
%tobool83.not239 = icmp eq i16 %.pre-phi, 0
br i1 %tobool83.not239, label %while.cond93.preheader, label %while.body84
while.cond93.preheader: ; preds = %if.end89, %if.end75
%p.7.lcssa = phi ptr [ %p.6, %if.end75 ], [ %incdec.ptr90, %if.end89 ]
%q.8.lcssa = phi ptr [ %q.7, %if.end75 ], [ %incdec.ptr91, %if.end89 ]
%.lcssa214 = phi ptr [ %24, %if.end75 ], [ %27, %if.end89 ]
br label %while.cond93
while.body84: ; preds = %if.end75, %if.end89
%25 = phi i8 [ %28, %if.end89 ], [ %23, %if.end75 ]
%q.8242 = phi ptr [ %incdec.ptr91, %if.end89 ], [ %q.7, %if.end75 ]
%p.7241 = phi ptr [ %incdec.ptr90, %if.end89 ], [ %p.6, %if.end75 ]
%f.6240 = phi i32 [ %f.7, %if.end89 ], [ %f.5, %if.end75 ]
%cmp85 = icmp eq i32 %f.6240, 1
br i1 %cmp85, label %if.then87, label %if.end89
if.then87: ; preds = %while.body84
%incdec.ptr88 = getelementptr inbounds i8, ptr %q.8242, i64 1
store i8 46, ptr %q.8242, align 1, !tbaa !9
%.pre270 = load i8, ptr %p.7241, align 1, !tbaa !9
br label %if.end89
if.end89: ; preds = %if.then87, %while.body84
%26 = phi i8 [ %.pre270, %if.then87 ], [ %25, %while.body84 ]
%f.7 = phi i32 [ 2, %if.then87 ], [ %f.6240, %while.body84 ]
%q.9 = phi ptr [ %incdec.ptr88, %if.then87 ], [ %q.8242, %while.body84 ]
%incdec.ptr90 = getelementptr inbounds i8, ptr %p.7241, i64 1
%incdec.ptr91 = getelementptr inbounds i8, ptr %q.9, i64 1
store i8 %26, ptr %q.9, align 1, !tbaa !9
%27 = load ptr, ptr %call4, align 8, !tbaa !5
%28 = load i8, ptr %incdec.ptr90, align 1, !tbaa !9
%idxprom79 = sext i8 %28 to i64
%arrayidx80 = getelementptr inbounds i16, ptr %27, i64 %idxprom79
%29 = load i16, ptr %arrayidx80, align 2, !tbaa !10
%30 = and i16 %29, 2048
%tobool83.not = icmp eq i16 %30, 0
br i1 %tobool83.not, label %while.cond93.preheader, label %while.body84, !llvm.loop !17
while.cond93: ; preds = %while.cond93, %while.cond93.preheader
%p.8 = phi ptr [ %incdec.ptr102, %while.cond93 ], [ %p.7.lcssa, %while.cond93.preheader ]
%31 = load i8, ptr %p.8, align 1, !tbaa !9
%idxprom96 = sext i8 %31 to i64
%arrayidx97 = getelementptr inbounds i16, ptr %.lcssa214, i64 %idxprom96
%32 = load i16, ptr %arrayidx97, align 2, !tbaa !10
%33 = and i16 %32, 8192
%tobool100.not = icmp eq i16 %33, 0
%incdec.ptr102 = getelementptr inbounds i8, ptr %p.8, i64 1
br i1 %tobool100.not, label %while.cond104, label %while.cond93, !llvm.loop !18
while.cond104: ; preds = %while.cond93, %while.cond104
%p.9 = phi ptr [ %incdec.ptr113, %while.cond104 ], [ %p.8, %while.cond93 ]
%34 = load i8, ptr %p.9, align 1, !tbaa !9
%idxprom107 = sext i8 %34 to i64
%arrayidx108 = getelementptr inbounds i16, ptr %.lcssa214, i64 %idxprom107
%35 = load i16, ptr %arrayidx108, align 2, !tbaa !10
%36 = and i16 %35, 1024
%tobool111.not = icmp eq i16 %36, 0
%incdec.ptr113 = getelementptr inbounds i8, ptr %p.9, i64 1
br i1 %tobool111.not, label %while.end114, label %while.cond104, !llvm.loop !19
while.end114: ; preds = %while.cond104
store i8 0, ptr %p.9, align 1, !tbaa !9
%37 = load ptr, ptr @pre, align 16, !tbaa !5
%call119 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %37) #7
%tobool120.not = icmp eq i32 %call119, 0
br i1 %tobool120.not, label %for.end, label %for.cond
for.cond: ; preds = %while.end114
%38 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 1), align 8, !tbaa !5
%call119.1 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %38) #7
%tobool120.not.1 = icmp eq i32 %call119.1, 0
br i1 %tobool120.not.1, label %for.end, label %for.cond.1
for.cond.1: ; preds = %for.cond
%39 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 2), align 16, !tbaa !5
%call119.2 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %39) #7
%tobool120.not.2 = icmp eq i32 %call119.2, 0
br i1 %tobool120.not.2, label %for.end, label %for.cond.2
for.cond.2: ; preds = %for.cond.1
%40 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 3), align 8, !tbaa !5
%call119.3 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %40) #7
%tobool120.not.3 = icmp eq i32 %call119.3, 0
br i1 %tobool120.not.3, label %for.end, label %for.cond.3
for.cond.3: ; preds = %for.cond.2
%41 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 4), align 16, !tbaa !5
%call119.4 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %41) #7
%tobool120.not.4 = icmp eq i32 %call119.4, 0
br i1 %tobool120.not.4, label %for.end, label %for.cond.4
for.cond.4: ; preds = %for.cond.3
%42 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 5), align 8, !tbaa !5
%call119.5 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %42) #7
%tobool120.not.5 = icmp eq i32 %call119.5, 0
br i1 %tobool120.not.5, label %for.end, label %for.cond.5
for.cond.5: ; preds = %for.cond.4
%43 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 6), align 16, !tbaa !5
%call119.6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %43) #7
%tobool120.not.6 = icmp eq i32 %call119.6, 0
br i1 %tobool120.not.6, label %for.end, label %for.cond.6
for.cond.6: ; preds = %for.cond.5
%44 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 7), align 8, !tbaa !5
%call119.7 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %44) #7
%tobool120.not.7 = icmp eq i32 %call119.7, 0
br i1 %tobool120.not.7, label %for.end, label %for.cond.7
for.cond.7: ; preds = %for.cond.6
%45 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 8), align 16, !tbaa !5
%call119.8 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %45) #7
%tobool120.not.8 = icmp eq i32 %call119.8, 0
br i1 %tobool120.not.8, label %for.end, label %for.cond.8
for.cond.8: ; preds = %for.cond.7
%46 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 9), align 8, !tbaa !5
%call119.9 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %46) #7
%tobool120.not.9 = icmp eq i32 %call119.9, 0
br i1 %tobool120.not.9, label %for.end, label %for.cond.9
for.cond.9: ; preds = %for.cond.8
%47 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 10), align 16, !tbaa !5
%call119.10 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %47) #7
%tobool120.not.10 = icmp eq i32 %call119.10, 0
br i1 %tobool120.not.10, label %for.end, label %for.cond.10
for.cond.10: ; preds = %for.cond.9
%48 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 11), align 8, !tbaa !5
%call119.11 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %48) #7
%tobool120.not.11 = icmp eq i32 %call119.11, 0
br i1 %tobool120.not.11, label %for.end, label %for.cond.11
for.cond.11: ; preds = %for.cond.10
%49 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 12), align 16, !tbaa !5
%call119.12 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %49) #7
%tobool120.not.12 = icmp eq i32 %call119.12, 0
br i1 %tobool120.not.12, label %for.end, label %for.cond.12
for.cond.12: ; preds = %for.cond.11
%50 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 13), align 8, !tbaa !5
%call119.13 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %50) #7
%tobool120.not.13 = icmp eq i32 %call119.13, 0
br i1 %tobool120.not.13, label %for.end, label %for.cond.13
for.cond.13: ; preds = %for.cond.12
%51 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 14), align 16, !tbaa !5
%call119.14 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %51) #7
%tobool120.not.14 = icmp eq i32 %call119.14, 0
br i1 %tobool120.not.14, label %for.end, label %for.cond.14
for.cond.14: ; preds = %for.cond.13
%52 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 15), align 8, !tbaa !5
%call119.15 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %52) #7
%tobool120.not.15 = icmp eq i32 %call119.15, 0
br i1 %tobool120.not.15, label %for.end, label %for.cond.15
for.cond.15: ; preds = %for.cond.14
%53 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 16), align 16, !tbaa !5
%call119.16 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %53) #7
%tobool120.not.16 = icmp eq i32 %call119.16, 0
br i1 %tobool120.not.16, label %for.end, label %for.cond.16
for.cond.16: ; preds = %for.cond.15
%54 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 17), align 8, !tbaa !5
%call119.17 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %54) #7
%tobool120.not.17 = icmp eq i32 %call119.17, 0
br i1 %tobool120.not.17, label %for.end, label %for.cond.17
for.cond.17: ; preds = %for.cond.16
%55 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 18), align 16, !tbaa !5
%call119.18 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %55) #7
%tobool120.not.18 = icmp eq i32 %call119.18, 0
br i1 %tobool120.not.18, label %for.end, label %for.cond.18
for.cond.18: ; preds = %for.cond.17
%56 = load ptr, ptr getelementptr inbounds ([20 x ptr], ptr @pre, i64 0, i64 19), align 8, !tbaa !5
%call119.19 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p.8, ptr noundef nonnull dereferenceable(1) %56) #7
%tobool120.not.19 = icmp eq i32 %call119.19, 0
br i1 %tobool120.not.19, label %for.end, label %if.end141
for.end: ; preds = %for.cond.18, %for.cond.17, %for.cond.16, %for.cond.15, %for.cond.14, %for.cond.13, %for.cond.12, %for.cond.11, %for.cond.10, %for.cond.9, %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, %while.end114
%idxprom117.lcssa = phi i64 [ 0, %while.end114 ], [ 1, %for.cond ], [ 2, %for.cond.1 ], [ 3, %for.cond.2 ], [ 4, %for.cond.3 ], [ 5, %for.cond.4 ], [ 6, %for.cond.5 ], [ 7, %for.cond.6 ], [ 8, %for.cond.7 ], [ 9, %for.cond.8 ], [ 10, %for.cond.9 ], [ 11, %for.cond.10 ], [ 12, %for.cond.11 ], [ 13, %for.cond.12 ], [ 14, %for.cond.13 ], [ 15, %for.cond.14 ], [ 16, %for.cond.15 ], [ 17, %for.cond.16 ], [ 18, %for.cond.17 ], [ 19, %for.cond.18 ]
%arrayidx123 = getelementptr inbounds [20 x i32], ptr @idx, i64 0, i64 %idxprom117.lcssa
%57 = load i32, ptr %arrayidx123, align 4, !tbaa !20
%58 = load ptr, ptr %call4, align 8, !tbaa !5
br label %while.cond130
while.cond130: ; preds = %for.end, %while.cond130
%p.9.pn = phi ptr [ %p.9, %for.end ], [ %p.10, %while.cond130 ]
%p.10 = getelementptr inbounds i8, ptr %p.9.pn, i64 1
%59 = load i8, ptr %p.10, align 1, !tbaa !9
%idxprom133 = sext i8 %59 to i64
%arrayidx134 = getelementptr inbounds i16, ptr %58, i64 %idxprom133
%60 = load i16, ptr %arrayidx134, align 2, !tbaa !10
%61 = and i16 %60, 8192
%tobool137.not = icmp eq i16 %61, 0
br i1 %tobool137.not, label %if.end141, label %while.cond130, !llvm.loop !22
if.end141: ; preds = %while.cond130, %for.cond.18
%b.0210 = phi i32 [ 0, %for.cond.18 ], [ %57, %while.cond130 ]
%w.0 = phi ptr [ %p.8, %for.cond.18 ], [ %p.10, %while.cond130 ]
%add = add nsw i32 %b.0210, %a.2.lcssa
%call142 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %q.8.lcssa, ptr noundef nonnull dereferenceable(1) @.str.20, i32 noundef %add) #5
%call143 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %q.8.lcssa) #7
%add.ptr = getelementptr inbounds i8, ptr %q.8.lcssa, i64 %call143
%62 = load ptr, ptr %call4, align 8, !tbaa !5
%63 = load i8, ptr %w.0, align 1, !tbaa !9
%idxprom147247 = sext i8 %63 to i64
%arrayidx148248 = getelementptr inbounds i16, ptr %62, i64 %idxprom147247
%64 = load i16, ptr %arrayidx148248, align 2, !tbaa !10
%65 = and i16 %64, 1024
%tobool151.not249 = icmp eq i16 %65, 0
br i1 %tobool151.not249, label %while.end155, label %while.body152
while.body152: ; preds = %if.end141, %while.body152
%66 = phi i8 [ %68, %while.body152 ], [ %63, %if.end141 ]
%w.1251 = phi ptr [ %incdec.ptr153, %while.body152 ], [ %w.0, %if.end141 ]
%q.10250 = phi ptr [ %incdec.ptr154, %while.body152 ], [ %add.ptr, %if.end141 ]
%incdec.ptr153 = getelementptr inbounds i8, ptr %w.1251, i64 1
%incdec.ptr154 = getelementptr inbounds i8, ptr %q.10250, i64 1
store i8 %66, ptr %q.10250, align 1, !tbaa !9
%67 = load ptr, ptr %call4, align 8, !tbaa !5
%68 = load i8, ptr %incdec.ptr153, align 1, !tbaa !9
%idxprom147 = sext i8 %68 to i64
%arrayidx148 = getelementptr inbounds i16, ptr %67, i64 %idxprom147
%69 = load i16, ptr %arrayidx148, align 2, !tbaa !10
%70 = and i16 %69, 1024
%tobool151.not = icmp eq i16 %70, 0
br i1 %tobool151.not, label %while.end155, label %while.body152, !llvm.loop !23
while.end155: ; preds = %while.body152, %if.end141
%q.10.lcssa = phi ptr [ %add.ptr, %if.end141 ], [ %incdec.ptr154, %while.body152 ]
store i8 0, ptr %q.10.lcssa, align 1, !tbaa !9
%call156 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @ans)
%cmp = icmp sgt i32 %dec255.in, 1
br i1 %cmp, label %while.body, label %while.end157, !llvm.loop !24
while.end157: ; preds = %while.end155, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, 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 #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }
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 = !{!"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}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
|
#include<stdio.h>
int main(){
int N,T,t1,t2;
scanf("%d%d",&N,&T);
long sum=0;
scanf("%d",&t1);
for (int i = 1; i < N; i++)
{
scanf("%d",&t2);
if ((t2-t1)<=T)
{
sum+=t2-t1;
}else
{
sum+=T;
}
t1=t2;
}
sum+=T;
printf("%ld",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179680/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179680/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%T = alloca i32, align 4
%t1 = alloca i32, align 4
%t2 = 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 %T) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %T)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t1)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %0, 1
br i1 %cmp14, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = load i32, ptr %T, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%1 = phi i32 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %4, %for.body ]
%sum.0.lcssa = phi i64 [ 0, %entry.for.cond.cleanup_crit_edge ], [ %sum.1, %for.body ]
%conv7 = sext i32 %1 to i64
%add8 = add nsw i64 %sum.0.lcssa, %conv7
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.016 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%sum.015 = phi i64 [ %sum.1, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t2)
%2 = load i32, ptr %t2, align 4, !tbaa !5
%3 = load i32, ptr %t1, align 4, !tbaa !5
%sub = sub nsw i32 %2, %3
%4 = load i32, ptr %T, align 4, !tbaa !5
%.sub = call i32 @llvm.smin.i32(i32 %sub, i32 %4)
%conv.pn = sext i32 %.sub to i64
%sum.1 = add nsw i64 %sum.015, %conv.pn
store i32 %2, ptr %t1, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.016, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_VTX_MAX 50 // 最大頂点数
#define D_EDGE_MAX 100 // 最大辺数
#define D_PAY_MAX 50 // 最大運賃数
#define D_MONEY_MAX D_VTX_MAX * D_PAY_MAX // 最大金額
#define D_HEAP_MAX D_EDGE_MAX * D_MONEY_MAX // 最大ヒープ数
// 内部構造体 - 辺情報
typedef struct Edge {
int miVNo; // 接続先頂点
int miMoney; // 金額
int miLen; // 長さ
struct Edge *mzpNext; // 次の辺情報
} Edge;
// 内部構造体 - 頂点情報
typedef struct Vtx {
Edge *mzpEdge; // 辺
long long ml1Min[D_MONEY_MAX]; // 最短距離
int miMoney; // 両替枚数
int miTime; // 両替時間
} Vtx;
// 内部構造体 - ヒープ情報
typedef struct Heap {
long long mlMin; // 最短距離
int miVNo; // 頂点
int miMoney; // 金額
} Heap;
// 内部変数
static FILE *szpFpI; // 入力
static Vtx sz1Vtx[D_VTX_MAX]; // 頂点
static int siVCnt; // 頂点数
static Edge sz1Edge[D_EDGE_MAX * 2]; // 辺
static int siECnt; // 辺数
static Heap sz1Heap[D_HEAP_MAX]; // ヒープ
static int siHCnt; // ヒープ数
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpA;
static int siTNo;
#endif
// 1行出力
int
fOutLine(
char *pcpLine // <I> 1行
)
{
char lc1Buf[1024];
#ifdef D_TEST
lc1Buf[0] = '\0';
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, pcpLine)) {
siRes = -1;
}
#else
printf("%s", pcpLine);
#endif
return 0;
}
// 最小値 - 取得
long long
fGetMin(
long long plVal1 // <I> 値1
, long long plVal2 // <I> 値2
)
{
if (plVal1 < plVal2) {
return plVal1;
}
else {
return plVal2;
}
}
// 辺 - 追加
int
fAddEdge(
int piVFNo // <I> 頂点 - 元 0~
, int piVTNo // <I> 頂点 - 先 0~
, int piMoney // <I> 金額
, int piLen // <I> 長さ
)
{
sz1Edge[siECnt].miVNo = piVTNo;
sz1Edge[siECnt].miMoney = piMoney;
sz1Edge[siECnt].miLen = piLen;
sz1Edge[siECnt].mzpNext = sz1Vtx[piVFNo].mzpEdge;
sz1Vtx[piVFNo].mzpEdge = &sz1Edge[siECnt];
siECnt++;
return 0;
}
// ヒープ - 比較 - 最短距離昇順
int
fHeapCmp(
int piNo1 // <I> 配列番号1 0~
, int piNo2 // <I> 配列番号2 0~
)
{
// 最短距離昇順
if (sz1Heap[piNo1].mlMin < sz1Heap[piNo2].mlMin) {
return -1;
}
else if (sz1Heap[piNo1].mlMin > sz1Heap[piNo2].mlMin) {
return 1;
}
return 0;
}
// ヒープ - 親子関係チェック
// 戻り値:[>=0]:変更した子の配列番号 [-1]:変更なし
int
fHeapChk(
int piPNo // <I> 親の配列番号 0~
)
{
int liRet;
// 最小値
int liMNo = piPNo;
// 左の子と比較
int liCNo = piPNo * 2 + 1;
if (liCNo < siHCnt) {
liRet = fHeapCmp(liMNo, liCNo);
if (liRet == 1) {
liMNo = liCNo;
}
}
// 右の子と比較
liCNo = piPNo * 2 + 2;
if (liCNo < siHCnt) {
liRet = fHeapCmp(liMNo, liCNo);
if (liRet == 1) {
liMNo = liCNo;
}
}
// 変更有無
if (piPNo == liMNo) {
return -1;
}
// 値の交換
Heap lzWork;
memcpy(&lzWork, &sz1Heap[liMNo], sizeof(Heap));
memcpy(&sz1Heap[liMNo], &sz1Heap[piPNo], sizeof(Heap));
memcpy(&sz1Heap[piPNo], &lzWork, sizeof(Heap));
return liMNo;
}
// ヒープ - キュー追加
int
fHeapEnqueue(
int piVNo // <I> 頂点
, int piMoney // <I> 金額
, long long plMin // <I> 最短距離
)
{
int liRet;
// 金額
if (piMoney >= D_MONEY_MAX - 1) {
piMoney = D_MONEY_MAX - 1;
}
else if (piMoney < 0) {
return 0;
}
// 最短距離
if (sz1Vtx[piVNo].ml1Min[piMoney] <= plMin) {
return 0;
}
sz1Vtx[piVNo].ml1Min[piMoney] = plMin;
// 末尾に追加
sz1Heap[siHCnt].miVNo = piVNo;
sz1Heap[siHCnt].miMoney = piMoney;
sz1Heap[siHCnt].mlMin = plMin;
siHCnt++;
// 親子関係チェック
int liNo = siHCnt - 1;
while (1) {
// 親の配列番号
liNo = (liNo - 1) / 2;
// 親子関係チェック
liRet = fHeapChk(liNo);
if (liRet < 0) {
break;
}
}
return 0;
}
// ヒープ - キュー取得
int
fHeapDequeue(
Heap *pzpRet // <O> 取得先
)
{
// データ数
if (siHCnt < 1) {
return -1;
}
// 取得
memcpy(pzpRet, &sz1Heap[0], sizeof(Heap));
siHCnt--;
// データ数
if (siHCnt < 1) {
return 0;
}
// 末尾を先頭へ
memcpy(&sz1Heap[0], &sz1Heap[siHCnt], sizeof(Heap));
// 親子関係チェック
int liNo = 0;
while (liNo >= 0) {
liNo = fHeapChk(liNo);
}
return 0;
}
// 最短距離 - セット
int
fSetMin(
int piVSNo // <I> 開始頂点
, int piMoney // <I> 金額
)
{
int i, j, liRet;
// 最短距離 - 初期化
for (i = 0; i < siVCnt; i++) {
for (j = 0; j < D_MONEY_MAX; j++) {
sz1Vtx[i].ml1Min[j] = LLONG_MAX;
}
}
// 初期化
siHCnt = 0;
fHeapEnqueue(piVSNo, piMoney, 0);
// ヒープ - 取得
while (1) {
Heap lzHeap;
liRet = fHeapDequeue(&lzHeap);
if (liRet != 0) {
break;
}
// 最短距離のみ
if (lzHeap.mlMin > sz1Vtx[lzHeap.miVNo].ml1Min[lzHeap.miMoney]) {
continue;
}
// 辺でループ
Edge *lzpEdge = sz1Vtx[lzHeap.miVNo].mzpEdge;
while (lzpEdge != NULL) {
// ヒープ - 追加
fHeapEnqueue(lzpEdge->miVNo, lzHeap.miMoney - lzpEdge->miMoney, lzHeap.mlMin + (long long)lzpEdge->miLen);
// 次の辺へ
lzpEdge = lzpEdge->mzpNext;
}
// 換金
fHeapEnqueue(lzHeap.miVNo, lzHeap.miMoney + sz1Vtx[lzHeap.miVNo].miMoney, lzHeap.mlMin + (long long)sz1Vtx[lzHeap.miVNo].miTime);
}
return 0;
}
// 実行メイン
int
fMain(
)
{
int i, j;
char lc1Buf[1024];
// データ - 初期化
memset(sz1Vtx, 0, sizeof(sz1Vtx));
siECnt = 0;
// 頂点数・辺数・銀貨数 - 取得
int liECnt, liSCnt;
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d%d%d", &siVCnt, &liECnt, &liSCnt);
// 辺 - 取得
for (i = 0; i < liECnt; i++) {
int liVNo1, liVNo2, liMoney, liLen;
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d%d%d%d", &liVNo1, &liVNo2, &liMoney, &liLen);
liVNo1--;
liVNo2--;
// 辺 - 追加
fAddEdge(liVNo1, liVNo2, liMoney, liLen);
fAddEdge(liVNo2, liVNo1, liMoney, liLen);
}
// 両替 - 取得
for (i = 0; i < siVCnt; i++) {
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d%d", &sz1Vtx[i].miMoney, &sz1Vtx[i].miTime);
}
// 最短距離 - セット
fSetMin(0, liSCnt);
// 出力
for (i = 1; i < siVCnt; i++) {
// 最短時間 - 取得
long long llMin = LLONG_MAX;
for (j = 0; j < D_MONEY_MAX; j++) {
llMin = fGetMin(llMin, sz1Vtx[i].ml1Min[j]);
}
sprintf(lc1Buf, "%lld\n", llMin);
fOutLine(lc1Buf);
}
return 0;
}
// 1回実行
int
fOne(
)
{
int liRet;
char lc1Buf[1024];
// 入力 - セット
#ifdef D_TEST
sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
szpFpI = fopen(lc1Buf, "r");
sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
szpFpA = fopen(lc1Buf, "r");
siRes = 0;
#else
szpFpI = stdin;
#endif
// 実行メイン
liRet = fMain();
// 残データ有無
#ifdef D_TEST
lc1Buf[0] = '\0';
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, "")) {
siRes = -1;
}
#endif
// テストファイルクローズ
#ifdef D_TEST
fclose(szpFpI);
fclose(szpFpA);
#endif
// テスト結果
#ifdef D_TEST
if (siRes == 0) {
printf("OK %d\n", siTNo);
}
else {
printf("NG %d\n", siTNo);
}
#endif
return 0;
}
// プログラム開始
int
main()
{
#ifdef D_TEST
int i;
for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
siTNo = i;
fOne();
}
#else
fOne();
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179730/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179730/source.c"
target datalayout = "e-m:e-p270: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.Edge = type { i32, i32, i32, ptr }
%struct.Vtx = type { ptr, [2500 x i64], i32, i32 }
%struct.Heap = type { i64, i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@sz1Edge = internal global [200 x %struct.Edge] zeroinitializer, align 16
@siECnt = internal unnamed_addr global i32 0, align 4
@sz1Vtx = internal global [50 x %struct.Vtx] zeroinitializer, align 16
@sz1Heap = internal unnamed_addr global [250000 x %struct.Heap] zeroinitializer, align 16
@siHCnt = internal unnamed_addr global i32 0, align 4
@siVCnt = internal global i32 0, align 4
@szpFpI = internal unnamed_addr global ptr null, align 8
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOutLine(ptr noundef %pcpLine) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %pcpLine)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree 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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @fGetMin(i64 noundef %plVal1, i64 noundef %plVal2) local_unnamed_addr #3 {
entry:
%plVal1.plVal2 = tail call i64 @llvm.smin.i64(i64 %plVal1, i64 %plVal2)
ret i64 %plVal1.plVal2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @fAddEdge(i32 noundef %piVFNo, i32 noundef %piVTNo, i32 noundef %piMoney, i32 noundef %piLen) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr @siECnt, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom
store i32 %piVTNo, ptr %arrayidx, align 8, !tbaa !9
%miMoney = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom, i32 1
store i32 %piMoney, ptr %miMoney, align 4, !tbaa !12
%miLen = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom, i32 2
store i32 %piLen, ptr %miLen, align 8, !tbaa !13
%idxprom5 = sext i32 %piVFNo to i64
%arrayidx6 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom5
%1 = load ptr, ptr %arrayidx6, align 16, !tbaa !14
%mzpNext = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom, i32 3
store ptr %1, ptr %mzpNext, align 8, !tbaa !16
store ptr %arrayidx, ptr %arrayidx6, align 16, !tbaa !14
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @siECnt, align 4, !tbaa !5
ret i32 0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @fHeapCmp(i32 noundef %piNo1, i32 noundef %piNo2) local_unnamed_addr #5 {
entry:
%idxprom = sext i32 %piNo1 to i64
%arrayidx = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom
%0 = load i64, ptr %arrayidx, align 16, !tbaa !17
%idxprom1 = sext i32 %piNo2 to i64
%arrayidx2 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1
%1 = load i64, ptr %arrayidx2, align 16, !tbaa !17
%cmp = icmp slt i64 %0, %1
%cmp10 = icmp sgt i64 %0, %1
%. = zext i1 %cmp10 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @fHeapChk(i32 noundef %piPNo) local_unnamed_addr #6 {
entry:
%lzWork = alloca %struct.Heap, align 8
%mul = shl nsw i32 %piPNo, 1
%add = or i32 %mul, 1
%0 = load i32, ptr @siHCnt, align 4, !tbaa !5
%cmp = icmp slt i32 %add, %0
br i1 %cmp, label %if.then, label %if.end3
if.then: ; preds = %entry
%idxprom.i = sext i32 %piPNo to i64
%arrayidx.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i
%1 = load i64, ptr %arrayidx.i, align 16, !tbaa !17
%idxprom1.i = sext i32 %add to i64
%arrayidx2.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i
%2 = load i64, ptr %arrayidx2.i, align 16, !tbaa !17
%cmp10.i = icmp sgt i64 %1, %2
%spec.select = select i1 %cmp10.i, i32 %add, i32 %piPNo
br label %if.end3
if.end3: ; preds = %if.then, %entry
%liMNo.0 = phi i32 [ %piPNo, %entry ], [ %spec.select, %if.then ]
%add5 = add nsw i32 %mul, 2
%cmp6 = icmp slt i32 %add5, %0
br i1 %cmp6, label %if.then7, label %if.end12
if.then7: ; preds = %if.end3
%idxprom.i41 = sext i32 %liMNo.0 to i64
%arrayidx.i42 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i41
%3 = load i64, ptr %arrayidx.i42, align 16, !tbaa !17
%idxprom1.i43 = sext i32 %add5 to i64
%arrayidx2.i44 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i43
%4 = load i64, ptr %arrayidx2.i44, align 16, !tbaa !17
%cmp10.i46 = icmp sgt i64 %3, %4
%spec.select40 = select i1 %cmp10.i46, i32 %add5, i32 %liMNo.0
br label %if.end12
if.end12: ; preds = %if.then7, %if.end3
%liMNo.1 = phi i32 [ %liMNo.0, %if.end3 ], [ %spec.select40, %if.then7 ]
%cmp13 = icmp eq i32 %liMNo.1, %piPNo
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end12
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %lzWork)
%idxprom = sext i32 %liMNo.1 to i64
%arrayidx = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %lzWork, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx, i64 16, i1 false)
%idxprom18 = sext i32 %piPNo to i64
%arrayidx19 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom18
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19, i64 16, i1 false)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19, ptr noundef nonnull align 8 dereferenceable(16) %lzWork, i64 16, i1 false)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %lzWork)
br label %cleanup
cleanup: ; preds = %if.end12, %if.end15
%retval.0 = phi i32 [ %liMNo.1, %if.end15 ], [ -1, %if.end12 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @fHeapEnqueue(i32 noundef %piVNo, i32 noundef %piMoney, i64 noundef %plMin) local_unnamed_addr #8 {
entry:
%lzWork.i = alloca %struct.Heap, align 8
%cmp = icmp sgt i32 %piMoney, 2498
br i1 %cmp, label %if.end3, label %if.else
if.else: ; preds = %entry
%cmp1 = icmp slt i32 %piMoney, 0
br i1 %cmp1, label %cleanup, label %if.end3
if.end3: ; preds = %entry, %if.else
%piMoney.addr.0 = phi i32 [ %piMoney, %if.else ], [ 2499, %entry ]
%idxprom = sext i32 %piVNo to i64
%idxprom4 = zext i32 %piMoney.addr.0 to i64
%arrayidx5 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom, i32 1, i64 %idxprom4
%0 = load i64, ptr %arrayidx5, align 8, !tbaa !20
%cmp6.not = icmp sgt i64 %0, %plMin
br i1 %cmp6.not, label %if.end8, label %cleanup
if.end8: ; preds = %if.end3
store i64 %plMin, ptr %arrayidx5, align 8, !tbaa !20
%1 = load i32, ptr @siHCnt, align 4, !tbaa !5
%idxprom14 = sext i32 %1 to i64
%miVNo = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14, i32 1
store i32 %piVNo, ptr %miVNo, align 8, !tbaa !21
%miMoney = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14, i32 2
store i32 %piMoney.addr.0, ptr %miMoney, align 4, !tbaa !22
%arrayidx19 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14
store i64 %plMin, ptr %arrayidx19, align 16, !tbaa !17
%inc = add nsw i32 %1, 1
store i32 %inc, ptr @siHCnt, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %fHeapChk.exit, %if.end8
%liNo.0 = phi i32 [ %1, %if.end8 ], [ %div, %fHeapChk.exit ]
%sub20 = add nsw i32 %liNo.0, -1
%div = sdiv i32 %sub20, 2
%mul.i = shl nsw i32 %div, 1
%add.i = or i32 %mul.i, 1
%cmp.i.not = icmp sgt i32 %add.i, %1
br i1 %cmp.i.not, label %if.end3.i, label %if.then.i
if.then.i: ; preds = %while.cond
%idxprom.i.i = sext i32 %div to i64
%arrayidx.i.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i.i
%2 = load i64, ptr %arrayidx.i.i, align 16, !tbaa !17
%idxprom1.i.i = sext i32 %add.i to i64
%arrayidx2.i.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i.i
%3 = load i64, ptr %arrayidx2.i.i, align 16, !tbaa !17
%cmp10.i.i = icmp sgt i64 %2, %3
%spec.select.i = select i1 %cmp10.i.i, i32 %add.i, i32 %div
br label %if.end3.i
if.end3.i: ; preds = %if.then.i, %while.cond
%liMNo.0.i = phi i32 [ %div, %while.cond ], [ %spec.select.i, %if.then.i ]
%add5.i = add nsw i32 %mul.i, 2
%cmp6.i.not = icmp sgt i32 %add5.i, %1
br i1 %cmp6.i.not, label %if.end12.i, label %if.then7.i
if.then7.i: ; preds = %if.end3.i
%idxprom.i41.i = sext i32 %liMNo.0.i to i64
%arrayidx.i42.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i41.i
%4 = load i64, ptr %arrayidx.i42.i, align 16, !tbaa !17
%idxprom1.i43.i = sext i32 %add5.i to i64
%arrayidx2.i44.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i43.i
%5 = load i64, ptr %arrayidx2.i44.i, align 16, !tbaa !17
%cmp10.i46.i = icmp sgt i64 %4, %5
%spec.select40.i = select i1 %cmp10.i46.i, i32 %add5.i, i32 %liMNo.0.i
br label %if.end12.i
if.end12.i: ; preds = %if.then7.i, %if.end3.i
%liMNo.1.i = phi i32 [ %liMNo.0.i, %if.end3.i ], [ %spec.select40.i, %if.then7.i ]
%cmp13.i = icmp eq i32 %liMNo.1.i, %div
br i1 %cmp13.i, label %cleanup, label %fHeapChk.exit
fHeapChk.exit: ; preds = %if.end12.i
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %lzWork.i)
%idxprom.i = sext i32 %liMNo.1.i to i64
%arrayidx.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i, i64 16, i1 false)
%idxprom18.i = sext i32 %div to i64
%arrayidx19.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom18.i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i, i64 16, i1 false)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i, ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i, i64 16, i1 false)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %lzWork.i)
%cmp21 = icmp slt i32 %liMNo.1.i, 0
br i1 %cmp21, label %cleanup, label %while.cond
cleanup: ; preds = %if.end12.i, %fHeapChk.exit, %if.end3, %if.else
ret i32 0
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @fHeapDequeue(ptr nocapture noundef writeonly %pzpRet) local_unnamed_addr #9 {
entry:
%lzWork.i = alloca %struct.Heap, align 8
%0 = load i32, ptr @siHCnt, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %pzpRet, ptr noundef nonnull align 16 dereferenceable(16) @sz1Heap, i64 16, i1 false)
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @siHCnt, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 1
br i1 %cmp1, label %return, label %if.end3
if.end3: ; preds = %if.end
%idxprom = zext i32 %dec to i64
%arrayidx = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @sz1Heap, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx, i64 16, i1 false)
br label %while.body
while.body: ; preds = %if.end3, %fHeapChk.exit
%liNo.06 = phi i32 [ 0, %if.end3 ], [ %liMNo.1.i, %fHeapChk.exit ]
%mul.i = shl nuw nsw i32 %liNo.06, 1
%add.i = or i32 %mul.i, 1
%cmp.i = icmp slt i32 %add.i, %dec
br i1 %cmp.i, label %if.then.i, label %if.end3.i
if.then.i: ; preds = %while.body
%idxprom.i.i = zext i32 %liNo.06 to i64
%arrayidx.i.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i.i
%1 = load i64, ptr %arrayidx.i.i, align 16, !tbaa !17
%idxprom1.i.i = zext i32 %add.i to i64
%arrayidx2.i.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i.i
%2 = load i64, ptr %arrayidx2.i.i, align 16, !tbaa !17
%cmp10.i.i = icmp sgt i64 %1, %2
%spec.select.i = select i1 %cmp10.i.i, i32 %add.i, i32 %liNo.06
br label %if.end3.i
if.end3.i: ; preds = %if.then.i, %while.body
%liMNo.0.i = phi i32 [ %liNo.06, %while.body ], [ %spec.select.i, %if.then.i ]
%add5.i = add nuw nsw i32 %mul.i, 2
%cmp6.i = icmp slt i32 %add5.i, %dec
br i1 %cmp6.i, label %if.then7.i, label %if.end12.i
if.then7.i: ; preds = %if.end3.i
%idxprom.i41.i = sext i32 %liMNo.0.i to i64
%arrayidx.i42.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i41.i
%3 = load i64, ptr %arrayidx.i42.i, align 16, !tbaa !17
%idxprom1.i43.i = zext i32 %add5.i to i64
%arrayidx2.i44.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i43.i
%4 = load i64, ptr %arrayidx2.i44.i, align 16, !tbaa !17
%cmp10.i46.i = icmp sgt i64 %3, %4
%spec.select40.i = select i1 %cmp10.i46.i, i32 %add5.i, i32 %liMNo.0.i
br label %if.end12.i
if.end12.i: ; preds = %if.then7.i, %if.end3.i
%liMNo.1.i = phi i32 [ %liMNo.0.i, %if.end3.i ], [ %spec.select40.i, %if.then7.i ]
%cmp13.i = icmp eq i32 %liMNo.1.i, %liNo.06
br i1 %cmp13.i, label %return, label %fHeapChk.exit
fHeapChk.exit: ; preds = %if.end12.i
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %lzWork.i)
%idxprom.i = sext i32 %liMNo.1.i to i64
%arrayidx.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i, i64 16, i1 false)
%idxprom18.i = zext i32 %liNo.06 to i64
%arrayidx19.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom18.i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i, i64 16, i1 false)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i, ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i, i64 16, i1 false)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %lzWork.i)
%cmp4 = icmp sgt i32 %liMNo.1.i, -1
br i1 %cmp4, label %while.body, label %return, !llvm.loop !23
return: ; preds = %if.end12.i, %fHeapChk.exit, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 0, %if.end ], [ 0, %fHeapChk.exit ], [ 0, %if.end12.i ]
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @fSetMin(i32 noundef %piVSNo, i32 noundef %piMoney) local_unnamed_addr #10 {
entry:
%lzWork.i.i139 = alloca %struct.Heap, align 8
%lzWork.i.i88 = alloca %struct.Heap, align 8
%lzWork.i.i56 = alloca %struct.Heap, align 8
%0 = load i32, ptr @siVCnt, align 4, !tbaa !5
%cmp213 = icmp sgt i32 %0, 0
br i1 %cmp213, label %for.cond1.preheader.preheader, label %for.end8
for.cond1.preheader.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %vector.ph
vector.ph: ; preds = %for.inc6, %for.cond1.preheader.preheader
%indvars.iv228 = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvars.iv.next229, %for.inc6 ]
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next.4, %vector.body ]
%1 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv228, i32 1, i64 %index
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %1, align 8, !tbaa !20
%2 = getelementptr inbounds i64, ptr %1, i64 2
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %2, align 8, !tbaa !20
%index.next = add nuw nsw i64 %index, 4
%3 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv228, i32 1, i64 %index.next
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %3, align 8, !tbaa !20
%4 = getelementptr inbounds i64, ptr %3, i64 2
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %4, align 8, !tbaa !20
%index.next.1 = add nuw nsw i64 %index, 8
%5 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv228, i32 1, i64 %index.next.1
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %5, align 8, !tbaa !20
%6 = getelementptr inbounds i64, ptr %5, i64 2
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %6, align 8, !tbaa !20
%index.next.2 = add nuw nsw i64 %index, 12
%7 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv228, i32 1, i64 %index.next.2
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %7, align 8, !tbaa !20
%8 = getelementptr inbounds i64, ptr %7, i64 2
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %8, align 8, !tbaa !20
%index.next.3 = add nuw nsw i64 %index, 16
%9 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv228, i32 1, i64 %index.next.3
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %9, align 8, !tbaa !20
%10 = getelementptr inbounds i64, ptr %9, i64 2
store <2 x i64> <i64 9223372036854775807, i64 9223372036854775807>, ptr %10, align 8, !tbaa !20
%index.next.4 = add nuw nsw i64 %index, 20
%11 = icmp eq i64 %index.next.4, 2500
br i1 %11, label %for.inc6, label %vector.body, !llvm.loop !25
for.inc6: ; preds = %vector.body
%indvars.iv.next229 = add nuw nsw i64 %indvars.iv228, 1
%exitcond231.not = icmp eq i64 %indvars.iv.next229, %wide.trip.count
br i1 %exitcond231.not, label %for.end8, label %vector.ph, !llvm.loop !28
for.end8: ; preds = %for.inc6, %entry
store i32 0, ptr @siHCnt, align 4, !tbaa !5
%cmp.i = icmp sgt i32 %piMoney, 2498
br i1 %cmp.i, label %if.end3.i, label %if.else.i
if.else.i: ; preds = %for.end8
%cmp1.i = icmp slt i32 %piMoney, 0
br i1 %cmp1.i, label %while.end44, label %if.end3.i
if.end3.i: ; preds = %if.else.i, %for.end8
%piMoney.addr.0.i = phi i32 [ %piMoney, %if.else.i ], [ 2499, %for.end8 ]
%idxprom.i = sext i32 %piVSNo to i64
%idxprom4.i = zext i32 %piMoney.addr.0.i to i64
%arrayidx5.i = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom.i, i32 1, i64 %idxprom4.i
%12 = load i64, ptr %arrayidx5.i, align 8, !tbaa !20
%cmp6.not.i = icmp sgt i64 %12, 0
br i1 %cmp6.not.i, label %if.end.i.preheader, label %while.end44
if.end.i.preheader: ; preds = %if.end3.i
store i64 0, ptr %arrayidx5.i, align 8, !tbaa !20
store i32 %piVSNo, ptr getelementptr inbounds ([250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 0, i32 1), align 8, !tbaa !21
store i32 %piMoney.addr.0.i, ptr getelementptr inbounds ([250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 0, i32 2), align 4, !tbaa !22
store i64 0, ptr @sz1Heap, align 16, !tbaa !17
br label %if.end.i
if.end.i: ; preds = %if.end.i.preheader, %cleanup
%siHCnt.promoted223226 = phi i32 [ %siHCnt.promoted224, %cleanup ], [ 1, %if.end.i.preheader ]
%lzHeap.sroa.0.0.copyload = load i64, ptr @sz1Heap, align 16
%lzHeap.sroa.6.0.copyload = load i32, ptr getelementptr inbounds ([250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 0, i32 1), align 8
%lzHeap.sroa.8.0.copyload = load i32, ptr getelementptr inbounds ([250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 0, i32 2), align 4
%dec.i = add nsw i32 %siHCnt.promoted223226, -1
store i32 %dec.i, ptr @siHCnt, align 4, !tbaa !5
%cmp1.i58 = icmp eq i32 %siHCnt.promoted223226, 1
br i1 %cmp1.i58, label %if.end, label %if.end3.i59
if.end3.i59: ; preds = %if.end.i
%idxprom.i60 = zext i32 %dec.i to i64
%arrayidx.i = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i60
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @sz1Heap, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i, i64 16, i1 false)
br label %while.body.i
while.body.i: ; preds = %fHeapChk.exit.i69, %if.end3.i59
%liNo.06.i = phi i32 [ 0, %if.end3.i59 ], [ %liMNo.1.i.i67, %fHeapChk.exit.i69 ]
%mul.i.i61 = shl nuw nsw i32 %liNo.06.i, 1
%add.i.i62 = or i32 %mul.i.i61, 1
%cmp.i.i = icmp slt i32 %add.i.i62, %dec.i
br i1 %cmp.i.i, label %if.then.i.i81, label %if.end3.i.i63
if.then.i.i81: ; preds = %while.body.i
%idxprom.i.i.i82 = zext i32 %liNo.06.i to i64
%arrayidx.i.i.i83 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i.i.i82
%13 = load i64, ptr %arrayidx.i.i.i83, align 16, !tbaa !17
%idxprom1.i.i.i84 = zext i32 %add.i.i62 to i64
%arrayidx2.i.i.i85 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i.i.i84
%14 = load i64, ptr %arrayidx2.i.i.i85, align 16, !tbaa !17
%cmp10.i.i.i86 = icmp sgt i64 %13, %14
%spec.select.i.i87 = select i1 %cmp10.i.i.i86, i32 %add.i.i62, i32 %liNo.06.i
br label %if.end3.i.i63
if.end3.i.i63: ; preds = %if.then.i.i81, %while.body.i
%liMNo.0.i.i64 = phi i32 [ %liNo.06.i, %while.body.i ], [ %spec.select.i.i87, %if.then.i.i81 ]
%add5.i.i65 = add nuw nsw i32 %mul.i.i61, 2
%cmp6.i.i = icmp slt i32 %add5.i.i65, %dec.i
br i1 %cmp6.i.i, label %if.then7.i.i74, label %if.end12.i.i66
if.then7.i.i74: ; preds = %if.end3.i.i63
%idxprom.i41.i.i75 = sext i32 %liMNo.0.i.i64 to i64
%arrayidx.i42.i.i76 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i41.i.i75
%15 = load i64, ptr %arrayidx.i42.i.i76, align 16, !tbaa !17
%idxprom1.i43.i.i77 = zext i32 %add5.i.i65 to i64
%arrayidx2.i44.i.i78 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i43.i.i77
%16 = load i64, ptr %arrayidx2.i44.i.i78, align 16, !tbaa !17
%cmp10.i46.i.i79 = icmp sgt i64 %15, %16
%spec.select40.i.i80 = select i1 %cmp10.i46.i.i79, i32 %add5.i.i65, i32 %liMNo.0.i.i64
br label %if.end12.i.i66
if.end12.i.i66: ; preds = %if.then7.i.i74, %if.end3.i.i63
%liMNo.1.i.i67 = phi i32 [ %liMNo.0.i.i64, %if.end3.i.i63 ], [ %spec.select40.i.i80, %if.then7.i.i74 ]
%cmp13.i.i68 = icmp eq i32 %liMNo.1.i.i67, %liNo.06.i
br i1 %cmp13.i.i68, label %if.end, label %fHeapChk.exit.i69
fHeapChk.exit.i69: ; preds = %if.end12.i.i66
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %lzWork.i.i56)
%idxprom.i.i70 = sext i32 %liMNo.1.i.i67 to i64
%arrayidx.i.i71 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i.i70
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i.i56, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i.i71, i64 16, i1 false)
%idxprom18.i.i72 = zext i32 %liNo.06.i to i64
%arrayidx19.i.i73 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom18.i.i72
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i.i71, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i.i73, i64 16, i1 false)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i.i73, ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i.i56, i64 16, i1 false)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %lzWork.i.i56)
%cmp4.i = icmp sgt i32 %liMNo.1.i.i67, -1
br i1 %cmp4.i, label %while.body.i, label %if.end, !llvm.loop !23
if.end: ; preds = %fHeapChk.exit.i69, %if.end12.i.i66, %if.end.i
%idxprom11 = sext i32 %lzHeap.sroa.6.0.copyload to i64
%idxprom14 = sext i32 %lzHeap.sroa.8.0.copyload to i64
%arrayidx15 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom11, i32 1, i64 %idxprom14
%17 = load i64, ptr %arrayidx15, align 8, !tbaa !20
%cmp16 = icmp sgt i64 %lzHeap.sroa.0.0.copyload, %17
br i1 %cmp16, label %cleanup, label %if.end18
if.end18: ; preds = %if.end
%arrayidx12 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom11
%lzpEdge.0217 = load ptr, ptr %arrayidx12, align 16, !tbaa !29
%cmp23.not218 = icmp eq ptr %lzpEdge.0217, null
br i1 %cmp23.not218, label %while.end, label %while.body24
while.body24: ; preds = %if.end18, %fHeapEnqueue.exit138
%lzpEdge.0220 = phi ptr [ %lzpEdge.0, %fHeapEnqueue.exit138 ], [ %lzpEdge.0217, %if.end18 ]
%inc.i103216219 = phi i32 [ %inc.i103215, %fHeapEnqueue.exit138 ], [ %dec.i, %if.end18 ]
%18 = load i32, ptr %lzpEdge.0220, align 8, !tbaa !9
%miMoney27 = getelementptr inbounds %struct.Edge, ptr %lzpEdge.0220, i64 0, i32 1
%19 = load i32, ptr %miMoney27, align 4, !tbaa !12
%sub = sub nsw i32 %lzHeap.sroa.8.0.copyload, %19
%miLen = getelementptr inbounds %struct.Edge, ptr %lzpEdge.0220, i64 0, i32 2
%20 = load i32, ptr %miLen, align 8, !tbaa !13
%conv = sext i32 %20 to i64
%add = add nsw i64 %lzHeap.sroa.0.0.copyload, %conv
%cmp.i89 = icmp sgt i32 %sub, 2498
br i1 %cmp.i89, label %if.end3.i92, label %if.else.i90
if.else.i90: ; preds = %while.body24
%cmp1.i91 = icmp slt i32 %sub, 0
br i1 %cmp1.i91, label %fHeapEnqueue.exit138, label %if.end3.i92
if.end3.i92: ; preds = %if.else.i90, %while.body24
%piMoney.addr.0.i93 = phi i32 [ %sub, %if.else.i90 ], [ 2499, %while.body24 ]
%idxprom.i94 = sext i32 %18 to i64
%idxprom4.i95 = zext i32 %piMoney.addr.0.i93 to i64
%arrayidx5.i96 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom.i94, i32 1, i64 %idxprom4.i95
%21 = load i64, ptr %arrayidx5.i96, align 8, !tbaa !20
%cmp6.not.i97 = icmp sgt i64 %21, %add
br i1 %cmp6.not.i97, label %if.end8.i98, label %fHeapEnqueue.exit138
if.end8.i98: ; preds = %if.end3.i92
store i64 %add, ptr %arrayidx5.i96, align 8, !tbaa !20
%idxprom14.i99 = sext i32 %inc.i103216219 to i64
%miVNo.i100 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14.i99, i32 1
store i32 %18, ptr %miVNo.i100, align 8, !tbaa !21
%miMoney.i101 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14.i99, i32 2
store i32 %piMoney.addr.0.i93, ptr %miMoney.i101, align 4, !tbaa !22
%arrayidx19.i102 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14.i99
store i64 %add, ptr %arrayidx19.i102, align 16, !tbaa !17
%inc.i103 = add nsw i32 %inc.i103216219, 1
store i32 %inc.i103, ptr @siHCnt, align 4, !tbaa !5
br label %while.cond.i104
while.cond.i104: ; preds = %fHeapChk.exit.i132, %if.end8.i98
%liNo.0.i105 = phi i32 [ %inc.i103216219, %if.end8.i98 ], [ %div.i107, %fHeapChk.exit.i132 ]
%sub20.i106 = add nsw i32 %liNo.0.i105, -1
%div.i107 = sdiv i32 %sub20.i106, 2
%mul.i.i108 = shl nsw i32 %div.i107, 1
%add.i.i109 = or i32 %mul.i.i108, 1
%cmp.i.not.i110 = icmp sgt i32 %add.i.i109, %inc.i103216219
br i1 %cmp.i.not.i110, label %if.end3.i.i118, label %if.then.i.i111
if.then.i.i111: ; preds = %while.cond.i104
%idxprom.i.i.i112 = sext i32 %div.i107 to i64
%arrayidx.i.i.i113 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i.i.i112
%22 = load i64, ptr %arrayidx.i.i.i113, align 16, !tbaa !17
%idxprom1.i.i.i114 = sext i32 %add.i.i109 to i64
%arrayidx2.i.i.i115 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i.i.i114
%23 = load i64, ptr %arrayidx2.i.i.i115, align 16, !tbaa !17
%cmp10.i.i.i116 = icmp sgt i64 %22, %23
%spec.select.i.i117 = select i1 %cmp10.i.i.i116, i32 %add.i.i109, i32 %div.i107
br label %if.end3.i.i118
if.end3.i.i118: ; preds = %if.then.i.i111, %while.cond.i104
%liMNo.0.i.i119 = phi i32 [ %div.i107, %while.cond.i104 ], [ %spec.select.i.i117, %if.then.i.i111 ]
%add5.i.i120 = add nsw i32 %mul.i.i108, 2
%cmp6.i.not.i121 = icmp sgt i32 %add5.i.i120, %inc.i103216219
br i1 %cmp6.i.not.i121, label %if.end12.i.i129, label %if.then7.i.i122
if.then7.i.i122: ; preds = %if.end3.i.i118
%idxprom.i41.i.i123 = sext i32 %liMNo.0.i.i119 to i64
%arrayidx.i42.i.i124 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i41.i.i123
%24 = load i64, ptr %arrayidx.i42.i.i124, align 16, !tbaa !17
%idxprom1.i43.i.i125 = sext i32 %add5.i.i120 to i64
%arrayidx2.i44.i.i126 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i43.i.i125
%25 = load i64, ptr %arrayidx2.i44.i.i126, align 16, !tbaa !17
%cmp10.i46.i.i127 = icmp sgt i64 %24, %25
%spec.select40.i.i128 = select i1 %cmp10.i46.i.i127, i32 %add5.i.i120, i32 %liMNo.0.i.i119
br label %if.end12.i.i129
if.end12.i.i129: ; preds = %if.then7.i.i122, %if.end3.i.i118
%liMNo.1.i.i130 = phi i32 [ %liMNo.0.i.i119, %if.end3.i.i118 ], [ %spec.select40.i.i128, %if.then7.i.i122 ]
%cmp13.i.i131 = icmp eq i32 %liMNo.1.i.i130, %div.i107
br i1 %cmp13.i.i131, label %fHeapEnqueue.exit138, label %fHeapChk.exit.i132
fHeapChk.exit.i132: ; preds = %if.end12.i.i129
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %lzWork.i.i88)
%idxprom.i.i133 = sext i32 %liMNo.1.i.i130 to i64
%arrayidx.i.i134 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i.i133
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i.i88, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i.i134, i64 16, i1 false)
%idxprom18.i.i135 = sext i32 %div.i107 to i64
%arrayidx19.i.i136 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom18.i.i135
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i.i134, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i.i136, i64 16, i1 false)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i.i136, ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i.i88, i64 16, i1 false)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %lzWork.i.i88)
%cmp21.i137 = icmp slt i32 %liMNo.1.i.i130, 0
br i1 %cmp21.i137, label %fHeapEnqueue.exit138, label %while.cond.i104
fHeapEnqueue.exit138: ; preds = %if.end12.i.i129, %fHeapChk.exit.i132, %if.else.i90, %if.end3.i92
%inc.i103215 = phi i32 [ %inc.i103216219, %if.else.i90 ], [ %inc.i103216219, %if.end3.i92 ], [ %inc.i103, %fHeapChk.exit.i132 ], [ %inc.i103, %if.end12.i.i129 ]
%mzpNext = getelementptr inbounds %struct.Edge, ptr %lzpEdge.0220, i64 0, i32 3
%lzpEdge.0 = load ptr, ptr %mzpNext, align 8, !tbaa !29
%cmp23.not = icmp eq ptr %lzpEdge.0, null
br i1 %cmp23.not, label %while.end, label %while.body24, !llvm.loop !30
while.end: ; preds = %fHeapEnqueue.exit138, %if.end18
%siHCnt.promoted222 = phi i32 [ %dec.i, %if.end18 ], [ %inc.i103215, %fHeapEnqueue.exit138 ]
%miMoney35 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom11, i32 2
%26 = load i32, ptr %miMoney35, align 8, !tbaa !31
%add36 = add nsw i32 %26, %lzHeap.sroa.8.0.copyload
%miTime = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom11, i32 3
%27 = load i32, ptr %miTime, align 4, !tbaa !32
%conv41 = sext i32 %27 to i64
%add42 = add nsw i64 %lzHeap.sroa.0.0.copyload, %conv41
%cmp.i140 = icmp sgt i32 %add36, 2498
br i1 %cmp.i140, label %if.end3.i143, label %if.else.i141
if.else.i141: ; preds = %while.end
%cmp1.i142 = icmp slt i32 %add36, 0
br i1 %cmp1.i142, label %cleanup, label %if.end3.i143
if.end3.i143: ; preds = %if.else.i141, %while.end
%piMoney.addr.0.i144 = phi i32 [ %add36, %if.else.i141 ], [ 2499, %while.end ]
%idxprom4.i146 = zext i32 %piMoney.addr.0.i144 to i64
%arrayidx5.i147 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom11, i32 1, i64 %idxprom4.i146
%28 = load i64, ptr %arrayidx5.i147, align 8, !tbaa !20
%cmp6.not.i148 = icmp sgt i64 %28, %add42
br i1 %cmp6.not.i148, label %if.end8.i149, label %cleanup
if.end8.i149: ; preds = %if.end3.i143
store i64 %add42, ptr %arrayidx5.i147, align 8, !tbaa !20
%idxprom14.i150 = sext i32 %siHCnt.promoted222 to i64
%miVNo.i151 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14.i150, i32 1
store i32 %lzHeap.sroa.6.0.copyload, ptr %miVNo.i151, align 8, !tbaa !21
%miMoney.i152 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14.i150, i32 2
store i32 %piMoney.addr.0.i144, ptr %miMoney.i152, align 4, !tbaa !22
%arrayidx19.i153 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom14.i150
store i64 %add42, ptr %arrayidx19.i153, align 16, !tbaa !17
%inc.i154 = add nsw i32 %siHCnt.promoted222, 1
store i32 %inc.i154, ptr @siHCnt, align 4, !tbaa !5
br label %while.cond.i155
while.cond.i155: ; preds = %fHeapChk.exit.i183, %if.end8.i149
%liNo.0.i156 = phi i32 [ %siHCnt.promoted222, %if.end8.i149 ], [ %div.i158, %fHeapChk.exit.i183 ]
%sub20.i157 = add nsw i32 %liNo.0.i156, -1
%div.i158 = sdiv i32 %sub20.i157, 2
%mul.i.i159 = shl nsw i32 %div.i158, 1
%add.i.i160 = or i32 %mul.i.i159, 1
%cmp.i.not.i161 = icmp sgt i32 %add.i.i160, %siHCnt.promoted222
br i1 %cmp.i.not.i161, label %if.end3.i.i169, label %if.then.i.i162
if.then.i.i162: ; preds = %while.cond.i155
%idxprom.i.i.i163 = sext i32 %div.i158 to i64
%arrayidx.i.i.i164 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i.i.i163
%29 = load i64, ptr %arrayidx.i.i.i164, align 16, !tbaa !17
%idxprom1.i.i.i165 = sext i32 %add.i.i160 to i64
%arrayidx2.i.i.i166 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i.i.i165
%30 = load i64, ptr %arrayidx2.i.i.i166, align 16, !tbaa !17
%cmp10.i.i.i167 = icmp sgt i64 %29, %30
%spec.select.i.i168 = select i1 %cmp10.i.i.i167, i32 %add.i.i160, i32 %div.i158
br label %if.end3.i.i169
if.end3.i.i169: ; preds = %if.then.i.i162, %while.cond.i155
%liMNo.0.i.i170 = phi i32 [ %div.i158, %while.cond.i155 ], [ %spec.select.i.i168, %if.then.i.i162 ]
%add5.i.i171 = add nsw i32 %mul.i.i159, 2
%cmp6.i.not.i172 = icmp sgt i32 %add5.i.i171, %siHCnt.promoted222
br i1 %cmp6.i.not.i172, label %if.end12.i.i180, label %if.then7.i.i173
if.then7.i.i173: ; preds = %if.end3.i.i169
%idxprom.i41.i.i174 = sext i32 %liMNo.0.i.i170 to i64
%arrayidx.i42.i.i175 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i41.i.i174
%31 = load i64, ptr %arrayidx.i42.i.i175, align 16, !tbaa !17
%idxprom1.i43.i.i176 = sext i32 %add5.i.i171 to i64
%arrayidx2.i44.i.i177 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom1.i43.i.i176
%32 = load i64, ptr %arrayidx2.i44.i.i177, align 16, !tbaa !17
%cmp10.i46.i.i178 = icmp sgt i64 %31, %32
%spec.select40.i.i179 = select i1 %cmp10.i46.i.i178, i32 %add5.i.i171, i32 %liMNo.0.i.i170
br label %if.end12.i.i180
if.end12.i.i180: ; preds = %if.then7.i.i173, %if.end3.i.i169
%liMNo.1.i.i181 = phi i32 [ %liMNo.0.i.i170, %if.end3.i.i169 ], [ %spec.select40.i.i179, %if.then7.i.i173 ]
%cmp13.i.i182 = icmp eq i32 %liMNo.1.i.i181, %div.i158
br i1 %cmp13.i.i182, label %cleanup, label %fHeapChk.exit.i183
fHeapChk.exit.i183: ; preds = %if.end12.i.i180
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %lzWork.i.i139)
%idxprom.i.i184 = sext i32 %liMNo.1.i.i181 to i64
%arrayidx.i.i185 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom.i.i184
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i.i139, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i.i185, i64 16, i1 false)
%idxprom18.i.i186 = sext i32 %div.i158 to i64
%arrayidx19.i.i187 = getelementptr inbounds [250000 x %struct.Heap], ptr @sz1Heap, i64 0, i64 %idxprom18.i.i186
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i.i185, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i.i187, i64 16, i1 false)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx19.i.i187, ptr noundef nonnull align 8 dereferenceable(16) %lzWork.i.i139, i64 16, i1 false)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %lzWork.i.i139)
%cmp21.i188 = icmp slt i32 %liMNo.1.i.i181, 0
br i1 %cmp21.i188, label %cleanup, label %while.cond.i155
cleanup: ; preds = %fHeapChk.exit.i183, %if.end12.i.i180, %if.end3.i143, %if.else.i141, %if.end
%siHCnt.promoted224 = phi i32 [ %siHCnt.promoted222, %if.end3.i143 ], [ %siHCnt.promoted222, %if.else.i141 ], [ %dec.i, %if.end ], [ %inc.i154, %if.end12.i.i180 ], [ %inc.i154, %fHeapChk.exit.i183 ]
%cmp.i57 = icmp slt i32 %siHCnt.promoted224, 1
br i1 %cmp.i57, label %while.end44, label %if.end.i
while.end44: ; preds = %cleanup, %if.end3.i, %if.else.i
ret i32 0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fMain() local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
%liECnt = alloca i32, align 4
%liSCnt = alloca i32, align 4
%liVNo1 = alloca i32, align 4
%liVNo2 = alloca i32, align 4
%liMoney = alloca i32, align 4
%liLen = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #13
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1000800) @sz1Vtx, i8 0, i64 1000800, i1 false)
store i32 0, ptr @siECnt, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liECnt) #13
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liSCnt) #13
%0 = load ptr, ptr @szpFpI, align 8, !tbaa !29
%call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull @siVCnt, ptr noundef nonnull %liECnt, ptr noundef nonnull %liSCnt) #13
%1 = load i32, ptr %liECnt, align 4, !tbaa !5
%cmp63 = icmp sgt i32 %1, 0
br i1 %cmp63, label %for.body, label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.body, %entry
%2 = load i32, ptr @siVCnt, align 4, !tbaa !5
%cmp1165 = icmp sgt i32 %2, 0
br i1 %cmp1165, label %for.body12, label %for.end21
for.body: ; preds = %entry, %for.body
%i.064 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liVNo1) #13
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liVNo2) #13
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liMoney) #13
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liLen) #13
%3 = load ptr, ptr @szpFpI, align 8, !tbaa !29
%call4 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %3)
%call6 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.2, ptr noundef nonnull %liVNo1, ptr noundef nonnull %liVNo2, ptr noundef nonnull %liMoney, ptr noundef nonnull %liLen) #13
%4 = load i32, ptr %liVNo1, align 4, !tbaa !5
%dec = add nsw i32 %4, -1
%5 = load i32, ptr %liVNo2, align 4, !tbaa !5
%dec7 = add nsw i32 %5, -1
%6 = load i32, ptr %liMoney, align 4, !tbaa !5
%7 = load i32, ptr %liLen, align 4, !tbaa !5
%8 = load i32, ptr @siECnt, align 4, !tbaa !5
%idxprom.i = sext i32 %8 to i64
%arrayidx.i = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom.i
store i32 %dec7, ptr %arrayidx.i, align 8, !tbaa !9
%miMoney.i = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom.i, i32 1
store i32 %6, ptr %miMoney.i, align 4, !tbaa !12
%miLen.i = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom.i, i32 2
store i32 %7, ptr %miLen.i, align 8, !tbaa !13
%idxprom5.i = sext i32 %dec to i64
%arrayidx6.i = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom5.i
%9 = load ptr, ptr %arrayidx6.i, align 16, !tbaa !14
%mzpNext.i = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom.i, i32 3
store ptr %9, ptr %mzpNext.i, align 8, !tbaa !16
store ptr %arrayidx.i, ptr %arrayidx6.i, align 16, !tbaa !14
%inc.i = add nsw i32 %8, 1
%idxprom.i55 = sext i32 %inc.i to i64
%arrayidx.i56 = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom.i55
store i32 %dec, ptr %arrayidx.i56, align 8, !tbaa !9
%miMoney.i57 = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom.i55, i32 1
store i32 %6, ptr %miMoney.i57, align 4, !tbaa !12
%miLen.i58 = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom.i55, i32 2
store i32 %7, ptr %miLen.i58, align 8, !tbaa !13
%idxprom5.i59 = sext i32 %dec7 to i64
%arrayidx6.i60 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom5.i59
%10 = load ptr, ptr %arrayidx6.i60, align 16, !tbaa !14
%mzpNext.i61 = getelementptr inbounds [200 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %idxprom.i55, i32 3
store ptr %10, ptr %mzpNext.i61, align 8, !tbaa !16
store ptr %arrayidx.i56, ptr %arrayidx6.i60, align 16, !tbaa !14
%inc.i62 = add nsw i32 %8, 2
store i32 %inc.i62, ptr @siECnt, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liLen) #13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liMoney) #13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liVNo2) #13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liVNo1) #13
%inc = add nuw nsw i32 %i.064, 1
%11 = load i32, ptr %liECnt, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %11
br i1 %cmp, label %for.body, label %for.cond10.preheader, !llvm.loop !33
for.body12: ; preds = %for.cond10.preheader, %for.body12
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body12 ], [ 0, %for.cond10.preheader ]
%12 = load ptr, ptr @szpFpI, align 8, !tbaa !29
%call14 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %12)
%miMoney = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv, i32 2
%miTime = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv, i32 3
%call18 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.3, ptr noundef nonnull %miMoney, ptr noundef nonnull %miTime) #13
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = load i32, ptr @siVCnt, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp11 = icmp slt i64 %indvars.iv.next, %14
br i1 %cmp11, label %for.body12, label %for.end21, !llvm.loop !34
for.end21: ; preds = %for.body12, %for.cond10.preheader
%15 = load i32, ptr %liSCnt, align 4, !tbaa !5
%call22 = call i32 @fSetMin(i32 noundef 0, i32 noundef %15)
%16 = load i32, ptr @siVCnt, align 4, !tbaa !5
%cmp2469 = icmp sgt i32 %16, 1
br i1 %cmp2469, label %vector.ph, label %for.end43
vector.ph: ; preds = %for.end21, %middle.block
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %middle.block ], [ 1, %for.end21 ]
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 9223372036854775807, i64 9223372036854775807>, %vector.ph ], [ %19, %vector.body ]
%vec.phi78 = phi <2 x i64> [ <i64 9223372036854775807, i64 9223372036854775807>, %vector.ph ], [ %20, %vector.body ]
%17 = getelementptr inbounds [50 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv75, i32 1, i64 %index
%wide.load = load <2 x i64>, ptr %17, align 8, !tbaa !20
%18 = getelementptr inbounds i64, ptr %17, i64 2
%wide.load79 = load <2 x i64>, ptr %18, align 8, !tbaa !20
%19 = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%20 = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi78, <2 x i64> %wide.load79)
%index.next = add nuw i64 %index, 4
%21 = icmp eq i64 %index.next, 2500
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !35
middle.block: ; preds = %vector.body
%rdx.minmax = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %19, <2 x i64> %20)
%22 = call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%call38 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %22) #13
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf)
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%23 = load i32, ptr @siVCnt, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp24 = icmp slt i64 %indvars.iv.next76, %24
br i1 %cmp24, label %vector.ph, label %for.end43, !llvm.loop !36
for.end43: ; preds = %middle.block, %for.end21
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liSCnt) #13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liECnt) #13
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #13
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #11
; 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 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOne() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !29
store ptr %0, ptr @szpFpI, align 8, !tbaa !29
%call = tail call i32 @fMain()
ret i32 0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !29
store ptr %0, ptr @szpFpI, align 8, !tbaa !29
%call.i = tail call i32 @fMain()
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #12
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #13 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"Edge", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 4}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !11, i64 0}
!15 = !{!"Vtx", !11, i64 0, !7, i64 8, !6, i64 20008, !6, i64 20012}
!16 = !{!10, !11, i64 16}
!17 = !{!18, !19, i64 0}
!18 = !{!"Heap", !19, i64 0, !6, i64 8, !6, i64 12}
!19 = !{!"long long", !7, i64 0}
!20 = !{!19, !19, i64 0}
!21 = !{!18, !6, i64 8}
!22 = !{!18, !6, i64 12}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24, !26, !27}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = distinct !{!28, !24}
!29 = !{!11, !11, i64 0}
!30 = distinct !{!30, !24}
!31 = !{!15, !6, i64 20008}
!32 = !{!15, !6, i64 20012}
!33 = distinct !{!33, !24}
!34 = distinct !{!34, !24}
!35 = distinct !{!35, !24, !26, !27}
!36 = distinct !{!36, !24}
|
#include <stdio.h>
#include <string.h>
int main(void){
char nums[10][8];
strcpy(nums[0], "0111111");
strcpy(nums[1], "0000110");
strcpy(nums[2], "1011011");
strcpy(nums[3], "1001111");
strcpy(nums[4], "1100110");
strcpy(nums[5], "1101101");
strcpy(nums[6], "1111101");
strcpy(nums[7], "0100111");
strcpy(nums[8], "1111111");
strcpy(nums[9], "1101111");
while(1){
int n, i, j, a;
char ans[8];
char now[8] = "0000000";
scanf(" %d", &n);
if(n==-1) break;
for(i=0; i<n; i++){
scanf(" %d", &a);
for(j=0; j<7; j++){
if(now[j] == nums[a][j]) printf("0");
else printf("1");
}
strcpy(now, nums[a]);
printf("\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179781/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179781/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.10 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%nums = alloca [10 x [8 x i8]], align 16
%n = alloca i32, align 4
%a = alloca i32, align 4
%now = alloca [8 x i8], align 8
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %nums) #5
store i64 13846361207288112, ptr %nums, align 16
%arrayidx1 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 1
store i64 13564886213734448, ptr %arrayidx1, align 8
%arrayidx4 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 2
store i64 13846356912320561, ptr %arrayidx4, align 16
%arrayidx7 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 3
store i64 13846361207222321, ptr %arrayidx7, align 8
%arrayidx10 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 4
store i64 13564886213734705, ptr %arrayidx10, align 16
%arrayidx13 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 5
store i64 13845261695594801, ptr %arrayidx13, align 8
%arrayidx16 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 6
store i64 13845261695660337, ptr %arrayidx16, align 16
%arrayidx19 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 7
store i64 13846361190445360, ptr %arrayidx19, align 8
%arrayidx22 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 8
store i64 13846361207288113, ptr %arrayidx22, align 16
%arrayidx25 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 9
store i64 13846361207222577, ptr %arrayidx25, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %now) #5
store i64 13563782407139376, ptr %now, align 8
%call2872 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.10, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp73 = icmp eq i32 %0, -1
br i1 %cmp73, label %while.end, label %for.cond.preheader.preheader
for.cond.preheader.preheader: ; preds = %entry
%arrayidx34.1 = getelementptr inbounds [8 x i8], ptr %now, i64 0, i64 1
%arrayidx34.2 = getelementptr inbounds [8 x i8], ptr %now, i64 0, i64 2
%arrayidx34.3 = getelementptr inbounds [8 x i8], ptr %now, i64 0, i64 3
%arrayidx34.4 = getelementptr inbounds [8 x i8], ptr %now, i64 0, i64 4
%arrayidx34.5 = getelementptr inbounds [8 x i8], ptr %now, i64 0, i64 5
%arrayidx34.6 = getelementptr inbounds [8 x i8], ptr %now, i64 0, i64 6
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.preheader, %cleanup
%1 = phi i32 [ %0, %for.cond.preheader.preheader ], [ %25, %cleanup ]
%cmp2970 = icmp sgt i32 %1, 0
br i1 %cmp2970, label %for.body, label %cleanup
for.body: ; preds = %for.cond.preheader, %for.body
%i.071 = phi i32 [ %inc53, %for.body ], [ 0, %for.cond.preheader ]
%call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.10, ptr noundef nonnull %a)
%2 = load i8, ptr %now, align 8, !tbaa !9
%3 = load i32, ptr %a, align 4, !tbaa !5
%idxprom35 = sext i32 %3 to i64
%arrayidx38 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 %idxprom35, i64 0
%4 = load i8, ptr %arrayidx38, align 8, !tbaa !9
%cmp40 = icmp eq i8 %2, %4
%. = select i1 %cmp40, i32 48, i32 49
%putchar66 = call i32 @putchar(i32 %.)
%5 = load i8, ptr %arrayidx34.1, align 1, !tbaa !9
%6 = load i32, ptr %a, align 4, !tbaa !5
%idxprom35.1 = sext i32 %6 to i64
%arrayidx38.1 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 %idxprom35.1, i64 1
%7 = load i8, ptr %arrayidx38.1, align 1, !tbaa !9
%cmp40.1 = icmp eq i8 %5, %7
%.sink75 = select i1 %cmp40.1, i32 48, i32 49
%putchar66.1 = call i32 @putchar(i32 %.sink75)
%8 = load i8, ptr %arrayidx34.2, align 2, !tbaa !9
%9 = load i32, ptr %a, align 4, !tbaa !5
%idxprom35.2 = sext i32 %9 to i64
%arrayidx38.2 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 %idxprom35.2, i64 2
%10 = load i8, ptr %arrayidx38.2, align 2, !tbaa !9
%cmp40.2 = icmp eq i8 %8, %10
%.sink76 = select i1 %cmp40.2, i32 48, i32 49
%putchar66.2 = call i32 @putchar(i32 %.sink76)
%11 = load i8, ptr %arrayidx34.3, align 1, !tbaa !9
%12 = load i32, ptr %a, align 4, !tbaa !5
%idxprom35.3 = sext i32 %12 to i64
%arrayidx38.3 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 %idxprom35.3, i64 3
%13 = load i8, ptr %arrayidx38.3, align 1, !tbaa !9
%cmp40.3 = icmp eq i8 %11, %13
%.sink77 = select i1 %cmp40.3, i32 48, i32 49
%putchar66.3 = call i32 @putchar(i32 %.sink77)
%14 = load i8, ptr %arrayidx34.4, align 4, !tbaa !9
%15 = load i32, ptr %a, align 4, !tbaa !5
%idxprom35.4 = sext i32 %15 to i64
%arrayidx38.4 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 %idxprom35.4, i64 4
%16 = load i8, ptr %arrayidx38.4, align 4, !tbaa !9
%cmp40.4 = icmp eq i8 %14, %16
%.sink78 = select i1 %cmp40.4, i32 48, i32 49
%putchar66.4 = call i32 @putchar(i32 %.sink78)
%17 = load i8, ptr %arrayidx34.5, align 1, !tbaa !9
%18 = load i32, ptr %a, align 4, !tbaa !5
%idxprom35.5 = sext i32 %18 to i64
%arrayidx38.5 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 %idxprom35.5, i64 5
%19 = load i8, ptr %arrayidx38.5, align 1, !tbaa !9
%cmp40.5 = icmp eq i8 %17, %19
%.sink79 = select i1 %cmp40.5, i32 48, i32 49
%putchar66.5 = call i32 @putchar(i32 %.sink79)
%20 = load i8, ptr %arrayidx34.6, align 2, !tbaa !9
%21 = load i32, ptr %a, align 4, !tbaa !5
%idxprom35.6 = sext i32 %21 to i64
%arrayidx38.6 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 %idxprom35.6, i64 6
%22 = load i8, ptr %arrayidx38.6, align 2, !tbaa !9
%cmp40.6 = icmp eq i8 %20, %22
%.sink80 = select i1 %cmp40.6, i32 48, i32 49
%putchar66.6 = call i32 @putchar(i32 %.sink80)
%23 = load i32, ptr %a, align 4, !tbaa !5
%idxprom47 = sext i32 %23 to i64
%arrayidx48 = getelementptr inbounds [10 x [8 x i8]], ptr %nums, i64 0, i64 %idxprom47
%call50 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %now, ptr noundef nonnull dereferenceable(1) %arrayidx48) #5
%putchar = call i32 @putchar(i32 10)
%inc53 = add nuw nsw i32 %i.071, 1
%24 = load i32, ptr %n, align 4, !tbaa !5
%cmp29 = icmp slt i32 %inc53, %24
br i1 %cmp29, label %for.body, label %cleanup, !llvm.loop !10
cleanup: ; preds = %for.body, %for.cond.preheader
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %now) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %now) #5
store i64 13563782407139376, ptr %now, align 8
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.10, ptr noundef nonnull %n)
%25 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %25, -1
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %now) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %nums) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
//set many funcs
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define inf 1145141919
#define llinf 1145141919810364364
#define mod 1000000007
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int main(void){
int a,b,c,d,e,f,s[4096]={0},i,j,k,ms,ma,na;
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
ms=0;ma=100*a;
for(i=0;i<=f;i+=c){
for(j=0;(i+j)<=f;j+=d){
s[i+j]=1;
}
}
for(i=0;i<=f;i+=(100*a)){
for(j=0;(i+j)<=f;j+=(100*b)){
if(i+j==0){continue;}
for(k=1;(i+j+k)<=f;k++){
if(s[k]==0){continue;}
na=i+j+k;
if(ms*na<ma*k && k*(100+e)<=na*e){ms=k;ma=na;}
}
}
}
printf("%d %d\n",ma,ms);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179831/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179831/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i32 %a, %b
%sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true)
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%mul = shl nsw i32 %rem, 1
%cmp.not = icmp sge i32 %mul, %b
%div1 = sdiv i32 %a, %b
%add = zext i1 %cmp.not to i32
%retval.0 = add nsw i32 %div1, %add
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %a, %b
%add = zext i1 %cmp to i32
%retval.0 = add nsw i32 %div, %add
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i32 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i32 %b, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %a, %a.addr.0.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i32 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %a, 1
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i32 %add, %i.07
%mul = mul nsw i32 %r.08, %sub
%div = sdiv i32 %mul, %i.07
%inc = add nuw i32 %i.07, 1
%sub.1 = sub i32 %add, %inc
%mul.1 = mul nsw i32 %div, %sub.1
%div.1 = sdiv i32 %mul.1, %inc
%inc.1 = add nuw i32 %i.07, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i32 %add, %i.07.unr
%mul.epil = mul nsw i32 %r.08.unr, %sub.epil
%div.epil = sdiv i32 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i32 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %a, 8
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %a, -8
%ind.end = or i32 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = mul <4 x i32> %vec.phi, %vec.ind
%1 = mul <4 x i32> %vec.phi7, %step.add
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %a
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ]
%mul = mul nsw i32 %r.06, %i.05
%inc = add nuw i32 %i.05, 1
%exitcond.not = icmp eq i32 %i.05, %a
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i32 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %b, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%0 = mul <4 x i32> %vec.phi, %broadcast.splat
%1 = mul <4 x i32> %vec.phi6, %broadcast.splat
%index.next = add nuw i32 %index, 8
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %b
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%mul = mul nsw i32 %r.05, %a
%inc = add nuw i32 %i.04, 1
%exitcond.not = icmp eq i32 %i.04, %b
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%mul = shl nsw i64 %rem, 1
%cmp.not = icmp sge i64 %mul, %b
%div1 = sdiv i64 %a, %b
%add = zext i1 %cmp.not to i64
%retval.0 = add nsw i64 %div1, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %b
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i64 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i64 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i64 %a.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i64 %b, 0
br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i64 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !14
llgcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i64 %a, %a.addr.0.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i64 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %a, 1
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i64 %add, %i.07
%mul = mul nsw i64 %r.08, %sub
%div = sdiv i64 %mul, %i.07
%inc = add nuw i64 %i.07, 1
%sub.1 = sub i64 %add, %inc
%mul.1 = mul nsw i64 %div, %sub.1
%div.1 = sdiv i64 %mul.1, %inc
%inc.1 = add nuw i64 %i.07, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !15
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i64 %add, %i.07.unr
%mul.epil = mul nsw i64 %r.08.unr, %sub.epil
%div.epil = sdiv i64 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i64 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 7
%0 = icmp ult i64 %a, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %a, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.06, %i.05
%inc = add nuw nsw i64 %i.05, 1
%mul.1 = mul nsw i64 %mul, %inc
%inc.1 = add nuw nsw i64 %i.05, 2
%mul.2 = mul nsw i64 %mul.1, %inc.1
%inc.2 = add nuw nsw i64 %i.05, 3
%mul.3 = mul nsw i64 %mul.2, %inc.2
%inc.3 = add nuw nsw i64 %i.05, 4
%mul.4 = mul nsw i64 %mul.3, %inc.3
%inc.4 = add nuw nsw i64 %i.05, 5
%mul.5 = mul nsw i64 %mul.4, %inc.4
%inc.5 = add nuw nsw i64 %i.05, 6
%mul.6 = mul nsw i64 %mul.5, %inc.5
%inc.6 = add nuw i64 %i.05, 7
%mul.7 = mul nsw i64 %mul.6, %inc.6
%inc.7 = add nuw i64 %i.05, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !16
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ]
%i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.06.epil, %i.05.epil
%inc.epil = add nuw i64 %i.05.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !17
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i64 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.05, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !19
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.05.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !20
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !21
%1 = load i32, ptr %b, align 4, !tbaa !21
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !21
%1 = load i32, ptr %b, align 4, !tbaa !21
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !25
%1 = load i64, ptr %b, align 8, !tbaa !25
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !25
%1 = load i64, ptr %b, align 8, !tbaa !25
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !27
%1 = load double, ptr %b, align 8, !tbaa !27
%cmp = fcmp ogt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !27
%1 = load double, ptr %b, align 8, !tbaa !27
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%f = alloca i32, align 4
%s = alloca [4096 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #9
call void @llvm.lifetime.start.p0(i64 16384, ptr nonnull %s) #9
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16384) %s, i8 0, i64 16384, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %f)
%0 = load i32, ptr %a, align 4, !tbaa !21
%mul = mul nsw i32 %0, 100
%1 = load i32, ptr %f, align 4, !tbaa !21
%cmp.not79 = icmp slt i32 %1, 0
br i1 %cmp.not79, label %for.end48, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%2 = load i32, ptr %d, align 4, !tbaa !21
%3 = load i32, ptr %c, align 4, !tbaa !21
%4 = sext i32 %2 to i64
%5 = zext i32 %1 to i64
%6 = sext i32 %3 to i64
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc6
%indvars.iv101 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next102, %for.inc6 ]
br label %for.body3
for.cond9.preheader: ; preds = %for.inc6
br i1 %cmp.not79, label %for.end48, label %for.cond12.preheader.lr.ph
for.cond12.preheader.lr.ph: ; preds = %for.cond9.preheader
%7 = load i32, ptr %e, align 4
%add33 = add nsw i32 %7, 100
%8 = load i32, ptr %b, align 4, !tbaa !21
%mul42 = mul nsw i32 %8, 100
br label %for.cond12.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ]
%add78.in = phi i64 [ %indvars.iv101, %for.cond1.preheader ], [ %9, %for.body3 ]
%sext = shl i64 %add78.in, 32
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds [4096 x i32], ptr %s, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !21
%indvars.iv.next = add i64 %indvars.iv, %4
%9 = add nsw i64 %indvars.iv.next, %indvars.iv101
%cmp2.not = icmp sgt i64 %9, %5
br i1 %cmp2.not, label %for.inc6, label %for.body3, !llvm.loop !29
for.inc6: ; preds = %for.body3
%indvars.iv.next102 = add nsw i64 %indvars.iv101, %6
%cmp.not = icmp sgt i64 %indvars.iv.next102, %5
br i1 %cmp.not, label %for.cond9.preheader, label %for.cond1.preheader, !llvm.loop !30
for.cond12.preheader: ; preds = %for.cond12.preheader.lr.ph, %for.inc45
%i.196 = phi i32 [ 0, %for.cond12.preheader.lr.ph ], [ %add47, %for.inc45 ]
%ma.095 = phi i32 [ %mul, %for.cond12.preheader.lr.ph ], [ %ma.4, %for.inc45 ]
%ms.094 = phi i32 [ 0, %for.cond12.preheader.lr.ph ], [ %ms.4, %for.inc45 ]
br label %for.body15
for.body15: ; preds = %for.cond12.preheader, %for.inc41
%add1392 = phi i32 [ %i.196, %for.cond12.preheader ], [ %add13, %for.inc41 ]
%ma.191 = phi i32 [ %ma.095, %for.cond12.preheader ], [ %ma.4, %for.inc41 ]
%ms.190 = phi i32 [ %ms.094, %for.cond12.preheader ], [ %ms.4, %for.inc41 ]
%j.189 = phi i32 [ 0, %for.cond12.preheader ], [ %add43, %for.inc41 ]
%cmp17 = icmp eq i32 %add1392, 0
%cmp21.not82 = icmp sge i32 %add1392, %1
%or.cond = or i1 %cmp17, %cmp21.not82
br i1 %or.cond, label %for.inc41, label %for.body22.preheader
for.body22.preheader: ; preds = %for.body15
%add2081 = add nuw nsw i32 %add1392, 1
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.inc39
%indvars.iv104 = phi i64 [ 1, %for.body22.preheader ], [ %indvars.iv.next105, %for.inc39 ]
%add2086 = phi i32 [ %add2081, %for.body22.preheader ], [ %add20, %for.inc39 ]
%ma.285 = phi i32 [ %ma.191, %for.body22.preheader ], [ %ma.3, %for.inc39 ]
%ms.284 = phi i32 [ %ms.190, %for.body22.preheader ], [ %ms.3, %for.inc39 ]
%arrayidx24 = getelementptr inbounds [4096 x i32], ptr %s, i64 0, i64 %indvars.iv104
%10 = load i32, ptr %arrayidx24, align 4, !tbaa !21
%cmp25 = icmp eq i32 %10, 0
br i1 %cmp25, label %for.inc39, label %if.end27
if.end27: ; preds = %for.body22
%mul30 = mul nsw i32 %ms.284, %add2086
%11 = trunc i64 %indvars.iv104 to i32
%mul31 = mul nsw i32 %ma.285, %11
%cmp32 = icmp slt i32 %mul30, %mul31
br i1 %cmp32, label %land.lhs.true, label %for.inc39
land.lhs.true: ; preds = %if.end27
%mul34 = mul nsw i32 %add33, %11
%mul35 = mul nsw i32 %7, %add2086
%cmp36.not = icmp sgt i32 %mul34, %mul35
%spec.select = select i1 %cmp36.not, i32 %ms.284, i32 %11
%spec.select76 = select i1 %cmp36.not, i32 %ma.285, i32 %add2086
br label %for.inc39
for.inc39: ; preds = %land.lhs.true, %if.end27, %for.body22
%ms.3 = phi i32 [ %ms.284, %for.body22 ], [ %ms.284, %if.end27 ], [ %spec.select, %land.lhs.true ]
%ma.3 = phi i32 [ %ma.285, %for.body22 ], [ %ma.285, %if.end27 ], [ %spec.select76, %land.lhs.true ]
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
%12 = trunc i64 %indvars.iv.next105 to i32
%add20 = add nsw i32 %add1392, %12
%cmp21.not = icmp sgt i32 %add20, %1
br i1 %cmp21.not, label %for.inc41, label %for.body22, !llvm.loop !31
for.inc41: ; preds = %for.inc39, %for.body15
%ms.4 = phi i32 [ %ms.190, %for.body15 ], [ %ms.3, %for.inc39 ]
%ma.4 = phi i32 [ %ma.191, %for.body15 ], [ %ma.3, %for.inc39 ]
%add43 = add nsw i32 %mul42, %j.189
%add13 = add nsw i32 %add43, %i.196
%cmp14.not = icmp sgt i32 %add13, %1
br i1 %cmp14.not, label %for.inc45, label %for.body15, !llvm.loop !32
for.inc45: ; preds = %for.inc41
%add47 = add nsw i32 %i.196, %mul
%cmp10.not = icmp sgt i32 %add47, %1
br i1 %cmp10.not, label %for.end48, label %for.cond12.preheader, !llvm.loop !33
for.end48: ; preds = %for.inc45, %entry, %for.cond9.preheader
%ms.0.lcssa = phi i32 [ 0, %for.cond9.preheader ], [ 0, %entry ], [ %ms.4, %for.inc45 ]
%ma.0.lcssa = phi i32 [ %mul, %for.cond9.preheader ], [ %mul, %entry ], [ %ma.4, %for.inc45 ]
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ma.0.lcssa, i32 noundef %ms.0.lcssa)
call void @llvm.lifetime.end.p0(i64 16384, ptr nonnull %s) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
; 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #8
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6, !9, !10}
!9 = !{!"llvm.loop.isvectorized", i32 1}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = distinct !{!11, !6, !10, !9}
!12 = distinct !{!12, !6, !9, !10}
!13 = distinct !{!13, !6, !10, !9}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !6}
!20 = distinct !{!20, !18}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !23, i64 0}
!23 = !{!"omnipotent char", !24, i64 0}
!24 = !{!"Simple C/C++ TBAA"}
!25 = !{!26, !26, i64 0}
!26 = !{!"long long", !23, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"double", !23, i64 0}
!29 = distinct !{!29, !6}
!30 = distinct !{!30, !6}
!31 = distinct !{!31, !6}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
|
#include <stdio.h>
#include <stdlib.h>
typedef struct {
long long key;
int id;
} data;
void merge_sort(data x[], int n)
{
static data y[200002] = {};
if (n <= 1) return;
merge_sort(&(x[0]), n/2);
merge_sort(&(x[n/2]), (n+1)/2);
int i, p, q;
for (i = 0, p = 0, q = n/2; i < n; i++) {
if (p >= n/2) y[i] = x[q++];
else if (q >= n) y[i] = x[p++];
else y[i] = (x[p].key < x[q].key)? x[p++]: x[q++];
}
for (i = 0; i < n; i++) x[i] = y[i];
}
void add_BIT(int BIT[], int n, int i, int k)
{
while (i <= n) {
BIT[i] += k;
i += (i & -i);
}
}
int sum_BIT(int BIT[], int r)
{
int sum = 0;
while (r > 0) {
sum += BIT[r];
r -= (r & -r);
}
return sum;
}
int main()
{
int i, Q, q[200001];
long long a[200001], b[200001];
scanf("%d", &Q);
for (i = 1; i <= Q; i++) {
scanf("%d", &(q[i]));
if (q[i] == 1) scanf("%lld %lld", &(a[i]), &(b[i]));
else a[i] = 1 << 30;
}
int p[200001];
data d[200002];
for (i = 1; i <= Q; i++) {
d[i].key = a[i];
d[i].id = i;
}
merge_sort(&(d[1]), Q);
for (i = 1; i <= Q; i++) p[d[i].id] = i;
int k, l, r, m, BIT[200001] = {}, argmin = p[1];
long long min = b[1];
add_BIT(BIT, Q, p[1], 1);
for (i = 2, k = 1; i <= Q; i++) {
if (q[i] == 2) {
printf("%d %lld\n", d[argmin].key, min);
continue;
}
k++;
add_BIT(BIT, Q, p[i], 1);
if (p[i] == argmin) {
min += b[i];
continue;
}
l = argmin;
r = argmin;
if (p[i] < argmin) l = 0;
else r = Q - 1;
while (l < r) {
m = (l + r) / 2;
if (sum_BIT(BIT, m) <= (k - 1) / 2) l = m + 1;
else r = m;
}
if (l >= argmin) min += llabs(d[l].key - a[i]) + b[i];
else min += llabs(d[argmin].key - d[l].key) + llabs(d[l].key - a[i]) + b[i];
argmin = l;
}
fflush(stdout);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179875/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179875/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.data = type { i64, i32 }
@merge_sort.y = internal unnamed_addr global [200002 x %struct.data] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%d %lld\0A\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge_sort(ptr noundef %x, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %n, 2
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%div78 = lshr i32 %n, 1
tail call void @merge_sort(ptr noundef %x, i32 noundef %div78)
%idxprom = zext i32 %div78 to i64
%arrayidx2 = getelementptr inbounds %struct.data, ptr %x, i64 %idxprom
%add = add nuw nsw i32 %n, 1
%div37980 = lshr i32 %add, 1
tail call void @merge_sort(ptr noundef %arrayidx2, i32 noundef %div37980)
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond38.preheader: ; preds = %for.inc
%cmp3984 = icmp sgt i32 %n, 0
br i1 %cmp3984, label %for.body40.preheader, label %return
for.body40.preheader: ; preds = %for.cond38.preheader
%0 = shl nuw nsw i64 %wide.trip.count, 4
tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %x, ptr nonnull align 16 @merge_sort.y, i64 %0, i1 false)
br label %return
for.body: ; preds = %if.end, %for.inc
%indvars.iv = phi i64 [ 0, %if.end ], [ %indvars.iv.next, %for.inc ]
%q.083 = phi i32 [ %div78, %if.end ], [ %q.1, %for.inc ]
%p.082 = phi i32 [ 0, %if.end ], [ %p.1, %for.inc ]
%cmp7.not = icmp slt i32 %p.082, %div78
br i1 %cmp7.not, label %if.else, label %if.then8
if.then8: ; preds = %for.body
%arrayidx10 = getelementptr inbounds [200002 x %struct.data], ptr @merge_sort.y, i64 0, i64 %indvars.iv
%inc = add nsw i32 %q.083, 1
%idxprom11 = sext i32 %q.083 to i64
%arrayidx12 = getelementptr inbounds %struct.data, ptr %x, i64 %idxprom11
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx10, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx12, i64 16, i1 false), !tbaa.struct !5
br label %for.inc
if.else: ; preds = %for.body
%cmp13.not = icmp slt i32 %q.083, %n
%arrayidx22 = getelementptr inbounds [200002 x %struct.data], ptr @merge_sort.y, i64 0, i64 %indvars.iv
br i1 %cmp13.not, label %if.else20, label %if.then14
if.then14: ; preds = %if.else
%inc17 = add nsw i32 %p.082, 1
%idxprom18 = sext i32 %p.082 to i64
%arrayidx19 = getelementptr inbounds %struct.data, ptr %x, i64 %idxprom18
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx22, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx19, i64 16, i1 false), !tbaa.struct !5
br label %for.inc
if.else20: ; preds = %if.else
%idxprom23 = sext i32 %p.082 to i64
%arrayidx24 = getelementptr inbounds %struct.data, ptr %x, i64 %idxprom23
%1 = load i64, ptr %arrayidx24, align 8, !tbaa !12
%idxprom25 = sext i32 %q.083 to i64
%arrayidx26 = getelementptr inbounds %struct.data, ptr %x, i64 %idxprom25
%2 = load i64, ptr %arrayidx26, align 8, !tbaa !12
%cmp28 = icmp slt i64 %1, %2
br i1 %cmp28, label %cond.true, label %cond.false
cond.true: ; preds = %if.else20
%inc29 = add nsw i32 %p.082, 1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx22, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx24, i64 16, i1 false), !tbaa.struct !5
br label %for.inc
cond.false: ; preds = %if.else20
%inc32 = add nsw i32 %q.083, 1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx22, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx26, i64 16, i1 false), !tbaa.struct !5
br label %for.inc
for.inc: ; preds = %if.then8, %cond.true, %cond.false, %if.then14
%p.1 = phi i32 [ %p.082, %if.then8 ], [ %inc17, %if.then14 ], [ %inc29, %cond.true ], [ %p.082, %cond.false ]
%q.1 = phi i32 [ %inc, %if.then8 ], [ %q.083, %if.then14 ], [ %q.083, %cond.true ], [ %inc32, %cond.false ]
%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.cond38.preheader, label %for.body, !llvm.loop !14
return: ; preds = %for.body40.preheader, %for.cond38.preheader, %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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @add_BIT(ptr nocapture noundef %BIT, i32 noundef %n, i32 noundef %i, i32 noundef %k) local_unnamed_addr #3 {
entry:
%cmp.not6 = icmp sgt i32 %i, %n
br i1 %cmp.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%i.addr.07 = phi i32 [ %add1, %while.body ], [ %i, %entry ]
%idxprom = sext i32 %i.addr.07 to i64
%arrayidx = getelementptr inbounds i32, ptr %BIT, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !10
%add = add nsw i32 %0, %k
store i32 %add, ptr %arrayidx, align 4, !tbaa !10
%sub = sub nsw i32 0, %i.addr.07
%and = and i32 %i.addr.07, %sub
%add1 = add nsw i32 %and, %i.addr.07
%cmp.not = icmp sgt i32 %add1, %n
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %while.body, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @sum_BIT(ptr nocapture noundef readonly %BIT, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp7 = icmp sgt i32 %r, 0
br i1 %cmp7, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%sum.09 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%r.addr.08 = phi i32 [ %sub1, %while.body ], [ %r, %entry ]
%idxprom = zext i32 %r.addr.08 to i64
%arrayidx = getelementptr inbounds i32, ptr %BIT, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !10
%add = add nsw i32 %0, %sum.09
%sub.not = add nsw i32 %r.addr.08, -1
%sub1 = and i32 %sub.not, %r.addr.08
%cmp.not = icmp eq i32 %sub1, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !17
while.end: ; preds = %while.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %sum.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%Q = alloca i32, align 4
%q = alloca [200001 x i32], align 16
%a = alloca [200001 x i64], align 16
%b = alloca [200001 x i64], align 16
%p = alloca [200001 x i32], align 16
%d = alloca [200002 x %struct.data], align 16
%BIT = alloca [200001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Q) #9
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %q) #9
call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %a) #9
call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %b) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Q)
%0 = load i32, ptr %Q, align 4, !tbaa !10
%cmp.not180 = icmp slt i32 %0, 1
br i1 %cmp.not180, label %for.end.thread, label %for.body
for.end.thread: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %p) #9
call void @llvm.lifetime.start.p0(i64 3200032, ptr nonnull %d) #9
br label %for.end23
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [200001 x i32], ptr %q, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !10
%cmp4 = icmp eq i32 %1, 1
%arrayidx6 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %indvars.iv
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %for.body
%arrayidx8 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 %indvars.iv
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx8)
br label %for.inc
if.else: ; preds = %for.body
store i64 1073741824, ptr %arrayidx6, align 8, !tbaa !6
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %Q, align 4, !tbaa !10
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !18
for.end: ; preds = %for.inc
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %p) #9
call void @llvm.lifetime.start.p0(i64 3200032, ptr nonnull %d) #9
%cmp13.not182 = icmp slt i32 %2, 1
br i1 %cmp13.not182, label %for.end23, label %for.body14.preheader
for.body14.preheader: ; preds = %for.end
%4 = zext i32 %2 to i64
%xtraiter = and i64 %4, 1
%5 = icmp eq i32 %2, 1
br i1 %5, label %for.end23.loopexit.unr-lcssa, label %for.body14.preheader.new
for.body14.preheader.new: ; preds = %for.body14.preheader
%unroll_iter = and i64 %4, 4294967294
br label %for.body14
for.body14: ; preds = %for.body14, %for.body14.preheader.new
%indvars.iv197 = phi i64 [ 1, %for.body14.preheader.new ], [ %indvars.iv.next198.1, %for.body14 ]
%niter = phi i64 [ 0, %for.body14.preheader.new ], [ %niter.next.1, %for.body14 ]
%arrayidx16 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %indvars.iv197
%6 = load i64, ptr %arrayidx16, align 8, !tbaa !6
%arrayidx18 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv197
store i64 %6, ptr %arrayidx18, align 16, !tbaa !12
%id = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv197, i32 1
%7 = trunc i64 %indvars.iv197 to i32
store i32 %7, ptr %id, align 8, !tbaa !19
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%arrayidx16.1 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %indvars.iv.next198
%8 = load i64, ptr %arrayidx16.1, align 8, !tbaa !6
%arrayidx18.1 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv.next198
store i64 %8, ptr %arrayidx18.1, align 16, !tbaa !12
%id.1 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv.next198, i32 1
%9 = trunc i64 %indvars.iv.next198 to i32
store i32 %9, ptr %id.1, align 8, !tbaa !19
%indvars.iv.next198.1 = add nuw nsw i64 %indvars.iv197, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end23.loopexit.unr-lcssa, label %for.body14, !llvm.loop !20
for.end23.loopexit.unr-lcssa: ; preds = %for.body14, %for.body14.preheader
%indvars.iv197.unr = phi i64 [ 1, %for.body14.preheader ], [ %indvars.iv.next198.1, %for.body14 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end23, label %for.body14.epil
for.body14.epil: ; preds = %for.end23.loopexit.unr-lcssa
%arrayidx16.epil = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %indvars.iv197.unr
%10 = load i64, ptr %arrayidx16.epil, align 8, !tbaa !6
%arrayidx18.epil = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv197.unr
store i64 %10, ptr %arrayidx18.epil, align 16, !tbaa !12
%id.epil = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv197.unr, i32 1
%11 = trunc i64 %indvars.iv197.unr to i32
store i32 %11, ptr %id.epil, align 8, !tbaa !19
br label %for.end23
for.end23: ; preds = %for.body14.epil, %for.end23.loopexit.unr-lcssa, %for.end.thread, %for.end
%.lcssa179211 = phi i32 [ %0, %for.end.thread ], [ %2, %for.end ], [ %2, %for.end23.loopexit.unr-lcssa ], [ %2, %for.body14.epil ]
%arrayidx24 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 1
call void @merge_sort(ptr noundef nonnull %arrayidx24, i32 noundef %.lcssa179211)
%12 = load i32, ptr %Q, align 4
%cmp26.not184 = icmp slt i32 %12, 1
br i1 %cmp26.not184, label %for.end35.thread, label %for.body27.preheader
for.end35.thread: ; preds = %for.end23
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %BIT) #9
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) %BIT, i8 0, i64 800004, i1 false)
%arrayidx37212 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 1
%13 = load i64, ptr %arrayidx37212, align 8, !tbaa !6
br label %while.body.i.preheader
for.body27.preheader: ; preds = %for.end23
%14 = add nuw i32 %12, 1
%wide.trip.count203 = zext i32 %14 to i64
%15 = add nsw i64 %wide.trip.count203, -1
%16 = add nsw i64 %wide.trip.count203, -2
%xtraiter214 = and i64 %15, 3
%17 = icmp ult i64 %16, 3
br i1 %17, label %for.end35.unr-lcssa, label %for.body27.preheader.new
for.body27.preheader.new: ; preds = %for.body27.preheader
%unroll_iter216 = and i64 %15, -4
br label %for.body27
for.body27: ; preds = %for.body27, %for.body27.preheader.new
%indvars.iv200 = phi i64 [ 1, %for.body27.preheader.new ], [ %indvars.iv.next201.3, %for.body27 ]
%niter217 = phi i64 [ 0, %for.body27.preheader.new ], [ %niter217.next.3, %for.body27 ]
%id30 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv200, i32 1
%18 = load i32, ptr %id30, align 8, !tbaa !19
%idxprom31 = sext i32 %18 to i64
%arrayidx32 = getelementptr inbounds [200001 x i32], ptr %p, i64 0, i64 %idxprom31
%19 = trunc i64 %indvars.iv200 to i32
store i32 %19, ptr %arrayidx32, align 4, !tbaa !10
%indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
%id30.1 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv.next201, i32 1
%20 = load i32, ptr %id30.1, align 8, !tbaa !19
%idxprom31.1 = sext i32 %20 to i64
%arrayidx32.1 = getelementptr inbounds [200001 x i32], ptr %p, i64 0, i64 %idxprom31.1
%21 = trunc i64 %indvars.iv.next201 to i32
store i32 %21, ptr %arrayidx32.1, align 4, !tbaa !10
%indvars.iv.next201.1 = add nuw nsw i64 %indvars.iv200, 2
%id30.2 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv.next201.1, i32 1
%22 = load i32, ptr %id30.2, align 8, !tbaa !19
%idxprom31.2 = sext i32 %22 to i64
%arrayidx32.2 = getelementptr inbounds [200001 x i32], ptr %p, i64 0, i64 %idxprom31.2
%23 = trunc i64 %indvars.iv.next201.1 to i32
store i32 %23, ptr %arrayidx32.2, align 4, !tbaa !10
%indvars.iv.next201.2 = add nuw nsw i64 %indvars.iv200, 3
%id30.3 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv.next201.2, i32 1
%24 = load i32, ptr %id30.3, align 8, !tbaa !19
%idxprom31.3 = sext i32 %24 to i64
%arrayidx32.3 = getelementptr inbounds [200001 x i32], ptr %p, i64 0, i64 %idxprom31.3
%25 = trunc i64 %indvars.iv.next201.2 to i32
store i32 %25, ptr %arrayidx32.3, align 4, !tbaa !10
%indvars.iv.next201.3 = add nuw nsw i64 %indvars.iv200, 4
%niter217.next.3 = add i64 %niter217, 4
%niter217.ncmp.3 = icmp eq i64 %niter217.next.3, %unroll_iter216
br i1 %niter217.ncmp.3, label %for.end35.unr-lcssa, label %for.body27, !llvm.loop !21
for.end35.unr-lcssa: ; preds = %for.body27, %for.body27.preheader
%indvars.iv200.unr = phi i64 [ 1, %for.body27.preheader ], [ %indvars.iv.next201.3, %for.body27 ]
%lcmp.mod215.not = icmp eq i64 %xtraiter214, 0
br i1 %lcmp.mod215.not, label %for.end35, label %for.body27.epil
for.body27.epil: ; preds = %for.end35.unr-lcssa, %for.body27.epil
%indvars.iv200.epil = phi i64 [ %indvars.iv.next201.epil, %for.body27.epil ], [ %indvars.iv200.unr, %for.end35.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body27.epil ], [ 0, %for.end35.unr-lcssa ]
%id30.epil = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %indvars.iv200.epil, i32 1
%26 = load i32, ptr %id30.epil, align 8, !tbaa !19
%idxprom31.epil = sext i32 %26 to i64
%arrayidx32.epil = getelementptr inbounds [200001 x i32], ptr %p, i64 0, i64 %idxprom31.epil
%27 = trunc i64 %indvars.iv200.epil to i32
store i32 %27, ptr %arrayidx32.epil, align 4, !tbaa !10
%indvars.iv.next201.epil = add nuw nsw i64 %indvars.iv200.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter214
br i1 %epil.iter.cmp.not, label %for.end35, label %for.body27.epil, !llvm.loop !22
for.end35: ; preds = %for.body27.epil, %for.end35.unr-lcssa
%arrayidx36.phi.trans.insert = getelementptr inbounds [200001 x i32], ptr %p, i64 0, i64 1
%.pre = load i32, ptr %arrayidx36.phi.trans.insert, align 4, !tbaa !10
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %BIT) #9
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) %BIT, i8 0, i64 800004, i1 false)
%arrayidx37 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 1
%28 = load i64, ptr %arrayidx37, align 8, !tbaa !6
%cmp.not6.i = icmp sgt i32 %.pre, %12
br i1 %cmp.not6.i, label %add_BIT.exit, label %while.body.i.preheader
while.body.i.preheader: ; preds = %for.end35.thread, %for.end35
%29 = phi i64 [ %13, %for.end35.thread ], [ %28, %for.end35 ]
%30 = phi i32 [ undef, %for.end35.thread ], [ %.pre, %for.end35 ]
br label %while.body.i
while.body.i: ; preds = %while.body.i.preheader, %while.body.i
%i.addr.07.i = phi i32 [ %add1.i, %while.body.i ], [ %30, %while.body.i.preheader ]
%idxprom.i = sext i32 %i.addr.07.i to i64
%arrayidx.i = getelementptr inbounds i32, ptr %BIT, i64 %idxprom.i
%31 = load i32, ptr %arrayidx.i, align 4, !tbaa !10
%add.i = add nsw i32 %31, 1
store i32 %add.i, ptr %arrayidx.i, align 4, !tbaa !10
%sub.i = sub nsw i32 0, %i.addr.07.i
%and.i = and i32 %i.addr.07.i, %sub.i
%add1.i = add nsw i32 %and.i, %i.addr.07.i
%cmp.not.i = icmp sgt i32 %add1.i, %12
br i1 %cmp.not.i, label %add_BIT.exit, label %while.body.i, !llvm.loop !16
add_BIT.exit: ; preds = %while.body.i, %for.end35
%32 = phi i64 [ %28, %for.end35 ], [ %29, %while.body.i ]
%33 = phi i32 [ %.pre, %for.end35 ], [ %30, %while.body.i ]
%cmp40.not191 = icmp slt i32 %12, 2
br i1 %cmp40.not191, label %for.end113, label %for.body41
for.body41: ; preds = %add_BIT.exit, %for.inc111
%34 = phi i32 [ %51, %for.inc111 ], [ %12, %add_BIT.exit ]
%indvars.iv205 = phi i64 [ %indvars.iv.next206, %for.inc111 ], [ 2, %add_BIT.exit ]
%min.0195 = phi i64 [ %min.2, %for.inc111 ], [ %32, %add_BIT.exit ]
%argmin.0194 = phi i32 [ %argmin.1, %for.inc111 ], [ %33, %add_BIT.exit ]
%k.0192 = phi i32 [ %k.1, %for.inc111 ], [ 1, %add_BIT.exit ]
%arrayidx43 = getelementptr inbounds [200001 x i32], ptr %q, i64 0, i64 %indvars.iv205
%35 = load i32, ptr %arrayidx43, align 4, !tbaa !10
%cmp44 = icmp eq i32 %35, 2
br i1 %cmp44, label %if.then45, label %if.end50
if.then45: ; preds = %for.body41
%idxprom46 = sext i32 %argmin.0194 to i64
%arrayidx47 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %idxprom46
%36 = load i64, ptr %arrayidx47, align 16, !tbaa !12
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %36, i64 noundef %min.0195)
%.pre208 = load i32, ptr %Q, align 4
br label %for.inc111
if.end50: ; preds = %for.body41
%inc51 = add nsw i32 %k.0192, 1
%arrayidx54 = getelementptr inbounds [200001 x i32], ptr %p, i64 0, i64 %indvars.iv205
%37 = load i32, ptr %arrayidx54, align 4, !tbaa !10
%cmp.not6.i163 = icmp sgt i32 %37, %34
br i1 %cmp.not6.i163, label %add_BIT.exit173, label %while.body.i164
while.body.i164: ; preds = %if.end50, %while.body.i164
%i.addr.07.i165 = phi i32 [ %add1.i171, %while.body.i164 ], [ %37, %if.end50 ]
%idxprom.i166 = sext i32 %i.addr.07.i165 to i64
%arrayidx.i167 = getelementptr inbounds i32, ptr %BIT, i64 %idxprom.i166
%38 = load i32, ptr %arrayidx.i167, align 4, !tbaa !10
%add.i168 = add nsw i32 %38, 1
store i32 %add.i168, ptr %arrayidx.i167, align 4, !tbaa !10
%sub.i169 = sub nsw i32 0, %i.addr.07.i165
%and.i170 = and i32 %i.addr.07.i165, %sub.i169
%add1.i171 = add nsw i32 %and.i170, %i.addr.07.i165
%cmp.not.i172 = icmp sgt i32 %add1.i171, %34
br i1 %cmp.not.i172, label %add_BIT.exit173, label %while.body.i164, !llvm.loop !16
add_BIT.exit173: ; preds = %while.body.i164, %if.end50
%cmp57 = icmp eq i32 %37, %argmin.0194
br i1 %cmp57, label %if.then58, label %if.end61
if.then58: ; preds = %add_BIT.exit173
%arrayidx60 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 %indvars.iv205
%39 = load i64, ptr %arrayidx60, align 8, !tbaa !6
%add = add nsw i64 %39, %min.0195
br label %for.inc111
if.end61: ; preds = %add_BIT.exit173
%cmp64 = icmp slt i32 %37, %argmin.0194
%sub = add nsw i32 %34, -1
%l.0 = select i1 %cmp64, i32 0, i32 %argmin.0194
%r.0 = select i1 %cmp64, i32 %argmin.0194, i32 %sub
%cmp68187 = icmp slt i32 %l.0, %r.0
br i1 %cmp68187, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %if.end61
%div73 = sdiv i32 %k.0192, 2
br label %while.body
while.body: ; preds = %while.body.lr.ph, %sum_BIT.exit
%r.1189 = phi i32 [ %r.0, %while.body.lr.ph ], [ %r.2, %sum_BIT.exit ]
%l.1188 = phi i32 [ %l.0, %while.body.lr.ph ], [ %l.2, %sum_BIT.exit ]
%add69 = add nsw i32 %r.1189, %l.1188
%div = sdiv i32 %add69, 2
%cmp7.i = icmp sgt i32 %add69, 1
br i1 %cmp7.i, label %while.body.i174, label %sum_BIT.exit
while.body.i174: ; preds = %while.body, %while.body.i174
%sum.09.i = phi i32 [ %add.i177, %while.body.i174 ], [ 0, %while.body ]
%r.addr.08.i = phi i32 [ %sub1.i, %while.body.i174 ], [ %div, %while.body ]
%idxprom.i175 = zext i32 %r.addr.08.i to i64
%arrayidx.i176 = getelementptr inbounds i32, ptr %BIT, i64 %idxprom.i175
%40 = load i32, ptr %arrayidx.i176, align 4, !tbaa !10
%add.i177 = add nsw i32 %40, %sum.09.i
%sub.not.i = add nsw i32 %r.addr.08.i, -1
%sub1.i = and i32 %sub.not.i, %r.addr.08.i
%cmp.not.i178 = icmp eq i32 %sub1.i, 0
br i1 %cmp.not.i178, label %sum_BIT.exit, label %while.body.i174, !llvm.loop !17
sum_BIT.exit: ; preds = %while.body.i174, %while.body
%sum.0.lcssa.i = phi i32 [ 0, %while.body ], [ %add.i177, %while.body.i174 ]
%cmp74.not = icmp sgt i32 %sum.0.lcssa.i, %div73
%add76 = add nsw i32 %div, 1
%l.2 = select i1 %cmp74.not, i32 %l.1188, i32 %add76
%r.2 = select i1 %cmp74.not, i32 %div, i32 %r.1189
%cmp68 = icmp slt i32 %l.2, %r.2
br i1 %cmp68, label %while.body, label %while.end, !llvm.loop !24
while.end: ; preds = %sum_BIT.exit, %if.end61
%l.1.lcssa = phi i32 [ %l.0, %if.end61 ], [ %l.2, %sum_BIT.exit ]
%cmp79.not = icmp slt i32 %l.1.lcssa, %argmin.0194
br i1 %cmp79.not, label %if.else91, label %if.then80
if.then80: ; preds = %while.end
%idxprom81 = sext i32 %l.1.lcssa to i64
%arrayidx82 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %idxprom81
%41 = load i64, ptr %arrayidx82, align 16, !tbaa !12
%arrayidx85 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %indvars.iv205
%42 = load i64, ptr %arrayidx85, align 8, !tbaa !6
%sub86 = sub nsw i64 %41, %42
%43 = call i64 @llvm.abs.i64(i64 %sub86, i1 true)
%arrayidx88 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 %indvars.iv205
%44 = load i64, ptr %arrayidx88, align 8, !tbaa !6
%add89 = add nsw i64 %43, %44
br label %if.end110
if.else91: ; preds = %while.end
%idxprom92 = sext i32 %argmin.0194 to i64
%arrayidx93 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %idxprom92
%45 = load i64, ptr %arrayidx93, align 16, !tbaa !12
%idxprom95 = sext i32 %l.1.lcssa to i64
%arrayidx96 = getelementptr inbounds [200002 x %struct.data], ptr %d, i64 0, i64 %idxprom95
%46 = load i64, ptr %arrayidx96, align 16, !tbaa !12
%sub98 = sub nsw i64 %45, %46
%47 = call i64 @llvm.abs.i64(i64 %sub98, i1 true)
%arrayidx103 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %indvars.iv205
%48 = load i64, ptr %arrayidx103, align 8, !tbaa !6
%sub104 = sub nsw i64 %46, %48
%49 = call i64 @llvm.abs.i64(i64 %sub104, i1 true)
%arrayidx107 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 %indvars.iv205
%50 = load i64, ptr %arrayidx107, align 8, !tbaa !6
%add105 = add i64 %50, %47
%add108 = add i64 %add105, %49
br label %if.end110
if.end110: ; preds = %if.else91, %if.then80
%add89.pn = phi i64 [ %add89, %if.then80 ], [ %add108, %if.else91 ]
%min.1 = add nsw i64 %add89.pn, %min.0195
br label %for.inc111
for.inc111: ; preds = %if.end110, %if.then58, %if.then45
%51 = phi i32 [ %.pre208, %if.then45 ], [ %34, %if.then58 ], [ %34, %if.end110 ]
%k.1 = phi i32 [ %k.0192, %if.then45 ], [ %inc51, %if.then58 ], [ %inc51, %if.end110 ]
%argmin.1 = phi i32 [ %argmin.0194, %if.then45 ], [ %argmin.0194, %if.then58 ], [ %l.1.lcssa, %if.end110 ]
%min.2 = phi i64 [ %min.0195, %if.then45 ], [ %add, %if.then58 ], [ %min.1, %if.end110 ]
%indvars.iv.next206 = add nuw nsw i64 %indvars.iv205, 1
%52 = sext i32 %51 to i64
%cmp40.not.not = icmp slt i64 %indvars.iv205, %52
br i1 %cmp40.not.not, label %for.body41, label %for.end113, !llvm.loop !25
for.end113: ; preds = %for.inc111, %add_BIT.exit
%53 = load ptr, ptr @stdout, align 8, !tbaa !26
%call114 = call i32 @fflush(ptr noundef %53)
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %BIT) #9
call void @llvm.lifetime.end.p0(i64 3200032, ptr nonnull %d) #9
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %p) #9
call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %b) #9
call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %a) #9
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %q) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #8
; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #6
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{i64 0, i64 8, !6, i64 8, i64 4, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"", !7, i64 0, !11, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = !{!13, !11, i64 8}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
!26 = !{!27, !27, i64 0}
!27 = !{!"any pointer", !8, i64 0}
|
#include<stdio.h>
int main(){
int a;
scanf("%d", &a);
printf("%d\n", (a/2)*(a/2+a%2));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179918/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179918/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%div = sdiv i32 %0, 2
%rem = srem i32 %0, 2
%add = add nsw i32 %div, %rem
%mul = mul nsw i32 %add, %div
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
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/2)*((a+1)/2));
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179961/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179961/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%div = sdiv i32 %0, 2
%add = add nsw i32 %0, 1
%div1 = sdiv i32 %add, 2
%mul = mul nsw i32 %div1, %div
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul)
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 k;
scanf("%d", &k);
printf("%d\n", (k-k/2)*(k/2));
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180002/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180002/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%div = sdiv i32 %0, 2
%sub = sub nsw i32 %0, %div
%mul = mul nsw i32 %sub, %div
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int n, ans;
scanf("%d", &n);
ans = n*n/4;
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180046/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180046/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #3
%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, %0
%div2 = lshr i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div2)
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 x,c=0,b=0,i;
scanf("%d",&x);
for(i=1;i<=x;i++)
{
if(i%2==0)
c++;
else
b++;
}
printf("%d\n",c*b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180097/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180097/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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.not9 = icmp slt i32 %0, 1
br i1 %cmp.not9, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader20, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %0, -8
%ind.end = or i32 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi15 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi16 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi17 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%1 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%2 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%3 = xor <4 x i32> %1, <i32 1, i32 1, i32 1, i32 1>
%4 = xor <4 x i32> %2, <i32 1, i32 1, i32 1, i32 1>
%5 = add <4 x i32> %3, %vec.phi16
%6 = add <4 x i32> %4, %vec.phi17
%7 = add <4 x i32> %1, %vec.phi
%8 = add <4 x i32> %2, %vec.phi15
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%9 = icmp eq i32 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx18 = add <4 x i32> %6, %5
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx18)
%bin.rdx = add <4 x i32> %8, %7
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %0, %n.vec
br i1 %cmp.n, label %for.end.loopexit, label %for.body.preheader20
for.body.preheader20: ; preds = %for.body.preheader, %middle.block
%i.012.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
%b.011.ph = phi i32 [ 0, %for.body.preheader ], [ %11, %middle.block ]
%c.010.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader20, %for.body
%i.012 = phi i32 [ %inc3, %for.body ], [ %i.012.ph, %for.body.preheader20 ]
%b.011 = phi i32 [ %b.1, %for.body ], [ %b.011.ph, %for.body.preheader20 ]
%c.010 = phi i32 [ %c.1, %for.body ], [ %c.010.ph, %for.body.preheader20 ]
%rem = and i32 %i.012, 1
%12 = xor i32 %rem, 1
%c.1 = add i32 %12, %c.010
%b.1 = add i32 %rem, %b.011
%inc3 = add nuw i32 %i.012, 1
%exitcond.not = icmp eq i32 %i.012, %0
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !13
for.end.loopexit: ; preds = %for.body, %middle.block
%c.1.lcssa = phi i32 [ %10, %middle.block ], [ %c.1, %for.body ]
%b.1.lcssa = phi i32 [ %11, %middle.block ], [ %b.1, %for.body ]
%13 = mul nsw i32 %b.1.lcssa, %c.1.lcssa
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%mul = phi i32 [ 0, %entry ], [ %13, %for.end.loopexit ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include<stdio.h>
int main()
{
int k;
scanf("%d", &k);
printf("%d\n", (k / 2)*((k + 1) / 2));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180147/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180147/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%div = sdiv i32 %0, 2
%add = add nsw i32 %0, 1
%div1 = sdiv i32 %add, 2
%mul = mul nsw i32 %div1, %div
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 K,sum=0;
scanf("%d",&K);
for(int i=K;i>=1;i--){
sum+=i/2;
}
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180190/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180190/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %0, -8
%ind.end = and i32 %0, 7
%.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add <4 x i32> %.splat, <i32 0, i32 -1, i32 -2, i32 -3>
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 -4, i32 -4, i32 -4, i32 -4>
%1 = lshr <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%2 = lshr <4 x i32> %step.add, <i32 1, i32 1, i32 1, i32 1>
%3 = add <4 x i32> %1, %vec.phi
%4 = add <4 x i32> %2, %vec.phi10
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 -8, i32 -8, i32 -8, i32 -8>
%5 = icmp eq i32 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %4, %3
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %0, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %for.body.1, %for.body.2, %for.body.3, %for.body.4, %for.body.5, %for.body.6, %middle.block, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %6, %middle.block ], [ %add, %for.body ], [ %add.1, %for.body.1 ], [ %add.2, %for.body.2 ], [ %add.3, %for.body.3 ], [ %add.4, %for.body.4 ], [ %add.5, %for.body.5 ], [ %add.6, %for.body.6 ]
%call1 = 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
for.body: ; preds = %middle.block, %for.body.preheader
%i.08.ph = phi i32 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ]
%sum.07.ph = phi i32 [ 0, %for.body.preheader ], [ %6, %middle.block ]
%div5 = lshr i32 %i.08.ph, 1
%add = add nuw nsw i32 %div5, %sum.07.ph
%cmp = icmp ugt i32 %i.08.ph, 1
br i1 %cmp, label %for.body.1, label %for.cond.cleanup, !llvm.loop !13
for.body.1: ; preds = %for.body
%dec = add nsw i32 %i.08.ph, -1
%div5.1 = lshr i32 %dec, 1
%add.1 = add nuw nsw i32 %div5.1, %add
%cmp.1 = icmp ugt i32 %dec, 1
br i1 %cmp.1, label %for.body.2, label %for.cond.cleanup, !llvm.loop !13
for.body.2: ; preds = %for.body.1
%dec.1 = add nsw i32 %i.08.ph, -2
%div5.2 = lshr i32 %dec.1, 1
%add.2 = add nuw nsw i32 %div5.2, %add.1
%cmp.2 = icmp ugt i32 %dec.1, 1
br i1 %cmp.2, label %for.body.3, label %for.cond.cleanup, !llvm.loop !13
for.body.3: ; preds = %for.body.2
%dec.2 = add nsw i32 %i.08.ph, -3
%div5.3 = lshr i32 %dec.2, 1
%add.3 = add nuw nsw i32 %div5.3, %add.2
%cmp.3 = icmp ugt i32 %dec.2, 1
br i1 %cmp.3, label %for.body.4, label %for.cond.cleanup, !llvm.loop !13
for.body.4: ; preds = %for.body.3
%dec.3 = add nsw i32 %i.08.ph, -4
%div5.4 = lshr i32 %dec.3, 1
%add.4 = add nuw nsw i32 %div5.4, %add.3
%cmp.4 = icmp ugt i32 %dec.3, 1
br i1 %cmp.4, label %for.body.5, label %for.cond.cleanup, !llvm.loop !13
for.body.5: ; preds = %for.body.4
%dec.4 = add nsw i32 %i.08.ph, -5
%div5.5 = lshr i32 %dec.4, 1
%add.5 = add nuw nsw i32 %div5.5, %add.4
%cmp.5 = icmp ugt i32 %dec.4, 1
br i1 %cmp.5, label %for.body.6, label %for.cond.cleanup, !llvm.loop !13
for.body.6: ; preds = %for.body.5
%dec.5 = add nsw i32 %i.08.ph, -6
%div5.6 = lshr i32 %dec.5, 1
%add.6 = add nuw nsw i32 %div5.6, %add.5
br label %for.cond.cleanup
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include<stdio.h>
int main(){
int K;
scanf("%d",&K);
if(K%2==0) printf("%d",K*K/4);
else printf("%d",(K*K-1)/4);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180240/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180240/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%0 = load i32, ptr %K, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
%mul = mul nsw i32 %0, %0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div5 = lshr i32 %mul, 2
br label %if.end
if.else: ; preds = %entry
%sub = add nsw i32 %mul, -1
%div3 = sdiv i32 %sub, 4
br label %if.end
if.end: ; preds = %if.else, %if.then
%div3.sink = phi i32 [ %div3, %if.else ], [ %div5, %if.then ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #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>
#define lop(i, n) for(i=0; i<n; i++)
int gcd(long int a, long int b){
long int t;
if(a<b){ t=a; a=b; b=t; }
if(b<1)return -1;
if(a%b==0)return b;
else return gcd(b, a%b);
}
int main()
{
long int a, b, tmp;
scanf("%ld %ld", &a, &b);
long int x = a * b;
long int p=gcd(a, b);
printf("%ld", x/p);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180284/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180284/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end3, %entry
%a.tr = phi i64 [ %a, %entry ], [ %spec.select16, %if.end3 ]
%b.tr = phi i64 [ %b, %entry ], [ %rem, %if.end3 ]
%spec.select16 = tail call i64 @llvm.smin.i64(i64 %a.tr, i64 %b.tr)
%cmp1 = icmp slt i64 %spec.select16, 1
br i1 %cmp1, label %cleanup, label %if.end3
if.end3: ; preds = %tailrecurse
%spec.select = tail call i64 @llvm.smax.i64(i64 %a.tr, i64 %b.tr)
%rem = srem i64 %spec.select, %spec.select16
%cmp4 = icmp eq i64 %rem, 0
br i1 %cmp4, label %if.then5, label %tailrecurse
if.then5: ; preds = %if.end3
%conv = trunc i64 %spec.select16 to i32
br label %cleanup
cleanup: ; preds = %tailrecurse, %if.then5
%retval.0 = phi i32 [ %conv, %if.then5 ], [ -1, %tailrecurse ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
br label %tailrecurse.i
tailrecurse.i: ; preds = %if.end3.i, %entry
%a.tr.i = phi i64 [ %0, %entry ], [ %spec.select16.i, %if.end3.i ]
%b.tr.i = phi i64 [ %1, %entry ], [ %rem.i, %if.end3.i ]
%spec.select16.i = call i64 @llvm.smin.i64(i64 %a.tr.i, i64 %b.tr.i)
%cmp1.i = icmp slt i64 %spec.select16.i, 1
br i1 %cmp1.i, label %gcd.exit, label %if.end3.i
if.end3.i: ; preds = %tailrecurse.i
%spec.select.i = call i64 @llvm.smax.i64(i64 %a.tr.i, i64 %b.tr.i)
%rem.i = srem i64 %spec.select.i, %spec.select16.i
%cmp4.i = icmp eq i64 %rem.i, 0
br i1 %cmp4.i, label %if.then5.i, label %tailrecurse.i
if.then5.i: ; preds = %if.end3.i
%sext = shl i64 %spec.select16.i, 32
%2 = ashr exact i64 %sext, 32
br label %gcd.exit
gcd.exit: ; preds = %tailrecurse.i, %if.then5.i
%retval.0.i = phi i64 [ %2, %if.then5.i ], [ -1, %tailrecurse.i ]
%mul = mul nsw i64 %1, %0
%div = sdiv i64 %mul, %retval.0.i
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 i64 @llvm.smax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #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 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int gcd(int i, int j) {
return j == 0 ? i : gcd(j, i % j);
}
int main() {
int n, m;
scanf("%d%d", &n, &m);
printf("%lld\n", (long long)n * m / gcd(n, m));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180327/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180327/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i32 %j, 0
br i1 %cmp4, label %cond.end, label %cond.false
cond.false: ; preds = %entry, %cond.false
%j.tr6 = phi i32 [ %rem, %cond.false ], [ %j, %entry ]
%i.tr5 = phi i32 [ %j.tr6, %cond.false ], [ %i, %entry ]
%rem = srem i32 %i.tr5, %j.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %cond.end, label %cond.false
cond.end: ; preds = %cond.false, %entry
%i.tr.lcssa = phi i32 [ %i, %entry ], [ %j.tr6, %cond.false ]
ret i32 %i.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %m, align 4, !tbaa !5
%cmp4.i = icmp eq i32 %1, 0
br i1 %cmp4.i, label %gcd.exit, label %cond.false.i
cond.false.i: ; preds = %entry, %cond.false.i
%j.tr6.i = phi i32 [ %rem.i, %cond.false.i ], [ %1, %entry ]
%i.tr5.i = phi i32 [ %j.tr6.i, %cond.false.i ], [ %0, %entry ]
%rem.i = srem i32 %i.tr5.i, %j.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %cond.false.i
gcd.exit: ; preds = %cond.false.i, %entry
%i.tr.lcssa.i = phi i32 [ %0, %entry ], [ %j.tr6.i, %cond.false.i ]
%conv = sext i32 %0 to i64
%conv1 = sext i32 %1 to i64
%mul = mul nsw i64 %conv1, %conv
%conv3 = sext i32 %i.tr.lcssa.i to i64
%div = sdiv i64 %mul, %conv3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
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) #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"}
|
#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) ? (a) : (b))
#define rep(i, n) for(int i=0;i<(int)(n);i++)
long lcm(long a, long b){
long r, x, temp;
x = a*b;
if(a<b){
temp = a;
a = b;
b = temp;
}
// Euclidean Algorithm
r = a%b;
while(r != 0){
a = b;
b = r;
r = a%b;
}
return x/b;
}
int main(void){
long a, b, c;
scanf("%ld%ld",&a,&b);
c = lcm(a,b);
printf("%ld\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180370/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180370/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%spec.select = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
%spec.select14 = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
%rem = srem i64 %spec.select14, %spec.select
%cmp1.not15 = icmp eq i64 %rem, 0
br i1 %cmp1.not15, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%b.addr.117 = phi i64 [ %r.016, %while.body ], [ %spec.select, %entry ]
%r.016 = phi i64 [ %rem2, %while.body ], [ %rem, %entry ]
%rem2 = srem i64 %b.addr.117, %r.016
%cmp1.not = icmp eq i64 %rem2, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%b.addr.1.lcssa = phi i64 [ %spec.select, %entry ], [ %r.016, %while.body ]
%mul = mul nsw i64 %b, %a
%div = sdiv i64 %mul, %b.addr.1.lcssa
ret i64 %div
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !7
%1 = load i64, ptr %b, align 8, !tbaa !7
%spec.select.i = call i64 @llvm.smin.i64(i64 %0, i64 %1)
%spec.select14.i = call i64 @llvm.smax.i64(i64 %0, i64 %1)
%rem.i = srem i64 %spec.select14.i, %spec.select.i
%cmp1.not15.i = icmp eq i64 %rem.i, 0
br i1 %cmp1.not15.i, label %lcm.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%b.addr.117.i = phi i64 [ %r.016.i, %while.body.i ], [ %spec.select.i, %entry ]
%r.016.i = phi i64 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ]
%rem2.i = srem i64 %b.addr.117.i, %r.016.i
%cmp1.not.i = icmp eq i64 %rem2.i, 0
br i1 %cmp1.not.i, label %lcm.exit, label %while.body.i, !llvm.loop !5
lcm.exit: ; preds = %while.body.i, %entry
%b.addr.1.lcssa.i = phi i64 [ %spec.select.i, %entry ], [ %r.016.i, %while.body.i ]
%mul.i = mul nsw i64 %1, %0
%div.i = sdiv i64 %mul.i, %b.addr.1.lcssa.i
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 i64 @llvm.smin.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #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 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
long long int a,b,t,m,n;
long long int x;
scanf("%lld%lld",&a,&b);
m=a;
n=b;
if(a<b)
{
t=a;a=b;b=t;
}
while(a%b)
{
t=b;
b=a%b;
a=t;
}
x=m*n/b;
printf("%lld",x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180420/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180420/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i64 %1, ptr %a, align 8, !tbaa !5
store i64 %0, ptr %b, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%b.promoted = phi i64 [ %0, %if.then ], [ %1, %entry ]
%a.promoted = phi i64 [ %1, %if.then ], [ %0, %entry ]
%rem6 = srem i64 %a.promoted, %b.promoted
%tobool.not7 = icmp eq i64 %rem6, 0
br i1 %tobool.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%rem9 = phi i64 [ %rem, %while.body ], [ %rem6, %if.end ]
%rem58 = phi i64 [ %rem9, %while.body ], [ %b.promoted, %if.end ]
%rem = srem i64 %rem58, %rem9
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i64 %rem9, ptr %b, align 8, !tbaa !5
store i64 %rem58, ptr %a, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%.lcssa = phi i64 [ %rem9, %while.cond.while.end_crit_edge ], [ %b.promoted, %if.end ]
%mul = mul nsw i64 %1, %0
%div = sdiv i64 %mul, %.lcssa
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int Gcd(int a, int b)
{
if(a<b)
{
int t = a;
a = b;
b = t;
}
if(a%b==0) return b;
return Gcd(b, a%b);
}
int main()
{
long long int a, b;
scanf("%lld%lld", &a, &b);
long long int multi = a*b;
printf("%lld\n", multi/Gcd(a, b));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180464/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180464/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @Gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i32 [ %a, %entry ], [ %spec.select13, %tailrecurse ]
%b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ]
%spec.select = tail call i32 @llvm.smax.i32(i32 %a.tr, i32 %b.tr)
%spec.select13 = tail call i32 @llvm.smin.i32(i32 %a.tr, i32 %b.tr)
%rem = srem i32 %spec.select, %spec.select13
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %return, label %tailrecurse
return: ; preds = %tailrecurse
ret i32 %spec.select13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%conv = trunc i64 %0 to i32
%conv1 = trunc i64 %1 to i32
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %entry
%a.tr.i = phi i32 [ %conv, %entry ], [ %spec.select13.i, %tailrecurse.i ]
%b.tr.i = phi i32 [ %conv1, %entry ], [ %rem.i, %tailrecurse.i ]
%spec.select.i = call i32 @llvm.smax.i32(i32 %a.tr.i, i32 %b.tr.i)
%spec.select13.i = call i32 @llvm.smin.i32(i32 %a.tr.i, i32 %b.tr.i)
%rem.i = srem i32 %spec.select.i, %spec.select13.i
%cmp1.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.i, label %Gcd.exit, label %tailrecurse.i
Gcd.exit: ; preds = %tailrecurse.i
%mul = mul nsw i64 %1, %0
%conv3 = sext i32 %spec.select13.i to i64
%div = sdiv i64 %mul, %conv3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int i,j,k,set,map[150][150],sss[150][150],q[20000][2],blk,ans;
int m,n,s,t,x,y;
void mark(int x,int y){
if(x<0 || y<0 || x>=m || y>=n)return;
if(sss[x][y]!=set){
map[x][y]=map[q[i][0]][q[i][1]]+1;
sss[x][y]=set;
q[j][0]=x;q[j][1]=y;
j++;
}
}
void search(int x,int y){
mark(x-1+y%2,y-1);
mark(x+y%2,y-1);
mark(x-1,y);
mark(x+1,y);
mark(x-1+y%2,y+1);
mark(x+y%2,y+1);
}
void check2(int x,int y,int k){
if(x<0 || y<0 || x>=m || y>=n)return;
if(sss[x][y]>=set || map[x][y]<=k)return;
sss[x][y]=set+k;
q[j][0]=x;q[j][1]=y;
j++;
}
void check(int x,int y,int k){
check2(x-1+y%2,y-1,k+1);
check2(x+y%2,y-1,k+1);
check2(x-1,y,k+1);
check2(x+1,y,k+1);
check2(x-1+y%2,y+1,k+1);
check2(x+y%2,y+1,k+1);
}
int main(){
while(scanf("%d",&m)*m){
set+=300;
scanf("%d %d",&n,&s);
for(i=0;i<s;i++){
scanf("%d %d",&x,&y);
y--;x--;
map[x][y]=0;
sss[x][y]=set;
q[i][0]=x;
q[i][1]=y;
}
i=0;j=s;
while(i<j){
search(q[i][0],q[i][1]);
i++;
}
scanf("%d",&t);
ans=0;
for(i=0;i<t;i++){
scanf("%d %d",&x,&y);
x--;y--;set+=300;
blk=0;j=1;
q[0][0]=x;q[0][1]=y;
sss[x][y]=set;
while(blk<j){
check(q[blk][0],q[blk][1],sss[q[blk][0]][q[blk][1]]-set);
blk++;
}
if(ans<blk)ans=blk;
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180514/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180514/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@m = dso_local global i32 0, align 4
@n = dso_local global i32 0, align 4
@sss = dso_local local_unnamed_addr global [150 x [150 x i32]] zeroinitializer, align 16
@set = dso_local local_unnamed_addr global i32 0, align 4
@map = dso_local local_unnamed_addr global [150 x [150 x i32]] zeroinitializer, align 16
@q = dso_local local_unnamed_addr global [20000 x [2 x i32]] zeroinitializer, align 16
@i = dso_local local_unnamed_addr global i32 0, align 4
@j = dso_local local_unnamed_addr global i32 0, align 4
@.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
@s = dso_local global i32 0, align 4
@x = dso_local global i32 0, align 4
@y = dso_local global i32 0, align 4
@t = dso_local global i32 0, align 4
@ans = dso_local local_unnamed_addr global i32 0, align 4
@blk = dso_local local_unnamed_addr global i32 0, align 4
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@k = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @mark(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%0 = or i32 %y, %x
%or.cond.not = icmp sgt i32 %0, -1
%1 = load i32, ptr @m, align 4
%cmp3.not = icmp sgt i32 %1, %x
%or.cond = select i1 %or.cond.not, i1 %cmp3.not, i1 false
%2 = load i32, ptr @n, align 4
%cmp5.not = icmp sgt i32 %2, %y
%or.cond45 = select i1 %or.cond, i1 %cmp5.not, i1 false
br i1 %or.cond45, label %if.end, label %if.end34
if.end: ; preds = %entry
%idxprom = zext i32 %x to i64
%idxprom6 = zext i32 %y to i64
%arrayidx7 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom, i64 %idxprom6
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%4 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not = icmp eq i32 %3, %4
br i1 %cmp8.not, label %if.end34, label %if.then9
if.then9: ; preds = %if.end
%5 = load i32, ptr @i, align 4, !tbaa !5
%idxprom10 = sext i32 %5 to i64
%arrayidx11 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10
%6 = load i32, ptr %arrayidx11, align 8, !tbaa !5
%idxprom13 = sext i32 %6 to i64
%arrayidx17 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10, i64 1
%7 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%idxprom18 = sext i32 %7 to i64
%arrayidx19 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom13, i64 %idxprom18
%8 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%add = add nsw i32 %8, 1
%arrayidx23 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom, i64 %idxprom6
store i32 %add, ptr %arrayidx23, align 4, !tbaa !5
store i32 %4, ptr %arrayidx7, align 4, !tbaa !5
%9 = load i32, ptr @j, align 4, !tbaa !5
%idxprom28 = sext i32 %9 to i64
%arrayidx29 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28
store i32 %x, ptr %arrayidx29, align 8, !tbaa !5
%arrayidx33 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28, i64 1
store i32 %y, ptr %arrayidx33, align 4, !tbaa !5
%inc = add nsw i32 %9, 1
store i32 %inc, ptr @j, align 4, !tbaa !5
br label %if.end34
if.end34: ; preds = %entry, %if.then9, %if.end
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @search(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%sub = add nsw i32 %x, -1
%rem = srem i32 %y, 2
%add = add nsw i32 %rem, %sub
%sub1 = add nsw i32 %y, -1
%0 = or i32 %add, %sub1
%or.cond.not.i = icmp sgt i32 %0, -1
%1 = load i32, ptr @m, align 4
%cmp3.not.i = icmp sgt i32 %1, %add
%or.cond.i = select i1 %or.cond.not.i, i1 %cmp3.not.i, i1 false
%2 = load i32, ptr @n, align 4
%cmp5.not.i = icmp sge i32 %2, %y
%or.cond45.i = select i1 %or.cond.i, i1 %cmp5.not.i, i1 false
br i1 %or.cond45.i, label %if.end.i, label %mark.exit
if.end.i: ; preds = %entry
%idxprom.i = zext i32 %add to i64
%idxprom6.i = zext i32 %sub1 to i64
%arrayidx7.i = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i, i64 %idxprom6.i
%3 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5
%4 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i = icmp eq i32 %3, %4
br i1 %cmp8.not.i, label %mark.exit, label %if.then9.i
if.then9.i: ; preds = %if.end.i
%5 = load i32, ptr @i, align 4, !tbaa !5
%idxprom10.i = sext i32 %5 to i64
%arrayidx11.i = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i
%6 = load i32, ptr %arrayidx11.i, align 8, !tbaa !5
%idxprom13.i = sext i32 %6 to i64
%arrayidx17.i = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i, i64 1
%7 = load i32, ptr %arrayidx17.i, align 4, !tbaa !5
%idxprom18.i = sext i32 %7 to i64
%arrayidx19.i = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom13.i, i64 %idxprom18.i
%8 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5
%add.i = add nsw i32 %8, 1
%arrayidx23.i = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i, i64 %idxprom6.i
store i32 %add.i, ptr %arrayidx23.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx7.i, align 4, !tbaa !5
%9 = load i32, ptr @j, align 4, !tbaa !5
%idxprom28.i = sext i32 %9 to i64
%arrayidx29.i = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i
store i32 %add, ptr %arrayidx29.i, align 8, !tbaa !5
%arrayidx33.i = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i, i64 1
store i32 %sub1, ptr %arrayidx33.i, align 4, !tbaa !5
%inc.i = add nsw i32 %9, 1
store i32 %inc.i, ptr @j, align 4, !tbaa !5
br label %mark.exit
mark.exit: ; preds = %entry, %if.end.i, %if.then9.i
%add3 = add nsw i32 %rem, %x
%10 = or i32 %add3, %sub1
%or.cond.not.i28 = icmp sgt i32 %10, -1
%cmp3.not.i29 = icmp sgt i32 %1, %add3
%or.cond.i30 = select i1 %or.cond.not.i28, i1 %cmp3.not.i29, i1 false
%or.cond45.i32 = select i1 %or.cond.i30, i1 %cmp5.not.i, i1 false
br i1 %or.cond45.i32, label %if.end.i33, label %mark.exit51
if.end.i33: ; preds = %mark.exit
%idxprom.i34 = zext i32 %add3 to i64
%idxprom6.i35 = zext i32 %sub1 to i64
%arrayidx7.i36 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i34, i64 %idxprom6.i35
%11 = load i32, ptr %arrayidx7.i36, align 4, !tbaa !5
%12 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i37 = icmp eq i32 %11, %12
br i1 %cmp8.not.i37, label %mark.exit51, label %if.then9.i38
if.then9.i38: ; preds = %if.end.i33
%13 = load i32, ptr @i, align 4, !tbaa !5
%idxprom10.i39 = sext i32 %13 to i64
%arrayidx11.i40 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i39
%14 = load i32, ptr %arrayidx11.i40, align 8, !tbaa !5
%idxprom13.i41 = sext i32 %14 to i64
%arrayidx17.i42 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i39, i64 1
%15 = load i32, ptr %arrayidx17.i42, align 4, !tbaa !5
%idxprom18.i43 = sext i32 %15 to i64
%arrayidx19.i44 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom13.i41, i64 %idxprom18.i43
%16 = load i32, ptr %arrayidx19.i44, align 4, !tbaa !5
%add.i45 = add nsw i32 %16, 1
%arrayidx23.i46 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i34, i64 %idxprom6.i35
store i32 %add.i45, ptr %arrayidx23.i46, align 4, !tbaa !5
store i32 %12, ptr %arrayidx7.i36, align 4, !tbaa !5
%17 = load i32, ptr @j, align 4, !tbaa !5
%idxprom28.i47 = sext i32 %17 to i64
%arrayidx29.i48 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i47
store i32 %add3, ptr %arrayidx29.i48, align 8, !tbaa !5
%arrayidx33.i49 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i47, i64 1
store i32 %sub1, ptr %arrayidx33.i49, align 4, !tbaa !5
%inc.i50 = add nsw i32 %17, 1
store i32 %inc.i50, ptr @j, align 4, !tbaa !5
br label %mark.exit51
mark.exit51: ; preds = %mark.exit, %if.end.i33, %if.then9.i38
%18 = or i32 %sub, %y
%or.cond.not.i52 = icmp sgt i32 %18, -1
%cmp3.not.i53 = icmp sge i32 %1, %x
%or.cond.i54 = select i1 %or.cond.not.i52, i1 %cmp3.not.i53, i1 false
%cmp5.not.i55 = icmp sgt i32 %2, %y
%or.cond45.i56 = select i1 %or.cond.i54, i1 %cmp5.not.i55, i1 false
br i1 %or.cond45.i56, label %if.end.i57, label %mark.exit75
if.end.i57: ; preds = %mark.exit51
%idxprom.i58 = zext i32 %sub to i64
%idxprom6.i59 = zext i32 %y to i64
%arrayidx7.i60 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i58, i64 %idxprom6.i59
%19 = load i32, ptr %arrayidx7.i60, align 4, !tbaa !5
%20 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i61 = icmp eq i32 %19, %20
br i1 %cmp8.not.i61, label %mark.exit75, label %if.then9.i62
if.then9.i62: ; preds = %if.end.i57
%21 = load i32, ptr @i, align 4, !tbaa !5
%idxprom10.i63 = sext i32 %21 to i64
%arrayidx11.i64 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i63
%22 = load i32, ptr %arrayidx11.i64, align 8, !tbaa !5
%idxprom13.i65 = sext i32 %22 to i64
%arrayidx17.i66 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i63, i64 1
%23 = load i32, ptr %arrayidx17.i66, align 4, !tbaa !5
%idxprom18.i67 = sext i32 %23 to i64
%arrayidx19.i68 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom13.i65, i64 %idxprom18.i67
%24 = load i32, ptr %arrayidx19.i68, align 4, !tbaa !5
%add.i69 = add nsw i32 %24, 1
%arrayidx23.i70 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i58, i64 %idxprom6.i59
store i32 %add.i69, ptr %arrayidx23.i70, align 4, !tbaa !5
store i32 %20, ptr %arrayidx7.i60, align 4, !tbaa !5
%25 = load i32, ptr @j, align 4, !tbaa !5
%idxprom28.i71 = sext i32 %25 to i64
%arrayidx29.i72 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i71
store i32 %sub, ptr %arrayidx29.i72, align 8, !tbaa !5
%arrayidx33.i73 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i71, i64 1
store i32 %y, ptr %arrayidx33.i73, align 4, !tbaa !5
%inc.i74 = add nsw i32 %25, 1
store i32 %inc.i74, ptr @j, align 4, !tbaa !5
br label %mark.exit75
mark.exit75: ; preds = %mark.exit51, %if.end.i57, %if.then9.i62
%add6 = add nsw i32 %x, 1
%26 = or i32 %add6, %y
%or.cond.not.i76 = icmp sgt i32 %26, -1
%cmp3.not.i77 = icmp sgt i32 %1, %add6
%or.cond.i78 = select i1 %or.cond.not.i76, i1 %cmp3.not.i77, i1 false
%or.cond45.i80 = select i1 %or.cond.i78, i1 %cmp5.not.i55, i1 false
br i1 %or.cond45.i80, label %if.end.i81, label %mark.exit99
if.end.i81: ; preds = %mark.exit75
%idxprom.i82 = zext i32 %add6 to i64
%idxprom6.i83 = zext i32 %y to i64
%arrayidx7.i84 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i82, i64 %idxprom6.i83
%27 = load i32, ptr %arrayidx7.i84, align 4, !tbaa !5
%28 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i85 = icmp eq i32 %27, %28
br i1 %cmp8.not.i85, label %mark.exit99, label %if.then9.i86
if.then9.i86: ; preds = %if.end.i81
%29 = load i32, ptr @i, align 4, !tbaa !5
%idxprom10.i87 = sext i32 %29 to i64
%arrayidx11.i88 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i87
%30 = load i32, ptr %arrayidx11.i88, align 8, !tbaa !5
%idxprom13.i89 = sext i32 %30 to i64
%arrayidx17.i90 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i87, i64 1
%31 = load i32, ptr %arrayidx17.i90, align 4, !tbaa !5
%idxprom18.i91 = sext i32 %31 to i64
%arrayidx19.i92 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom13.i89, i64 %idxprom18.i91
%32 = load i32, ptr %arrayidx19.i92, align 4, !tbaa !5
%add.i93 = add nsw i32 %32, 1
%arrayidx23.i94 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i82, i64 %idxprom6.i83
store i32 %add.i93, ptr %arrayidx23.i94, align 4, !tbaa !5
store i32 %28, ptr %arrayidx7.i84, align 4, !tbaa !5
%33 = load i32, ptr @j, align 4, !tbaa !5
%idxprom28.i95 = sext i32 %33 to i64
%arrayidx29.i96 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i95
store i32 %add6, ptr %arrayidx29.i96, align 8, !tbaa !5
%arrayidx33.i97 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i95, i64 1
store i32 %y, ptr %arrayidx33.i97, align 4, !tbaa !5
%inc.i98 = add nsw i32 %33, 1
store i32 %inc.i98, ptr @j, align 4, !tbaa !5
br label %mark.exit99
mark.exit99: ; preds = %mark.exit75, %if.end.i81, %if.then9.i86
%add10 = add nsw i32 %y, 1
%34 = or i32 %add, %add10
%or.cond.not.i100 = icmp sgt i32 %34, -1
%or.cond.i102 = select i1 %or.cond.not.i100, i1 %cmp3.not.i, i1 false
%cmp5.not.i103 = icmp sgt i32 %2, %add10
%or.cond45.i104 = select i1 %or.cond.i102, i1 %cmp5.not.i103, i1 false
br i1 %or.cond45.i104, label %if.end.i105, label %mark.exit123
if.end.i105: ; preds = %mark.exit99
%idxprom.i106 = zext i32 %add to i64
%idxprom6.i107 = zext i32 %add10 to i64
%arrayidx7.i108 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i106, i64 %idxprom6.i107
%35 = load i32, ptr %arrayidx7.i108, align 4, !tbaa !5
%36 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i109 = icmp eq i32 %35, %36
br i1 %cmp8.not.i109, label %mark.exit123, label %if.then9.i110
if.then9.i110: ; preds = %if.end.i105
%37 = load i32, ptr @i, align 4, !tbaa !5
%idxprom10.i111 = sext i32 %37 to i64
%arrayidx11.i112 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i111
%38 = load i32, ptr %arrayidx11.i112, align 8, !tbaa !5
%idxprom13.i113 = sext i32 %38 to i64
%arrayidx17.i114 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i111, i64 1
%39 = load i32, ptr %arrayidx17.i114, align 4, !tbaa !5
%idxprom18.i115 = sext i32 %39 to i64
%arrayidx19.i116 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom13.i113, i64 %idxprom18.i115
%40 = load i32, ptr %arrayidx19.i116, align 4, !tbaa !5
%add.i117 = add nsw i32 %40, 1
%arrayidx23.i118 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i106, i64 %idxprom6.i107
store i32 %add.i117, ptr %arrayidx23.i118, align 4, !tbaa !5
store i32 %36, ptr %arrayidx7.i108, align 4, !tbaa !5
%41 = load i32, ptr @j, align 4, !tbaa !5
%idxprom28.i119 = sext i32 %41 to i64
%arrayidx29.i120 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i119
store i32 %add, ptr %arrayidx29.i120, align 8, !tbaa !5
%arrayidx33.i121 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i119, i64 1
store i32 %add10, ptr %arrayidx33.i121, align 4, !tbaa !5
%inc.i122 = add nsw i32 %41, 1
store i32 %inc.i122, ptr @j, align 4, !tbaa !5
br label %mark.exit123
mark.exit123: ; preds = %mark.exit99, %if.end.i105, %if.then9.i110
%42 = or i32 %add3, %add10
%or.cond.not.i124 = icmp sgt i32 %42, -1
%or.cond.i126 = select i1 %or.cond.not.i124, i1 %cmp3.not.i29, i1 false
%or.cond45.i128 = select i1 %or.cond.i126, i1 %cmp5.not.i103, i1 false
br i1 %or.cond45.i128, label %if.end.i129, label %mark.exit147
if.end.i129: ; preds = %mark.exit123
%idxprom.i130 = zext i32 %add3 to i64
%idxprom6.i131 = zext i32 %add10 to i64
%arrayidx7.i132 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i130, i64 %idxprom6.i131
%43 = load i32, ptr %arrayidx7.i132, align 4, !tbaa !5
%44 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i133 = icmp eq i32 %43, %44
br i1 %cmp8.not.i133, label %mark.exit147, label %if.then9.i134
if.then9.i134: ; preds = %if.end.i129
%45 = load i32, ptr @i, align 4, !tbaa !5
%idxprom10.i135 = sext i32 %45 to i64
%arrayidx11.i136 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i135
%46 = load i32, ptr %arrayidx11.i136, align 8, !tbaa !5
%idxprom13.i137 = sext i32 %46 to i64
%arrayidx17.i138 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10.i135, i64 1
%47 = load i32, ptr %arrayidx17.i138, align 4, !tbaa !5
%idxprom18.i139 = sext i32 %47 to i64
%arrayidx19.i140 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom13.i137, i64 %idxprom18.i139
%48 = load i32, ptr %arrayidx19.i140, align 4, !tbaa !5
%add.i141 = add nsw i32 %48, 1
%arrayidx23.i142 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i130, i64 %idxprom6.i131
store i32 %add.i141, ptr %arrayidx23.i142, align 4, !tbaa !5
store i32 %44, ptr %arrayidx7.i132, align 4, !tbaa !5
%49 = load i32, ptr @j, align 4, !tbaa !5
%idxprom28.i143 = sext i32 %49 to i64
%arrayidx29.i144 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i143
store i32 %add3, ptr %arrayidx29.i144, align 8, !tbaa !5
%arrayidx33.i145 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom28.i143, i64 1
store i32 %add10, ptr %arrayidx33.i145, align 4, !tbaa !5
%inc.i146 = add nsw i32 %49, 1
store i32 %inc.i146, ptr @j, align 4, !tbaa !5
br label %mark.exit147
mark.exit147: ; preds = %mark.exit123, %if.end.i129, %if.then9.i134
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @check2(i32 noundef %x, i32 noundef %y, i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = or i32 %y, %x
%or.cond.not = icmp sgt i32 %0, -1
%1 = load i32, ptr @m, align 4
%cmp3.not = icmp sgt i32 %1, %x
%or.cond = select i1 %or.cond.not, i1 %cmp3.not, i1 false
%2 = load i32, ptr @n, align 4
%cmp5.not = icmp sgt i32 %2, %y
%or.cond38 = select i1 %or.cond, i1 %cmp5.not, i1 false
br i1 %or.cond38, label %if.end, label %return
if.end: ; preds = %entry
%idxprom = zext i32 %x to i64
%idxprom6 = zext i32 %y to i64
%arrayidx7 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom, i64 %idxprom6
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%4 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not = icmp slt i32 %3, %4
br i1 %cmp8.not, label %lor.lhs.false9, label %return
lor.lhs.false9: ; preds = %if.end
%arrayidx13 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom, i64 %idxprom6
%5 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14.not = icmp sgt i32 %5, %k
br i1 %cmp14.not, label %if.end16, label %return
if.end16: ; preds = %lor.lhs.false9
%add = add nsw i32 %4, %k
store i32 %add, ptr %arrayidx7, align 4, !tbaa !5
%6 = load i32, ptr @j, align 4, !tbaa !5
%idxprom21 = sext i32 %6 to i64
%arrayidx22 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21
store i32 %x, ptr %arrayidx22, align 8, !tbaa !5
%arrayidx26 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21, i64 1
store i32 %y, ptr %arrayidx26, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @j, align 4, !tbaa !5
br label %return
return: ; preds = %if.end, %lor.lhs.false9, %entry, %if.end16
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @check(i32 noundef %x, i32 noundef %y, i32 noundef %k) local_unnamed_addr #0 {
entry:
%sub = add nsw i32 %x, -1
%rem = srem i32 %y, 2
%add = add nsw i32 %rem, %sub
%sub1 = add nsw i32 %y, -1
%add2 = add nsw i32 %k, 1
%0 = or i32 %add, %sub1
%or.cond.not.i = icmp sgt i32 %0, -1
%1 = load i32, ptr @m, align 4
%cmp3.not.i = icmp sgt i32 %1, %add
%or.cond.i = select i1 %or.cond.not.i, i1 %cmp3.not.i, i1 false
%2 = load i32, ptr @n, align 4
%cmp5.not.i = icmp sge i32 %2, %y
%or.cond38.i = select i1 %or.cond.i, i1 %cmp5.not.i, i1 false
br i1 %or.cond38.i, label %if.end.i, label %check2.exit
if.end.i: ; preds = %entry
%idxprom.i = zext i32 %add to i64
%idxprom6.i = zext i32 %sub1 to i64
%arrayidx7.i = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i, i64 %idxprom6.i
%3 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5
%4 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i = icmp slt i32 %3, %4
br i1 %cmp8.not.i, label %lor.lhs.false9.i, label %check2.exit
lor.lhs.false9.i: ; preds = %if.end.i
%arrayidx13.i = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i, i64 %idxprom6.i
%5 = load i32, ptr %arrayidx13.i, align 4, !tbaa !5
%cmp14.not.i = icmp sgt i32 %5, %add2
br i1 %cmp14.not.i, label %if.end16.i, label %check2.exit
if.end16.i: ; preds = %lor.lhs.false9.i
%add.i = add nsw i32 %4, %add2
store i32 %add.i, ptr %arrayidx7.i, align 4, !tbaa !5
%6 = load i32, ptr @j, align 4, !tbaa !5
%idxprom21.i = sext i32 %6 to i64
%arrayidx22.i = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i
store i32 %add, ptr %arrayidx22.i, align 8, !tbaa !5
%arrayidx26.i = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i, i64 1
store i32 %sub1, ptr %arrayidx26.i, align 4, !tbaa !5
%inc.i = add nsw i32 %6, 1
store i32 %inc.i, ptr @j, align 4, !tbaa !5
br label %check2.exit
check2.exit: ; preds = %entry, %if.end.i, %lor.lhs.false9.i, %if.end16.i
%add4 = add nsw i32 %rem, %x
%7 = or i32 %add4, %sub1
%or.cond.not.i39 = icmp sgt i32 %7, -1
%cmp3.not.i40 = icmp sgt i32 %1, %add4
%or.cond.i41 = select i1 %or.cond.not.i39, i1 %cmp3.not.i40, i1 false
%or.cond38.i43 = select i1 %or.cond.i41, i1 %cmp5.not.i, i1 false
br i1 %or.cond38.i43, label %if.end.i44, label %check2.exit58
if.end.i44: ; preds = %check2.exit
%idxprom.i45 = zext i32 %add4 to i64
%idxprom6.i46 = zext i32 %sub1 to i64
%arrayidx7.i47 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i45, i64 %idxprom6.i46
%8 = load i32, ptr %arrayidx7.i47, align 4, !tbaa !5
%9 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i48 = icmp slt i32 %8, %9
br i1 %cmp8.not.i48, label %lor.lhs.false9.i49, label %check2.exit58
lor.lhs.false9.i49: ; preds = %if.end.i44
%arrayidx13.i50 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i45, i64 %idxprom6.i46
%10 = load i32, ptr %arrayidx13.i50, align 4, !tbaa !5
%cmp14.not.i51 = icmp sgt i32 %10, %add2
br i1 %cmp14.not.i51, label %if.end16.i52, label %check2.exit58
if.end16.i52: ; preds = %lor.lhs.false9.i49
%add.i53 = add nsw i32 %9, %add2
store i32 %add.i53, ptr %arrayidx7.i47, align 4, !tbaa !5
%11 = load i32, ptr @j, align 4, !tbaa !5
%idxprom21.i54 = sext i32 %11 to i64
%arrayidx22.i55 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i54
store i32 %add4, ptr %arrayidx22.i55, align 8, !tbaa !5
%arrayidx26.i56 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i54, i64 1
store i32 %sub1, ptr %arrayidx26.i56, align 4, !tbaa !5
%inc.i57 = add nsw i32 %11, 1
store i32 %inc.i57, ptr @j, align 4, !tbaa !5
br label %check2.exit58
check2.exit58: ; preds = %check2.exit, %if.end.i44, %lor.lhs.false9.i49, %if.end16.i52
%12 = or i32 %sub, %y
%or.cond.not.i59 = icmp sgt i32 %12, -1
%cmp3.not.i60 = icmp sge i32 %1, %x
%or.cond.i61 = select i1 %or.cond.not.i59, i1 %cmp3.not.i60, i1 false
%cmp5.not.i62 = icmp sgt i32 %2, %y
%or.cond38.i63 = select i1 %or.cond.i61, i1 %cmp5.not.i62, i1 false
br i1 %or.cond38.i63, label %if.end.i64, label %check2.exit78
if.end.i64: ; preds = %check2.exit58
%idxprom.i65 = zext i32 %sub to i64
%idxprom6.i66 = zext i32 %y to i64
%arrayidx7.i67 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i65, i64 %idxprom6.i66
%13 = load i32, ptr %arrayidx7.i67, align 4, !tbaa !5
%14 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i68 = icmp slt i32 %13, %14
br i1 %cmp8.not.i68, label %lor.lhs.false9.i69, label %check2.exit78
lor.lhs.false9.i69: ; preds = %if.end.i64
%arrayidx13.i70 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i65, i64 %idxprom6.i66
%15 = load i32, ptr %arrayidx13.i70, align 4, !tbaa !5
%cmp14.not.i71 = icmp sgt i32 %15, %add2
br i1 %cmp14.not.i71, label %if.end16.i72, label %check2.exit78
if.end16.i72: ; preds = %lor.lhs.false9.i69
%add.i73 = add nsw i32 %14, %add2
store i32 %add.i73, ptr %arrayidx7.i67, align 4, !tbaa !5
%16 = load i32, ptr @j, align 4, !tbaa !5
%idxprom21.i74 = sext i32 %16 to i64
%arrayidx22.i75 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i74
store i32 %sub, ptr %arrayidx22.i75, align 8, !tbaa !5
%arrayidx26.i76 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i74, i64 1
store i32 %y, ptr %arrayidx26.i76, align 4, !tbaa !5
%inc.i77 = add nsw i32 %16, 1
store i32 %inc.i77, ptr @j, align 4, !tbaa !5
br label %check2.exit78
check2.exit78: ; preds = %check2.exit58, %if.end.i64, %lor.lhs.false9.i69, %if.end16.i72
%add9 = add nsw i32 %x, 1
%17 = or i32 %add9, %y
%or.cond.not.i79 = icmp sgt i32 %17, -1
%cmp3.not.i80 = icmp sgt i32 %1, %add9
%or.cond.i81 = select i1 %or.cond.not.i79, i1 %cmp3.not.i80, i1 false
%or.cond38.i83 = select i1 %or.cond.i81, i1 %cmp5.not.i62, i1 false
br i1 %or.cond38.i83, label %if.end.i84, label %check2.exit98
if.end.i84: ; preds = %check2.exit78
%idxprom.i85 = zext i32 %add9 to i64
%idxprom6.i86 = zext i32 %y to i64
%arrayidx7.i87 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i85, i64 %idxprom6.i86
%18 = load i32, ptr %arrayidx7.i87, align 4, !tbaa !5
%19 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i88 = icmp slt i32 %18, %19
br i1 %cmp8.not.i88, label %lor.lhs.false9.i89, label %check2.exit98
lor.lhs.false9.i89: ; preds = %if.end.i84
%arrayidx13.i90 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i85, i64 %idxprom6.i86
%20 = load i32, ptr %arrayidx13.i90, align 4, !tbaa !5
%cmp14.not.i91 = icmp sgt i32 %20, %add2
br i1 %cmp14.not.i91, label %if.end16.i92, label %check2.exit98
if.end16.i92: ; preds = %lor.lhs.false9.i89
%add.i93 = add nsw i32 %19, %add2
store i32 %add.i93, ptr %arrayidx7.i87, align 4, !tbaa !5
%21 = load i32, ptr @j, align 4, !tbaa !5
%idxprom21.i94 = sext i32 %21 to i64
%arrayidx22.i95 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i94
store i32 %add9, ptr %arrayidx22.i95, align 8, !tbaa !5
%arrayidx26.i96 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i94, i64 1
store i32 %y, ptr %arrayidx26.i96, align 4, !tbaa !5
%inc.i97 = add nsw i32 %21, 1
store i32 %inc.i97, ptr @j, align 4, !tbaa !5
br label %check2.exit98
check2.exit98: ; preds = %check2.exit78, %if.end.i84, %lor.lhs.false9.i89, %if.end16.i92
%add14 = add nsw i32 %y, 1
%22 = or i32 %add, %add14
%or.cond.not.i99 = icmp sgt i32 %22, -1
%or.cond.i101 = select i1 %or.cond.not.i99, i1 %cmp3.not.i, i1 false
%cmp5.not.i102 = icmp sgt i32 %2, %add14
%or.cond38.i103 = select i1 %or.cond.i101, i1 %cmp5.not.i102, i1 false
br i1 %or.cond38.i103, label %if.end.i104, label %check2.exit118
if.end.i104: ; preds = %check2.exit98
%idxprom.i105 = zext i32 %add to i64
%idxprom6.i106 = zext i32 %add14 to i64
%arrayidx7.i107 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i105, i64 %idxprom6.i106
%23 = load i32, ptr %arrayidx7.i107, align 4, !tbaa !5
%24 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i108 = icmp slt i32 %23, %24
br i1 %cmp8.not.i108, label %lor.lhs.false9.i109, label %check2.exit118
lor.lhs.false9.i109: ; preds = %if.end.i104
%arrayidx13.i110 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i105, i64 %idxprom6.i106
%25 = load i32, ptr %arrayidx13.i110, align 4, !tbaa !5
%cmp14.not.i111 = icmp sgt i32 %25, %add2
br i1 %cmp14.not.i111, label %if.end16.i112, label %check2.exit118
if.end16.i112: ; preds = %lor.lhs.false9.i109
%add.i113 = add nsw i32 %24, %add2
store i32 %add.i113, ptr %arrayidx7.i107, align 4, !tbaa !5
%26 = load i32, ptr @j, align 4, !tbaa !5
%idxprom21.i114 = sext i32 %26 to i64
%arrayidx22.i115 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i114
store i32 %add, ptr %arrayidx22.i115, align 8, !tbaa !5
%arrayidx26.i116 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i114, i64 1
store i32 %add14, ptr %arrayidx26.i116, align 4, !tbaa !5
%inc.i117 = add nsw i32 %26, 1
store i32 %inc.i117, ptr @j, align 4, !tbaa !5
br label %check2.exit118
check2.exit118: ; preds = %check2.exit98, %if.end.i104, %lor.lhs.false9.i109, %if.end16.i112
%27 = or i32 %add4, %add14
%or.cond.not.i119 = icmp sgt i32 %27, -1
%or.cond.i121 = select i1 %or.cond.not.i119, i1 %cmp3.not.i40, i1 false
%or.cond38.i123 = select i1 %or.cond.i121, i1 %cmp5.not.i102, i1 false
br i1 %or.cond38.i123, label %if.end.i124, label %check2.exit138
if.end.i124: ; preds = %check2.exit118
%idxprom.i125 = zext i32 %add4 to i64
%idxprom6.i126 = zext i32 %add14 to i64
%arrayidx7.i127 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom.i125, i64 %idxprom6.i126
%28 = load i32, ptr %arrayidx7.i127, align 4, !tbaa !5
%29 = load i32, ptr @set, align 4, !tbaa !5
%cmp8.not.i128 = icmp slt i32 %28, %29
br i1 %cmp8.not.i128, label %lor.lhs.false9.i129, label %check2.exit138
lor.lhs.false9.i129: ; preds = %if.end.i124
%arrayidx13.i130 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom.i125, i64 %idxprom6.i126
%30 = load i32, ptr %arrayidx13.i130, align 4, !tbaa !5
%cmp14.not.i131 = icmp sgt i32 %30, %add2
br i1 %cmp14.not.i131, label %if.end16.i132, label %check2.exit138
if.end16.i132: ; preds = %lor.lhs.false9.i129
%add.i133 = add nsw i32 %29, %add2
store i32 %add.i133, ptr %arrayidx7.i127, align 4, !tbaa !5
%31 = load i32, ptr @j, align 4, !tbaa !5
%idxprom21.i134 = sext i32 %31 to i64
%arrayidx22.i135 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i134
store i32 %add4, ptr %arrayidx22.i135, align 8, !tbaa !5
%arrayidx26.i136 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom21.i134, i64 1
store i32 %add14, ptr %arrayidx26.i136, align 4, !tbaa !5
%inc.i137 = add nsw i32 %31, 1
store i32 %inc.i137, ptr @j, align 4, !tbaa !5
br label %check2.exit138
check2.exit138: ; preds = %check2.exit118, %if.end.i124, %lor.lhs.false9.i129, %if.end16.i132
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call73 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
%0 = load i32, ptr @m, align 4, !tbaa !5
%mul74 = mul nsw i32 %0, %call73
%tobool.not75 = icmp eq i32 %mul74, 0
br i1 %tobool.not75, label %while.end64, label %while.body
while.body: ; preds = %entry, %for.end62
%1 = load i32, ptr @set, align 4, !tbaa !5
%add = add nsw i32 %1, 300
store i32 %add, ptr @set, align 4, !tbaa !5
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @s)
store i32 0, ptr @i, align 4, !tbaa !5
%2 = load i32, ptr @s, align 4, !tbaa !5
%cmp68 = icmp sgt i32 %2, 0
br i1 %cmp68, label %for.body, label %for.end.thread
for.end.thread: ; preds = %while.body
store i32 %2, ptr @j, align 4, !tbaa !5
br label %while.end
for.body: ; preds = %while.body, %for.body
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @x, ptr noundef nonnull @y)
%3 = load i32, ptr @y, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr @y, align 4, !tbaa !5
%4 = load i32, ptr @x, align 4, !tbaa !5
%dec3 = add nsw i32 %4, -1
store i32 %dec3, ptr @x, align 4, !tbaa !5
%idxprom = sext i32 %dec3 to i64
%idxprom4 = sext i32 %dec to i64
%arrayidx5 = getelementptr inbounds [150 x [150 x i32]], ptr @map, i64 0, i64 %idxprom, i64 %idxprom4
store i32 0, ptr %arrayidx5, align 4, !tbaa !5
%5 = load i32, ptr @set, align 4, !tbaa !5
%arrayidx9 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom, i64 %idxprom4
store i32 %5, ptr %arrayidx9, align 4, !tbaa !5
%6 = load i32, ptr @i, align 4, !tbaa !5
%idxprom10 = sext i32 %6 to i64
%arrayidx11 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10
store i32 %dec3, ptr %arrayidx11, align 8, !tbaa !5
%arrayidx15 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom10, i64 1
store i32 %dec, ptr %arrayidx15, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @i, align 4, !tbaa !5
%7 = load i32, ptr @s, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %7
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
store i32 0, ptr @i, align 4, !tbaa !5
store i32 %7, ptr @j, align 4, !tbaa !5
%cmp1769 = icmp sgt i32 %7, 0
br i1 %cmp1769, label %while.body18, label %while.end
while.body18: ; preds = %for.end, %while.body18
%8 = phi i32 [ %inc25, %while.body18 ], [ 0, %for.end ]
%idxprom19 = sext i32 %8 to i64
%arrayidx20 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom19
%9 = load i32, ptr %arrayidx20, align 8, !tbaa !5
%arrayidx24 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom19, i64 1
%10 = load i32, ptr %arrayidx24, align 4, !tbaa !5
tail call void @search(i32 noundef %9, i32 noundef %10)
%11 = load i32, ptr @i, align 4, !tbaa !5
%inc25 = add nsw i32 %11, 1
store i32 %inc25, ptr @i, align 4, !tbaa !5
%12 = load i32, ptr @j, align 4, !tbaa !5
%cmp17 = icmp slt i32 %inc25, %12
br i1 %cmp17, label %while.body18, label %while.end, !llvm.loop !11
while.end: ; preds = %while.body18, %for.end.thread, %for.end
%call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
store i32 0, ptr @ans, align 4, !tbaa !5
store i32 0, ptr @i, align 4, !tbaa !5
%13 = load i32, ptr @t, align 4, !tbaa !5
%cmp2872 = icmp sgt i32 %13, 0
br i1 %cmp2872, label %while.body40.preheader, label %for.end62
while.body40.preheader: ; preds = %while.end, %for.inc60
%call30 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @x, ptr noundef nonnull @y)
%14 = load i32, ptr @x, align 4, !tbaa !5
%dec31 = add nsw i32 %14, -1
store i32 %dec31, ptr @x, align 4, !tbaa !5
%15 = load i32, ptr @y, align 4, !tbaa !5
%dec32 = add nsw i32 %15, -1
store i32 %dec32, ptr @y, align 4, !tbaa !5
%16 = load i32, ptr @set, align 4, !tbaa !5
%add33 = add nsw i32 %16, 300
store i32 %add33, ptr @set, align 4, !tbaa !5
store i32 0, ptr @blk, align 4, !tbaa !5
store i32 1, ptr @j, align 4, !tbaa !5
store i32 %dec31, ptr @q, align 16, !tbaa !5
store i32 %dec32, ptr getelementptr inbounds ([20000 x [2 x i32]], ptr @q, i64 0, i64 0, i64 1), align 4, !tbaa !5
%idxprom34 = sext i32 %dec31 to i64
%idxprom36 = sext i32 %dec32 to i64
%arrayidx37 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom34, i64 %idxprom36
store i32 %add33, ptr %arrayidx37, align 4, !tbaa !5
br label %while.body40
while.body40: ; preds = %while.body40.preheader, %while.body40
%17 = phi i32 [ %inc57, %while.body40 ], [ 0, %while.body40.preheader ]
%idxprom41 = sext i32 %17 to i64
%arrayidx42 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom41
%18 = load i32, ptr %arrayidx42, align 8, !tbaa !5
%arrayidx46 = getelementptr inbounds [20000 x [2 x i32]], ptr @q, i64 0, i64 %idxprom41, i64 1
%19 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%idxprom50 = sext i32 %18 to i64
%idxprom55 = sext i32 %19 to i64
%arrayidx56 = getelementptr inbounds [150 x [150 x i32]], ptr @sss, i64 0, i64 %idxprom50, i64 %idxprom55
%20 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%21 = load i32, ptr @set, align 4, !tbaa !5
%sub = sub nsw i32 %20, %21
tail call void @check(i32 noundef %18, i32 noundef %19, i32 noundef %sub)
%22 = load i32, ptr @blk, align 4, !tbaa !5
%inc57 = add nsw i32 %22, 1
store i32 %inc57, ptr @blk, align 4, !tbaa !5
%23 = load i32, ptr @j, align 4, !tbaa !5
%cmp39 = icmp slt i32 %inc57, %23
br i1 %cmp39, label %while.body40, label %while.end58, !llvm.loop !12
while.end58: ; preds = %while.body40
%24 = load i32, ptr @ans, align 4, !tbaa !5
%cmp59.not = icmp sgt i32 %24, %22
br i1 %cmp59.not, label %for.inc60, label %if.then
if.then: ; preds = %while.end58
store i32 %inc57, ptr @ans, align 4, !tbaa !5
br label %for.inc60
for.inc60: ; preds = %while.end58, %if.then
%25 = phi i32 [ %24, %while.end58 ], [ %inc57, %if.then ]
%26 = load i32, ptr @i, align 4, !tbaa !5
%inc61 = add nsw i32 %26, 1
store i32 %inc61, ptr @i, align 4, !tbaa !5
%27 = load i32, ptr @t, align 4, !tbaa !5
%cmp28 = icmp slt i32 %inc61, %27
br i1 %cmp28, label %while.body40.preheader, label %for.end62, !llvm.loop !13
for.end62: ; preds = %for.inc60, %while.end
%28 = phi i32 [ 0, %while.end ], [ %25, %for.inc60 ]
%call63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
%29 = load i32, ptr @m, align 4, !tbaa !5
%mul = mul nsw i32 %29, %call
%tobool.not = icmp eq i32 %mul, 0
br i1 %tobool.not, label %while.end64, label %while.body, !llvm.loop !14
while.end64: ; preds = %for.end62, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<math.h>
int main(){
double a,b,c,d;
scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
printf("%f\n",hypot(a-c,b-d));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180565/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180565/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [16 x i8] c"%lf %lf %lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, align 8
%c = alloca double, align 8
%d = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load double, ptr %a, align 8, !tbaa !5
%1 = load double, ptr %c, align 8, !tbaa !5
%sub = fsub double %0, %1
%2 = load double, ptr %b, align 8, !tbaa !5
%3 = load double, ptr %d, align 8, !tbaa !5
%sub1 = fsub double %2, %3
%call2 = call double @hypot(double noundef %sub, double noundef %sub1) #4
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nounwind
declare double @hypot(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
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(void){
double x1,x2,y1,y2;
scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
printf("%#.8f\n", sqrt( (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)) );
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180608/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180608/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [16 x i8] c"%lf %lf %lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%#.8f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca double, align 8
%x2 = alloca double, align 8
%y1 = alloca double, align 8
%y2 = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x1) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x2) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y1) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y2) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2)
%0 = load double, ptr %x2, align 8, !tbaa !5
%1 = load double, ptr %x1, align 8, !tbaa !5
%sub = fsub double %0, %1
%2 = load double, ptr %y2, align 8, !tbaa !5
%3 = load double, ptr %y1, align 8, !tbaa !5
%sub2 = fsub double %2, %3
%mul4 = fmul double %sub2, %sub2
%4 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %mul4)
%sqrt = call double @llvm.sqrt.f64(double %4)
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sqrt)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y2) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y1) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x2) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x1) #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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(){
double x1,x2,y1,y2;
int i;
char a[202];
char a1[202];
//FILE *fp;
//fp = fopen("text.txt", "r");
//fscanf(fp,"%s%*c",buf1);
scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
if(x1-x2>y1-y2)
printf("%.10lf\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));
else
printf("%.10lf\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));
//for(i=0;i<=10000000000;i++);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180673/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180673/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [16 x i8] c"%lf %lf %lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%.10lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca double, align 8
%x2 = alloca double, align 8
%y1 = alloca double, align 8
%y2 = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x1) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x2) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y1) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y2) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2)
%0 = load double, ptr %x1, align 8, !tbaa !5
%1 = load double, ptr %x2, align 8, !tbaa !5
%sub = fsub double %0, %1
%2 = load double, ptr %y1, align 8, !tbaa !5
%3 = load double, ptr %y2, align 8, !tbaa !5
%sub1 = fsub double %2, %3
%mul6 = fmul double %sub1, %sub1
%4 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %mul6)
%sqrt = call double @llvm.sqrt.f64(double %4)
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sqrt)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y2) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y1) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x2) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x1) #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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define N 100
int max(int a,int b){
if(a > b){
return a;
}
return b;
}
int main(void){
int A,B;
scanf("%d%d",&A,&B);
char S[N][N];
for(int i = 0;i < N;i++){
for(int j = 0;j < N;j++){
if(i < N/2) S[i][j] = '#';
else S[i][j] = '.';
}
}
int cnt = 0;
for(int i = 1;i < N/2;i += 2){
for(int j = 1;j < N-1;j += 2){
if(++cnt < A) S[i][j] = '.';
}
}
cnt = 0;
for(int i = N/2+1;i < N;i += 2){
for(int j = 1;j < N-1;j += 2){
if(++cnt < B) S[i][j] = '#';
}
}
printf("%d %d\n",N,N);
for(int i = 0;i < N;i++){
for(int j = 0;j < N;j++){
printf("%c",S[i][j]);
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180723/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180723/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%S = alloca [100 x [100 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %S) #7
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond.cleanup3.1, %entry
%indvar = phi i64 [ 0, %entry ], [ %indvar.next.1, %for.cond.cleanup3.1 ]
%0 = mul nuw nsw i64 %indvar, 100
%scevgep120 = getelementptr i8, ptr %S, i64 %0
%1 = icmp ult i64 %indvar, 50
br i1 %1, label %for.body4.us.preheader, label %for.body4.preheader
for.body4.preheader: ; preds = %for.cond1.preheader
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(100) %scevgep120, i8 46, i64 100, i1 false), !tbaa !5
br label %for.cond.cleanup3
for.body4.us.preheader: ; preds = %for.cond1.preheader
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(100) %scevgep120, i8 35, i64 100, i1 false), !tbaa !5
br label %for.cond.cleanup3
for.cond16.preheader: ; preds = %for.cond.cleanup3.1
%2 = load i32, ptr %A, align 4, !tbaa !8
%broadcast.splatinsert = insertelement <16 x i32> poison, i32 %2, i64 0
%broadcast.splat = shufflevector <16 x i32> %broadcast.splatinsert, <16 x i32> poison, <16 x i32> zeroinitializer
br label %vector.ph
for.cond.cleanup3: ; preds = %for.body4.preheader, %for.body4.us.preheader
%indvar.next = or i64 %indvar, 1
%3 = mul nuw nsw i64 %indvar.next, 100
%scevgep120.1 = getelementptr i8, ptr %S, i64 %3
%4 = icmp ult i64 %indvar.next, 50
br i1 %4, label %for.body4.us.preheader.1, label %for.body4.preheader.1
for.body4.preheader.1: ; preds = %for.cond.cleanup3
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(100) %scevgep120.1, i8 46, i64 100, i1 false), !tbaa !5
br label %for.cond.cleanup3.1
for.body4.us.preheader.1: ; preds = %for.cond.cleanup3
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(100) %scevgep120.1, i8 35, i64 100, i1 false), !tbaa !5
br label %for.cond.cleanup3.1
for.cond.cleanup3.1: ; preds = %for.body4.us.preheader.1, %for.body4.preheader.1
%indvar.next.1 = add nuw nsw i64 %indvar, 2
%exitcond.not.1 = icmp eq i64 %indvar.next.1, 100
br i1 %exitcond.not.1, label %for.cond16.preheader, label %for.cond1.preheader, !llvm.loop !10
vector.ph: ; preds = %for.inc33, %for.cond16.preheader
%indvars.iv127 = phi i64 [ 1, %for.cond16.preheader ], [ %indvars.iv.next128, %for.inc33 ]
%cnt.0110 = phi i32 [ 0, %for.cond16.preheader ], [ %108, %for.inc33 ]
%.splatinsert = insertelement <16 x i32> poison, i32 %cnt.0110, i64 0
%.splat = shufflevector <16 x i32> %.splatinsert, <16 x i32> poison, <16 x i32> zeroinitializer
%5 = add nuw <16 x i32> %.splat, <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16>
%6 = icmp slt <16 x i32> %5, %broadcast.splat
%7 = extractelement <16 x i1> %6, i64 0
br i1 %7, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.ph
%8 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 1
store i8 46, ptr %8, align 1, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.ph
%9 = extractelement <16 x i1> %6, i64 1
br i1 %9, label %pred.store.if148, label %pred.store.continue149
pred.store.if148: ; preds = %pred.store.continue
%10 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 3
store i8 46, ptr %10, align 1, !tbaa !5
br label %pred.store.continue149
pred.store.continue149: ; preds = %pred.store.if148, %pred.store.continue
%11 = extractelement <16 x i1> %6, i64 2
br i1 %11, label %pred.store.if150, label %pred.store.continue151
pred.store.if150: ; preds = %pred.store.continue149
%12 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 5
store i8 46, ptr %12, align 1, !tbaa !5
br label %pred.store.continue151
pred.store.continue151: ; preds = %pred.store.if150, %pred.store.continue149
%13 = extractelement <16 x i1> %6, i64 3
br i1 %13, label %pred.store.if152, label %pred.store.continue153
pred.store.if152: ; preds = %pred.store.continue151
%14 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 7
store i8 46, ptr %14, align 1, !tbaa !5
br label %pred.store.continue153
pred.store.continue153: ; preds = %pred.store.if152, %pred.store.continue151
%15 = extractelement <16 x i1> %6, i64 4
br i1 %15, label %pred.store.if154, label %pred.store.continue155
pred.store.if154: ; preds = %pred.store.continue153
%16 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 9
store i8 46, ptr %16, align 1, !tbaa !5
br label %pred.store.continue155
pred.store.continue155: ; preds = %pred.store.if154, %pred.store.continue153
%17 = extractelement <16 x i1> %6, i64 5
br i1 %17, label %pred.store.if156, label %pred.store.continue157
pred.store.if156: ; preds = %pred.store.continue155
%18 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 11
store i8 46, ptr %18, align 1, !tbaa !5
br label %pred.store.continue157
pred.store.continue157: ; preds = %pred.store.if156, %pred.store.continue155
%19 = extractelement <16 x i1> %6, i64 6
br i1 %19, label %pred.store.if158, label %pred.store.continue159
pred.store.if158: ; preds = %pred.store.continue157
%20 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 13
store i8 46, ptr %20, align 1, !tbaa !5
br label %pred.store.continue159
pred.store.continue159: ; preds = %pred.store.if158, %pred.store.continue157
%21 = extractelement <16 x i1> %6, i64 7
br i1 %21, label %pred.store.if160, label %pred.store.continue161
pred.store.if160: ; preds = %pred.store.continue159
%22 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 15
store i8 46, ptr %22, align 1, !tbaa !5
br label %pred.store.continue161
pred.store.continue161: ; preds = %pred.store.if160, %pred.store.continue159
%23 = extractelement <16 x i1> %6, i64 8
br i1 %23, label %pred.store.if162, label %pred.store.continue163
pred.store.if162: ; preds = %pred.store.continue161
%24 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 17
store i8 46, ptr %24, align 1, !tbaa !5
br label %pred.store.continue163
pred.store.continue163: ; preds = %pred.store.if162, %pred.store.continue161
%25 = extractelement <16 x i1> %6, i64 9
br i1 %25, label %pred.store.if164, label %pred.store.continue165
pred.store.if164: ; preds = %pred.store.continue163
%26 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 19
store i8 46, ptr %26, align 1, !tbaa !5
br label %pred.store.continue165
pred.store.continue165: ; preds = %pred.store.if164, %pred.store.continue163
%27 = extractelement <16 x i1> %6, i64 10
br i1 %27, label %pred.store.if166, label %pred.store.continue167
pred.store.if166: ; preds = %pred.store.continue165
%28 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 21
store i8 46, ptr %28, align 1, !tbaa !5
br label %pred.store.continue167
pred.store.continue167: ; preds = %pred.store.if166, %pred.store.continue165
%29 = extractelement <16 x i1> %6, i64 11
br i1 %29, label %pred.store.if168, label %pred.store.continue169
pred.store.if168: ; preds = %pred.store.continue167
%30 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 23
store i8 46, ptr %30, align 1, !tbaa !5
br label %pred.store.continue169
pred.store.continue169: ; preds = %pred.store.if168, %pred.store.continue167
%31 = extractelement <16 x i1> %6, i64 12
br i1 %31, label %pred.store.if170, label %pred.store.continue171
pred.store.if170: ; preds = %pred.store.continue169
%32 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 25
store i8 46, ptr %32, align 1, !tbaa !5
br label %pred.store.continue171
pred.store.continue171: ; preds = %pred.store.if170, %pred.store.continue169
%33 = extractelement <16 x i1> %6, i64 13
br i1 %33, label %pred.store.if172, label %pred.store.continue173
pred.store.if172: ; preds = %pred.store.continue171
%34 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 27
store i8 46, ptr %34, align 1, !tbaa !5
br label %pred.store.continue173
pred.store.continue173: ; preds = %pred.store.if172, %pred.store.continue171
%35 = extractelement <16 x i1> %6, i64 14
br i1 %35, label %pred.store.if174, label %pred.store.continue175
pred.store.if174: ; preds = %pred.store.continue173
%36 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 29
store i8 46, ptr %36, align 1, !tbaa !5
br label %pred.store.continue175
pred.store.continue175: ; preds = %pred.store.if174, %pred.store.continue173
%37 = extractelement <16 x i1> %6, i64 15
br i1 %37, label %pred.store.if176, label %pred.store.continue177
pred.store.if176: ; preds = %pred.store.continue175
%38 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 31
store i8 46, ptr %38, align 1, !tbaa !5
br label %pred.store.continue177
pred.store.continue177: ; preds = %pred.store.if176, %pred.store.continue175
%39 = add nuw <16 x i32> %.splat, <i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32>
%40 = icmp slt <16 x i32> %39, %broadcast.splat
%41 = extractelement <16 x i1> %40, i64 0
br i1 %41, label %pred.store.if.1, label %pred.store.continue.1
pred.store.if.1: ; preds = %pred.store.continue177
%42 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 33
store i8 46, ptr %42, align 1, !tbaa !5
br label %pred.store.continue.1
pred.store.continue.1: ; preds = %pred.store.if.1, %pred.store.continue177
%43 = extractelement <16 x i1> %40, i64 1
br i1 %43, label %pred.store.if148.1, label %pred.store.continue149.1
pred.store.if148.1: ; preds = %pred.store.continue.1
%44 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 35
store i8 46, ptr %44, align 1, !tbaa !5
br label %pred.store.continue149.1
pred.store.continue149.1: ; preds = %pred.store.if148.1, %pred.store.continue.1
%45 = extractelement <16 x i1> %40, i64 2
br i1 %45, label %pred.store.if150.1, label %pred.store.continue151.1
pred.store.if150.1: ; preds = %pred.store.continue149.1
%46 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 37
store i8 46, ptr %46, align 1, !tbaa !5
br label %pred.store.continue151.1
pred.store.continue151.1: ; preds = %pred.store.if150.1, %pred.store.continue149.1
%47 = extractelement <16 x i1> %40, i64 3
br i1 %47, label %pred.store.if152.1, label %pred.store.continue153.1
pred.store.if152.1: ; preds = %pred.store.continue151.1
%48 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 39
store i8 46, ptr %48, align 1, !tbaa !5
br label %pred.store.continue153.1
pred.store.continue153.1: ; preds = %pred.store.if152.1, %pred.store.continue151.1
%49 = extractelement <16 x i1> %40, i64 4
br i1 %49, label %pred.store.if154.1, label %pred.store.continue155.1
pred.store.if154.1: ; preds = %pred.store.continue153.1
%50 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 41
store i8 46, ptr %50, align 1, !tbaa !5
br label %pred.store.continue155.1
pred.store.continue155.1: ; preds = %pred.store.if154.1, %pred.store.continue153.1
%51 = extractelement <16 x i1> %40, i64 5
br i1 %51, label %pred.store.if156.1, label %pred.store.continue157.1
pred.store.if156.1: ; preds = %pred.store.continue155.1
%52 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 43
store i8 46, ptr %52, align 1, !tbaa !5
br label %pred.store.continue157.1
pred.store.continue157.1: ; preds = %pred.store.if156.1, %pred.store.continue155.1
%53 = extractelement <16 x i1> %40, i64 6
br i1 %53, label %pred.store.if158.1, label %pred.store.continue159.1
pred.store.if158.1: ; preds = %pred.store.continue157.1
%54 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 45
store i8 46, ptr %54, align 1, !tbaa !5
br label %pred.store.continue159.1
pred.store.continue159.1: ; preds = %pred.store.if158.1, %pred.store.continue157.1
%55 = extractelement <16 x i1> %40, i64 7
br i1 %55, label %pred.store.if160.1, label %pred.store.continue161.1
pred.store.if160.1: ; preds = %pred.store.continue159.1
%56 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 47
store i8 46, ptr %56, align 1, !tbaa !5
br label %pred.store.continue161.1
pred.store.continue161.1: ; preds = %pred.store.if160.1, %pred.store.continue159.1
%57 = extractelement <16 x i1> %40, i64 8
br i1 %57, label %pred.store.if162.1, label %pred.store.continue163.1
pred.store.if162.1: ; preds = %pred.store.continue161.1
%58 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 49
store i8 46, ptr %58, align 1, !tbaa !5
br label %pred.store.continue163.1
pred.store.continue163.1: ; preds = %pred.store.if162.1, %pred.store.continue161.1
%59 = extractelement <16 x i1> %40, i64 9
br i1 %59, label %pred.store.if164.1, label %pred.store.continue165.1
pred.store.if164.1: ; preds = %pred.store.continue163.1
%60 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 51
store i8 46, ptr %60, align 1, !tbaa !5
br label %pred.store.continue165.1
pred.store.continue165.1: ; preds = %pred.store.if164.1, %pred.store.continue163.1
%61 = extractelement <16 x i1> %40, i64 10
br i1 %61, label %pred.store.if166.1, label %pred.store.continue167.1
pred.store.if166.1: ; preds = %pred.store.continue165.1
%62 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 53
store i8 46, ptr %62, align 1, !tbaa !5
br label %pred.store.continue167.1
pred.store.continue167.1: ; preds = %pred.store.if166.1, %pred.store.continue165.1
%63 = extractelement <16 x i1> %40, i64 11
br i1 %63, label %pred.store.if168.1, label %pred.store.continue169.1
pred.store.if168.1: ; preds = %pred.store.continue167.1
%64 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 55
store i8 46, ptr %64, align 1, !tbaa !5
br label %pred.store.continue169.1
pred.store.continue169.1: ; preds = %pred.store.if168.1, %pred.store.continue167.1
%65 = extractelement <16 x i1> %40, i64 12
br i1 %65, label %pred.store.if170.1, label %pred.store.continue171.1
pred.store.if170.1: ; preds = %pred.store.continue169.1
%66 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 57
store i8 46, ptr %66, align 1, !tbaa !5
br label %pred.store.continue171.1
pred.store.continue171.1: ; preds = %pred.store.if170.1, %pred.store.continue169.1
%67 = extractelement <16 x i1> %40, i64 13
br i1 %67, label %pred.store.if172.1, label %pred.store.continue173.1
pred.store.if172.1: ; preds = %pred.store.continue171.1
%68 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 59
store i8 46, ptr %68, align 1, !tbaa !5
br label %pred.store.continue173.1
pred.store.continue173.1: ; preds = %pred.store.if172.1, %pred.store.continue171.1
%69 = extractelement <16 x i1> %40, i64 14
br i1 %69, label %pred.store.if174.1, label %pred.store.continue175.1
pred.store.if174.1: ; preds = %pred.store.continue173.1
%70 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 61
store i8 46, ptr %70, align 1, !tbaa !5
br label %pred.store.continue175.1
pred.store.continue175.1: ; preds = %pred.store.if174.1, %pred.store.continue173.1
%71 = extractelement <16 x i1> %40, i64 15
br i1 %71, label %pred.store.if176.1, label %pred.store.continue177.1
pred.store.if176.1: ; preds = %pred.store.continue175.1
%72 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 63
store i8 46, ptr %72, align 1, !tbaa !5
br label %pred.store.continue177.1
pred.store.continue177.1: ; preds = %pred.store.if176.1, %pred.store.continue175.1
%73 = add nuw <16 x i32> %.splat, <i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48>
%74 = icmp slt <16 x i32> %73, %broadcast.splat
%75 = extractelement <16 x i1> %74, i64 0
br i1 %75, label %pred.store.if.2, label %pred.store.continue.2
pred.store.if.2: ; preds = %pred.store.continue177.1
%76 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 65
store i8 46, ptr %76, align 1, !tbaa !5
br label %pred.store.continue.2
pred.store.continue.2: ; preds = %pred.store.if.2, %pred.store.continue177.1
%77 = extractelement <16 x i1> %74, i64 1
br i1 %77, label %pred.store.if148.2, label %pred.store.continue149.2
pred.store.if148.2: ; preds = %pred.store.continue.2
%78 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 67
store i8 46, ptr %78, align 1, !tbaa !5
br label %pred.store.continue149.2
pred.store.continue149.2: ; preds = %pred.store.if148.2, %pred.store.continue.2
%79 = extractelement <16 x i1> %74, i64 2
br i1 %79, label %pred.store.if150.2, label %pred.store.continue151.2
pred.store.if150.2: ; preds = %pred.store.continue149.2
%80 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 69
store i8 46, ptr %80, align 1, !tbaa !5
br label %pred.store.continue151.2
pred.store.continue151.2: ; preds = %pred.store.if150.2, %pred.store.continue149.2
%81 = extractelement <16 x i1> %74, i64 3
br i1 %81, label %pred.store.if152.2, label %pred.store.continue153.2
pred.store.if152.2: ; preds = %pred.store.continue151.2
%82 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 71
store i8 46, ptr %82, align 1, !tbaa !5
br label %pred.store.continue153.2
pred.store.continue153.2: ; preds = %pred.store.if152.2, %pred.store.continue151.2
%83 = extractelement <16 x i1> %74, i64 4
br i1 %83, label %pred.store.if154.2, label %pred.store.continue155.2
pred.store.if154.2: ; preds = %pred.store.continue153.2
%84 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 73
store i8 46, ptr %84, align 1, !tbaa !5
br label %pred.store.continue155.2
pred.store.continue155.2: ; preds = %pred.store.if154.2, %pred.store.continue153.2
%85 = extractelement <16 x i1> %74, i64 5
br i1 %85, label %pred.store.if156.2, label %pred.store.continue157.2
pred.store.if156.2: ; preds = %pred.store.continue155.2
%86 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 75
store i8 46, ptr %86, align 1, !tbaa !5
br label %pred.store.continue157.2
pred.store.continue157.2: ; preds = %pred.store.if156.2, %pred.store.continue155.2
%87 = extractelement <16 x i1> %74, i64 6
br i1 %87, label %pred.store.if158.2, label %pred.store.continue159.2
pred.store.if158.2: ; preds = %pred.store.continue157.2
%88 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 77
store i8 46, ptr %88, align 1, !tbaa !5
br label %pred.store.continue159.2
pred.store.continue159.2: ; preds = %pred.store.if158.2, %pred.store.continue157.2
%89 = extractelement <16 x i1> %74, i64 7
br i1 %89, label %pred.store.if160.2, label %pred.store.continue161.2
pred.store.if160.2: ; preds = %pred.store.continue159.2
%90 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 79
store i8 46, ptr %90, align 1, !tbaa !5
br label %pred.store.continue161.2
pred.store.continue161.2: ; preds = %pred.store.if160.2, %pred.store.continue159.2
%91 = extractelement <16 x i1> %74, i64 8
br i1 %91, label %pred.store.if162.2, label %pred.store.continue163.2
pred.store.if162.2: ; preds = %pred.store.continue161.2
%92 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 81
store i8 46, ptr %92, align 1, !tbaa !5
br label %pred.store.continue163.2
pred.store.continue163.2: ; preds = %pred.store.if162.2, %pred.store.continue161.2
%93 = extractelement <16 x i1> %74, i64 9
br i1 %93, label %pred.store.if164.2, label %pred.store.continue165.2
pred.store.if164.2: ; preds = %pred.store.continue163.2
%94 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 83
store i8 46, ptr %94, align 1, !tbaa !5
br label %pred.store.continue165.2
pred.store.continue165.2: ; preds = %pred.store.if164.2, %pred.store.continue163.2
%95 = extractelement <16 x i1> %74, i64 10
br i1 %95, label %pred.store.if166.2, label %pred.store.continue167.2
pred.store.if166.2: ; preds = %pred.store.continue165.2
%96 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 85
store i8 46, ptr %96, align 1, !tbaa !5
br label %pred.store.continue167.2
pred.store.continue167.2: ; preds = %pred.store.if166.2, %pred.store.continue165.2
%97 = extractelement <16 x i1> %74, i64 11
br i1 %97, label %pred.store.if168.2, label %pred.store.continue169.2
pred.store.if168.2: ; preds = %pred.store.continue167.2
%98 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 87
store i8 46, ptr %98, align 1, !tbaa !5
br label %pred.store.continue169.2
pred.store.continue169.2: ; preds = %pred.store.if168.2, %pred.store.continue167.2
%99 = extractelement <16 x i1> %74, i64 12
br i1 %99, label %pred.store.if170.2, label %pred.store.continue171.2
pred.store.if170.2: ; preds = %pred.store.continue169.2
%100 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 89
store i8 46, ptr %100, align 1, !tbaa !5
br label %pred.store.continue171.2
pred.store.continue171.2: ; preds = %pred.store.if170.2, %pred.store.continue169.2
%101 = extractelement <16 x i1> %74, i64 13
br i1 %101, label %pred.store.if172.2, label %pred.store.continue173.2
pred.store.if172.2: ; preds = %pred.store.continue171.2
%102 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 91
store i8 46, ptr %102, align 1, !tbaa !5
br label %pred.store.continue173.2
pred.store.continue173.2: ; preds = %pred.store.if172.2, %pred.store.continue171.2
%103 = extractelement <16 x i1> %74, i64 14
br i1 %103, label %pred.store.if174.2, label %pred.store.continue175.2
pred.store.if174.2: ; preds = %pred.store.continue173.2
%104 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 93
store i8 46, ptr %104, align 1, !tbaa !5
br label %pred.store.continue175.2
pred.store.continue175.2: ; preds = %pred.store.if174.2, %pred.store.continue173.2
%105 = extractelement <16 x i1> %74, i64 15
br i1 %105, label %pred.store.if176.2, label %for.body24
pred.store.if176.2: ; preds = %pred.store.continue175.2
%106 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 95
store i8 46, ptr %106, align 1, !tbaa !5
br label %for.body24
for.cond39.preheader: ; preds = %for.inc33
%107 = load i32, ptr %B, align 4, !tbaa !8
%broadcast.splatinsert192 = insertelement <16 x i32> poison, i32 %107, i64 0
%broadcast.splat193 = shufflevector <16 x i32> %broadcast.splatinsert192, <16 x i32> poison, <16 x i32> zeroinitializer
br label %vector.ph180
for.body24: ; preds = %pred.store.continue175.2, %pred.store.if176.2
%inc25 = add nuw i32 %cnt.0110, 49
%cmp26 = icmp slt i32 %inc25, %2
br i1 %cmp26, label %if.then27, label %for.inc33
if.then27: ; preds = %for.body24
%arrayidx31 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv127, i64 97
store i8 46, ptr %arrayidx31, align 1, !tbaa !5
br label %for.inc33
for.inc33: ; preds = %for.body24, %if.then27
%108 = add nuw nsw i32 %cnt.0110, 49
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 2
%cmp17 = icmp ult i64 %indvars.iv127, 48
br i1 %cmp17, label %vector.ph, label %for.cond39.preheader, !llvm.loop !12
vector.ph180: ; preds = %for.inc56, %for.cond39.preheader
%indvars.iv136 = phi i64 [ 51, %for.cond39.preheader ], [ %indvars.iv.next137, %for.inc56 ]
%cnt.2114 = phi i32 [ 0, %for.cond39.preheader ], [ %211, %for.inc56 ]
%.splatinsert186 = insertelement <16 x i32> poison, i32 %cnt.2114, i64 0
%.splat187 = shufflevector <16 x i32> %.splatinsert186, <16 x i32> poison, <16 x i32> zeroinitializer
%109 = add nuw <16 x i32> %.splat187, <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16>
%110 = icmp slt <16 x i32> %109, %broadcast.splat193
%111 = extractelement <16 x i1> %110, i64 0
br i1 %111, label %pred.store.if194, label %pred.store.continue195
pred.store.if194: ; preds = %vector.ph180
%112 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 1
store i8 35, ptr %112, align 1, !tbaa !5
br label %pred.store.continue195
pred.store.continue195: ; preds = %pred.store.if194, %vector.ph180
%113 = extractelement <16 x i1> %110, i64 1
br i1 %113, label %pred.store.if196, label %pred.store.continue197
pred.store.if196: ; preds = %pred.store.continue195
%114 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 3
store i8 35, ptr %114, align 1, !tbaa !5
br label %pred.store.continue197
pred.store.continue197: ; preds = %pred.store.if196, %pred.store.continue195
%115 = extractelement <16 x i1> %110, i64 2
br i1 %115, label %pred.store.if198, label %pred.store.continue199
pred.store.if198: ; preds = %pred.store.continue197
%116 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 5
store i8 35, ptr %116, align 1, !tbaa !5
br label %pred.store.continue199
pred.store.continue199: ; preds = %pred.store.if198, %pred.store.continue197
%117 = extractelement <16 x i1> %110, i64 3
br i1 %117, label %pred.store.if200, label %pred.store.continue201
pred.store.if200: ; preds = %pred.store.continue199
%118 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 7
store i8 35, ptr %118, align 1, !tbaa !5
br label %pred.store.continue201
pred.store.continue201: ; preds = %pred.store.if200, %pred.store.continue199
%119 = extractelement <16 x i1> %110, i64 4
br i1 %119, label %pred.store.if202, label %pred.store.continue203
pred.store.if202: ; preds = %pred.store.continue201
%120 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 9
store i8 35, ptr %120, align 1, !tbaa !5
br label %pred.store.continue203
pred.store.continue203: ; preds = %pred.store.if202, %pred.store.continue201
%121 = extractelement <16 x i1> %110, i64 5
br i1 %121, label %pred.store.if204, label %pred.store.continue205
pred.store.if204: ; preds = %pred.store.continue203
%122 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 11
store i8 35, ptr %122, align 1, !tbaa !5
br label %pred.store.continue205
pred.store.continue205: ; preds = %pred.store.if204, %pred.store.continue203
%123 = extractelement <16 x i1> %110, i64 6
br i1 %123, label %pred.store.if206, label %pred.store.continue207
pred.store.if206: ; preds = %pred.store.continue205
%124 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 13
store i8 35, ptr %124, align 1, !tbaa !5
br label %pred.store.continue207
pred.store.continue207: ; preds = %pred.store.if206, %pred.store.continue205
%125 = extractelement <16 x i1> %110, i64 7
br i1 %125, label %pred.store.if208, label %pred.store.continue209
pred.store.if208: ; preds = %pred.store.continue207
%126 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 15
store i8 35, ptr %126, align 1, !tbaa !5
br label %pred.store.continue209
pred.store.continue209: ; preds = %pred.store.if208, %pred.store.continue207
%127 = extractelement <16 x i1> %110, i64 8
br i1 %127, label %pred.store.if210, label %pred.store.continue211
pred.store.if210: ; preds = %pred.store.continue209
%128 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 17
store i8 35, ptr %128, align 1, !tbaa !5
br label %pred.store.continue211
pred.store.continue211: ; preds = %pred.store.if210, %pred.store.continue209
%129 = extractelement <16 x i1> %110, i64 9
br i1 %129, label %pred.store.if212, label %pred.store.continue213
pred.store.if212: ; preds = %pred.store.continue211
%130 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 19
store i8 35, ptr %130, align 1, !tbaa !5
br label %pred.store.continue213
pred.store.continue213: ; preds = %pred.store.if212, %pred.store.continue211
%131 = extractelement <16 x i1> %110, i64 10
br i1 %131, label %pred.store.if214, label %pred.store.continue215
pred.store.if214: ; preds = %pred.store.continue213
%132 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 21
store i8 35, ptr %132, align 1, !tbaa !5
br label %pred.store.continue215
pred.store.continue215: ; preds = %pred.store.if214, %pred.store.continue213
%133 = extractelement <16 x i1> %110, i64 11
br i1 %133, label %pred.store.if216, label %pred.store.continue217
pred.store.if216: ; preds = %pred.store.continue215
%134 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 23
store i8 35, ptr %134, align 1, !tbaa !5
br label %pred.store.continue217
pred.store.continue217: ; preds = %pred.store.if216, %pred.store.continue215
%135 = extractelement <16 x i1> %110, i64 12
br i1 %135, label %pred.store.if218, label %pred.store.continue219
pred.store.if218: ; preds = %pred.store.continue217
%136 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 25
store i8 35, ptr %136, align 1, !tbaa !5
br label %pred.store.continue219
pred.store.continue219: ; preds = %pred.store.if218, %pred.store.continue217
%137 = extractelement <16 x i1> %110, i64 13
br i1 %137, label %pred.store.if220, label %pred.store.continue221
pred.store.if220: ; preds = %pred.store.continue219
%138 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 27
store i8 35, ptr %138, align 1, !tbaa !5
br label %pred.store.continue221
pred.store.continue221: ; preds = %pred.store.if220, %pred.store.continue219
%139 = extractelement <16 x i1> %110, i64 14
br i1 %139, label %pred.store.if222, label %pred.store.continue223
pred.store.if222: ; preds = %pred.store.continue221
%140 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 29
store i8 35, ptr %140, align 1, !tbaa !5
br label %pred.store.continue223
pred.store.continue223: ; preds = %pred.store.if222, %pred.store.continue221
%141 = extractelement <16 x i1> %110, i64 15
br i1 %141, label %pred.store.if224, label %pred.store.continue225
pred.store.if224: ; preds = %pred.store.continue223
%142 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 31
store i8 35, ptr %142, align 1, !tbaa !5
br label %pred.store.continue225
pred.store.continue225: ; preds = %pred.store.if224, %pred.store.continue223
%143 = add nuw <16 x i32> %.splat187, <i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32>
%144 = icmp slt <16 x i32> %143, %broadcast.splat193
%145 = extractelement <16 x i1> %144, i64 0
br i1 %145, label %pred.store.if194.1, label %pred.store.continue195.1
pred.store.if194.1: ; preds = %pred.store.continue225
%146 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 33
store i8 35, ptr %146, align 1, !tbaa !5
br label %pred.store.continue195.1
pred.store.continue195.1: ; preds = %pred.store.if194.1, %pred.store.continue225
%147 = extractelement <16 x i1> %144, i64 1
br i1 %147, label %pred.store.if196.1, label %pred.store.continue197.1
pred.store.if196.1: ; preds = %pred.store.continue195.1
%148 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 35
store i8 35, ptr %148, align 1, !tbaa !5
br label %pred.store.continue197.1
pred.store.continue197.1: ; preds = %pred.store.if196.1, %pred.store.continue195.1
%149 = extractelement <16 x i1> %144, i64 2
br i1 %149, label %pred.store.if198.1, label %pred.store.continue199.1
pred.store.if198.1: ; preds = %pred.store.continue197.1
%150 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 37
store i8 35, ptr %150, align 1, !tbaa !5
br label %pred.store.continue199.1
pred.store.continue199.1: ; preds = %pred.store.if198.1, %pred.store.continue197.1
%151 = extractelement <16 x i1> %144, i64 3
br i1 %151, label %pred.store.if200.1, label %pred.store.continue201.1
pred.store.if200.1: ; preds = %pred.store.continue199.1
%152 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 39
store i8 35, ptr %152, align 1, !tbaa !5
br label %pred.store.continue201.1
pred.store.continue201.1: ; preds = %pred.store.if200.1, %pred.store.continue199.1
%153 = extractelement <16 x i1> %144, i64 4
br i1 %153, label %pred.store.if202.1, label %pred.store.continue203.1
pred.store.if202.1: ; preds = %pred.store.continue201.1
%154 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 41
store i8 35, ptr %154, align 1, !tbaa !5
br label %pred.store.continue203.1
pred.store.continue203.1: ; preds = %pred.store.if202.1, %pred.store.continue201.1
%155 = extractelement <16 x i1> %144, i64 5
br i1 %155, label %pred.store.if204.1, label %pred.store.continue205.1
pred.store.if204.1: ; preds = %pred.store.continue203.1
%156 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 43
store i8 35, ptr %156, align 1, !tbaa !5
br label %pred.store.continue205.1
pred.store.continue205.1: ; preds = %pred.store.if204.1, %pred.store.continue203.1
%157 = extractelement <16 x i1> %144, i64 6
br i1 %157, label %pred.store.if206.1, label %pred.store.continue207.1
pred.store.if206.1: ; preds = %pred.store.continue205.1
%158 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 45
store i8 35, ptr %158, align 1, !tbaa !5
br label %pred.store.continue207.1
pred.store.continue207.1: ; preds = %pred.store.if206.1, %pred.store.continue205.1
%159 = extractelement <16 x i1> %144, i64 7
br i1 %159, label %pred.store.if208.1, label %pred.store.continue209.1
pred.store.if208.1: ; preds = %pred.store.continue207.1
%160 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 47
store i8 35, ptr %160, align 1, !tbaa !5
br label %pred.store.continue209.1
pred.store.continue209.1: ; preds = %pred.store.if208.1, %pred.store.continue207.1
%161 = extractelement <16 x i1> %144, i64 8
br i1 %161, label %pred.store.if210.1, label %pred.store.continue211.1
pred.store.if210.1: ; preds = %pred.store.continue209.1
%162 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 49
store i8 35, ptr %162, align 1, !tbaa !5
br label %pred.store.continue211.1
pred.store.continue211.1: ; preds = %pred.store.if210.1, %pred.store.continue209.1
%163 = extractelement <16 x i1> %144, i64 9
br i1 %163, label %pred.store.if212.1, label %pred.store.continue213.1
pred.store.if212.1: ; preds = %pred.store.continue211.1
%164 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 51
store i8 35, ptr %164, align 1, !tbaa !5
br label %pred.store.continue213.1
pred.store.continue213.1: ; preds = %pred.store.if212.1, %pred.store.continue211.1
%165 = extractelement <16 x i1> %144, i64 10
br i1 %165, label %pred.store.if214.1, label %pred.store.continue215.1
pred.store.if214.1: ; preds = %pred.store.continue213.1
%166 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 53
store i8 35, ptr %166, align 1, !tbaa !5
br label %pred.store.continue215.1
pred.store.continue215.1: ; preds = %pred.store.if214.1, %pred.store.continue213.1
%167 = extractelement <16 x i1> %144, i64 11
br i1 %167, label %pred.store.if216.1, label %pred.store.continue217.1
pred.store.if216.1: ; preds = %pred.store.continue215.1
%168 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 55
store i8 35, ptr %168, align 1, !tbaa !5
br label %pred.store.continue217.1
pred.store.continue217.1: ; preds = %pred.store.if216.1, %pred.store.continue215.1
%169 = extractelement <16 x i1> %144, i64 12
br i1 %169, label %pred.store.if218.1, label %pred.store.continue219.1
pred.store.if218.1: ; preds = %pred.store.continue217.1
%170 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 57
store i8 35, ptr %170, align 1, !tbaa !5
br label %pred.store.continue219.1
pred.store.continue219.1: ; preds = %pred.store.if218.1, %pred.store.continue217.1
%171 = extractelement <16 x i1> %144, i64 13
br i1 %171, label %pred.store.if220.1, label %pred.store.continue221.1
pred.store.if220.1: ; preds = %pred.store.continue219.1
%172 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 59
store i8 35, ptr %172, align 1, !tbaa !5
br label %pred.store.continue221.1
pred.store.continue221.1: ; preds = %pred.store.if220.1, %pred.store.continue219.1
%173 = extractelement <16 x i1> %144, i64 14
br i1 %173, label %pred.store.if222.1, label %pred.store.continue223.1
pred.store.if222.1: ; preds = %pred.store.continue221.1
%174 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 61
store i8 35, ptr %174, align 1, !tbaa !5
br label %pred.store.continue223.1
pred.store.continue223.1: ; preds = %pred.store.if222.1, %pred.store.continue221.1
%175 = extractelement <16 x i1> %144, i64 15
br i1 %175, label %pred.store.if224.1, label %pred.store.continue225.1
pred.store.if224.1: ; preds = %pred.store.continue223.1
%176 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 63
store i8 35, ptr %176, align 1, !tbaa !5
br label %pred.store.continue225.1
pred.store.continue225.1: ; preds = %pred.store.if224.1, %pred.store.continue223.1
%177 = add nuw <16 x i32> %.splat187, <i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48>
%178 = icmp slt <16 x i32> %177, %broadcast.splat193
%179 = extractelement <16 x i1> %178, i64 0
br i1 %179, label %pred.store.if194.2, label %pred.store.continue195.2
pred.store.if194.2: ; preds = %pred.store.continue225.1
%180 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 65
store i8 35, ptr %180, align 1, !tbaa !5
br label %pred.store.continue195.2
pred.store.continue195.2: ; preds = %pred.store.if194.2, %pred.store.continue225.1
%181 = extractelement <16 x i1> %178, i64 1
br i1 %181, label %pred.store.if196.2, label %pred.store.continue197.2
pred.store.if196.2: ; preds = %pred.store.continue195.2
%182 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 67
store i8 35, ptr %182, align 1, !tbaa !5
br label %pred.store.continue197.2
pred.store.continue197.2: ; preds = %pred.store.if196.2, %pred.store.continue195.2
%183 = extractelement <16 x i1> %178, i64 2
br i1 %183, label %pred.store.if198.2, label %pred.store.continue199.2
pred.store.if198.2: ; preds = %pred.store.continue197.2
%184 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 69
store i8 35, ptr %184, align 1, !tbaa !5
br label %pred.store.continue199.2
pred.store.continue199.2: ; preds = %pred.store.if198.2, %pred.store.continue197.2
%185 = extractelement <16 x i1> %178, i64 3
br i1 %185, label %pred.store.if200.2, label %pred.store.continue201.2
pred.store.if200.2: ; preds = %pred.store.continue199.2
%186 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 71
store i8 35, ptr %186, align 1, !tbaa !5
br label %pred.store.continue201.2
pred.store.continue201.2: ; preds = %pred.store.if200.2, %pred.store.continue199.2
%187 = extractelement <16 x i1> %178, i64 4
br i1 %187, label %pred.store.if202.2, label %pred.store.continue203.2
pred.store.if202.2: ; preds = %pred.store.continue201.2
%188 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 73
store i8 35, ptr %188, align 1, !tbaa !5
br label %pred.store.continue203.2
pred.store.continue203.2: ; preds = %pred.store.if202.2, %pred.store.continue201.2
%189 = extractelement <16 x i1> %178, i64 5
br i1 %189, label %pred.store.if204.2, label %pred.store.continue205.2
pred.store.if204.2: ; preds = %pred.store.continue203.2
%190 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 75
store i8 35, ptr %190, align 1, !tbaa !5
br label %pred.store.continue205.2
pred.store.continue205.2: ; preds = %pred.store.if204.2, %pred.store.continue203.2
%191 = extractelement <16 x i1> %178, i64 6
br i1 %191, label %pred.store.if206.2, label %pred.store.continue207.2
pred.store.if206.2: ; preds = %pred.store.continue205.2
%192 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 77
store i8 35, ptr %192, align 1, !tbaa !5
br label %pred.store.continue207.2
pred.store.continue207.2: ; preds = %pred.store.if206.2, %pred.store.continue205.2
%193 = extractelement <16 x i1> %178, i64 7
br i1 %193, label %pred.store.if208.2, label %pred.store.continue209.2
pred.store.if208.2: ; preds = %pred.store.continue207.2
%194 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 79
store i8 35, ptr %194, align 1, !tbaa !5
br label %pred.store.continue209.2
pred.store.continue209.2: ; preds = %pred.store.if208.2, %pred.store.continue207.2
%195 = extractelement <16 x i1> %178, i64 8
br i1 %195, label %pred.store.if210.2, label %pred.store.continue211.2
pred.store.if210.2: ; preds = %pred.store.continue209.2
%196 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 81
store i8 35, ptr %196, align 1, !tbaa !5
br label %pred.store.continue211.2
pred.store.continue211.2: ; preds = %pred.store.if210.2, %pred.store.continue209.2
%197 = extractelement <16 x i1> %178, i64 9
br i1 %197, label %pred.store.if212.2, label %pred.store.continue213.2
pred.store.if212.2: ; preds = %pred.store.continue211.2
%198 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 83
store i8 35, ptr %198, align 1, !tbaa !5
br label %pred.store.continue213.2
pred.store.continue213.2: ; preds = %pred.store.if212.2, %pred.store.continue211.2
%199 = extractelement <16 x i1> %178, i64 10
br i1 %199, label %pred.store.if214.2, label %pred.store.continue215.2
pred.store.if214.2: ; preds = %pred.store.continue213.2
%200 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 85
store i8 35, ptr %200, align 1, !tbaa !5
br label %pred.store.continue215.2
pred.store.continue215.2: ; preds = %pred.store.if214.2, %pred.store.continue213.2
%201 = extractelement <16 x i1> %178, i64 11
br i1 %201, label %pred.store.if216.2, label %pred.store.continue217.2
pred.store.if216.2: ; preds = %pred.store.continue215.2
%202 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 87
store i8 35, ptr %202, align 1, !tbaa !5
br label %pred.store.continue217.2
pred.store.continue217.2: ; preds = %pred.store.if216.2, %pred.store.continue215.2
%203 = extractelement <16 x i1> %178, i64 12
br i1 %203, label %pred.store.if218.2, label %pred.store.continue219.2
pred.store.if218.2: ; preds = %pred.store.continue217.2
%204 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 89
store i8 35, ptr %204, align 1, !tbaa !5
br label %pred.store.continue219.2
pred.store.continue219.2: ; preds = %pred.store.if218.2, %pred.store.continue217.2
%205 = extractelement <16 x i1> %178, i64 13
br i1 %205, label %pred.store.if220.2, label %pred.store.continue221.2
pred.store.if220.2: ; preds = %pred.store.continue219.2
%206 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 91
store i8 35, ptr %206, align 1, !tbaa !5
br label %pred.store.continue221.2
pred.store.continue221.2: ; preds = %pred.store.if220.2, %pred.store.continue219.2
%207 = extractelement <16 x i1> %178, i64 14
br i1 %207, label %pred.store.if222.2, label %pred.store.continue223.2
pred.store.if222.2: ; preds = %pred.store.continue221.2
%208 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 93
store i8 35, ptr %208, align 1, !tbaa !5
br label %pred.store.continue223.2
pred.store.continue223.2: ; preds = %pred.store.if222.2, %pred.store.continue221.2
%209 = extractelement <16 x i1> %178, i64 15
br i1 %209, label %pred.store.if224.2, label %for.body47
pred.store.if224.2: ; preds = %pred.store.continue223.2
%210 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 95
store i8 35, ptr %210, align 1, !tbaa !5
br label %for.body47
for.cond.cleanup41: ; preds = %for.inc56
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef 100)
br label %for.cond69.preheader
for.body47: ; preds = %pred.store.continue223.2, %pred.store.if224.2
%inc48 = add nuw i32 %cnt.2114, 49
%cmp49 = icmp slt i32 %inc48, %107
br i1 %cmp49, label %if.then50, label %for.inc56
if.then50: ; preds = %for.body47
%arrayidx54 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv136, i64 97
store i8 35, ptr %arrayidx54, align 1, !tbaa !5
br label %for.inc56
for.inc56: ; preds = %for.body47, %if.then50
%211 = add nuw nsw i32 %cnt.2114, 49
%indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 2
%cmp40 = icmp ult i64 %indvars.iv136, 98
br i1 %cmp40, label %vector.ph180, label %for.cond.cleanup41, !llvm.loop !13
for.cond69.preheader: ; preds = %for.cond.cleanup41, %for.cond.cleanup71
%indvars.iv143 = phi i64 [ 0, %for.cond.cleanup41 ], [ %indvars.iv.next144, %for.cond.cleanup71 ]
br label %for.body72
for.cond.cleanup66: ; preds = %for.cond.cleanup71
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %S) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #7
ret i32 0
for.cond.cleanup71: ; preds = %for.body72
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
%exitcond146.not = icmp eq i64 %indvars.iv.next144, 100
br i1 %exitcond146.not, label %for.cond.cleanup66, label %for.cond69.preheader, !llvm.loop !14
for.body72: ; preds = %for.cond69.preheader, %for.body72
%indvars.iv139 = phi i64 [ 0, %for.cond69.preheader ], [ %indvars.iv.next140, %for.body72 ]
%arrayidx76 = getelementptr inbounds [100 x [100 x i8]], ptr %S, i64 0, i64 %indvars.iv143, i64 %indvars.iv139
%212 = load i8, ptr %arrayidx76, align 1, !tbaa !5
%conv = sext i8 %212 to i32
%putchar105 = call i32 @putchar(i32 %conv)
%indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
%exitcond142.not = icmp eq i64 %indvars.iv.next140, 100
br i1 %exitcond142.not, label %for.cond.cleanup71, label %for.body72, !llvm.loop !15
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
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 = !{!"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}
!15 = distinct !{!15, !11}
|
#include <stdio.h>
int main(void){
int i;
char bt[4];
int cnt[4] = {};
while( scanf("%d,%s",&i, bt) != EOF ) {
if( bt[1] == 'B' ) {
cnt[3] ++;
} else if( bt[0] == 'A' ) {
cnt[0] ++;
} else if( bt[0] == 'B' ) {
cnt[1] ++;
} else {
cnt[2] ++;
}
}
printf("%d\n%d\n%d\n%d\n", cnt[0], cnt[1], cnt[3], cnt[2] );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180774/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180774/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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,%s\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%d\0A%d\0A%d\0A%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
%bt = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %bt) #3
%call36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %bt)
%cmp.not37 = icmp eq i32 %call36, -1
br i1 %cmp.not37, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx = getelementptr inbounds [4 x i8], ptr %bt, i64 0, i64 1
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end23
%cnt.sroa.12.041 = phi i32 [ 0, %while.body.lr.ph ], [ %cnt.sroa.12.1, %if.end23 ]
%cnt.sroa.9.040 = phi i32 [ 0, %while.body.lr.ph ], [ %cnt.sroa.9.1, %if.end23 ]
%cnt.sroa.6.039 = phi i32 [ 0, %while.body.lr.ph ], [ %cnt.sroa.6.1, %if.end23 ]
%cnt.sroa.0.038 = phi i32 [ 0, %while.body.lr.ph ], [ %cnt.sroa.0.1, %if.end23 ]
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp1 = icmp eq i8 %0, 66
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%inc = add nsw i32 %cnt.sroa.12.041, 1
br label %if.end23
if.else: ; preds = %while.body
%1 = load i8, ptr %bt, align 1, !tbaa !5
switch i8 %1, label %if.else19 [
i8 65, label %if.then8
i8 66, label %if.then16
]
if.then8: ; preds = %if.else
%inc10 = add nsw i32 %cnt.sroa.0.038, 1
br label %if.end23
if.then16: ; preds = %if.else
%inc18 = add nsw i32 %cnt.sroa.6.039, 1
br label %if.end23
if.else19: ; preds = %if.else
%inc21 = add nsw i32 %cnt.sroa.9.040, 1
br label %if.end23
if.end23: ; preds = %if.then8, %if.else19, %if.then16, %if.then
%cnt.sroa.0.1 = phi i32 [ %cnt.sroa.0.038, %if.then ], [ %inc10, %if.then8 ], [ %cnt.sroa.0.038, %if.then16 ], [ %cnt.sroa.0.038, %if.else19 ]
%cnt.sroa.6.1 = phi i32 [ %cnt.sroa.6.039, %if.then ], [ %cnt.sroa.6.039, %if.then8 ], [ %inc18, %if.then16 ], [ %cnt.sroa.6.039, %if.else19 ]
%cnt.sroa.9.1 = phi i32 [ %cnt.sroa.9.040, %if.then ], [ %cnt.sroa.9.040, %if.then8 ], [ %cnt.sroa.9.040, %if.then16 ], [ %inc21, %if.else19 ]
%cnt.sroa.12.1 = phi i32 [ %inc, %if.then ], [ %cnt.sroa.12.041, %if.then8 ], [ %cnt.sroa.12.041, %if.then16 ], [ %cnt.sroa.12.041, %if.else19 ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %bt)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %if.end23, %entry
%cnt.sroa.0.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.sroa.0.1, %if.end23 ]
%cnt.sroa.6.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.sroa.6.1, %if.end23 ]
%cnt.sroa.9.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.sroa.9.1, %if.end23 ]
%cnt.sroa.12.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.sroa.12.1, %if.end23 ]
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.sroa.0.0.lcssa, i32 noundef %cnt.sroa.6.0.lcssa, i32 noundef %cnt.sroa.12.0.lcssa, i32 noundef %cnt.sroa.9.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %bt) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 a,b,o,ab,n;
char x[5];
int main(){
a=b=o=ab=0;
while(scanf("%d,%s",&n,x)!=EOF){
if(strcmp(x, "A")==0) a++;
if(strcmp(x, "B")==0) b++;
if(strcmp(x, "O")==0) o++;
if(strcmp(x,"AB")==0)ab++;
}
printf("%d\n%d\n%d\n%d\n",a,b,ab,o);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180817/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180817/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@ab = dso_local local_unnamed_addr global i32 0, align 4
@o = dso_local local_unnamed_addr global i32 0, align 4
@b = dso_local local_unnamed_addr global i32 0, align 4
@a = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [6 x i8] c"%d,%s\00", align 1
@n = dso_local global i32 0, align 4
@x = dso_local global [5 x i8] zeroinitializer, align 1
@.str.1 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"B\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"O\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"AB\00", align 1
@.str.5 = private unnamed_addr constant [13 x i8] c"%d\0A%d\0A%d\0A%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
store i32 0, ptr @ab, align 4, !tbaa !5
store i32 0, ptr @o, align 4, !tbaa !5
store i32 0, ptr @b, align 4, !tbaa !5
store i32 0, ptr @a, align 4, !tbaa !5
%call22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @x)
%cmp.not23 = icmp eq i32 %call22, -1
br i1 %cmp.not23, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end17
%bcmp = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) @x, ptr noundef nonnull dereferenceable(2) @.str.1, i64 2)
%cmp2 = icmp eq i32 %bcmp, 0
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %while.body
%0 = load i32, ptr @a, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%bcmp19 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) @x, ptr noundef nonnull dereferenceable(2) @.str.2, i64 2)
%cmp4 = icmp eq i32 %bcmp19, 0
br i1 %cmp4, label %if.then5, label %if.end7
if.then5: ; preds = %if.end
%1 = load i32, ptr @b, align 4, !tbaa !5
%inc6 = add nsw i32 %1, 1
store i32 %inc6, ptr @b, align 4, !tbaa !5
br label %if.end7
if.end7: ; preds = %if.then5, %if.end
%bcmp20 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) @x, ptr noundef nonnull dereferenceable(2) @.str.3, i64 2)
%cmp9 = icmp eq i32 %bcmp20, 0
br i1 %cmp9, label %if.then10, label %if.end12
if.then10: ; preds = %if.end7
%2 = load i32, ptr @o, align 4, !tbaa !5
%inc11 = add nsw i32 %2, 1
store i32 %inc11, ptr @o, align 4, !tbaa !5
br label %if.end12
if.end12: ; preds = %if.then10, %if.end7
%bcmp21 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(3) @x, ptr noundef nonnull dereferenceable(3) @.str.4, i64 3)
%cmp14 = icmp eq i32 %bcmp21, 0
br i1 %cmp14, label %if.then15, label %if.end17
if.then15: ; preds = %if.end12
%3 = load i32, ptr @ab, align 4, !tbaa !5
%inc16 = add nsw i32 %3, 1
store i32 %inc16, ptr @ab, align 4, !tbaa !5
br label %if.end17
if.end17: ; preds = %if.then15, %if.end12
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @x)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end17, %entry
%4 = load i32, ptr @a, align 4, !tbaa !5
%5 = load i32, ptr @b, align 4, !tbaa !5
%6 = load i32, ptr @ab, align 4, !tbaa !5
%7 = load i32, ptr @o, align 4, !tbaa !5
%call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7)
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 willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 willreturn memory(argmem: 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}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main(void){
char blood[3];
int a=0,b=0,o=0,ab=0;
while(scanf("%*d,%s",blood)!=EOF){
if(blood[1]=='B')ab++;
else if(blood[0]=='A')a++;
else if(blood[0]=='B')b++;
else if(blood[0]=='O')o++;
}
printf("%d\n%d\n%d\n%d\n",a,b,ab,o);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180897/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180897/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%*d,%s\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%d\0A%d\0A%d\0A%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%blood = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %blood) #3
%call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %blood)
%cmp.not32 = icmp eq i32 %call31, -1
br i1 %cmp.not32, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx = getelementptr inbounds [3 x i8], ptr %blood, i64 0, i64 1
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end25
%ab.036 = phi i32 [ 0, %while.body.lr.ph ], [ %ab.1, %if.end25 ]
%o.035 = phi i32 [ 0, %while.body.lr.ph ], [ %o.1, %if.end25 ]
%b.034 = phi i32 [ 0, %while.body.lr.ph ], [ %b.1, %if.end25 ]
%a.033 = phi i32 [ 0, %while.body.lr.ph ], [ %a.1, %if.end25 ]
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp1 = icmp eq i8 %0, 66
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%inc = add nsw i32 %ab.036, 1
br label %if.end25
if.else: ; preds = %while.body
%1 = load i8, ptr %blood, align 1, !tbaa !5
switch i8 %1, label %if.end25 [
i8 65, label %if.then7
i8 66, label %if.then14
i8 79, label %if.then21
]
if.then7: ; preds = %if.else
%inc8 = add nsw i32 %a.033, 1
br label %if.end25
if.then14: ; preds = %if.else
%inc15 = add nsw i32 %b.034, 1
br label %if.end25
if.then21: ; preds = %if.else
%inc22 = add nsw i32 %o.035, 1
br label %if.end25
if.end25: ; preds = %if.else, %if.then7, %if.then21, %if.then14, %if.then
%a.1 = phi i32 [ %a.033, %if.then ], [ %inc8, %if.then7 ], [ %a.033, %if.then14 ], [ %a.033, %if.then21 ], [ %a.033, %if.else ]
%b.1 = phi i32 [ %b.034, %if.then ], [ %b.034, %if.then7 ], [ %inc15, %if.then14 ], [ %b.034, %if.then21 ], [ %b.034, %if.else ]
%o.1 = phi i32 [ %o.035, %if.then ], [ %o.035, %if.then7 ], [ %o.035, %if.then14 ], [ %inc22, %if.then21 ], [ %o.035, %if.else ]
%ab.1 = phi i32 [ %inc, %if.then ], [ %ab.036, %if.then7 ], [ %ab.036, %if.then14 ], [ %ab.036, %if.then21 ], [ %ab.036, %if.else ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %blood)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %if.end25, %entry
%a.0.lcssa = phi i32 [ 0, %entry ], [ %a.1, %if.end25 ]
%b.0.lcssa = phi i32 [ 0, %entry ], [ %b.1, %if.end25 ]
%o.0.lcssa = phi i32 [ 0, %entry ], [ %o.1, %if.end25 ]
%ab.0.lcssa = phi i32 [ 0, %entry ], [ %ab.1, %if.end25 ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa, i32 noundef %b.0.lcssa, i32 noundef %ab.0.lcssa, i32 noundef %o.0.lcssa)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %blood) #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()
{
char str[1001];
int n,m;
while(scanf("%d\r",&n)!=EOF)
{
int i,k=0;
for( i=0;i<n;i++)
scanf("%c",&str[i]);
str[n]='\0';
for(int i=0;i<n-1;i++)
{
if(str[i]!=str[i+1])
{
printf("YES\n%c%c\n",str[i],str[i+1]);
k=1;
break;
}
if(k)
break;
}
if(k==0||n==1) printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18094/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18094/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0D\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"YES\0A%c%c\0A\00", align 1
@str = 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:
%str = alloca [1001 x i8], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not54 = icmp eq i32 %call53, -1
br i1 %cmp.not54, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end35
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp151 = icmp sgt i32 %0, 0
br i1 %cmp151, label %for.body, label %for.cond.preheader.for.end_crit_edge
for.cond.preheader.for.end_crit_edge: ; preds = %for.cond.preheader
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %for.cond.preheader.for.end_crit_edge
%idxprom3.pre-phi = phi i64 [ %.pre, %for.cond.preheader.for.end_crit_edge ], [ %2, %for.body ]
%.lcssa = phi i32 [ %0, %for.cond.preheader.for.end_crit_edge ], [ %1, %for.body ]
%arrayidx4 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom3.pre-phi
store i8 0, ptr %arrayidx4, align 1, !tbaa !11
%3 = call i32 @llvm.smax.i32(i32 %.lcssa, i32 1)
%smax = add nsw i32 %3, -1
%wide.trip.count = zext i32 %smax to i64
br label %for.cond6
for.cond6: ; preds = %for.body8, %for.end
%indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.body8 ], [ 0, %for.end ]
%exitcond.not = icmp eq i64 %indvars.iv59, %wide.trip.count
br i1 %exitcond.not, label %if.then33, label %for.body8
for.body8: ; preds = %for.cond6
%arrayidx10 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv59
%4 = load i8, ptr %arrayidx10, align 1, !tbaa !11
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%arrayidx12 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv.next60
%5 = load i8, ptr %arrayidx12, align 1, !tbaa !11
%cmp14.not = icmp eq i8 %4, %5
br i1 %cmp14.not, label %for.cond6, label %cleanup, !llvm.loop !12
cleanup: ; preds = %for.body8
%conv13 = sext i8 %5 to i32
%conv = sext i8 %4 to i32
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv, i32 noundef %conv13)
%6 = load i32, ptr %n, align 4
%cmp31 = icmp eq i32 %6, 1
br i1 %cmp31, label %if.then33, label %if.end35
if.then33: ; preds = %for.cond6, %cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end35
if.end35: ; preds = %cleanup, %if.then33
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !13
while.end: ; preds = %if.end35, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <math.h>
int main(void){
int i, j, k = 3, a, n, s[10000], p[10000];
p[0] = 1; s[0] = 0;
p[1] = 2; s[1] = 2;
p[2] = 3; s[2] = 5;
for(i = 5; i <= 104729; i += 2){
a = 0;
for(j = 2; p[j] <= sqrt((double)i); j++){
if(i % p[j] == 0){
a++;
break;
}
}
if(a == 0){
p[k] = i;
s[k] = s[k-1]+p[k];
k++;
}
}
scanf("%d", &n);
while(n != 0){
printf("%d\n", s[n]);
scanf("%d", &n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180983/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180983/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [10000 x i32], align 16
%p = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %p) #4
store i32 1, ptr %p, align 16, !tbaa !5
store i32 0, ptr %s, align 16, !tbaa !5
%arrayidx2 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 1
store i32 2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 1
store i32 2, ptr %arrayidx3, align 4, !tbaa !5
%arrayidx4 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 2
store i32 3, ptr %arrayidx4, align 8, !tbaa !5
%arrayidx5 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 2
store i32 5, ptr %arrayidx5, align 8, !tbaa !5
br label %for.cond6.preheader
for.cond6.preheader: ; preds = %entry, %for.inc30
%k.057 = phi i32 [ 3, %entry ], [ %k.1, %for.inc30 ]
%i.056 = phi i32 [ 5, %entry ], [ %add31, %for.inc30 ]
%conv8 = sitofp i32 %i.056 to double
%0 = load i32, ptr %arrayidx4, align 8, !tbaa !5
%conv52 = sitofp i32 %0 to double
%call53 = tail call double @sqrt(double noundef %conv8) #4
%cmp954 = fcmp ult double %call53, %conv52
br i1 %cmp954, label %if.then19, label %for.body11
for.cond6: ; preds = %for.body11
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx7 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %indvars.iv.next
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%conv = sitofp i32 %1 to double
%call = tail call double @sqrt(double noundef %conv8) #4
%cmp9 = fcmp ult double %call, %conv
br i1 %cmp9, label %if.then19, label %for.body11, !llvm.loop !9
for.body11: ; preds = %for.cond6.preheader, %for.cond6
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond6 ], [ 2, %for.cond6.preheader ]
%2 = phi i32 [ %1, %for.cond6 ], [ %0, %for.cond6.preheader ]
%rem = srem i32 %i.056, %2
%cmp14 = icmp eq i32 %rem, 0
br i1 %cmp14, label %for.inc30, label %for.cond6
if.then19: ; preds = %for.cond6, %for.cond6.preheader
%idxprom20 = sext i32 %k.057 to i64
%arrayidx21 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %idxprom20
store i32 %i.056, ptr %arrayidx21, align 4, !tbaa !5
%sub = add nsw i32 %k.057, -1
%idxprom22 = sext i32 %sub to i64
%arrayidx23 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %idxprom22
%3 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%add = add nsw i32 %3, %i.056
%arrayidx27 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %idxprom20
store i32 %add, ptr %arrayidx27, align 4, !tbaa !5
%inc28 = add nsw i32 %k.057, 1
br label %for.inc30
for.inc30: ; preds = %for.body11, %if.then19
%k.1 = phi i32 [ %inc28, %if.then19 ], [ %k.057, %for.body11 ]
%add31 = add nuw nsw i32 %i.056, 2
%cmp = icmp ult i32 %i.056, 104728
br i1 %cmp, label %for.cond6.preheader, label %for.end32, !llvm.loop !11
for.end32: ; preds = %for.inc30
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp34.not58 = icmp eq i32 %4, 0
br i1 %cmp34.not58, label %while.end, label %while.body
while.body: ; preds = %for.end32, %while.body
%5 = phi i32 [ %7, %while.body ], [ %4, %for.end32 ]
%idxprom36 = sext i32 %5 to i64
%arrayidx37 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %idxprom36
%6 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6)
%call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp34.not = icmp eq i32 %7, 0
br i1 %cmp34.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %while.body, %for.end32
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 40000, 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: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #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 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 #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 <math.h>
int main(){
int a, n, i, j, z, s[10000], ans;
while(scanf("%d", &n) != 0){
if(n == 0) break;
if(n == 0){
printf("1\n");
continue;
}
ans = 0;
s[0] = 2;
a = 1;
for(i = 3; i <= 104729; i += 2){
z = 0;
for(j = 0; s[j] * s[j] <= i; j++){
if(i % s[j] == 0){
z = 1;
break;
}
}
if(z == 0){
s[a] = i;
a++;
if(a == n) break;
}
}
for(i = 0; i < a; i++) ans += s[i];
printf("%d\n", ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181047/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181047/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %s) #4
%call61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp62 = icmp eq i32 %call61, 0
%0 = load i32, ptr %n, align 4
%cmp163 = icmp eq i32 %0, 0
%or.cond64 = select i1 %cmp62, i1 true, i1 %cmp163
br i1 %or.cond64, label %while.end, label %if.end5
if.end5: ; preds = %entry, %for.end37
%1 = phi i32 [ %12, %for.end37 ], [ %0, %entry ]
store i32 2, ptr %s, align 16, !tbaa !5
br label %for.cond7.preheader
for.cond7.preheader: ; preds = %if.end5, %for.inc27
%i.057 = phi i32 [ 3, %if.end5 ], [ %add, %for.inc27 ]
%a.056 = phi i32 [ 1, %if.end5 ], [ %a.1, %for.inc27 ]
%2 = load i32, ptr %s, align 16, !tbaa !5
%mul53 = mul nsw i32 %2, %2
%cmp11.not54 = icmp ugt i32 %mul53, %i.057
br i1 %cmp11.not54, label %if.then19, label %for.body12
for.cond7: ; preds = %for.body12
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx8 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv.next
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%mul = mul nsw i32 %3, %3
%cmp11.not = icmp ugt i32 %mul, %i.057
br i1 %cmp11.not, label %if.then19, label %for.body12, !llvm.loop !9
for.body12: ; preds = %for.cond7.preheader, %for.cond7
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond7 ], [ 0, %for.cond7.preheader ]
%4 = phi i32 [ %3, %for.cond7 ], [ %2, %for.cond7.preheader ]
%rem = srem i32 %i.057, %4
%cmp15 = icmp eq i32 %rem, 0
br i1 %cmp15, label %for.inc27, label %for.cond7
if.then19: ; preds = %for.cond7, %for.cond7.preheader
%idxprom20 = sext i32 %a.056 to i64
%arrayidx21 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %idxprom20
store i32 %i.057, ptr %arrayidx21, align 4, !tbaa !5
%inc22 = add nsw i32 %a.056, 1
%cmp23 = icmp eq i32 %inc22, %1
br i1 %cmp23, label %for.end28, label %for.inc27
for.inc27: ; preds = %for.body12, %if.then19
%a.1 = phi i32 [ %inc22, %if.then19 ], [ %a.056, %for.body12 ]
%add = add nuw nsw i32 %i.057, 2
%cmp6 = icmp ult i32 %i.057, 104728
br i1 %cmp6, label %for.cond7.preheader, label %for.end28, !llvm.loop !11
for.end28: ; preds = %if.then19, %for.inc27
%a.2 = phi i32 [ %1, %if.then19 ], [ %a.1, %for.inc27 ]
%cmp3058 = icmp sgt i32 %a.2, 0
br i1 %cmp3058, label %for.body31.preheader, label %for.end37
for.body31.preheader: ; preds = %for.end28
%wide.trip.count = zext i32 %a.2 to i64
%min.iters.check = icmp ult i32 %a.2, 8
br i1 %min.iters.check, label %for.body31.preheader71, label %vector.ph
vector.ph: ; preds = %for.body31.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 ], [ %7, %vector.body ]
%vec.phi69 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%5 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load70 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = add <4 x i32> %wide.load, %vec.phi
%8 = add <4 x i32> %wide.load70, %vec.phi69
%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 !12
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.vec, %wide.trip.count
br i1 %cmp.n, label %for.end37, label %for.body31.preheader71
for.body31.preheader71: ; preds = %for.body31.preheader, %middle.block
%indvars.iv66.ph = phi i64 [ 0, %for.body31.preheader ], [ %n.vec, %middle.block ]
%ans.060.ph = phi i32 [ 0, %for.body31.preheader ], [ %10, %middle.block ]
br label %for.body31
for.body31: ; preds = %for.body31.preheader71, %for.body31
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.body31 ], [ %indvars.iv66.ph, %for.body31.preheader71 ]
%ans.060 = phi i32 [ %add34, %for.body31 ], [ %ans.060.ph, %for.body31.preheader71 ]
%arrayidx33 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv66
%11 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%add34 = add nsw i32 %11, %ans.060
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%exitcond.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count
br i1 %exitcond.not, label %for.end37, label %for.body31, !llvm.loop !15
for.end37: ; preds = %for.body31, %middle.block, %for.end28
%ans.0.lcssa = phi i32 [ 0, %for.end28 ], [ %10, %middle.block ], [ %add34, %for.body31 ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp = icmp eq i32 %call, 0
%12 = load i32, ptr %n, align 4
%cmp1 = icmp eq i32 %12, 0
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %while.end, label %if.end5, !llvm.loop !16
while.end: ; preds = %for.end37, %entry
call void @llvm.lifetime.end.p0(i64 40000, 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
!16 = distinct !{!16, !10}
|
// AOJ 2249: Road Construction
// 2017.11.15 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 20000
typedef struct { int t, node, c; } QUE;
QUE que[MAX]; int qsize;
#define PARENT(i) ((i)>>1)
#define LEFT(i) ((i)<<1)
#define RIGHT(i) (((i)<<1)+1)
void min_heapify(int i)
{
int l, r, min;
l = LEFT(i), r = RIGHT(i);
if (l < qsize && (que[l].t < que[i].t ||
que[l].t == que[i].t && que[l].c < que[i].c)) min = l; else min = i;
if (r < qsize && (que[r].t < que[min].t ||
que[r].t == que[min].t && que[r].c < que[min].c)) min = r;
if (min != i) {
QUE t = que[i]; que[i] = que[min]; que[min] = t;
min_heapify(min);
}
}
int deq(int *n, int *t, int *c)
{
if (qsize == 0) return 0;
*n = que[0].node, *t = que[0].t, *c = que[0].c;
que[0] = que[--qsize];
min_heapify(0);
return 1;
}
void enq(int n, int t, int c)
{
int i, min;
i = qsize++;
que[i].node = n, que[i].t = t, que[i].c = c;
while (i > 0 && (que[min = PARENT(i)].t > que[i].t ||
que[min].t == que[i].t && que[min].c > que[i].c)) {
QUE tt = que[i]; que[i] = que[min]; que[min] = tt;
i = min;
}
}
#define INF 0x55555555
#define TOSIZE 250
typedef struct { int len, lim, *to, *d, *c; } TBL;
TBL *tbl; char *visited; int size;
int dijkstra(int start)
{
int i, s, e, c, d, ans = 0;
TBL *tp;
qsize = 0;
memset(visited, 0, sizeof(char)*size);
enq(start, 0, 0);
while(deq(&s, &d, &c)) {
// if (s == goal) break;
if (visited[s]) continue;
visited[s] = 1;
ans += c;
tp = tbl + s;
for (i = 0; i < tp->len; i++) {
e = tp->to[i];
if (visited[e]) continue;
enq(e, d + tp->d[i], tp->c[i]);
}
}
return ans;
}
char buf[40], *p;
int getint()
{
int n = 0;
while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
return n;
}
void checkMem(TBL *p)
{
int *to;
if (p->len < p->lim) return;
to = calloc(2 * p->lim + 2, sizeof(int));
memcpy(to, p->to, p->lim * sizeof(int));
p->lim *= 2;
free(p->to);
p->to = to;
}
int main()
{
int n, m, i, k, u, v, d, c;
TBL *tp;
while (fgets(p=buf, 40, stdin) && *p != '0') {
size = n = getint(), p++, m = getint();
tbl = calloc(size+2, sizeof(TBL));
visited = calloc(size+2, sizeof(char));
for (i = 0; i < size; i++) {
tbl[i].len = 0, tbl[i].lim = TOSIZE;
tbl[i].to = calloc(TOSIZE+2, sizeof(int));
tbl[i].c = calloc(TOSIZE+2, sizeof(int));
tbl[i].d = calloc(TOSIZE+2, sizeof(int));
}
for (i = 0; i < m; i++) {
fgets(p=buf, 40, stdin);
u = getint()-1, p++, v = getint()-1, p++, d = getint(), p++, c = getint();
tp = tbl+u, checkMem(tp);
k = tp->len, tp->to[k] = v, tp->d[k] = d, tp->c[k] = c, tp->len++;
tp = tbl+v, checkMem(tp);
k = tp->len, tp->to[k] = u, tp->d[k] = d, tp->c[k] = c, tp->len++;
}
printf("%d\n", dijkstra(0));
for (i = 0; i < size; i++) free(tbl[i].d), free(tbl[i].c), free(tbl[i].to);
free(visited), free(tbl);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181098/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181098/source.c"
target datalayout = "e-m:e-p270: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.QUE = type { i32, i32, i32 }
%struct.TBL = type { i32, i32, ptr, ptr, ptr }
@qsize = dso_local local_unnamed_addr global i32 0, align 4
@que = dso_local local_unnamed_addr global [20000 x %struct.QUE] zeroinitializer, align 16
@visited = dso_local local_unnamed_addr global ptr null, align 8
@size = dso_local local_unnamed_addr global i32 0, align 4
@tbl = dso_local local_unnamed_addr global ptr null, align 8
@p = dso_local local_unnamed_addr global ptr null, align 8
@buf = dso_local global [40 x i8] zeroinitializer, align 16
@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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @min_heapify(i32 noundef %i) local_unnamed_addr #0 {
entry:
%t49 = alloca %struct.QUE, align 4
%0 = load i32, ptr @qsize, align 4, !tbaa !5
br label %tailrecurse
tailrecurse: ; preds = %if.then48, %entry
%i.tr = phi i32 [ %i, %entry ], [ %min.1, %if.then48 ]
%shl = shl i32 %i.tr, 1
%add = or i32 %shl, 1
%cmp = icmp slt i32 %shl, %0
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %tailrecurse
%idxprom = sext i32 %shl to i64
%arrayidx = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 8, !tbaa !9
%idxprom2 = sext i32 %i.tr to i64
%arrayidx3 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2
%2 = load i32, ptr %arrayidx3, align 4, !tbaa !9
%cmp5 = icmp slt i32 %1, %2
br i1 %cmp5, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %land.lhs.true
%cmp12 = icmp eq i32 %1, %2
br i1 %cmp12, label %land.lhs.true13, label %if.else
land.lhs.true13: ; preds = %lor.lhs.false
%c = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 2
%3 = load i32, ptr %c, align 8, !tbaa !11
%c18 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2, i32 2
%4 = load i32, ptr %c18, align 4, !tbaa !11
%cmp19 = icmp slt i32 %3, %4
br i1 %cmp19, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true13, %lor.lhs.false, %tailrecurse
br label %if.end
if.end: ; preds = %land.lhs.true, %land.lhs.true13, %if.else
%min.0 = phi i32 [ %i.tr, %if.else ], [ %shl, %land.lhs.true13 ], [ %shl, %land.lhs.true ]
%cmp20 = icmp slt i32 %add, %0
br i1 %cmp20, label %land.lhs.true21, label %if.end46
land.lhs.true21: ; preds = %if.end
%idxprom22 = sext i32 %add to i64
%arrayidx23 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom22
%5 = load i32, ptr %arrayidx23, align 4, !tbaa !9
%idxprom25 = sext i32 %min.0 to i64
%arrayidx26 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom25
%6 = load i32, ptr %arrayidx26, align 4, !tbaa !9
%cmp28 = icmp slt i32 %5, %6
br i1 %cmp28, label %if.then45, label %lor.lhs.false29
lor.lhs.false29: ; preds = %land.lhs.true21
%cmp36 = icmp eq i32 %5, %6
br i1 %cmp36, label %land.lhs.true37, label %if.end46
land.lhs.true37: ; preds = %lor.lhs.false29
%c40 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom22, i32 2
%7 = load i32, ptr %c40, align 4, !tbaa !11
%c43 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom25, i32 2
%8 = load i32, ptr %c43, align 4, !tbaa !11
%cmp44 = icmp slt i32 %7, %8
br i1 %cmp44, label %if.then45, label %if.end46
if.then45: ; preds = %land.lhs.true37, %land.lhs.true21
br label %if.end46
if.end46: ; preds = %if.then45, %land.lhs.true37, %lor.lhs.false29, %if.end
%min.1 = phi i32 [ %add, %if.then45 ], [ %min.0, %land.lhs.true37 ], [ %min.0, %lor.lhs.false29 ], [ %min.0, %if.end ]
%cmp47.not = icmp eq i32 %min.1, %i.tr
br i1 %cmp47.not, label %if.end58, label %if.then48
if.then48: ; preds = %if.end46
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t49)
%idxprom50 = sext i32 %i.tr to i64
%arrayidx51 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom50
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t49, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx51, i64 12, i1 false), !tbaa.struct !12
%idxprom54 = sext i32 %min.1 to i64
%arrayidx55 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom54
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx51, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx55, i64 12, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx55, ptr noundef nonnull align 4 dereferenceable(12) %t49, i64 12, i1 false), !tbaa.struct !12
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t49)
br label %tailrecurse
if.end58: ; preds = %if.end46
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable
define dso_local i32 @deq(ptr nocapture noundef writeonly %n, ptr nocapture noundef writeonly %t, ptr nocapture noundef writeonly %c) local_unnamed_addr #3 {
entry:
%t49.i = alloca %struct.QUE, align 4
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%1 = load i32, ptr getelementptr inbounds ([20000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !13
store i32 %1, ptr %n, align 4, !tbaa !5
%2 = load i32, ptr @que, align 16, !tbaa !9
store i32 %2, ptr %t, align 4, !tbaa !5
%3 = load i32, ptr getelementptr inbounds ([20000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 2), align 8, !tbaa !11
store i32 %3, ptr %c, align 4, !tbaa !5
%4 = load i32, ptr @qsize, align 4, !tbaa !5
%dec = add nsw i32 %4, -1
store i32 %dec, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) @que, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !12
br label %tailrecurse.i
tailrecurse.i: ; preds = %if.then48.i, %if.end
%i.tr.i = phi i32 [ 0, %if.end ], [ %min.1.i, %if.then48.i ]
%shl.i = shl i32 %i.tr.i, 1
%add.i = or i32 %shl.i, 1
%cmp.i = icmp slt i32 %shl.i, %dec
br i1 %cmp.i, label %land.lhs.true.i, label %if.else.i
land.lhs.true.i: ; preds = %tailrecurse.i
%idxprom.i = sext i32 %shl.i to i64
%arrayidx.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 8, !tbaa !9
%idxprom2.i = sext i32 %i.tr.i to i64
%arrayidx3.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2.i
%6 = load i32, ptr %arrayidx3.i, align 4, !tbaa !9
%cmp5.i = icmp slt i32 %5, %6
br i1 %cmp5.i, label %if.end.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %land.lhs.true.i
%cmp12.i = icmp eq i32 %5, %6
br i1 %cmp12.i, label %land.lhs.true13.i, label %if.else.i
land.lhs.true13.i: ; preds = %lor.lhs.false.i
%c.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i, i32 2
%7 = load i32, ptr %c.i, align 8, !tbaa !11
%c18.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2.i, i32 2
%8 = load i32, ptr %c18.i, align 4, !tbaa !11
%cmp19.i = icmp slt i32 %7, %8
br i1 %cmp19.i, label %if.end.i, label %if.else.i
if.else.i: ; preds = %land.lhs.true13.i, %lor.lhs.false.i, %tailrecurse.i
br label %if.end.i
if.end.i: ; preds = %if.else.i, %land.lhs.true13.i, %land.lhs.true.i
%min.0.i = phi i32 [ %i.tr.i, %if.else.i ], [ %shl.i, %land.lhs.true13.i ], [ %shl.i, %land.lhs.true.i ]
%cmp20.i = icmp slt i32 %add.i, %dec
br i1 %cmp20.i, label %land.lhs.true21.i, label %if.end46.i
land.lhs.true21.i: ; preds = %if.end.i
%idxprom22.i = sext i32 %add.i to i64
%arrayidx23.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom22.i
%9 = load i32, ptr %arrayidx23.i, align 4, !tbaa !9
%idxprom25.i = sext i32 %min.0.i to i64
%arrayidx26.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom25.i
%10 = load i32, ptr %arrayidx26.i, align 4, !tbaa !9
%cmp28.i = icmp slt i32 %9, %10
br i1 %cmp28.i, label %if.then45.i, label %lor.lhs.false29.i
lor.lhs.false29.i: ; preds = %land.lhs.true21.i
%cmp36.i = icmp eq i32 %9, %10
br i1 %cmp36.i, label %land.lhs.true37.i, label %if.end46.i
land.lhs.true37.i: ; preds = %lor.lhs.false29.i
%c40.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom22.i, i32 2
%11 = load i32, ptr %c40.i, align 4, !tbaa !11
%c43.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom25.i, i32 2
%12 = load i32, ptr %c43.i, align 4, !tbaa !11
%cmp44.i = icmp slt i32 %11, %12
br i1 %cmp44.i, label %if.then45.i, label %if.end46.i
if.then45.i: ; preds = %land.lhs.true37.i, %land.lhs.true21.i
br label %if.end46.i
if.end46.i: ; preds = %if.then45.i, %land.lhs.true37.i, %lor.lhs.false29.i, %if.end.i
%min.1.i = phi i32 [ %add.i, %if.then45.i ], [ %min.0.i, %land.lhs.true37.i ], [ %min.0.i, %lor.lhs.false29.i ], [ %min.0.i, %if.end.i ]
%cmp47.not.i = icmp eq i32 %min.1.i, %i.tr.i
br i1 %cmp47.not.i, label %return, label %if.then48.i
if.then48.i: ; preds = %if.end46.i
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t49.i)
%idxprom50.i = sext i32 %i.tr.i to i64
%arrayidx51.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom50.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %t49.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx51.i, i64 12, i1 false), !tbaa.struct !12
%idxprom54.i = sext i32 %min.1.i to i64
%arrayidx55.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom54.i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx51.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx55.i, i64 12, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx55.i, ptr noundef nonnull align 4 dereferenceable(12) %t49.i, i64 12, i1 false), !tbaa.struct !12
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t49.i)
br label %tailrecurse.i
return: ; preds = %if.end46.i, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 1, %if.end46.i ]
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @enq(i32 noundef %n, i32 noundef %t, i32 noundef %c) local_unnamed_addr #0 {
entry:
%tt = alloca %struct.QUE, align 4
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
%node = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1
store i32 %n, ptr %node, align 4, !tbaa !13
store i32 %t, ptr %arrayidx, align 4, !tbaa !9
%c6 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 2
store i32 %c, ptr %c6, align 4, !tbaa !11
%cmp52 = icmp sgt i32 %0, 0
br i1 %cmp52, label %land.rhs, label %while.end
land.rhs: ; preds = %entry, %while.body
%i.053 = phi i32 [ %shr, %while.body ], [ %0, %entry ]
%shr = lshr i32 %i.053, 1
%idxprom7 = zext i32 %shr to i64
%arrayidx8 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !9
%idxprom10 = zext i32 %i.053 to i64
%arrayidx11 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom10
%2 = load i32, ptr %arrayidx11, align 4, !tbaa !9
%cmp13 = icmp sgt i32 %1, %2
br i1 %cmp13, label %while.body, label %lor.rhs
lor.rhs: ; preds = %land.rhs
%cmp20 = icmp eq i32 %1, %2
br i1 %cmp20, label %land.rhs21, label %while.end
land.rhs21: ; preds = %lor.rhs
%c24 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7, i32 2
%3 = load i32, ptr %c24, align 4, !tbaa !11
%c27 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom10, i32 2
%4 = load i32, ptr %c27, align 4, !tbaa !11
%cmp28 = icmp sgt i32 %3, %4
br i1 %cmp28, label %while.body, label %while.end
while.body: ; preds = %land.rhs, %land.rhs21
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tt)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tt, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, i64 12, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8, i64 12, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8, ptr noundef nonnull align 4 dereferenceable(12) %tt, i64 12, i1 false), !tbaa.struct !12
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tt)
%cmp.not = icmp ult i32 %i.053, 2
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !14
while.end: ; preds = %land.rhs21, %lor.rhs, %while.body, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @dijkstra(i32 noundef %start) local_unnamed_addr #4 {
entry:
%tt.i28 = alloca %struct.QUE, align 4
%tt.i = alloca %struct.QUE, align 4
%s = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #12
store i32 0, ptr @qsize, align 4, !tbaa !5
%0 = load ptr, ptr @visited, align 8, !tbaa !16
%1 = load i32, ptr @size, align 4, !tbaa !5
%conv = sext i32 %1 to i64
tail call void @llvm.memset.p0.i64(ptr align 1 %0, i8 0, i64 %conv, i1 false)
%2 = load i32, ptr @qsize, align 4, !tbaa !5
%inc.i = add nsw i32 %2, 1
store i32 %inc.i, ptr @qsize, align 4, !tbaa !5
%idxprom.i = sext i32 %2 to i64
%arrayidx.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i
%node.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i, i32 1
store i32 %start, ptr %node.i, align 4, !tbaa !13
store i32 0, ptr %arrayidx.i, align 4, !tbaa !9
%c6.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i, i32 2
store i32 0, ptr %c6.i, align 4, !tbaa !11
%cmp52.i = icmp sgt i32 %2, 0
br i1 %cmp52.i, label %land.rhs.i, label %while.cond.outer.preheader
land.rhs.i: ; preds = %entry, %while.body.i
%i.053.i = phi i32 [ %shr.i, %while.body.i ], [ %2, %entry ]
%shr.i = lshr i32 %i.053.i, 1
%idxprom7.i = zext i32 %shr.i to i64
%arrayidx8.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i
%3 = load i32, ptr %arrayidx8.i, align 4, !tbaa !9
%idxprom10.i = zext i32 %i.053.i to i64
%arrayidx11.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom10.i
%4 = load i32, ptr %arrayidx11.i, align 4, !tbaa !9
%cmp13.i = icmp sgt i32 %3, %4
br i1 %cmp13.i, label %while.body.i, label %lor.rhs.i
lor.rhs.i: ; preds = %land.rhs.i
%cmp20.i = icmp eq i32 %3, %4
br i1 %cmp20.i, label %land.rhs21.i, label %while.cond.outer.preheader
land.rhs21.i: ; preds = %lor.rhs.i
%c24.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i, i32 2
%5 = load i32, ptr %c24.i, align 4, !tbaa !11
%c27.i = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom10.i, i32 2
%6 = load i32, ptr %c27.i, align 4, !tbaa !11
%cmp28.i = icmp sgt i32 %5, %6
br i1 %cmp28.i, label %while.body.i, label %while.cond.outer.preheader
while.body.i: ; preds = %land.rhs21.i, %land.rhs.i
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tt.i)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tt.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, i64 12, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8.i, i64 12, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8.i, ptr noundef nonnull align 4 dereferenceable(12) %tt.i, i64 12, i1 false), !tbaa.struct !12
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tt.i)
%cmp.not.i = icmp ult i32 %i.053.i, 2
br i1 %cmp.not.i, label %while.cond.outer.preheader, label %land.rhs.i, !llvm.loop !14
while.cond.outer.preheader: ; preds = %lor.rhs.i, %land.rhs21.i, %while.body.i, %entry
br label %while.cond.outer
while.cond.outer: ; preds = %while.cond.outer.backedge, %while.cond.outer.preheader
%ans.0.ph = phi i32 [ 0, %while.cond.outer.preheader ], [ %add, %while.cond.outer.backedge ]
br label %while.cond
while.cond: ; preds = %while.cond.outer, %while.body
%call = call i32 @deq(ptr noundef nonnull %s, ptr noundef nonnull %d, ptr noundef nonnull %c), !range !18
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %while.end, label %while.body
while.body: ; preds = %while.cond
%7 = load ptr, ptr @visited, align 8, !tbaa !16
%8 = load i32, ptr %s, align 4, !tbaa !5
%idxprom = sext i32 %8 to i64
%arrayidx = getelementptr inbounds i8, ptr %7, i64 %idxprom
%9 = load i8, ptr %arrayidx, align 1, !tbaa !19
%tobool1.not = icmp eq i8 %9, 0
br i1 %tobool1.not, label %if.end, label %while.cond, !llvm.loop !20
if.end: ; preds = %while.body
%arrayidx.le = getelementptr inbounds i8, ptr %7, i64 %idxprom
store i8 1, ptr %arrayidx.le, align 1, !tbaa !19
%10 = load i32, ptr %c, align 4, !tbaa !5
%add = add nsw i32 %10, %ans.0.ph
%11 = load ptr, ptr @tbl, align 8, !tbaa !16
%add.ptr = getelementptr inbounds %struct.TBL, ptr %11, i64 %idxprom
%12 = load i32, ptr %add.ptr, align 8, !tbaa !21
%cmp53 = icmp sgt i32 %12, 0
br i1 %cmp53, label %for.body.lr.ph, label %while.cond.outer.backedge
while.cond.outer.backedge: ; preds = %for.inc, %if.end
br label %while.cond.outer, !llvm.loop !20
for.body.lr.ph: ; preds = %if.end
%to = getelementptr inbounds %struct.TBL, ptr %11, i64 %idxprom, i32 2
%13 = load ptr, ptr @visited, align 8, !tbaa !16
%14 = load i32, ptr %d, align 4
%d12 = getelementptr inbounds %struct.TBL, ptr %11, i64 %idxprom, i32 3
%c16 = getelementptr inbounds %struct.TBL, ptr %11, i64 %idxprom, i32 4
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%15 = load ptr, ptr %to, align 8, !tbaa !23
%arrayidx6 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv
%16 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%idxprom7 = sext i32 %16 to i64
%arrayidx8 = getelementptr inbounds i8, ptr %13, i64 %idxprom7
%17 = load i8, ptr %arrayidx8, align 1, !tbaa !19
%tobool9.not = icmp eq i8 %17, 0
br i1 %tobool9.not, label %if.end11, label %for.inc
if.end11: ; preds = %for.body
%18 = load ptr, ptr %d12, align 8, !tbaa !24
%arrayidx14 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv
%19 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%add15 = add nsw i32 %19, %14
%20 = load ptr, ptr %c16, align 8, !tbaa !25
%arrayidx18 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv
%21 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%22 = load i32, ptr @qsize, align 4, !tbaa !5
%inc.i29 = add nsw i32 %22, 1
store i32 %inc.i29, ptr @qsize, align 4, !tbaa !5
%idxprom.i30 = sext i32 %22 to i64
%arrayidx.i31 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i30
%node.i32 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i30, i32 1
store i32 %16, ptr %node.i32, align 4, !tbaa !13
store i32 %add15, ptr %arrayidx.i31, align 4, !tbaa !9
%c6.i33 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i30, i32 2
store i32 %21, ptr %c6.i33, align 4, !tbaa !11
%cmp52.i34 = icmp sgt i32 %22, 0
br i1 %cmp52.i34, label %land.rhs.i35, label %for.inc
land.rhs.i35: ; preds = %if.end11, %while.body.i49
%i.053.i36 = phi i32 [ %shr.i37, %while.body.i49 ], [ %22, %if.end11 ]
%shr.i37 = lshr i32 %i.053.i36, 1
%idxprom7.i38 = zext i32 %shr.i37 to i64
%arrayidx8.i39 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i38
%23 = load i32, ptr %arrayidx8.i39, align 4, !tbaa !9
%idxprom10.i40 = zext i32 %i.053.i36 to i64
%arrayidx11.i41 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom10.i40
%24 = load i32, ptr %arrayidx11.i41, align 4, !tbaa !9
%cmp13.i42 = icmp sgt i32 %23, %24
br i1 %cmp13.i42, label %while.body.i49, label %lor.rhs.i43
lor.rhs.i43: ; preds = %land.rhs.i35
%cmp20.i44 = icmp eq i32 %23, %24
br i1 %cmp20.i44, label %land.rhs21.i45, label %for.inc
land.rhs21.i45: ; preds = %lor.rhs.i43
%c24.i46 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i38, i32 2
%25 = load i32, ptr %c24.i46, align 4, !tbaa !11
%c27.i47 = getelementptr inbounds [20000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom10.i40, i32 2
%26 = load i32, ptr %c27.i47, align 4, !tbaa !11
%cmp28.i48 = icmp sgt i32 %25, %26
br i1 %cmp28.i48, label %while.body.i49, label %for.inc
while.body.i49: ; preds = %land.rhs21.i45, %land.rhs.i35
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tt.i28)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tt.i28, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i41, i64 12, i1 false), !tbaa.struct !12
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i41, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8.i39, i64 12, i1 false), !tbaa.struct !12
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx8.i39, ptr noundef nonnull align 4 dereferenceable(12) %tt.i28, i64 12, i1 false), !tbaa.struct !12
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tt.i28)
%cmp.not.i50 = icmp ult i32 %i.053.i36, 2
br i1 %cmp.not.i50, label %for.inc, label %land.rhs.i35, !llvm.loop !14
for.inc: ; preds = %while.body.i49, %land.rhs21.i45, %lor.rhs.i43, %if.end11, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%27 = load i32, ptr %add.ptr, align 8, !tbaa !21
%28 = sext i32 %27 to i64
%cmp = icmp slt i64 %indvars.iv.next, %28
br i1 %cmp, label %for.body, label %while.cond.outer.backedge, !llvm.loop !26
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #12
ret i32 %ans.0.ph
}
; 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 norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @getint() local_unnamed_addr #6 {
entry:
%p.promoted = load ptr, ptr @p, align 8, !tbaa !16
%0 = load i8, ptr %p.promoted, align 1, !tbaa !19
%cmp8 = icmp sgt i8 %0, 47
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%n.010 = phi i32 [ %add4, %while.body ], [ 0, %entry ]
%incdec.ptr79 = phi ptr [ %incdec.ptr, %while.body ], [ %p.promoted, %entry ]
%add = mul i32 %n.010, 10
%incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr79, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !16
%1 = load i8, ptr %incdec.ptr79, align 1, !tbaa !19
%2 = and i8 %1, 15
%and = zext i8 %2 to i32
%add4 = add nsw i32 %add, %and
%3 = load i8, ptr %incdec.ptr, align 1, !tbaa !19
%cmp = icmp sgt i8 %3, 47
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !27
while.end: ; preds = %while.body, %entry
%n.0.lcssa = phi i32 [ 0, %entry ], [ %add4, %while.body ]
ret i32 %n.0.lcssa
}
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @checkMem(ptr nocapture noundef %p) local_unnamed_addr #7 {
entry:
%0 = load i32, ptr %p, align 8, !tbaa !21
%lim = getelementptr inbounds %struct.TBL, ptr %p, i64 0, i32 1
%1 = load i32, ptr %lim, align 4, !tbaa !28
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%mul = shl nsw i32 %1, 1
%add = add nsw i32 %mul, 2
%conv = sext i32 %add to i64
%call = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #13
%to2 = getelementptr inbounds %struct.TBL, ptr %p, i64 0, i32 2
%2 = load ptr, ptr %to2, align 8, !tbaa !23
%conv4 = sext i32 %1 to i64
%mul5 = shl nsw i64 %conv4, 2
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %call, ptr align 4 %2, i64 %mul5, i1 false)
store i32 %mul, ptr %lim, align 4, !tbaa !28
tail call void @free(ptr noundef %2) #12
store ptr %call, ptr %to2, align 8, !tbaa !23
br label %cleanup
cleanup: ; preds = %entry, %if.end
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #8
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #9
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #10 {
entry:
store ptr @buf, ptr @p, align 8, !tbaa !16
%0 = load ptr, ptr @stdin, align 8, !tbaa !16
%call196 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 40, ptr noundef %0)
%tobool.not197 = icmp eq ptr %call196, null
br i1 %tobool.not197, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %for.end83
%1 = load ptr, ptr @p, align 8, !tbaa !16
%2 = load i8, ptr %1, align 1, !tbaa !19
%cmp.not = icmp eq i8 %2, 48
br i1 %cmp.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp8.i = icmp sgt i8 %2, 47
br i1 %cmp8.i, label %while.body.i, label %getint.exit
while.body.i: ; preds = %while.body, %while.body.i
%n.010.i = phi i32 [ %add4.i, %while.body.i ], [ 0, %while.body ]
%incdec.ptr79.i = phi ptr [ %incdec.ptr.i, %while.body.i ], [ %1, %while.body ]
%add.i = mul i32 %n.010.i, 10
%incdec.ptr.i = getelementptr inbounds i8, ptr %incdec.ptr79.i, i64 1
store ptr %incdec.ptr.i, ptr @p, align 8, !tbaa !16
%3 = load i8, ptr %incdec.ptr79.i, align 1, !tbaa !19
%4 = and i8 %3, 15
%and.i = zext i8 %4 to i32
%add4.i = add nsw i32 %add.i, %and.i
%5 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !19
%cmp.i = icmp sgt i8 %5, 47
br i1 %cmp.i, label %while.body.i, label %getint.exit, !llvm.loop !27
getint.exit: ; preds = %while.body.i, %while.body
%6 = phi ptr [ %1, %while.body ], [ %incdec.ptr.i, %while.body.i ]
%7 = phi i32 [ 0, %while.body ], [ %add4.i, %while.body.i ]
store i32 %7, ptr @size, align 4, !tbaa !5
%incdec.ptr = getelementptr inbounds i8, ptr %6, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !16
%8 = load i8, ptr %incdec.ptr, align 1, !tbaa !19
%cmp8.i118 = icmp sgt i8 %8, 47
br i1 %cmp8.i118, label %while.body.i120, label %getint.exit128
while.body.i120: ; preds = %getint.exit, %while.body.i120
%n.010.i121 = phi i32 [ %add4.i126, %while.body.i120 ], [ 0, %getint.exit ]
%incdec.ptr79.i122 = phi ptr [ %incdec.ptr.i124, %while.body.i120 ], [ %incdec.ptr, %getint.exit ]
%add.i123 = mul i32 %n.010.i121, 10
%incdec.ptr.i124 = getelementptr inbounds i8, ptr %incdec.ptr79.i122, i64 1
store ptr %incdec.ptr.i124, ptr @p, align 8, !tbaa !16
%9 = load i8, ptr %incdec.ptr79.i122, align 1, !tbaa !19
%10 = and i8 %9, 15
%and.i125 = zext i8 %10 to i32
%add4.i126 = add nsw i32 %add.i123, %and.i125
%11 = load i8, ptr %incdec.ptr.i124, align 1, !tbaa !19
%cmp.i127 = icmp sgt i8 %11, 47
br i1 %cmp.i127, label %while.body.i120, label %getint.exit128, !llvm.loop !27
getint.exit128: ; preds = %while.body.i120, %getint.exit
%n.0.lcssa.i119 = phi i32 [ 0, %getint.exit ], [ %add4.i126, %while.body.i120 ]
%add = add nsw i32 %7, 2
%conv4 = sext i32 %add to i64
%call5 = tail call noalias ptr @calloc(i64 noundef %conv4, i64 noundef 32) #13
store ptr %call5, ptr @tbl, align 8, !tbaa !16
%call8 = tail call noalias ptr @calloc(i64 noundef %conv4, i64 noundef 1) #13
store ptr %call8, ptr @visited, align 8, !tbaa !16
%cmp9190 = icmp sgt i32 %7, 0
br i1 %cmp9190, label %for.body, label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.body, %getint.exit128
%cmp25192 = icmp sgt i32 %n.0.lcssa.i119, 0
br i1 %cmp25192, label %for.body27, label %for.end65
for.body: ; preds = %getint.exit128, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %getint.exit128 ]
%12 = load ptr, ptr @tbl, align 8, !tbaa !16
%arrayidx = getelementptr inbounds %struct.TBL, ptr %12, i64 %indvars.iv
store i32 0, ptr %arrayidx, align 8, !tbaa !21
%lim = getelementptr inbounds %struct.TBL, ptr %12, i64 %indvars.iv, i32 1
store i32 250, ptr %lim, align 4, !tbaa !28
%call13 = tail call noalias dereferenceable_or_null(1008) ptr @calloc(i64 noundef 252, i64 noundef 4) #13
%to = getelementptr inbounds %struct.TBL, ptr %12, i64 %indvars.iv, i32 2
store ptr %call13, ptr %to, align 8, !tbaa !23
%call16 = tail call noalias dereferenceable_or_null(1008) ptr @calloc(i64 noundef 252, i64 noundef 4) #13
%13 = load ptr, ptr @tbl, align 8, !tbaa !16
%c19 = getelementptr inbounds %struct.TBL, ptr %13, i64 %indvars.iv, i32 4
store ptr %call16, ptr %c19, align 8, !tbaa !25
%call20 = tail call noalias dereferenceable_or_null(1008) ptr @calloc(i64 noundef 252, i64 noundef 4) #13
%14 = load ptr, ptr @tbl, align 8, !tbaa !16
%d23 = getelementptr inbounds %struct.TBL, ptr %14, i64 %indvars.iv, i32 3
store ptr %call20, ptr %d23, align 8, !tbaa !24
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%15 = load i32, ptr @size, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp9 = icmp slt i64 %indvars.iv.next, %16
br i1 %cmp9, label %for.body, label %for.cond24.preheader, !llvm.loop !29
for.body27: ; preds = %for.cond24.preheader, %checkMem.exit189
%i.1193 = phi i32 [ %inc64, %checkMem.exit189 ], [ 0, %for.cond24.preheader ]
store ptr @buf, ptr @p, align 8, !tbaa !16
%17 = load ptr, ptr @stdin, align 8, !tbaa !16
%call28 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 40, ptr noundef %17)
%p.promoted.i129 = load ptr, ptr @p, align 8, !tbaa !16
%18 = load i8, ptr %p.promoted.i129, align 1, !tbaa !19
%cmp8.i130 = icmp sgt i8 %18, 47
br i1 %cmp8.i130, label %while.body.i132, label %getint.exit140
while.body.i132: ; preds = %for.body27, %while.body.i132
%n.010.i133 = phi i32 [ %add4.i138, %while.body.i132 ], [ 0, %for.body27 ]
%incdec.ptr79.i134 = phi ptr [ %incdec.ptr.i136, %while.body.i132 ], [ %p.promoted.i129, %for.body27 ]
%add.i135 = mul i32 %n.010.i133, 10
%incdec.ptr.i136 = getelementptr inbounds i8, ptr %incdec.ptr79.i134, i64 1
store ptr %incdec.ptr.i136, ptr @p, align 8, !tbaa !16
%19 = load i8, ptr %incdec.ptr79.i134, align 1, !tbaa !19
%20 = and i8 %19, 15
%and.i137 = zext i8 %20 to i32
%add4.i138 = add nsw i32 %add.i135, %and.i137
%21 = load i8, ptr %incdec.ptr.i136, align 1, !tbaa !19
%cmp.i139 = icmp sgt i8 %21, 47
br i1 %cmp.i139, label %while.body.i132, label %getint.exit140, !llvm.loop !27
getint.exit140: ; preds = %while.body.i132, %for.body27
%22 = phi ptr [ %p.promoted.i129, %for.body27 ], [ %incdec.ptr.i136, %while.body.i132 ]
%n.0.lcssa.i131 = phi i32 [ 0, %for.body27 ], [ %add4.i138, %while.body.i132 ]
%sub = add nsw i32 %n.0.lcssa.i131, -1
%incdec.ptr30 = getelementptr inbounds i8, ptr %22, i64 1
store ptr %incdec.ptr30, ptr @p, align 8, !tbaa !16
%23 = load i8, ptr %incdec.ptr30, align 1, !tbaa !19
%cmp8.i142 = icmp sgt i8 %23, 47
br i1 %cmp8.i142, label %while.body.i144, label %getint.exit152
while.body.i144: ; preds = %getint.exit140, %while.body.i144
%n.010.i145 = phi i32 [ %add4.i150, %while.body.i144 ], [ 0, %getint.exit140 ]
%incdec.ptr79.i146 = phi ptr [ %incdec.ptr.i148, %while.body.i144 ], [ %incdec.ptr30, %getint.exit140 ]
%add.i147 = mul i32 %n.010.i145, 10
%incdec.ptr.i148 = getelementptr inbounds i8, ptr %incdec.ptr79.i146, i64 1
store ptr %incdec.ptr.i148, ptr @p, align 8, !tbaa !16
%24 = load i8, ptr %incdec.ptr79.i146, align 1, !tbaa !19
%25 = and i8 %24, 15
%and.i149 = zext i8 %25 to i32
%add4.i150 = add nsw i32 %add.i147, %and.i149
%26 = load i8, ptr %incdec.ptr.i148, align 1, !tbaa !19
%cmp.i151 = icmp sgt i8 %26, 47
br i1 %cmp.i151, label %while.body.i144, label %getint.exit152, !llvm.loop !27
getint.exit152: ; preds = %while.body.i144, %getint.exit140
%27 = phi ptr [ %22, %getint.exit140 ], [ %incdec.ptr79.i146, %while.body.i144 ]
%n.0.lcssa.i143 = phi i32 [ 0, %getint.exit140 ], [ %add4.i150, %while.body.i144 ]
%sub32 = add nsw i32 %n.0.lcssa.i143, -1
%incdec.ptr33 = getelementptr inbounds i8, ptr %27, i64 2
store ptr %incdec.ptr33, ptr @p, align 8, !tbaa !16
%28 = load i8, ptr %incdec.ptr33, align 1, !tbaa !19
%cmp8.i154 = icmp sgt i8 %28, 47
br i1 %cmp8.i154, label %while.body.i156, label %getint.exit164
while.body.i156: ; preds = %getint.exit152, %while.body.i156
%n.010.i157 = phi i32 [ %add4.i162, %while.body.i156 ], [ 0, %getint.exit152 ]
%incdec.ptr79.i158 = phi ptr [ %incdec.ptr.i160, %while.body.i156 ], [ %incdec.ptr33, %getint.exit152 ]
%add.i159 = mul i32 %n.010.i157, 10
%incdec.ptr.i160 = getelementptr inbounds i8, ptr %incdec.ptr79.i158, i64 1
store ptr %incdec.ptr.i160, ptr @p, align 8, !tbaa !16
%29 = load i8, ptr %incdec.ptr79.i158, align 1, !tbaa !19
%30 = and i8 %29, 15
%and.i161 = zext i8 %30 to i32
%add4.i162 = add nsw i32 %add.i159, %and.i161
%31 = load i8, ptr %incdec.ptr.i160, align 1, !tbaa !19
%cmp.i163 = icmp sgt i8 %31, 47
br i1 %cmp.i163, label %while.body.i156, label %getint.exit164, !llvm.loop !27
getint.exit164: ; preds = %while.body.i156, %getint.exit152
%32 = phi ptr [ %incdec.ptr33, %getint.exit152 ], [ %incdec.ptr.i160, %while.body.i156 ]
%n.0.lcssa.i155 = phi i32 [ 0, %getint.exit152 ], [ %add4.i162, %while.body.i156 ]
%incdec.ptr35 = getelementptr inbounds i8, ptr %32, i64 1
store ptr %incdec.ptr35, ptr @p, align 8, !tbaa !16
%33 = load i8, ptr %incdec.ptr35, align 1, !tbaa !19
%cmp8.i166 = icmp sgt i8 %33, 47
br i1 %cmp8.i166, label %while.body.i168, label %getint.exit176
while.body.i168: ; preds = %getint.exit164, %while.body.i168
%n.010.i169 = phi i32 [ %add4.i174, %while.body.i168 ], [ 0, %getint.exit164 ]
%incdec.ptr79.i170 = phi ptr [ %incdec.ptr.i172, %while.body.i168 ], [ %incdec.ptr35, %getint.exit164 ]
%add.i171 = mul i32 %n.010.i169, 10
%incdec.ptr.i172 = getelementptr inbounds i8, ptr %incdec.ptr79.i170, i64 1
store ptr %incdec.ptr.i172, ptr @p, align 8, !tbaa !16
%34 = load i8, ptr %incdec.ptr79.i170, align 1, !tbaa !19
%35 = and i8 %34, 15
%and.i173 = zext i8 %35 to i32
%add4.i174 = add nsw i32 %add.i171, %and.i173
%36 = load i8, ptr %incdec.ptr.i172, align 1, !tbaa !19
%cmp.i175 = icmp sgt i8 %36, 47
br i1 %cmp.i175, label %while.body.i168, label %getint.exit176, !llvm.loop !27
getint.exit176: ; preds = %while.body.i168, %getint.exit164
%n.0.lcssa.i167 = phi i32 [ 0, %getint.exit164 ], [ %add4.i174, %while.body.i168 ]
%37 = load ptr, ptr @tbl, align 8, !tbaa !16
%idx.ext = sext i32 %sub to i64
%add.ptr = getelementptr inbounds %struct.TBL, ptr %37, i64 %idx.ext
%38 = load i32, ptr %add.ptr, align 8, !tbaa !21
%lim.i = getelementptr inbounds %struct.TBL, ptr %37, i64 %idx.ext, i32 1
%39 = load i32, ptr %lim.i, align 4, !tbaa !28
%cmp.i177 = icmp slt i32 %38, %39
br i1 %cmp.i177, label %getint.exit176.checkMem.exit_crit_edge, label %if.end.i
getint.exit176.checkMem.exit_crit_edge: ; preds = %getint.exit176
%to38.phi.trans.insert = getelementptr inbounds %struct.TBL, ptr %37, i64 %idx.ext, i32 2
%.pre202 = load ptr, ptr %to38.phi.trans.insert, align 8, !tbaa !23
br label %checkMem.exit
if.end.i: ; preds = %getint.exit176
%mul.i = shl nsw i32 %39, 1
%add.i178 = add nsw i32 %mul.i, 2
%conv.i = sext i32 %add.i178 to i64
%call.i = tail call noalias ptr @calloc(i64 noundef %conv.i, i64 noundef 4) #13
%to2.i = getelementptr inbounds %struct.TBL, ptr %37, i64 %idx.ext, i32 2
%40 = load ptr, ptr %to2.i, align 8, !tbaa !23
%conv4.i = sext i32 %39 to i64
%mul5.i = shl nsw i64 %conv4.i, 2
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %call.i, ptr align 4 %40, i64 %mul5.i, i1 false)
store i32 %mul.i, ptr %lim.i, align 4, !tbaa !28
tail call void @free(ptr noundef %40) #12
store ptr %call.i, ptr %to2.i, align 8, !tbaa !23
%.pre = load i32, ptr %add.ptr, align 8, !tbaa !21
%.pre203 = load ptr, ptr @tbl, align 8, !tbaa !16
br label %checkMem.exit
checkMem.exit: ; preds = %getint.exit176.checkMem.exit_crit_edge, %if.end.i
%41 = phi ptr [ %37, %getint.exit176.checkMem.exit_crit_edge ], [ %.pre203, %if.end.i ]
%42 = phi ptr [ %.pre202, %getint.exit176.checkMem.exit_crit_edge ], [ %call.i, %if.end.i ]
%43 = phi i32 [ %38, %getint.exit176.checkMem.exit_crit_edge ], [ %.pre, %if.end.i ]
%idxprom39 = sext i32 %43 to i64
%arrayidx40 = getelementptr inbounds i32, ptr %42, i64 %idxprom39
store i32 %sub32, ptr %arrayidx40, align 4, !tbaa !5
%d41 = getelementptr inbounds %struct.TBL, ptr %37, i64 %idx.ext, i32 3
%44 = load ptr, ptr %d41, align 8, !tbaa !24
%arrayidx43 = getelementptr inbounds i32, ptr %44, i64 %idxprom39
store i32 %n.0.lcssa.i155, ptr %arrayidx43, align 4, !tbaa !5
%c44 = getelementptr inbounds %struct.TBL, ptr %37, i64 %idx.ext, i32 4
%45 = load ptr, ptr %c44, align 8, !tbaa !25
%arrayidx46 = getelementptr inbounds i32, ptr %45, i64 %idxprom39
store i32 %n.0.lcssa.i167, ptr %arrayidx46, align 4, !tbaa !5
%46 = load i32, ptr %add.ptr, align 8, !tbaa !21
%inc48 = add nsw i32 %46, 1
store i32 %inc48, ptr %add.ptr, align 8, !tbaa !21
%idx.ext49 = sext i32 %sub32 to i64
%add.ptr50 = getelementptr inbounds %struct.TBL, ptr %41, i64 %idx.ext49
%47 = load i32, ptr %add.ptr50, align 8, !tbaa !21
%lim.i179 = getelementptr inbounds %struct.TBL, ptr %41, i64 %idx.ext49, i32 1
%48 = load i32, ptr %lim.i179, align 4, !tbaa !28
%cmp.i180 = icmp slt i32 %47, %48
br i1 %cmp.i180, label %checkMem.exit.checkMem.exit189_crit_edge, label %if.end.i181
checkMem.exit.checkMem.exit189_crit_edge: ; preds = %checkMem.exit
%to52.phi.trans.insert = getelementptr inbounds %struct.TBL, ptr %41, i64 %idx.ext49, i32 2
%.pre205 = load ptr, ptr %to52.phi.trans.insert, align 8, !tbaa !23
br label %checkMem.exit189
if.end.i181: ; preds = %checkMem.exit
%mul.i182 = shl nsw i32 %48, 1
%add.i183 = add nsw i32 %mul.i182, 2
%conv.i184 = sext i32 %add.i183 to i64
%call.i185 = tail call noalias ptr @calloc(i64 noundef %conv.i184, i64 noundef 4) #13
%to2.i186 = getelementptr inbounds %struct.TBL, ptr %41, i64 %idx.ext49, i32 2
%49 = load ptr, ptr %to2.i186, align 8, !tbaa !23
%conv4.i187 = sext i32 %48 to i64
%mul5.i188 = shl nsw i64 %conv4.i187, 2
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %call.i185, ptr align 4 %49, i64 %mul5.i188, i1 false)
store i32 %mul.i182, ptr %lim.i179, align 4, !tbaa !28
tail call void @free(ptr noundef %49) #12
store ptr %call.i185, ptr %to2.i186, align 8, !tbaa !23
%.pre204 = load i32, ptr %add.ptr50, align 8, !tbaa !21
br label %checkMem.exit189
checkMem.exit189: ; preds = %checkMem.exit.checkMem.exit189_crit_edge, %if.end.i181
%50 = phi ptr [ %.pre205, %checkMem.exit.checkMem.exit189_crit_edge ], [ %call.i185, %if.end.i181 ]
%51 = phi i32 [ %47, %checkMem.exit.checkMem.exit189_crit_edge ], [ %.pre204, %if.end.i181 ]
%idxprom53 = sext i32 %51 to i64
%arrayidx54 = getelementptr inbounds i32, ptr %50, i64 %idxprom53
store i32 %sub, ptr %arrayidx54, align 4, !tbaa !5
%d55 = getelementptr inbounds %struct.TBL, ptr %41, i64 %idx.ext49, i32 3
%52 = load ptr, ptr %d55, align 8, !tbaa !24
%arrayidx57 = getelementptr inbounds i32, ptr %52, i64 %idxprom53
store i32 %n.0.lcssa.i155, ptr %arrayidx57, align 4, !tbaa !5
%c58 = getelementptr inbounds %struct.TBL, ptr %41, i64 %idx.ext49, i32 4
%53 = load ptr, ptr %c58, align 8, !tbaa !25
%arrayidx60 = getelementptr inbounds i32, ptr %53, i64 %idxprom53
store i32 %n.0.lcssa.i167, ptr %arrayidx60, align 4, !tbaa !5
%54 = load i32, ptr %add.ptr50, align 8, !tbaa !21
%inc62 = add nsw i32 %54, 1
store i32 %inc62, ptr %add.ptr50, align 8, !tbaa !21
%inc64 = add nuw nsw i32 %i.1193, 1
%exitcond.not = icmp eq i32 %inc64, %n.0.lcssa.i119
br i1 %exitcond.not, label %for.end65, label %for.body27, !llvm.loop !30
for.end65: ; preds = %checkMem.exit189, %for.cond24.preheader
%call66 = tail call i32 @dijkstra(i32 noundef 0)
%call67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %call66)
%55 = load i32, ptr @size, align 4, !tbaa !5
%cmp69194 = icmp sgt i32 %55, 0
br i1 %cmp69194, label %for.body71, label %for.end83
for.body71: ; preds = %for.end65, %for.body71
%indvars.iv199 = phi i64 [ %indvars.iv.next200, %for.body71 ], [ 0, %for.end65 ]
%56 = load ptr, ptr @tbl, align 8, !tbaa !16
%d74 = getelementptr inbounds %struct.TBL, ptr %56, i64 %indvars.iv199, i32 3
%57 = load ptr, ptr %d74, align 8, !tbaa !24
tail call void @free(ptr noundef %57) #12
%58 = load ptr, ptr @tbl, align 8, !tbaa !16
%c77 = getelementptr inbounds %struct.TBL, ptr %58, i64 %indvars.iv199, i32 4
%59 = load ptr, ptr %c77, align 8, !tbaa !25
tail call void @free(ptr noundef %59) #12
%60 = load ptr, ptr @tbl, align 8, !tbaa !16
%to80 = getelementptr inbounds %struct.TBL, ptr %60, i64 %indvars.iv199, i32 2
%61 = load ptr, ptr %to80, align 8, !tbaa !23
tail call void @free(ptr noundef %61) #12
%indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1
%62 = load i32, ptr @size, align 4, !tbaa !5
%63 = sext i32 %62 to i64
%cmp69 = icmp slt i64 %indvars.iv.next200, %63
br i1 %cmp69, label %for.body71, label %for.end83, !llvm.loop !31
for.end83: ; preds = %for.body71, %for.end65
%64 = load ptr, ptr @visited, align 8, !tbaa !16
tail call void @free(ptr noundef %64) #12
%65 = load ptr, ptr @tbl, align 8, !tbaa !16
tail call void @free(ptr noundef %65) #12
store ptr @buf, ptr @p, align 8, !tbaa !16
%66 = load ptr, ptr @stdin, align 8, !tbaa !16
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 40, ptr noundef %66)
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %while.end, label %land.rhs, !llvm.loop !32
while.end: ; preds = %land.rhs, %for.end83, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #11
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #9 = { 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 #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 = { nofree nounwind "no-trapping-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 = { nounwind }
attributes #13 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!13 = !{!10, !6, i64 4}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{i32 0, i32 2}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !15}
!21 = !{!22, !6, i64 0}
!22 = !{!"", !6, i64 0, !6, i64 4, !17, i64 8, !17, i64 16, !17, i64 24}
!23 = !{!22, !17, i64 8}
!24 = !{!22, !17, i64 16}
!25 = !{!22, !17, i64 24}
!26 = distinct !{!26, !15}
!27 = distinct !{!27, !15}
!28 = !{!22, !6, i64 4}
!29 = distinct !{!29, !15}
!30 = distinct !{!30, !15}
!31 = distinct !{!31, !15}
!32 = distinct !{!32, !15}
|
#include <stdio.h>
#include <math.h>
int abs(int a){
if(a>=0) return a;
else return -a;
}
int max(int a, int b){
if(a>=b) return a;
else return b;
}
int main(){
int N;
int x[101],y[101],h[101];
scanf("%d",&N);
for(int i=1;i<=N;i++){
scanf("%d%d%d",&x[i],&y[i],&h[i]);
}
//h[i]が0でないiを調べておく.
int pi;
for(int i=1;i<=N;i++){
if(h[i]!=0) pi=i;
}
//中心を全探索
for(int i=0;i<=100;i++){
for(int j=0;j<=100;j++){
int H;
H=h[pi]+abs(x[pi]-i)+abs(y[pi]-j);
int A=1;
for(int k=1;k<=N;k++){
if(h[k]==max(H-abs(x[k]-i)-abs(y[k]-j),0)) A=1;
else{
A=0;
break;
}
}
if(A==1){
printf("%d %d %d\n",i,j,H);
}
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181148/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181148/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @abs(i32 noundef %a) local_unnamed_addr #0 {
entry:
%retval.0 = tail call i32 @llvm.abs.i32(i32 %a, i1 true)
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%b.a = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %b.a
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i32, align 4
%x = alloca [101 x i32], align 16
%y = alloca [101 x i32], align 16
%h = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %x) #7
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %y) #7
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %h) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not96 = icmp slt i32 %0, 1
br i1 %cmp.not96, label %for.cond18.preheader, label %for.body
for.cond7.preheader: ; preds = %for.body
%cmp8.not98 = icmp slt i32 %5, 1
br i1 %cmp8.not98, label %for.cond18.preheader, label %for.body10.preheader
for.body10.preheader: ; preds = %for.cond7.preheader
%1 = add nuw i32 %5, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%3 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %2, 3
%4 = icmp ult i64 %3, 3
br i1 %4, label %for.cond18.preheader.loopexit.unr-lcssa, label %for.body10.preheader.new
for.body10.preheader.new: ; preds = %for.body10.preheader
%unroll_iter = and i64 %2, -4
br label %for.body10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %6
br i1 %cmp.not.not, label %for.body, label %for.cond7.preheader, !llvm.loop !9
for.cond18.preheader.loopexit.unr-lcssa: ; preds = %for.body10, %for.body10.preheader
%indvars.iv108.unr = phi i64 [ 1, %for.body10.preheader ], [ %indvars.iv.next109.3, %for.body10 ]
%pi.099.unr = phi i32 [ undef, %for.body10.preheader ], [ %spec.select.3, %for.body10 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond18.preheader.loopexit, label %for.body10.epil
for.body10.epil: ; preds = %for.cond18.preheader.loopexit.unr-lcssa, %for.body10.epil
%indvars.iv108.epil = phi i64 [ %indvars.iv.next109.epil, %for.body10.epil ], [ %indvars.iv108.unr, %for.cond18.preheader.loopexit.unr-lcssa ]
%pi.099.epil = phi i32 [ %spec.select.epil, %for.body10.epil ], [ %pi.099.unr, %for.cond18.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body10.epil ], [ 0, %for.cond18.preheader.loopexit.unr-lcssa ]
%arrayidx12.epil = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv108.epil
%7 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !5
%cmp13.not.epil = icmp eq i32 %7, 0
%8 = trunc i64 %indvars.iv108.epil to i32
%spec.select.epil = select i1 %cmp13.not.epil, i32 %pi.099.epil, i32 %8
%indvars.iv.next109.epil = add nuw nsw i64 %indvars.iv108.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.cond18.preheader.loopexit, label %for.body10.epil, !llvm.loop !11
for.cond18.preheader.loopexit: ; preds = %for.body10.epil, %for.cond18.preheader.loopexit.unr-lcssa
%spec.select.lcssa = phi i32 [ %pi.099.unr, %for.cond18.preheader.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body10.epil ]
%9 = sext i32 %spec.select.lcssa to i64
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %entry, %for.cond18.preheader.loopexit, %for.cond7.preheader
%pi.0.lcssa = phi i64 [ 0, %for.cond7.preheader ], [ %9, %for.cond18.preheader.loopexit ], [ 0, %entry ]
%arrayidx27 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %pi.0.lcssa
%arrayidx29 = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %pi.0.lcssa
%arrayidx31 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %pi.0.lcssa
br label %for.cond22.preheader
for.body10: ; preds = %for.body10, %for.body10.preheader.new
%indvars.iv108 = phi i64 [ 1, %for.body10.preheader.new ], [ %indvars.iv.next109.3, %for.body10 ]
%pi.099 = phi i32 [ undef, %for.body10.preheader.new ], [ %spec.select.3, %for.body10 ]
%niter = phi i64 [ 0, %for.body10.preheader.new ], [ %niter.next.3, %for.body10 ]
%arrayidx12 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv108
%10 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13.not = icmp eq i32 %10, 0
%11 = trunc i64 %indvars.iv108 to i32
%spec.select = select i1 %cmp13.not, i32 %pi.099, i32 %11
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%arrayidx12.1 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv.next109
%12 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5
%cmp13.not.1 = icmp eq i32 %12, 0
%13 = trunc i64 %indvars.iv.next109 to i32
%spec.select.1 = select i1 %cmp13.not.1, i32 %spec.select, i32 %13
%indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 2
%arrayidx12.2 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv.next109.1
%14 = load i32, ptr %arrayidx12.2, align 4, !tbaa !5
%cmp13.not.2 = icmp eq i32 %14, 0
%15 = trunc i64 %indvars.iv.next109.1 to i32
%spec.select.2 = select i1 %cmp13.not.2, i32 %spec.select.1, i32 %15
%indvars.iv.next109.2 = add nuw nsw i64 %indvars.iv108, 3
%arrayidx12.3 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv.next109.2
%16 = load i32, ptr %arrayidx12.3, align 4, !tbaa !5
%cmp13.not.3 = icmp eq i32 %16, 0
%17 = trunc i64 %indvars.iv.next109.2 to i32
%spec.select.3 = select i1 %cmp13.not.3, i32 %spec.select.2, i32 %17
%indvars.iv.next109.3 = add nuw nsw i64 %indvars.iv108, 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.cond18.preheader.loopexit.unr-lcssa, label %for.body10, !llvm.loop !13
for.cond22.preheader: ; preds = %for.cond18.preheader, %for.cond.cleanup24
%i17.0105 = phi i32 [ 0, %for.cond18.preheader ], [ %inc64, %for.cond.cleanup24 ]
br label %for.body25
for.cond.cleanup20: ; preds = %for.cond.cleanup24
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %h) #7
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %y) #7
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %x) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7
ret i32 0
for.cond.cleanup24: ; preds = %if.end58
%inc64 = add nuw nsw i32 %i17.0105, 1
%exitcond117.not = icmp eq i32 %inc64, 101
br i1 %exitcond117.not, label %for.cond.cleanup20, label %for.cond22.preheader, !llvm.loop !14
for.body25: ; preds = %for.cond22.preheader, %if.end58
%j.0104 = phi i32 [ 0, %for.cond22.preheader ], [ %inc60, %if.end58 ]
%18 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%sub = sub nsw i32 %19, %i17.0105
%20 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%add = add nsw i32 %20, %18
%21 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%sub32 = sub nsw i32 %21, %j.0104
%22 = call i32 @llvm.abs.i32(i32 %sub32, i1 true)
%add33 = add nsw i32 %add, %22
%23 = load i32, ptr %N, align 4, !tbaa !5
%cmp35.not102 = icmp slt i32 %23, 1
br i1 %cmp35.not102, label %if.then56, label %for.body37.preheader
for.body37.preheader: ; preds = %for.body25
%24 = add nuw i32 %23, 1
%wide.trip.count114 = zext i32 %24 to i64
br label %for.body37
for.cond34: ; preds = %for.body37
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114
br i1 %exitcond115.not, label %if.then56, label %for.body37, !llvm.loop !15
for.body37: ; preds = %for.body37.preheader, %for.cond34
%indvars.iv111 = phi i64 [ 1, %for.body37.preheader ], [ %indvars.iv.next112, %for.cond34 ]
%arrayidx39 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv111
%25 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%arrayidx41 = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv111
%26 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%sub42 = sub nsw i32 %26, %i17.0105
%27 = call i32 @llvm.abs.i32(i32 %sub42, i1 true)
%arrayidx45 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv111
%28 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%sub46 = sub nsw i32 %28, %j.0104
%29 = call i32 @llvm.abs.i32(i32 %sub46, i1 true)
%30 = add nuw i32 %27, %29
%sub47 = sub i32 %add33, %30
%b.a.i = call i32 @llvm.smax.i32(i32 %sub47, i32 0)
%cmp49 = icmp eq i32 %25, %b.a.i
br i1 %cmp49, label %for.cond34, label %if.end58
if.then56: ; preds = %for.cond34, %for.body25
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i17.0105, i32 noundef %j.0104, i32 noundef %add33)
br label %if.end58
if.end58: ; preds = %for.body37, %if.then56
%inc60 = add nuw nsw i32 %j.0104, 1
%exitcond116.not = icmp eq i32 %inc60, 101
br i1 %exitcond116.not, label %for.cond.cleanup24, label %for.body25, !llvm.loop !16
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: 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 #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind 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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#define max(x,y) ((x)>(y)?(x):(y))
#define abs(x) ((x)<0?-1*(x):(x))
int main()
{
int n;
int x[105],y[105],h[105];
int cx,cy,ch;
int f,s;
int i;
scanf("%d",&n);
for(i=0;i<n;++i){
scanf("%d%d%d",x+i,y+i,h+i);
if(h[i]) s=i;
}
for(cx=0;cx<=100;++cx){
for(cy=0;cy<=100;++cy){
f=0;
ch=h[s]+abs(x[s]-cx)+abs(y[s]-cy);
for(i=0;i<n;++i){
int tmp=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0);
if(tmp==h[i])++f;
}
if(f==n)printf("%d %d %d",cx,cy,ch);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181191/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181191/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = 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
%x = alloca [105 x i32], align 16
%y = alloca [105 x i32], align 16
%h = alloca [105 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %y) #4
call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %h) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp186 = icmp sgt i32 %0, 0
br i1 %cmp186, label %for.body, label %for.cond8.preheader
for.cond8.preheader.loopexit: ; preds = %for.body
%1 = sext i32 %spec.select to i64
br label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.cond8.preheader.loopexit, %entry
%s.0.lcssa = phi i64 [ 0, %entry ], [ %1, %for.cond8.preheader.loopexit ]
%arrayidx15 = getelementptr inbounds [105 x i32], ptr %h, i64 0, i64 %s.0.lcssa
%arrayidx17 = getelementptr inbounds [105 x i32], ptr %x, i64 0, i64 %s.0.lcssa
%arrayidx26 = getelementptr inbounds [105 x i32], ptr %y, i64 0, i64 %s.0.lcssa
br label %for.cond11.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%s.0187 = phi i32 [ %spec.select, %for.body ], [ undef, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %x, i64 %indvars.iv
%add.ptr3 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv
%add.ptr6 = getelementptr inbounds i32, ptr %h, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr, ptr noundef nonnull %add.ptr3, ptr noundef nonnull %add.ptr6)
%2 = load i32, ptr %add.ptr6, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
%3 = trunc i64 %indvars.iv to i32
%spec.select = select i1 %tobool.not, i32 %s.0187, i32 %3
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond8.preheader.loopexit, !llvm.loop !9
for.cond11.preheader: ; preds = %for.cond8.preheader, %for.inc129
%cx.0195 = phi i32 [ 0, %for.cond8.preheader ], [ %inc130, %for.inc129 ]
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %cx.0195, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %for.body13
for.body13: ; preds = %for.cond11.preheader, %for.inc126
%cy.0194 = phi i32 [ 0, %for.cond11.preheader ], [ %inc127, %for.inc126 ]
%6 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%sub = sub nsw i32 %7, %cx.0195
%cond = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%add = add nsw i32 %cond, %6
%8 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%sub27 = sub nsw i32 %8, %cy.0194
%cond39 = call i32 @llvm.abs.i32(i32 %sub27, i1 true)
%add40 = add nsw i32 %add, %cond39
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp42189 = icmp sgt i32 %9, 0
br i1 %cmp42189, label %for.body43.preheader, label %for.end121
for.body43.preheader: ; preds = %for.body13
%wide.trip.count = zext i32 %9 to i64
%min.iters.check = icmp ult i32 %9, 8
br i1 %min.iters.check, label %for.body43.preheader212, label %vector.ph
vector.ph: ; preds = %for.body43.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert206 = insertelement <4 x i32> poison, i32 %cy.0194, i64 0
%broadcast.splat207 = shufflevector <4 x i32> %broadcast.splatinsert206, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert208 = insertelement <4 x i32> poison, i32 %add40, i64 0
%broadcast.splat209 = shufflevector <4 x i32> %broadcast.splatinsert208, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %34, %vector.body ]
%vec.phi202 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %35, %vector.body ]
%10 = getelementptr inbounds [105 x i32], ptr %x, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = getelementptr inbounds i32, ptr %10, i64 4
%wide.load203 = load <4 x i32>, ptr %11, align 16, !tbaa !5
%12 = sub nsw <4 x i32> %wide.load, %broadcast.splat
%13 = sub nsw <4 x i32> %wide.load203, %broadcast.splat
%14 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %12, i1 true)
%15 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %13, i1 true)
%16 = getelementptr inbounds [105 x i32], ptr %y, i64 0, i64 %index
%wide.load204 = load <4 x i32>, ptr %16, align 16, !tbaa !5
%17 = getelementptr inbounds i32, ptr %16, i64 4
%wide.load205 = load <4 x i32>, ptr %17, align 16, !tbaa !5
%18 = sub nsw <4 x i32> %wide.load204, %broadcast.splat207
%19 = sub nsw <4 x i32> %wide.load205, %broadcast.splat207
%20 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %18, i1 true)
%21 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %19, i1 true)
%22 = add nuw <4 x i32> %14, %20
%23 = add nuw <4 x i32> %15, %21
%24 = sub <4 x i32> %broadcast.splat209, %22
%25 = sub <4 x i32> %broadcast.splat209, %23
%26 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %24, <4 x i32> zeroinitializer)
%27 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %25, <4 x i32> zeroinitializer)
%28 = getelementptr inbounds [105 x i32], ptr %h, i64 0, i64 %index
%wide.load210 = load <4 x i32>, ptr %28, align 16, !tbaa !5
%29 = getelementptr inbounds i32, ptr %28, i64 4
%wide.load211 = load <4 x i32>, ptr %29, align 16, !tbaa !5
%30 = icmp eq <4 x i32> %26, %wide.load210
%31 = icmp eq <4 x i32> %27, %wide.load211
%32 = zext <4 x i1> %30 to <4 x i32>
%33 = zext <4 x i1> %31 to <4 x i32>
%34 = add <4 x i32> %vec.phi, %32
%35 = add <4 x i32> %vec.phi202, %33
%index.next = add nuw i64 %index, 8
%36 = icmp eq i64 %index.next, %n.vec
br i1 %36, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %35, %34
%37 = 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.end121, label %for.body43.preheader212
for.body43.preheader212: ; preds = %for.body43.preheader, %middle.block
%indvars.iv197.ph = phi i64 [ 0, %for.body43.preheader ], [ %n.vec, %middle.block ]
%f.0190.ph = phi i32 [ 0, %for.body43.preheader ], [ %37, %middle.block ]
br label %for.body43
for.body43: ; preds = %for.body43.preheader212, %for.body43
%indvars.iv197 = phi i64 [ %indvars.iv.next198, %for.body43 ], [ %indvars.iv197.ph, %for.body43.preheader212 ]
%f.0190 = phi i32 [ %spec.select184, %for.body43 ], [ %f.0190.ph, %for.body43.preheader212 ]
%arrayidx45 = getelementptr inbounds [105 x i32], ptr %x, i64 0, i64 %indvars.iv197
%38 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%sub46 = sub nsw i32 %38, %cx.0195
%cond58 = call i32 @llvm.abs.i32(i32 %sub46, i1 true)
%arrayidx61 = getelementptr inbounds [105 x i32], ptr %y, i64 0, i64 %indvars.iv197
%39 = load i32, ptr %arrayidx61, align 4, !tbaa !5
%sub62 = sub nsw i32 %39, %cy.0194
%cond74 = call i32 @llvm.abs.i32(i32 %sub62, i1 true)
%40 = add nuw i32 %cond58, %cond74
%sub75 = sub i32 %add40, %40
%spec.select185 = call i32 @llvm.smax.i32(i32 %sub75, i32 0)
%arrayidx114 = getelementptr inbounds [105 x i32], ptr %h, i64 0, i64 %indvars.iv197
%41 = load i32, ptr %arrayidx114, align 4, !tbaa !5
%cmp115 = icmp eq i32 %spec.select185, %41
%inc117 = zext i1 %cmp115 to i32
%spec.select184 = add nuw nsw i32 %f.0190, %inc117
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%exitcond.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count
br i1 %exitcond.not, label %for.end121, label %for.body43, !llvm.loop !14
for.end121: ; preds = %for.body43, %middle.block, %for.body13
%f.0.lcssa = phi i32 [ 0, %for.body13 ], [ %37, %middle.block ], [ %spec.select184, %for.body43 ]
%cmp122 = icmp eq i32 %f.0.lcssa, %9
br i1 %cmp122, label %if.then123, label %for.inc126
if.then123: ; preds = %for.end121
%call124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cx.0195, i32 noundef %cy.0194, i32 noundef %add40)
br label %for.inc126
for.inc126: ; preds = %for.end121, %if.then123
%inc127 = add nuw nsw i32 %cy.0194, 1
%exitcond200.not = icmp eq i32 %inc127, 101
br i1 %exitcond200.not, label %for.inc129, label %for.body13, !llvm.loop !15
for.inc129: ; preds = %for.inc126
%inc130 = add nuw nsw i32 %cx.0195, 1
%exitcond201.not = icmp eq i32 %inc130, 101
br i1 %exitcond201.not, label %for.end131, label %for.cond11.preheader, !llvm.loop !16
for.end131: ; preds = %for.inc129
call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 420, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
int main()
{
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
if((a-b<=d && b-c<=d && a-b>=-d && b-c>=-d) || (a-c<=d && a-c>=-d))
printf("Yes\n");
else
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181241/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181241/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@str = 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
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %d, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %sub, %2
%.pre = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp.not, label %lor.lhs.false, label %land.lhs.true
land.lhs.true: ; preds = %entry
%sub1 = sub nsw i32 %1, %.pre
%cmp2.not = icmp sgt i32 %sub1, %2
br i1 %cmp2.not, label %lor.lhs.false, label %land.lhs.true3
land.lhs.true3: ; preds = %land.lhs.true
%sub5 = sub nsw i32 0, %2
%cmp6.not = icmp slt i32 %sub, %sub5
%cmp10.not = icmp slt i32 %sub1, %sub5
%or.cond = or i1 %cmp6.not, %cmp10.not
br i1 %or.cond, label %lor.lhs.false, label %if.end
lor.lhs.false: ; preds = %land.lhs.true3, %land.lhs.true, %entry
%sub11 = sub nsw i32 %0, %.pre
%cmp12.not = icmp sgt i32 %sub11, %2
%sub15 = sub nsw i32 0, %2
%cmp16.not = icmp slt i32 %sub11, %sub15
%or.cond21 = select i1 %cmp12.not, i1 true, i1 %cmp16.not
%spec.select = select i1 %or.cond21, ptr @str, ptr @str.3
br label %if.end
if.end: ; preds = %lor.lhs.false, %land.lhs.true3
%str.sink = phi ptr [ @str.3, %land.lhs.true3 ], [ %spec.select, %lor.lhs.false ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 ads(int a){
if(a<0)
a=-a;
return a;}
int main(){
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(ads(a-b)<d+1&&ads(b-c)<d+1)
printf("Yes\n");
else if(ads(a-c)<d+1)
printf("Yes\n");
else
printf("No\n");
return 0;}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181292/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181292/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ads(i32 noundef %a) local_unnamed_addr #0 {
entry:
%spec.select = tail call i32 @llvm.abs.i32(i32 %a, i1 true)
ret i32 %spec.select
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%spec.select.i = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%2 = load i32, ptr %d, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %spec.select.i, %2
%.pre = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%sub2 = sub nsw i32 %1, %.pre
%spec.select.i18 = call i32 @llvm.abs.i32(i32 %sub2, i1 true)
%cmp5.not = icmp sgt i32 %spec.select.i18, %2
br i1 %cmp5.not, label %if.else, label %if.end15
if.else: ; preds = %land.lhs.true, %entry
%sub7 = sub nsw i32 %0, %.pre
%spec.select.i19 = call i32 @llvm.abs.i32(i32 %sub7, i1 true)
%cmp10.not = icmp sgt i32 %spec.select.i19, %2
%str.str.3 = select i1 %cmp10.not, ptr @str, ptr @str.4
br label %if.end15
if.end15: ; preds = %if.else, %land.lhs.true
%str.3.sink = phi ptr [ @str.4, %land.lhs.true ], [ %str.str.3, %if.else ]
%puts16 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main(void){
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(abs(a-c)<=d || (abs(a-b)<=d && abs(b-c)<=d))
printf("Yes");
else
printf("No");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181335/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181335/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"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
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%3 = load i32, ptr %d, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %2, %3
br i1 %cmp.not, label %lor.lhs.false, label %if.end
lor.lhs.false: ; preds = %entry
%4 = load i32, ptr %b, align 4, !tbaa !5
%sub1 = sub nsw i32 %0, %4
%5 = call i32 @llvm.abs.i32(i32 %sub1, i1 true)
%cmp2.not = icmp sgt i32 %5, %3
br i1 %cmp2.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %lor.lhs.false
%sub3 = sub nsw i32 %4, %1
%6 = call i32 @llvm.abs.i32(i32 %sub3, i1 true)
%cmp4.not = icmp sgt i32 %6, %3
br i1 %cmp4.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true, %lor.lhs.false
br label %if.end
if.end: ; preds = %entry, %land.lhs.true, %if.else
%.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ], [ @.str.1, %entry ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int T,i;
scanf("%d",&T);
for(i=0;i<T;i++){
int a,b,c,d,k;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&k);
int no_penc=0, no_pen=0;
if(a%c==0) no_pen=a/c;
else no_pen=(a/c)+1;
if(b%d==0) no_penc=b/d;
else no_penc=(b/d)+1;
if(no_penc+no_pen<=k) printf("%d %d\n",no_pen,no_penc);
else printf("-1\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18140/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18140/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d%d%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%T = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end18
%i.023 = phi i32 [ %inc, %if.end18 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %k)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%rem = srem i32 %1, %2
%cmp2 = icmp ne i32 %rem, 0
%div = sdiv i32 %1, %2
%add = zext i1 %cmp2 to i32
%no_pen.0 = add nsw i32 %div, %add
%3 = load i32, ptr %b, align 4, !tbaa !5
%4 = load i32, ptr %d, align 4, !tbaa !5
%rem4 = srem i32 %3, %4
%cmp5 = icmp ne i32 %rem4, 0
%div7 = sdiv i32 %3, %4
%add10 = zext i1 %cmp5 to i32
%no_penc.0 = add nsw i32 %div7, %add10
%add12 = add nsw i32 %no_penc.0, %no_pen.0
%5 = load i32, ptr %k, align 4, !tbaa !5
%cmp13.not = icmp sgt i32 %add12, %5
br i1 %cmp13.not, label %if.else16, label %if.then14
if.then14: ; preds = %for.body
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %no_pen.0, i32 noundef %no_penc.0)
br label %if.end18
if.else16: ; preds = %for.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end18
if.end18: ; preds = %if.else16, %if.then14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
%inc = add nuw nsw i32 %i.023, 1
%6 = load i32, ptr %T, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end18, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int def(int a, int b);
int main(void){
int a, b, c, d;
int flag = 0;
scanf("%d %d %d %d", &a, &b, &c, &d);
if(def(a, b)>d || def(b, c)>d) flag++;
if(def(a, c)<=d) flag = 0;
if(!flag){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
}
int def(int a, int b){
return (a<b) ? b-a : a-b;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181465/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181465/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@str = 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:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub1.i = sub nsw i32 %0, %1
%cond.i = call i32 @llvm.abs.i32(i32 %sub1.i, i1 true)
%2 = load i32, ptr %d, align 4, !tbaa !5
%cmp = icmp sgt i32 %cond.i, %2
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%sub1.i14 = sub nsw i32 %1, %.pre.pre
%cond.i15 = call i32 @llvm.abs.i32(i32 %sub1.i14, i1 true)
%cmp3 = icmp sgt i32 %cond.i15, %2
br i1 %cmp3, label %if.end, label %if.end11
if.end: ; preds = %entry, %lor.lhs.false
%sub1.i16 = sub nsw i32 %0, %.pre.pre
%cond.i17 = call i32 @llvm.abs.i32(i32 %sub1.i16, i1 true)
%cmp5.not.not = icmp sgt i32 %cond.i17, %2
%spec.select = select i1 %cmp5.not.not, ptr @str.3, ptr @str
br label %if.end11
if.end11: ; preds = %if.end, %lor.lhs.false
%str.3.sink = phi ptr [ @str, %lor.lhs.false ], [ %spec.select, %if.end ]
%puts13 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @def(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%sub1 = sub nsw i32 %a, %b
%cond = tail call i32 @llvm.abs.i32(i32 %sub1, i1 true)
ret i32 %cond
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, 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 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int i,j,n,k,a[200][3],x=0;
scanf("%d",&n);
for(i=0;i<n;i++)for(j=0;j<3;j++)scanf("%d",&a[i][j]);
for(i=0;i<3;i++)for(j=0;j<n;j++)for(k=j;k<n;k++)if(a[j][i]%100==a[k][i]%100 && j!=k)a[j][i]+=100,a[k][i]+=100;
for(i=0;i<n;i++)for(j=0;j<3;j++)if(a[i][j]>100)a[i][j]=0;
for(i=0;i<n;i++)printf("%d\n",a[i][0]+a[i][1]+a[i][2]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181522/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181522/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [200 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 2400, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp123 = icmp sgt i32 %0, 0
br i1 %cmp123, label %for.cond1.preheader, label %for.end88
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %entry ]
%arrayidx5 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 0
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%arrayidx5.1 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 1
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 2
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%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.cond1.preheader, label %for.cond10.preheader, !llvm.loop !9
for.cond10.preheader: ; preds = %for.cond1.preheader
%cmp14126 = icmp sgt i32 %1, 0
br i1 %cmp14126, label %for.cond13.preheader.us.preheader, label %for.end88
for.cond13.preheader.us.preheader: ; preds = %for.cond10.preheader
%3 = zext i32 %1 to i64
%wide.trip.count = zext i32 %1 to i64
br label %for.cond16.preheader.us
for.inc42.us: ; preds = %for.inc39.us
%indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
%exitcond.not = icmp eq i64 %indvars.iv.next139, %wide.trip.count
br i1 %exitcond.not, label %for.cond16.preheader.us.1, label %for.cond16.preheader.us, !llvm.loop !11
for.body18.us: ; preds = %for.cond16.preheader.us, %for.inc39.us
%indvars.iv140 = phi i64 [ %indvars.iv138, %for.cond16.preheader.us ], [ %indvars.iv.next141, %for.inc39.us ]
%4 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5
%rem.us = srem i32 %4, 100
%arrayidx26.us = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv140, i64 0
%5 = load i32, ptr %arrayidx26.us, align 4, !tbaa !5
%rem27.us = srem i32 %5, 100
%cmp28.us = icmp ne i32 %rem.us, %rem27.us
%cmp29.not.us = icmp eq i64 %indvars.iv138, %indvars.iv140
%or.cond.us = or i1 %cmp29.not.us, %cmp28.us
br i1 %or.cond.us, label %for.inc39.us, label %if.then.us
if.then.us: ; preds = %for.body18.us
%add.us = add nsw i32 %4, 100
store i32 %add.us, ptr %arrayidx22.us, align 4, !tbaa !5
%6 = load i32, ptr %arrayidx26.us, align 4, !tbaa !5
%add38.us = add nsw i32 %6, 100
store i32 %add38.us, ptr %arrayidx26.us, align 4, !tbaa !5
br label %for.inc39.us
for.inc39.us: ; preds = %if.then.us, %for.body18.us
%indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
%cmp17.us = icmp ult i64 %indvars.iv.next141, %3
br i1 %cmp17.us, label %for.body18.us, label %for.inc42.us, !llvm.loop !12
for.cond16.preheader.us: ; preds = %for.cond13.preheader.us.preheader, %for.inc42.us
%indvars.iv138 = phi i64 [ 0, %for.cond13.preheader.us.preheader ], [ %indvars.iv.next139, %for.inc42.us ]
%arrayidx22.us = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv138, i64 0
br label %for.body18.us
for.cond16.preheader.us.1: ; preds = %for.inc42.us, %for.inc42.us.1
%indvars.iv138.1 = phi i64 [ %indvars.iv.next139.1, %for.inc42.us.1 ], [ 0, %for.inc42.us ]
%arrayidx22.us.1 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv138.1, i64 1
br label %for.body18.us.1
for.body18.us.1: ; preds = %for.inc39.us.1, %for.cond16.preheader.us.1
%indvars.iv140.1 = phi i64 [ %indvars.iv138.1, %for.cond16.preheader.us.1 ], [ %indvars.iv.next141.1, %for.inc39.us.1 ]
%7 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !5
%rem.us.1 = srem i32 %7, 100
%arrayidx26.us.1 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv140.1, i64 1
%8 = load i32, ptr %arrayidx26.us.1, align 4, !tbaa !5
%rem27.us.1 = srem i32 %8, 100
%cmp28.us.1 = icmp ne i32 %rem.us.1, %rem27.us.1
%cmp29.not.us.1 = icmp eq i64 %indvars.iv138.1, %indvars.iv140.1
%or.cond.us.1 = or i1 %cmp29.not.us.1, %cmp28.us.1
br i1 %or.cond.us.1, label %for.inc39.us.1, label %if.then.us.1
if.then.us.1: ; preds = %for.body18.us.1
%add.us.1 = add nsw i32 %7, 100
store i32 %add.us.1, ptr %arrayidx22.us.1, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx26.us.1, align 4, !tbaa !5
%add38.us.1 = add nsw i32 %9, 100
store i32 %add38.us.1, ptr %arrayidx26.us.1, align 4, !tbaa !5
br label %for.inc39.us.1
for.inc39.us.1: ; preds = %if.then.us.1, %for.body18.us.1
%indvars.iv.next141.1 = add nuw nsw i64 %indvars.iv140.1, 1
%cmp17.us.1 = icmp ult i64 %indvars.iv.next141.1, %3
br i1 %cmp17.us.1, label %for.body18.us.1, label %for.inc42.us.1, !llvm.loop !12
for.inc42.us.1: ; preds = %for.inc39.us.1
%indvars.iv.next139.1 = add nuw nsw i64 %indvars.iv138.1, 1
%exitcond.1.not = icmp eq i64 %indvars.iv.next139.1, %wide.trip.count
br i1 %exitcond.1.not, label %for.cond16.preheader.us.2, label %for.cond16.preheader.us.1, !llvm.loop !11
for.cond16.preheader.us.2: ; preds = %for.inc42.us.1, %for.inc42.us.2
%indvars.iv138.2 = phi i64 [ %indvars.iv.next139.2, %for.inc42.us.2 ], [ 0, %for.inc42.us.1 ]
%arrayidx22.us.2 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv138.2, i64 2
br label %for.body18.us.2
for.body18.us.2: ; preds = %for.inc39.us.2, %for.cond16.preheader.us.2
%indvars.iv140.2 = phi i64 [ %indvars.iv138.2, %for.cond16.preheader.us.2 ], [ %indvars.iv.next141.2, %for.inc39.us.2 ]
%10 = load i32, ptr %arrayidx22.us.2, align 4, !tbaa !5
%rem.us.2 = srem i32 %10, 100
%arrayidx26.us.2 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv140.2, i64 2
%11 = load i32, ptr %arrayidx26.us.2, align 4, !tbaa !5
%rem27.us.2 = srem i32 %11, 100
%cmp28.us.2 = icmp ne i32 %rem.us.2, %rem27.us.2
%cmp29.not.us.2 = icmp eq i64 %indvars.iv138.2, %indvars.iv140.2
%or.cond.us.2 = or i1 %cmp29.not.us.2, %cmp28.us.2
br i1 %or.cond.us.2, label %for.inc39.us.2, label %if.then.us.2
if.then.us.2: ; preds = %for.body18.us.2
%add.us.2 = add nsw i32 %10, 100
store i32 %add.us.2, ptr %arrayidx22.us.2, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx26.us.2, align 4, !tbaa !5
%add38.us.2 = add nsw i32 %12, 100
store i32 %add38.us.2, ptr %arrayidx26.us.2, align 4, !tbaa !5
br label %for.inc39.us.2
for.inc39.us.2: ; preds = %if.then.us.2, %for.body18.us.2
%indvars.iv.next141.2 = add nuw nsw i64 %indvars.iv140.2, 1
%cmp17.us.2 = icmp ult i64 %indvars.iv.next141.2, %3
br i1 %cmp17.us.2, label %for.body18.us.2, label %for.inc42.us.2, !llvm.loop !12
for.inc42.us.2: ; preds = %for.inc39.us.2
%indvars.iv.next139.2 = add nuw nsw i64 %indvars.iv138.2, 1
%exitcond.2.not = icmp eq i64 %indvars.iv.next139.2, %wide.trip.count
br i1 %exitcond.2.not, label %for.cond48.preheader, label %for.cond16.preheader.us.2, !llvm.loop !11
for.cond48.preheader: ; preds = %for.inc42.us.2
br i1 %cmp14126, label %for.cond51.preheader.preheader, label %for.end88
for.cond51.preheader.preheader: ; preds = %for.cond48.preheader
%wide.trip.count155 = zext i32 %1 to i64
br label %for.cond51.preheader
for.cond51.preheader: ; preds = %for.cond51.preheader.preheader, %for.inc65.2
%indvars.iv152 = phi i64 [ 0, %for.cond51.preheader.preheader ], [ %indvars.iv.next153, %for.inc65.2 ]
%arrayidx57 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv152, i64 0
%13 = load i32, ptr %arrayidx57, align 4, !tbaa !5
%cmp58 = icmp sgt i32 %13, 100
br i1 %cmp58, label %if.then59, label %for.inc65
for.cond71.preheader: ; preds = %for.inc65.2
br i1 %cmp14126, label %for.body73, label %for.end88
if.then59: ; preds = %for.cond51.preheader
store i32 0, ptr %arrayidx57, align 4, !tbaa !5
br label %for.inc65
for.inc65: ; preds = %for.cond51.preheader, %if.then59
%arrayidx57.1 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv152, i64 1
%14 = load i32, ptr %arrayidx57.1, align 4, !tbaa !5
%cmp58.1 = icmp sgt i32 %14, 100
br i1 %cmp58.1, label %if.then59.1, label %for.inc65.1
if.then59.1: ; preds = %for.inc65
store i32 0, ptr %arrayidx57.1, align 4, !tbaa !5
br label %for.inc65.1
for.inc65.1: ; preds = %if.then59.1, %for.inc65
%arrayidx57.2 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv152, i64 2
%15 = load i32, ptr %arrayidx57.2, align 4, !tbaa !5
%cmp58.2 = icmp sgt i32 %15, 100
br i1 %cmp58.2, label %if.then59.2, label %for.inc65.2
if.then59.2: ; preds = %for.inc65.1
store i32 0, ptr %arrayidx57.2, align 4, !tbaa !5
br label %for.inc65.2
for.inc65.2: ; preds = %if.then59.2, %for.inc65.1
%indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1
%exitcond156.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count155
br i1 %exitcond156.not, label %for.cond71.preheader, label %for.cond51.preheader, !llvm.loop !13
for.body73: ; preds = %for.cond71.preheader, %for.body73
%indvars.iv157 = phi i64 [ %indvars.iv.next158, %for.body73 ], [ 0, %for.cond71.preheader ]
%arrayidx75 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv157
%16 = load i32, ptr %arrayidx75, align 4, !tbaa !5
%arrayidx79 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv157, i64 1
%17 = load i32, ptr %arrayidx79, align 4, !tbaa !5
%add80 = add nsw i32 %17, %16
%arrayidx83 = getelementptr inbounds [200 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv157, i64 2
%18 = load i32, ptr %arrayidx83, align 4, !tbaa !5
%add84 = add nsw i32 %add80, %18
%call85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add84)
%indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
%19 = load i32, ptr %n, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp72 = icmp slt i64 %indvars.iv.next158, %20
br i1 %cmp72, label %for.body73, label %for.end88, !llvm.loop !14
for.end88: ; preds = %for.body73, %entry, %for.cond10.preheader, %for.cond48.preheader, %for.cond71.preheader
call void @llvm.lifetime.end.p0(i64 2400, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(void){
int i, j, k;
int n, player[600], co;
int cplayer[600] = {0};
scanf("%d", &n);
for(i = 0; i < n*3; i++){
scanf("%d", &player[i]);
}
for(i = 0; i < 3; i++){
for(j = 0; j < n-1; j++){
co = 0;
for(k = 0; k < n-j-1; k++){
if(player[(k+j+1)*3+i] == player[j*3+i]){
cplayer[(k+j+1)*3+i] = 1;
co = 1;
}
}
if(co == 1) cplayer[j*3+i] = 1;
}
}
for(i = 0; i < n*3; i++){
if(cplayer[i] == 1) player[i] = 0;
}
co = 0;
for(i = 0; i < n; i++){
printf("%d\n", player[i*co] + player[i*co+1] + player[i*co+2]);
co = 3;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_181566/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_181566/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%player = alloca [600 x i32], align 16
%cplayer = alloca [600 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 2400, ptr nonnull %player) #4
call void @llvm.lifetime.start.p0(i64 2400, ptr nonnull %cplayer) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2400) %cplayer, i8 0, i64 2400, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul108 = mul nsw i32 %0, 3
%cmp109 = icmp sgt i32 %0, 0
br i1 %cmp109, label %for.body, label %for.cond45.preheader
for.cond2.preheader: ; preds = %for.body
%sub = add i32 %41, -1
%cmp6116 = icmp sgt i32 %41, 1
br i1 %cmp6116, label %for.cond5.preheader.us.preheader, label %for.cond45.preheader
for.cond5.preheader.us.preheader: ; preds = %for.cond2.preheader
%wide.trip.count141 = zext i32 %sub to i64
br label %for.cond8.preheader.us
for.end31.us.unr-lcssa: ; preds = %for.inc29.us.1197, %for.body12.lr.ph.us
%co.1.us.lcssa.ph = phi i32 [ undef, %for.body12.lr.ph.us ], [ %co.1.us.1195, %for.inc29.us.1197 ]
%indvars.iv128.unr = phi i64 [ 0, %for.body12.lr.ph.us ], [ %indvars.iv.next129.1196, %for.inc29.us.1197 ]
%co.0114.us.unr = phi i32 [ 0, %for.body12.lr.ph.us ], [ %co.1.us.1195, %for.inc29.us.1197 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end31.us, label %for.body12.us.epil
for.body12.us.epil: ; preds = %for.end31.us.unr-lcssa
%1 = add nuw nsw i64 %indvars.iv128.unr, %indvars.iv134
%add15.us.epil = mul i64 %1, 12884901888
%sext.epil = add i64 %add15.us.epil, 12884901888
%idxprom16.us.epil = ashr exact i64 %sext.epil, 32
%arrayidx17.us.epil = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us.epil
%2 = load i32, ptr %arrayidx17.us.epil, align 4, !tbaa !5
%cmp22.us.epil = icmp eq i32 %2, %11
br i1 %cmp22.us.epil, label %if.then.us.epil, label %for.end31.us
if.then.us.epil: ; preds = %for.body12.us.epil
%arrayidx28.us.epil = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us.epil
store i32 1, ptr %arrayidx28.us.epil, align 4, !tbaa !5
br label %for.end31.us
for.end31.us: ; preds = %for.body12.us.epil, %if.then.us.epil, %for.end31.us.unr-lcssa
%co.1.us.lcssa = phi i32 [ %co.1.us.lcssa.ph, %for.end31.us.unr-lcssa ], [ 1, %if.then.us.epil ], [ %co.0114.us.unr, %for.body12.us.epil ]
%cmp32.us = icmp eq i32 %co.1.us.lcssa, 1
br i1 %cmp32.us, label %if.then33.us, label %for.inc39.us
if.then33.us: ; preds = %for.end31.us
%3 = mul i64 %indvars.iv134, 3
%idxprom36.us = and i64 %3, 4294967295
%arrayidx37.us = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom36.us
store i32 1, ptr %arrayidx37.us, align 4, !tbaa !5
br label %for.inc39.us
for.inc39.us: ; preds = %for.cond8.preheader.us, %if.then33.us, %for.end31.us
%indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
%indvars.iv.next133 = add i32 %indvars.iv132, -1
%exitcond142.not = icmp eq i64 %indvars.iv.next135, %wide.trip.count141
br i1 %exitcond142.not, label %for.cond8.preheader.us.1, label %for.cond8.preheader.us, !llvm.loop !9
for.body12.us: ; preds = %for.inc29.us.1197, %for.body12.lr.ph.us.new
%indvars.iv128 = phi i64 [ 0, %for.body12.lr.ph.us.new ], [ %indvars.iv.next129.1196, %for.inc29.us.1197 ]
%co.0114.us = phi i32 [ 0, %for.body12.lr.ph.us.new ], [ %co.1.us.1195, %for.inc29.us.1197 ]
%niter = phi i64 [ 0, %for.body12.lr.ph.us.new ], [ %niter.next.1, %for.inc29.us.1197 ]
%4 = add nuw nsw i64 %indvars.iv128, %indvars.iv134
%add15.us = mul i64 %4, 12884901888
%sext = add i64 %add15.us, 12884901888
%idxprom16.us = ashr exact i64 %sext, 32
%arrayidx17.us = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us
%5 = load i32, ptr %arrayidx17.us, align 4, !tbaa !5
%cmp22.us = icmp eq i32 %5, %11
br i1 %cmp22.us, label %if.then.us, label %for.inc29.us
if.then.us: ; preds = %for.body12.us
%arrayidx28.us = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us
store i32 1, ptr %arrayidx28.us, align 4, !tbaa !5
br label %for.inc29.us
for.inc29.us: ; preds = %if.then.us, %for.body12.us
%co.1.us = phi i32 [ 1, %if.then.us ], [ %co.0114.us, %for.body12.us ]
%indvars.iv.next129 = or i64 %indvars.iv128, 1
%6 = add nuw nsw i64 %indvars.iv.next129, %indvars.iv134
%add15.us.1188 = mul i64 %6, 12884901888
%sext.1 = add i64 %add15.us.1188, 12884901888
%idxprom16.us.1189 = ashr exact i64 %sext.1, 32
%arrayidx17.us.1190 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us.1189
%7 = load i32, ptr %arrayidx17.us.1190, align 4, !tbaa !5
%cmp22.us.1191 = icmp eq i32 %7, %11
br i1 %cmp22.us.1191, label %if.then.us.1194, label %for.inc29.us.1197
if.then.us.1194: ; preds = %for.inc29.us
%arrayidx28.us.1193 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us.1189
store i32 1, ptr %arrayidx28.us.1193, align 4, !tbaa !5
br label %for.inc29.us.1197
for.inc29.us.1197: ; preds = %if.then.us.1194, %for.inc29.us
%co.1.us.1195 = phi i32 [ 1, %if.then.us.1194 ], [ %co.1.us, %for.inc29.us ]
%indvars.iv.next129.1196 = add nuw nsw i64 %indvars.iv128, 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.end31.us.unr-lcssa, label %for.body12.us, !llvm.loop !11
for.cond8.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.inc39.us
%indvars.iv134 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next135, %for.inc39.us ]
%indvars.iv132 = phi i32 [ %sub, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next133, %for.inc39.us ]
%8 = zext i32 %indvars.iv132 to i64
%indvars140 = trunc i64 %indvars.iv134 to i32
%9 = xor i32 %indvars140, -1
%sub10.us = add i32 %41, %9
%cmp11112.us = icmp sgt i32 %sub10.us, 0
br i1 %cmp11112.us, label %for.body12.lr.ph.us, label %for.inc39.us
for.body12.lr.ph.us: ; preds = %for.cond8.preheader.us
%10 = mul i64 %indvars.iv134, 3
%idxprom20.us = and i64 %10, 4294967295
%arrayidx21.us = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom20.us
%11 = load i32, ptr %arrayidx21.us, align 4, !tbaa !5
%xtraiter = and i64 %8, 1
%12 = icmp eq i32 %indvars.iv132, 1
br i1 %12, label %for.end31.us.unr-lcssa, label %for.body12.lr.ph.us.new
for.body12.lr.ph.us.new: ; preds = %for.body12.lr.ph.us
%unroll_iter = and i64 %8, 4294967294
br label %for.body12.us
for.cond8.preheader.us.1: ; preds = %for.inc39.us, %for.inc39.us.1
%indvars.iv134.1 = phi i64 [ %indvars.iv.next135.1, %for.inc39.us.1 ], [ 0, %for.inc39.us ]
%indvars.iv132.1 = phi i32 [ %indvars.iv.next133.1, %for.inc39.us.1 ], [ %sub, %for.inc39.us ]
%13 = zext i32 %indvars.iv132.1 to i64
%indvars140.1 = trunc i64 %indvars.iv134.1 to i32
%14 = xor i32 %indvars140.1, -1
%sub10.us.1 = add i32 %41, %14
%cmp11112.us.1 = icmp sgt i32 %sub10.us.1, 0
br i1 %cmp11112.us.1, label %for.body12.lr.ph.us.1, label %for.inc39.us.1
for.body12.lr.ph.us.1: ; preds = %for.cond8.preheader.us.1
%15 = mul i64 %indvars.iv134.1, 3
%16 = add i64 %15, 1
%idxprom20.us.1 = and i64 %16, 4294967295
%arrayidx21.us.1 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom20.us.1
%17 = load i32, ptr %arrayidx21.us.1, align 4, !tbaa !5
%xtraiter198 = and i64 %13, 1
%18 = icmp eq i32 %indvars.iv132.1, 1
br i1 %18, label %for.end31.us.1.unr-lcssa, label %for.body12.lr.ph.us.1.new
for.body12.lr.ph.us.1.new: ; preds = %for.body12.lr.ph.us.1
%unroll_iter201 = and i64 %13, 4294967294
br label %for.body12.us.1
for.body12.us.1: ; preds = %for.inc29.us.1.1, %for.body12.lr.ph.us.1.new
%indvars.iv128.1 = phi i64 [ 0, %for.body12.lr.ph.us.1.new ], [ %indvars.iv.next129.1.1, %for.inc29.us.1.1 ]
%co.0114.us.1 = phi i32 [ 0, %for.body12.lr.ph.us.1.new ], [ %co.1.us.1.1, %for.inc29.us.1.1 ]
%niter202 = phi i64 [ 0, %for.body12.lr.ph.us.1.new ], [ %niter202.next.1, %for.inc29.us.1.1 ]
%19 = add nuw nsw i64 %indvars.iv128.1, %indvars.iv134.1
%add15.us.1 = mul i64 %19, 12884901888
%sext154 = add i64 %add15.us.1, 17179869184
%idxprom16.us.1 = ashr exact i64 %sext154, 32
%arrayidx17.us.1 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us.1
%20 = load i32, ptr %arrayidx17.us.1, align 4, !tbaa !5
%cmp22.us.1 = icmp eq i32 %20, %17
br i1 %cmp22.us.1, label %if.then.us.1, label %for.inc29.us.1
if.then.us.1: ; preds = %for.body12.us.1
%arrayidx28.us.1 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us.1
store i32 1, ptr %arrayidx28.us.1, align 4, !tbaa !5
br label %for.inc29.us.1
for.inc29.us.1: ; preds = %if.then.us.1, %for.body12.us.1
%co.1.us.1 = phi i32 [ 1, %if.then.us.1 ], [ %co.0114.us.1, %for.body12.us.1 ]
%indvars.iv.next129.1 = or i64 %indvars.iv128.1, 1
%21 = add nuw nsw i64 %indvars.iv.next129.1, %indvars.iv134.1
%add15.us.1.1 = mul i64 %21, 12884901888
%sext154.1 = add i64 %add15.us.1.1, 17179869184
%idxprom16.us.1.1 = ashr exact i64 %sext154.1, 32
%arrayidx17.us.1.1 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us.1.1
%22 = load i32, ptr %arrayidx17.us.1.1, align 4, !tbaa !5
%cmp22.us.1.1 = icmp eq i32 %22, %17
br i1 %cmp22.us.1.1, label %if.then.us.1.1, label %for.inc29.us.1.1
if.then.us.1.1: ; preds = %for.inc29.us.1
%arrayidx28.us.1.1 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us.1.1
store i32 1, ptr %arrayidx28.us.1.1, align 4, !tbaa !5
br label %for.inc29.us.1.1
for.inc29.us.1.1: ; preds = %if.then.us.1.1, %for.inc29.us.1
%co.1.us.1.1 = phi i32 [ 1, %if.then.us.1.1 ], [ %co.1.us.1, %for.inc29.us.1 ]
%indvars.iv.next129.1.1 = add nuw nsw i64 %indvars.iv128.1, 2
%niter202.next.1 = add i64 %niter202, 2
%niter202.ncmp.1 = icmp eq i64 %niter202.next.1, %unroll_iter201
br i1 %niter202.ncmp.1, label %for.end31.us.1.unr-lcssa, label %for.body12.us.1, !llvm.loop !11
for.end31.us.1.unr-lcssa: ; preds = %for.inc29.us.1.1, %for.body12.lr.ph.us.1
%co.1.us.1.lcssa.ph = phi i32 [ undef, %for.body12.lr.ph.us.1 ], [ %co.1.us.1.1, %for.inc29.us.1.1 ]
%indvars.iv128.1.unr = phi i64 [ 0, %for.body12.lr.ph.us.1 ], [ %indvars.iv.next129.1.1, %for.inc29.us.1.1 ]
%co.0114.us.1.unr = phi i32 [ 0, %for.body12.lr.ph.us.1 ], [ %co.1.us.1.1, %for.inc29.us.1.1 ]
%lcmp.mod199.not = icmp eq i64 %xtraiter198, 0
br i1 %lcmp.mod199.not, label %for.end31.us.1, label %for.body12.us.1.epil
for.body12.us.1.epil: ; preds = %for.end31.us.1.unr-lcssa
%23 = add nuw nsw i64 %indvars.iv128.1.unr, %indvars.iv134.1
%add15.us.1.epil = mul i64 %23, 12884901888
%sext154.epil = add i64 %add15.us.1.epil, 17179869184
%idxprom16.us.1.epil = ashr exact i64 %sext154.epil, 32
%arrayidx17.us.1.epil = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us.1.epil
%24 = load i32, ptr %arrayidx17.us.1.epil, align 4, !tbaa !5
%cmp22.us.1.epil = icmp eq i32 %24, %17
br i1 %cmp22.us.1.epil, label %if.then.us.1.epil, label %for.end31.us.1
if.then.us.1.epil: ; preds = %for.body12.us.1.epil
%arrayidx28.us.1.epil = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us.1.epil
store i32 1, ptr %arrayidx28.us.1.epil, align 4, !tbaa !5
br label %for.end31.us.1
for.end31.us.1: ; preds = %for.body12.us.1.epil, %if.then.us.1.epil, %for.end31.us.1.unr-lcssa
%co.1.us.1.lcssa = phi i32 [ %co.1.us.1.lcssa.ph, %for.end31.us.1.unr-lcssa ], [ 1, %if.then.us.1.epil ], [ %co.0114.us.1.unr, %for.body12.us.1.epil ]
%cmp32.us.1 = icmp eq i32 %co.1.us.1.lcssa, 1
br i1 %cmp32.us.1, label %if.then33.us.1, label %for.inc39.us.1
if.then33.us.1: ; preds = %for.end31.us.1
%25 = mul i64 %indvars.iv134.1, 3
%26 = add i64 %25, 1
%idxprom36.us.1 = and i64 %26, 4294967295
%arrayidx37.us.1 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom36.us.1
store i32 1, ptr %arrayidx37.us.1, align 4, !tbaa !5
br label %for.inc39.us.1
for.inc39.us.1: ; preds = %for.cond8.preheader.us.1, %if.then33.us.1, %for.end31.us.1
%indvars.iv.next135.1 = add nuw nsw i64 %indvars.iv134.1, 1
%indvars.iv.next133.1 = add i32 %indvars.iv132.1, -1
%exitcond142.1.not = icmp eq i64 %indvars.iv.next135.1, %wide.trip.count141
br i1 %exitcond142.1.not, label %for.cond8.preheader.us.2, label %for.cond8.preheader.us.1, !llvm.loop !9
for.cond8.preheader.us.2: ; preds = %for.inc39.us.1, %for.inc39.us.2
%indvars.iv134.2 = phi i64 [ %indvars.iv.next135.2, %for.inc39.us.2 ], [ 0, %for.inc39.us.1 ]
%indvars.iv132.2 = phi i32 [ %indvars.iv.next133.2, %for.inc39.us.2 ], [ %sub, %for.inc39.us.1 ]
%27 = zext i32 %indvars.iv132.2 to i64
%indvars140.2 = trunc i64 %indvars.iv134.2 to i32
%28 = xor i32 %indvars140.2, -1
%sub10.us.2 = add i32 %41, %28
%cmp11112.us.2 = icmp sgt i32 %sub10.us.2, 0
br i1 %cmp11112.us.2, label %for.body12.lr.ph.us.2, label %for.inc39.us.2
for.body12.lr.ph.us.2: ; preds = %for.cond8.preheader.us.2
%29 = mul i64 %indvars.iv134.2, 3
%30 = add i64 %29, 2
%idxprom20.us.2 = and i64 %30, 4294967295
%arrayidx21.us.2 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom20.us.2
%31 = load i32, ptr %arrayidx21.us.2, align 4, !tbaa !5
%xtraiter203 = and i64 %27, 1
%32 = icmp eq i32 %indvars.iv132.2, 1
br i1 %32, label %for.end31.us.2.unr-lcssa, label %for.body12.lr.ph.us.2.new
for.body12.lr.ph.us.2.new: ; preds = %for.body12.lr.ph.us.2
%unroll_iter206 = and i64 %27, 4294967294
br label %for.body12.us.2
for.body12.us.2: ; preds = %for.inc29.us.2.1, %for.body12.lr.ph.us.2.new
%indvars.iv128.2 = phi i64 [ 0, %for.body12.lr.ph.us.2.new ], [ %indvars.iv.next129.2.1, %for.inc29.us.2.1 ]
%co.0114.us.2 = phi i32 [ 0, %for.body12.lr.ph.us.2.new ], [ %co.1.us.2.1, %for.inc29.us.2.1 ]
%niter207 = phi i64 [ 0, %for.body12.lr.ph.us.2.new ], [ %niter207.next.1, %for.inc29.us.2.1 ]
%33 = add nuw nsw i64 %indvars.iv128.2, %indvars.iv134.2
%add15.us.2 = mul i64 %33, 12884901888
%sext155 = add i64 %add15.us.2, 21474836480
%idxprom16.us.2 = ashr exact i64 %sext155, 32
%arrayidx17.us.2 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us.2
%34 = load i32, ptr %arrayidx17.us.2, align 4, !tbaa !5
%cmp22.us.2 = icmp eq i32 %34, %31
br i1 %cmp22.us.2, label %if.then.us.2, label %for.inc29.us.2
if.then.us.2: ; preds = %for.body12.us.2
%arrayidx28.us.2 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us.2
store i32 1, ptr %arrayidx28.us.2, align 4, !tbaa !5
br label %for.inc29.us.2
for.inc29.us.2: ; preds = %if.then.us.2, %for.body12.us.2
%co.1.us.2 = phi i32 [ 1, %if.then.us.2 ], [ %co.0114.us.2, %for.body12.us.2 ]
%indvars.iv.next129.2 = or i64 %indvars.iv128.2, 1
%35 = add nuw nsw i64 %indvars.iv.next129.2, %indvars.iv134.2
%add15.us.2.1 = mul i64 %35, 12884901888
%sext155.1 = add i64 %add15.us.2.1, 21474836480
%idxprom16.us.2.1 = ashr exact i64 %sext155.1, 32
%arrayidx17.us.2.1 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us.2.1
%36 = load i32, ptr %arrayidx17.us.2.1, align 4, !tbaa !5
%cmp22.us.2.1 = icmp eq i32 %36, %31
br i1 %cmp22.us.2.1, label %if.then.us.2.1, label %for.inc29.us.2.1
if.then.us.2.1: ; preds = %for.inc29.us.2
%arrayidx28.us.2.1 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us.2.1
store i32 1, ptr %arrayidx28.us.2.1, align 4, !tbaa !5
br label %for.inc29.us.2.1
for.inc29.us.2.1: ; preds = %if.then.us.2.1, %for.inc29.us.2
%co.1.us.2.1 = phi i32 [ 1, %if.then.us.2.1 ], [ %co.1.us.2, %for.inc29.us.2 ]
%indvars.iv.next129.2.1 = add nuw nsw i64 %indvars.iv128.2, 2
%niter207.next.1 = add i64 %niter207, 2
%niter207.ncmp.1 = icmp eq i64 %niter207.next.1, %unroll_iter206
br i1 %niter207.ncmp.1, label %for.end31.us.2.unr-lcssa, label %for.body12.us.2, !llvm.loop !11
for.end31.us.2.unr-lcssa: ; preds = %for.inc29.us.2.1, %for.body12.lr.ph.us.2
%co.1.us.2.lcssa.ph = phi i32 [ undef, %for.body12.lr.ph.us.2 ], [ %co.1.us.2.1, %for.inc29.us.2.1 ]
%indvars.iv128.2.unr = phi i64 [ 0, %for.body12.lr.ph.us.2 ], [ %indvars.iv.next129.2.1, %for.inc29.us.2.1 ]
%co.0114.us.2.unr = phi i32 [ 0, %for.body12.lr.ph.us.2 ], [ %co.1.us.2.1, %for.inc29.us.2.1 ]
%lcmp.mod204.not = icmp eq i64 %xtraiter203, 0
br i1 %lcmp.mod204.not, label %for.end31.us.2, label %for.body12.us.2.epil
for.body12.us.2.epil: ; preds = %for.end31.us.2.unr-lcssa
%37 = add nuw nsw i64 %indvars.iv128.2.unr, %indvars.iv134.2
%add15.us.2.epil = mul i64 %37, 12884901888
%sext155.epil = add i64 %add15.us.2.epil, 21474836480
%idxprom16.us.2.epil = ashr exact i64 %sext155.epil, 32
%arrayidx17.us.2.epil = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom16.us.2.epil
%38 = load i32, ptr %arrayidx17.us.2.epil, align 4, !tbaa !5
%cmp22.us.2.epil = icmp eq i32 %38, %31
br i1 %cmp22.us.2.epil, label %if.then.us.2.epil, label %for.end31.us.2
if.then.us.2.epil: ; preds = %for.body12.us.2.epil
%arrayidx28.us.2.epil = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom16.us.2.epil
store i32 1, ptr %arrayidx28.us.2.epil, align 4, !tbaa !5
br label %for.end31.us.2
for.end31.us.2: ; preds = %for.body12.us.2.epil, %if.then.us.2.epil, %for.end31.us.2.unr-lcssa
%co.1.us.2.lcssa = phi i32 [ %co.1.us.2.lcssa.ph, %for.end31.us.2.unr-lcssa ], [ 1, %if.then.us.2.epil ], [ %co.0114.us.2.unr, %for.body12.us.2.epil ]
%cmp32.us.2 = icmp eq i32 %co.1.us.2.lcssa, 1
br i1 %cmp32.us.2, label %if.then33.us.2, label %for.inc39.us.2
if.then33.us.2: ; preds = %for.end31.us.2
%39 = mul i64 %indvars.iv134.2, 3
%40 = add i64 %39, 2
%idxprom36.us.2 = and i64 %40, 4294967295
%arrayidx37.us.2 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %idxprom36.us.2
store i32 1, ptr %arrayidx37.us.2, align 4, !tbaa !5
br label %for.inc39.us.2
for.inc39.us.2: ; preds = %for.cond8.preheader.us.2, %if.then33.us.2, %for.end31.us.2
%indvars.iv.next135.2 = add nuw nsw i64 %indvars.iv134.2, 1
%indvars.iv.next133.2 = add i32 %indvars.iv132.2, -1
%exitcond142.2.not = icmp eq i64 %indvars.iv.next135.2, %wide.trip.count141
br i1 %exitcond142.2.not, label %for.cond45.preheader, label %for.cond8.preheader.us.2, !llvm.loop !9
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [600 x i32], ptr %player, 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
%41 = load i32, ptr %n, align 4, !tbaa !5
%mul = mul nsw i32 %41, 3
%42 = sext i32 %mul to i64
%cmp = icmp slt i64 %indvars.iv.next, %42
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !12
for.cond45.preheader: ; preds = %for.inc39.us.2, %entry, %for.cond2.preheader
%mul.lcssa159 = phi i32 [ %mul, %for.cond2.preheader ], [ %mul108, %entry ], [ %mul, %for.inc39.us.2 ]
%43 = phi i32 [ %41, %for.cond2.preheader ], [ %0, %entry ], [ %41, %for.inc39.us.2 ]
%cmp47119 = icmp sgt i32 %mul.lcssa159, 0
br i1 %cmp47119, label %for.body48.preheader, label %for.cond59.preheader
for.body48.preheader: ; preds = %for.cond45.preheader
%wide.trip.count151 = zext i32 %mul.lcssa159 to i64
%min.iters.check = icmp ult i32 %mul.lcssa159, 8
br i1 %min.iters.check, label %for.body48.preheader184, label %vector.ph
vector.ph: ; preds = %for.body48.preheader
%n.vec = and i64 %wide.trip.count151, 4294967288
br label %vector.body
vector.body: ; preds = %pred.store.continue182, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue182 ]
%44 = or i64 %index, 4
%45 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %45, align 16, !tbaa !5
%46 = getelementptr inbounds i32, ptr %45, i64 4
%wide.load168 = load <4 x i32>, ptr %46, align 16, !tbaa !5
%47 = icmp eq <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
%48 = icmp eq <4 x i32> %wide.load168, <i32 1, i32 1, i32 1, i32 1>
%49 = extractelement <4 x i1> %47, i64 0
br i1 %49, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%50 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %index
store i32 0, ptr %50, align 16, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%51 = extractelement <4 x i1> %47, i64 1
br i1 %51, label %pred.store.if169, label %pred.store.continue170
pred.store.if169: ; preds = %pred.store.continue
%52 = or i64 %index, 1
%53 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %52
store i32 0, ptr %53, align 4, !tbaa !5
br label %pred.store.continue170
pred.store.continue170: ; preds = %pred.store.if169, %pred.store.continue
%54 = extractelement <4 x i1> %47, i64 2
br i1 %54, label %pred.store.if171, label %pred.store.continue172
pred.store.if171: ; preds = %pred.store.continue170
%55 = or i64 %index, 2
%56 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %55
store i32 0, ptr %56, align 8, !tbaa !5
br label %pred.store.continue172
pred.store.continue172: ; preds = %pred.store.if171, %pred.store.continue170
%57 = extractelement <4 x i1> %47, i64 3
br i1 %57, label %pred.store.if173, label %pred.store.continue174
pred.store.if173: ; preds = %pred.store.continue172
%58 = or i64 %index, 3
%59 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %58
store i32 0, ptr %59, align 4, !tbaa !5
br label %pred.store.continue174
pred.store.continue174: ; preds = %pred.store.if173, %pred.store.continue172
%60 = extractelement <4 x i1> %48, i64 0
br i1 %60, label %pred.store.if175, label %pred.store.continue176
pred.store.if175: ; preds = %pred.store.continue174
%61 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %44
store i32 0, ptr %61, align 16, !tbaa !5
br label %pred.store.continue176
pred.store.continue176: ; preds = %pred.store.if175, %pred.store.continue174
%62 = extractelement <4 x i1> %48, i64 1
br i1 %62, label %pred.store.if177, label %pred.store.continue178
pred.store.if177: ; preds = %pred.store.continue176
%63 = or i64 %index, 5
%64 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %63
store i32 0, ptr %64, align 4, !tbaa !5
br label %pred.store.continue178
pred.store.continue178: ; preds = %pred.store.if177, %pred.store.continue176
%65 = extractelement <4 x i1> %48, i64 2
br i1 %65, label %pred.store.if179, label %pred.store.continue180
pred.store.if179: ; preds = %pred.store.continue178
%66 = or i64 %index, 6
%67 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %66
store i32 0, ptr %67, align 8, !tbaa !5
br label %pred.store.continue180
pred.store.continue180: ; preds = %pred.store.if179, %pred.store.continue178
%68 = extractelement <4 x i1> %48, i64 3
br i1 %68, label %pred.store.if181, label %pred.store.continue182
pred.store.if181: ; preds = %pred.store.continue180
%69 = or i64 %index, 7
%70 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %69
store i32 0, ptr %70, align 4, !tbaa !5
br label %pred.store.continue182
pred.store.continue182: ; preds = %pred.store.if181, %pred.store.continue180
%index.next = add nuw i64 %index, 8
%71 = icmp eq i64 %index.next, %n.vec
br i1 %71, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %pred.store.continue182
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count151
br i1 %cmp.n, label %for.cond59.preheader, label %for.body48.preheader184
for.body48.preheader184: ; preds = %for.body48.preheader, %middle.block
%indvars.iv148.ph = phi i64 [ 0, %for.body48.preheader ], [ %n.vec, %middle.block ]
br label %for.body48
for.cond59.preheader: ; preds = %for.inc56, %middle.block, %for.cond45.preheader
%cmp60121 = icmp sgt i32 %43, 0
br i1 %cmp60121, label %for.body61.preheader, label %for.end78
for.body61.preheader: ; preds = %for.cond59.preheader
%72 = load i32, ptr %player, align 16, !tbaa !5
%arrayidx68.peel = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 1
%73 = load i32, ptr %arrayidx68.peel, align 4, !tbaa !5
%add69.peel = add nsw i32 %73, %72
%arrayidx73.peel = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 2
%74 = load i32, ptr %arrayidx73.peel, align 8, !tbaa !5
%add74.peel = add nsw i32 %add69.peel, %74
%call75.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add74.peel)
%75 = load i32, ptr %n, align 4, !tbaa !5
%cmp60.peel = icmp sgt i32 %75, 1
br i1 %cmp60.peel, label %for.body61, label %for.end78
for.body48: ; preds = %for.body48.preheader184, %for.inc56
%indvars.iv148 = phi i64 [ %indvars.iv.next149, %for.inc56 ], [ %indvars.iv148.ph, %for.body48.preheader184 ]
%arrayidx50 = getelementptr inbounds [600 x i32], ptr %cplayer, i64 0, i64 %indvars.iv148
%76 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%cmp51 = icmp eq i32 %76, 1
br i1 %cmp51, label %if.then52, label %for.inc56
if.then52: ; preds = %for.body48
%arrayidx54 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %indvars.iv148
store i32 0, ptr %arrayidx54, align 4, !tbaa !5
br label %for.inc56
for.inc56: ; preds = %for.body48, %if.then52
%indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
%exitcond152.not = icmp eq i64 %indvars.iv.next149, %wide.trip.count151
br i1 %exitcond152.not, label %for.cond59.preheader, label %for.body48, !llvm.loop !16
for.body61: ; preds = %for.body61.preheader, %for.body61
%i.3122 = phi i32 [ %inc77, %for.body61 ], [ 1, %for.body61.preheader ]
%mul62 = mul nuw nsw i32 %i.3122, 3
%idxprom63 = zext i32 %mul62 to i64
%arrayidx64 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom63
%77 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%add66 = add nuw nsw i32 %mul62, 1
%idxprom67 = zext i32 %add66 to i64
%arrayidx68 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom67
%78 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%add69 = add nsw i32 %78, %77
%add71 = add nuw nsw i32 %mul62, 2
%idxprom72 = zext i32 %add71 to i64
%arrayidx73 = getelementptr inbounds [600 x i32], ptr %player, i64 0, i64 %idxprom72
%79 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%add74 = add nsw i32 %add69, %79
%call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add74)
%inc77 = add nuw nsw i32 %i.3122, 1
%80 = load i32, ptr %n, align 4, !tbaa !5
%cmp60 = icmp slt i32 %inc77, %80
br i1 %cmp60, label %for.body61, label %for.end78, !llvm.loop !17
for.end78: ; preds = %for.body61, %for.body61.preheader, %for.cond59.preheader
call void @llvm.lifetime.end.p0(i64 2400, ptr nonnull %cplayer) #4
call void @llvm.lifetime.end.p0(i64 2400, ptr nonnull %player) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10, !18}
!18 = !{!"llvm.loop.peeled.count", i32 1}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.